GumConfig

GumConfig — gum configuration information

Functions

Types and Values

#define GUM_UMASK

Object Hierarchy

    GObject
    ╰── GumConfig

Includes

#include <gum/common/gum-config.h>

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

Functions

gum_config_new ()

GumConfig *
gum_config_new ();

Create a GumConfig object.

Returns

an instance of GumConfig.


gum_config_get_int ()

gint
gum_config_get_int (GumConfig *self,
                    const gchar *key,
                    gint retval);

Get an integer configuration value.

Parameters

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_set_int ()

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

Sets the configuration value to the provided integer.

Parameters

self

an instance of GumConfig.

[transfer none]

key

the key name

 

value

the value

 

gum_config_get_uint ()

guint
gum_config_get_uint (GumConfig *self,
                     const gchar *key,
                     guint retval);

Get an unsigned integer configuration value.

Parameters

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_set_uint ()

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

Sets the configuration value to the provided unsigned integer.

Parameters

self

an instance of GumConfig.

[transfer none]

key

the key name

 

value

the value

 

gum_config_get_string ()

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

Get a string configuration value.

Parameters

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_set_string ()

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

Sets the configuration value to the provided string.

Parameters

self

an instance of GumConfig.

[transfer none]

key

the key name.

[transfer none]

value

the value.

[transfer none]

Types and Values

GUM_UMASK

#define GUM_UMASK  077

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