| gumd API Reference Manual | ||||
|---|---|---|---|---|
| Top | Description | Object Hierarchy | ||||
#include <gum/common/gum-config.h> #define GUM_UMASK struct GumConfig; struct GumConfigClass; gint gum_config_get_int (GumConfig *self,const gchar *key,gint retval); const gchar * gum_config_get_string (GumConfig *self,const gchar *key); guint gum_config_get_uint (GumConfig *self,const gchar *key,guint retval); GumConfig * gum_config_new (); void gum_config_set_int (GumConfig *self,const gchar *key,gint value); void gum_config_set_string (GumConfig *self,const gchar *key,const gchar *value); void gum_config_set_uint (GumConfig *self,const gchar *key,guint value);
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 (); 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 file
#define GUM_UMASK 022
Value used to set the mode of home directories created for new users.
struct GumConfigClass {
GObjectClass parent_class;
};
Opaque structure for the class.
GObjectClass |
parent class object |
gint gum_config_get_int (GumConfig *self,const gchar *key,gint retval);
Get an integer configuration value.
|
an instance of GumConfig. [transfer none] |
|
the key name |
|
value to be returned in case key is not found |
Returns : |
the value corresponding to the key as an integer. If the key does not exist or cannot be converted to the integer, retval is returned. |
const gchar * gum_config_get_string (GumConfig *self,const gchar *key);
Get a string configuration value.
|
an instance of GumConfig. [transfer none] |
|
the key name. [transfer none] |
Returns : |
the value corresponding to the key as an string. If the key does not exist or cannot be converted to the integer, NULL is returned. |
guint gum_config_get_uint (GumConfig *self,const gchar *key,guint retval);
Get an unsigned integer configuration value.
|
an instance of GumConfig. [transfer none] |
|
the key name |
|
value to be returned in case key is not found |
Returns : |
the value corresponding to the key as an unsigned integer. If the key does not exist or cannot be converted to the integer, retval is returned. |
GumConfig * gum_config_new ();
Create a GumConfig object.
Returns : |
an instance of GumConfig. |
void gum_config_set_int (GumConfig *self,const gchar *key,gint value);
Sets the configuration value to the provided integer.
|
an instance of GumConfig. [transfer none] |
|
the key name |
|
the value |
void gum_config_set_string (GumConfig *self,const gchar *key,const gchar *value);
Sets the configuration value to the provided string.
|
an instance of GumConfig. [transfer none] |
|
the key name. [transfer none] |
|
the value. [transfer none] |