GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> EMSG / dev > emsg_mt / i845e
#include <stdio.h>
#include <stdarg.h>
#include <time.h>
#include <EMSG/EMSG_pubdefs.h>
#include <EMSG/EMSG_database.h>
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. |
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().