futex.2: Rework the description of FUTEX_LOCK_PI2
[man-pages.git] / man3 / catgets.3
blob737689fe2f0f4e75d381fe970228066ca38b87dc
1 .\" Copyright 1993 Mitchum DSouza <m.dsouza@mrc-applied-psychology.cambridge.ac.uk>
2 .\"
3 .\" %%%LICENSE_START(VERBATIM)
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.
12 .\"
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.
20 .\"
21 .\" Formatted or processed versions of this manual, if unaccompanied by
22 .\" the source, must acknowledge the copyright and authors of this work.
23 .\" %%%LICENSE_END
24 .\"
25 .\" Updated, aeb, 980809
26 .TH CATGETS 3 2021-03-22 "" "Linux Programmer's Manual"
27 .SH NAME
28 catgets \- get message from a message catalog
29 .SH SYNOPSIS
30 .nf
31 .B #include <nl_types.h>
32 .PP
33 .BI "char *catgets(nl_catd " catalog ", int " set_number \
34 ", int " message_number ,
35 .BI "              const char *" message );
36 .fi
37 .SH DESCRIPTION
38 .BR catgets ()
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).
49 The fourth argument,
50 .IR message ,
51 points to a default message string which will be returned by
52 .BR catgets ()
53 if the identified message catalog is not currently available.
54 The
55 message-text is contained in an internal buffer area and should be copied by
56 the application if it is to be saved or modified.
57 The return string is
58 always terminated with a null byte (\(aq\e0\(aq).
59 .SH RETURN VALUE
60 On success,
61 .BR catgets ()
62 returns a pointer to an internal buffer area
63 containing the null-terminated message string.
64 On failure,
65 .BR catgets ()
66 returns the value
67 .IR message .
68 .SH ATTRIBUTES
69 For an explanation of the terms used in this section, see
70 .BR attributes (7).
71 .ad l
72 .nh
73 .TS
74 allbox;
75 lbx lb lb
76 l l l.
77 Interface       Attribute       Value
79 .BR catgets ()
80 T}      Thread safety   MT-Safe
81 .TE
82 .hy
83 .ad
84 .sp 1
85 .SH CONFORMING TO
86 POSIX.1-2001, POSIX.1-2008.
87 .SH NOTES
88 The
89 .BR catgets ()
90 function is available only in libc.so.4.4.4c and above.
91 The Jan 1987 X/Open Portability Guide specifies a more subtle
92 error return:
93 .I message
94 is returned if the message catalog specified by
95 .I catalog
96 is not available, while an empty string is returned
97 when the message catalog is available but does not contain
98 the specified message.
99 These two possible error returns seem to be discarded in SUSv2
100 in favor of always returning
101 .IR message .
102 .SH SEE ALSO
103 .BR catopen (3),
104 .BR setlocale (3)