1catgets(3)                 Library Functions Manual                 catgets(3)
2
3
4

NAME

6       catgets - get message from a message catalog
7

LIBRARY

9       Standard C library (libc, -lc)
10

SYNOPSIS

12       #include <nl_types.h>
13
14       char *catgets(nl_catd catalog, int set_number, int message_number,
15                     const char *message);
16

DESCRIPTION

18       catgets() reads the message message_number, in set set_number, from the
19       message catalog identified by catalog, where catalog is a  catalog  de‐
20       scriptor returned from an earlier call to catopen(3).  The fourth argu‐
21       ment, message, points to a default message string  which  will  be  re‐
22       turned  by catgets() if the identified message catalog is not currently
23       available.  The message-text is contained in an  internal  buffer  area
24       and  should  be copied by the application if it is to be saved or modi‐
25       fied.  The return string is always terminated with a null byte ('\0').
26

RETURN VALUE

28       On success, catgets() returns a pointer to an internal buffer area con‐
29       taining  the null-terminated message string.  On failure, catgets() re‐
30       turns the value message.
31

ATTRIBUTES

33       For an  explanation  of  the  terms  used  in  this  section,  see  at‐
34       tributes(7).
35
36       ┌────────────────────────────────────────────┬───────────────┬─────────┐
37Interface                                   Attribute     Value   
38       ├────────────────────────────────────────────┼───────────────┼─────────┤
39catgets()                                   │ Thread safety │ MT-Safe │
40       └────────────────────────────────────────────┴───────────────┴─────────┘
41

STANDARDS

43       POSIX.1-2008.
44

HISTORY

46       POSIX.1-2001.
47
48       The catgets() function is available only in libc.so.4.4.4c and above.
49
50       The  Jan  1987  X/Open  Portability Guide specifies a more subtle error
51       return: message is returned if the message catalog specified by catalog
52       is  not  available,  while an empty string is returned when the message
53       catalog is available but does not contain the specified message.  These
54       two  possible  error  returns seem to be discarded in SUSv2 in favor of
55       always returning message.
56

SEE ALSO

58       catopen(3), setlocale(3)
59
60
61
62Linux man-pages 6.05              2023-07-20                        catgets(3)
Impressum