~ubuntu-branches/ubuntu/wily/libuser/wily

« back to all changes in this revision

Viewing changes to docs/reference/html/libuser-value.html

  • Committer: Bazaar Package Importer
  • Author(s): Pierre Habouzit
  • Date: 2006-09-03 21:58:15 UTC
  • mto: (2.1.1 edgy) (1.1.5 upstream) (3.1.1 lenny)
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20060903215815-rtvvfzhaer8ymyp4
Tags: upstream-0.54.6-2.1.dfsg.1
Import upstream version 0.54.6-2.1.dfsg.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
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 &#8212; 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">
 
2
<html>
 
3
<head>
 
4
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
 
5
<title>value</title>
 
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">
 
14
</head>
 
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">
 
17
<tr valign="middle">
 
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>
 
23
</tr>
 
24
<tr><td colspan="5" class="shortcuts"><nobr><a href="#top_of_page" class="shortcut">Top</a>
 
25
                  &#160;|&#160;
 
26
                  <a href="#desc" class="shortcut">Description</a></nobr></td></tr>
 
27
</table>
 
28
<div class="refentry" lang="en">
 
29
<a name="libuser-value"></a><div class="titlepage"></div>
 
30
<div class="refnamediv"><table width="100%"><tr>
 
31
<td valign="top">
 
32
<h2><span class="refentrytitle"><a name="top_of_page"></a>value</span></h2>
 
33
<p>value &#8212; Simplified interface to GValue types used in libuser entities.</p>
 
34
</td>
 
35
<td valign="top" align="right"></td>
 
36
</tr></table></div>
 
37
<div class="refsynopsisdiv">
 
38
<a name="synopsis"></a><h2>Synopsis</h2>
 
39
<pre class="synopsis">
2
40
 
3
41
 
4
42
 
19
57
                                             const <a
20
58
href="/usr/share/gtk-doc/html/gobject/gobject-Generic-values.html#GValue"
21
59
>GValue</a> *b);
22
 
</pre></div><div class="refsect1" lang="en"><a name="id2716828"></a><h2>Description</h2><p>
 
60
</pre>
 
61
</div>
 
62
<div class="refsect1" lang="en">
 
63
<a name="desc"></a><h2>Description</h2>
 
64
<p>
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).
29
 
</p><p>
 
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>
 
74
(<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).
 
77
</p>
 
78
<p>
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
42
93
not rely on them.
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)
44
 
</pre><p>
 
94
</p>
 
95
</div>
 
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)
 
102
</pre>
 
103
<p>
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
 
105
</p>
 
106
</div>
 
107
<hr>
 
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>
 
114
<p>
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
 
117
</p>
 
118
<div class="variablelist"><table border="0">
 
119
<col align="left" valign="top">
 
120
<tbody>
 
121
<tr>
 
122
<td>
 
123
<span class="term"><em class="parameter"><code>value</code></em>&#160;:</span></td>
 
124
<td>value
 
125
</td>
 
126
</tr>
 
127
<tr>
 
128
<td>
 
129
<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</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>
55
133
 
56
134
 
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
 
135
</td>
 
136
</tr>
 
137
</tbody>
 
138
</table></div>
 
139
</div>
 
140
<hr>
 
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,
60
 
                                             id_t id);</pre><p>
 
147
                                             id_t id);</pre>
 
148
<p>
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
 
151
</p>
 
152
<div class="variablelist"><table border="0">
 
153
<col align="left" valign="top">
 
154
<tbody>
 
155
<tr>
 
156
<td>
 
157
<span class="term"><em class="parameter"><code>value</code></em>&#160;:</span></td>
 
158
<td>
 
159
<a
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.
67
 
 
68
 
 
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
 
162
</td>
 
163
</tr>
 
164
<tr>
 
165
<td>
 
166
<span class="term"><em class="parameter"><code>id</code></em>&#160;:</span></td>
 
167
<td>user or group ID.
 
168
 
 
169
 
 
170
</td>
 
171
</tr>
 
172
</tbody>
 
173
</table></div>
 
174
</div>
 
175
<hr>
 
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>
 
182
<p>
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>.
74
 
</p><p>
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>.
 
189
</p>
 
190
<p>
 
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>
76
192
is returned.
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
 
193
</p>
 
194
<div class="variablelist"><table border="0">
 
195
<col align="left" valign="top">
 
196
<tbody>
 
197
<tr>
 
198
<td>
 
199
<span class="term"><em class="parameter"><code>value</code></em>&#160;:</span></td>
 
200
<td>
 
201
<a
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>
81
 
 
82
 
 
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
 
204
</td>
 
205
</tr>
 
206
<tr>
 
207
<td>
 
208
<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</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>
 
210
 
 
211
 
 
212
</td>
 
213
</tr>
 
214
</tbody>
 
215
</table></div>
 
216
</div>
 
217
<hr>
 
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"
85
223
>GValue</a> *a,
86
224
                                             const <a
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>
 
227
<p>
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
 
229
</p>
 
230
<div class="variablelist"><table border="0">
 
231
<col align="left" valign="top">
 
232
<tbody>
 
233
<tr>
 
234
<td>
 
235
<span class="term"><em class="parameter"><code>a</code></em>&#160;:</span></td>
 
236
<td>
 
237
<a
 
238
href="/usr/share/gtk-doc/html/gobject/gobject-Generic-values.html#GValue"
 
239
><span class="type">GValue</span></a>
 
240
</td>
 
241
</tr>
 
242
<tr>
 
243
<td>
 
244
<span class="term"><em class="parameter"><code>b</code></em>&#160;:</span></td>
 
245
<td>
 
246
<a
 
247
href="/usr/share/gtk-doc/html/gobject/gobject-Generic-values.html#GValue"
 
248
><span class="type">GValue</span></a>
 
249
</td>
 
250
</tr>
 
251
<tr>
 
252
<td>
 
253
<span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
 
254
<td>
 
255
<a
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
99
258
 
100
259
 
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>&lt;&lt;�config</b></a></td><td align="right"><a accesskey="n" href="libuser-entity.html"><b>entity�&gt;&gt;</b></a></td></tr></table></body></html>
 
260
</td>
 
261
</tr>
 
262
</tbody>
 
263
</table></div>
 
264
</div>
 
265
</div>
 
266
</div>
 
267
</body>
 
268
</html>