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