![]() |
![]() |
![]() |
libgebr Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
gboolean g_key_file_has_key_woe (GKeyFile *key_file
,const gchar *group
,const gchar *key
); int g_strcmp0 (const char *str1
,const char *str2
); gboolean gebr_append_filename_extension (GString *filename
,const gchar *extension
); gchar * gebr_calculate_detailed_relative_time (GTimeVal *time1
,GTimeVal *time2
); gint gebr_calculate_number_of_processors (gint total_nprocs
,gint aggressive
); gchar * gebr_calculate_relative_time (GTimeVal *time1
,GTimeVal *time2
); gboolean gebr_create_config_dirs (void
); gchar * gebr_date_get_localized (const gchar *format
,const gchar *locale
); gboolean gebr_dir_has_files (const gchar *dir_path
); #define gebr_directory_foreach_file (filename, directory) #define gebr_directory_foreach_file_hyg (filename, directory, hygid) #define gebr_foreach_gslist (element, list) #define gebr_foreach_gslist_hyg (element, list, hygid) gboolean gebr_g_key_file_has_key (GKeyFile *key_file
,const gchar *group
,const gchar *key
); 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
); 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_remove_key (GKeyFile *key_file
,const gchar *group
,const gchar *key
); gboolean gebr_g_string_ends_with (GString *string
,const gchar *val
); void gebr_g_string_replace (GString *string
,const gchar *oldtext
,const gchar *newtext
); 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
); #define gebr_glist_foreach (element, list) #define gebr_glist_foreach_hyg (element, list, hygid) int gebr_home_mode (void
); gchar * gebr_id_random_create (gssize bytes
); gchar * gebr_locale_to_utf8 (const gchar *string
); gchar * gebr_lock_file (const gchar *pathname
,const gchar *new_lock_content
,gboolean symlink
); GString * gebr_make_temp_filename (const gchar *template
); GString * gebr_make_unique_filename (const gchar *template
); gboolean gebr_path_is_at_home (const gchar *path
); gboolean gebr_path_resolve_home_variable (GString *path
); void gebr_path_set_to (GString *path
,gboolean relative
); gboolean gebr_path_use_home_variable (GString *path
); gboolean gebr_realpath_equal (const gchar *path1
,const gchar *path2
); gboolean gebr_str_canonical_var_name (const gchar *keyword
,gchar **new_value
,GError **error
); gchar * gebr_str_escape (const gchar *str
); gchar * gebr_str_remove_trailing_zeros (gchar *str
); gchar * gebr_str_word_before_pos (const gchar *str
,gint *pos
); gint gebr_system (const gchar *cmd
,...
); GString * gebr_temp_directory_create (void
); void gebr_temp_directory_destroy (GString *path
); gboolean gebr_utf8_is_asc_alnum (const gchar *str
); gchar * gebr_utf8_strstr (const gchar *haystack
,const gchar *needle
); const gchar * gebr_validate_float (const gchar *text_value
,const gchar *min
,const gchar *max
); const gchar * gebr_validate_int (const gchar *text_value
,const gchar *min
,const gchar *max
);
gboolean g_key_file_has_key_woe (GKeyFile *key_file
,const gchar *group
,const gchar *key
);
gboolean gebr_append_filename_extension (GString *filename
,const gchar *extension
);
gchar * gebr_calculate_detailed_relative_time (GTimeVal *time1
,GTimeVal *time2
);
gint gebr_calculate_number_of_processors (gint total_nprocs
,gint aggressive
);
Calculate real number of processors will be used
|
Number of processors of a server |
|
Aggressive percentage (slider) |
gchar * gebr_calculate_relative_time (GTimeVal *time1
,GTimeVal *time2
);
|
The first date to compare |
|
The second date to compare |
Returns : |
A message (string) of the relative time and NULL if time2 is older than time1. |
gchar * gebr_date_get_localized (const gchar *format
,const gchar *locale
);
#define gebr_directory_foreach_file_hyg(filename, directory, hygid)
gboolean gebr_g_key_file_has_key (GKeyFile *key_file
,const gchar *group
,const gchar *key
);
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
);
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_remove_key (GKeyFile *key_file
,const gchar *group
,const gchar *key
);
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.
|
The string to with the text. |
|
The text to be replaced. |
|
The text to replace oldtext. |
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
);
gchar * gebr_lock_file (const gchar *pathname
,const gchar *new_lock_content
,gboolean symlink
);
gboolean gebr_realpath_equal (const gchar *path1
,const gchar *path2
);
Compares if path1 and path2 resolves to the same file.
The paths compared for equality by calling g_stat()
on both of them
and comparing their inode parameters are the same.
|
the first path |
|
the second path |
Returns : |
TRUE if path1 points to the same file/directory as path2 .
FALSE otherwise, including if one or both of then does not exists in the file system. |
gboolean gebr_str_canonical_var_name (const gchar *keyword
,gchar **new_value
,GError **error
);
|
The keyword to be canonized. (not modified) |
|
Returns a new alocated string with the canonized value of keyword. |
|
A GError (not used until now) |
Returns : |
TRUE if everthing is ok. False otherwise. |
gchar * gebr_str_escape (const gchar *str
);
Escapes all backslashes and quotes in a string. It is based on glib's g_strescape.
|
the string to be escaped |
Returns : |
a newly allocated string. |
gchar * gebr_str_remove_trailing_zeros (gchar *str
);
Modifies str
inplace by removing trailing zeros.
Returns : |
The same str , but modified. |
gboolean gebr_utf8_is_asc_alnum (const gchar *str
);
|
The string to check |
Returns : |
TRUE if str is ASC and alpha-numerical. |
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.
const gchar * gebr_validate_float (const gchar *text_value
,const gchar *min
,const gchar *max
);