GLAST/LAT > DAQ and FSW > FSW > Doxygen Index > EMSG / V0-0-3

Constituent: emsg_mt     Tag: i845e


Interface   Data Structures   File List   Data Fields   Globals  

EMSG_database.c File Reference

Provides the facilities to maintain the error message database. More...

#include "stdio.h"
#include "stdarg.h"
#include "time.h"
#include "EMSG/EMSG_pubdefs.h"
#include "EMSG/EMSG_database.h"

Include dependency graph for EMSG_database.c:


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.

Detailed Description

Provides the facilities to maintain the error message database.

Author:
A.P.Waite & Owen H Saxton
Id
EMSG_database.c,v 1.2 2006/02/28 20:46:03 saxton Exp

Function Documentation

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).

Parameters:
code (in ) Message code
fdb (out) Facility descriptor
mdb (out) Message descriptor
Return values:
0 Database entry found
1 Database entry not found

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.

Warning:
This routine appears in the constituent interface only to support other packages that wish to automatically insert a message facility into the message facility list. It should never be called by application code.
Parameters:
fac (in) Pointer to the facility.

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.

Warning:
This routine appears in the constituent interface only to support other packages that wish to automatically insert a message facility into the message facility list. It should never be called by application code.
Parameters:
fac (in) Pointer to the facility.


Generated on Thu Mar 8 09:41:31 2007 by  doxygen 1.4.4