1BINDTEXTDOMAIN(3)          Library Functions Manual          BINDTEXTDOMAIN(3)
2
3
4

NAME

6       bindtextdomain - set directory containing message catalogs
7

SYNOPSIS

9       #include <libintl.h>
10
11       char * bindtextdomain (const char * domainname, const char * dirname);
12

DESCRIPTION

14       The  bindtextdomain  function  sets the base directory of the hierarchy
15       containing message catalogs for a given message domain.
16
17       A message domain is a set of translatable msgid messages. Usually,  ev‐
18       ery  software  package has its own message domain. The need for calling
19       bindtextdomain arises because packages are not  always  installed  with
20       the  same  prefix  as  the  <libintl.h> header and the libc/libintl li‐
21       braries.
22
23       Message catalogs will be expected at the pathnames dirname/locale/cate‐
24       gory/domainname.mo, where locale is a locale name and category is a lo‐
25       cale facet such as LC_MESSAGES.
26
27       domainname must be a non-empty string.
28
29       If dirname is not NULL, the base directory for message catalogs belong‐
30       ing  to  domain domainname is set to dirname. The function makes copies
31       of the argument strings as needed. If the program wishes  to  call  the
32       chdir  function,  it is important that dirname be an absolute pathname;
33       otherwise it cannot be guaranteed that the  message  catalogs  will  be
34       found.
35
36       If dirname is NULL, the function returns the previously set base direc‐
37       tory for domain domainname.
38

RETURN VALUE

40       If successful, the bindtextdomain function returns the current base di‐
41       rectory  for domain domainname, after possibly changing it. The result‐
42       ing string is valid until the next bindtextdomain call for the same do‐
43       mainname  and  must  not  be  modified or freed. If a memory allocation
44       failure occurs, it sets errno to ENOMEM and returns NULL.
45

ERRORS

47       The following error can occur, among others:
48
49       ENOMEM Not enough memory available.
50

BUGS

52       The return type ought to be const char *, but is char * to avoid  warn‐
53       ings in C code predating ANSI C.
54

SEE ALSO

56       gettext(3),  dgettext(3),  dcgettext(3), ngettext(3), dngettext(3), dc‐
57       ngettext(3), textdomain(3), realpath(3)
58
59
60
61GNU gettext 20220912               May 2001                  BINDTEXTDOMAIN(3)
Impressum