Previous Next

dce_msg_get_default_msg(3dce)

Retrieves DCE message from in-memory tables

Synopsis

#include <dce/dce_msg.h>

unsigned char *dce_msg_get_default_msg(

unsigned32 message,

error_status_t *status);

Parameters

Input

message
ID of message to be retrieved.

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
The dce_msg_get_default_msg( ) routine retrieves a message from the application's in-memory tables. It returns a pointer to static space that should not be freed. If the specified message (which is a 32-bit DCE message ID as described in dce_error_inq_text(3dce)) cannot be found in the in-memory tables, the routine returns NULL and fills in status with the appropriate error code.

This routine should be used only for message strings that will never have to be translated (see dce_msg_translate_table(3dce)).

All messages for a given component are stored in a single message catalog generated by the sams utility when the component is built. 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 set up an in-memory table containing the messages.

Examples
The following code fragment shows how dce_msg_get_default_msg( ) might be called to retrieve the in-memory copy of a message defined by a DCE application (whose serviceability component name is app):

#include <dce/dce.h>
#include <dce/dce_msg.h>$
#include <dce/dcesvcmsg.h>$
#include "dceappmsg.h" /* ''test_msg'' is defined in this file */

unsigned char *my_msg;
error_status_t status;

<. . .>

my_msg = dce_msg_get_default_msg(test_msg, &status);
printf("Message is: %s\n", my_msg);

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_define_msg_table(3dce)

dce_msg_get(3dce)

dce_msg_get_msg(3dce)