Objective Systems, Inc.  

Error Formatting and Print Functions
[C Runtime Common Functions]

Error formatting and print functions allow information about the encode/decode errors to be added to a context block structure and then printed out when the error is propagated to the top level. More...

Defines

#define LOG_ASN1ERR(ctxt, stat)   errSetData(&(ctxt)->errInfo,stat,__FILE__,__LINE__)
#define LOG_ASN1ERR_AND_FREE(pctxt, stat, lctxt)   freeContext ((lctxt)), LOG_ASN1ERR(pctxt, stat)

Functions

EXTERN int errAddIntParm (ASN1ErrInfo *pErrInfo, int errParm)
 This function adds an integer parameter to an error information structure.
EXTERN int errAddStrParm (ASN1ErrInfo *pErrInfo, const char *errprm_p)
 This function adds an string parameter to an error information structure.
EXTERN int errAddUIntParm (ASN1ErrInfo *pErrInfo, unsigned int errParm)
 This function adds an unsigned integer parameter to an error information structure.
EXTERN int errCopyData (ASN1ErrInfo *pSrcErrInfo, ASN1ErrInfo *pDestErrInfo)
EXTERN void errFreeParms (ASN1ErrInfo *pErrInfo)
 This function frees memory associated with the storage of parameters associated with an error message.
EXTERN char * errFmtMsg (ASN1ErrInfo *pErrInfo, char *bufp)
EXTERN char * errGetText (OOCTXT *pctxt)
 This function gets the text of the error.
EXTERN void errPrint (ASN1ErrInfo *pErrInfo)
 This function prints error information to the standard output device.
EXTERN int errReset (ASN1ErrInfo *pErrInfo)
 This function resets the error information in the error information sturcture.
EXTERN int errSetData (ASN1ErrInfo *pErrInfo, int status, const char *module, int lno)
 This function sets error information in an error information structure.

Detailed Description

Error formatting and print functions allow information about the encode/decode errors to be added to a context block structure and then printed out when the error is propagated to the top level.


Function Documentation

EXTERN int errAddIntParm ( ASN1ErrInfo pErrInfo,
int  errParm 
)

This function adds an integer parameter to an error information structure.

Parameter substitution is done in much the same way as it is done in C printf statments. The base error message specification that goes along with a particular status code may have variable fields built in using '' modifiers. These would be replaced with actual parameter data.

Parameters:
pErrInfo A pointer to a structure containing information on the error to be printed. Typically, the error info structure referred to is the one inside the OOCTXT structure. (i.e. &pctxt->errInfo).
errParm The typed error parameter.
Returns:
The status of the operation.

EXTERN int errAddStrParm ( ASN1ErrInfo pErrInfo,
const char *  errprm_p 
)

This function adds an string parameter to an error information structure.

Parameter substitution is done in much the same way as it is done in C printf statments. The base error message specification that goes along with a particular status code may have variable fields built in using '' modifiers. These would be replaced with actual parameter data.

Parameters:
pErrInfo A pointer to a structure containing information on the error to be printed. Typically, the error info structure referred to is the one inside the OOCTXT structure. (i.e. &pctxt->errInfo).
errprm_p The typed error parameter.
Returns:
The status of the operation.

EXTERN int errAddUIntParm ( ASN1ErrInfo pErrInfo,
unsigned int  errParm 
)

This function adds an unsigned integer parameter to an error information structure.

Parameter substitution is done in much the same way as it is done in C printf statments. The base error message specification that goes along with a particular status code may have variable fields built in using '' modifiers. These would be replaced with actual parameter data.

Parameters:
pErrInfo A pointer to a structure containing information on the error to be printed. Typically, the error info structure referred to is the one inside the OOCTXT structure. (i.e. &pctxt->errInfo).
errParm The typed error parameter.
Returns:
The status of the operation.

EXTERN void errFreeParms ( ASN1ErrInfo pErrInfo  ) 

This function frees memory associated with the storage of parameters associated with an error message.

These parameters are maintained on an internal linked list maintained within the error information structure. The list memory must be freed when error processing is complete. This function is called from within errPrint after teh error has been printed out. It is also called in teh freeContext function.

Parameters:
pErrInfo A pointer to a structure containing information on the error to be printed. Typically, the error info structure referred to is the one inside the OOCTXT structure. (i.e. &pctxt->errInfo).

EXTERN char* errGetText ( OOCTXT pctxt  ) 

This function gets the text of the error.

Parameters:
pctxt A pointer to a context structure.

EXTERN void errPrint ( ASN1ErrInfo pErrInfo  ) 

This function prints error information to the standard output device.

The error information is stored in a structure of type ASN1ErrInfo. A structure of the this type is part f the OOCTXT structure. This is where error information is stored within the ASN1C generated and low-level encode/decode functions.

Parameters:
pErrInfo A pointer to a structure containing information on the error to be printed. Typically, the error info structure referred to is the one inside the OOCTXT structure. (i.e. &pctxt->errInfo).

EXTERN int errReset ( ASN1ErrInfo pErrInfo  ) 

This function resets the error information in the error information sturcture.

Parameters:
pErrInfo A pointer to a structure containing information on the error to be printed. Typically, the error info structure referred to is the one inside the OOCTXT structure. (i.e. &pctxt->errInfo).

EXTERN int errSetData ( ASN1ErrInfo pErrInfo,
int  status,
const char *  module,
int  lno 
)

This function sets error information in an error information structure.

The information set includes status code, module name, and line number. Location information (i.e. module name and line number) is pushed onto a stack within the error information structure to provide a complete stack trace when the information is printed out.

Parameters:
pErrInfo A pointer to a structure containing information on the error to be printed. Typically, the error info structure referred to is the one inside the OOCTXT structure. (i.e. &pctxt->errInfo).
status The error status code. This is one of the negative error status codes.
module The name of the module (C or C++ source file) in which the module occurred. This is typically obtained by using the _FILE_ macro.
lno The line number at which the error occurred. This is typically obtained by using the _LINE_ macro.
Returns:
The status value passed to the operation in the third argument. This makes it possible to set the error information and return the status value in one line of code.


This file was last modified on 28 May 2010.
Objective Open H.323 Stack, 0.9.1