*nix Documentation Project
·  Home
 +   man pages
·  Linux HOWTOs
·  FreeBSD Tips
·  *niX Forums

  man pages->Linux man pages -> catopen (3)              
Title
Content
Arch
Section
 

CATOPEN(3)

Contents


NAME    [Toc]    [Back]

       catopen, catclose - open/close a message catalog

SYNOPSIS    [Toc]    [Back]

       #include <features.h>
       #include <nl_types.h>

       nl_catd catopen(name, flag)
       char *name;
       int flag;

       void catclose(catalog)
       nl_catd catalog;

DESCRIPTION    [Toc]    [Back]

       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_MES-
       SAGES  category	of  locale  from  a  previous  call to setlocale() and
       defaults to the "C" locale. In the last search path 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.

       catclose() closes the message catalog identified by catalog.  It invalidates
 any subsequent references to the message catalog defined by cat-
       alog.

RETURN VALUE    [Toc]    [Back]

       catopen()  returns a message catalog descriptor of type nl_catd on success.
  On failure, it returns -1.

       catclose() returns 0 on success, or -1 on failure.

NOTES    [Toc]    [Back]

       These functions are only available in libc.so.4.4.4c and above. In  the
       case  of  linux, the catalog descriptor nl_catd is actually a mmap()'ed
       area of memory and not a file descriptor, thus allowing catalogs to  be
       shared.

SEE ALSO    [Toc]    [Back]

      
      
       catgets(3), setlocale(3)



				  1993-11-30			    CATOPEN(3)
[ Back ]
 Similar pages
Name OS Title
catclose Tru64 Close a specified message catalog
catclose FreeBSD close message catalog
catclose NetBSD close message catalog
catclose OpenBSD close message catalog
catopen FreeBSD open message catalog
catopen NetBSD open message catalog
catopen OpenBSD open message catalog
catopen IRIX open/close a message catalogue
dspmsg Tru64 Displays a selected message from a message catalog
catgetmsg IRIX Reads a message from a message catalog
Copyright © 2004-2005 DeniX Solutions SRL
newsletter delivery service