annotate src/define.h @ 67:90aa7814ad1f stable-0-6-8

Initial version of pst2dii to convert to Summation dii load file format.
author Carl Byington <carl@five-ten-sg.com>
date Wed, 05 Mar 2008 18:58:40 -0800
parents cfd6175f9334
children 3cb02cb1e6cd
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
16
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
1 /***
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
2 * define.h
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
3 * Part of the LibPST project
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
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
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
6 */
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
7
31
b88ceb81dba2 mege changes from Joe Nahmias
carl
parents: 28
diff changeset
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"
31
b88ceb81dba2 mege changes from Joe Nahmias
carl
parents: 28
diff changeset
10 #endif
48
f66078abed38 more fixes for 64 bit format
carl
parents: 46
diff changeset
11 #include "version.h"
16
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
12
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
13 #ifndef DEFINEH_H
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
14 #define DEFINEH_H
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
15
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
16 #define DEBUG_MODE_GEN
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
17 #define DEBUGPRINT
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
18 #define DEBUG_MODE_WARN
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
19 #define DEBUG_MODE_READ
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
20 #define DEBUG_MODE_EMAIL
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
21 #define DEBUG_MODE_MAIN
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
22 #define DEBUG_MODE_INDEX
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
23 #define DEBUG_MODE_CODE
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
24 #define DEBUG_MODE_INFO
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
25 #define DEBUG_MODE_HEXDUMP
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
26 #define DEBUG_MODE_FUNC
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
27
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
28 //number of items to save in memory between writes
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
29 #define DEBUG_MAX_ITEMS 0
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
30
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
31 #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
32 #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
33 #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
34 #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
35 #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
36 #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
37 #define DEBUG_MAIN_NO 7
36
6fe121a971c9 valgrind fixes
carl
parents: 34
diff changeset
38 #define DEBUG_DECRYPT_NO 8
6fe121a971c9 valgrind fixes
carl
parents: 34
diff changeset
39 #define DEBUG_FUNCENT_NO 9
6fe121a971c9 valgrind fixes
carl
parents: 34
diff changeset
40 #define DEBUG_FUNCRET_NO 10
16
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
41 #define DEBUG_HEXDUMP_NO 11
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
42
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
43 #include <stdio.h>
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
44 #include <stdlib.h>
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
45 #include <stdarg.h>
59
7d5c637aaafb General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
46 #include <time.h>
7d5c637aaafb General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
47 #include <string.h>
7d5c637aaafb General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
48 #include <ctype.h>
7d5c637aaafb General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
49 #include <limits.h>
7d5c637aaafb General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
50 #include <wchar.h>
7d5c637aaafb General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
51 #include <signal.h>
7d5c637aaafb General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
52 #include <errno.h>
16
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
53
59
7d5c637aaafb General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
54 #ifdef HAVE_UNISTD_H
7d5c637aaafb General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
55 #include <unistd.h>
7d5c637aaafb General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
56 #else
7d5c637aaafb General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
57 #include "XGetopt.h"
7d5c637aaafb General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
58 #ifdef HAVE_DIRECT_H
7d5c637aaafb General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
59 #include <direct.h> // win32
7d5c637aaafb General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
60 #define chdir _chdir
7d5c637aaafb General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
61 #define int32_t __int32
7d5c637aaafb General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
62 #endif
7d5c637aaafb General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
63
7d5c637aaafb General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
64 #ifdef HAVE_WINDOWS_H
7d5c637aaafb General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
65 #include <windows.h> // win32
7d5c637aaafb General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
66 #endif
7d5c637aaafb General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
67 #endif
7d5c637aaafb General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
68
7d5c637aaafb General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
69 #ifdef HAVE_SYS_STAT_H
7d5c637aaafb General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
70 # include <sys/stat.h> //mkdir
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 // for reading of directory and clearing in function mk_seperate_dir
7d5c637aaafb General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
74 #ifdef HAVE_SYS_TYPES_H
7d5c637aaafb General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
75 # include <sys/types.h>
7d5c637aaafb General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
76 #endif
7d5c637aaafb General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
77
7d5c637aaafb General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
78 #ifdef HAVE_DIRENT_H
7d5c637aaafb General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
79 # include <dirent.h>
16
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
80 #endif
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
81
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
82
46
b2a7f2e0926a more fixes for 64 bit format
carl
parents: 43
diff changeset
83 void pst_debug(char *fmt, ...);
b2a7f2e0926a more fixes for 64 bit format
carl
parents: 43
diff changeset
84 void pst_debug_hexdumper(FILE* out, unsigned char* buf, size_t size, int col, int delta);
b2a7f2e0926a more fixes for 64 bit format
carl
parents: 43
diff changeset
85 void pst_debug_hexprint(char *data, int size);
16
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
86
46
b2a7f2e0926a more fixes for 64 bit format
carl
parents: 43
diff changeset
87 void pst_debug_init(char *fname);
b2a7f2e0926a more fixes for 64 bit format
carl
parents: 43
diff changeset
88 void pst_debug_msg_info (int line, char *file, int type);
b2a7f2e0926a more fixes for 64 bit format
carl
parents: 43
diff changeset
89 void pst_debug_msg_text(char* fmt, ...);
b2a7f2e0926a more fixes for 64 bit format
carl
parents: 43
diff changeset
90 void pst_debug_hexdump(unsigned char *x, size_t y, int cols, int delta);
b2a7f2e0926a more fixes for 64 bit format
carl
parents: 43
diff changeset
91 void pst_debug_func(char *function);
b2a7f2e0926a more fixes for 64 bit format
carl
parents: 43
diff changeset
92 void pst_debug_func_ret();
b2a7f2e0926a more fixes for 64 bit format
carl
parents: 43
diff changeset
93 void pst_debug_close(void);
b2a7f2e0926a more fixes for 64 bit format
carl
parents: 43
diff changeset
94 void pst_debug_write();
16
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
95
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
96 void * xmalloc(size_t size);
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
97
46
b2a7f2e0926a more fixes for 64 bit format
carl
parents: 43
diff changeset
98 #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
99 pst_debug_msg_text x;}
16
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
100
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
101 #define LOGSTOP() {MESSAGESTOP();DEBUGSTOP();}
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
102
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
103 #define DIE(x) {\
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
104 MESSAGEPRINT(x, 0);\
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
105 printf x;\
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
106 exit(EXIT_FAILURE);\
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
107 }
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
108 #define WARN(x) {\
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
109 MESSAGEPRINT(x, 0);\
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
110 printf x;\
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
111 }
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
112
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
113 #ifdef DEBUGPRINT
46
b2a7f2e0926a more fixes for 64 bit format
carl
parents: 43
diff changeset
114 #define DEBUG_PRINT(x) pst_debug x;
16
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
115 #else
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
116 #define DEBUG_PRINT(x) {}
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
117 #endif
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
118
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
119 #ifdef DEBUG_MODE_GEN
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
120 #define DEBUG(x) {DEBUG_PRINT(x);}
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
121 #else
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
122 #define DEBUG(x) {}
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
123 #endif
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
124
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
125 #ifdef DEBUG_MODE_INDEX
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
126 #define DEBUG_INDEX(x) MESSAGEPRINT(x, DEBUG_INDEX_NO);
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
127 #else
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
128 #define DEBUG_INDEX(x) {}
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
129 #endif
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
130
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
131 #ifdef DEBUG_MODE_EMAIL
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
132 #define DEBUG_EMAIL(x) MESSAGEPRINT(x, DEBUG_EMAIL_NO);
46
b2a7f2e0926a more fixes for 64 bit format
carl
parents: 43
diff changeset
133 #define DEBUG_EMAIL_HEXPRINT(x,y) {pst_debug_msg_info(__LINE__, __FILE__, 11);\
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
134 pst_debug_hexdump(x, y, 0x10, 0);}
16
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
135 #else
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
136 #define DEBUG_EMAIL(x) {}
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
137 #define DEBUG_EMAIL_HEXPRINT(x,y) {}
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
138 #endif
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
139
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
140 #ifdef DEBUG_MODE_WARN
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
141 #define DEBUG_WARN(x) MESSAGEPRINT(x, DEBUG_WARN_NO);
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
142 #else
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
143 #define DEBUG_WARN(x) {}
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
144 #endif
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
145
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
146 #ifdef DEBUG_MODE_READ
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
147 #define DEBUG_READ(x) MESSAGEPRINT(x, DEBUG_READ_NO);
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
148 #else
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
149 #define DEBUG_READ(x) {}
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
150 #endif
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
151
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
152 #ifdef DEBUG_MODE_INFO
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
153 #define DEBUG_INFO(x) MESSAGEPRINT(x, DEBUG_INFO_NO);
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
154 #else
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
155 #define DEBUG_INFO(x) {}
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
156 #endif
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
157
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
158 #ifdef DEBUG_MODE_MAIN
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
159 #define DEBUG_MAIN(x) MESSAGEPRINT(x, DEBUG_MAIN_NO);
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
160 #else
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
161 #define DEBUG_MAIN(x) {}
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
162 #endif
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
163
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
164 #ifdef DEBUG_MODE_CODE
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
165 #define DEBUG_CODE(x) {x}
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
166 #else
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
167 #define DEBUG_CODE(x) {}
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
168 #endif
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
169
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
170 #ifdef DEBUG_MODE_DECRYPT
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
171 #define DEBUG_DECRYPT(x) MESSAGEPRINT(x, DEBUG_DECRYPT_NO);
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
172 #else
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
173 #define DEBUG_DECRYPT(x) {}
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
174 #endif
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
175
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
176 #ifdef DEBUG_MODE_HEXDUMP
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
177 #define DEBUG_HEXDUMP(x, s)\
46
b2a7f2e0926a more fixes for 64 bit format
carl
parents: 43
diff changeset
178 {pst_debug_msg_info(__LINE__, __FILE__, DEBUG_HEXDUMP_NO);\
b2a7f2e0926a more fixes for 64 bit format
carl
parents: 43
diff changeset
179 pst_debug_hexdump(x, s, 0x10, 0);}
16
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
180 #define DEBUG_HEXDUMPC(x, s, c)\
46
b2a7f2e0926a more fixes for 64 bit format
carl
parents: 43
diff changeset
181 {pst_debug_msg_info(__LINE__, __FILE__, DEBUG_HEXDUMP_NO);\
b2a7f2e0926a more fixes for 64 bit format
carl
parents: 43
diff changeset
182 pst_debug_hexdump(x, s, c, 0);}
16
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
183 #else
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
184 #define DEBUG_HEXDUMP(x, s) {}
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
185 #define DEBUG_HEXDUMPC(x, s, c) {}
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
186 #endif
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
187
46
b2a7f2e0926a more fixes for 64 bit format
carl
parents: 43
diff changeset
188 #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
189 pst_debug_msg_text x;}
16
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
190
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
191 #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
192 # 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
193 { \
cfd6175f9334 Start work on pst2dii to convert to Summation dii load file format.
Carl Byington <carl@five-ten-sg.com>
parents: 59
diff changeset
194 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
195 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
196 }
cfd6175f9334 Start work on pst2dii to convert to Summation dii load file format.
Carl Byington <carl@five-ten-sg.com>
parents: 59
diff changeset
197 # 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
198 { \
cfd6175f9334 Start work on pst2dii to convert to Summation dii load file format.
Carl Byington <carl@five-ten-sg.com>
parents: 59
diff changeset
199 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
200 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
201 }
16
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
202 #else
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
203 # define DEBUG_ENT(x) {}
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
204 # define DEBUG_RET() {}
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
205 #endif
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
206
46
b2a7f2e0926a more fixes for 64 bit format
carl
parents: 43
diff changeset
207 #define DEBUG_INIT(fname) {pst_debug_init(fname);}
b2a7f2e0926a more fixes for 64 bit format
carl
parents: 43
diff changeset
208 #define DEBUG_CLOSE() {pst_debug_close();}
b2a7f2e0926a more fixes for 64 bit format
carl
parents: 43
diff changeset
209 #define DEBUG_REGISTER_CLOSE() {if(atexit(pst_debug_close)!=0) fprintf(stderr, "Error registering atexit function\n");}
16
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
210
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
211 #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
212 if (res) { DIE(x);}
16
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
213
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
214 #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
215 if (res) {return ret_val;}
16
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
216
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
217 #define DEBUG_VERSION 1
46
b2a7f2e0926a more fixes for 64 bit format
carl
parents: 43
diff changeset
218 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
219 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
220 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
221 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
222 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
223 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
224 unsigned int type;
16
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
225 };
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
226
46
b2a7f2e0926a more fixes for 64 bit format
carl
parents: 43
diff changeset
227 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
228 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
229 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
230 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
231 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
232 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
233 unsigned int type;
16
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
234 };
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
235
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
236 #endif //DEFINEH_H