| Top |
| GumConfig * | gum_config_new () |
| gchar * | gum_config_prepend_sysroot () |
| gint | gum_config_get_int () |
| void | gum_config_set_int () |
| guint | gum_config_get_uint () |
| void | gum_config_set_uint () |
| const gchar * | gum_config_get_string () |
| void | gum_config_set_string () |
GumConfig holds configuration information as a set of keys and values (integer or strings). The key names are defined in
General config keys,and DBus config keys.
The configuration is retrieved from the gum configuration file. See below for where the file is searched for.
Following code snippet demonstrates how to create and use config object:
GumConfig* config = gum_config_new (sysroot_path); const gchar *str = gum_config_get_string (config, GUM_CONFIG_GENERAL_SKEL_DIR, 0); g_object_unref(config);
If gum has been compiled with --enable-debug, then these locations are used, in decreasing order of priority:
UM_CONF_FILE environment variable
g_get_user_config_dir() + "gum.conf"
each of g_get_system_config_dirs() + "gum.conf"
Otherwise, the config file location is determined at compilation time as $(sysconfdir) + "gum.conf"
See example configuration file here:
gum configuration fileGumConfig *
gum_config_new (const gchar *sysroot);
Create a singleton GumConfig object, which means 'sysroot' has to be passed on in the first call to this function.
gchar * gum_config_prepend_sysroot (GumConfig *self,const gchar *string);
Prepends the sysroot path to the end of the 'string'. If sysroot is NULL or empty, then 'string' is duplicated and returned.
gint gum_config_get_int (GumConfig *self,const gchar *key,gint retval);
Get an integer configuration value.
self |
an instance of GumConfig. |
[transfer none] |
key |
the key name |
|
retval |
value to be returned in case key is not found |
void gum_config_set_int (GumConfig *self,const gchar *key,gint value);
Sets the configuration value to the provided integer.
guint gum_config_get_uint (GumConfig *self,const gchar *key,guint retval);
Get an unsigned integer configuration value.
self |
an instance of GumConfig. |
[transfer none] |
key |
the key name |
|
retval |
value to be returned in case key is not found |
void gum_config_set_uint (GumConfig *self,const gchar *key,guint value);
Sets the configuration value to the provided unsigned integer.
const gchar * gum_config_get_string (GumConfig *self,const gchar *key);
Get a string configuration value.
“sysroot” property“sysroot” gchar *
This property holds the shell path of the user. Shell path should not contain any control chars (0x00-0x1F,0x7F), comma (',' 0x2c) or colon (':' 0x3A). For new user, it is recommended to let the underlying framework to set the home directory of the user based on the configuration.
Flags: Read / Write / Construct Only
Default value: NULL