Top | ![]() |
![]() |
![]() |
![]() |
gchar *
gebr_g_string_remove_accents (gchar *title
);
Replace accented characters on a string to non accented characters. If character is non ASCII, it is replaced to ""
void gebr_g_string_replace (GString *string
,const gchar *oldtext
,const gchar *newtext
);
Replace each reference of oldtext in string with newtext. If newtext if NULL, then each reference of oldtext found is removed.
void gebr_g_string_replace_first_ref (GString *string
,const gchar *oldtext
,const gchar *newtext
);
gboolean gebr_g_string_starts_with (GString *string
,const gchar *val
);
gboolean gebr_append_filename_extension (GString *filename
,const gchar *extension
);
gboolean g_key_file_has_key_woe (GKeyFile *key_file
,const gchar *group
,const gchar *key
);
GString * gebr_g_key_file_load_string_key (GKeyFile *key_file
,const gchar *group
,const gchar *key
,const gchar *default_value
);
gboolean gebr_g_key_file_load_boolean_key (GKeyFile *key_file
,const gchar *group
,const gchar *key
,gboolean default_value
);
int gebr_g_key_file_load_int_key (GKeyFile *key_file
,const gchar *group
,const gchar *key
,int default_value
);
gboolean gebr_g_key_file_has_key (GKeyFile *key_file
,const gchar *group
,const gchar *key
);
gboolean gebr_g_key_file_remove_key (GKeyFile *key_file
,const gchar *group
,const gchar *key
);
#define gebr_directory_foreach_file_hyg(filename, directory, hygid)
const gchar * gebr_validate_int (const gchar *text_value
,const gchar *min
,const gchar *max
);
const gchar * gebr_validate_float (const gchar *text_value
,const gchar *min
,const gchar *max
);
gboolean gebr_realpath_equal (const gchar *path1
,const gchar *path2
);
Compares if path1
and path2
resolves to the same file. The equality is
decided by calling g_stat()
on both of them and comparing their inode ids.
gchar *
gebr_str_escape (const gchar *str
);
Escapes all backslashes and quotes in a string. It is based on glib's g_strescape.
gchar * gebr_date_get_localized (const gchar *format
,const gchar *locale
);
gchar * gebr_lock_file (const gchar *path
,const gchar *content
);
If content
is NULL
, returns the content of path
. Otherwise, content
is
written in path
in a safe way.
gchar *
gebr_str_remove_trailing_zeros (gchar *str
);
Modifies str
inplace by removing trailing zeros.
gboolean gebr_str_canonical_var_name (const gchar *keyword
,gchar **new_value
,GError **error
);
gchar * gebr_calculate_relative_time (GTimeVal *time1
,GTimeVal *time2
,TimesType *type
,gdouble *delta
);
gchar * gebr_calculate_detailed_relative_time (GTimeVal *time1
,GTimeVal *time2
);
gchar * gebr_compute_diff_iso_times (const gchar *iso_time1
,const gchar *iso_time2
);
gchar * gebr_utf8_strstr (const gchar *haystack
,const gchar *needle
);
Searches for needle
in haystack
and returns a pointer to the begging of
the substring or NULL
if it was not found.
gint gebr_calculate_number_of_processors (gint total_nprocs
,gdouble aggressive
);
Calculate real number of processors will be used
gchar * gebr_remove_path_prefix (const gchar *prefix
,const gchar *path
);
Remove prefix
from path
gchar *
gebr_relativise_old_home_path (const gchar *path_string
);
Change $HOME of path_string
to <HOME>
gchar * gebr_relativise_home_path (const gchar *path_string
,const gchar *mount_point
,const gchar *home
);
Substitute home
with the prefix HOME
pvector
is a vector of pair of strings, the first entry is an
alias and the second is an absolute path.
gchar * gebr_relativise_path (const gchar *path_string
,const gchar *mount_point
,gchar ***pvector
);
Substitute path
with the longest prefix in pvector
.
pvector
is a vector of pair of strings, the first entry is an
alias and the second is an absolute path.
gchar * gebr_resolve_relative_path (const char *path
,gchar ***pvector
);
Transfors a relative path in absolute path
void gebr_gtk_bookmarks_add_paths (const gchar *filename
,const gchar *uri_prefix
,gchar ***paths
);
Add bookmarks on filename
file with uri_prefix
and base paths set on vector paths
,
and include suffix (GeBR) on name to identify
void gebr_gtk_bookmarks_remove_paths (const gchar *filename
,gchar ***paths
);
Remove bookmarks according paths
for filename
gboolean gebr_validate_path (const gchar *path
,gchar ***paths
,gchar **err_msg
);
gchar *
gebr_get_user_from_address (const gchar *address
);
Get substring before the first @ from address
.
In case there's no @, get the returns the local user.
gchar *
gebr_get_host_from_address (const gchar *address
);
Get substring after the first @ and before the first space In case there's no @, get the substring before the first space
gboolean
gebr_verify_address_without_username (const gchar *address
);
gboolean gebr_gzfile_get_contents (const gchar *filename
,GString *contents
,gchar **error
);
void
gebr_string_freeall (GString *string
);
Equivalent to calling g_string_free(string, TRUE).
GQueue * gebr_gqueue_push_tail_avoiding_duplicates (GQueue *queue
,const gchar *data
);
const gchar * gebr_paths_get_value_by_key (const gchar ***paths
,const gchar *key
);
void
GEBR_LOCK_FILE (const gchar *path
);
Locks the file pointed by path
. You must call GEBR_UNLOCK_FILE()
when done.