fixed packaging
[platform/upstream/libunistring.git] / doc / libunistring_2.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html401/loose.dtd">
2 <html>
3 <!-- Created on September, 1 2014 by texi2html 1.78a -->
4 <!--
5 Written by: Lionel Cons <Lionel.Cons@cern.ch> (original author)
6             Karl Berry  <karl@freefriends.org>
7             Olaf Bachmann <obachman@mathematik.uni-kl.de>
8             and many others.
9 Maintained by: Many creative people.
10 Send bugs and suggestions to <texi2html-bug@nongnu.org>
11
12 -->
13 <head>
14 <title>GNU libunistring: 2. Conventions</title>
15
16 <meta name="description" content="GNU libunistring: 2. Conventions">
17 <meta name="keywords" content="GNU libunistring: 2. Conventions">
18 <meta name="resource-type" content="document">
19 <meta name="distribution" content="global">
20 <meta name="Generator" content="texi2html 1.78a">
21 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
22 <style type="text/css">
23 <!--
24 a.summary-letter {text-decoration: none}
25 pre.display {font-family: serif}
26 pre.format {font-family: serif}
27 pre.menu-comment {font-family: serif}
28 pre.menu-preformatted {font-family: serif}
29 pre.smalldisplay {font-family: serif; font-size: smaller}
30 pre.smallexample {font-size: smaller}
31 pre.smallformat {font-family: serif; font-size: smaller}
32 pre.smalllisp {font-size: smaller}
33 span.roman {font-family:serif; font-weight:normal;}
34 span.sansserif {font-family:sans-serif; font-weight:normal;}
35 ul.toc {list-style: none}
36 -->
37 </style>
38
39
40 </head>
41
42 <body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
43
44 <table cellpadding="1" cellspacing="1" border="0">
45 <tr><td valign="middle" align="left">[<a href="libunistring_1.html#SEC1" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
46 <td valign="middle" align="left">[<a href="libunistring_3.html#SEC10" title="Next chapter"> &gt;&gt; </a>]</td>
47 <td valign="middle" align="left"> &nbsp; </td>
48 <td valign="middle" align="left"> &nbsp; </td>
49 <td valign="middle" align="left"> &nbsp; </td>
50 <td valign="middle" align="left"> &nbsp; </td>
51 <td valign="middle" align="left"> &nbsp; </td>
52 <td valign="middle" align="left">[<a href="libunistring.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
53 <td valign="middle" align="left">[<a href="libunistring.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
54 <td valign="middle" align="left">[<a href="libunistring_19.html#SEC77" title="Index">Index</a>]</td>
55 <td valign="middle" align="left">[<a href="libunistring_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
56 </tr></table>
57
58 <hr size="2">
59 <a name="Conventions"></a>
60 <a name="SEC9"></a>
61 <h1 class="chapter"> <a href="libunistring.html#TOC9">2. Conventions</a> </h1>
62
63 <p>This chapter explains conventions valid throughout the libunistring library.
64 </p>
65 <a name="IDX14"></a>
66 <p>Variables of type <code>char *</code> denote C strings in locale encoding.
67 See <a href="libunistring_1.html#SEC4">Locale encodings</a>.
68 </p>
69 <p>Variables of type <code>uint8_t *</code> denote UTF-8 strings.  Their units
70 are bytes.
71 </p>
72 <p>Variables of type <code>uint16_t *</code> denote UTF-16 strings, without byte
73 order mark.  Their units are 2-byte words.
74 </p>
75 <p>Variables of type <code>uint32_t *</code> denote UTF-32 strings, without byte
76 order mark.  Their units are 4-byte words.
77 </p>
78 <p>Argument pairs <code>(<var>s</var>, <var>n</var>)</code> denote a string
79 <code><var>s</var>[0..<var>n</var>-1]</code> with exactly <var>n</var> units.
80 </p>
81 <p>All functions with prefix &lsquo;<samp>ulc_</samp>&rsquo; operate on C strings in locale
82 encoding.
83 </p>
84 <p>All functions with prefix &lsquo;<samp>u8_</samp>&rsquo; operate on UTF-8 strings.
85 </p>
86 <p>All functions with prefix &lsquo;<samp>u16_</samp>&rsquo; operate on UTF-16 strings.
87 </p>
88 <p>All functions with prefix &lsquo;<samp>u32_</samp>&rsquo; operate on UTF-32 strings.
89 </p>
90 <p>For every function with prefix &lsquo;<samp>u8_</samp>&rsquo;, operating on UTF-8 strings,
91 there is also a corresponding function with prefix &lsquo;<samp>u16_</samp>&rsquo;,
92 operating on UTF-16 strings, and a corresponding function with prefix
93 &lsquo;<samp>u32_</samp>&rsquo;, operating on UTF-32 strings.  Their description is
94 analogous; in this documentation we describe only the function that
95 operates on UTF-8 strings, for brevity.
96 </p>
97 <p>A declaration with a variable <var>n</var> denotes the three concrete
98 declarations with <var>n</var> = 8, <var>n</var> = 16, <var>n</var> = 32.
99 </p>
100 <p>All parameters starting with &lsquo;<samp>str</samp>&rsquo; and the parameters of
101 functions starting with <code>u8_str</code>/<code>u16_str</code>/<code>u32_str</code>
102 denote a NUL terminated string.
103 </p>
104 <a name="IDX15"></a>
105 <p>Error values are always returned through the <code>errno</code> variable,
106 usually with a return value that indicates the presence of an error
107 (NULL for functions that return an pointer, or -1 for functions that
108 return an <code>int</code>).
109 </p>
110 <p>Functions returning a string result take a
111 <code>(<var>resultbuf</var>, <var>lengthp</var>)</code>
112 argument pair.  If <var>resultbuf</var> is not NULL and the result fits
113 into <code>*<var>lengthp</var></code> units, it is put in <var>resultbuf</var>, and
114 <var>resultbuf</var> is returned.  Otherwise, a freshly allocated string
115 is returned.  In both cases, <code>*<var>lengthp</var></code> is set to the
116 length (number of units) of the returned string.  In case of error,
117 NULL is returned and <code>errno</code> is set.
118 </p>
119 <hr size="6">
120 <table cellpadding="1" cellspacing="1" border="0">
121 <tr><td valign="middle" align="left">[<a href="libunistring_1.html#SEC1" title="Beginning of this chapter or previous chapter"> &lt;&lt; </a>]</td>
122 <td valign="middle" align="left">[<a href="libunistring_3.html#SEC10" title="Next chapter"> &gt;&gt; </a>]</td>
123 <td valign="middle" align="left"> &nbsp; </td>
124 <td valign="middle" align="left"> &nbsp; </td>
125 <td valign="middle" align="left"> &nbsp; </td>
126 <td valign="middle" align="left"> &nbsp; </td>
127 <td valign="middle" align="left"> &nbsp; </td>
128 <td valign="middle" align="left">[<a href="libunistring.html#SEC_Top" title="Cover (top) of document">Top</a>]</td>
129 <td valign="middle" align="left">[<a href="libunistring.html#SEC_Contents" title="Table of contents">Contents</a>]</td>
130 <td valign="middle" align="left">[<a href="libunistring_19.html#SEC77" title="Index">Index</a>]</td>
131 <td valign="middle" align="left">[<a href="libunistring_abt.html#SEC_About" title="About (help)"> ? </a>]</td>
132 </tr></table>
133 <p>
134  <font size="-1">
135   This document was generated by <em>Daiki Ueno</em> on <em>September, 1 2014</em> using <a href="http://www.nongnu.org/texi2html/"><em>texi2html 1.78a</em></a>.
136  </font>
137  <br>
138
139 </p>
140 </body>
141 </html>