Top | Description | Object Hierarchy |
#include <gsignond/gsignond-config.h> struct GSignondConfig; struct GSignondConfigClass; gint gsignond_config_get_integer (GSignondConfig *self
,const gchar *key
); const gchar * gsignond_config_get_string (GSignondConfig *self
,const gchar *key
); GSignondConfig * gsignond_config_new (); void gsignond_config_set_integer (GSignondConfig *self
,const gchar *key
,gint value
); void gsignond_config_set_string (GSignondConfig *self
,const gchar *key
,const gchar *value
);
GSignondConfig holds configuration information as a set of keys and values (integer or strings). The key names are defined in general config keys, database config keys, and DBus config keys.
The configuration is discovered from these sources, in decreasing order of priority:
environment variables, if gSSO has been compiled with --enable-debug switch. See the specific keys documentation for the variable names.
gSSO configuration file. See below for where the file is searched for.
default values. See the documentation for specific keys for those.
If gSSO has been compiled with --enable-debug, then these locations are used, in decreasing order of priority:
GSIGNOND_CONFIG environment variable
g_get_user_config_dir()
+ "gsignond/gsignond.conf"
each of g_get_system_config_dirs()
+ "gsignond/gsignond.conf"
Otherwise, the config file location is determined at compilation time as $(sysconfdir) + "gsignond/gsignond.conf"
See example configuration file here: http://code.google.com/p/accounts-sso/source/browse/gsignond.conf?repo=gsignond
gint gsignond_config_get_integer (GSignondConfig *self
,const gchar *key
);
Get an integer configuration value.
|
an instance of GSignondConfig |
|
the key name |
Returns : |
the value corresponding to the key as an integer. If the key does not exist or cannot be converted to the integer, 0 is returned. |
const gchar * gsignond_config_get_string (GSignondConfig *self
,const gchar *key
);
Get a string configuration value.
|
an instance of GSignondConfig |
|
the key name |
Returns : |
the value corresponding to the key as string. If the key does not exist, NULL is returned. [transfer none] |
GSignondConfig * gsignond_config_new ();
Create a GSignondConfig object.
Returns : |
an instance of GSignondConfig. gSSO extensions should not use this as they're already provided with a config object when they're created. |
void gsignond_config_set_integer (GSignondConfig *self
,const gchar *key
,gint value
);
Sets the configuration value to the provided integer.
|
an instance of GSignondConfig |
|
the key name |
|
the value |
void gsignond_config_set_string (GSignondConfig *self
,const gchar *key
,const gchar *value
);
Sets the configuration value to the provided string.
|
an instance of GSignondConfig |
|
the key name |
|
the value. [transfer none] |