Basic functions to initialize GConf and get/set values
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.
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
- key to check.
- why-invalid
- return location for an explanation of the problem, if any.
g-free
the returned string.- ret
#t
if the key is valid, or#f
if not.
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.
- above
- the key on the "left hand side" of the predicate.
- below
- the key on the "right hand side."
- ret
#t
or#f
.
mchars
) (key mchars
) ⇒ (ret mchars
)Concatenates the dir and key passed removing the unnecessary '/' characters and returns the new string.
- dir
- the directory.
- key
- the key.
- ret
- the newly concatenated string.
mchars
)Generates a new and unique key using serial number, process id, current time and a random number generated.
- ret
- a newly created key, a
<gchar>
value.
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.
- arbitrary-text
- some text in any encoding or format
- len
- length of arbitrary-text in bytes, or -1 if arbitrary-text is nul-terminated
- ret
- a nul-terminated valid GConf key
mchars
) (len int
) ⇒ (ret mchars
)Converts a string escaped with
gconf-escape-key
back into its original form.
- escaped-key
- a key created with
gconf-escape-key
- len
- length of escaped-key in bytes, or -1 if escaped-key is nul-terminated
- ret
- the original string that was escaped to create escaped-key