man-pages/man3/textdomain.3.html
2021-03-31 01:06:50 +01:00

99 lines
3.0 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML><HEAD><TITLE>Man page of TEXTDOMAIN</TITLE>
</HEAD><BODY>
<H1>TEXTDOMAIN</H1>
Section: C Library Functions (3)<BR>Updated: May 2001<BR><A HREF="#index">Index</A>
<A HREF="/cgi-bin/man/man2html">Return to Main Contents</A><HR>
<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>
textdomain - set domain for future gettext() calls
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>
<PRE>
<B>#include &lt;<A HREF="file:///usr/include/libintl.h">libintl.h</A>&gt;</B>
<B>char * textdomain (const char * </B><I>domainname</I><B>);</B>
</PRE>
<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>
The <B>textdomain</B> function sets or retrieves the current message domain.
<P>
A message domain is a set of translatable <I>msgid</I> messages. Usually,
every software package has its own message domain. The domain name is used
to determine the message catalog where a translation is looked up; it must
be a non-empty string.
<P>
The current message domain is used by the <B>gettext</B>, <B>ngettext</B>
functions, and by the <B>dgettext</B>, <B>dcgettext</B>, <B>dngettext</B> and
<B>dcngettext</B> functions when called with a NULL domainname argument.
<P>
If <I>domainname</I> is not NULL, the current message domain is set to
<I>domainname</I>. The string the function stores internally is a copy of the
<I>domainname</I> argument.
<P>
If <I>domainname</I> is NULL, the function returns the current message domain.
<A NAME="lbAE">&nbsp;</A>
<H2>RETURN VALUE</H2>
If successful, the <B>textdomain</B> function returns the current message
domain, after possibly changing it. The resulting string is valid until the
next <B>textdomain</B> call and must not be modified or freed. If a memory
allocation failure occurs, it sets <B>errno</B> to <B>ENOMEM</B> and returns
NULL.
<A NAME="lbAF">&nbsp;</A>
<H2>ERRORS</H2>
The following error can occur, among others:
<DL COMPACT>
<DT id="1"><B>ENOMEM</B>
<DD>
Not enough memory available.
</DL>
<A NAME="lbAG">&nbsp;</A>
<H2>BUGS</H2>
The return type ought to be <B>const char *</B>, but is <B>char *</B> to avoid
warnings in C code predating ANSI C.
<A NAME="lbAH">&nbsp;</A>
<H2>SEE ALSO</H2>
<B><A HREF="/cgi-bin/man/man2html?3+gettext">gettext</A></B>(3),
<B><A HREF="/cgi-bin/man/man2html?3+ngettext">ngettext</A></B>(3),
<B><A HREF="/cgi-bin/man/man2html?3+bindtextdomain">bindtextdomain</A></B>(3),
<B><A HREF="/cgi-bin/man/man2html?3+bind_textdomain_codeset">bind_textdomain_codeset</A></B>(3)
<P>
<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT id="2"><A HREF="#lbAB">NAME</A><DD>
<DT id="3"><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT id="4"><A HREF="#lbAD">DESCRIPTION</A><DD>
<DT id="5"><A HREF="#lbAE">RETURN VALUE</A><DD>
<DT id="6"><A HREF="#lbAF">ERRORS</A><DD>
<DT id="7"><A HREF="#lbAG">BUGS</A><DD>
<DT id="8"><A HREF="#lbAH">SEE ALSO</A><DD>
</DL>
<HR>
This document was created by
<A HREF="/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:05:58 GMT, March 31, 2021
</BODY>
</HTML>