1catgets(3C)              Standard C Library Functions              catgets(3C)
2
3
4

NAME

6       catgets - read a program message
7

SYNOPSIS

9       #include <nl_types.h>
10
11       char *catgets(nl_catd catd, int set_num, int msg_num, const char *s);
12
13

DESCRIPTION

15       The  catgets()  function  attempts  to  read  message  msg_num,  in set
16       set_num, from the message catalog identified by  catd. The  catd  argu‐
17       ment  is  a  catalog  descriptor  returned  from  an  earlier  call  to
18       catopen(). The s argument points to a default message string which will
19       be returned by  catgets() if the identified message catalog is not cur‐
20       rently available.
21

RETURN VALUES

23       If the identified message is retrieved successfully,  catgets() returns
24       a  pointer  to  an internal buffer area containing the  null terminated
25       message string. If the call is unsuccessful for any  reason,  catgets()
26       returns a pointer to s and errno may be set to indicate the error.
27

ERRORS

29       The catgets() function may fail if:
30
31       EBADF      The  catd argument is not a valid message catalogue descrip‐
32                  tor open for reading.
33
34
35       EBADMSG    The number of %n  specifiers  that  appear  in  the  message
36                  string specified by s does not match the number of %n speci‐
37                  fiers that appear in the message identified  by  set_id  and
38                  msg_id in the specified message catalog.
39
40
41       EINTR      The  read  operation  was terminated due to the receipt of a
42                  signal, and no data was transferred.
43
44
45       EINVAL     The message catalog identified by catd is corrupted.
46
47
48       ENOMSG     The message identified by set_id and msg_id is  not  in  the
49                  message catalog.
50
51

USAGE

53       The catgets() function can be used safely in multithreaded applications
54       as long as setlocale(3C) is not being called to change the locale.
55

ATTRIBUTES

57       See attributes(5) for descriptions of the following attributes:
58
59
60
61
62       ┌─────────────────────────────┬─────────────────────────────┐
63       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
64       ├─────────────────────────────┼─────────────────────────────┤
65       │Interface Stability          │Standard                     │
66       ├─────────────────────────────┼─────────────────────────────┤
67       │MT-Level                     │MT-Safe                      │
68       └─────────────────────────────┴─────────────────────────────┘
69

SEE ALSO

71       gencat(1),  catclose(3C),  catopen(3C),   gettext(3C),   setlocale(3C),
72       attributes(5), standards(5)
73
74
75       International Language Environments Guide
76
77
78
79SunOS 5.11                        22 Mar 2002                      catgets(3C)
Impressum