/****************************************************************** 
 *
 * errclass.h
 *
 *     Interface to error reporting class.
 *
 *
 * $Author: mstoufer $
 * $Source: /home/g2/src/projects/NetLogger/src/nlv/errclass.h,v $
 * $RCSfile: errclass.h,v $
 * $Revision: 1.1.1.1 $
 * $Locker:  $
 * $Date: 2000/12/05 19:52:32 $
 *
 ****************************************************************** 
 */
#ifndef NLV_ERROR_INCLUDED
#define NLV_ERROR_INCLUDED

#include <tcl.h>
#include <stdio.h>
#include <stdarg.h>
#include <pthread.h>
#include "structs.h"
#include "syswrappers.h"

/*========= DATA =====================================================*/

#define T Nlv_err
typedef struct T *T;

typedef struct Nlv_EInfo {
  int   code;
  int   reps;
  char *file;
  int   lineNum;
} Nlv_EInfo;

#define NLV_SET_EINFO(e,c,r) e.lineNum = __LINE__;\
                             e.file = __FILE__; \
                             e.code=(c); \
                             e.reps=(r);
#define NLV_WARN 10000

/*========= FUNCTIONS ================================================*/

T    Nlv_errNew();
void Nlv_errReport( T, Nlv_EInfo *info, char *fmtMsg, ... );
void Nlv_errPrintString ( T, const char *func, char *msg );
void Nlv_errFatalTcl( T, Tcl_Interp *interp, char *command );
void Nlv_errSetDebug( T, int lvl);

#undef T
#endif
