# man > textdomain(3)

[_TEXTDOMAIN_(3)](https://www.chedong.com/phpMan.php/man/TEXTDOMAIN/3/markdown)                         Library Functions Manual                         [_TEXTDOMAIN_(3)](https://www.chedong.com/phpMan.php/man/TEXTDOMAIN/3/markdown)

## NAME
       textdomain - set domain for future gettext() calls

## SYNOPSIS
### #include <libintl.h>

       **char * textdomain (const char * _**domainname_**);**

## DESCRIPTION
       The **textdomain **function sets or retrieves the current message domain.

       A message domain is a set of translatable _msgid_ 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.

       The current message domain is used by the **gettext**, **ngettext **functions, and by  the  **dgettext**,
       **dcgettext**, **dngettext **and **dcngettext **functions when called with a NULL domainname argument.

       If  _domainname_  is  not NULL, the current message domain is set to _domainname_. The string the
       function stores internally is a copy of the _domainname_ argument.

       If _domainname_ is NULL, the function returns the current message domain.

## RETURN VALUE
       If successful, the **textdomain **function returns the current  message  domain,  after  possibly
       changing  it.  The  resulting  string is valid until the next **textdomain **call and must not be
       modified or freed. If a memory allocation failure occurs, it sets **errno **to **ENOMEM **and returns
       NULL.

## ERRORS
       The following error can occur, among others:

       **ENOMEM **Not enough memory available.

## BUGS
       The return type ought to be **const char ***, but is **char * **to avoid warnings in C code predating
       ANSI C.

## SEE ALSO
       [**gettext**(3)](https://www.chedong.com/phpMan.php/man/gettext/3/markdown), [**ngettext**(3)](https://www.chedong.com/phpMan.php/man/ngettext/3/markdown), [**bindtextdomain**(3)](https://www.chedong.com/phpMan.php/man/bindtextdomain/3/markdown), [**bind_textdomain_codeset**(3)](https://www.chedong.com/phpMan.php/man/bindtextdomaincodeset/3/markdown)

GNU gettext 0.20.1.124-32cf                   May 2001                                 [_TEXTDOMAIN_(3)](https://www.chedong.com/phpMan.php/man/TEXTDOMAIN/3/markdown)
