|
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17 System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64 User : nobody ( 99) PHP Version : 5.2.17 Disable Function : NONE Directory : /usr/share/gtk-doc/html/libuser/ |
Upload File : |
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<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.6 (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" id="top" 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>
<tr><td colspan="5" class="shortcuts"><nobr><a href="#top_of_page" class="shortcut">Top</a>
 | 
<a href="#desc" class="shortcut">Description</a></nobr></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"><a name="top_of_page"></a>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">
<a name="synopsis"></a><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="/usr/share/gtk-doc/html/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="/usr/share/gtk-doc/html/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="/usr/share/gtk-doc/html/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="/usr/share/gtk-doc/html/gobject/gobject-Generic-values.html#GValue"
>GValue</a> *a,
const <a
href="/usr/share/gtk-doc/html/gobject/gobject-Generic-values.html#GValue"
>GValue</a> *b);
</pre>
</div>
<div class="refsect1" lang="en">
<a name="desc"></a><h2>Description</h2>
<p>
Libuser entities store attribute values as <a
href="/usr/share/gtk-doc/html/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 <a
href="/usr/share/gtk-doc/html/gobject/gobject-Type-Information.html#G-TYPE-LONG:CAPS"
><code class="literal">G_TYPE_LONG</code></a> and <a
href="/usr/share/gtk-doc/html/gobject/gobject-Type-Information.html#G-TYPE-STRING:CAPS"
><code class="literal">G_TYPE_STRING</code></a>
(<a
href="/usr/share/gtk-doc/html/gobject/gobject-Type-Information.html#G-TYPE-STRING:CAPS"
><code class="literal">G_TYPE_STRING</code></a> 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="/usr/share/gtk-doc/html/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="/usr/share/gtk-doc/html/gobject/gobject-Generic-values.html#GValue"
><span class="type">GValue</span></a>, even if the
value is stored using <a
href="/usr/share/gtk-doc/html/gobject/gobject-Type-Information.html#G-TYPE-STRING:CAPS"
><code class="literal">G_TYPE_STRING</code></a>. The <a
href="/usr/share/gtk-doc/html/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="details"></a><h2>Details</h2>
<div class="refsect2" lang="en">
<a name="id2564741"></a><h3>
<a name="LU-VALUE-INVALID-ID:CAPS"></a>LU_VALUE_INVALID_ID</h3>
<a class="indexterm" name="id2564753"></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="id2564777"></a><h3>
<a name="lu-value-strdup"></a>lu_value_strdup ()</h3>
<a class="indexterm" name="id2564789"></a><pre class="programlisting">char* lu_value_strdup (const <a
href="/usr/share/gtk-doc/html/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="/usr/share/gtk-doc/html/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="id2564864"></a><h3>
<a name="lu-value-init-set-id"></a>lu_value_init_set_id ()</h3>
<a class="indexterm" name="id2564877"></a><pre class="programlisting">void lu_value_init_set_id (<a
href="/usr/share/gtk-doc/html/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="/usr/share/gtk-doc/html/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="id2564964"></a><h3>
<a name="lu-value-get-id"></a>lu_value_get_id ()</h3>
<a class="indexterm" name="id2564976"></a><pre class="programlisting">id_t lu_value_get_id (const <a
href="/usr/share/gtk-doc/html/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 <a
href="/usr/share/gtk-doc/html/gobject/gobject-Type-Information.html#G-TYPE-LONG:CAPS"
><code class="literal">G_TYPE_LONG</code></a> or <a
href="/usr/share/gtk-doc/html/gobject/gobject-Type-Information.html#G-TYPE-STRING:CAPS"
><code class="literal">G_TYPE_STRING</code></a>.
</p>
<p>
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>
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="/usr/share/gtk-doc/html/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 <a href="libuser-value.html#LU-VALUE-INVALID-ID:CAPS"><code class="literal">LU_VALUE_INVALID_ID</code></a>
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2565125"></a><h3>
<a name="lu-values-equal"></a>lu_values_equal ()</h3>
<a class="indexterm" name="id2565137"></a><pre class="programlisting">int lu_values_equal (const <a
href="/usr/share/gtk-doc/html/gobject/gobject-Generic-values.html#GValue"
>GValue</a> *a,
const <a
href="/usr/share/gtk-doc/html/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="/usr/share/gtk-doc/html/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="/usr/share/gtk-doc/html/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="/usr/share/gtk-doc/html/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>
</body>
</html>