GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> EMSG / V1-1-1 > emsg_st / rhel6-64
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <PBS/MBA.h>
#include <PBS/FPA.h>
#include <EMSG/EMSG_msgs.h>
#include <EMSG_prvdefs.h>
#include <PBI/PTR.h>
Functions | |
unsigned int | EMSG_attachOutputRtn (EMSG_OutputRtn **handle, EMSG_CbOutputRtn *rtn, void *prm) |
Attach a message output callback routine. | |
unsigned int | EMSG_detachOutputRtn (EMSG_OutputRtn *handle) |
Detach a message callback routine. | |
unsigned int | EMSG_outputScan (void *prm, void *hdr) |
Call back the message output processing routines. |
This file contains all the routines needed to attach, detach and scan output processors for the message system.
unsigned int EMSG_attachOutputRtn | ( | EMSG_OutputRtn ** | handle, | |
EMSG_CbOutputRtn * | rtn, | |||
void * | prm | |||
) |
Attach a message output callback routine.
This routine attaches a message output processing routine. Each routine attached is called once when the message system is starting, once per call to EMSG_report(), and once when the message system is stopping.
In the single-threaded version of MSG, the attached routines are called directly by the EMSG_report() routine. In the multi-threaded version of MSG the routines are called by the message processing task.
Output processing routines may only be attached/detached when the message system is in state EMSG_S_INITIALIZED. This is true:
handle | (out) Handle for identifying the callback (used to detach) | |
rtn | (in) Routine entry point | |
prm | (in) Routine parameter |
EMSG_SUCCESS | Success | |
EMSG_BADSTATE | Cannot attach output processors in the current message state | |
EMSG_ALOCFAIL | Cannot allocate memory for the output routine description |
References EMSG_mcb, EMSG_MX_LOCK, EMSG_MX_UNLOCK, EMSG_S_INITIALIZED, _EMSG_Control::out, and _EMSG_Control::state.
unsigned int EMSG_detachOutputRtn | ( | EMSG_OutputRtn * | handle | ) |
Detach a message callback routine.
This routine detaches an message output processing routine.
Output processing routines may only be attached/detached when the message system is in state EMSG_S_INITIALIZED. This is true:
handle | (in) Handle for identifying the callback (from attach call) |
EMSG_SUCCESS | Success | |
EMSG_BADSTATE | Cannot detach output processors in the current message state | |
EMSG_OUTNTFND | Cannot find this output processor on the list |
References EMSG_mcb, EMSG_MX_LOCK, EMSG_MX_UNLOCK, EMSG_S_INITIALIZED, _EMSG_OutputRtn::next, _EMSG_Control::out, and _EMSG_Control::state.
unsigned int EMSG_outputScan | ( | void * | prm, | |
void * | hdr | |||
) |
Call back the message output processing routines.
This routine scans through attached output processors.
prm | (in) User context stored in fork control block | |
hdr | (in) Pointer to the message (complete packet). |
References _EMSG_Control::acb, _EMSG_Control::beg, _EMSG_Packet::buf, _EMSG_AltMessage::code, _EMSG_Message::code, _EMSG_Control::drp, EMSG_A_GAPEND, EMSG_alt, EMSG_getTask(), EMSG_getTrace(), EMSG_K_FMT4BYTE, EMSG_K_FMT8BYTE, EMSG_K_FMTBITS, EMSG_K_FMTSTATUS, EMSG_K_FMTSTRING, EMSG_K_SEVERITY, EMSG_L_FMTLENGTH, EMSG_L_TSKNAME, EMSG_M_FMTBITS, EMSG_M_SEVERITY, EMSG_mcb, EMSG_OUT_NORMAL, EMSG_RW_DECLARE, EMSG_RW_LOCK, EMSG_RW_UNLOCK, EMSG_S_STOPSYNC, EMSG_V_SEVERITY, _EMSG_Control::end, _EMSG_Message::fac, _EMSG_MsgList::frmt, _EMSG_Counts::hwm, _EMSG_Message::isr, _EMSG_Packet::msg, _EMSG_MsgList::name, _EMSG_OutputRtn::next, _EMSG_Message::nick, _EMSG_Control::now, _EMSG_Control::out, _EMSG_Control::pkt_len, _EMSG_OutputRtn::prm, _EMSG_Control::reset, _EMSG_OutputRtn::rtn, _EMSG_Message::rtn, _EMSG_FacList::sdb, _EMSG_Counts::sent, _EMSG_Message::sev, _EMSG_Control::start, _EMSG_Control::state, _EMSG_Message::task, _EMSG_Message::text, _EMSG_Message::tid, _EMSG_Message::time, and _EMSG_Message::trace.
Referenced by EMSG_report().