#ifndef __RDISTRIBUTOR_H__ #define __RDISTRIBUTOR_H__ /* The following enum is to inform about the kind of message format. For example: * MESSAGE_FORMAT: this is a message * REPORT_FORMAT: distributor.h.7, Error: this is a message. 0, (0x0,0x1) */ typedef enum { MESSAGE_FORMAT, REPORT_FORMAT } FormatType; /* Use the following macro in order to get the private severity as the */ /* severity parameter from one of the Report routines */ #define GET_PRIVATE_SEVERITY(handle) (DistributorHandle)((handle)>>5) /* The mask of currently enabled severity. */ extern bool filterTest(ErrorSeverity severity); extern STATUS distibutorInit( int priority, int maxMsgs, int maxDestinations ); extern STATUS reportDistribute(FormatType format, char *message, char *FileName, int LineNumber, int errorCode, ErrorSeverity severity, int parameter1, int parameter2); /*************************************************************************** * * Name : ReportStrCmp * * Function : compare between two string with case-insensitive. * * Notes : * * Return value: TRUE - strings are identical; FALSE - otherwise **************************************************************************/ extern bool ReportStrCmp(const char *str1, const char *str2); /*************************************************************************** * * Name : IsNameExistsInDistributorTable * * Function : Check if a given name is already found in the table * of the private severities * * Notes : * * Return value: TRUE if found; FALSE otherwise **************************************************************************/ extern bool IsNameExistsInDistributorTable(const char *name); /*************************************************************************** * * Name : ReportGetDistributorHandleByName * * Function : Get the severity handle given the severity's name * * Notes : * * Return value: the handle; or -1 if no such name **************************************************************************/ extern DistributorHandle ReportGetDistributorHandleByName(const char *distributorName); /*************************************************************************** * * Name : GetDistributorParamsByHandle * * Function : Get the private severity details according to its handle * * Parameters : DistributorHandle - table entry * name - buffer to contain the private severity's name * IsActive - FALSE if the private severity * * Notes : The name field must exceeds 10 bytes long * * Return value: OK or ERROR and then: * errno = REPORT_ERROR_ILLEGAL_PARAMETER if no such entry * errno = REPORT_ERROR_FILTER_NOT_ALIVE if the private * severity has already removed (and thus it is no * no longer exists until re-added). **************************************************************************/ extern STATUS GetDistributorParamsByHandle(uint32_t DistributorHandle, char *name, bool *IsActive); /* Total message length w/o message text in bytes (for reportMsgFormat function ) */ #define REPORT_MSG_FORMAT_LEN 61 #endif /* __RDISTRIBUTOR_H__ */