1
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>value</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="libuser-config.html" title="config"><link rel="next" href="libuser-entity.html" title="entity"><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="libuser-config.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-entity.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-value"></a><div class="titlepage"></div><div class="refnamediv"><table width="100%"><tr><td valign="top"><h2><span class="refentrytitle">value</span></h2><p>value — Simplified interface to GValue types used in libuser entities.</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="libuser-config.html" title="config">
10
<link rel="next" href="libuser-entity.html" title="entity">
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="libuser-config.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-entity.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-value"></a><div class="titlepage"></div>
30
<div class="refnamediv"><table width="100%"><tr>
32
<h2><span class="refentrytitle"><a name="top_of_page"></a>value</span></h2>
33
<p>value — Simplified interface to GValue types used in libuser entities.</p>
35
<td valign="top" align="right"></td>
37
<div class="refsynopsisdiv">
38
<a name="synopsis"></a><h2>Synopsis</h2>
39
<pre class="synopsis">
20
58
href="/usr/share/gtk-doc/html/gobject/gobject-Generic-values.html#GValue"
22
</pre></div><div class="refsect1" lang="en"><a name="id2716828"></a><h2>Description</h2><p>
62
<div class="refsect1" lang="en">
63
<a name="desc"></a><h2>Description</h2>
23
65
Libuser entities store attribute values as <a
24
66
href="/usr/share/gtk-doc/html/gobject/gobject-Generic-values.html#GValue"
25
67
><span class="type">GValue</span></a>, which allows representing
26
68
any possible data type. Only a few types are needed in practice; the only
27
types applications should hard-code are <code class="literal">G_TYPE_LONG</code> and <code class="literal">G_TYPE_STRING</code>
28
(<code class="literal">G_TYPE_STRING</code> can usually be used as a fallback for other number types).
69
types applications should hard-code are <a
70
href="/usr/share/gtk-doc/html/gobject/gobject-Type-Information.html#G-TYPE-LONG:CAPS"
71
><code class="literal">G_TYPE_LONG</code></a> and <a
72
href="/usr/share/gtk-doc/html/gobject/gobject-Type-Information.html#G-TYPE-STRING:CAPS"
73
><code class="literal">G_TYPE_STRING</code></a>
75
href="/usr/share/gtk-doc/html/gobject/gobject-Type-Information.html#G-TYPE-STRING:CAPS"
76
><code class="literal">G_TYPE_STRING</code></a> can usually be used as a fallback for other number types).
30
79
The only currently used data types that are not conveniently supported using
31
80
the above types are <span class="type">uid_t</span> and <span class="type">gid_t</span> (which can be together represented in
32
81
<span class="type">id_t</span>), because they can support values outside of the range of <a
35
84
functions are provided to convert values between <span class="type">id_t</span> and <a
36
85
href="/usr/share/gtk-doc/html/gobject/gobject-Generic-values.html#GValue"
37
86
><span class="type">GValue</span></a>, even if the
38
value is stored using <code class="literal">G_TYPE_STRING</code>. The <a
87
value is stored using <a
88
href="/usr/share/gtk-doc/html/gobject/gobject-Type-Information.html#G-TYPE-STRING:CAPS"
89
><code class="literal">G_TYPE_STRING</code></a>. The <a
39
90
href="/usr/share/gtk-doc/html/gobject/gobject-Generic-values.html#GValue"
40
91
><span class="type">GValue</span></a> types used for storing <span class="type">id_t</span>
41
92
values are an internal implementation detail of libuser and applications should
43
</p></div><div class="refsect1" lang="en"><a name="id2716950"></a><h2>Details</h2><div class="refsect2" lang="en"><a name="id2716956"></a><h3><a name="LU-VALUE-INVALID-ID:CAPS"></a>LU_VALUE_INVALID_ID</h3><a class="indexterm" name="id2716967"></a><pre class="programlisting">#define LU_VALUE_INVALID_ID ((id_t)-1)
96
<div class="refsect1" lang="en">
97
<a name="details"></a><h2>Details</h2>
98
<div class="refsect2" lang="en">
99
<a name="id3062916"></a><h3>
100
<a name="LU-VALUE-INVALID-ID:CAPS"></a>LU_VALUE_INVALID_ID</h3>
101
<a class="indexterm" name="id3062928"></a><pre class="programlisting">#define LU_VALUE_INVALID_ID ((id_t)-1)
45
104
An <span class="type">id_t</span> value that matches no valid user or group ID.
46
</p></div><hr><div class="refsect2" lang="en"><a name="id2716991"></a><h3><a name="lu-value-strdup"></a>lu_value_strdup ()</h3><a class="indexterm" name="id2717001"></a><pre class="programlisting">char* lu_value_strdup (const <a
108
<div class="refsect2" lang="en">
109
<a name="id3062952"></a><h3>
110
<a name="lu-value-strdup"></a>lu_value_strdup ()</h3>
111
<a class="indexterm" name="id3062964"></a><pre class="programlisting">char* lu_value_strdup (const <a
47
112
href="/usr/share/gtk-doc/html/gobject/gobject-Generic-values.html#GValue"
48
>GValue</a> *value);</pre><p>
113
>GValue</a> *value);</pre>
49
115
Converts <em class="parameter"><code>value</code></em>, of any type used by libuser, to a string. Preferable
50
116
to hard-coding checks for expected value types.
51
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><em class="parameter"><code>value</code></em>�:</span></td><td>value
52
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>�:</span></td><td>string, should be freed by <a
118
<div class="variablelist"><table border="0">
119
<col align="left" valign="top">
123
<span class="term"><em class="parameter"><code>value</code></em> :</span></td>
129
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
130
<td>string, should be freed by <a
53
131
href="/usr/share/gtk-doc/html/glib/glib-Memory-Allocation.html#g-free"
54
132
><code class="function">g_free()</code></a>
57
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2717076"></a><h3><a name="lu-value-init-set-id"></a>lu_value_init_set_id ()</h3><a class="indexterm" name="id2717087"></a><pre class="programlisting">void lu_value_init_set_id (<a
141
<div class="refsect2" lang="en">
142
<a name="id3063040"></a><h3>
143
<a name="lu-value-init-set-id"></a>lu_value_init_set_id ()</h3>
144
<a class="indexterm" name="id3063052"></a><pre class="programlisting">void lu_value_init_set_id (<a
58
145
href="/usr/share/gtk-doc/html/gobject/gobject-Generic-values.html#GValue"
59
146
>GValue</a> *value,
61
149
Initializes a zero-filled (uninitialized) <em class="parameter"><code>value</code></em> with an unspecified type and
62
150
sets it to <em class="parameter"><code>id</code></em>.
63
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><em class="parameter"><code>value</code></em>�:</span></td><td><a
152
<div class="variablelist"><table border="0">
153
<col align="left" valign="top">
157
<span class="term"><em class="parameter"><code>value</code></em> :</span></td>
64
160
href="/usr/share/gtk-doc/html/gobject/gobject-Generic-values.html#GValue"
65
161
><span class="type">GValue</span></a>
66
</td></tr><tr><td><span class="term"><em class="parameter"><code>id</code></em>�:</span></td><td>user or group ID.
69
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2717174"></a><h3><a name="lu-value-get-id"></a>lu_value_get_id ()</h3><a class="indexterm" name="id2717184"></a><pre class="programlisting">id_t lu_value_get_id (const <a
166
<span class="term"><em class="parameter"><code>id</code></em> :</span></td>
167
<td>user or group ID.
176
<div class="refsect2" lang="en">
177
<a name="id3063139"></a><h3>
178
<a name="lu-value-get-id"></a>lu_value_get_id ()</h3>
179
<a class="indexterm" name="id3063152"></a><pre class="programlisting">id_t lu_value_get_id (const <a
70
180
href="/usr/share/gtk-doc/html/gobject/gobject-Generic-values.html#GValue"
71
>GValue</a> *value);</pre><p>
181
>GValue</a> *value);</pre>
72
183
Get the contents of <em class="parameter"><code>value</code></em>. <em class="parameter"><code>value</code></em> should be initialized by
73
<a href="libuser-value.html#lu-value-init-set-id"><code class="function">lu_value_init_set_id()</code></a> or use <code class="literal">G_TYPE_LONG</code> or <code class="literal">G_TYPE_STRING</code>.
75
If <em class="parameter"><code>value</code></em> does not contain a valid <span class="type">id_t</span> value, <code class="literal">LU_VALUE_INVALID_ID</code>
184
<a href="libuser-value.html#lu-value-init-set-id"><code class="function">lu_value_init_set_id()</code></a> or use <a
185
href="/usr/share/gtk-doc/html/gobject/gobject-Type-Information.html#G-TYPE-LONG:CAPS"
186
><code class="literal">G_TYPE_LONG</code></a> or <a
187
href="/usr/share/gtk-doc/html/gobject/gobject-Type-Information.html#G-TYPE-STRING:CAPS"
188
><code class="literal">G_TYPE_STRING</code></a>.
191
If <em class="parameter"><code>value</code></em> does not contain a valid <span class="type">id_t</span> value, <a href="libuser-value.html#LU-VALUE-INVALID-ID:CAPS"><code class="literal">LU_VALUE_INVALID_ID</code></a>
77
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><em class="parameter"><code>value</code></em>�:</span></td><td><a
194
<div class="variablelist"><table border="0">
195
<col align="left" valign="top">
199
<span class="term"><em class="parameter"><code>value</code></em> :</span></td>
78
202
href="/usr/share/gtk-doc/html/gobject/gobject-Generic-values.html#GValue"
79
203
><span class="type">GValue</span></a>
80
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>�:</span></td><td>ID value or <code class="literal">LU_VALUE_INVALID_ID</code>
83
</td></tr></tbody></table></div></div><hr><div class="refsect2" lang="en"><a name="id2717313"></a><h3><a name="lu-values-equal"></a>lu_values_equal ()</h3><a class="indexterm" name="id2717324"></a><pre class="programlisting">int lu_values_equal (const <a
208
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
209
<td>ID value or <a href="libuser-value.html#LU-VALUE-INVALID-ID:CAPS"><code class="literal">LU_VALUE_INVALID_ID</code></a>
218
<div class="refsect2" lang="en">
219
<a name="id3063300"></a><h3>
220
<a name="lu-values-equal"></a>lu_values_equal ()</h3>
221
<a class="indexterm" name="id3063312"></a><pre class="programlisting">int lu_values_equal (const <a
84
222
href="/usr/share/gtk-doc/html/gobject/gobject-Generic-values.html#GValue"
87
225
href="/usr/share/gtk-doc/html/gobject/gobject-Generic-values.html#GValue"
88
>GValue</a> *b);</pre><p>
226
>GValue</a> *b);</pre>
89
228
Check whether <em class="parameter"><code>a</code></em> and <em class="parameter"><code>b</code></em> have the same type and value.
90
</p><div class="variablelist"><table border="0"><col align="left" valign="top"><tbody><tr><td><span class="term"><em class="parameter"><code>a</code></em>�:</span></td><td><a
91
href="/usr/share/gtk-doc/html/gobject/gobject-Generic-values.html#GValue"
92
><span class="type">GValue</span></a>
93
</td></tr><tr><td><span class="term"><em class="parameter"><code>b</code></em>�:</span></td><td><a
94
href="/usr/share/gtk-doc/html/gobject/gobject-Generic-values.html#GValue"
95
><span class="type">GValue</span></a>
96
</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>�:</span></td><td><a
230
<div class="variablelist"><table border="0">
231
<col align="left" valign="top">
235
<span class="term"><em class="parameter"><code>a</code></em> :</span></td>
238
href="/usr/share/gtk-doc/html/gobject/gobject-Generic-values.html#GValue"
239
><span class="type">GValue</span></a>
244
<span class="term"><em class="parameter"><code>b</code></em> :</span></td>
247
href="/usr/share/gtk-doc/html/gobject/gobject-Generic-values.html#GValue"
248
><span class="type">GValue</span></a>
253
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
97
256
href="/usr/share/gtk-doc/html/glib/glib-Standard-Macros.html#TRUE:CAPS"
98
257
><span class="type">TRUE</span></a> if <em class="parameter"><code>a</code></em> and <em class="parameter"><code>b</code></em> have the same type and value
101
</td></tr></tbody></table></div></div></div></div><table class="navigation" width="100%" summary="Navigation footer" cellpadding="2" cellspacing="0"><tr valign="middle"><td align="left"><a accesskey="p" href="libuser-config.html"><b><<�config</b></a></td><td align="right"><a accesskey="n" href="libuser-entity.html"><b>entity�>></b></a></td></tr></table></body></html>