|
Server : Apache/2.2.2 (Fedora) System : Linux App1.pathumtani.go.th 2.6.20-1.2320.fc5smp #1 SMP Tue Jun 12 19:40:16 EDT 2007 i686 User : apache ( 48) PHP Version : 5.2.9 Disable Function : NONE Directory : /usr/share/gtk-doc/html/libuser/ |
Upload File : |
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>value</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.69.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.4 (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">
#define <a href="libuser-value.html#LU-VALUE-INVALID-ID:CAPS">LU_VALUE_INVALID_ID</a>
char* <a href="libuser-value.html#lu-value-strdup">lu_value_strdup</a> (const <a
href="../gobject/gobject-Generic-values.html#GValue"
>GValue</a> *value);
void <a href="libuser-value.html#lu-value-init-set-id">lu_value_init_set_id</a> (<a
href="../gobject/gobject-Generic-values.html#GValue"
>GValue</a> *value,
id_t id);
id_t <a href="libuser-value.html#lu-value-get-id">lu_value_get_id</a> (const <a
href="../gobject/gobject-Generic-values.html#GValue"
>GValue</a> *value);
int <a href="libuser-value.html#lu-values-equal">lu_values_equal</a> (const <a
href="../gobject/gobject-Generic-values.html#GValue"
>GValue</a> *a,
const <a
href="../gobject/gobject-Generic-values.html#GValue"
>GValue</a> *b);
</pre>
</div>
<div class="refsect1" lang="en">
<a name="id2525152"></a><h2>Description</h2>
<p>
Libuser entities store attribute values as <a
href="../gobject/gobject-Generic-values.html#GValue"
><span class="type">GValue</span></a>, which allows representing
any possible data type. Only a few types are needed in practice; the only
types applications should hard-code are <code class="literal">G_TYPE_LONG</code> and <code class="literal">G_TYPE_STRING</code>
(<code class="literal">G_TYPE_STRING</code> can usually be used as a fallback for other number types).
</p>
<p>
The only currently used data types that are not conveniently supported using
the above types are <span class="type">uid_t</span> and <span class="type">gid_t</span> (which can be together represented in
<span class="type">id_t</span>), because they can support values outside of the range of <a
href="../glib/glib-Basic-Types.html#glong"
><span class="type">glong</span></a>. Helper
functions are provided to convert values between <span class="type">id_t</span> and <a
href="../gobject/gobject-Generic-values.html#GValue"
><span class="type">GValue</span></a>, even if the
value is stored using <code class="literal">G_TYPE_STRING</code>. The <a
href="../gobject/gobject-Generic-values.html#GValue"
><span class="type">GValue</span></a> types used for storing <span class="type">id_t</span>
values are an internal implementation detail of libuser and applications should
not rely on them.
</p>
</div>
<div class="refsect1" lang="en">
<a name="id2525274"></a><h2>Details</h2>
<div class="refsect2" lang="en">
<a name="id2525280"></a><h3>
<a name="LU-VALUE-INVALID-ID:CAPS"></a>LU_VALUE_INVALID_ID</h3>
<a class="indexterm" name="id2525291"></a><pre class="programlisting">#define LU_VALUE_INVALID_ID ((id_t)-1)
</pre>
<p>
An <span class="type">id_t</span> value that matches no valid user or group ID.
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2525315"></a><h3>
<a name="lu-value-strdup"></a>lu_value_strdup ()</h3>
<a class="indexterm" name="id2525325"></a><pre class="programlisting">char* lu_value_strdup (const <a
href="../gobject/gobject-Generic-values.html#GValue"
>GValue</a> *value);</pre>
<p>
Converts <em class="parameter"><code>value</code></em>, of any type used by libuser, to a string. Preferable
to hard-coding checks for expected value types.
</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
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td>string, should be freed by <a
href="../glib/glib-Memory-Allocation.html#g-free"
><code class="function">g_free()</code></a>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2525400"></a><h3>
<a name="lu-value-init-set-id"></a>lu_value_init_set_id ()</h3>
<a class="indexterm" name="id2525411"></a><pre class="programlisting">void lu_value_init_set_id (<a
href="../gobject/gobject-Generic-values.html#GValue"
>GValue</a> *value,
id_t id);</pre>
<p>
Initializes a zero-filled (uninitialized) <em class="parameter"><code>value</code></em> with an unspecified type and
sets it to <em class="parameter"><code>id</code></em>.
</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
href="../gobject/gobject-Generic-values.html#GValue"
><span class="type">GValue</span></a>
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>id</code></em> :</span></td>
<td>user or group ID.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2525498"></a><h3>
<a name="lu-value-get-id"></a>lu_value_get_id ()</h3>
<a class="indexterm" name="id2525508"></a><pre class="programlisting">id_t lu_value_get_id (const <a
href="../gobject/gobject-Generic-values.html#GValue"
>GValue</a> *value);</pre>
<p>
Get the contents of <em class="parameter"><code>value</code></em>. <em class="parameter"><code>value</code></em> should be initialized by
<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>.
</p>
<p>
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>
is returned.
</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
href="../gobject/gobject-Generic-values.html#GValue"
><span class="type">GValue</span></a>
</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>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2525637"></a><h3>
<a name="lu-values-equal"></a>lu_values_equal ()</h3>
<a class="indexterm" name="id2525648"></a><pre class="programlisting">int lu_values_equal (const <a
href="../gobject/gobject-Generic-values.html#GValue"
>GValue</a> *a,
const <a
href="../gobject/gobject-Generic-values.html#GValue"
>GValue</a> *b);</pre>
<p>
Check whether <em class="parameter"><code>a</code></em> and <em class="parameter"><code>b</code></em> have the same type and value.
</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
href="../gobject/gobject-Generic-values.html#GValue"
><span class="type">GValue</span></a>
</td>
</tr>
<tr>
<td>
<span class="term"><em class="parameter"><code>b</code></em> :</span></td>
<td>
<a
href="../gobject/gobject-Generic-values.html#GValue"
><span class="type">GValue</span></a>
</td>
</tr>
<tr>
<td>
<span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td>
<a
href="../glib/glib-Standard-Macros.html#TRUE:CAPS"
><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
</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>