Previous Next

dce_msg_define_msg_table(3dce)

Adds a message table to in-memory table

Synopsis

#include <dce/dce_msg.h>

void dce_msg_define_msg_table(

dce_msg_table_t *table,

unsigned32 count,

error_status_t *status);

Parameters

Input

table
A message table structure (defined in a header file generated by sams during compilation (see Examples).

count
The number of elements contained in the table.

Output

status
Returns the status code from this operation. The status code is a value that indicates whether the routine completed successfully and if not, why not.

Description
All messages for a given component are stored in a single message catalog generated by the sams utility when the component (application) is built.

However, the messages may also be compiled directly into the component code, thus rendering the successful retrieval of message text independent of whether or not the message catalogs were correctly installed. Generation of in-memory message tables is specified by the incatalog flag in the sams file in which the message text is defined (see sams(1dce) for more information on sams files). If the messages have been generated at compile time with this option specified, the dce_msg_define_msg_table( ) routine can be called by the application to register an in-memory table containing the messages.

The table parameter to the call should identify a message table structure defined in a header file generated by sams during compilation (see Examples). The count parameter specifies the number of elements contained in the table. If an error is detected during the call, the routine will return an appropriate error code in the status parameter.

Examples
The following code fragment shows how an application (whose serviceability component name is app) would set up an in-memory message table:

#include <dce/dce.h>$
#include <dce/dce_msg.h>$
#include <dce/dcesvcmsg.h>$
#include "dceappmsg.h" /* defines app_msg_table */

error_status_t status;

The following call adds the message table to the in-memory table. Note that you must include <dce/dce_msg.h>. You also have to link in dceappmsg.o and dceappsvc.o (object files produced by compiling sams-generated .c files), which contain the code for the messages and the table, respectively.

dce_msg_define_msg_table(app_msg_table,

sizeof(app_msg_table) / sizeof(app_msg_table[0]),

&status);

Errors

The following describes a partial list of errors that might be returned. Refer to the OSF DCE Problem Determination Guide for complete descriptions of all error messages.

See dce_msg_get(3dce)

Related Information
Functions: dce_msg_get(3dce)

dce_msg_get_msg(3dce)

dce_msg_get_default_msg(3dce)