util

util

Functions

Description

Functions

util_get_number_of_cpus ()

guint
util_get_number_of_cpus (void);

split_string_from_file_on_equals ()

gboolean
split_string_from_file_on_equals (const gchar *buf,
                                  gchar **key,
                                  gchar **val);

buf : the input string key : newly allocated string that is before the '=' val : newly allocated string after the '='

Designed for file line processing, so it ignores strings beginning with special characters, such as '#'; returns false in such situations. Also returns false if no equals character is found

e.g. if buf = "GPS.parameter=42" key = "GPS.parameter" val = "42"


util_add_to_deletion_list ()

void
util_add_to_deletion_list (const gchar *filename);

Add a name of a file into the list that is to be deleted on program exit Normally this is for files that get used asynchronously, so we don't know when it's time to delete them - other than at this program's end


util_remove_all_in_deletion_list ()

void
util_remove_all_in_deletion_list (void);

Delete all the files in the deletion list This should only be called on program exit


util_str_remove_chars ()

gchar *
util_str_remove_chars (gchar *string,
                       const gchar *chars);

EMPTY()

#define             EMPTY(ptr)

foreach_list()

#define             foreach_list(node, list)

foreach_slist()

#define             foreach_slist(node, list)

foreach_str()

#define             foreach_str(char_ptr, string)

util_remove ()

int
util_remove (const gchar *filename);