DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH
 

setcat(S)


setcat -- define default catalog

Syntax

cc ...-lc

#include <pfmt.h>

char *setcat(const char *catalog);

Description

The routine setcat(S) defines the default message catalog to be used by subsequent calls to gettxt(S) or pfmt(S) that 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 results in the return of a pointer to the name of the default message catalog. A pointer to an empty string passed as an argument cancels the default catalog.

If no default catalog is specified, or if catalog is an invalid catalog name, subsequent calls to gettxt( ) or pfmt( ) that do not explicitly specify a catalog name use

   Message not found!!\n
as the default string.

Return values

On success, setcat( ) returns a pointer to the catalog name. On failure, setcat( ) returns a null pointer.

Diagnostics

This function does not set errno.

Examples

The example below demonstrates how you can use the message catalog test for the subsequent call to gettxt( ):
   setcat("test");
   gettxt(":10", "hello world\n");

See also

environ(M), gettxt(S), pfmt(S), setlocale(S)

Standards conformance

setcat(S) is not part of any currently supported standard; it was developed by UNIX System Laboratories, Inc. and is maintained by The SCO Group.
© 2003 Caldera International, Inc. All rights reserved.
SCO OpenServer Release 5.0.7 -- 11 February 2003