]>
Commit | Line | Data |
---|---|---|
fea681da MK |
1 | .\" Copyright 1993 Mitchum DSouza <m.dsouza@mrc-applied-psychology.cambridge.ac.uk> |
2 | .\" | |
93015253 | 3 | .\" %%%LICENSE_START(VERBATIM) |
fea681da MK |
4 | .\" Permission is granted to make and distribute verbatim copies of this |
5 | .\" manual provided the copyright notice and this permission notice are | |
6 | .\" preserved on all copies. | |
7 | .\" | |
8 | .\" Permission is granted to copy and distribute modified versions of this | |
9 | .\" manual under the conditions for verbatim copying, provided that the | |
10 | .\" entire resulting derived work is distributed under the terms of a | |
11 | .\" permission notice identical to this one. | |
c13182ef | 12 | .\" |
fea681da MK |
13 | .\" Since the Linux kernel and libraries are constantly changing, this |
14 | .\" manual page may be incorrect or out-of-date. The author(s) assume no | |
15 | .\" responsibility for errors or omissions, or for damages resulting from | |
16 | .\" the use of the information contained herein. The author(s) may not | |
17 | .\" have taken the same level of care in the production of this manual, | |
18 | .\" which is licensed free of charge, as they might when working | |
19 | .\" professionally. | |
c13182ef | 20 | .\" |
fea681da MK |
21 | .\" Formatted or processed versions of this manual, if unaccompanied by |
22 | .\" the source, must acknowledge the copyright and authors of this work. | |
4b72fb64 | 23 | .\" %%%LICENSE_END |
fea681da MK |
24 | .\" |
25 | .\" Updated, aeb, 980809 | |
460495ca | 26 | .TH CATGETS 3 2015-08-08 "" "Linux Programmer's Manual" |
fea681da MK |
27 | .SH NAME |
28 | catgets \- get message from a message catalog | |
29 | .SH SYNOPSIS | |
fea681da | 30 | .nf |
b9f02710 | 31 | .B #include <nl_types.h> |
dbfe9c70 | 32 | .PP |
b9f02710 | 33 | .BI "char *catgets(nl_catd " catalog ", int " set_number \ |
c13182ef | 34 | ", int " message_number , |
b9f02710 | 35 | .BI " const char *" message ); |
fea681da | 36 | .fi |
fea681da | 37 | .SH DESCRIPTION |
63aa9df0 | 38 | .BR catgets () |
fea681da MK |
39 | reads the message |
40 | .IR message_number , | |
41 | in set | |
42 | .IR set_number , | |
43 | from the message catalog identified by | |
44 | .IR catalog , | |
45 | where | |
46 | .I catalog | |
47 | is a catalog descriptor returned from an earlier call to | |
48 | .BR catopen (3). | |
e357a0a4 MK |
49 | The fourth argument, |
50 | .IR message , | |
fea681da | 51 | points to a default message string which will be returned by |
63aa9df0 | 52 | .BR catgets () |
c13182ef MK |
53 | if the identified message catalog is not currently available. |
54 | The | |
fea681da | 55 | message-text is contained in an internal buffer area and should be copied by |
c13182ef MK |
56 | the application if it is to be saved or modified. |
57 | The return string is | |
1aff5804 | 58 | always terminated with a null byte (\(aq\\0\(aq). |
47297adb | 59 | .SH RETURN VALUE |
dd3568a1 | 60 | .PP |
fea681da | 61 | On success, |
63aa9df0 | 62 | .BR catgets () |
fea681da MK |
63 | returns a pointer to an internal buffer area |
64 | containing the null-terminated message string. | |
65 | On failure, | |
63aa9df0 | 66 | .BR catgets () |
fea681da MK |
67 | returns the value |
68 | .IR message . | |
8114fa14 | 69 | .SH ATTRIBUTES |
85312567 MK |
70 | For an explanation of the terms used in this section, see |
71 | .BR attributes (7). | |
72 | .TS | |
73 | allbox; | |
74 | lb lb lb | |
75 | l l l. | |
76 | Interface Attribute Value | |
77 | T{ | |
8114fa14 | 78 | .BR catgets () |
85312567 MK |
79 | T} Thread safety MT-Safe |
80 | .TE | |
47297adb | 81 | .SH CONFORMING TO |
e4cb8dcb | 82 | POSIX.1-2001, POSIX.1-2008. |
fea681da | 83 | .SH NOTES |
f4dc1f56 MK |
84 | The |
85 | .BR catgets () | |
86 | function is available only in libc.so.4.4.4c and above. | |
fea681da MK |
87 | The Jan 1987 X/Open Portability Guide specifies a more subtle |
88 | error return: | |
89 | .I message | |
90 | is returned if the message catalog specified by | |
91 | .I catalog | |
92 | is not available, while an empty string is returned | |
93 | when the message catalog is available but does not contain | |
94 | the specified message. | |
68e1685c | 95 | These two possible error returns seem to be discarded in SUSv2 |
d9bfdb9c | 96 | in favor of always returning |
fea681da | 97 | .IR message . |
47297adb | 98 | .SH SEE ALSO |
fea681da MK |
99 | .BR catopen (3), |
100 | .BR setlocale (3) |