Programming Guide



sm_*msg_read

Reads messages from a message file

#include <smerror.h>
int sm_msg_read(char *msg_prefix, int class, int no_replace, char *msgfile);
int sm_d_msg_read(char *msg_prefix, int class, int no_replace);
int sm_n_msg_read(char *msg_prefix, int class, int no_replace, char *msgfile);

msg_prefix
Specifies to read messages of this prefix within message class class. Panther messages have the following prefixes:

DM

Database interface

DM_TM

Transaction manager

FM

Editor

JM

Panther runtime

JV

Java

SM

Screen manager

TP

Three-tier (JetNet/Tuxedo)

UT

Utilities

WB

Web

To read all messages in class, supply NULL or empty string "".

class
Specifies the class of messages to read, where 0-7 are reserved for user-defined message classes, and the following classes, defined in smerror.h, are reserved for Panther:

DM_MSGS

UT_MSGS

SM_MSGS

WB_MSGS

TP_MSGS

If the message file is not divided into sections, supply a value of 0.

no_replace
Boolean flag. If set to other than 0 (true), an existing message set of the same class already loaded into memory is not replaced.

msgfile
Specifies the message file.

Environment

C only

Returns

Description

sm_msg_read and its variants let you read a set of messages from a binary message file. The set of messages from the message file that is read is determined by the values of class and msg_prefix. When Panther reads messages of prefix msg_prefix from the file, it numbers them sequentially, starting from class*4096. Later, you can access these messages through sm_msg_get or sm_msgfind.

This function has three variants:

See Also

sm_msg_del, sm_msg_get, sm_msgfind