Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

catopen(3C)

catgetmsg(3C)

catgets(3C)

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

catgets() 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)). def_str points to a default message string returned by catgets() if the call fails. 

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>. 

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 if the following condition is encountered:

[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] Message identified by set_num or msg_num is not in the message catalog. 

[ERANGE] A message longer than NL_TEXTMAX bytes was truncated. 

catgets() fails and errno if any of the following conditions are encountered:

WARNINGS

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

AUTHOR

catgets() was developed by HP. 

SEE ALSO

catopen(3C), catgetmsg(3C). 

STANDARDS CONFORMANCE

catgets(): AES, XPG2, XPG3, XPG4

Hewlett-Packard Company  —  HP-UX Release 9.0: August 1992

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026