Imported Upstream version 0.18.1.1
[platform/upstream/gettext.git] / gettext-runtime / man / bindtextdomain.3.html
1 <!-- Creator     : groff version 1.18.1 -->
2 <html>
3 <head>
4 <meta name="generator" content="groff -Thtml, see www.gnu.org">
5 <meta name="Content-Style" content="text/css">
6 <title>BINDTEXTDOMAIN</title>
7 </head>
8 <body>
9
10 <h1 align=center>BINDTEXTDOMAIN</h1>
11 <a href="#NAME">NAME</a><br>
12 <a href="#SYNOPSIS">SYNOPSIS</a><br>
13 <a href="#DESCRIPTION">DESCRIPTION</a><br>
14 <a href="#RETURN VALUE">RETURN VALUE</a><br>
15 <a href="#ERRORS">ERRORS</a><br>
16 <a href="#BUGS">BUGS</a><br>
17 <a href="#SEE ALSO">SEE ALSO</a><br>
18
19 <hr>
20 <a name="NAME"></a>
21 <h2>NAME</h2>
22 <!-- INDENTATION -->
23 <table width="100%" border=0 rules="none" frame="void"
24        cols="2" cellspacing="0" cellpadding="0">
25 <tr valign="top" align="left">
26 <td width="10%"></td>
27 <td width="89%">
28 <p>bindtextdomain &minus; set directory containing message
29 catalogs</p>
30 </td>
31 </table>
32 <a name="SYNOPSIS"></a>
33 <h2>SYNOPSIS</h2>
34 <!-- INDENTATION -->
35 <table width="100%" border=0 rules="none" frame="void"
36        cols="2" cellspacing="0" cellpadding="0">
37 <tr valign="top" align="left">
38 <td width="10%"></td>
39 <td width="89%">
40 <pre><b>#include &lt;libintl.h&gt;
41
42 char * bindtextdomain (const char *</b> <i>domainname</i><b>, const char *</b> <i>dirname</i><b>);
43 </b></pre>
44 </td>
45 </table>
46 <a name="DESCRIPTION"></a>
47 <h2>DESCRIPTION</h2>
48 <!-- INDENTATION -->
49
50 <table width="100%" border=0 rules="none" frame="void"
51        cols="2" cellspacing="0" cellpadding="0">
52 <tr valign="top" align="left">
53 <td width="10%"></td>
54 <td width="89%">
55 <p>The <b>bindtextdomain</b> function sets the base
56 directory of the hierarchy containing message catalogs for a
57 given message domain.</p>
58 <!-- INDENTATION -->
59 <p>A message domain is a set of translatable <i>msgid</i>
60 messages. Usually, every software package has its own
61 message domain. The need for calling <b>bindtextdomain</b>
62 arises because packages are not always installed with the
63 same prefix as the &lt;libintl.h&gt; header and the
64 libc/libintl libraries.</p>
65 <!-- INDENTATION -->
66 <p>Message catalogs will be expected at the pathnames
67 <i>dirname</i>/<i>locale</i>/<i>category</i>/<i>domainname</i>.mo,
68 where <i>locale</i> is a locale name and <i>category</i> is
69 a locale facet such as <b>LC_MESSAGES</b>.</p>
70 <!-- INDENTATION -->
71 <p><i>domainname</i> must be a non-empty string.</p>
72 <!-- INDENTATION -->
73 <p>If <i>dirname</i> is not NULL, the base directory for
74 message catalogs belonging to domain <i>domainname</i> is
75 set to <i>dirname</i>. The function makes copies of the
76 argument strings as needed. If the program wishes to call
77 the <b>chdir</b> function, it is important that
78 <i>dirname</i> be an absolute pathname; otherwise it cannot
79 be guaranteed that the message catalogs will be found.</p>
80 <!-- INDENTATION -->
81 <p>If <i>dirname</i> is NULL, the function returns the
82 previously set base directory for domain
83 <i>domainname</i>.</p>
84 </td>
85 </table>
86 <a name="RETURN VALUE"></a>
87 <h2>RETURN VALUE</h2>
88 <!-- INDENTATION -->
89 <table width="100%" border=0 rules="none" frame="void"
90        cols="2" cellspacing="0" cellpadding="0">
91 <tr valign="top" align="left">
92 <td width="10%"></td>
93 <td width="89%">
94 <p>If successful, the <b>bindtextdomain</b> function returns
95 the current base directory for domain <i>domainname</i>,
96 after possibly changing it. The resulting string is valid
97 until the next <b>bindtextdomain</b> call for the same
98 <i>domainname</i> and must not be modified or freed. If a
99 memory allocation failure occurs, it sets <b>errno</b> to
100 <b>ENOMEM</b> and returns NULL.</p>
101 </td>
102 </table>
103 <a name="ERRORS"></a>
104 <h2>ERRORS</h2>
105 <!-- INDENTATION -->
106 <table width="100%" border=0 rules="none" frame="void"
107        cols="2" cellspacing="0" cellpadding="0">
108 <tr valign="top" align="left">
109 <td width="10%"></td>
110 <td width="89%">
111 <p>The following error can occur, among others:</p>
112 </td>
113 </table>
114 <!-- TABS -->
115 <table width="100%" border=0 rules="none" frame="void"
116        cols="5" cellspacing="0" cellpadding="0">
117 <tr valign="top" align="left">
118 <td width="11%"></td>
119 <td width="8%">
120
121 <p><b>ENOMEM</b></p>
122 </td>
123 <td width="13%"></td>
124 <td width="41%">
125
126 <p>Not enough memory available.</p>
127 </td>
128 <td width="24%">
129 </td>
130 </table>
131 <a name="BUGS"></a>
132 <h2>BUGS</h2>
133 <!-- INDENTATION -->
134 <table width="100%" border=0 rules="none" frame="void"
135        cols="2" cellspacing="0" cellpadding="0">
136 <tr valign="top" align="left">
137 <td width="10%"></td>
138 <td width="89%">
139 <p>The return type ought to be <b>const char *</b>, but is
140 <b>char *</b> to avoid warnings in C code predating ANSI
141 C.</p>
142 </td>
143 </table>
144 <a name="SEE ALSO"></a>
145 <h2>SEE ALSO</h2>
146 <!-- INDENTATION -->
147 <table width="100%" border=0 rules="none" frame="void"
148        cols="2" cellspacing="0" cellpadding="0">
149 <tr valign="top" align="left">
150 <td width="10%"></td>
151 <td width="89%">
152 <p><b>gettext</b>(3), <b>dgettext</b>(3),
153 <b>dcgettext</b>(3), <b>ngettext</b>(3),
154 <b>dngettext</b>(3), <b>dcngettext</b>(3),
155 <b>textdomain</b>(3), <b>realpath</b>(3)</p>
156 </td>
157 </table>
158 <hr>
159 </body>
160 </html>