Go to the documentation of this file. 1 #ifndef __JBXL_COMMON_HEADER_
2 #define __JBXL_COMMON_HEADER_
17 #define _INCLUDE_POSIX_SOURCE
18 #define __EXTENSIONS__
21 #ifndef _CRT_SECURE_NO_WARNINGS
22 #define _CRT_SECURE_NO_WARNINGS
36 #elif defined __CYGWIN__
55 #define unlink _unlink
56 #define snprintf _snprintf
57 #define vsnprintf _vsnprintf
58 #define strcasecmp _stricmp
59 #define strncasecmp _strnicmp
61 #define mkdir(d, m) _mkdir(d)
62 #define rmdir(d) _rmdir(d)
64 #define bzero(p, n) ZeroMemory((p), (n))
65 #define bcopy(f, t, n) CopyMemory((t), (f), (n))
78 #define tcscmp _tcscmp
79 #define tcsncmp _tcsncmp
80 #define tcsncpy _tcsncpy
81 #define tcslen _tcslen
82 #define tunlink _tunlink
83 #define tfopen _tfopen
84 #define sntprintf _sntprintf_s
87 #define tprintf _tprintf
88 #define ftprintf _ftprintf
91 #define DllExport __declspec(dllexport)
92 #define DllImport __declspec(dllimport)
96 #define WIN_DD_NULL (void*)0xdddddddddddddddd
98 #define WIN_DD_NULL (void*)0xdddddddd
122 #define Sleep(t) usleep((t)*1000)
128 #define MAXBUFSZ 4194304
129 #define BUFSZ2M 2087152
130 #define HHHBUFSZ 2087152
131 #define BUFSZ1M 1048576
132 #define HHBUFSZ 1048576
133 #define HBUFSZ 524288
134 #define RECVBUFSZ 262144
135 #define LLLBUFSZ 131072
136 #define LLBUFSZ 65536
172 #define LEN_IPADDR 17
173 #define LEN_IPADDR6 41
175 #define LEN_IPPORT 23
177 #define STRLEN_GUID 36
179 #define WORK_FILENAME_LEN 16
182 #define PI 3.1415926535897932385
183 #define PI15 4.7123889803846898577
184 #define PI2 6.2831853071795864769
185 #define PI_DIV2 1.5707963267948966192
186 #define PI_DIV2_3 4.7123889803846898577
187 #define PI_DIV3 1.0471975511965977462
188 #define PI_DIV3_2 2.0943951023931954923
189 #define PI_DIV4 0.78539816339744830962
190 #define PI_DIV6 0.52359877559829887308
191 #define LN_10 2.3025850929940456840
192 #define EXP_1 2.71828182845904523536
194 #define DEGREE2RAD 0.0174532925199432957692
195 #define RAD2DEGREE 57.2957795130823208768
197 #define SQROOT_05 0.707106781186547524401
198 #define SQROOT_2 1.4142135623730950488
199 #define SQROOT_3 1.7320508075688772935
200 #define SQROOT_5 2.2360679774997896964
201 #define SQROOT_7 2.6457513110645905905
204 #define SINTMAX 2147483647
205 #define SINTMIN -2147483647
206 #define UINTMAX 4294967295
207 #define SWORDMAX 32767
208 #define SWORDMIN -32768
209 #define UWORDMAX 65535
213 #define RAND_MAX 32767
215 #define RAND_MAX 2147483647
247 #define Max(x, y) (((x)<(y)) ? (y):(x))
250 #define Min(x, y) (((x)>(y)) ? (y):(x))
253 #define Sign(x) (((x)>=0) ? (1):(-1))
256 #define Loop while(1)
257 #define Xabs(x) (((x)>=0) ? (x):(-(x)))
258 #define getBit(x, n) ((sByte)((*(x+(n)/8)>>(7+(n)/8*8-(n)))&0x01))
259 #define setBit(x, n, i) ((i)?(*(x+(n)/8)|=(0x80>>((n)-(n)/8*8))):(*((x)+(n)/8)&=~(0x80>>((n)-(n)/8*8))))
260 #define checkBit(dat, bit) (((dat)&(bit))==(bit))
261 #define maskBit(dat, bit) ((dat)&(0xff>>(8-(bit))))
264 #define UNUSED(x) (void)((x))
268 #define Frand() (rand()/((double)RAND_MAX+1.0))
269 #define Drand(x) ((int)(rand()/((double)RAND_MAX+1.0)*((x)+1)))
270 #define LDrand(x) ((long int)(rand()/((double)RAND_MAX+1.0)*((x)+1)))
275 #define Error(s) {perror(s); return -1;}
291 #define JBXL_Max(x, y) (((x)<(y)) ? (y):(x))
292 #define JBXL_Min(x, y) (((x)>(y)) ? (y):(x))
293 #define JBXL_Sign(x) (((x)>=0) ? (1):(-1))
295 #define JBXL_EPS 1.0e-6
299 #define JBXL_3D_FORMAT_NONE 0
300 #define JBXL_3D_FORMAT_DAE 1
301 #define JBXL_3D_FORMAT_OBJ 2
302 #define JBXL_3D_FORMAT_FBX 3
303 #define JBXL_3D_FORMAT_GLTF 4
304 #define JBXL_3D_FORMAT_GLB 5
305 #define JBXL_3D_FORMAT_STL 8
306 #define JBXL_3D_FORMAT_STL_A 8
307 #define JBXL_3D_FORMAT_STL_B 9
309 #define JBXL_3D_ENGINE_NONE 0
310 #define JBXL_3D_ENGINE_UNITY 1
311 #define JBXL_3D_ENGINE_UE 2
315 #define JBXL_TEXTURE_UN_KNOWN 0
316 #define JBXL_TEXTURE_MOON 3
317 #define JBXL_TEXTURE_DICOM 4
318 #define JBXL_TEXTURE_USERSET 5
320 #define JBXL_TEXTURE_CT 16
321 #define JBXL_TEXTURE_JPEG 32
322 #define JBXL_TEXTURE_JPG 32
323 #define JBXL_TEXTURE_TIFF 48
324 #define JBXL_TEXTURE_PNG 64
325 #define JBXL_TEXTURE_TGA 80
326 #define JBXL_TEXTURE_JP2K 96
327 #define JBXL_TEXTURE_RAS 112
344 typedef struct _parameter32 {
349 typedef struct _parameter64 {
unsigned short uWord
2Byte