[Go to CFHT Home Page] Man Pages
Back to Software Index  BORDER=0Manpage Top Level
    setcat(3C) manual page Table of Contents

Name

setcat - define default catalog

Synopsis


#include <pfmt.h>
char *setcat(const char *catalog);

MT-Level

MT-safe

Description

The routine setcat() defines the default message catalog to be used by subsequent calls to pfmt(), pfmt() or gettxt() which do not explicitely 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 gettxt(), pfmt() or lfmt() that do not explicitely specify a catalog name will use Message not found!!\n as default string.

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")

See Also

gettxt(3C) , lfmt(3C) , pfmt(3C) , setlocale(3C) , environ(5)


Table of Contents