File: gdebug.h

package info (click to toggle)
glide 2002.04.10ds1-16
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 59,540 kB
  • sloc: ansic: 290,125; asm: 23,305; sh: 8,089; pascal: 3,854; makefile: 1,276; perl: 73
file content (101 lines) | stat: -rw-r--r-- 3,671 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
/*-*-c++-*-*/
#ifndef __GDEBUG_H__
#define __GDEBUG_H__

/*
** THIS SOFTWARE IS SUBJECT TO COPYRIGHT PROTECTION AND IS OFFERED ONLY
** PURSUANT TO THE 3DFX GLIDE GENERAL PUBLIC LICENSE. THERE IS NO RIGHT
** TO USE THE GLIDE TRADEMARK WITHOUT PRIOR WRITTEN PERMISSION OF 3DFX
** INTERACTIVE, INC. A COPY OF THIS LICENSE MAY BE OBTAINED FROM THE 
** DISTRIBUTOR OR BY CONTACTING 3DFX INTERACTIVE INC(info@3dfx.com). 
** THIS PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER 
** EXPRESSED OR IMPLIED. SEE THE 3DFX GLIDE GENERAL PUBLIC LICENSE FOR A
** FULL TEXT OF THE NON-WARRANTY PROVISIONS.  
** 
** USE, DUPLICATION OR DISCLOSURE BY THE GOVERNMENT IS SUBJECT TO
** RESTRICTIONS AS SET FORTH IN SUBDIVISION (C)(1)(II) OF THE RIGHTS IN
** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 252.227-7013,
** AND/OR IN SIMILAR OR SUCCESSOR CLAUSES IN THE FAR, DOD OR NASA FAR
** SUPPLEMENT. UNPUBLISHED RIGHTS RESERVED UNDER THE COPYRIGHT LAWS OF
** THE UNITED STATES.  
** 
** COPYRIGHT 3DFX INTERACTIVE, INC. 1999, ALL RIGHTS RESERVED
**
** $Revision: 1.3 $
** $Date: 2000/11/15 23:32:58 $
*/

#include <stdarg.h>

#if defined(FX_DLL_ENABLE)
#define FX_DLL_DEFINITION

#endif
#include <fxdll.h>

#define GDBG_MAX_LEVELS 512

#ifndef GETENV
#define GETENV(a) getenv(a)
#endif

// if debug info turned on then GDBG_INFO does something
#ifdef GDBG_INFO_ON

#define GDBG_INFO(level, format, ...) gdbg_info(level, format, __VA_ARGS__)
#define GDBG_INFO_MORE(level, format, ...) gdbg_info_more(level, format, __VA_ARGS__)
#define GDBG_PRINTF(format, ...) gdbg_printf(format, __VA_ARGS__)

#define GDBG_ERROR_SET_CALLBACK(p)   gdbg_error_set_callback(p)
#define GDBG_ERROR_CLEAR_CALLBACK(p) gdbg_error_clear_callback(p)

#define GDBG_GET_DEBUGLEVEL	gdbg_get_debuglevel
#define GDBG_SET_DEBUGLEVEL	gdbg_set_debuglevel

// otherwise GDBG_INFO does nothing
#else

#define GDBG_INFO(level, format, ...)
#define GDBG_INFO_MORE(level, format, ...)
#define GDBG_PRINTF(format, ...)

#define GDBG_ERROR_SET_CALLBACK(p)
#define GDBG_ERROR_CLEAR_CALLBACK(p)

#define GDBG_GET_DEBUGLEVEL(x) 0
#define GDBG_SET_DEBUGLEVEL(a,b)

#endif

#define GDBG_INIT		gdbg_init
#define GDBG_SHUTDOWN		gdbg_shutdown
#define GDBG_ERROR		gdbg_error
#define GDBG_GET_ERRORS		gdbg_get_errors
#define GDBG_SET_FILE		gdbg_set_file

FX_ENTRY void	FX_CALL gdbg_init(void);
FX_ENTRY void	FX_CALL gdbg_parse(const char *env);
FX_ENTRY void	FX_CALL gdbg_shutdown(void);
FX_ENTRY void	FX_CALL gdbg_vprintf(const char *format, va_list);
FX_ENTRY void	FX_CALL gdbg_printf(const char *format, ...);
FX_ENTRY int	FX_CALL gdbg_info(const int level, const char *format, ...);
FX_ENTRY int	FX_CALL gdbg_info_more(const int level, const char *format, ...);
FX_ENTRY void	FX_CALL gdbg_error(const char *name, const char *format, ...);
FX_ENTRY int	FX_CALL gdbg_get_errors(void);
FX_ENTRY int	FX_CALL gdbg_set_file(const char *name);
FX_ENTRY int	FX_CALL gdbg_get_debuglevel(const int level);
FX_ENTRY void	FX_CALL gdbg_set_debuglevel(const int level, const int value);

// these routines allow for a library (like Glide) to get called back
typedef void (*GDBGErrorProc)(const char* const procName,
                              const char* const format,
                              va_list     args);
FX_ENTRY int FX_CALL gdbg_error_set_callback(GDBGErrorProc p);
FX_ENTRY void FX_CALL gdbg_error_clear_callback(GDBGErrorProc p);

// these routines allow for some GUI code to get called once in a while
// so that it can keep the UI alive by reading the message queue
typedef void (*GDBGKeepAliveProc)(int adjust);
FX_ENTRY void FX_CALL gdbg_set_keepalive(GDBGKeepAliveProc p);

#endif /* !__GDEBUG_H__ */