catgetmsg(3int) [ultrix man page]
catgetmsg(3int) catgetmsg(3int) Name catgetmsg - get message from a message catalog Syntax #include <nl_types.h> char *catgetmsg(catd, set_num, msg_num, buf, buflen) nl_catd catd; int set_num, msg_num, buflen; char *buf; Description The function has been superceded by the function. You should use the function to get messages from a message catalog. You might want to rewrite calls to the function so that they use the function. The function is available for compatibility with XPG-2 conformant software and might not be available in the future. For more information on using see the reference page. The function attempts to read up to buflen -1 bytes of a message string into the area pointed to by buf . The parameter is an integer value containing the size in bytes of buf. The return string is always terminated with a null byte. The parameter catd is a catalog descriptor returned from an earlier call to and identifies the message catalog containing the message set ( set_num) and the program message ( msg_num). The arguments set_num and msg_num are defined as integer values for maximum portability. Where possible, you should use symbolic names for message and set numbers, rather hard-coding integer values into your source programs. If you use symbolic names, you must run prior to and be sure the appropriate include file is used in your program. Return Value If successful, returns a pointer to the message string in buf. Otherwise, if catd is invalid or if set_num or msg_num are not in the mes- sage catalog, returns a pointer to an empty (null) string. See Also intro(3int), gencat(1int), catopen(3int), catgets(3int), nl_types(5int) Guide to Developing International Software catgetmsg(3int)
Check Out this Related Man Page
catgets(3int) catgets(3int) Name catgets - read a program message Syntax #include <nl_types.h> char *catgets (catd, set_num, msg_num, s) nl_catd catd; int set_num, msg_num; char *s; Description The function attempts to read message msg_num in set set_num from the message catalog identified by catd. The parameter catd is a catalog descriptor returned from an earlier call to The pointer, s, points to a default message string. The function returns the default message if the identified message catalog is not currently available. The function stores the message text it returns in an internal buffer area. This buffer area might be written over by a subsequent call to If you want to re-use or modify the message text, you should copy it to another location. The arguments set_num and msg_num are defined as integer values to make programs that contain the call portable. Where possible, you should use symbolic names for message and set numbers, instead of hard-coding integer values into your source programs. If you use sym- bolic names, you must include the header file that creates in all your program modules. Examples The following example shows using the call to retrieve a message from a message catalog that uses symbolic names for set and message num- bers: nl_catd catd = catopen (messages.msf, 0) message = catgets (catd, error_set, bad_value, "Invalid value") When this call executes, searches for the message catalog identified by the catalog descriptor stored in The function searches for the mes- sage identified by the symbolic name in the set identified by the symbolic name and stores the message text in If cannot find the message, it returns the message Invalid value. Return Values If successfully retrieves the message, it returns a pointer to an internal buffer area containing the null terminated message string. If the call is unsuccessful for any reason, catgets returns the default message in s. See Also intro(3int), gencat(1int), catgetmsg(3int), catopen(3int), nl_types(5int) Guide to Developing International Software catgets(3int)