Mercurial > libpst
comparison src/define.h @ 200:d360f96f71f6
start changes for parallel readpst on multi-processor machines
author | Carl Byington <carl@five-ten-sg.com> |
---|---|
date | Wed, 13 May 2009 20:06:53 -0700 |
parents | ac6e22c8a9cf |
children | 3850a3b11745 |
comparison
equal
deleted
inserted
replaced
199:e3a46f66332b | 200:d360f96f71f6 |
---|---|
134 | 134 |
135 #ifdef HAVE_SYS_TYPES_H | 135 #ifdef HAVE_SYS_TYPES_H |
136 #include <sys/types.h> | 136 #include <sys/types.h> |
137 #endif | 137 #endif |
138 | 138 |
139 #ifdef HAVE_SYS_WAIT_H | |
140 #include <sys/wait.h> | |
141 #endif | |
142 | |
139 #ifdef HAVE_DIRENT_H | 143 #ifdef HAVE_DIRENT_H |
140 #include <dirent.h> | 144 #include <dirent.h> |
145 #endif | |
146 | |
147 #ifdef HAVE_SEMAPHORE_H | |
148 #include <semaphore.h> | |
141 #endif | 149 #endif |
142 | 150 |
143 | 151 |
144 void pst_debug(const char *fmt, ...); | 152 void pst_debug(const char *fmt, ...); |
145 void pst_debug_hexdumper(FILE* out, char* buf, size_t size, int col, int delta); | 153 void pst_debug_hexdumper(FILE* out, char* buf, size_t size, int col, int delta); |
156 #define MESSAGEPRINT(x,y) {pst_debug_msg_info(__LINE__,__FILE__,y);\ | 164 #define MESSAGEPRINT(x,y) {pst_debug_msg_info(__LINE__,__FILE__,y);\ |
157 pst_debug_msg_text x;} | 165 pst_debug_msg_text x;} |
158 | 166 |
159 #define LOGSTOP() {MESSAGESTOP();DEBUGSTOP();} | 167 #define LOGSTOP() {MESSAGESTOP();DEBUGSTOP();} |
160 | 168 |
161 #define DIE(x) {\ | 169 #define DIE(x) { \ |
162 MESSAGEPRINT(x, 0);\ | 170 MESSAGEPRINT(x, 0); \ |
163 printf x;\ | 171 printf x; \ |
164 exit(EXIT_FAILURE);\ | 172 fflush(stdout); \ |
173 exit(EXIT_FAILURE); \ | |
165 } | 174 } |
166 #define WARN(x) {\ | 175 #define WARN(x) { \ |
167 MESSAGEPRINT(x, 0);\ | 176 MESSAGEPRINT(x, 0); \ |
168 printf x;\ | 177 printf x; \ |
178 fflush(stdout); \ | |
169 } | 179 } |
170 | 180 |
171 #ifdef DEBUGPRINT | 181 #ifdef DEBUGPRINT |
172 #define DEBUG_PRINT(x) pst_debug x; | 182 #define DEBUG_PRINT(x) pst_debug x; |
173 #else | 183 #else |