1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132
|
<refentry id="libuser-config">
<refmeta>
<refentrytitle role="top_of_page">config</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>LIBUSER Library</refmiscinfo>
</refmeta>
<refnamediv>
<refname>config</refname>
<refpurpose>Routines for reading configuration information for the libuser library.</refpurpose>
<!--[<xref linkend="desc" endterm="desc.title"/>]-->
</refnamediv>
<refsynopsisdiv role="synopsis">
<title role="synopsis.title">Synopsis</title>
<synopsis>
<link linkend="GList">GList</link>* <link linkend="lu-cfg-read">lu_cfg_read</link> (<link linkend="struct-lu-context">struct lu_context</link> *context,
const <link linkend="char">char</link> *key,
const <link linkend="char">char</link> *default_value);
const <link linkend="char">char</link>* <link linkend="lu-cfg-read-single">lu_cfg_read_single</link> (<link linkend="struct-lu-context">struct lu_context</link> *context,
const <link linkend="char">char</link> *key,
const <link linkend="char">char</link> *default_value);
<link linkend="GList">GList</link>* <link linkend="lu-cfg-read-keys">lu_cfg_read_keys</link> (<link linkend="struct-lu-context">struct lu_context</link> *context,
const <link linkend="char">char</link> *parent_key);
</synopsis>
</refsynopsisdiv>
<refsect1 role="desc">
<title role="desc.title">Description</title>
<para>
These routines allow an application or module to read configuration data
from the libuser configuration.
</para>
</refsect1>
<refsect1 role="details">
<title role="details.title">Details</title>
<refsect2>
<title><anchor id="lu-cfg-read" role="function"/>lu_cfg_read ()</title>
<indexterm><primary>lu_cfg_read</primary></indexterm><programlisting><link linkend="GList">GList</link>* lu_cfg_read (<link linkend="struct-lu-context">struct lu_context</link> *context,
const <link linkend="char">char</link> *key,
const <link linkend="char">char</link> *default_value);</programlisting>
<para>
Reads the list of values for a given key from the configuration space.
</para><variablelist role="params">
<varlistentry><term><parameter>context</parameter> :</term>
<listitem><simpara>A valid libuser library context.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>key</parameter> :</term>
<listitem><simpara>The value to be read from the configuration. The key should be of the
form "section/key" for most purposes. For example, the <link linkend="files"><type>files</type></link> module uses
keys of the form "file/foo" for all of its configuration data.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>default_value</parameter> :</term>
<listitem><simpara>A default value to be returned in case none are found. Can
be NULL.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>A <link linkend="GList"><type>GList</type></link> of values, formatted as strings. The list must be freed
by calling <link linkend="g-list-free"><function>g_list_free()</function></link>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="lu-cfg-read-single" role="function"/>lu_cfg_read_single ()</title>
<indexterm><primary>lu_cfg_read_single</primary></indexterm><programlisting>const <link linkend="char">char</link>* lu_cfg_read_single (<link linkend="struct-lu-context">struct lu_context</link> *context,
const <link linkend="char">char</link> *key,
const <link linkend="char">char</link> *default_value);</programlisting>
<para>
Read a single value set for a given key in the configuration space. This is
a convenience function.
</para><variablelist role="params">
<varlistentry><term><parameter>context</parameter> :</term>
<listitem><simpara>A valid libuser library context.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>key</parameter> :</term>
<listitem><simpara>The value to be read from the configuration. The key should be of the
form "section/key" for most purposes. For example, the <link linkend="files"><type>files</type></link> module uses
keys of the form "file/foo" for all of its configuration data.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>default_value</parameter> :</term>
<listitem><simpara>A default value to be returned in case none are found. Can
be NULL.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>A string representation of one of the values set for the key. This
string must not be freed.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2>
<title><anchor id="lu-cfg-read-keys" role="function"/>lu_cfg_read_keys ()</title>
<indexterm><primary>lu_cfg_read_keys</primary></indexterm><programlisting><link linkend="GList">GList</link>* lu_cfg_read_keys (<link linkend="struct-lu-context">struct lu_context</link> *context,
const <link linkend="char">char</link> *parent_key);</programlisting>
<para>
Read the names of all of the keys "below" a given key in the configuration
space. This function is typically used for walking the configuration space.
</para><variablelist role="params">
<varlistentry><term><parameter>context</parameter> :</term>
<listitem><simpara>A valid libuser library context.
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>parent_key</parameter> :</term>
<listitem><simpara>The parent key under which the caller wishes to know which subkeys
are present.
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis> :</term><listitem><simpara>A <link linkend="GList"><type>GList</type></link> of string representations of key names. The list must be
freed using <link linkend="g-list-free"><function>g_list_free()</function></link>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
</refsect1>
<refsect1><refsect2 /><refsect2 /></refsect1>
</refentry>
|