GLAST / LAT > DAQ and FSW > FSW > Doxygen Index> MSG / V3-1-2 > msg_st / rhel6-32


Interface   Data Structures   File List   Data Fields   Globals  

MSG_report_st.c File Reference

Single-threaded specific implementations of utility routines. More...

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <PBS/MBA.h>
#include <MSG/MSG_pubdefs.h>
#include <MSG/MSG_msgs.h>
#include <MSG_prvdefs.h>

Functions

MSG_Level MSG_getLevel ()
 Get the current reporting level.
MSG_Level MSG_getLevel4Task (void **tbd)
 No meaning in the single-threaded context ... call is ignored.
const char * MSG_getTask ()
 Return pointer to task name.
unsigned short MSG_getTrace ()
 Get the current trace buffer number.
MSG_Level MSG_setLevel (MSG_Level newval)
 Set the current reporting level.
MSG_Level MSG_setLevel4Task (void **tbd, MSG_Level newval)
 No meaning in the single-threaded context ... call is ignored.
unsigned int MSG_setTask (const char *task)
 Set the task name.
unsigned short MSG_setTrace (unsigned short newval)
 Set the current trace buffer number.

Variables

static MSG_TaskOption MSG_taskOption = { 1, MSG_D_LEVEL, MSG_D_TRACE }
 Static variable providing the reporting level and trace buffer number.
static const char MSG_defaultTask [] = { "UND>" }
 Static variable providing a default task name.
static const char * MSG_task = MSG_defaultTask
 Variable to record the task name.


Detailed Description

Single-threaded specific implementations of utility routines.

CVS $Id: MSG_report_st.c,v 1.5 2011/03/25 01:05:53 apw Exp $
Author:
A.P.Waite

Function Documentation

MSG_Level MSG_getLevel ( void   ) 

Get the current reporting level.

Returns:
The severity level for reporting
MSG_getLevel() returns the level at which messages are reported. Messages whose severity is greater than or equal to the level set are reported.

References _MSG_TaskOption::level.

Referenced by MSG_reportInternal().

MSG_Level MSG_getLevel4Task ( void **  tbd  ) 

No meaning in the single-threaded context ... call is ignored.

Parameters:
tbd (in) Pointer to arbitrary task's TBD block
Returns:
The reporting level for the only existing task/thread
MSG_getLevel4Task() is meaningless in the single-threaded context and is only provided to provide compatibility between the single-threaded and multi-threaded modules.

References _MSG_TaskOption::level.

const char* MSG_getTask ( void   ) 

Return pointer to task name.

Returns:
Pointer to the string containing the task name
MSG_getTask() returns a pointer to the task name. This is the host side version where the task name is an arbitrary string under user control.

Referenced by MSG_outputScan(), and MSG_reportInternal().

unsigned short MSG_getTrace ( void   ) 

Get the current trace buffer number.

Returns:
The trace buffer number for reporting
MSG_getTrace() returns the trace buffer number currently in effect. This is a 16-bit number associated with a message. All messages record the current value of the trace buffer number. This is a simple mechanism to group messages.

References _MSG_TaskOption::trace.

Referenced by MSG_outputScan(), and MSG_reportInternal().

MSG_Level MSG_setLevel ( MSG_Level  newval  ) 

Set the current reporting level.

Parameters:
newval (in) Reporting level to be set
Returns:
Reporting level prior to the call
MSG_setLevel() sets the level at which messages are reported. A message whose severity is greater than or equal to the level set is reported. The routine returns the reporting level prior to the call (to allow simple reversion).

References _MSG_TaskOption::level, MSG_LVL_ERROR, and MSG_LVL_SUCCESS.

MSG_Level MSG_setLevel4Task ( void **  tbd,
MSG_Level  newval 
)

No meaning in the single-threaded context ... call is ignored.

Parameters:
tbd (in) Pointer to arbitrary task's TBD block
newval (in) Reporting level to be set
Returns:
The reporting level for the only existing task/thread
MSG_setLevel4Task() is meaningless in the single-threaded context and is only provided to provide compatibility between the single-threaded and multi-threaded modules.

References _MSG_TaskOption::level.

unsigned int MSG_setTask ( const char *  task  ) 

Set the task name.

Parameters:
task (in) Pointer to task name
Return values:
MSG_ALOCFAIL Could not allocate storage for task name string
MSG_TNM2LONG Task name too long
MSG_SUCCESS Success
MSG_setTask() sets a task name. This is only valid in the single-threaded environment where the task name is an arbitrary string under user control.

References MSG_L_TSKNAME.

unsigned short MSG_setTrace ( unsigned short  newval  ) 

Set the current trace buffer number.

Parameters:
newval (in) Trace buffer number to set
Returns:
The trace buffer prior to the change
MSG_setTrace() sets the trace buffer number currently in effect. This is a 16-bit number associated with a message. All messages record the current value of the trace buffer number. This is a simple mechanism to group messages. The routine returns the trace buffer in effect prior to the call to make reversion simple.

References _MSG_TaskOption::trace.


Generated on Tue Nov 29 16:54:51 2011 by  doxygen 1.5.8