GumConfig

GumConfig — gum configuration information

Synopsis

#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);

Object Hierarchy

  GObject
   +----GumConfig

Description

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.

Usage

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);

Where the configuration file is searched for

If gum has been compiled with --enable-debug, then these locations are used, in decreasing order of priority:

Otherwise, the config file location is determined at compilation time as $(sysconfdir) + "gum.conf"

Example configuration file

See example configuration file here: gum configuration file

Details

GUM_UMASK

#define GUM_UMASK  022

Value used to set the mode of home directories created for new users.


struct GumConfig

struct GumConfig;

Opaque structure for the object.


struct GumConfigClass

struct GumConfigClass {
    GObjectClass parent_class;
};

Opaque structure for the class.

GObjectClass parent_class;

parent class object

gum_config_get_int ()

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

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.

gum_config_get_string ()

const gchar *       gum_config_get_string               (GumConfig *self,
                                                         const gchar *key);

Get a string configuration value.

self :

an instance of GumConfig. [transfer none]

key :

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.

gum_config_get_uint ()

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

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.

gum_config_new ()

GumConfig *         gum_config_new                      ();

Create a GumConfig object.

Returns :

an instance of GumConfig.

gum_config_set_int ()

void                gum_config_set_int                  (GumConfig *self,
                                                         const gchar *key,
                                                         gint value);

Sets the configuration value to the provided integer.

self :

an instance of GumConfig. [transfer none]

key :

the key name

value :

the value

gum_config_set_string ()

void                gum_config_set_string               (GumConfig *self,
                                                         const gchar *key,
                                                         const gchar *value);

Sets the configuration value to the provided string.

self :

an instance of GumConfig. [transfer none]

key :

the key name. [transfer none]

value :

the value. [transfer none]

gum_config_set_uint ()

void                gum_config_set_uint                 (GumConfig *self,
                                                         const gchar *key,
                                                         guint value);

Sets the configuration value to the provided unsigned integer.

self :

an instance of GumConfig. [transfer none]

key :

the key name

value :

the value