Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX Reference > C

catgets(3C)

HP-UX 11i Version 3: February 2007
» 

Technical documentation

» Feedback
Content starts here

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

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), findmsg(1), gencat(1), catclose(3C), catopen(3C), thread_safety(5).

STANDARDS CONFORMANCE

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

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1983-2007 Hewlett-Packard Development Company, L.P.