setcat(3C) DG/UX 5.4R3.00 setcat(3C)
NAME
setcat - define default catalog
SYNOPSIS
#include <pfmt.h>
char *setcat(const char *catalog);
DESCRIPTION
The routine setcat() defines the default message catalog to be used
by subsequent calls to pfmt(), pfmt() or gettxt() which do not
explicitly specify a message catalog.
catalog must be limited to 14 characters. These characters must be
selected from a set of all characters values, excluding \0 (null) and
the ASCII codes for / (slash) and : (colon).
setcat() 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 pfmt() or lfmt() that do not
explicitly specify a catalog name will use Message not found!!\n as
default string.
Considerations for Threads Programming
+---------+-----------------------------+
| | async- |
|function | reentrant cancel cancel |
| | point safe |
+---------+-----------------------------+
|setcat | Y N N |
+---------+-----------------------------+
Calls to setcat will change the default message catalogue for the
threads in a process. The change occurs immediately and wiil become
evident the next time the default catalogue is accessed.
setcat should be called when the other threads in a process are not
changing LCMESSAGES database. See the setlocale(3C) man page for
more information.
RETURN VALUE
Upon success, setcat() returns a pointer to the catalog name. Upon
failure, setcat() returns a NULL pointer.
EXAMPLE
setcat("test");
gettxt(":10", "hello world\n")
Licensed material--property of copyright holder(s) 1
setcat(3C) DG/UX 5.4R3.00 setcat(3C)
SEE ALSO
reentrant(3), gettxt(3C), lfmt(3C), pfmt(3C), setlocale(3C),
environ(5).
Licensed material--property of copyright holder(s) 2