Gnome Library Reference Manual | |||
---|---|---|---|
<<< Previous Page | Home | Up | Next Page >>> |
gnome-config routines provide a simple way of retrieving and storing configuration values (the routines provide handling of default values to simplify the code).
config path: a string that specifies which item to retrieve from the configuration database. The config path is composed of three elements: the first one is the filename where the information is stored, the second component is the section and the third one is the key inside the section
For example, a config path of "/myapp/toolbox/showit" could be used to retrieve the setting for whether 'myapp' should display its toolbox or not. In this example "myapp" is the file name (which is stored in ~/.gnome directory), "toolbox" is the section and "showit" is the key.
If you want to access an absolute file instead of a ~/.gnome-relative file, then you need to surround the filename with equal signs, for example, to access the key "mykey" from the section "mysection" in a configuration file located in /gnome/var/myconfig you need to use this path: "=/gnome/var/myconfig=/mysection/mykey".
default: when retrieving a config item, specifies the value to be used if the item is not found.
private configuration data - Normally, config item data is located in files under the ~user/.gnome directory in a .ini-like format. These files are world-readable. Items that have security or privacy implications are stored and retrieved using the "private" versions of the gnome-config routines, and the data for these items is stored in files under the ~user/.gnome_private directory, which is not accessable by anyone except that user and the system administrator.
"translated" strings - GNOME's multilingual
support means that multiple languages must be supported for
configuration items. The
gnome_config_*
"section" - a group of config items and other config sections
Gnome has a versatile method of storing config items. When a config item is written by a program, it is written to a file under the ~/.gnome heirachy. However, when config items are read, the process is a little more complicated. There are a number of places that are searched. If the config item is not found in one, then the next place is checked, finally falling back to the default value provided by the application. The locations are as follows:
$(sysconfdir)/gnome/config-override - a system administrator would put config items in this directory that they don't want to be configurable.
~/.gnome - this is where the user's config items are written to and is the next place that is searched
$(sysconfdir)/gnome/config - this directory would hold system wide default configuration values.
Possible uses for this are setting system wide defaults such as proxy servers for system (either using config-override to enforce such a policy or the config directory to suggest such a default). It is also possible to configure the application through its graphical interface, and then copy the configuration file accross to the appropriate system wide directory. The use of the config-override directory should be used sparingly, as it could annoy or confuse some users. Note also that some applications will not read the config items every time they are needed, so putting defaults into the config-override directory will not always completely enforce a setting.
There are two types of routines
FIXME: Finish this. Explain the different types of routines, explain the _private versions, explain the vector use, etc
Retrieves & returns the value of a configuration item as a string.
The returned value should be
path : | A gnome configuration path to an item. |
def : | A pointer to a flag that will be set if the default value for the item is returned. |
Retrieves & returns the value of a configuration item as a string appropriate for the current language. The returned value should be
path : | A gnome configuration path to an item. |
def : | A pointer to a flag that will be set if the default value for the item is returned. |
Retrieves & returns the value of a configuration item as an integer.
path : | A gnome configuration path to an item. |
def : | A pointer to a flag that will be set if the default value for the item is returned. |
Retrieves & returns the value of a configuration item as a floating-point number.
path : | A gnome configuration path to an item. |
def : | A pointer to a flag that will be set if the default value for the item is returned. |
Retrieves & returns the value of a configuration item as a boolean.
path : | A gnome configuration path to an item. |
def : | A pointer to a flag that will be set if the default value for the item is returned. |
Retrieves & returns the value of a configuration item as a string array.
The returned value should be
path : | A gnome configuration path to an item. |
argcp : | Number of elements in the vector |
argvp : | Vector of strings |
def : | A pointer to a flag that will be set if the default value for the item is returned. |
Retrieves & returns the value of a configuration item as a string.
The returned value should be
path : | A gnome configuration path to an item in the user-private namespace. |
def : | A pointer to a flag that will be set if the default value for the item is returned. |
Retrieves & returns the value of a configuration item as a string appropriate for the current language. The returned value should be
path : | A gnome configuration path to an item in the user-private namespace. |
def : | A pointer to a flag that will be set if the default value for the item is returned. |
Retrieves & returns the value of a configuration item as an integer. The item is retrieved from the user's private configuration storage area.
path : | A gnome configuration path to an item in the user-private namespace. |
def : | A pointer to a flag that will be set if the default value for the item is returned. |
Retrieves & returns the value of a configuration item as a floating-point number. The item is retrieved from the user's private configuration storage area.
path : | A gnome configuration path to an item in the user-private namespace. |
def : | A pointer to a flag that will be set if the default value for the item is returned. |
Retrieves & returns the value of a configuration item as a boolean. The item is retrieved from the user's private configuration storage area.
path : | A gnome configuration path to an item in the user-private namespace. |
def : | A pointer to a flag that will be set if the default value for the item is returned. |
Retrieves & returns the value of a configuration item as a string array.
The returned value should be
path : | A gnome configuration path to an item in the user-private namespace. |
argcp : | Number of elements in the vector |
argvp : | Vector of strings |
def : | A pointer to a flag that will be set if the default value for the item is returned. |
Retrieves & returns the value of a configuration item as a string.
The returned value should be
path : | A gnome configuration path to an item. |
Retrieves & returns the value of a configuration item as a string
appropriate for the current language. The returned value should be
path : | A gnome configuration path to an item. |
Retrieves & returns the value of a configuration item as an integer.
path : | A gnome configuration path to an item. |
Retrieves & returns the value of a configuration item as a floating-point number.
path : | A gnome configuration path to an item. |
Retrieves & returns the value of a configuration item as a boolean.
path : | A gnome configuration path to an item. |
Retrieves & returns the value of a configuration item as a string array.
The returned value should be
path : | A gnome configuration path to an item. |
argcp : | Number of elements in the vector |
argvp : | Vector of strings |
Retrieves & returns the value of a configuration item as a
string. The returned value should be
path : | A gnome configuration path to an item in the user-private namespace. |
Retrieves & returns the value of a configuration item as a string appropriate for the current language. The returned value should be
path : | A gnome configuration path to an item in the user-private namespace. |
Retrieves & returns the value of a configuration item as an integer. The item is retrieved from the user's private configuration storage area.
path : | A gnome configuration path to an item in the user-private namespace. |
Retrieves & returns the value of a configuration item as a floating-point number. The item is retrieved from the user's private configuration storage area.
path : | A gnome configuration path to an item in the user-private namespace. |
Retrieves & returns the value of a configuration item as a boolean. The item is retrieved from the user's private configuration storage area.
path : | A gnome configuration path to an item in the user-private namespace. |
Retrieves & returns the value of a configuration item as a
string. The returned value should be
path : | A gnome configuration path to an item in the user-private namespace. |
argcp : | Number of elements in the vector |
argvp : | Vector of strings |
Stores the string value new_value in the file/section/key defined by the path
path : | a gnome configuration path to a key |
new_value : | a string value to set. |
Stores the string value new_value in the file/section/key defined by the path on the proper section for the current language set by by the user.
path : | a gnome configuration path to a key |
value : | a string value to set. |
Stores the integer value new_value in the file/section/key defined by the path
path : | a gnome configuration path to a key |
new_value : | a int value to set. |
Stores the double value new_value in the file/section/key defined by the path
path : | a gnome configuration path to a key |
new_value : | a double value to set. |
Stores boolean value new_value in the file/section/key defined by path.
path : | a gnome configuration path to a key |
new_value : | a boolean value to set |
Stores vector argv in the file/section/key defined by path.
path : | a gnome configuration path to a key |
argc : | the number of elements in argv |
argv : | a string array holding the data to store. |
path : | |
new_value : |
path : | |
new_value : |
path : | |
new_value : |
path : | |
argc : | |
argv : |
Queries the gnome configuration file for the presence of the section specified in path.
path : | A gnome configuration path to a section |
Queries the private gnome configuration file for the presence of the section specified in path.
Path : | A gnome configuration path to a section |
Creates an iterator handle that can be used to iterate over the keys in a section in a gnome configuration file. path must refer to a section. The returned value can be used as an iterator for #gnome_config_iterator_next().
path : | A gnome configuration path for a section. |
Creates an iterator handle that can be used to iterate over the keys in a section in a private gnome configuration file. path must refer to a section. The returned value can be used as an iterator for #gnome_config_iterator_next().
path : | A gnome configuration path for a section. |
Creates an iterator handle that can be used to iterate over the sections in a gnome configuration file. path must refer to a gnome configuration file. The returned value can be used as an iterator for #gnome_config_iterator_next().
path : | A gnome configuration path for a file. |
Creates an iterator handle that can be used to iterate over the sections in a private gnome configuration file. path must refer to a gnome configuration file. The returned value can be used as an iterator for #gnome_config_iterator_next().
path : | A gnome configuration path for a file |
iterator_handle : | A gnome configu iterator handle, returned from any iteration start routine or this routine. |
key : | Address where the key gets stored. |
value : | Address where the value gets stored. |
Drops any information cached in memory that was fetched with gnome config. Any pending information that has not been written to disk is discarded.
Writes all of the information modified by gnome-config to the disk.
Note: the gnome_config code does not write anything to the configuration files until this routine is actually invoked.
Writes all of the information modified by gnome-config to the disk for the given file.
Note: the gnome_config code does not write anything to the configuration files until this routine or gnome_config_sync is actually invoked.
path : | A gnome-config path |
Writes all of the information modified by gnome-config to the disk for the given private file.
Note: the gnome_config code does not write anything to the configuration files until this routine or gnome_config_sync is actually invoked.
path : | A gnome-config path |
Releases any memory resources that were allocated from accessing the configuration file in path. Changes will take place after gnome_config_sync has been invoked
path : | A gnome-config path |
Releases any memory resources that were allocated from accessing the private configuration file in path.
path : | A gnome-config path |
Cleans up the configuration file specified by path from any configuration information.
Changes will take place after gnome_config_sync has been invoked.
path : | A gnome-config path |
Cleans up the private configuration file specified by path from any configuration information.
Changes will take place after gnome_config_sync has been invoked.
path : | A gnome-config path |
Cleans up the section specified by path from any configuration information. Changes will only take place after gnome_config_sync has been invoked.
path : | a gnome configuration path to a section. |
Cleans up the section specified by path in a private file from any configuration information. Changes will only take place after gnome_config_sync has been invoked.
Path : | a gnome configuration path to a section. |
Removes the definition for the key on a gnome configuration file.
Changes will take place after gnome_config_sync has been invoked.
path : | a gnome configuration path to a key. |
Removes the definition for the key on a private gnome configuration file.
Changes will take place after gnome_config_sync has been invoked.
path : | a gnome configuration path to a key. |
path is a prefix that will be prepended automatically to any non-absolute configuration path in gnome config.
This is used to simplify application loading code.
Library code will usually have to set the prefix before doing any gnome-configuration access, since the application might be using their own prefix.
path : | a gnome configuration path prefix |
Call this routine to remove the current configuration prefix from the stack.
Creates a new vector from a string as it stored in the config file, breaks the string on spaces except if the space is escaped with a backslash.
string : | The stringified vector to decode into 'argcp' and 'argvp' |
argcp : | Returns the number of elements in 'argvp' |
argvp : | Returns the array of strings found in 'rr'. |
This routine returns the the strings in the array contactenated by spaces.
argc : | Number of elements in the argv string array. |
argv : | An array of strings. |
Returns : | a |
Internal Obsolete.
func : | Obsolete |
data : | Obsolete |