annotate src/define.h @ 212:8e17efed33c1

patch from Fridrich Strba to build on win32
author Carl Byington <carl@five-ten-sg.com>
date Mon, 08 Jun 2009 13:51:24 -0700
parents 5f3fa53cb0e1
children be1009c92ac2
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
120
6395ced2b8b2 disable building pst2dii on cygwin
Carl Byington <carl@five-ten-sg.com>
parents: 118
diff changeset
8 #ifndef DEFINEH_H
6395ced2b8b2 disable building pst2dii on cygwin
Carl Byington <carl@five-ten-sg.com>
parents: 118
diff changeset
9 #define DEFINEH_H
6395ced2b8b2 disable building pst2dii on cygwin
Carl Byington <carl@five-ten-sg.com>
parents: 118
diff changeset
10
163
03fbb0269f3c fix large file support, some sytems require config.h to be included earlier in the compilation.
Carl Byington <carl@five-ten-sg.com>
parents: 153
diff changeset
11 #ifdef HAVE_CONFIG_H
03fbb0269f3c fix large file support, some sytems require config.h to be included earlier in the compilation.
Carl Byington <carl@five-ten-sg.com>
parents: 153
diff changeset
12 #include "config.h"
03fbb0269f3c fix large file support, some sytems require config.h to be included earlier in the compilation.
Carl Byington <carl@five-ten-sg.com>
parents: 153
diff changeset
13 #endif
03fbb0269f3c fix large file support, some sytems require config.h to be included earlier in the compilation.
Carl Byington <carl@five-ten-sg.com>
parents: 153
diff changeset
14
129
fc11b1d1ad34 fix initial from header in mbox format.
Carl Byington <carl@five-ten-sg.com>
parents: 128
diff changeset
15 #include "libpst.h"
fc11b1d1ad34 fix initial from header in mbox format.
Carl Byington <carl@five-ten-sg.com>
parents: 128
diff changeset
16 #include "timeconv.h"
fc11b1d1ad34 fix initial from header in mbox format.
Carl Byington <carl@five-ten-sg.com>
parents: 128
diff changeset
17 #include "libstrfunc.h"
fc11b1d1ad34 fix initial from header in mbox format.
Carl Byington <carl@five-ten-sg.com>
parents: 128
diff changeset
18 #include "vbuf.h"
fc11b1d1ad34 fix initial from header in mbox format.
Carl Byington <carl@five-ten-sg.com>
parents: 128
diff changeset
19
16
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
20
120
6395ced2b8b2 disable building pst2dii on cygwin
Carl Byington <carl@five-ten-sg.com>
parents: 118
diff changeset
21 #ifdef HAVE_STRING_H
6395ced2b8b2 disable building pst2dii on cygwin
Carl Byington <carl@five-ten-sg.com>
parents: 118
diff changeset
22 #include <string.h>
6395ced2b8b2 disable building pst2dii on cygwin
Carl Byington <carl@five-ten-sg.com>
parents: 118
diff changeset
23 #endif
6395ced2b8b2 disable building pst2dii on cygwin
Carl Byington <carl@five-ten-sg.com>
parents: 118
diff changeset
24
6395ced2b8b2 disable building pst2dii on cygwin
Carl Byington <carl@five-ten-sg.com>
parents: 118
diff changeset
25 #ifdef HAVE_CTYPE_H
6395ced2b8b2 disable building pst2dii on cygwin
Carl Byington <carl@five-ten-sg.com>
parents: 118
diff changeset
26 #include <ctype.h>
6395ced2b8b2 disable building pst2dii on cygwin
Carl Byington <carl@five-ten-sg.com>
parents: 118
diff changeset
27 #endif
6395ced2b8b2 disable building pst2dii on cygwin
Carl Byington <carl@five-ten-sg.com>
parents: 118
diff changeset
28
6395ced2b8b2 disable building pst2dii on cygwin
Carl Byington <carl@five-ten-sg.com>
parents: 118
diff changeset
29 #ifdef HAVE_LIMITS_H
6395ced2b8b2 disable building pst2dii on cygwin
Carl Byington <carl@five-ten-sg.com>
parents: 118
diff changeset
30 #include <limits.h>
6395ced2b8b2 disable building pst2dii on cygwin
Carl Byington <carl@five-ten-sg.com>
parents: 118
diff changeset
31 #endif
6395ced2b8b2 disable building pst2dii on cygwin
Carl Byington <carl@five-ten-sg.com>
parents: 118
diff changeset
32
6395ced2b8b2 disable building pst2dii on cygwin
Carl Byington <carl@five-ten-sg.com>
parents: 118
diff changeset
33 #ifdef HAVE_WCHAR_H
6395ced2b8b2 disable building pst2dii on cygwin
Carl Byington <carl@five-ten-sg.com>
parents: 118
diff changeset
34 #include <wchar.h>
6395ced2b8b2 disable building pst2dii on cygwin
Carl Byington <carl@five-ten-sg.com>
parents: 118
diff changeset
35 #endif
6395ced2b8b2 disable building pst2dii on cygwin
Carl Byington <carl@five-ten-sg.com>
parents: 118
diff changeset
36
6395ced2b8b2 disable building pst2dii on cygwin
Carl Byington <carl@five-ten-sg.com>
parents: 118
diff changeset
37 #ifdef HAVE_SIGNAL_H
6395ced2b8b2 disable building pst2dii on cygwin
Carl Byington <carl@five-ten-sg.com>
parents: 118
diff changeset
38 #include <signal.h>
6395ced2b8b2 disable building pst2dii on cygwin
Carl Byington <carl@five-ten-sg.com>
parents: 118
diff changeset
39 #endif
6395ced2b8b2 disable building pst2dii on cygwin
Carl Byington <carl@five-ten-sg.com>
parents: 118
diff changeset
40
6395ced2b8b2 disable building pst2dii on cygwin
Carl Byington <carl@five-ten-sg.com>
parents: 118
diff changeset
41 #ifdef HAVE_ERRNO_H
6395ced2b8b2 disable building pst2dii on cygwin
Carl Byington <carl@five-ten-sg.com>
parents: 118
diff changeset
42 #include <errno.h>
6395ced2b8b2 disable building pst2dii on cygwin
Carl Byington <carl@five-ten-sg.com>
parents: 118
diff changeset
43 #endif
6395ced2b8b2 disable building pst2dii on cygwin
Carl Byington <carl@five-ten-sg.com>
parents: 118
diff changeset
44
153
0b1766da9be8 use AM_ICONV for better portability of the library location.
Carl Byington <carl@five-ten-sg.com>
parents: 133
diff changeset
45 #ifdef HAVE_ICONV
123
ab2a11e72250 more cleanup of #include files.
Carl Byington <carl@five-ten-sg.com>
parents: 122
diff changeset
46 #include <iconv.h>
ab2a11e72250 more cleanup of #include files.
Carl Byington <carl@five-ten-sg.com>
parents: 122
diff changeset
47 #endif
ab2a11e72250 more cleanup of #include files.
Carl Byington <carl@five-ten-sg.com>
parents: 122
diff changeset
48
ab2a11e72250 more cleanup of #include files.
Carl Byington <carl@five-ten-sg.com>
parents: 122
diff changeset
49 #ifdef HAVE_REGEX_H
ab2a11e72250 more cleanup of #include files.
Carl Byington <carl@five-ten-sg.com>
parents: 122
diff changeset
50 #include <regex.h>
ab2a11e72250 more cleanup of #include files.
Carl Byington <carl@five-ten-sg.com>
parents: 122
diff changeset
51 #endif
ab2a11e72250 more cleanup of #include files.
Carl Byington <carl@five-ten-sg.com>
parents: 122
diff changeset
52
ab2a11e72250 more cleanup of #include files.
Carl Byington <carl@five-ten-sg.com>
parents: 122
diff changeset
53 #ifdef HAVE_GD_H
ab2a11e72250 more cleanup of #include files.
Carl Byington <carl@five-ten-sg.com>
parents: 122
diff changeset
54 #include <gd.h>
ab2a11e72250 more cleanup of #include files.
Carl Byington <carl@five-ten-sg.com>
parents: 122
diff changeset
55 #endif
ab2a11e72250 more cleanup of #include files.
Carl Byington <carl@five-ten-sg.com>
parents: 122
diff changeset
56
16
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
57
75
987aa872294e Use ftello/fseeko to properly handle large files.
Carl Byington <carl@five-ten-sg.com>
parents: 73
diff changeset
58 #define PERM_DIRS 0777
987aa872294e Use ftello/fseeko to properly handle large files.
Carl Byington <carl@five-ten-sg.com>
parents: 73
diff changeset
59
118
0f1492b7fe8b patch from Fridrich Strba for building on mingw and general cleanup of autoconf files
Carl Byington <carl@five-ten-sg.com>
parents: 75
diff changeset
60 #ifdef _WIN32
133
2ec889a79e51 patch from Fridrich Strba, some systems need extra library for regex
Carl Byington <carl@five-ten-sg.com>
parents: 130
diff changeset
61 #include <direct.h>
118
0f1492b7fe8b patch from Fridrich Strba for building on mingw and general cleanup of autoconf files
Carl Byington <carl@five-ten-sg.com>
parents: 75
diff changeset
62
0f1492b7fe8b patch from Fridrich Strba for building on mingw and general cleanup of autoconf files
Carl Byington <carl@five-ten-sg.com>
parents: 75
diff changeset
63 #define D_MKDIR(x) mkdir(x)
0f1492b7fe8b patch from Fridrich Strba for building on mingw and general cleanup of autoconf files
Carl Byington <carl@five-ten-sg.com>
parents: 75
diff changeset
64 #define chdir _chdir
122
bdb38b434c0a more changes from Fridrich Strba to avoid installing our config.h
Carl Byington <carl@five-ten-sg.com>
parents: 120
diff changeset
65 #define strcasecmp _stricmp
118
0f1492b7fe8b patch from Fridrich Strba for building on mingw and general cleanup of autoconf files
Carl Byington <carl@five-ten-sg.com>
parents: 75
diff changeset
66 #define vsnprintf _vsnprintf
0f1492b7fe8b patch from Fridrich Strba for building on mingw and general cleanup of autoconf files
Carl Byington <carl@five-ten-sg.com>
parents: 75
diff changeset
67 #define snprintf _snprintf
0f1492b7fe8b patch from Fridrich Strba for building on mingw and general cleanup of autoconf files
Carl Byington <carl@five-ten-sg.com>
parents: 75
diff changeset
68 #ifdef _MSC_VER
0f1492b7fe8b patch from Fridrich Strba for building on mingw and general cleanup of autoconf files
Carl Byington <carl@five-ten-sg.com>
parents: 75
diff changeset
69 #define ftello _ftelli64
0f1492b7fe8b patch from Fridrich Strba for building on mingw and general cleanup of autoconf files
Carl Byington <carl@five-ten-sg.com>
parents: 75
diff changeset
70 #define fseeko _fseeki64
0f1492b7fe8b patch from Fridrich Strba for building on mingw and general cleanup of autoconf files
Carl Byington <carl@five-ten-sg.com>
parents: 75
diff changeset
71 #elif defined (__MINGW32__)
0f1492b7fe8b patch from Fridrich Strba for building on mingw and general cleanup of autoconf files
Carl Byington <carl@five-ten-sg.com>
parents: 75
diff changeset
72 #define ftello ftello64
0f1492b7fe8b patch from Fridrich Strba for building on mingw and general cleanup of autoconf files
Carl Byington <carl@five-ten-sg.com>
parents: 75
diff changeset
73 #define fseeko fseeko64
0f1492b7fe8b patch from Fridrich Strba for building on mingw and general cleanup of autoconf files
Carl Byington <carl@five-ten-sg.com>
parents: 75
diff changeset
74 #else
0f1492b7fe8b patch from Fridrich Strba for building on mingw and general cleanup of autoconf files
Carl Byington <carl@five-ten-sg.com>
parents: 75
diff changeset
75 #error Only MSC and mingw supported for Windows
59
7d5c637aaafb General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
76 #endif
118
0f1492b7fe8b patch from Fridrich Strba for building on mingw and general cleanup of autoconf files
Carl Byington <carl@five-ten-sg.com>
parents: 75
diff changeset
77 #ifndef __MINGW32__
0f1492b7fe8b patch from Fridrich Strba for building on mingw and general cleanup of autoconf files
Carl Byington <carl@five-ten-sg.com>
parents: 75
diff changeset
78 #define size_t __int64
0f1492b7fe8b patch from Fridrich Strba for building on mingw and general cleanup of autoconf files
Carl Byington <carl@five-ten-sg.com>
parents: 75
diff changeset
79 #endif
0f1492b7fe8b patch from Fridrich Strba for building on mingw and general cleanup of autoconf files
Carl Byington <carl@five-ten-sg.com>
parents: 75
diff changeset
80 #ifndef UINT64_MAX
0f1492b7fe8b patch from Fridrich Strba for building on mingw and general cleanup of autoconf files
Carl Byington <carl@five-ten-sg.com>
parents: 75
diff changeset
81 #define UINT64_MAX ((uint64_t)0xffffffffffffffff)
0f1492b7fe8b patch from Fridrich Strba for building on mingw and general cleanup of autoconf files
Carl Byington <carl@five-ten-sg.com>
parents: 75
diff changeset
82 #endif
0f1492b7fe8b patch from Fridrich Strba for building on mingw and general cleanup of autoconf files
Carl Byington <carl@five-ten-sg.com>
parents: 75
diff changeset
83 #define PRIx64 "I64x"
0f1492b7fe8b patch from Fridrich Strba for building on mingw and general cleanup of autoconf files
Carl Byington <carl@five-ten-sg.com>
parents: 75
diff changeset
84 int __cdecl _fseeki64(FILE *, __int64, int);
0f1492b7fe8b patch from Fridrich Strba for building on mingw and general cleanup of autoconf files
Carl Byington <carl@five-ten-sg.com>
parents: 75
diff changeset
85 __int64 __cdecl _ftelli64(FILE *);
59
7d5c637aaafb General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
86
118
0f1492b7fe8b patch from Fridrich Strba for building on mingw and general cleanup of autoconf files
Carl Byington <carl@five-ten-sg.com>
parents: 75
diff changeset
87 #ifdef __MINGW32__
0f1492b7fe8b patch from Fridrich Strba for building on mingw and general cleanup of autoconf files
Carl Byington <carl@five-ten-sg.com>
parents: 75
diff changeset
88 #include <getopt.h>
0f1492b7fe8b patch from Fridrich Strba for building on mingw and general cleanup of autoconf files
Carl Byington <carl@five-ten-sg.com>
parents: 75
diff changeset
89 #else
0f1492b7fe8b patch from Fridrich Strba for building on mingw and general cleanup of autoconf files
Carl Byington <carl@five-ten-sg.com>
parents: 75
diff changeset
90 #include "XGetopt.h"
75
987aa872294e Use ftello/fseeko to properly handle large files.
Carl Byington <carl@five-ten-sg.com>
parents: 73
diff changeset
91 #endif
212
8e17efed33c1 patch from Fridrich Strba to build on win32
Carl Byington <carl@five-ten-sg.com>
parents: 205
diff changeset
92 #include <process.h>
8e17efed33c1 patch from Fridrich Strba to build on win32
Carl Byington <carl@five-ten-sg.com>
parents: 205
diff changeset
93 #undef gmtime_r
8e17efed33c1 patch from Fridrich Strba to build on win32
Carl Byington <carl@five-ten-sg.com>
parents: 205
diff changeset
94 #define gmtime_r(tp,tmp) (gmtime(tp)?(*(tmp)=*gmtime(tp),(tmp)):0)
8e17efed33c1 patch from Fridrich Strba to build on win32
Carl Byington <carl@five-ten-sg.com>
parents: 205
diff changeset
95 #define ctime_r(tp,tmp) (ctime(tp)?(strcpy((tmp),ctime((tp))),(tmp)):0)
118
0f1492b7fe8b patch from Fridrich Strba for building on mingw and general cleanup of autoconf files
Carl Byington <carl@five-ten-sg.com>
parents: 75
diff changeset
96 #else
0f1492b7fe8b patch from Fridrich Strba for building on mingw and general cleanup of autoconf files
Carl Byington <carl@five-ten-sg.com>
parents: 75
diff changeset
97 #ifdef HAVE_UNISTD_H
0f1492b7fe8b patch from Fridrich Strba for building on mingw and general cleanup of autoconf files
Carl Byington <carl@five-ten-sg.com>
parents: 75
diff changeset
98 #include <unistd.h>
0f1492b7fe8b patch from Fridrich Strba for building on mingw and general cleanup of autoconf files
Carl Byington <carl@five-ten-sg.com>
parents: 75
diff changeset
99 #else
0f1492b7fe8b patch from Fridrich Strba for building on mingw and general cleanup of autoconf files
Carl Byington <carl@five-ten-sg.com>
parents: 75
diff changeset
100 #include "XGetopt.h"
59
7d5c637aaafb General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
101 #endif
133
2ec889a79e51 patch from Fridrich Strba, some systems need extra library for regex
Carl Byington <carl@five-ten-sg.com>
parents: 130
diff changeset
102 #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
103 #endif
7d5c637aaafb General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
104
7d5c637aaafb General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
105 #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
106 #include <sys/stat.h>
59
7d5c637aaafb General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
107 #endif
7d5c637aaafb General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
108
7d5c637aaafb General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
109 #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
110 #include <sys/types.h>
59
7d5c637aaafb General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
111 #endif
7d5c637aaafb General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
112
201
3850a3b11745 fixes for parallel readpst
Carl Byington <carl@five-ten-sg.com>
parents: 200
diff changeset
113 #ifdef HAVE_SYS_SHM_H
3850a3b11745 fixes for parallel readpst
Carl Byington <carl@five-ten-sg.com>
parents: 200
diff changeset
114 #include <sys/shm.h>
3850a3b11745 fixes for parallel readpst
Carl Byington <carl@five-ten-sg.com>
parents: 200
diff changeset
115 #endif
3850a3b11745 fixes for parallel readpst
Carl Byington <carl@five-ten-sg.com>
parents: 200
diff changeset
116
200
d360f96f71f6 start changes for parallel readpst on multi-processor machines
Carl Byington <carl@five-ten-sg.com>
parents: 176
diff changeset
117 #ifdef HAVE_SYS_WAIT_H
d360f96f71f6 start changes for parallel readpst on multi-processor machines
Carl Byington <carl@five-ten-sg.com>
parents: 176
diff changeset
118 #include <sys/wait.h>
d360f96f71f6 start changes for parallel readpst on multi-processor machines
Carl Byington <carl@five-ten-sg.com>
parents: 176
diff changeset
119 #endif
d360f96f71f6 start changes for parallel readpst on multi-processor machines
Carl Byington <carl@five-ten-sg.com>
parents: 176
diff changeset
120
59
7d5c637aaafb General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
121 #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
122 #include <dirent.h>
16
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
123 #endif
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
124
200
d360f96f71f6 start changes for parallel readpst on multi-processor machines
Carl Byington <carl@five-ten-sg.com>
parents: 176
diff changeset
125 #ifdef HAVE_SEMAPHORE_H
d360f96f71f6 start changes for parallel readpst on multi-processor machines
Carl Byington <carl@five-ten-sg.com>
parents: 176
diff changeset
126 #include <semaphore.h>
d360f96f71f6 start changes for parallel readpst on multi-processor machines
Carl Byington <carl@five-ten-sg.com>
parents: 176
diff changeset
127 #endif
d360f96f71f6 start changes for parallel readpst on multi-processor machines
Carl Byington <carl@five-ten-sg.com>
parents: 176
diff changeset
128
16
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
129
202
2f38c4ce606f remove readpstlog, switch to plain ascii debug log files
Carl Byington <carl@five-ten-sg.com>
parents: 201
diff changeset
130 void pst_debug_lock();
2f38c4ce606f remove readpstlog, switch to plain ascii debug log files
Carl Byington <carl@five-ten-sg.com>
parents: 201
diff changeset
131 void pst_debug_unlock();
2f38c4ce606f remove readpstlog, switch to plain ascii debug log files
Carl Byington <carl@five-ten-sg.com>
parents: 201
diff changeset
132 void pst_debug_init(const char* fname, void* output_mutex);
2f38c4ce606f remove readpstlog, switch to plain ascii debug log files
Carl Byington <carl@five-ten-sg.com>
parents: 201
diff changeset
133 void pst_debug_func(const char* function);
176
ac6e22c8a9cf build separate libpst, libpst-libs, libpst-devel rpms.
Carl Byington <carl@five-ten-sg.com>
parents: 172
diff changeset
134 void pst_debug_func_ret();
202
2f38c4ce606f remove readpstlog, switch to plain ascii debug log files
Carl Byington <carl@five-ten-sg.com>
parents: 201
diff changeset
135 void pst_debug(int line, const char *file, const char *fmt, ...);
2f38c4ce606f remove readpstlog, switch to plain ascii debug log files
Carl Byington <carl@five-ten-sg.com>
parents: 201
diff changeset
136 void pst_debug_hexdump(int line, const char *file, const char* buf, size_t size, int cols, int delta);
2f38c4ce606f remove readpstlog, switch to plain ascii debug log files
Carl Byington <carl@five-ten-sg.com>
parents: 201
diff changeset
137 void pst_debug_hexdumper(FILE* out, const char* buf, size_t size, int cols, int delta);
176
ac6e22c8a9cf build separate libpst, libpst-libs, libpst-devel rpms.
Carl Byington <carl@five-ten-sg.com>
parents: 172
diff changeset
138 void pst_debug_close(void);
ac6e22c8a9cf build separate libpst, libpst-libs, libpst-devel rpms.
Carl Byington <carl@five-ten-sg.com>
parents: 172
diff changeset
139 void* pst_malloc(size_t size);
16
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
140
202
2f38c4ce606f remove readpstlog, switch to plain ascii debug log files
Carl Byington <carl@five-ten-sg.com>
parents: 201
diff changeset
141 #define MESSAGEPRINT(...) pst_debug(__LINE__, __FILE__, __VA_ARGS__)
16
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
142
200
d360f96f71f6 start changes for parallel readpst on multi-processor machines
Carl Byington <carl@five-ten-sg.com>
parents: 176
diff changeset
143 #define WARN(x) { \
202
2f38c4ce606f remove readpstlog, switch to plain ascii debug log files
Carl Byington <carl@five-ten-sg.com>
parents: 201
diff changeset
144 MESSAGEPRINT x; \
2f38c4ce606f remove readpstlog, switch to plain ascii debug log files
Carl Byington <carl@five-ten-sg.com>
parents: 201
diff changeset
145 pst_debug_lock(); \
2f38c4ce606f remove readpstlog, switch to plain ascii debug log files
Carl Byington <carl@five-ten-sg.com>
parents: 201
diff changeset
146 printf x; \
2f38c4ce606f remove readpstlog, switch to plain ascii debug log files
Carl Byington <carl@five-ten-sg.com>
parents: 201
diff changeset
147 fflush(stdout); \
2f38c4ce606f remove readpstlog, switch to plain ascii debug log files
Carl Byington <carl@five-ten-sg.com>
parents: 201
diff changeset
148 pst_debug_unlock(); \
16
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
149 }
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
150
202
2f38c4ce606f remove readpstlog, switch to plain ascii debug log files
Carl Byington <carl@five-ten-sg.com>
parents: 201
diff changeset
151 #define DIE(x) { \
2f38c4ce606f remove readpstlog, switch to plain ascii debug log files
Carl Byington <carl@five-ten-sg.com>
parents: 201
diff changeset
152 WARN(x); \
2f38c4ce606f remove readpstlog, switch to plain ascii debug log files
Carl Byington <carl@five-ten-sg.com>
parents: 201
diff changeset
153 exit(EXIT_FAILURE); \
2f38c4ce606f remove readpstlog, switch to plain ascii debug log files
Carl Byington <carl@five-ten-sg.com>
parents: 201
diff changeset
154 }
16
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
155
202
2f38c4ce606f remove readpstlog, switch to plain ascii debug log files
Carl Byington <carl@five-ten-sg.com>
parents: 201
diff changeset
156 #define DEBUG_WARN(x) MESSAGEPRINT x
2f38c4ce606f remove readpstlog, switch to plain ascii debug log files
Carl Byington <carl@five-ten-sg.com>
parents: 201
diff changeset
157 #define DEBUG_INFO(x) MESSAGEPRINT x
2f38c4ce606f remove readpstlog, switch to plain ascii debug log files
Carl Byington <carl@five-ten-sg.com>
parents: 201
diff changeset
158 #define DEBUG_HEXDUMP(x, s) pst_debug_hexdump(__LINE__, __FILE__, (char*)x, s, 0x10, 0)
2f38c4ce606f remove readpstlog, switch to plain ascii debug log files
Carl Byington <carl@five-ten-sg.com>
parents: 201
diff changeset
159 #define DEBUG_HEXDUMPC(x, s, c) pst_debug_hexdump(__LINE__, __FILE__, (char*)x, s, c, 0)
16
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
160
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
161
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
162 # 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
163 { \
cfd6175f9334 Start work on pst2dii to convert to Summation dii load file format.
Carl Byington <carl@five-ten-sg.com>
parents: 59
diff changeset
164 pst_debug_func(x); \
202
2f38c4ce606f remove readpstlog, switch to plain ascii debug log files
Carl Byington <carl@five-ten-sg.com>
parents: 201
diff changeset
165 pst_debug(__LINE__, __FILE__, "Entering function\n"); \
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
166 }
cfd6175f9334 Start work on pst2dii to convert to Summation dii load file format.
Carl Byington <carl@five-ten-sg.com>
parents: 59
diff changeset
167 # 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
168 { \
202
2f38c4ce606f remove readpstlog, switch to plain ascii debug log files
Carl Byington <carl@five-ten-sg.com>
parents: 201
diff changeset
169 pst_debug(__LINE__, __FILE__, "Leaving function\n"); \
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
170 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
171 }
16
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
172
202
2f38c4ce606f remove readpstlog, switch to plain ascii debug log files
Carl Byington <carl@five-ten-sg.com>
parents: 201
diff changeset
173 #define DEBUG_INIT(fname,mutex) {pst_debug_init(fname,mutex);}
2f38c4ce606f remove readpstlog, switch to plain ascii debug log files
Carl Byington <carl@five-ten-sg.com>
parents: 201
diff changeset
174 #define DEBUG_CLOSE() {pst_debug_close();}
2f38c4ce606f remove readpstlog, switch to plain ascii debug log files
Carl Byington <carl@five-ten-sg.com>
parents: 201
diff changeset
175 #define RET_DERROR(res, ret_val, x) if (res) { DIE(x);}
16
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
176
202
2f38c4ce606f remove readpstlog, switch to plain ascii debug log files
Carl Byington <carl@five-ten-sg.com>
parents: 201
diff changeset
177
16
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
178
128
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
179 #if BYTE_ORDER == BIG_ENDIAN
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
180 # define LE64_CPU(x) \
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
181 x = ((((x) & UINT64_C(0xff00000000000000)) >> 56) | \
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
182 (((x) & UINT64_C(0x00ff000000000000)) >> 40) | \
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
183 (((x) & UINT64_C(0x0000ff0000000000)) >> 24) | \
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
184 (((x) & UINT64_C(0x000000ff00000000)) >> 8 ) | \
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
185 (((x) & UINT64_C(0x00000000ff000000)) << 8 ) | \
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
186 (((x) & UINT64_C(0x0000000000ff0000)) << 24) | \
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
187 (((x) & UINT64_C(0x000000000000ff00)) << 40) | \
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
188 (((x) & UINT64_C(0x00000000000000ff)) << 56));
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
189 # define LE32_CPU(x) \
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
190 x = ((((x) & 0xff000000) >> 24) | \
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
191 (((x) & 0x00ff0000) >> 8 ) | \
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
192 (((x) & 0x0000ff00) << 8 ) | \
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
193 (((x) & 0x000000ff) << 24));
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
194 # define LE16_CPU(x) \
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
195 x = ((((x) & 0xff00) >> 8) | \
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
196 (((x) & 0x00ff) << 8));
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
197 #elif BYTE_ORDER == LITTLE_ENDIAN
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
198 # define LE64_CPU(x) {}
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
199 # define LE32_CPU(x) {}
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
200 # define LE16_CPU(x) {}
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
201 #else
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
202 # error "Byte order not supported by this library"
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
203 #endif // BYTE_ORDER
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
204
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
205
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
206 #define PST_LE_GET_UINT64(p) \
129
fc11b1d1ad34 fix initial from header in mbox format.
Carl Byington <carl@five-ten-sg.com>
parents: 128
diff changeset
207 (uint64_t)((((uint8_t const *)(p))[0] << 0) | \
fc11b1d1ad34 fix initial from header in mbox format.
Carl Byington <carl@five-ten-sg.com>
parents: 128
diff changeset
208 (((uint8_t const *)(p))[1] << 8) | \
fc11b1d1ad34 fix initial from header in mbox format.
Carl Byington <carl@five-ten-sg.com>
parents: 128
diff changeset
209 (((uint8_t const *)(p))[2] << 16) | \
fc11b1d1ad34 fix initial from header in mbox format.
Carl Byington <carl@five-ten-sg.com>
parents: 128
diff changeset
210 (((uint8_t const *)(p))[3] << 24) | \
fc11b1d1ad34 fix initial from header in mbox format.
Carl Byington <carl@five-ten-sg.com>
parents: 128
diff changeset
211 (((uint8_t const *)(p))[4] << 32) | \
fc11b1d1ad34 fix initial from header in mbox format.
Carl Byington <carl@five-ten-sg.com>
parents: 128
diff changeset
212 (((uint8_t const *)(p))[5] << 40) | \
fc11b1d1ad34 fix initial from header in mbox format.
Carl Byington <carl@five-ten-sg.com>
parents: 128
diff changeset
213 (((uint8_t const *)(p))[6] << 48) | \
fc11b1d1ad34 fix initial from header in mbox format.
Carl Byington <carl@five-ten-sg.com>
parents: 128
diff changeset
214 (((uint8_t const *)(p))[7] << 56))
128
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
215
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
216 #define PST_LE_GET_INT64(p) \
129
fc11b1d1ad34 fix initial from header in mbox format.
Carl Byington <carl@five-ten-sg.com>
parents: 128
diff changeset
217 (int64_t)((((uint8_t const *)(p))[0] << 0) | \
128
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
218 (((uint8_t const *)(p))[1] << 8) | \
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
219 (((uint8_t const *)(p))[2] << 16) | \
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
220 (((uint8_t const *)(p))[3] << 24) | \
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
221 (((uint8_t const *)(p))[4] << 32) | \
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
222 (((uint8_t const *)(p))[5] << 40) | \
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
223 (((uint8_t const *)(p))[6] << 48) | \
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
224 (((uint8_t const *)(p))[7] << 56))
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
225
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
226 #define PST_LE_GET_UINT32(p) \
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
227 (uint32_t)((((uint8_t const *)(p))[0] << 0) | \
129
fc11b1d1ad34 fix initial from header in mbox format.
Carl Byington <carl@five-ten-sg.com>
parents: 128
diff changeset
228 (((uint8_t const *)(p))[1] << 8) | \
fc11b1d1ad34 fix initial from header in mbox format.
Carl Byington <carl@five-ten-sg.com>
parents: 128
diff changeset
229 (((uint8_t const *)(p))[2] << 16) | \
fc11b1d1ad34 fix initial from header in mbox format.
Carl Byington <carl@five-ten-sg.com>
parents: 128
diff changeset
230 (((uint8_t const *)(p))[3] << 24))
128
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
231
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
232 #define PST_LE_GET_INT32(p) \
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
233 (int32_t)((((uint8_t const *)(p))[0] << 0) | \
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
234 (((uint8_t const *)(p))[1] << 8) | \
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
235 (((uint8_t const *)(p))[2] << 16) | \
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
236 (((uint8_t const *)(p))[3] << 24))
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
237
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
238 #define PST_LE_GET_UINT16(p) \
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
239 (uint16_t)((((uint8_t const *)(p))[0] << 0) | \
129
fc11b1d1ad34 fix initial from header in mbox format.
Carl Byington <carl@five-ten-sg.com>
parents: 128
diff changeset
240 (((uint8_t const *)(p))[1] << 8))
128
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
241
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
242 #define PST_LE_GET_INT16(p) \
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
243 (int16_t)((((uint8_t const *)(p))[0] << 0) | \
129
fc11b1d1ad34 fix initial from header in mbox format.
Carl Byington <carl@five-ten-sg.com>
parents: 128
diff changeset
244 (((uint8_t const *)(p))[1] << 8))
128
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
245
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
246 #define PST_LE_GET_UINT8(p) (*(uint8_t const *)(p))
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
247
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
248 #define PST_LE_GET_INT8(p) (*(int8_t const *)(p))
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
249
129
fc11b1d1ad34 fix initial from header in mbox format.
Carl Byington <carl@five-ten-sg.com>
parents: 128
diff changeset
250
16
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
251 #endif //DEFINEH_H