DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

setcat(S-osr5)


setcat -- define default catalog

Syntax

cc ...-lc

#include <pfmt.h>

char *setcat(const char *catalog);

Description

The routine setcat(S-osr5) defines the default message catalog to be used by subsequent calls to gettxt(S-osr5) or pfmt(S-osr5) 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-osr5), pfmt(S-osr5), setlocale(S-osr5)

Standards conformance

setcat(S-osr5) is not part of any currently supported standard; it was developed by UNIX System Laboratories, Inc. and is maintained by The SCO Group.
© 2005 The SCO Group, Inc. All rights reserved.
SCO OpenServer Release 6.0.0 -- 02 June 2005