1 .\" Copyright 1993 Mitchum DSouza <m.dsouza@mrc-applied-psychology.cambridge.ac.uk>
3 .\" Permission is granted to make and distribute verbatim copies of this
4 .\" manual provided the copyright notice and this permission notice are
5 .\" preserved on all copies.
7 .\" Permission is granted to copy and distribute modified versions of this
8 .\" manual under the conditions for verbatim copying, provided that the
9 .\" entire resulting derived work is distributed under the terms of a
10 .\" permission notice identical to this one.
12 .\" Since the Linux kernel and libraries are constantly changing, this
13 .\" manual page may be incorrect or out-of-date. The author(s) assume no
14 .\" responsibility for errors or omissions, or for damages resulting from
15 .\" the use of the information contained herein. The author(s) may not
16 .\" have taken the same level of care in the production of this manual,
17 .\" which is licensed free of charge, as they might when working
20 .\" Formatted or processed versions of this manual, if unaccompanied by
21 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" Modified Thu Dec 13 22:51:19 2001 by Martin Schulze <joey@infodrom.org>
24 .\" Modified 2001-12-14 aeb
26 .TH CATOPEN 3 2001-12-14
28 catopen, catclose \- open/close a message catalog
30 .B #include <nl_types.h>
32 .BI "nl_catd catopen(const char *" name ", int " flag );
34 .BI "int catclose(nl_catd " catalog );
38 opens a message catalog and returns a catalog descriptor.
39 The descriptor remains valid until
43 If a file descriptor is used to implement catalog descriptors
44 then the FD_CLOEXEC flag will be set.
48 specifies the name of the message catalog to be opened.
51 specifies and absolute path (i.e., contains a '/'),
54 specifies a pathname for the message catalog.
55 Otherwise, the environment variable
63 It is unspecified whether
65 will be used when the process has root privileges.
68 does not exist in the environment,
69 or if a message catalog cannot be opened
70 in any of the paths specified by it,
71 then an implementation defined path is used.
72 This latter default path may depend on the
74 locale setting when the
80 environment variable when the
83 Changing the LC_MESSAGES part of the locale may invalidate
84 open catalog descriptors.
90 is used to indicate the source for the language to use.
93 then it will use the current locale setting for
95 Otherwise it will use the
101 closes the message catalog identified by
103 It invalidates any subsequent references to the message catalog
110 returns a message catalog descriptor of type
113 On failure, it returns (nl_catd) \-1
116 to indicate the error. The possible error values include all
117 possible values for the
123 returns 0 on success, or \-1 on failure.
127 May be the source of the LC_MESSAGES locale setting, and thus
128 determine the language to use if
134 The language to use if
138 The above is the POSIX 1003.1-2001 description.
139 The glibc value for NL_CAT_LOCALE is 1.
140 (Compare MCLoadAll below.)
141 The default path varies, but usually looks at a number of places below
142 .IR /usr/share/locale .
143 .SH "NOTES FOR LIBC4 AND LIBC5"
144 These functions are available for Linux since libc 4.4.4c.
145 In the case of linux libc4 and libc5, the catalog descriptor
149 area of memory and not a file descriptor.
159 The former value indicates that a set from the catalog is to be
160 loaded when needed, whereas the latter causes the initial call to
162 to load the entire catalog into memory.
163 The default search path varies, but usually looks at a number of places below
166 .IR /usr/lib/locale .
169 In XPG 1987, Vol. 3 it says:
170 .I "The flag argument of catopen is reserved for future use"
171 .IR "and should be set to 0" .
172 It is unclear what the source was for the constants MCLoadBySet