Miscellaneous Utility Functions

Miscellaneous Utility Functions — a selection of portable utility functions.

Synopsis


#include <glib.h>


const gchar* g_get_application_name         (void);
void        g_set_application_name          (const gchar *application_name);
gchar*      g_get_prgname                   (void);
void        g_set_prgname                   (const gchar *prgname);
const gchar* g_getenv                       (const gchar *variable);
gboolean    g_setenv                        (const gchar *variable,
                                             const gchar *value,
                                             gboolean overwrite);
void        g_unsetenv                      (const gchar *variable);
gchar**     g_listenv                       (void);
const gchar* g_get_user_name                (void);
const gchar* g_get_real_name                (void);
const gchar* g_get_user_cache_dir           (void);
const gchar* g_get_user_data_dir            (void);
const gchar* g_get_user_config_dir          (void);
const gchar* const * g_get_system_data_dirs (void);
const gchar* const * g_get_system_config_dirs
                                            (void);

const gchar* g_get_host_name                (void);
const gchar* g_get_home_dir                 (void);
const gchar* g_get_tmp_dir                  (void);
gchar*      g_get_current_dir               (void);
const gchar* g_basename                     (const gchar *file_name);
#define     g_dirname
gboolean    g_path_is_absolute              (const gchar *file_name);
const gchar* g_path_skip_root               (const gchar *file_name);
gchar*      g_path_get_basename             (const gchar *file_name);
gchar*      g_path_get_dirname              (const gchar *file_name);
gchar*      g_build_filename                (const gchar *first_element,
                                             ...);
gchar*      g_build_filenamev               (gchar **args);
gchar*      g_build_path                    (const gchar *separator,
                                             const gchar *first_element,
                                             ...);
gchar*      g_build_pathv                   (const gchar *separator,
                                             gchar **args);

gchar*      g_find_program_in_path          (const gchar *program);

gint        g_bit_nth_lsf                   (gulong mask,
                                             gint nth_bit);
gint        g_bit_nth_msf                   (gulong mask,
                                             gint nth_bit);
guint       g_bit_storage                   (gulong number);

guint       g_spaced_primes_closest         (guint num);

void        g_atexit                        (GVoidFunc func);

guint       g_parse_debug_string            (const gchar *string,
                                             const GDebugKey *keys,
                                             guint nkeys);
            GDebugKey;

void        (*GVoidFunc)                    (void);
void        (*GFreeFunc)                    (gpointer data);

void        g_qsort_with_data               (gconstpointer pbase,
                                             gint total_elems,
                                             gsize size,
                                             GCompareDataFunc compare_func,
                                             gpointer user_data);

void        g_nullify_pointer               (gpointer *nullify_location);

Description

These are portable utility functions.

Details

g_get_application_name ()

const gchar* g_get_application_name         (void);

Gets a human-readable name for the application, as set by g_set_application_name(). This name should be localized if possible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the user. Contrast with sible, and is intended for display to the