1
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>config</title><meta name="generator" content="DocBook XSL Stylesheets V1.68.1"><link rel="start" href="index.html" title="libuser Reference Manual"><link rel="up" href="ch01.html" title="libuser"><link rel="prev" href="ch01.html" title="libuser"><link rel="next" href="libuser-value.html" title="value"><meta name="generator" content="GTK-Doc V1.3 (XML mode)"><link rel="stylesheet" href="style.css" type="text/css"><link rel="chapter" href="ch01.html" title="libuser"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><table class="navigation" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"><tr valign="middle"><td><a accesskey="p" href="ch01.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td><td><a accesskey="u" href="ch01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td><td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td><th width="100%" align="center">libuser Reference Manual</th><td><a accesskey="n" href="libuser-value.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td></tr></table><div class="refentry" lang="en"><a name="libuser-config"></a><div class="titlepage"></div><div class="refnamediv"><table width="100%"><tr><td valign="top"><h2><span class="refentrytitle">config</span></h2><p>config — Routines for reading configuration information for the libuser library.</p></td><td valign="top" align="right"></td></tr></table></div><div class="refsynopsisdiv"><h2>Synopsis</h2><pre class="synopsis">
1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
4
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
6
<meta name="generator" content="DocBook XSL Stylesheets V1.69.1">
7
<link rel="start" href="index.html" title="libuser Reference Manual">
8
<link rel="up" href="ch01.html" title="libuser">
9
<link rel="prev" href="ch01.html" title="libuser">
10
<link rel="next" href="libuser-value.html" title="value">
11
<meta name="generator" content="GTK-Doc V1.6 (XML mode)">
12
<link rel="stylesheet" href="style.css" type="text/css">
13
<link rel="chapter" href="ch01.html" title="libuser">
15
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
16
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
18
<td><a accesskey="p" href="ch01.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
19
<td><a accesskey="u" href="ch01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
20
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
21
<th width="100%" align="center">libuser Reference Manual</th>
22
<td><a accesskey="n" href="libuser-value.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
24
<tr><td colspan="5" class="shortcuts"><nobr><a href="#top_of_page" class="shortcut">Top</a>
26
<a href="#desc" class="shortcut">Description</a></nobr></td></tr>
28
<div class="refentry" lang="en">
29
<a name="libuser-config"></a><div class="titlepage"></div>
30
<div class="refnamediv"><table width="100%"><tr>
32
<h2><span class="refentrytitle"><a name="top_of_page"></a>config</span></h2>
33
<p>config — Routines for reading configuration information for the libuser library.</p>
35
<td valign="top" align="right"></td>
37
<div class="refsynopsisdiv">
38
<a name="synopsis"></a><h2>Synopsis</h2>
39
<pre class="synopsis">
14
52
href="/usr/share/gtk-doc/html/glib/glib-Doubly-Linked-Lists.html#GList"
15
53
>GList</a>* <a href="libuser-config.html#lu-cfg-read-keys">lu_cfg_read_keys</a> (struct lu_context *context,
16
54
const char *parent_key);
17
</pre></div><div class="refsect1" lang="en"><a name="id2671188"></a><h2>Description</h2><p>
57
<div class="refsect1" lang="en">
58
<a name="desc"></a><h2>Description</h2>
18
60
These routines allow an application or module to read configuration data
19
61
from the libuser configuration.
20
</p></div><div class="refsect1" lang="en"><a name="id2671200"></a><h2>Details</h2><div class="refsect2" lang="en"><a name="id2671205"></a><h3><a name="lu-cfg-read"></a>lu_cfg_read ()</h3><a class="indexterm" name="id2671215"></a><pre class="programlisting"><a
64
<div class="refsect1" lang="en">
65
<a name="details"></a><h2>Details</h2>
66
<div class="refsect2" lang="en">
67
<a name="id3017052"></a><h3>
68
<a name="lu-cfg-read"></a>lu_cfg_read ()</h3>
69
<a class="indexterm" name="id3017064"></a><pre class="programlisting"><a
21
70
href="/usr/share/gtk-doc/html/glib/glib-Doubly-Linked-Lists.html#GList"
22
71
>GList</a>* lu_cfg_read (struct lu_context *context,
24
const char *default_value);</pre><p>
73
const char *default_value);</pre>
25
75
Reads the list of values for a given key from the configuration space.
26
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><em class="parameter"><code>context</code></em>�:</span></td><td>A valid libuser library context.
27
</td></tr><tr><td><span class="term"><em class="parameter"><code>key</code></em>�:</span></td><td>The value to be read from the configuration. The key should be of the
77
<div class="variablelist"><table border="0">
78
<col align="left" valign="top">
82
<span class="term"><em class="parameter"><code>context</code></em> :</span></td>
83
<td>A valid libuser library context.
88
<span class="term"><em class="parameter"><code>key</code></em> :</span></td>
89
<td>The value to be read from the configuration. The key should be of the
28
90
form "section/key" for most purposes. For example, the <span class="type">files</span> module uses
29
91
keys of the form "file/foo" for all of its configuration data.
30
</td></tr><tr><td><span class="term"><em class="parameter"><code>default_value</code></em>�:</span></td><td>A default value to be returned in case none are found. Can
96
<span class="term"><em class="parameter"><code>default_value</code></em> :</span></td>
97
<td>A default value to be returned in case none are found. Can
32
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>�:</span></td><td>A <a
103
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
33
105
href="/usr/share/gtk-doc/html/glib/glib-Doubly-Linked-Lists.html#GList"
34
106
><span class="type">GList</span></a> of values, formatted as strings. The list must be freed
37
109
><code class="function">g_list_free()</code></a>.
40
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2715904"></a><h3><a name="lu-cfg-read-single"></a>lu_cfg_read_single ()</h3><a class="indexterm" name="id2715914"></a><pre class="programlisting">const char* lu_cfg_read_single (struct lu_context *context,
118
<div class="refsect2" lang="en">
119
<a name="id3061788"></a><h3>
120
<a name="lu-cfg-read-single"></a>lu_cfg_read_single ()</h3>
121
<a class="indexterm" name="id3061801"></a><pre class="programlisting">const char* lu_cfg_read_single (struct lu_context *context,
42
const char *default_value);</pre><p>
123
const char *default_value);</pre>
43
125
Read a single value set for a given key in the configuration space. This is
44
126
a convenience function.
45
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><em class="parameter"><code>context</code></em>�:</span></td><td>A valid libuser library context.
46
</td></tr><tr><td><span class="term"><em class="parameter"><code>key</code></em>�:</span></td><td>The value to be read from the configuration. The key should be of the
128
<div class="variablelist"><table border="0">
129
<col align="left" valign="top">
133
<span class="term"><em class="parameter"><code>context</code></em> :</span></td>
134
<td>A valid libuser library context.
139
<span class="term"><em class="parameter"><code>key</code></em> :</span></td>
140
<td>The value to be read from the configuration. The key should be of the
47
141
form "section/key" for most purposes. For example, the <span class="type">files</span> module uses
48
142
keys of the form "file/foo" for all of its configuration data.
49
</td></tr><tr><td><span class="term"><em class="parameter"><code>default_value</code></em>�:</span></td><td>A default value to be returned in case none are found. Can
147
<span class="term"><em class="parameter"><code>default_value</code></em> :</span></td>
148
<td>A default value to be returned in case none are found. Can
51
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>�:</span></td><td>A string representation of one of the values set for the key. This
154
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
155
<td>A string representation of one of the values set for the key. This
52
156
string must not be freed.
55
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2716030"></a><h3><a name="lu-cfg-read-keys"></a>lu_cfg_read_keys ()</h3><a class="indexterm" name="id2716040"></a><pre class="programlisting"><a
165
<div class="refsect2" lang="en">
166
<a name="id3061917"></a><h3>
167
<a name="lu-cfg-read-keys"></a>lu_cfg_read_keys ()</h3>
168
<a class="indexterm" name="id3061929"></a><pre class="programlisting"><a
56
169
href="/usr/share/gtk-doc/html/glib/glib-Doubly-Linked-Lists.html#GList"
57
170
>GList</a>* lu_cfg_read_keys (struct lu_context *context,
58
const char *parent_key);</pre><p>
171
const char *parent_key);</pre>
59
173
Read the names of all of the keys "below" a given key in the configuration
60
174
space. This function is typically used for walking the configuration space.
61
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><em class="parameter"><code>context</code></em>�:</span></td><td>A valid libuser library context.
62
</td></tr><tr><td><span class="term"><em class="parameter"><code>parent_key</code></em>�:</span></td><td>The parent key under which the caller wishes to know which subkeys
176
<div class="variablelist"><table border="0">
177
<col align="left" valign="top">
181
<span class="term"><em class="parameter"><code>context</code></em> :</span></td>
182
<td>A valid libuser library context.
187
<span class="term"><em class="parameter"><code>parent_key</code></em> :</span></td>
188
<td>The parent key under which the caller wishes to know which subkeys
64
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>�:</span></td><td>A <a
194
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
65
196
href="/usr/share/gtk-doc/html/glib/glib-Doubly-Linked-Lists.html#GList"
66
197
><span class="type">GList</span></a> of string representations of key names. The list must be