nl_catd catopen(name, flag) char *name; int flag;
catopen() opens a message catalog and returns a catalog descriptor. name specifies the name of the message catalog to be opened. If name specifies and absolute path, (i.e. contains a `/') then name specifies a pathname for the message catalog. Otherwise, the environment variable NLSPATH is used with name substituted for %N (see locale(7)). If NLSPATH does not exist in the environment, or if a message catalog cannot be opened in any of the paths specified by NLSPATH , then the following paths are searched in order
/etc/locale/LC_MESSAGES /usr/lib/locale/LC_MESSAGES /usr/lib/locale/name/LC_MESSAGES
In all cases LC_MESSAGES stands for the current setting of the LC_MESSAGES category of locale from a previous call to setlocale() and defaults to the __name'' refers to the catalog name.
The flag argument to catopen is used to indicate the type of loading desired. This should be either MCLoadBySet or 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 catopen() to load the entire catalog into memory.