annotate src/define.h @ 205:5f3fa53cb0e1

make nested mime multipart/alternative to hold the text/html parts
author Carl Byington <carl@five-ten-sg.com>
date Sat, 06 Jun 2009 12:48:09 -0700
parents 2f38c4ce606f
children 8e17efed33c1
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
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
92 #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
93 #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
94 #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
95 #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
96 #include "XGetopt.h"
59
7d5c637aaafb General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
97 #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
98 #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
99 #endif
7d5c637aaafb General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
100
7d5c637aaafb General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
101 #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
102 #include <sys/stat.h>
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_TYPES_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/types.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
201
3850a3b11745 fixes for parallel readpst
Carl Byington <carl@five-ten-sg.com>
parents: 200
diff changeset
109 #ifdef HAVE_SYS_SHM_H
3850a3b11745 fixes for parallel readpst
Carl Byington <carl@five-ten-sg.com>
parents: 200
diff changeset
110 #include <sys/shm.h>
3850a3b11745 fixes for parallel readpst
Carl Byington <carl@five-ten-sg.com>
parents: 200
diff changeset
111 #endif
3850a3b11745 fixes for parallel readpst
Carl Byington <carl@five-ten-sg.com>
parents: 200
diff changeset
112
200
d360f96f71f6 start changes for parallel readpst on multi-processor machines
Carl Byington <carl@five-ten-sg.com>
parents: 176
diff changeset
113 #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
114 #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
115 #endif
d360f96f71f6 start changes for parallel readpst on multi-processor machines
Carl Byington <carl@five-ten-sg.com>
parents: 176
diff changeset
116
59
7d5c637aaafb General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents: 48
diff changeset
117 #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
118 #include <dirent.h>
16
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
119 #endif
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
120
200
d360f96f71f6 start changes for parallel readpst on multi-processor machines
Carl Byington <carl@five-ten-sg.com>
parents: 176
diff changeset
121 #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
122 #include <semaphore.h>
d360f96f71f6 start changes for parallel readpst on multi-processor machines
Carl Byington <carl@five-ten-sg.com>
parents: 176
diff changeset
123 #endif
d360f96f71f6 start changes for parallel readpst on multi-processor machines
Carl Byington <carl@five-ten-sg.com>
parents: 176
diff changeset
124
16
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
125
202
2f38c4ce606f remove readpstlog, switch to plain ascii debug log files
Carl Byington <carl@five-ten-sg.com>
parents: 201
diff changeset
126 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
127 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
128 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
129 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
130 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
131 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
132 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
133 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
134 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
135 void* pst_malloc(size_t size);
16
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
136
202
2f38c4ce606f remove readpstlog, switch to plain ascii debug log files
Carl Byington <carl@five-ten-sg.com>
parents: 201
diff changeset
137 #define MESSAGEPRINT(...) pst_debug(__LINE__, __FILE__, __VA_ARGS__)
16
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
138
200
d360f96f71f6 start changes for parallel readpst on multi-processor machines
Carl Byington <carl@five-ten-sg.com>
parents: 176
diff changeset
139 #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
140 MESSAGEPRINT x; \
2f38c4ce606f remove readpstlog, switch to plain ascii debug log files
Carl Byington <carl@five-ten-sg.com>
parents: 201
diff changeset
141 pst_debug_lock(); \
2f38c4ce606f remove readpstlog, switch to plain ascii debug log files
Carl Byington <carl@five-ten-sg.com>
parents: 201
diff changeset
142 printf x; \
2f38c4ce606f remove readpstlog, switch to plain ascii debug log files
Carl Byington <carl@five-ten-sg.com>
parents: 201
diff changeset
143 fflush(stdout); \
2f38c4ce606f remove readpstlog, switch to plain ascii debug log files
Carl Byington <carl@five-ten-sg.com>
parents: 201
diff changeset
144 pst_debug_unlock(); \
16
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
145 }
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
146
202
2f38c4ce606f remove readpstlog, switch to plain ascii debug log files
Carl Byington <carl@five-ten-sg.com>
parents: 201
diff changeset
147 #define DIE(x) { \
2f38c4ce606f remove readpstlog, switch to plain ascii debug log files
Carl Byington <carl@five-ten-sg.com>
parents: 201
diff changeset
148 WARN(x); \
2f38c4ce606f remove readpstlog, switch to plain ascii debug log files
Carl Byington <carl@five-ten-sg.com>
parents: 201
diff changeset
149 exit(EXIT_FAILURE); \
2f38c4ce606f remove readpstlog, switch to plain ascii debug log files
Carl Byington <carl@five-ten-sg.com>
parents: 201
diff changeset
150 }
16
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
151
202
2f38c4ce606f remove readpstlog, switch to plain ascii debug log files
Carl Byington <carl@five-ten-sg.com>
parents: 201
diff changeset
152 #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
153 #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
154 #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
155 #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
156
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
157
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
158 # 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
159 { \
cfd6175f9334 Start work on pst2dii to convert to Summation dii load file format.
Carl Byington <carl@five-ten-sg.com>
parents: 59
diff changeset
160 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
161 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
162 }
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 # 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
164 { \
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__, "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
166 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
167 }
16
c508ee15dfca switch to automake/autoconf
carl
parents:
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 #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
170 #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
171 #define RET_DERROR(res, ret_val, x) if (res) { DIE(x);}
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
16
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
174
128
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
175 #if BYTE_ORDER == BIG_ENDIAN
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
176 # define LE64_CPU(x) \
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
177 x = ((((x) & UINT64_C(0xff00000000000000)) >> 56) | \
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
178 (((x) & UINT64_C(0x00ff000000000000)) >> 40) | \
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
179 (((x) & UINT64_C(0x0000ff0000000000)) >> 24) | \
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
180 (((x) & UINT64_C(0x000000ff00000000)) >> 8 ) | \
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
181 (((x) & UINT64_C(0x00000000ff000000)) << 8 ) | \
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
182 (((x) & UINT64_C(0x0000000000ff0000)) << 24) | \
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
183 (((x) & UINT64_C(0x000000000000ff00)) << 40) | \
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
184 (((x) & UINT64_C(0x00000000000000ff)) << 56));
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
185 # define LE32_CPU(x) \
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
186 x = ((((x) & 0xff000000) >> 24) | \
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
187 (((x) & 0x00ff0000) >> 8 ) | \
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
188 (((x) & 0x0000ff00) << 8 ) | \
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
189 (((x) & 0x000000ff) << 24));
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
190 # define LE16_CPU(x) \
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
191 x = ((((x) & 0xff00) >> 8) | \
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
192 (((x) & 0x00ff) << 8));
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
193 #elif BYTE_ORDER == LITTLE_ENDIAN
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
194 # define LE64_CPU(x) {}
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
195 # define LE32_CPU(x) {}
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
196 # define LE16_CPU(x) {}
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
197 #else
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
198 # error "Byte order not supported by this library"
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
199 #endif // BYTE_ORDER
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
200
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
201
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
202 #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
203 (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
204 (((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
205 (((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
206 (((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
207 (((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
208 (((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
209 (((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
210 (((uint8_t const *)(p))[7] << 56))
128
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
211
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
212 #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
213 (int64_t)((((uint8_t const *)(p))[0] << 0) | \
128
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
214 (((uint8_t const *)(p))[1] << 8) | \
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
215 (((uint8_t const *)(p))[2] << 16) | \
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
216 (((uint8_t const *)(p))[3] << 24) | \
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
217 (((uint8_t const *)(p))[4] << 32) | \
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
218 (((uint8_t const *)(p))[5] << 40) | \
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
219 (((uint8_t const *)(p))[6] << 48) | \
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
220 (((uint8_t const *)(p))[7] << 56))
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
221
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
222 #define PST_LE_GET_UINT32(p) \
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
223 (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
224 (((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
225 (((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
226 (((uint8_t const *)(p))[3] << 24))
128
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
227
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
228 #define PST_LE_GET_INT32(p) \
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
229 (int32_t)((((uint8_t const *)(p))[0] << 0) | \
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
230 (((uint8_t const *)(p))[1] << 8) | \
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
231 (((uint8_t const *)(p))[2] << 16) | \
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
232 (((uint8_t const *)(p))[3] << 24))
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
233
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
234 #define PST_LE_GET_UINT16(p) \
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
235 (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
236 (((uint8_t const *)(p))[1] << 8))
128
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_INT16(p) \
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
239 (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
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_UINT8(p) (*(uint8_t const *)(p))
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
243
7f747c8c9d02 cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents: 123
diff changeset
244 #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
245
129
fc11b1d1ad34 fix initial from header in mbox format.
Carl Byington <carl@five-ten-sg.com>
parents: 128
diff changeset
246
16
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
247 #endif //DEFINEH_H