Programming Guide |
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
, supplyNULL
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.
C only
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 ofclass
andmsg_prefix
. When Panther reads messages of prefixmsg_prefix
from the file, it numbers them sequentially, starting fromclass*4096
. Later, you can access these messages through sm_msg_get or sm_msgfind.This function has three variants:
sm_d_msg_read
reads from the default message file specified by the environment variableSMMSGS
.
sm_n_msg_read
reads from a named binary message file.
sm_msg_read
reads from a message file already loaded into memory.
sm_msg_del, sm_msg_get, sm_msgfind