2 * Copyright 2001, 2002, 2003 David Mansfield and Cobite, Inc.
3 * See COPYING file for license information
12 #include <sys/types.h>
17 #define DEBUG_NUM_FACILITIES 32 /* should be 64 on 64bit CPU... */
18 #define DEBUG_SYSERROR 1 /* same as DEBUG_ERROR, but here for clarity */
20 #define DEBUG_STATUS 2
22 #define DEBUG_SIGNALS 8
23 #define DEBUG_APPERROR 16
24 #define DEBUG_APPMSG1 32
25 #define DEBUG_APPMSG2 64
26 #define DEBUG_APPMSG3 128
27 #define DEBUG_APPMSG4 256
28 #define DEBUG_APPMSG5 512
29 #define DEBUG_LIBERROR 1024
30 #define DEBUG_LIBSTATUS 2048
37 extern unsigned int debuglvl
;
39 void hexdump( const char *ptr
, int size
, const char *fmt
, ... );
40 void vdebug(int dtype
, const char *fmt
, va_list);
41 void vmdebug(int dtype
, const char *fmt
, va_list);
42 void to_hex( char* dest
, const char* src
, size_t n
);
43 void debug_set_error_file(FILE *);
44 void debug_set_error_facility(int mask
, FILE *);
46 static INLINE
void debug(unsigned int dtype
, const char *fmt
, ...)
50 if (!(debuglvl
& dtype
))
54 vdebug(dtype
, fmt
, ap
);
58 static INLINE
void mdebug(unsigned int dtype
, const char *fmt
, ...)
62 if (!(debuglvl
& dtype
))
66 vmdebug(dtype
, fmt
, ap
);