Mercurial > libpst
annotate src/define.h @ 128:7f747c8c9d02
cleanup installed headers
author | Carl Byington <carl@five-ten-sg.com> |
---|---|
date | Thu, 05 Feb 2009 09:22:22 -0800 |
parents | ab2a11e72250 |
children | fc11b1d1ad34 |
rev | line source |
---|---|
16 | 1 /*** |
2 * define.h | |
3 * Part of the LibPST project | |
4 * Written by David Smith | |
63
cfd6175f9334
Start work on pst2dii to convert to Summation dii load file format.
Carl Byington <carl@five-ten-sg.com>
parents:
59
diff
changeset
|
5 * dave.s@earthcorp.com |
16 | 6 */ |
7 | |
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 |
128
7f747c8c9d02
cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents:
123
diff
changeset
|
11 #include "common.h" |
7f747c8c9d02
cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents:
123
diff
changeset
|
12 |
31 | 13 #ifdef HAVE_CONFIG_H |
122
bdb38b434c0a
more changes from Fridrich Strba to avoid installing our config.h
Carl Byington <carl@five-ten-sg.com>
parents:
120
diff
changeset
|
14 #include "config.h" |
31 | 15 #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
|
16 |
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
|
17 #ifdef _WIN32 |
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
|
18 #undef 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
|
19 #define HAVE_DIRECT_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
|
20 #define HAVE_WINDOWS_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
|
21 #endif |
16 | 22 |
23 #define DEBUG_MODE_GEN | |
24 #define DEBUGPRINT | |
25 #define DEBUG_MODE_WARN | |
26 #define DEBUG_MODE_READ | |
27 #define DEBUG_MODE_EMAIL | |
28 #define DEBUG_MODE_MAIN | |
29 #define DEBUG_MODE_INDEX | |
30 #define DEBUG_MODE_CODE | |
31 #define DEBUG_MODE_INFO | |
32 #define DEBUG_MODE_HEXDUMP | |
33 #define DEBUG_MODE_FUNC | |
34 | |
35 //number of items to save in memory between writes | |
36 #define DEBUG_MAX_ITEMS 0 | |
37 | |
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
|
38 #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
|
39 #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
|
40 #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
|
41 #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
|
42 #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
|
43 #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
|
44 #define DEBUG_MAIN_NO 7 |
36 | 45 #define DEBUG_DECRYPT_NO 8 |
46 #define DEBUG_FUNCENT_NO 9 | |
47 #define DEBUG_FUNCRET_NO 10 | |
16 | 48 #define DEBUG_HEXDUMP_NO 11 |
49 | |
120
6395ced2b8b2
disable building pst2dii on cygwin
Carl Byington <carl@five-ten-sg.com>
parents:
118
diff
changeset
|
50 #ifdef HAVE_TIME_H |
6395ced2b8b2
disable building pst2dii on cygwin
Carl Byington <carl@five-ten-sg.com>
parents:
118
diff
changeset
|
51 #include <time.h> |
6395ced2b8b2
disable building pst2dii on cygwin
Carl Byington <carl@five-ten-sg.com>
parents:
118
diff
changeset
|
52 #endif |
6395ced2b8b2
disable building pst2dii on cygwin
Carl Byington <carl@five-ten-sg.com>
parents:
118
diff
changeset
|
53 |
6395ced2b8b2
disable building pst2dii on cygwin
Carl Byington <carl@five-ten-sg.com>
parents:
118
diff
changeset
|
54 #ifdef HAVE_STRING_H |
6395ced2b8b2
disable building pst2dii on cygwin
Carl Byington <carl@five-ten-sg.com>
parents:
118
diff
changeset
|
55 #include <string.h> |
6395ced2b8b2
disable building pst2dii on cygwin
Carl Byington <carl@five-ten-sg.com>
parents:
118
diff
changeset
|
56 #endif |
6395ced2b8b2
disable building pst2dii on cygwin
Carl Byington <carl@five-ten-sg.com>
parents:
118
diff
changeset
|
57 |
6395ced2b8b2
disable building pst2dii on cygwin
Carl Byington <carl@five-ten-sg.com>
parents:
118
diff
changeset
|
58 #ifdef HAVE_CTYPE_H |
6395ced2b8b2
disable building pst2dii on cygwin
Carl Byington <carl@five-ten-sg.com>
parents:
118
diff
changeset
|
59 #include <ctype.h> |
6395ced2b8b2
disable building pst2dii on cygwin
Carl Byington <carl@five-ten-sg.com>
parents:
118
diff
changeset
|
60 #endif |
6395ced2b8b2
disable building pst2dii on cygwin
Carl Byington <carl@five-ten-sg.com>
parents:
118
diff
changeset
|
61 |
6395ced2b8b2
disable building pst2dii on cygwin
Carl Byington <carl@five-ten-sg.com>
parents:
118
diff
changeset
|
62 #ifdef HAVE_LIMITS_H |
6395ced2b8b2
disable building pst2dii on cygwin
Carl Byington <carl@five-ten-sg.com>
parents:
118
diff
changeset
|
63 #include <limits.h> |
6395ced2b8b2
disable building pst2dii on cygwin
Carl Byington <carl@five-ten-sg.com>
parents:
118
diff
changeset
|
64 #endif |
6395ced2b8b2
disable building pst2dii on cygwin
Carl Byington <carl@five-ten-sg.com>
parents:
118
diff
changeset
|
65 |
6395ced2b8b2
disable building pst2dii on cygwin
Carl Byington <carl@five-ten-sg.com>
parents:
118
diff
changeset
|
66 #ifdef HAVE_WCHAR_H |
6395ced2b8b2
disable building pst2dii on cygwin
Carl Byington <carl@five-ten-sg.com>
parents:
118
diff
changeset
|
67 #include <wchar.h> |
6395ced2b8b2
disable building pst2dii on cygwin
Carl Byington <carl@five-ten-sg.com>
parents:
118
diff
changeset
|
68 #endif |
6395ced2b8b2
disable building pst2dii on cygwin
Carl Byington <carl@five-ten-sg.com>
parents:
118
diff
changeset
|
69 |
6395ced2b8b2
disable building pst2dii on cygwin
Carl Byington <carl@five-ten-sg.com>
parents:
118
diff
changeset
|
70 #ifdef HAVE_SIGNAL_H |
6395ced2b8b2
disable building pst2dii on cygwin
Carl Byington <carl@five-ten-sg.com>
parents:
118
diff
changeset
|
71 #include <signal.h> |
6395ced2b8b2
disable building pst2dii on cygwin
Carl Byington <carl@five-ten-sg.com>
parents:
118
diff
changeset
|
72 #endif |
6395ced2b8b2
disable building pst2dii on cygwin
Carl Byington <carl@five-ten-sg.com>
parents:
118
diff
changeset
|
73 |
6395ced2b8b2
disable building pst2dii on cygwin
Carl Byington <carl@five-ten-sg.com>
parents:
118
diff
changeset
|
74 #ifdef HAVE_ERRNO_H |
6395ced2b8b2
disable building pst2dii on cygwin
Carl Byington <carl@five-ten-sg.com>
parents:
118
diff
changeset
|
75 #include <errno.h> |
6395ced2b8b2
disable building pst2dii on cygwin
Carl Byington <carl@five-ten-sg.com>
parents:
118
diff
changeset
|
76 #endif |
6395ced2b8b2
disable building pst2dii on cygwin
Carl Byington <carl@five-ten-sg.com>
parents:
118
diff
changeset
|
77 |
123
ab2a11e72250
more cleanup of #include files.
Carl Byington <carl@five-ten-sg.com>
parents:
122
diff
changeset
|
78 #ifdef HAVE_ICONV_H |
ab2a11e72250
more cleanup of #include files.
Carl Byington <carl@five-ten-sg.com>
parents:
122
diff
changeset
|
79 #include <iconv.h> |
ab2a11e72250
more cleanup of #include files.
Carl Byington <carl@five-ten-sg.com>
parents:
122
diff
changeset
|
80 #endif |
ab2a11e72250
more cleanup of #include files.
Carl Byington <carl@five-ten-sg.com>
parents:
122
diff
changeset
|
81 |
ab2a11e72250
more cleanup of #include files.
Carl Byington <carl@five-ten-sg.com>
parents:
122
diff
changeset
|
82 #ifdef HAVE_REGEX_H |
ab2a11e72250
more cleanup of #include files.
Carl Byington <carl@five-ten-sg.com>
parents:
122
diff
changeset
|
83 #include <regex.h> |
ab2a11e72250
more cleanup of #include files.
Carl Byington <carl@five-ten-sg.com>
parents:
122
diff
changeset
|
84 #endif |
ab2a11e72250
more cleanup of #include files.
Carl Byington <carl@five-ten-sg.com>
parents:
122
diff
changeset
|
85 |
ab2a11e72250
more cleanup of #include files.
Carl Byington <carl@five-ten-sg.com>
parents:
122
diff
changeset
|
86 #ifdef HAVE_GD_H |
ab2a11e72250
more cleanup of #include files.
Carl Byington <carl@five-ten-sg.com>
parents:
122
diff
changeset
|
87 #include <gd.h> |
ab2a11e72250
more cleanup of #include files.
Carl Byington <carl@five-ten-sg.com>
parents:
122
diff
changeset
|
88 #endif |
ab2a11e72250
more cleanup of #include files.
Carl Byington <carl@five-ten-sg.com>
parents:
122
diff
changeset
|
89 |
16 | 90 |
75
987aa872294e
Use ftello/fseeko to properly handle large files.
Carl Byington <carl@five-ten-sg.com>
parents:
73
diff
changeset
|
91 #define PERM_DIRS 0777 |
987aa872294e
Use ftello/fseeko to properly handle large files.
Carl Byington <carl@five-ten-sg.com>
parents:
73
diff
changeset
|
92 |
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
|
93 #ifdef _WIN32 |
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 <direct.h> // win32 |
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 |
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 #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
|
97 #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
|
98 #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
|
99 #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
|
100 #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
|
101 #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
|
102 #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
|
103 #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
|
104 #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
|
105 #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
|
106 #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
|
107 #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
|
108 #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
|
109 #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
|
110 #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
|
111 #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
|
112 #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
|
113 #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
|
114 #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
|
115 #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
|
116 #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
|
117 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
|
118 __int64 __cdecl _ftelli64(FILE *); |
59
7d5c637aaafb
General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents:
48
diff
changeset
|
119 |
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
|
120 #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
|
121 #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
|
122 #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
|
123 #include "XGetopt.h" |
75
987aa872294e
Use ftello/fseeko to properly handle large files.
Carl Byington <carl@five-ten-sg.com>
parents:
73
diff
changeset
|
124 #endif |
987aa872294e
Use ftello/fseeko to properly handle large files.
Carl Byington <carl@five-ten-sg.com>
parents:
73
diff
changeset
|
125 |
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
|
126 #include <windows.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
|
127 #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
|
128 #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
|
129 #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
|
130 #define D_MKDIR(x) mkdir(x, PERM_DIRS) |
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
|
131 #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
|
132 #include "XGetopt.h" |
59
7d5c637aaafb
General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents:
48
diff
changeset
|
133 #endif |
7d5c637aaafb
General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents:
48
diff
changeset
|
134 #endif |
7d5c637aaafb
General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents:
48
diff
changeset
|
135 |
7d5c637aaafb
General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents:
48
diff
changeset
|
136 #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
|
137 #include <sys/stat.h> |
59
7d5c637aaafb
General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents:
48
diff
changeset
|
138 #endif |
7d5c637aaafb
General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents:
48
diff
changeset
|
139 |
7d5c637aaafb
General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents:
48
diff
changeset
|
140 #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
|
141 #include <sys/types.h> |
59
7d5c637aaafb
General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents:
48
diff
changeset
|
142 #endif |
7d5c637aaafb
General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents:
48
diff
changeset
|
143 |
7d5c637aaafb
General cleanup and code fixes.
Carl Byington <carl@five-ten-sg.com>
parents:
48
diff
changeset
|
144 #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
|
145 #include <dirent.h> |
16 | 146 #endif |
147 | |
148 | |
73
3cb02cb1e6cd
Patch from Robert Simpson to fix doubly-linked list in the cache_ptr code, and allow arrays of unicode strings (without converting them).
Carl Byington <carl@five-ten-sg.com>
parents:
63
diff
changeset
|
149 void pst_debug(const char *fmt, ...); |
3cb02cb1e6cd
Patch from Robert Simpson to fix doubly-linked list in the cache_ptr code, and allow arrays of unicode strings (without converting them).
Carl Byington <carl@five-ten-sg.com>
parents:
63
diff
changeset
|
150 void pst_debug_hexdumper(FILE* out, char* buf, size_t size, int col, int delta); |
46 | 151 void pst_debug_hexprint(char *data, int size); |
16 | 152 |
73
3cb02cb1e6cd
Patch from Robert Simpson to fix doubly-linked list in the cache_ptr code, and allow arrays of unicode strings (without converting them).
Carl Byington <carl@five-ten-sg.com>
parents:
63
diff
changeset
|
153 void pst_debug_init(const char *fname); |
3cb02cb1e6cd
Patch from Robert Simpson to fix doubly-linked list in the cache_ptr code, and allow arrays of unicode strings (without converting them).
Carl Byington <carl@five-ten-sg.com>
parents:
63
diff
changeset
|
154 void pst_debug_msg_info (int line, const char *file, int type); |
3cb02cb1e6cd
Patch from Robert Simpson to fix doubly-linked list in the cache_ptr code, and allow arrays of unicode strings (without converting them).
Carl Byington <carl@five-ten-sg.com>
parents:
63
diff
changeset
|
155 void pst_debug_msg_text(const char* fmt, ...); |
3cb02cb1e6cd
Patch from Robert Simpson to fix doubly-linked list in the cache_ptr code, and allow arrays of unicode strings (without converting them).
Carl Byington <carl@five-ten-sg.com>
parents:
63
diff
changeset
|
156 void pst_debug_hexdump(char *x, size_t y, int cols, int delta); |
3cb02cb1e6cd
Patch from Robert Simpson to fix doubly-linked list in the cache_ptr code, and allow arrays of unicode strings (without converting them).
Carl Byington <carl@five-ten-sg.com>
parents:
63
diff
changeset
|
157 void pst_debug_func(const char *function); |
46 | 158 void pst_debug_func_ret(); |
159 void pst_debug_close(void); | |
160 void pst_debug_write(); | |
73
3cb02cb1e6cd
Patch from Robert Simpson to fix doubly-linked list in the cache_ptr code, and allow arrays of unicode strings (without converting them).
Carl Byington <carl@five-ten-sg.com>
parents:
63
diff
changeset
|
161 size_t pst_debug_fwrite(const void *ptr, size_t size, size_t nitems, FILE *stream); |
16 | 162 |
163 void * xmalloc(size_t size); | |
164 | |
46 | 165 #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
|
166 pst_debug_msg_text x;} |
16 | 167 |
168 #define LOGSTOP() {MESSAGESTOP();DEBUGSTOP();} | |
169 | |
170 #define DIE(x) {\ | |
171 MESSAGEPRINT(x, 0);\ | |
172 printf x;\ | |
173 exit(EXIT_FAILURE);\ | |
174 } | |
175 #define WARN(x) {\ | |
176 MESSAGEPRINT(x, 0);\ | |
177 printf x;\ | |
178 } | |
179 | |
180 #ifdef DEBUGPRINT | |
46 | 181 #define DEBUG_PRINT(x) pst_debug x; |
16 | 182 #else |
183 #define DEBUG_PRINT(x) {} | |
184 #endif | |
185 | |
186 #ifdef DEBUG_MODE_GEN | |
187 #define DEBUG(x) {DEBUG_PRINT(x);} | |
188 #else | |
189 #define DEBUG(x) {} | |
190 #endif | |
191 | |
192 #ifdef DEBUG_MODE_INDEX | |
193 #define DEBUG_INDEX(x) MESSAGEPRINT(x, DEBUG_INDEX_NO); | |
194 #else | |
195 #define DEBUG_INDEX(x) {} | |
196 #endif | |
197 | |
198 #ifdef DEBUG_MODE_EMAIL | |
199 #define DEBUG_EMAIL(x) MESSAGEPRINT(x, DEBUG_EMAIL_NO); | |
46 | 200 #define DEBUG_EMAIL_HEXPRINT(x,y) {pst_debug_msg_info(__LINE__, __FILE__, 11);\ |
73
3cb02cb1e6cd
Patch from Robert Simpson to fix doubly-linked list in the cache_ptr code, and allow arrays of unicode strings (without converting them).
Carl Byington <carl@five-ten-sg.com>
parents:
63
diff
changeset
|
201 pst_debug_hexdump((char*)x, y, 0x10, 0);} |
16 | 202 #else |
203 #define DEBUG_EMAIL(x) {} | |
204 #define DEBUG_EMAIL_HEXPRINT(x,y) {} | |
205 #endif | |
206 | |
207 #ifdef DEBUG_MODE_WARN | |
208 #define DEBUG_WARN(x) MESSAGEPRINT(x, DEBUG_WARN_NO); | |
209 #else | |
210 #define DEBUG_WARN(x) {} | |
211 #endif | |
212 | |
213 #ifdef DEBUG_MODE_READ | |
214 #define DEBUG_READ(x) MESSAGEPRINT(x, DEBUG_READ_NO); | |
215 #else | |
216 #define DEBUG_READ(x) {} | |
217 #endif | |
218 | |
219 #ifdef DEBUG_MODE_INFO | |
220 #define DEBUG_INFO(x) MESSAGEPRINT(x, DEBUG_INFO_NO); | |
221 #else | |
222 #define DEBUG_INFO(x) {} | |
223 #endif | |
224 | |
225 #ifdef DEBUG_MODE_MAIN | |
226 #define DEBUG_MAIN(x) MESSAGEPRINT(x, DEBUG_MAIN_NO); | |
227 #else | |
228 #define DEBUG_MAIN(x) {} | |
229 #endif | |
230 | |
231 #ifdef DEBUG_MODE_CODE | |
232 #define DEBUG_CODE(x) {x} | |
233 #else | |
234 #define DEBUG_CODE(x) {} | |
235 #endif | |
236 | |
237 #ifdef DEBUG_MODE_DECRYPT | |
238 #define DEBUG_DECRYPT(x) MESSAGEPRINT(x, DEBUG_DECRYPT_NO); | |
239 #else | |
240 #define DEBUG_DECRYPT(x) {} | |
241 #endif | |
242 | |
243 #ifdef DEBUG_MODE_HEXDUMP | |
244 #define DEBUG_HEXDUMP(x, s)\ | |
46 | 245 {pst_debug_msg_info(__LINE__, __FILE__, DEBUG_HEXDUMP_NO);\ |
73
3cb02cb1e6cd
Patch from Robert Simpson to fix doubly-linked list in the cache_ptr code, and allow arrays of unicode strings (without converting them).
Carl Byington <carl@five-ten-sg.com>
parents:
63
diff
changeset
|
246 pst_debug_hexdump((char*)x, s, 0x10, 0);} |
16 | 247 #define DEBUG_HEXDUMPC(x, s, c)\ |
46 | 248 {pst_debug_msg_info(__LINE__, __FILE__, DEBUG_HEXDUMP_NO);\ |
73
3cb02cb1e6cd
Patch from Robert Simpson to fix doubly-linked list in the cache_ptr code, and allow arrays of unicode strings (without converting them).
Carl Byington <carl@five-ten-sg.com>
parents:
63
diff
changeset
|
249 pst_debug_hexdump((char*)x, s, c, 0);} |
16 | 250 #else |
251 #define DEBUG_HEXDUMP(x, s) {} | |
252 #define DEBUG_HEXDUMPC(x, s, c) {} | |
253 #endif | |
254 | |
46 | 255 #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
|
256 pst_debug_msg_text x;} |
16 | 257 |
258 #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
|
259 # 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
|
260 { \ |
cfd6175f9334
Start work on pst2dii to convert to Summation dii load file format.
Carl Byington <carl@five-ten-sg.com>
parents:
59
diff
changeset
|
261 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
|
262 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
|
263 } |
cfd6175f9334
Start work on pst2dii to convert to Summation dii load file format.
Carl Byington <carl@five-ten-sg.com>
parents:
59
diff
changeset
|
264 # 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
|
265 { \ |
cfd6175f9334
Start work on pst2dii to convert to Summation dii load file format.
Carl Byington <carl@five-ten-sg.com>
parents:
59
diff
changeset
|
266 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
|
267 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
|
268 } |
16 | 269 #else |
270 # define DEBUG_ENT(x) {} | |
271 # define DEBUG_RET() {} | |
272 #endif | |
273 | |
46 | 274 #define DEBUG_INIT(fname) {pst_debug_init(fname);} |
275 #define DEBUG_CLOSE() {pst_debug_close();} | |
276 #define DEBUG_REGISTER_CLOSE() {if(atexit(pst_debug_close)!=0) fprintf(stderr, "Error registering atexit function\n");} | |
16 | 277 |
278 #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
|
279 if (res) { DIE(x);} |
16 | 280 |
281 #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
|
282 if (res) {return ret_val;} |
16 | 283 |
284 #define DEBUG_VERSION 1 | |
46 | 285 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
|
286 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
|
287 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
|
288 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
|
289 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
|
290 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
|
291 unsigned int type; |
16 | 292 }; |
293 | |
46 | 294 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
|
295 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
|
296 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
|
297 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
|
298 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
|
299 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
|
300 unsigned int type; |
16 | 301 }; |
302 | |
128
7f747c8c9d02
cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents:
123
diff
changeset
|
303 #if BYTE_ORDER == BIG_ENDIAN |
7f747c8c9d02
cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents:
123
diff
changeset
|
304 # define LE64_CPU(x) \ |
7f747c8c9d02
cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents:
123
diff
changeset
|
305 x = ((((x) & UINT64_C(0xff00000000000000)) >> 56) | \ |
7f747c8c9d02
cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents:
123
diff
changeset
|
306 (((x) & UINT64_C(0x00ff000000000000)) >> 40) | \ |
7f747c8c9d02
cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents:
123
diff
changeset
|
307 (((x) & UINT64_C(0x0000ff0000000000)) >> 24) | \ |
7f747c8c9d02
cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents:
123
diff
changeset
|
308 (((x) & UINT64_C(0x000000ff00000000)) >> 8 ) | \ |
7f747c8c9d02
cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents:
123
diff
changeset
|
309 (((x) & UINT64_C(0x00000000ff000000)) << 8 ) | \ |
7f747c8c9d02
cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents:
123
diff
changeset
|
310 (((x) & UINT64_C(0x0000000000ff0000)) << 24) | \ |
7f747c8c9d02
cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents:
123
diff
changeset
|
311 (((x) & UINT64_C(0x000000000000ff00)) << 40) | \ |
7f747c8c9d02
cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents:
123
diff
changeset
|
312 (((x) & UINT64_C(0x00000000000000ff)) << 56)); |
7f747c8c9d02
cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents:
123
diff
changeset
|
313 # define LE32_CPU(x) \ |
7f747c8c9d02
cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents:
123
diff
changeset
|
314 x = ((((x) & 0xff000000) >> 24) | \ |
7f747c8c9d02
cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents:
123
diff
changeset
|
315 (((x) & 0x00ff0000) >> 8 ) | \ |
7f747c8c9d02
cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents:
123
diff
changeset
|
316 (((x) & 0x0000ff00) << 8 ) | \ |
7f747c8c9d02
cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents:
123
diff
changeset
|
317 (((x) & 0x000000ff) << 24)); |
7f747c8c9d02
cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents:
123
diff
changeset
|
318 # define LE16_CPU(x) \ |
7f747c8c9d02
cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents:
123
diff
changeset
|
319 x = ((((x) & 0xff00) >> 8) | \ |
7f747c8c9d02
cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents:
123
diff
changeset
|
320 (((x) & 0x00ff) << 8)); |
7f747c8c9d02
cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents:
123
diff
changeset
|
321 #elif BYTE_ORDER == LITTLE_ENDIAN |
7f747c8c9d02
cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents:
123
diff
changeset
|
322 # define LE64_CPU(x) {} |
7f747c8c9d02
cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents:
123
diff
changeset
|
323 # define LE32_CPU(x) {} |
7f747c8c9d02
cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents:
123
diff
changeset
|
324 # define LE16_CPU(x) {} |
7f747c8c9d02
cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents:
123
diff
changeset
|
325 #else |
7f747c8c9d02
cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents:
123
diff
changeset
|
326 # error "Byte order not supported by this library" |
7f747c8c9d02
cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents:
123
diff
changeset
|
327 #endif // BYTE_ORDER |
7f747c8c9d02
cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents:
123
diff
changeset
|
328 |
7f747c8c9d02
cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents:
123
diff
changeset
|
329 |
7f747c8c9d02
cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents:
123
diff
changeset
|
330 #define PST_LE_GET_UINT64(p) \ |
7f747c8c9d02
cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents:
123
diff
changeset
|
331 (uint64_t)((((uint8_t const *)(p))[0] << 0) | \ |
7f747c8c9d02
cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents:
123
diff
changeset
|
332 (((uint8_t const *)(p))[1] << 8) | \ |
7f747c8c9d02
cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents:
123
diff
changeset
|
333 (((uint8_t const *)(p))[2] << 16) | \ |
7f747c8c9d02
cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents:
123
diff
changeset
|
334 (((uint8_t const *)(p))[3] << 24) | \ |
7f747c8c9d02
cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents:
123
diff
changeset
|
335 (((uint8_t const *)(p))[4] << 32) | \ |
7f747c8c9d02
cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents:
123
diff
changeset
|
336 (((uint8_t const *)(p))[5] << 40) | \ |
7f747c8c9d02
cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents:
123
diff
changeset
|
337 (((uint8_t const *)(p))[6] << 48) | \ |
7f747c8c9d02
cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents:
123
diff
changeset
|
338 (((uint8_t const *)(p))[7] << 56)) |
7f747c8c9d02
cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents:
123
diff
changeset
|
339 |
7f747c8c9d02
cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents:
123
diff
changeset
|
340 #define PST_LE_GET_INT64(p) \ |
7f747c8c9d02
cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents:
123
diff
changeset
|
341 (int64_t)((((uint8_t const *)(p))[0] << 0) | \ |
7f747c8c9d02
cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents:
123
diff
changeset
|
342 (((uint8_t const *)(p))[1] << 8) | \ |
7f747c8c9d02
cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents:
123
diff
changeset
|
343 (((uint8_t const *)(p))[2] << 16) | \ |
7f747c8c9d02
cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents:
123
diff
changeset
|
344 (((uint8_t const *)(p))[3] << 24) | \ |
7f747c8c9d02
cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents:
123
diff
changeset
|
345 (((uint8_t const *)(p))[4] << 32) | \ |
7f747c8c9d02
cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents:
123
diff
changeset
|
346 (((uint8_t const *)(p))[5] << 40) | \ |
7f747c8c9d02
cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents:
123
diff
changeset
|
347 (((uint8_t const *)(p))[6] << 48) | \ |
7f747c8c9d02
cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents:
123
diff
changeset
|
348 (((uint8_t const *)(p))[7] << 56)) |
7f747c8c9d02
cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents:
123
diff
changeset
|
349 |
7f747c8c9d02
cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents:
123
diff
changeset
|
350 #define PST_LE_GET_UINT32(p) \ |
7f747c8c9d02
cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents:
123
diff
changeset
|
351 (uint32_t)((((uint8_t const *)(p))[0] << 0) | \ |
7f747c8c9d02
cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents:
123
diff
changeset
|
352 (((uint8_t const *)(p))[1] << 8) | \ |
7f747c8c9d02
cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents:
123
diff
changeset
|
353 (((uint8_t const *)(p))[2] << 16) | \ |
7f747c8c9d02
cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents:
123
diff
changeset
|
354 (((uint8_t const *)(p))[3] << 24)) |
7f747c8c9d02
cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents:
123
diff
changeset
|
355 |
7f747c8c9d02
cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents:
123
diff
changeset
|
356 #define PST_LE_GET_INT32(p) \ |
7f747c8c9d02
cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents:
123
diff
changeset
|
357 (int32_t)((((uint8_t const *)(p))[0] << 0) | \ |
7f747c8c9d02
cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents:
123
diff
changeset
|
358 (((uint8_t const *)(p))[1] << 8) | \ |
7f747c8c9d02
cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents:
123
diff
changeset
|
359 (((uint8_t const *)(p))[2] << 16) | \ |
7f747c8c9d02
cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents:
123
diff
changeset
|
360 (((uint8_t const *)(p))[3] << 24)) |
7f747c8c9d02
cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents:
123
diff
changeset
|
361 |
7f747c8c9d02
cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents:
123
diff
changeset
|
362 #define PST_LE_GET_UINT16(p) \ |
7f747c8c9d02
cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents:
123
diff
changeset
|
363 (uint16_t)((((uint8_t const *)(p))[0] << 0) | \ |
7f747c8c9d02
cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents:
123
diff
changeset
|
364 (((uint8_t const *)(p))[1] << 8)) |
7f747c8c9d02
cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents:
123
diff
changeset
|
365 |
7f747c8c9d02
cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents:
123
diff
changeset
|
366 #define PST_LE_GET_INT16(p) \ |
7f747c8c9d02
cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents:
123
diff
changeset
|
367 (int16_t)((((uint8_t const *)(p))[0] << 0) | \ |
7f747c8c9d02
cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents:
123
diff
changeset
|
368 (((uint8_t const *)(p))[1] << 8)) |
7f747c8c9d02
cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents:
123
diff
changeset
|
369 |
7f747c8c9d02
cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents:
123
diff
changeset
|
370 #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
|
371 |
7f747c8c9d02
cleanup installed headers
Carl Byington <carl@five-ten-sg.com>
parents:
123
diff
changeset
|
372 #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
|
373 |
16 | 374 #endif //DEFINEH_H |