1 <!-- Creator : groff version 1.22.2 -->
2 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
3 "http://www.w3.org/TR/html4/loose.dtd">
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 }
15 <title>TEXTDOMAIN</title>
20 <h1 align="center">TEXTDOMAIN</h1>
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>
38 <p style="margin-left:11%; margin-top: 1em">textdomain
39 − set domain for future gettext() calls</p>
42 <a name="SYNOPSIS"></a>
46 <p style="margin-left:11%; margin-top: 1em"><b>#include
47 <libintl.h></b></p>
49 <p style="margin-left:11%; margin-top: 1em"><b>char *
50 textdomain (const char *</b> <i>domainname</i><b>);</b></p>
53 <a name="DESCRIPTION"></a>
57 <p style="margin-left:11%; margin-top: 1em">The
58 <b>textdomain</b> function sets or retrieves the current
61 <p style="margin-left:11%; margin-top: 1em">A message
62 domain is a set of translatable <i>msgid</i> messages.
63 Usually, every software package has its own message domain.
64 The domain name is used to determine the message catalog
65 where a translation is looked up; it must be a non-empty
68 <p style="margin-left:11%; margin-top: 1em">The current
69 message domain is used by the <b>gettext</b>,
70 <b>ngettext</b> functions, and by the <b>dgettext</b>,
71 <b>dcgettext</b>, <b>dngettext</b> and <b>dcngettext</b>
72 functions when called with a NULL domainname argument.</p>
74 <p style="margin-left:11%; margin-top: 1em">If
75 <i>domainname</i> is not NULL, the current message domain is
76 set to <i>domainname</i>. The string the function stores
77 internally is a copy of the <i>domainname</i> argument.</p>
79 <p style="margin-left:11%; margin-top: 1em">If
80 <i>domainname</i> is NULL, the function returns the current
84 <a name="RETURN VALUE"></a>
88 <p style="margin-left:11%; margin-top: 1em">If successful,
89 the <b>textdomain</b> function returns the current message
90 domain, after possibly changing it. The resulting string is
91 valid until the next <b>textdomain</b> call and must not be
92 modified or freed. If a memory allocation failure occurs, it
93 sets <b>errno</b> to <b>ENOMEM</b> and returns NULL.</p>
100 <p style="margin-left:11%; margin-top: 1em">The following
101 error can occur, among others:</p>
103 <table width="100%" border="0" rules="none" frame="void"
104 cellspacing="0" cellpadding="0">
105 <tr valign="top" align="left">
106 <td width="11%"></td>
110 <p><b>ENOMEM</b></p></td>
115 <p>Not enough memory available.</p></td>
125 <p style="margin-left:11%; margin-top: 1em">The return type
126 ought to be <b>const char *</b>, but is <b>char *</b> to
127 avoid warnings in C code predating ANSI C.</p>
130 <a name="SEE ALSO"></a>
135 <p style="margin-left:11%; margin-top: 1em"><b>gettext</b>(3),
136 <b>ngettext</b>(3), <b>bindtextdomain</b>(3),
137 <b>bind_textdomain_codeset</b>(3)</p>