gettxt(3C)gettxt(3C)NAMEgettxt() - read text string from message file
The routine retrieves a text string from a message file for the current
msg_id has the following syntax:
where msgfilename is the name of the message file generated by
mkmsgs(1). If msgfilename is NULL, uses the message file specified in
the last call to setcat(3C). msgnumber is the sequence number of the
text string in the message file (the sequence begins at 1).
returns the message
under any of the following conditions:
· msgfilename is an invalid message catalog name.
· No catalog is specified in msg_id or through setcat(3C).
· msgnumber is not a positive number.
· No message could be retrieved and def_str is NULL.
uses the environment variable to determine the locale to use to search
for the msgfilename message file. If is not set, the environment vari‐
able is used. If is not set, the "C" locale will be used. The user
can also change the locale via the setlocale(3C) routine.
If the msgfilename message file is not found in the specified locale or
if the msgnumber is out of bounds, attempts to retrieve the text string
from the "C" locale. def_str is the string returned if a text string
cannot be retrieved even from the "C" locale.
The following code fragments are equivalent:
is to be obsoleted at a future date.
SEE ALSOmkmsgs(1), setcat(3C), setlocale(3C), environ(5), thread_safety(5).
TO BE OBSOLETED gettxt(3C)