LINUX: afs_create infinite fetchStatus loop
[pkg-k5-afs_openafs.git] / src / WINNT / afsclass / c_debug.h
blob001821e930fe8979f4926357f739731123f56561
1 /*
2 * Copyright 2000, International Business Machines Corporation and others.
3 * All Rights Reserved.
5 * This software has been released under the terms of the IBM Public
6 * License. For details, see the LICENSE file in the top-level source
7 * directory or online at http://www.openafs.org/dl/license10.html
8 */
10 #ifndef DEBUG_H
11 #define DEBUG_H
13 #include <WINNT/afsclass.h>
15 #ifndef DEBUG // building retail?
17 #ifndef ASSERT
18 #define ASSERT(b) ((b) ? TRUE : FALSE) // take failure paths if retail asserts
19 #endif
21 #else // building debug?
23 #ifndef ASSERT
24 #define ASSERT(b) AssertFn(b, #b, __LINE__, __FILE__)
25 #endif
27 #include <windows.h>
30 typedef unsigned char uchar;
31 typedef unsigned short ushort;
33 #define ANGLES_ON "[AnglesOn]"
34 #define ANGLES_OFF "[AnglesOff]"
35 #define LASTERROR "[LastError]"
39 * DEFINITIONS ________________________________________________________________
43 #define minX 2
44 #define minY 2
46 #define yMAX 60
47 #define xMAX 300
51 * TYPEDEFS ___________________________________________________________________
56 class Debugstr
58 public:
60 Debugstr & operator<< (char *psz);
61 Debugstr & operator<< (void *psz);
62 Debugstr & operator<< (long v);
63 Debugstr & operator<< (size_t v);
64 Debugstr & operator<< (ushort v);
65 Debugstr & operator<< (short v);
66 Debugstr & operator<< (uchar ch);
67 Debugstr & operator<< (char ch);
68 Debugstr & operator<< (double f);
69 Debugstr & operator<< (RECT r);
70 Debugstr & operator<< (LPIDENT lpi);
72 Debugstr (void);
73 ~Debugstr (void);
75 static LRESULT APIENTRY DebugWndProc (HWND, UINT, WPARAM, LPARAM);
77 void OutString (char *str, BOOL fRecord);
79 private:
81 HBRUSH brBack;
82 HFONT hfNew;
83 TEXTMETRIC tm;
85 static void Register (void);
86 static void Initialize (void);
87 void Output (HDC hdc, char *str, BOOL fRecord);
89 static int fRegistered;
90 static BOOL fInit;
91 static HWND hwnd;
93 static ushort gx, gcX;
94 static ushort gy, gcY;
95 static char gdata[ yMAX ][ xMAX ];
97 static BOOL fAngles;
101 #define MAX_ARGS 10
103 class LogOut
105 public:
107 cdecl LogOut (char *format, ...);
108 ~LogOut (void);
110 private:
111 char pszFormat[ 256 ];
113 char *aPtr[ MAX_ARGS ];
114 ushort nArgs;
120 * VARIABLES __________________________________________________________________
124 extern Debugstr debug;
128 * PROTOTYPES _________________________________________________________________
132 extern int AssertFn (int, char *, int, char *);
135 #endif // DEBUG
137 #endif // DEBUG_H