1 .\" Copyright 1993 Mitchum DSouza <m.dsouza@mrc-applied-psychology.cambridge.ac.uk>
3 .\" %%%LICENSE_START(VERBATIM)
4 .\" Permission is granted to make and distribute verbatim copies of this
5 .\" manual provided the copyright notice and this permission notice are
6 .\" preserved on all copies.
8 .\" Permission is granted to copy and distribute modified versions of this
9 .\" manual under the conditions for verbatim copying, provided that the
10 .\" entire resulting derived work is distributed under the terms of a
11 .\" permission notice identical to this one.
13 .\" Since the Linux kernel and libraries are constantly changing, this
14 .\" manual page may be incorrect or out-of-date. The author(s) assume no
15 .\" responsibility for errors or omissions, or for damages resulting from
16 .\" the use of the information contained herein. The author(s) may not
17 .\" have taken the same level of care in the production of this manual,
18 .\" which is licensed free of charge, as they might when working
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
25 .\" Modified Thu Dec 13 22:51:19 2001 by Martin Schulze <joey@infodrom.org>
26 .\" Modified 2001-12-14 aeb
28 .TH CATOPEN 3 2021-03-22 "GNU" "Linux Programmer's Manual"
30 catopen, catclose \- open/close a message catalog
33 .B #include <nl_types.h>
35 .BI "nl_catd catopen(const char *" name ", int " flag );
36 .BI "int catclose(nl_catd " catalog );
41 opens a message catalog and returns a catalog descriptor.
42 The descriptor remains valid until
46 If a file descriptor is used to implement catalog descriptors,
53 specifies the name of the message catalog to be opened.
56 specifies an absolute path (i.e., contains a \(aq/\(aq),
59 specifies a pathname for the message catalog.
60 Otherwise, the environment variable
68 It is unspecified whether
70 will be used when the process has root privileges.
73 does not exist in the environment,
74 or if a message catalog cannot be opened
75 in any of the paths specified by it,
76 then an implementation defined path is used.
77 This latter default path may depend on the
79 locale setting when the
85 environment variable when the
90 part of the locale may invalidate
91 open catalog descriptors.
97 is used to indicate the source for the language to use.
100 then it will use the current locale setting for
102 Otherwise, it will use the
104 environment variable.
108 closes the message catalog identified by
110 It invalidates any subsequent references to the message catalog
116 returns a message catalog descriptor of type
119 On failure, it returns
123 to indicate the error.
124 The possible error values include all
125 possible values for the
131 returns 0 on success, or \-1 on failure.
135 May be the source of the
137 locale setting, and thus
138 determine the language to use if
144 The language to use if
148 For an explanation of the terms used in this section, see
156 Interface Attribute Value
159 T} Thread safety MT-Safe env
162 T} Thread safety MT-Safe
168 POSIX.1-2001, POSIX.1-2008.
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" .
173 .\" It is unclear what the source was for the constants
179 The above is the POSIX.1 description.
186 The default path varies, but usually looks at a number of places below
187 .IR /usr/share/locale .
189 .\" These functions are available for Linux since libc 4.4.4c.
190 .\" In the case of linux libc4 and libc5, the catalog descriptor
194 .\" area of memory and not a file descriptor.
204 .\" The former value indicates that a set from the catalog is to be
205 .\" loaded when needed, whereas the latter causes the initial call to
207 .\" to load the entire catalog into memory.
208 .\" The default search path varies, but usually looks at a number of places below
211 .\" .IR /usr/lib/locale .