KCMS CMM Developer's Guide

Header File

In addition to the two functions, findErrDesc() and findWarningDesc(), you need to provide a header file to incorporate status messages into your code. The header file should contain the following:

#define

<identifier> <status

number>

This define links a status identifier (for example, KCS_SOLARIS_FILE_NAME_NULL) with a hexadecimal status identification number (for example, 0x4203). You can assign numbers to your own status numbers that are not used by the KCMS library and only in the following specified ranges:

The header file should also contain your OwnerID (for example, SolMsgOwner) by which these messages are distinguished from the KCMS default messages.

The setId() function is one of the KcsStatus class methods.

status->setId(KCS_SOLARIS_FILE_NOT_FOUND,

SolMsgOwner);

It sets an ID (OwnerID) that tells the KcsStatus class function, getDescription(), that it is not a KCMS library error and to search the OWconfig file for a dynamically loadable module containing the matching error descriptions.

This example also contains code that prepares the message strings for language localization. You must setlocale(3C) and bindtextdomain(3I) once, so choose a unique define with which to ifdef these functions. Also choose a message file name for the message extraction script, xgettext(3I), in the makefile.