Next: , Previous: GConfClient, Up: Top

3 GConf Core Interfaces

Basic functions to initialize GConf and get/set values

3.1 Overview

These functions initialize GConf, and communicate with the server via a <g-conf-engine> object. You can install a notification request on the server, get values, set values, list directories, and associate schema names with keys.

Most of this interface is replicated in the <gobject> wrapper (<g-conf-client> object); an alternative to the value-setting functions is the <g-conf-change-set> interface.

3.2 Usage

— Function: gconf-valid-key (key mchars) ⇒  (ret bool) (why_invalid mchars)

Asks whether a key is syntactically correct, that is, it ensures that the key consists of slash-separated strings and contains only legal characters. Normally you shouldn't need to call this function; the GConf functions all check this for you and return an error if the key is invalid. However, it may be useful to validate input to an entry field or the like. If you pass a non-#f address as the why-invalid argument, an allocated string is returned explaining why the key is invalid, if it is. If the key is valid the why-invalid argument is unused.

key to check.
return location for an explanation of the problem, if any. g-free the returned string.
#t if the key is valid, or #f if not.
— Function: gconf-key-is-below (above mchars) (below mchars) ⇒  (ret bool)

Asks whether the key below would be found below the key above, were they both to exist in the database. For example, /foo is always found below / and above /foo/bar. This probably isn't useful but GConf uses it internally so here it is if you need it.

the key on the "left hand side" of the predicate.
the key on the "right hand side."
#t or #f.
— Function: gconf-concat-dir-and-key (dir mchars) (key mchars) ⇒  (ret mchars)

Concatenates the dir and key passed removing the unnecessary '/' characters and returns the new string.

the directory.
the key.
the newly concatenated string.
— Function: gconf-unique-key ⇒  (ret mchars)

Generates a new and unique key using serial number, process id, current time and a random number generated.

a newly created key, a <gchar> value.
— Function: gconf-escape-key (arbitrary_text mchars) (len int) ⇒  (ret mchars)

Escape arbitrary-text such that it's a valid key element (i.e. one part of the key path). The escaped key won't pass gconf-valid-key because it isn't a whole key (i.e. it doesn't have a preceding slash), but prepending a slash to the escaped text should always result in a valid key.

some text in any encoding or format
length of arbitrary-text in bytes, or -1 if arbitrary-text is nul-terminated
a nul-terminated valid GConf key
— Function: gconf-unescape-key (escaped_key mchars) (len int) ⇒  (ret mchars)

Converts a string escaped with gconf-escape-key back into its original form.

a key created with gconf-escape-key
length of escaped-key in bytes, or -1 if escaped-key is nul-terminated
the original string that was escaped to create escaped-key