Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

setcat(3c) [opensolaris 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.11 29 Dec 1996 setcat(3C)

Check Out this Related Man Page

addsev(3C)						   Standard C Library Functions 						addsev(3C)

NAME
addsev - define additional severities SYNOPSIS
#include <pfmt.h> int addsev(int int_val, const char *string); DESCRIPTION
The addsev() function defines additional severities for use in subsequent calls to pfmt(3C) or lfmt(3C). It associates an integer value int_val in the range [5-255] with a character string, overwriting any previous string association between int_val and string. If int_val is OR-ed with the flags argument passed to subsequent calls to pfmt() or lfmt(), string will be used as severity. Passing a null string removes the severity. RETURN VALUES
Upon successful completion, addsev() returns 0. Otherwise it returns-1. USAGE
Only the standard severities are automatically displayed for the locale in effect at runtime. An application must provide the means for displaying locale-specific versions of add-on severities. Add-on severities are only effective within the applications defining them. EXAMPLES
Example 1 Example of addsev() function. The following example #define Panic 5 setlabel("APPL"); setcat("my_appl"); addsev(Panic, gettxt(":26", "PANIC")); /* ... */ lfmt(stderr, MM_SOFT|MM_APPL|PANIC, ":12:Cannot locate database "); will display the message to stderr and forward to the logging service APPL: PANIC: Cannot locate database 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), attributes(5) SunOS 5.11 29 Dec 1996 addsev(3C)
Man Page

Featured Tech Videos