jpayne@68: .\" Copyright (c) Bruno Haible jpayne@68: .\" jpayne@68: .\" This is free documentation; you can redistribute it and/or jpayne@68: .\" modify it under the terms of the GNU General Public License as jpayne@68: .\" published by the Free Software Foundation; either version 2 of jpayne@68: .\" the License, or (at your option) any later version. jpayne@68: .\" jpayne@68: .\" References consulted: jpayne@68: .\" GNU glibc-2 source code and manual jpayne@68: .\" GNU gettext source code and manual jpayne@68: .\" LI18NUX 2000 Globalization Specification jpayne@68: .\" jpayne@68: .TH TEXTDOMAIN 3 "May 2001" "GNU gettext 0.22.5" jpayne@68: .SH NAME jpayne@68: textdomain \- set domain for future gettext() calls jpayne@68: .SH SYNOPSIS jpayne@68: .nf jpayne@68: .B #include jpayne@68: .sp jpayne@68: .BI "char * textdomain (const char * " domainname ); jpayne@68: .fi jpayne@68: .SH DESCRIPTION jpayne@68: The \fBtextdomain\fP function sets or retrieves the current message domain. jpayne@68: .PP jpayne@68: A message domain is a set of translatable \fImsgid\fP messages. Usually, jpayne@68: every software package has its own message domain. The domain name is used jpayne@68: to determine the message catalog where a translation is looked up; it must jpayne@68: be a non-empty string. jpayne@68: .PP jpayne@68: The current message domain is used by the \fBgettext\fP, \fBngettext\fP jpayne@68: functions, and by the \fBdgettext\fP, \fBdcgettext\fP, \fBdngettext\fP and jpayne@68: \fBdcngettext\fP functions when called with a NULL domainname argument. jpayne@68: .PP jpayne@68: If \fIdomainname\fP is not NULL, the current message domain is set to jpayne@68: \fIdomainname\fP. The string the function stores internally is a copy of the jpayne@68: \fIdomainname\fP argument. jpayne@68: .PP jpayne@68: If \fIdomainname\fP is NULL, the function returns the current message domain. jpayne@68: .SH "RETURN VALUE" jpayne@68: If successful, the \fBtextdomain\fP function returns the current message jpayne@68: domain, after possibly changing it. The resulting string is valid until the jpayne@68: next \fBtextdomain\fP call and must not be modified or freed. If a memory jpayne@68: allocation failure occurs, it sets \fBerrno\fP to \fBENOMEM\fP and returns jpayne@68: NULL. jpayne@68: .SH ERRORS jpayne@68: The following error can occur, among others: jpayne@68: .TP jpayne@68: .B ENOMEM jpayne@68: Not enough memory available. jpayne@68: .SH BUGS jpayne@68: The return type ought to be \fBconst char *\fP, but is \fBchar *\fP to avoid jpayne@68: warnings in C code predating ANSI C. jpayne@68: .SH "SEE ALSO" jpayne@68: .BR gettext (3), jpayne@68: .BR ngettext (3), jpayne@68: .BR bindtextdomain (3), jpayne@68: .BR bind_textdomain_codeset (3)