.\" Copyright 1993 Mitchum DSouza .\" .\" Permission is granted to make and distribute verbatim copies of this .\" manual provided the copyright notice and this permission notice are .\" preserved on all copies. .\" .\" Permission is granted to copy and distribute modified versions of this .\" manual under the conditions for verbatim copying, provided that the .\" entire resulting derived work is distributed under the terms of a .\" permission notice identical to this one .\" .\" Since the Linux kernel and libraries are constantly changing, this .\" manual page may be incorrect or out-of-date. The author(s) assume no .\" responsibility for errors or omissions, or for damages resulting from .\" the use of the information contained herein. The author(s) may not .\" have taken the same level of care in the production of this manual, .\" which is licensed free of charge, as they might when working .\" professionally. .\" .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .\" .TH CATOPEN 3 "30 November 1993" .SH NAME catopen, catclose \- open/close a message catalog .SH SYNOPSIS .B #include .br .B #include .LP .nf .ft B nl_catd catopen(name, flag) char *name; int flag; .ft R .fi .LP .nf .ft B void catclose(catalog) nl_catd catalog; .ft R .fi .SH DESCRIPTION .IX "catopen" "" "\fLcatopen\fR \(em open a message catalog" "" .IX "catclose" "" "\fLcatclose\fR \(em close a message catalog" "" .LP .B catopen(\|) opens a message catalog and returns a catalog descriptor. .I name specifies the name of the message catalog to be opened. If .I name specifies and absolute path, (i.e. contains a .RB ` / ' ) then .I name specifies a pathname for the message catalog. Otherwise, the environment variable .SB NLSPATH is used with .I name substituted for .B %N (see .BR locale (5)). If .SB NLSPATH does not exist in the environment, or if a message catalog cannot be opened in any of the paths specified by .BR \s-1NLSPATH\s0 , then the following paths are searched in order .RS .B /etc/locale/LC_MESSAGES .br .B /usr/lib/locale/LC_MESSAGES .br .B /usr/lib/locale/name/LC_MESSAGES .RE In all cases .I LC_MESSAGES stands for the current setting of the .B \s-1LC_MESSAGES\s+1 category of locale from a previous call to .BR setlocale () and defaults to the "C" locale. In the last search path .I name refers to the catalog name. .LP The .I flag argument to catopen is used to indicate the type of loading desired. This should be either .B MCLoadBySet or .BR MCLoadAll . The former value indicates that only the required set from the catalog is loaded into memory when needed, whereas the latter causes the initial call to .BR catopen () to load the entire catalog into memory. .LP .B catclose(\|) closes the message catalog identified by .IR catalog . It invalidates any subsequent references to the message catalog defined by .IR catalog . .LP .SH RETURN VALUES .LP .B catopen(\|) returns a message catalog descriptor of type .I nl_catd on success. On failure, it returns \-1. .\"and sets .\".B errno .\"to indicate the error. .LP .B catclose(\|) returns 0 on success, or -1 on failure. .SH NOTES These functions are only available in libc.so.4.4.4c and above. In the case of linux, the catalog descriptor .I nl_catd is actually a mmap()'ed area of memory and not a file descriptor, thus allowing catalogs to be shared. .SH SEE ALSO .BR catgets (3), .BR setlocale (3)