HPlogo HP-UX Reference Volume 4 of 5 > c

catgets(3C)

» 

Technical documentation

Complete book in PDF

 » Table of Contents

 » Index

NAME

catgets() — get a program message

SYNOPSIS

#include <nl_types.h>

char *catgets( nl_catd catd, int set_num, int msg_num, const char *def_str );

DESCRIPTION

The catgets() function reads message msg_num in set set_num from the message catalog identified by catd, a catalog descriptor returned from a previous call to catopen() (see catopen(3C)). If the call fails, def_str points to a default message string returned by catgets().

A message longer than NL_TEXTMAX bytes is truncated. The returned message string is always terminated with a null byte. NL_TEXTMAX is defined in <limits.h>.

APPLICATION USAGE.

catgets() is thread-safe. It is not async-cancel-safe. A cancellation point may occur when a thread is executing catgets().

EXTERNAL INFLUENCES

International Code Set Support

Single- and multi-byte character code sets are supported.

RETURN VALUE

If the call is successful, catgets() returns a pointer to an internal buffer area containing the null-terminated message string. If the call is unsuccessful, catgets() returns a pointer to def_str.

ERRORS

catgets() fails and sets errno under any of the following conditions:

[EBADF]

catd is not a valid catalog descriptor.

[EINTR]

A signal was caught during the read(2) system call.

[EINVAL]

The message catalog identified by catd is corrupted.

[ENOMSG]

The message identified by set_num or msg_num is not in the message catalog.

[ERANGE]

A message longer than NL_TEXTMAX bytes was truncated.

WARNINGS

The catgets() function returns a pointer to a static area that is overwritten on each call.

AUTHOR

catgets() was developed by HP.

FILES

/usr/include/nl_types.h

SEE ALSO

dumpmsg(1), gencat(1), catclose(3C), catopen(3C).

STANDARDS CONFORMANCE

catgets(): AES, SVID3, XPG2, XPG3, XPG4

© Hewlett-Packard Development Company, L.P.