Mercurial > libpst
annotate src/define.h @ 109:7947334d53ad
Added tag stable-0-6-21 for changeset 1b2a4fac1303
author | Carl Byington <carl@five-ten-sg.com> |
---|---|
date | Tue, 21 Oct 2008 14:45:39 -0700 |
parents | 987aa872294e |
children | 0f1492b7fe8b |
rev | line source |
---|---|
16 | 1 /*** |
2 * define.h | |
3 * Part of the LibPST project | |
4 * Written by David Smith | |
63
cfd6175f9334
Start work on pst2dii to convert to Summation dii load file format.
Carl Byington <carl@five-ten-sg.com>
parents:
59
diff
changeset
|
5 * dave.s@earthcorp.com |
16 | 6 */ |
7 | |
31 | 8 #ifdef HAVE_CONFIG_H |
63
cfd6175f9334
Start work on pst2dii to convert to Summation dii load file format.
Carl Byington <carl@five-ten-sg.com>
parents:
59
diff
changeset
|
9 #include "config.h" |
75
987aa872294e
Use ftello/fseeko to properly handle large files.
Carl Byington <carl@five-ten-sg.com>
parents:
73
diff
changeset
|
10 #else |
987aa872294e
Use ftello/fseeko to properly handle large files.
Carl Byington <carl@five-ten-sg.com>
parents:
73
diff
changeset
|
11 #ifdef _MSC_VER |
987aa872294e
Use ftello/fseeko to properly handle large files.
Carl Byington <carl@five-ten-sg.com>
parents:
73
diff
changeset
|
12 #undef HAVE_UNISTD_H |
987aa872294e
Use ftello/fseeko to properly handle large files.
Carl Byington <carl@five-ten-sg.com>
parents:
73
diff
changeset
|
13 #define HAVE_DIRECT_H |
987aa872294e
Use ftello/fseeko to properly handle large files.
Carl Byington <carl@five-ten-sg.com>
parents:
73
diff
changeset
|
14 #define HAVE_WINDOWS_H |
987aa872294e
Use ftello/fseeko to properly handle large files.
Carl Byington <carl@five-ten-sg.com>
parents:
73
diff
changeset
|
15 #endif |
31 | 16 #endif |
48 | 17 #include "version.h" |
16 | 18 |
19 #ifndef DEFINEH_H | |
20 #define DEFINEH_H | |
21 | |
22 #define DEBUG_MODE_GEN | |
23 #define DEBUGPRINT | |
24 #define DEBUG_MODE_WARN | |
25 #define DEBUG_MODE_READ | |
26 #define DEBUG_MODE_EMAIL | |
27 #define DEBUG_MODE_MAIN | |
28 #define DEBUG_MODE_INDEX | |
29 #define DEBUG_MODE_CODE | |
30 #define DEBUG_MODE_INFO | |
31 #define DEBUG_MODE_HEXDUMP | |
32 #define DEBUG_MODE_FUNC | |
33 | |
34 //number of items to save in memory between writes | |
35 #define DEBUG_MAX_ITEMS 0 | |
36 | |
63
cfd6175f9334
Start work on pst2dii to convert to Summation dii load file format.
Carl Byington <carl@five-ten-sg.com>
parents:
59
diff
changeset
|
37 #define DEBUG_FILE_NO 1 |
cfd6175f9334
Start work on pst2dii to convert to Summation dii load file format.
Carl Byington <carl@five-ten-sg.com>
parents:
59
diff
changeset
|
38 #define DEBUG_INDEX_NO 2 |
cfd6175f9334
Start work on pst2dii to convert to Summation dii load file format.
Carl Byington <carl@five-ten-sg.com>
parents:
59
diff
changeset
|
39 #define DEBUG_EMAIL_NO 3 |
cfd6175f9334
Start work on pst2dii to convert to Summation dii load file format.
Carl Byington <carl@five-ten-sg.com>
parents:
59
diff
changeset
|
40 #define DEBUG_WARN_NO 4 |
cfd6175f9334
Start work on pst2dii to convert to Summation dii load file format.
Carl Byington <carl@five-ten-sg.com>
parents:
59
diff
changeset
|
41 #define DEBUG_READ_NO 5 |
cfd6175f9334
Start work on pst2dii to convert to Summation dii load file format.
Carl Byington <carl@five-ten-sg.com>
parents:
59
diff
changeset
|
42 #define DEBUG_INFO_NO 6 |
cfd6175f9334
Start work on pst2dii to convert to Summation dii load file format.
Carl Byington <carl@five-ten-sg.com>
parents:
59
diff
changeset
|
43 #define DEBUG_MAIN_NO 7 |
36 | 44 #define DEBUG_DECRYPT_NO 8 |
45 #define DEBUG_FUNCENT_NO 9 | |
46 #define DEBUG_FUNCRET_NO 10 | |
16 | 47 #define DEBUG_HEXDUMP_NO 11 |
48 | |
49 #include <stdio.h> | |
50 #include <stdlib.h> | |
51 #include <stdarg.h> | |
59
7d5c637aaafb
General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents:
48
diff
changeset
|
52 #include <time.h> |
7d5c637aaafb
General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents:
48
diff
changeset
|
53 #include <string.h> |
7d5c637aaafb
General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents:
48
diff
changeset
|
54 #include <ctype.h> |
7d5c637aaafb
General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents:
48
diff
changeset
|
55 #include <limits.h> |
7d5c637aaafb
General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents:
48
diff
changeset
|
56 #include <wchar.h> |
7d5c637aaafb
General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents:
48
diff
changeset
|
57 #include <signal.h> |
7d5c637aaafb
General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents:
48
diff
changeset
|
58 #include <errno.h> |
16 | 59 |
75
987aa872294e
Use ftello/fseeko to properly handle large files.
Carl Byington <carl@five-ten-sg.com>
parents:
73
diff
changeset
|
60 #define PERM_DIRS 0777 |
987aa872294e
Use ftello/fseeko to properly handle large files.
Carl Byington <carl@five-ten-sg.com>
parents:
73
diff
changeset
|
61 |
59
7d5c637aaafb
General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents:
48
diff
changeset
|
62 #ifdef HAVE_UNISTD_H |
7d5c637aaafb
General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents:
48
diff
changeset
|
63 #include <unistd.h> |
75
987aa872294e
Use ftello/fseeko to properly handle large files.
Carl Byington <carl@five-ten-sg.com>
parents:
73
diff
changeset
|
64 #define D_MKDIR(x) mkdir(x, PERM_DIRS) |
59
7d5c637aaafb
General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents:
48
diff
changeset
|
65 #else |
7d5c637aaafb
General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents:
48
diff
changeset
|
66 #include "XGetopt.h" |
7d5c637aaafb
General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents:
48
diff
changeset
|
67 #ifdef HAVE_DIRECT_H |
7d5c637aaafb
General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents:
48
diff
changeset
|
68 #include <direct.h> // win32 |
75
987aa872294e
Use ftello/fseeko to properly handle large files.
Carl Byington <carl@five-ten-sg.com>
parents:
73
diff
changeset
|
69 #define D_MKDIR(x) mkdir(x) |
987aa872294e
Use ftello/fseeko to properly handle large files.
Carl Byington <carl@five-ten-sg.com>
parents:
73
diff
changeset
|
70 #define chdir _chdir |
59
7d5c637aaafb
General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents:
48
diff
changeset
|
71 #endif |
7d5c637aaafb
General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents:
48
diff
changeset
|
72 |
7d5c637aaafb
General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents:
48
diff
changeset
|
73 #ifdef HAVE_WINDOWS_H |
75
987aa872294e
Use ftello/fseeko to properly handle large files.
Carl Byington <carl@five-ten-sg.com>
parents:
73
diff
changeset
|
74 #include <windows.h> |
987aa872294e
Use ftello/fseeko to properly handle large files.
Carl Byington <carl@five-ten-sg.com>
parents:
73
diff
changeset
|
75 #endif |
987aa872294e
Use ftello/fseeko to properly handle large files.
Carl Byington <carl@five-ten-sg.com>
parents:
73
diff
changeset
|
76 |
987aa872294e
Use ftello/fseeko to properly handle large files.
Carl Byington <carl@five-ten-sg.com>
parents:
73
diff
changeset
|
77 #ifdef _MSC_VER |
987aa872294e
Use ftello/fseeko to properly handle large files.
Carl Byington <carl@five-ten-sg.com>
parents:
73
diff
changeset
|
78 #define vsnprintf _vsnprintf |
987aa872294e
Use ftello/fseeko to properly handle large files.
Carl Byington <carl@five-ten-sg.com>
parents:
73
diff
changeset
|
79 #define snprintf _snprintf |
987aa872294e
Use ftello/fseeko to properly handle large files.
Carl Byington <carl@five-ten-sg.com>
parents:
73
diff
changeset
|
80 #define ftello _ftelli64 |
987aa872294e
Use ftello/fseeko to properly handle large files.
Carl Byington <carl@five-ten-sg.com>
parents:
73
diff
changeset
|
81 #define fseeko _fseeki64 |
987aa872294e
Use ftello/fseeko to properly handle large files.
Carl Byington <carl@five-ten-sg.com>
parents:
73
diff
changeset
|
82 #define strcasecmp _stricmp |
987aa872294e
Use ftello/fseeko to properly handle large files.
Carl Byington <carl@five-ten-sg.com>
parents:
73
diff
changeset
|
83 #define off_t __int64 |
987aa872294e
Use ftello/fseeko to properly handle large files.
Carl Byington <carl@five-ten-sg.com>
parents:
73
diff
changeset
|
84 #define size_t __int64 |
987aa872294e
Use ftello/fseeko to properly handle large files.
Carl Byington <carl@five-ten-sg.com>
parents:
73
diff
changeset
|
85 #define int64_t __int64 |
987aa872294e
Use ftello/fseeko to properly handle large files.
Carl Byington <carl@five-ten-sg.com>
parents:
73
diff
changeset
|
86 #define uint64_t unsigned __int64 |
987aa872294e
Use ftello/fseeko to properly handle large files.
Carl Byington <carl@five-ten-sg.com>
parents:
73
diff
changeset
|
87 #define int32_t __int32 |
987aa872294e
Use ftello/fseeko to properly handle large files.
Carl Byington <carl@five-ten-sg.com>
parents:
73
diff
changeset
|
88 #define uint32_t unsigned int |
987aa872294e
Use ftello/fseeko to properly handle large files.
Carl Byington <carl@five-ten-sg.com>
parents:
73
diff
changeset
|
89 #define int16_t short int |
987aa872294e
Use ftello/fseeko to properly handle large files.
Carl Byington <carl@five-ten-sg.com>
parents:
73
diff
changeset
|
90 #define uint16_t unsigned short int |
987aa872294e
Use ftello/fseeko to properly handle large files.
Carl Byington <carl@five-ten-sg.com>
parents:
73
diff
changeset
|
91 #define int8_t signed char |
987aa872294e
Use ftello/fseeko to properly handle large files.
Carl Byington <carl@five-ten-sg.com>
parents:
73
diff
changeset
|
92 #define uint8_t unsigned char |
987aa872294e
Use ftello/fseeko to properly handle large files.
Carl Byington <carl@five-ten-sg.com>
parents:
73
diff
changeset
|
93 #define UINT64_MAX ((uint64_t)0xffffffffffffffff) |
987aa872294e
Use ftello/fseeko to properly handle large files.
Carl Byington <carl@five-ten-sg.com>
parents:
73
diff
changeset
|
94 int __cdecl _fseeki64(FILE *, __int64, int); |
987aa872294e
Use ftello/fseeko to properly handle large files.
Carl Byington <carl@five-ten-sg.com>
parents:
73
diff
changeset
|
95 __int64 __cdecl _ftelli64(FILE *); |
59
7d5c637aaafb
General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents:
48
diff
changeset
|
96 #endif |
7d5c637aaafb
General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents:
48
diff
changeset
|
97 #endif |
7d5c637aaafb
General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents:
48
diff
changeset
|
98 |
7d5c637aaafb
General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents:
48
diff
changeset
|
99 #ifdef HAVE_SYS_STAT_H |
75
987aa872294e
Use ftello/fseeko to properly handle large files.
Carl Byington <carl@five-ten-sg.com>
parents:
73
diff
changeset
|
100 #include <sys/stat.h> |
59
7d5c637aaafb
General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents:
48
diff
changeset
|
101 #endif |
7d5c637aaafb
General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents:
48
diff
changeset
|
102 |
7d5c637aaafb
General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents:
48
diff
changeset
|
103 #ifdef HAVE_SYS_TYPES_H |
75
987aa872294e
Use ftello/fseeko to properly handle large files.
Carl Byington <carl@five-ten-sg.com>
parents:
73
diff
changeset
|
104 #include <sys/types.h> |
59
7d5c637aaafb
General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents:
48
diff
changeset
|
105 #endif |
7d5c637aaafb
General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents:
48
diff
changeset
|
106 |
7d5c637aaafb
General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents:
48
diff
changeset
|
107 #ifdef HAVE_DIRENT_H |
75
987aa872294e
Use ftello/fseeko to properly handle large files.
Carl Byington <carl@five-ten-sg.com>
parents:
73
diff
changeset
|
108 #include <dirent.h> |
16 | 109 #endif |
110 | |
111 | |
73
3cb02cb1e6cd
Patch from Robert Simpson to fix doubly-linked list in the cache_ptr code, and allow arrays of unicode strings (without converting them).
Carl Byington <carl@five-ten-sg.com>
parents:
63
diff
changeset
|
112 void pst_debug(const char *fmt, ...); |
3cb02cb1e6cd
Patch from Robert Simpson to fix doubly-linked list in the cache_ptr code, and allow arrays of unicode strings (without converting them).
Carl Byington <carl@five-ten-sg.com>
parents:
63
diff
changeset
|
113 void pst_debug_hexdumper(FILE* out, char* buf, size_t size, int col, int delta); |
46 | 114 void pst_debug_hexprint(char *data, int size); |
16 | 115 |
73
3cb02cb1e6cd
Patch from Robert Simpson to fix doubly-linked list in the cache_ptr code, and allow arrays of unicode strings (without converting them).
Carl Byington <carl@five-ten-sg.com>
parents:
63
diff
changeset
|
116 void pst_debug_init(const char *fname); |
3cb02cb1e6cd
Patch from Robert Simpson to fix doubly-linked list in the cache_ptr code, and allow arrays of unicode strings (without converting them).
Carl Byington <carl@five-ten-sg.com>
parents:
63
diff
changeset
|
117 void pst_debug_msg_info (int line, const char *file, int type); |
3cb02cb1e6cd
Patch from Robert Simpson to fix doubly-linked list in the cache_ptr code, and allow arrays of unicode strings (without converting them).
Carl Byington <carl@five-ten-sg.com>
parents:
63
diff
changeset
|
118 void pst_debug_msg_text(const char* fmt, ...); |
3cb02cb1e6cd
Patch from Robert Simpson to fix doubly-linked list in the cache_ptr code, and allow arrays of unicode strings (without converting them).
Carl Byington <carl@five-ten-sg.com>
parents:
63
diff
changeset
|
119 void pst_debug_hexdump(char *x, size_t y, int cols, int delta); |
3cb02cb1e6cd
Patch from Robert Simpson to fix doubly-linked list in the cache_ptr code, and allow arrays of unicode strings (without converting them).
Carl Byington <carl@five-ten-sg.com>
parents:
63
diff
changeset
|
120 void pst_debug_func(const char *function); |
46 | 121 void pst_debug_func_ret(); |
122 void pst_debug_close(void); | |
123 void pst_debug_write(); | |
73
3cb02cb1e6cd
Patch from Robert Simpson to fix doubly-linked list in the cache_ptr code, and allow arrays of unicode strings (without converting them).
Carl Byington <carl@five-ten-sg.com>
parents:
63
diff
changeset
|
124 size_t pst_debug_fwrite(const void *ptr, size_t size, size_t nitems, FILE *stream); |
16 | 125 |
126 void * xmalloc(size_t size); | |
127 | |
46 | 128 #define MESSAGEPRINT(x,y) {pst_debug_msg_info(__LINE__,__FILE__,y);\ |
63
cfd6175f9334
Start work on pst2dii to convert to Summation dii load file format.
Carl Byington <carl@five-ten-sg.com>
parents:
59
diff
changeset
|
129 pst_debug_msg_text x;} |
16 | 130 |
131 #define LOGSTOP() {MESSAGESTOP();DEBUGSTOP();} | |
132 | |
133 #define DIE(x) {\ | |
134 MESSAGEPRINT(x, 0);\ | |
135 printf x;\ | |
136 exit(EXIT_FAILURE);\ | |
137 } | |
138 #define WARN(x) {\ | |
139 MESSAGEPRINT(x, 0);\ | |
140 printf x;\ | |
141 } | |
142 | |
143 #ifdef DEBUGPRINT | |
46 | 144 #define DEBUG_PRINT(x) pst_debug x; |
16 | 145 #else |
146 #define DEBUG_PRINT(x) {} | |
147 #endif | |
148 | |
149 #ifdef DEBUG_MODE_GEN | |
150 #define DEBUG(x) {DEBUG_PRINT(x);} | |
151 #else | |
152 #define DEBUG(x) {} | |
153 #endif | |
154 | |
155 #ifdef DEBUG_MODE_INDEX | |
156 #define DEBUG_INDEX(x) MESSAGEPRINT(x, DEBUG_INDEX_NO); | |
157 #else | |
158 #define DEBUG_INDEX(x) {} | |
159 #endif | |
160 | |
161 #ifdef DEBUG_MODE_EMAIL | |
162 #define DEBUG_EMAIL(x) MESSAGEPRINT(x, DEBUG_EMAIL_NO); | |
46 | 163 #define DEBUG_EMAIL_HEXPRINT(x,y) {pst_debug_msg_info(__LINE__, __FILE__, 11);\ |
73
3cb02cb1e6cd
Patch from Robert Simpson to fix doubly-linked list in the cache_ptr code, and allow arrays of unicode strings (without converting them).
Carl Byington <carl@five-ten-sg.com>
parents:
63
diff
changeset
|
164 pst_debug_hexdump((char*)x, y, 0x10, 0);} |
16 | 165 #else |
166 #define DEBUG_EMAIL(x) {} | |
167 #define DEBUG_EMAIL_HEXPRINT(x,y) {} | |
168 #endif | |
169 | |
170 #ifdef DEBUG_MODE_WARN | |
171 #define DEBUG_WARN(x) MESSAGEPRINT(x, DEBUG_WARN_NO); | |
172 #else | |
173 #define DEBUG_WARN(x) {} | |
174 #endif | |
175 | |
176 #ifdef DEBUG_MODE_READ | |
177 #define DEBUG_READ(x) MESSAGEPRINT(x, DEBUG_READ_NO); | |
178 #else | |
179 #define DEBUG_READ(x) {} | |
180 #endif | |
181 | |
182 #ifdef DEBUG_MODE_INFO | |
183 #define DEBUG_INFO(x) MESSAGEPRINT(x, DEBUG_INFO_NO); | |
184 #else | |
185 #define DEBUG_INFO(x) {} | |
186 #endif | |
187 | |
188 #ifdef DEBUG_MODE_MAIN | |
189 #define DEBUG_MAIN(x) MESSAGEPRINT(x, DEBUG_MAIN_NO); | |
190 #else | |
191 #define DEBUG_MAIN(x) {} | |
192 #endif | |
193 | |
194 #ifdef DEBUG_MODE_CODE | |
195 #define DEBUG_CODE(x) {x} | |
196 #else | |
197 #define DEBUG_CODE(x) {} | |
198 #endif | |
199 | |
200 #ifdef DEBUG_MODE_DECRYPT | |
201 #define DEBUG_DECRYPT(x) MESSAGEPRINT(x, DEBUG_DECRYPT_NO); | |
202 #else | |
203 #define DEBUG_DECRYPT(x) {} | |
204 #endif | |
205 | |
206 #ifdef DEBUG_MODE_HEXDUMP | |
207 #define DEBUG_HEXDUMP(x, s)\ | |
46 | 208 {pst_debug_msg_info(__LINE__, __FILE__, DEBUG_HEXDUMP_NO);\ |
73
3cb02cb1e6cd
Patch from Robert Simpson to fix doubly-linked list in the cache_ptr code, and allow arrays of unicode strings (without converting them).
Carl Byington <carl@five-ten-sg.com>
parents:
63
diff
changeset
|
209 pst_debug_hexdump((char*)x, s, 0x10, 0);} |
16 | 210 #define DEBUG_HEXDUMPC(x, s, c)\ |
46 | 211 {pst_debug_msg_info(__LINE__, __FILE__, DEBUG_HEXDUMP_NO);\ |
73
3cb02cb1e6cd
Patch from Robert Simpson to fix doubly-linked list in the cache_ptr code, and allow arrays of unicode strings (without converting them).
Carl Byington <carl@five-ten-sg.com>
parents:
63
diff
changeset
|
212 pst_debug_hexdump((char*)x, s, c, 0);} |
16 | 213 #else |
214 #define DEBUG_HEXDUMP(x, s) {} | |
215 #define DEBUG_HEXDUMPC(x, s, c) {} | |
216 #endif | |
217 | |
46 | 218 #define DEBUG_FILE(x) {pst_debug_msg_info(__LINE__, __FILE__, DEBUG_FILE_NO);\ |
63
cfd6175f9334
Start work on pst2dii to convert to Summation dii load file format.
Carl Byington <carl@five-ten-sg.com>
parents:
59
diff
changeset
|
219 pst_debug_msg_text x;} |
16 | 220 |
221 #ifdef DEBUG_MODE_FUNC | |
63
cfd6175f9334
Start work on pst2dii to convert to Summation dii load file format.
Carl Byington <carl@five-ten-sg.com>
parents:
59
diff
changeset
|
222 # define DEBUG_ENT(x) \ |
cfd6175f9334
Start work on pst2dii to convert to Summation dii load file format.
Carl Byington <carl@five-ten-sg.com>
parents:
59
diff
changeset
|
223 { \ |
cfd6175f9334
Start work on pst2dii to convert to Summation dii load file format.
Carl Byington <carl@five-ten-sg.com>
parents:
59
diff
changeset
|
224 pst_debug_func(x); \ |
cfd6175f9334
Start work on pst2dii to convert to Summation dii load file format.
Carl Byington <carl@five-ten-sg.com>
parents:
59
diff
changeset
|
225 MESSAGEPRINT(("Entering function %s\n",x),DEBUG_FUNCENT_NO); \ |
cfd6175f9334
Start work on pst2dii to convert to Summation dii load file format.
Carl Byington <carl@five-ten-sg.com>
parents:
59
diff
changeset
|
226 } |
cfd6175f9334
Start work on pst2dii to convert to Summation dii load file format.
Carl Byington <carl@five-ten-sg.com>
parents:
59
diff
changeset
|
227 # define DEBUG_RET() \ |
cfd6175f9334
Start work on pst2dii to convert to Summation dii load file format.
Carl Byington <carl@five-ten-sg.com>
parents:
59
diff
changeset
|
228 { \ |
cfd6175f9334
Start work on pst2dii to convert to Summation dii load file format.
Carl Byington <carl@five-ten-sg.com>
parents:
59
diff
changeset
|
229 MESSAGEPRINT(("Leaving function\n"),DEBUG_FUNCRET_NO); \ |
cfd6175f9334
Start work on pst2dii to convert to Summation dii load file format.
Carl Byington <carl@five-ten-sg.com>
parents:
59
diff
changeset
|
230 pst_debug_func_ret(); \ |
cfd6175f9334
Start work on pst2dii to convert to Summation dii load file format.
Carl Byington <carl@five-ten-sg.com>
parents:
59
diff
changeset
|
231 } |
16 | 232 #else |
233 # define DEBUG_ENT(x) {} | |
234 # define DEBUG_RET() {} | |
235 #endif | |
236 | |
46 | 237 #define DEBUG_INIT(fname) {pst_debug_init(fname);} |
238 #define DEBUG_CLOSE() {pst_debug_close();} | |
239 #define DEBUG_REGISTER_CLOSE() {if(atexit(pst_debug_close)!=0) fprintf(stderr, "Error registering atexit function\n");} | |
16 | 240 |
241 #define RET_DERROR(res, ret_val, x)\ | |
63
cfd6175f9334
Start work on pst2dii to convert to Summation dii load file format.
Carl Byington <carl@five-ten-sg.com>
parents:
59
diff
changeset
|
242 if (res) { DIE(x);} |
16 | 243 |
244 #define RET_ERROR(res, ret_val)\ | |
63
cfd6175f9334
Start work on pst2dii to convert to Summation dii load file format.
Carl Byington <carl@five-ten-sg.com>
parents:
59
diff
changeset
|
245 if (res) {return ret_val;} |
16 | 246 |
247 #define DEBUG_VERSION 1 | |
46 | 248 struct pst_debug_file_rec_m { |
63
cfd6175f9334
Start work on pst2dii to convert to Summation dii load file format.
Carl Byington <carl@five-ten-sg.com>
parents:
59
diff
changeset
|
249 unsigned short int funcname; |
cfd6175f9334
Start work on pst2dii to convert to Summation dii load file format.
Carl Byington <carl@five-ten-sg.com>
parents:
59
diff
changeset
|
250 unsigned short int filename; |
cfd6175f9334
Start work on pst2dii to convert to Summation dii load file format.
Carl Byington <carl@five-ten-sg.com>
parents:
59
diff
changeset
|
251 unsigned short int text; |
cfd6175f9334
Start work on pst2dii to convert to Summation dii load file format.
Carl Byington <carl@five-ten-sg.com>
parents:
59
diff
changeset
|
252 unsigned short int end; |
cfd6175f9334
Start work on pst2dii to convert to Summation dii load file format.
Carl Byington <carl@five-ten-sg.com>
parents:
59
diff
changeset
|
253 unsigned int line; |
cfd6175f9334
Start work on pst2dii to convert to Summation dii load file format.
Carl Byington <carl@five-ten-sg.com>
parents:
59
diff
changeset
|
254 unsigned int type; |
16 | 255 }; |
256 | |
46 | 257 struct pst_debug_file_rec_l { |
63
cfd6175f9334
Start work on pst2dii to convert to Summation dii load file format.
Carl Byington <carl@five-ten-sg.com>
parents:
59
diff
changeset
|
258 unsigned int funcname; |
cfd6175f9334
Start work on pst2dii to convert to Summation dii load file format.
Carl Byington <carl@five-ten-sg.com>
parents:
59
diff
changeset
|
259 unsigned int filename; |
cfd6175f9334
Start work on pst2dii to convert to Summation dii load file format.
Carl Byington <carl@five-ten-sg.com>
parents:
59
diff
changeset
|
260 unsigned int text; |
cfd6175f9334
Start work on pst2dii to convert to Summation dii load file format.
Carl Byington <carl@five-ten-sg.com>
parents:
59
diff
changeset
|
261 unsigned int end; |
cfd6175f9334
Start work on pst2dii to convert to Summation dii load file format.
Carl Byington <carl@five-ten-sg.com>
parents:
59
diff
changeset
|
262 unsigned int line; |
cfd6175f9334
Start work on pst2dii to convert to Summation dii load file format.
Carl Byington <carl@five-ten-sg.com>
parents:
59
diff
changeset
|
263 unsigned int type; |
16 | 264 }; |
265 | |
266 #endif //DEFINEH_H |