MessGetMsg - Return message text for a given message number.

Function

Return message text for a given message number.

Description

Searches the known message facilities for a message of the given number. In this search, the severity of the supplied message number is ignored. If found, a message string is constructed according to the details requested in the flags argument. The format is-

"%FACILITY-S-NAME, {\tt text}"

where-

FACILITY The name of the correspond facility.
S The severity of the message, as supplied in the call to this routine (The same message can have different severities).
NAME The message name.
text The text associated with the message.

If the message cannot be found, a suitable default text is returned. As a special case, the message number 0 is always defined and returns an appropriate OK text.

When running under VMS the behaviour changes. If a message cannot be found, then the SYS$GETMSG system service is called to attempt to find the message in the VMS tables. This will work if the message is a VMS system message or the message is known to the current process (either an object file generated by message/object is linked to the current image or a "set message" command has been used to add the message to the current process)

Language

C

Call

(int) = MessGetMsg (msgid, flags, buflen, buffer)

Parameters

(">" input, "!" modified, "W" workspace, "<" output)

>msgidStatusTypeThe identification of the message to be retrieved.
>flagsIntMessage components to be returned. Set the following bits true to include the component -

MESS_M_TEXT Message text.
MESS_M_IDENT Message identifier.
MESS_M_SEVERITY Message severity indicator.
MESS_M_FACILITY Facility name.

If flags is 0, then the default flags, set by MessSetFlags, is used. If MessSetFlags has not been called, then all are set true, except under VMS, where the processes VMS message mask is used.

>buflenInt *The length of buffer.
>bufferChar *The buffer to place the message in. If it is too long, then the message is truncated.

Include files

mess.h

External functions used

strncatCRTL Concentrate one string to another.
sprintfCRTL Formated print to a string.
lib$getjpiVMS-RTL (VMS version only) Get job process information.
sys$getmsgVMS (VMS version only) Get VMS message text.

Function value

Return 1 if the message is found and 0 if it is not.

External values used

None

Prior requirements

None

Support

Tony Farrell, AAO

Click here for the DRAMA home page and here for the AAO home page.

 For more information, contact tony.farrell@mq.edu.au