xref: /netbsd-src/external/gpl2/gettext/dist/gettext-runtime/man/textdomain.3.html (revision 946379e7b37692fc43f68eb0d1c10daa0a7f3b6c)
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>TEXTDOMAIN</title>
6*946379e7Schristos</head>
7*946379e7Schristos<body>
8*946379e7Schristos
9*946379e7Schristos<h1 align=center>TEXTDOMAIN</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*946379e7Schristostextdomain - set domain for future gettext() calls</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 &lt;libintl.h&gt;
35*946379e7Schristos
36*946379e7Schristoschar * textdomain (const char *</b> <i>domainname</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>textdomain</b> function sets or retrieves the current
46*946379e7Schristosmessage domain.</td></table>
47*946379e7Schristos
48*946379e7Schristos<table width="100%" border=0 rules="none" frame="void"
49*946379e7Schristos       cols="2" cellspacing="0" cellpadding="0">
50*946379e7Schristos<tr valign="top" align="left">
51*946379e7Schristos<td width="10%"></td><td width="90%">
52*946379e7SchristosA message domain is a set of translatable <i>msgid</i>
53*946379e7Schristosmessages. Usually, every software package has its own
54*946379e7Schristosmessage domain. The domain name is used to determine the
55*946379e7Schristosmessage catalog where a translation is looked up; it must be
56*946379e7Schristosa non-empty string.</td></table>
57*946379e7Schristos
58*946379e7Schristos<table width="100%" border=0 rules="none" frame="void"
59*946379e7Schristos       cols="2" cellspacing="0" cellpadding="0">
60*946379e7Schristos<tr valign="top" align="left">
61*946379e7Schristos<td width="10%"></td><td width="90%">
62*946379e7SchristosThe current message domain is used by the <b>gettext</b>,
63*946379e7Schristos<b>ngettext</b> functions, and by the <b>dgettext</b>,
64*946379e7Schristos<b>dcgettext</b>, <b>dngettext</b> and <b>dcngettext</b>
65*946379e7Schristosfunctions when called with a NULL domainname
66*946379e7Schristosargument.</td></table>
67*946379e7Schristos
68*946379e7Schristos<table width="100%" border=0 rules="none" frame="void"
69*946379e7Schristos       cols="2" cellspacing="0" cellpadding="0">
70*946379e7Schristos<tr valign="top" align="left">
71*946379e7Schristos<td width="10%"></td><td width="90%">
72*946379e7SchristosIf <i>domainname</i> is not NULL, the current message domain
73*946379e7Schristosis set to <i>domainname</i>. The string the function stores
74*946379e7Schristosinternally is a copy of the <i>domainname</i>
75*946379e7Schristosargument.</td></table>
76*946379e7Schristos
77*946379e7Schristos<table width="100%" border=0 rules="none" frame="void"
78*946379e7Schristos       cols="2" cellspacing="0" cellpadding="0">
79*946379e7Schristos<tr valign="top" align="left">
80*946379e7Schristos<td width="10%"></td><td width="90%">
81*946379e7SchristosIf <i>domainname</i> is NULL, the function returns the
82*946379e7Schristoscurrent message domain.</td></table>
83*946379e7Schristos<a name="RETURN VALUE"></a>
84*946379e7Schristos<h2>RETURN VALUE</h2>
85*946379e7Schristos
86*946379e7Schristos<table width="100%" border=0 rules="none" frame="void"
87*946379e7Schristos       cols="2" cellspacing="0" cellpadding="0">
88*946379e7Schristos<tr valign="top" align="left">
89*946379e7Schristos<td width="10%"></td><td width="90%">
90*946379e7SchristosIf successful, the <b>textdomain</b> function returns the
91*946379e7Schristoscurrent message domain, after possibly changing it. The
92*946379e7Schristosresulting string is valid until the next <b>textdomain</b>
93*946379e7Schristoscall and must not be modified or freed. If a memory
94*946379e7Schristosallocation failure occurs, it sets <b>errno</b> to
95*946379e7Schristos<b>ENOMEM</b> and returns NULL.</td></table>
96*946379e7Schristos<a name="ERRORS"></a>
97*946379e7Schristos<h2>ERRORS</h2>
98*946379e7Schristos
99*946379e7Schristos<table width="100%" border=0 rules="none" frame="void"
100*946379e7Schristos       cols="2" cellspacing="0" cellpadding="0">
101*946379e7Schristos<tr valign="top" align="left">
102*946379e7Schristos<td width="10%"></td><td width="90%">
103*946379e7SchristosThe following error can occur, among others:</td></table>
104*946379e7Schristos
105*946379e7Schristos<table width="100%" border=0 rules="none" frame="void"
106*946379e7Schristos       cols="2" cellspacing="0" cellpadding="0">
107*946379e7Schristos<tr valign="top" align="left">
108*946379e7Schristos<td width="10%"></td><td width="90%">
109*946379e7Schristos<b>ENOMEM</b></td></table>
110*946379e7Schristos
111*946379e7Schristos<table width="100%" border=0 rules="none" frame="void"
112*946379e7Schristos       cols="2" cellspacing="0" cellpadding="0">
113*946379e7Schristos<tr valign="top" align="left">
114*946379e7Schristos<td width="21%"></td><td width="79%">
115*946379e7SchristosNot enough memory available.</td></table>
116*946379e7Schristos<a name="BUGS"></a>
117*946379e7Schristos<h2>BUGS</h2>
118*946379e7Schristos
119*946379e7Schristos<table width="100%" border=0 rules="none" frame="void"
120*946379e7Schristos       cols="2" cellspacing="0" cellpadding="0">
121*946379e7Schristos<tr valign="top" align="left">
122*946379e7Schristos<td width="10%"></td><td width="90%">
123*946379e7SchristosThe return type ought to be <b>const char *</b>, but is
124*946379e7Schristos<b>char *</b> to avoid warnings in C code predating ANSI
125*946379e7SchristosC.</td></table>
126*946379e7Schristos<a name="SEE ALSO"></a>
127*946379e7Schristos<h2>SEE ALSO</h2>
128*946379e7Schristos
129*946379e7Schristos<table width="100%" border=0 rules="none" frame="void"
130*946379e7Schristos       cols="2" cellspacing="0" cellpadding="0">
131*946379e7Schristos<tr valign="top" align="left">
132*946379e7Schristos<td width="10%"></td><td width="90%">
133*946379e7Schristos<b>gettext</b>(3), <b>ngettext</b>(3),
134*946379e7Schristos<b>bindtextdomain</b>(3),
135*946379e7Schristos<b>bind_textdomain_codeset</b>(3)</td></table>
136*946379e7Schristos<hr>
137*946379e7Schristos</body>
138*946379e7Schristos</html>
139