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