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