Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

gettxt(3) [osf1 man page]

gettxt(3)						     Library Functions Manual							 gettxt(3)

NAME
gettxt - Retrieves a text string from a message catalog LIBRARY
Standard C Library (libc.so, libc.a) SYNOPSIS
#include <unistd.h> char *gettxt ( const char *msgid const char *dflt_str ); PARAMETERS
Specifies the message identification string. The format of this string is discussed in more detail below. Specifies the default string to use if the identified string is not found. DESCRIPTION
A message catalog contains text strings that can be accessed by programs. Message catalogs are created using the gencat and mkcatdefs com- mands. The gettxt function searches a message catalog for a specified text string. If the text string is available, it is returned. If attempts to retrieve the text string do not succeed, the specified default text string is used. You can request that messages be displayed in a specific language by setting environment variables. Likewise, you can also change the lan- guage in which the messages are displayed by invoking the setlocale function with the appropriate arguments. To retrieve a text string, the program must use the following format when specifying the msgid parameter: [msgfilename]:msgnumber The arguments are defined as follows: Specifies the message catalog that contains the localized version of the text string. Characters in the text string can be any set of characters excluding null (), the ASCII symbols for slash (/), and the colon (:). Specified as a posi- tive number only, this argument denotes the index of the text string in the message catalog. If the text string specified does not exist in the catalog associated with the locale setting, or if the message number exceeds the bounds of the catalog, attempts are made to retrieve this message from the catalog for the C locale. Should the second attempt be unsuccessful, the text string specified by the dflt_str is used. RETURN VALUES
The string Message not found!! is returned if the value for the msgfilename argument is invalid, a catalog number has not been specified, the value for msgnumber is not a positive number, or a message could not be retrieved and the dflt_str parameter was not specified. ERRORS
No errors are defined for this function. RESTRICTIONS
On this operating system, the gettxt function parses the directory locale as described on the catopen(3) and catgets(3) reference pages. RELATED INFORMATION
Commands: gencat(1), mkcatdefs(1) Functions: catgets(3), catopen(3) delim off gettxt(3)

Check Out this Related Man Page

setcat(3C)						   Standard C Library Functions 						setcat(3C)

NAME
setcat - define default catalog SYNOPSIS
#include <pfmt.h> char *setcat(const char *catalog); DESCRIPTION
The setcat() function defines the default message catalog to be used by subsequent calls to gettxt(3C), lfmt(3C), or pfmt(3C) that do not explicitly specify a message catalog. The catalog argument must be limited to 14 characters. These characters must be selected from a set of all characters values, excluding (null) and the ASCII codes for / (slash) and : (colon). The setcat() function assumes that the catalog exists. No checking is done on the argument. A null pointer passed as an argument will result in the return of a pointer to the current default message catalog name. A pointer to an empty string passed as an argument will cancel the default catalog. If no default catalog is specified, or if catalog is an invalid catalog name, subsequent calls to gettxt(3C), lfmt(3C), or pfmt(3C) that do not explicitely specify a catalog name will use Message not found!! as default string. RETURN VALUES
Upon successful completion, setcat() returns a pointer to the catalog name. Otherwise, it returns a null pointer. EXAMPLES
Example 1: Example of setcat() function. setcat("test"); gettxt(":10", "hello world ") ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |MT-Level |MT-Safe | +-----------------------------+-----------------------------+ SEE ALSO
gettxt(3C), lfmt(3C), pfmt(3C), setlocale(3C), attributes(5), environ(5) SunOS 5.10 29 Dec 1996 setcat(3C)
Man Page