Miscellaneous Utilities
Miscellaneous Utilities
These are portable utility functions.
Application Name and Environment
g_get_application_name()
g_set_application_name()
g_get_prgname()
g_set_prgname()
g_get_environ()
g_environ_getenv()
g_environ_setenv()
g_environ_unsetenv()
g_getenv()
g_setenv()
g_unsetenv()
g_listenv()
g_get_user_name()
g_get_real_name()
System Directories
g_get_user_cache_dir()
g_get_user_data_dir()
g_get_user_config_dir()
g_get_user_state_dir()
g_get_user_runtime_dir()
g_get_user_special_dir()
g_get_system_data_dirs()
g_get_system_config_dirs()
g_reload_user_special_dirs_cache()
OS Info
Information about the current OS can be retrieved by calling
g_get_os_info()
and passing it one of the following keys (this list may
grow in future):
G_OS_INFO_KEY_NAME
G_OS_INFO_KEY_PRETTY_NAME
G_OS_INFO_KEY_VERSION
G_OS_INFO_KEY_VERSION_CODENAME
G_OS_INFO_KEY_VERSION_ID
G_OS_INFO_KEY_ID
G_OS_INFO_KEY_HOME_URL
G_OS_INFO_KEY_DOCUMENTATION_URL
G_OS_INFO_KEY_SUPPORT_URL
G_OS_INFO_KEY_BUG_REPORT_URL
G_OS_INFO_KEY_PRIVACY_POLICY_URL
Paths
g_get_host_name()
g_get_home_dir()
g_get_tmp_dir()
g_get_current_dir()
g_canonicalize_filename()
g_path_is_absolute()
g_path_skip_root()
g_path_get_basename()
g_path_get_dirname()
g_build_filename()
g_build_filenamev()
g_build_filename_valist()
g_build_path()
g_build_pathv()