comparison define.h @ 10:a818f3c2e589

fix tree walk, we now use the item counts in the node blocks
author carl
date Fri, 17 Feb 2006 15:48:38 -0800
parents 3e3d8b576630
children 3f627519a92d
comparison
equal deleted inserted replaced
9:8c724896a28a 10:a818f3c2e589
1 /*** 1 /***
2 * define.h 2 * define.h
3 * Part of the LibPST project 3 * Part of the LibPST project
4 * Written by David Smith 4 * Written by David Smith
5 * dave.s@earthcorp.com 5 * dave.s@earthcorp.com
6 */ 6 */
7 7
8 //#define DEBUG_ALL 8 #define DEBUG_ALL
9 #ifndef DEFINEH_H 9 #ifndef DEFINEH_H
10 #define DEFINEH_H 10 #define DEFINEH_H
11 11
12 #ifdef DEBUG_ALL 12 #ifdef DEBUG_ALL
13 #define DEBUG_MODE_GEN 13 #define DEBUG_MODE_GEN
64 void _debug_write(); 64 void _debug_write();
65 65
66 void * xmalloc(size_t size); 66 void * xmalloc(size_t size);
67 67
68 #define MESSAGEPRINT(x,y) {_debug_msg_info(__LINE__,__FILE__,y);\ 68 #define MESSAGEPRINT(x,y) {_debug_msg_info(__LINE__,__FILE__,y);\
69 _debug_msg_text x;} 69 _debug_msg_text x;}
70 70
71 #define LOGSTOP() {MESSAGESTOP();DEBUGSTOP();} 71 #define LOGSTOP() {MESSAGESTOP();DEBUGSTOP();}
72 72
73 #define DIE(x) {\ 73 #define DIE(x) {\
74 MESSAGEPRINT(x, 0);\ 74 MESSAGEPRINT(x, 0);\
99 #endif 99 #endif
100 100
101 #ifdef DEBUG_MODE_EMAIL 101 #ifdef DEBUG_MODE_EMAIL
102 #define DEBUG_EMAIL(x) MESSAGEPRINT(x, DEBUG_EMAIL_NO); 102 #define DEBUG_EMAIL(x) MESSAGEPRINT(x, DEBUG_EMAIL_NO);
103 #define DEBUG_EMAIL_HEXPRINT(x,y) {_debug_msg_info(__LINE__, __FILE__, 11);\ 103 #define DEBUG_EMAIL_HEXPRINT(x,y) {_debug_msg_info(__LINE__, __FILE__, 11);\
104 _debug_hexdump(x, y, 0x10);} 104 _debug_hexdump(x, y, 0x10);}
105 #else 105 #else
106 #define DEBUG_EMAIL(x) {} 106 #define DEBUG_EMAIL(x) {}
107 #define DEBUG_EMAIL_HEXPRINT(x,y) {} 107 #define DEBUG_EMAIL_HEXPRINT(x,y) {}
108 #endif 108 #endif
109 109
154 #define DEBUG_HEXDUMP(x, s) {} 154 #define DEBUG_HEXDUMP(x, s) {}
155 #define DEBUG_HEXDUMPC(x, s, c) {} 155 #define DEBUG_HEXDUMPC(x, s, c) {}
156 #endif 156 #endif
157 157
158 #define DEBUG_FILE(x) {_debug_msg_info(__LINE__, __FILE__, DEBUG_FILE_NO);\ 158 #define DEBUG_FILE(x) {_debug_msg_info(__LINE__, __FILE__, DEBUG_FILE_NO);\
159 _debug_msg_text x;} 159 _debug_msg_text x;}
160 160
161 #ifdef DEBUG_MODE_FUNC 161 #ifdef DEBUG_MODE_FUNC
162 # define DEBUG_ENT(x) \ 162 # define DEBUG_ENT(x) \
163 {MESSAGEPRINT(("Entering function %s\n",x),DEBUG_FUNC_NO);\ 163 {MESSAGEPRINT(("Entering function %s\n",x),DEBUG_FUNC_NO);\
164 _debug_func(x);} 164 _debug_func(x);}
165 # define DEBUG_RET() {MESSAGEPRINT(("Leaving function\n"),DEBUG_FUNC_NO);\ 165 # define DEBUG_RET() {MESSAGEPRINT(("Leaving function\n"),DEBUG_FUNC_NO);\
166 _debug_func_ret();} 166 _debug_func_ret();}
167 #else 167 #else
168 # define DEBUG_ENT(x) {} 168 # define DEBUG_ENT(x) {}
169 # define DEBUG_RET() {} 169 # define DEBUG_RET() {}
170 #endif 170 #endif
171 171
175 175
176 #define RET_DERROR(res, ret_val, x)\ 176 #define RET_DERROR(res, ret_val, x)\
177 if (res) { DIE(x);} 177 if (res) { DIE(x);}
178 178
179 #define RET_ERROR(res, ret_val)\ 179 #define RET_ERROR(res, ret_val)\
180 if (res) {return ret_val;} 180 if (res) {return ret_val;}
181 181
182 #define DEBUG_VERSION 1 182 #define DEBUG_VERSION 1
183 struct _debug_file_rec_m { 183 struct _debug_file_rec_m {
184 unsigned short int funcname; 184 unsigned short int funcname;
185 unsigned short int filename; 185 unsigned short int filename;