GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> EMSG / dev > emsg_st / rhel5-64
#include <stdarg.h>
#include <time.h>
Classes | |
struct | _EMSG_MsgList |
List of messages used at run time. More... | |
struct | _EMSG_FacList |
List of facilities used at run time. More... | |
Typedefs | |
typedef unsigned int | EMSG_CbReportRtn (unsigned int code, struct timespec hack, const char *rtn, unsigned int nprm, va_list list) |
Signature for the MSG reporting routine. | |
typedef struct _EMSG_MsgList | EMSG_MsgList |
List of messages used at run time. | |
typedef struct _EMSG_FacList | EMSG_FacList |
List of facilities used at run time. | |
Functions | |
unsigned int | EMSG_find (unsigned int code, const EMSG_FacList **fdb, const EMSG_MsgList **mdb) |
Return facility and message database entries corresponding to code. | |
void | EMSG_insertFacility (const EMSG_FacList *fac) |
Insert a new facility into the store. | |
void | EMSG_removeFacility (const EMSG_FacList *fac) |
Remove an existing facility from the store. |
This file provides the structure definitions and function prototypes for inserting and removing contributions to the message database.
typedef struct _EMSG_FacList EMSG_FacList |
List of facilities used at run time.
This structure is used at run time to store a list of facilities. This is one of the structures used in the files generated by the msg2src
executable. It must therefore be visible in the interface so that the source files generated by msg2src
can be compiled. Apart from this very narrow usage, it is not of very much general interest.
typedef struct _EMSG_MsgList EMSG_MsgList |
List of messages used at run time.
This structure is used at run time to store a list of messages. This is one of the structures used in the files generated by the msg2src
executable. It must therefore be visible in the interface so that the source files generated by msg2src
can be compiled. Apart from this very narrow usage, it is not of very much general interest.
unsigned int EMSG_find | ( | unsigned int | code, | |
const EMSG_FacList ** | fdb, | |||
const EMSG_MsgList ** | mdb | |||
) |
Return facility and message database entries corresponding to code.
This routine searches for the facility and message descriptors corresponding to the message code provided as the first argument. If the code cannot be found, both descriptors are returned as NULL pointers (in addition to the return code indicating failure).
code | (in ) Message code | |
fdb | (out) Facility descriptor | |
mdb | (out) Message descriptor |
0 | Database entry found | |
1 | Database entry not found |
References EMSG_M_FACILITY, EMSG_M_MESSAGE, EMSG_V_FACILITY, EMSG_V_MESSAGE, _EMSG_FacList::frst, and _EMSG_FacList::nmsg.
Referenced by EMSG_initialize(), and EMSG_report().
void EMSG_insertFacility | ( | const EMSG_FacList * | fac | ) |
Insert a new facility into the store.
This routine inserts a facility into the facility search list. This is all very "clever". Message facilities take advantage of the fact that a routine can be declared __attribute__((constructor)) which results in it being run either before the main routine starts up (typical for single-threaded host applications) or immediately after a module is loaded (typical for the multi-threaded VxWorks environment). This technique is really provided for C++ static constructors, but there's no reason not to take advantage of it.
Thus every message facility source file contains a little stub routine declared constructor whose sole function is to call this routine with the address of the facility block.
fac | (in) Pointer to the facility. |
References EMSG_M_FACILITY, EMSG_V_FACILITY, and _EMSG_FacList::ID.
Referenced by _GLOBAL__I_EMSG_insertFacility_EMSG().
void EMSG_removeFacility | ( | const EMSG_FacList * | fac | ) |
Remove an existing facility from the store.
This routine removes a facility from the facility search list. This is all very "clever". Message facilities take advantage of the fact that a routine can be declared __attribute__((destructor)) which results in it being run either after the main routine completes (typical for single-threaded host applications) or immediately before a module is unloaded (typical for the multi-threaded VxWorks environment). This technique is really provided for C++ static destructors, but there's no reason not to take advantage of it.
Thus every message facility source file contains a little stub routine declared destructor whose sole function is to call this routine with the address of the facility block.
fac | (in) Pointer to the facility. |
References EMSG_M_FACILITY, EMSG_V_FACILITY, and _EMSG_FacList::ID.
Referenced by _GLOBAL__D_EMSG_removeFacility_EMSG().