| 1 |
#ifndef __PLATFORM_H__ |
|---|
| 2 |
#define __PLATFORM_H__ |
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
#ifdef __cplusplus |
|---|
| 18 |
extern "C" { |
|---|
| 19 |
#endif |
|---|
| 20 |
|
|---|
| 21 |
|
|---|
| 22 |
|
|---|
| 23 |
|
|---|
| 24 |
|
|---|
| 25 |
|
|---|
| 26 |
|
|---|
| 27 |
|
|---|
| 28 |
|
|---|
| 29 |
|
|---|
| 30 |
|
|---|
| 31 |
|
|---|
| 32 |
|
|---|
| 33 |
|
|---|
| 34 |
|
|---|
| 35 |
|
|---|
| 36 |
|
|---|
| 37 |
|
|---|
| 38 |
|
|---|
| 39 |
|
|---|
| 40 |
|
|---|
| 41 |
|
|---|
| 42 |
|
|---|
| 43 |
|
|---|
| 44 |
|
|---|
| 45 |
|
|---|
| 46 |
|
|---|
| 47 |
|
|---|
| 48 |
|
|---|
| 49 |
|
|---|
| 50 |
|
|---|
| 51 |
|
|---|
| 52 |
|
|---|
| 53 |
|
|---|
| 54 |
|
|---|
| 55 |
#ifndef SUPPORT_ASIAN_ENCODINGS |
|---|
| 56 |
#define SUPPORT_ASIAN_ENCODINGS 1 |
|---|
| 57 |
#endif |
|---|
| 58 |
|
|---|
| 59 |
|
|---|
| 60 |
#ifndef SUPPORT_UTF16_ENCODINGS |
|---|
| 61 |
#define SUPPORT_UTF16_ENCODINGS 1 |
|---|
| 62 |
#endif |
|---|
| 63 |
|
|---|
| 64 |
|
|---|
| 65 |
#ifndef SUPPORT_ACCESSIBILITY_CHECKS |
|---|
| 66 |
#define SUPPORT_ACCESSIBILITY_CHECKS 1 |
|---|
| 67 |
#endif |
|---|
| 68 |
|
|---|
| 69 |
|
|---|
| 70 |
|
|---|
| 71 |
|
|---|
| 72 |
#if defined(macintosh) |
|---|
| 73 |
|
|---|
| 74 |
#define MAC_OS_CLASSIC |
|---|
| 75 |
#ifndef PLATFORM_NAME |
|---|
| 76 |
#define PLATFORM_NAME "Mac OS" |
|---|
| 77 |
#endif |
|---|
| 78 |
|
|---|
| 79 |
|
|---|
| 80 |
#if !defined(_POSIX) && !defined(NO_ACCESS_SUPPORT) |
|---|
| 81 |
#define NO_ACCESS_SUPPORT |
|---|
| 82 |
#endif |
|---|
| 83 |
|
|---|
| 84 |
#ifdef SUPPORT_GETPWNAM |
|---|
| 85 |
#undef SUPPORT_GETPWNAM |
|---|
| 86 |
#endif |
|---|
| 87 |
|
|---|
| 88 |
#elif defined(__APPLE__) && defined(__MACH__) |
|---|
| 89 |
|
|---|
| 90 |
#define MAC_OS_X |
|---|
| 91 |
#ifndef PLATFORM_NAME |
|---|
| 92 |
#define PLATFORM_NAME "Mac OS X" |
|---|
| 93 |
#endif |
|---|
| 94 |
#endif |
|---|
| 95 |
|
|---|
| 96 |
#if defined(MAC_OS_CLASSIC) || defined(MAC_OS_X) |
|---|
| 97 |
|
|---|
| 98 |
#define MAC_OS |
|---|
| 99 |
#define FILENAMES_CASE_SENSITIVE 0 |
|---|
| 100 |
#define strcasecmp strcmp |
|---|
| 101 |
#ifndef DFLT_REPL_CHARENC |
|---|
| 102 |
#define DFLT_REPL_CHARENC MACROMAN |
|---|
| 103 |
#endif |
|---|
| 104 |
#endif |
|---|
| 105 |
|
|---|
| 106 |
|
|---|
| 107 |
|
|---|
| 108 |
#if defined(__FreeBSD__) |
|---|
| 109 |
#define BSD_BASED_OS |
|---|
| 110 |
#ifndef PLATFORM_NAME |
|---|
| 111 |
#define PLATFORM_NAME "FreeBSD" |
|---|
| 112 |
#endif |
|---|
| 113 |
|
|---|
| 114 |
#elif defined(__NetBSD__) |
|---|
| 115 |
#define BSD_BASED_OS |
|---|
| 116 |
#ifndef PLATFORM_NAME |
|---|
| 117 |
#define PLATFORM_NAME "NetBSD" |
|---|
| 118 |
#endif |
|---|
| 119 |
|
|---|
| 120 |
#elif defined(__OpenBSD__) |
|---|
| 121 |
#define BSD_BASED_OS |
|---|
| 122 |
#ifndef PLATFORM_NAME |
|---|
| 123 |
#define PLATFORM_NAME "OpenBSD" |
|---|
| 124 |
#endif |
|---|
| 125 |
|
|---|
| 126 |
#elif defined(__MINT__) |
|---|
| 127 |
#define BSD_BASED_OS |
|---|
| 128 |
#ifndef PLATFORM_NAME |
|---|
| 129 |
#define PLATFORM_NAME "FreeMiNT" |
|---|
| 130 |
#endif |
|---|
| 131 |
|
|---|
| 132 |
#elif defined(__bsdi__) |
|---|
| 133 |
#define BSD_BASED_OS |
|---|
| 134 |
#ifndef PLATFORM_NAME |
|---|
| 135 |
#define PLATFORM_NAME "BSD/OS" |
|---|
| 136 |
#endif |
|---|
| 137 |
|
|---|
| 138 |
#endif |
|---|
| 139 |
|
|---|
| 140 |
|
|---|
| 141 |
|
|---|
| 142 |
#if defined(WINDOWS) || defined(_WIN32) |
|---|
| 143 |
|
|---|
| 144 |
#define WINDOWS_OS |
|---|
| 145 |
#ifndef PLATFORM_NAME |
|---|
| 146 |
#define PLATFORM_NAME "Windows" |
|---|
| 147 |
#endif |
|---|
| 148 |
|
|---|
| 149 |
#if defined(__MWERKS__) || defined(__MSL__) |
|---|
| 150 |
|
|---|
| 151 |
|
|---|
| 152 |
#ifdef SUPPORT_GETPWNAM |
|---|
| 153 |
#undef SUPPORT_GETPWNAM |
|---|
| 154 |
#endif |
|---|
| 155 |
|
|---|
| 156 |
|
|---|
| 157 |
#if !defined(NO_SETMODE_SUPPORT) |
|---|
| 158 |
#define NO_SETMODE_SUPPORT |
|---|
| 159 |
#endif |
|---|
| 160 |
|
|---|
| 161 |
#define strcasecmp _stricmp |
|---|
| 162 |
|
|---|
| 163 |
#endif |
|---|
| 164 |
|
|---|
| 165 |
#if defined(__BORLANDC__) |
|---|
| 166 |
#define strcasecmp stricmp |
|---|
| 167 |
#endif |
|---|
| 168 |
|
|---|
| 169 |
#define FILENAMES_CASE_SENSITIVE 0 |
|---|
| 170 |
|
|---|
| 171 |
#endif |
|---|
| 172 |
|
|---|
| 173 |
|
|---|
| 174 |
|
|---|
| 175 |
#if defined(linux) && defined(__alpha__) |
|---|
| 176 |
|
|---|
| 177 |
#define LINUX_OS |
|---|
| 178 |
#ifndef PLATFORM_NAME |
|---|
| 179 |
#define PLATFORM_NAME "Linux/Alpha" |
|---|
| 180 |
#endif |
|---|
| 181 |
|
|---|
| 182 |
#elif defined(linux) && defined(__sparc__) |
|---|
| 183 |
|
|---|
| 184 |
#define LINUX_OS |
|---|
| 185 |
#ifndef PLATFORM_NAME |
|---|
| 186 |
#define PLATFORM_NAME "Linux/Sparc" |
|---|
| 187 |
#endif |
|---|
| 188 |
|
|---|
| 189 |
#elif defined(linux) && (defined(__i386__) || defined(__i486__) || defined(__i586__) || defined(__i686__)) |
|---|
| 190 |
|
|---|
| 191 |
#define LINUX_OS |
|---|
| 192 |
#ifndef PLATFORM_NAME |
|---|
| 193 |
#define PLATFORM_NAME "Linux/x86" |
|---|
| 194 |
#endif |
|---|
| 195 |
|
|---|
| 196 |
#elif defined(linux) && defined(__powerpc__) |
|---|
| 197 |
|
|---|
| 198 |
#define LINUX_OS |
|---|
| 199 |
|
|---|
| 200 |
#if defined(__linux__) && defined(__powerpc__) |
|---|
| 201 |
|
|---|
| 202 |
|
|---|
| 203 |
|
|---|
| 204 |
|
|---|
| 205 |
#ifndef PLATFORM_NAME |
|---|
| 206 |
#define PLATFORM_NAME "MkLinux" |
|---|
| 207 |
#endif |
|---|
| 208 |
|
|---|
| 209 |
#else |
|---|
| 210 |
|
|---|
| 211 |
#ifndef PLATFORM_NAME |
|---|
| 212 |
#define PLATFORM_NAME "Linux/PPC" |
|---|
| 213 |
#endif |
|---|
| 214 |
|
|---|
| 215 |
#endif |
|---|
| 216 |
|
|---|
| 217 |
#elif defined(linux) || defined(__linux__) |
|---|
| 218 |
|
|---|
| 219 |
#define LINUX_OS |
|---|
| 220 |
#ifndef PLATFORM_NAME |
|---|
| 221 |
#define PLATFORM_NAME "Linux" |
|---|
| 222 |
#endif |
|---|
| 223 |
|
|---|
| 224 |
#endif |
|---|
| 225 |
|
|---|
| 226 |
|
|---|
| 227 |
|
|---|
| 228 |
#if defined(sun) |
|---|
| 229 |
#define SOLARIS_OS |
|---|
| 230 |
#ifndef PLATFORM_NAME |
|---|
| 231 |
#define PLATFORM_NAME "Solaris" |
|---|
| 232 |
#endif |
|---|
| 233 |
#endif |
|---|
| 234 |
|
|---|
| 235 |
|
|---|
| 236 |
|
|---|
| 237 |
#if defined(__hpux) |
|---|
| 238 |
#define HPUX_OS |
|---|
| 239 |
#ifndef PLATFORM_NAME |
|---|
| 240 |
#define PLATFORM_NAME "HPUX" |
|---|
| 241 |
#endif |
|---|
| 242 |
#endif |
|---|
| 243 |
|
|---|
| 244 |
|
|---|
| 245 |
|
|---|
| 246 |
#if defined(__riscos__) |
|---|
| 247 |
#define RISC_OS |
|---|
| 248 |
#ifndef PLATFORM_NAME |
|---|
| 249 |
#define PLATFORM_NAME "RISC OS" |
|---|
| 250 |
#endif |
|---|
| 251 |
#endif |
|---|
| 252 |
|
|---|
| 253 |
|
|---|
| 254 |
|
|---|
| 255 |
#if defined(__OS2__) || defined(__EMX__) |
|---|
| 256 |
#define OS2_OS |
|---|
| 257 |
#ifndef PLATFORM_NAME |
|---|
| 258 |
#define PLATFORM_NAME "OS/2" |
|---|
| 259 |
#endif |
|---|
| 260 |
#define FILENAMES_CASE_SENSITIVE 0 |
|---|
| 261 |
#define strcasecmp stricmp |
|---|
| 262 |
#endif |
|---|
| 263 |
|
|---|
| 264 |
|
|---|
| 265 |
|
|---|
| 266 |
#if defined(__sgi) |
|---|
| 267 |
#define IRIX_OS |
|---|
| 268 |
#ifndef PLATFORM_NAME |
|---|
| 269 |
#define PLATFORM_NAME "SGI IRIX" |
|---|
| 270 |
#endif |
|---|
| 271 |
#endif |
|---|
| 272 |
|
|---|
| 273 |
|
|---|
| 274 |
|
|---|
| 275 |
#if defined(_AIX) |
|---|
| 276 |
#define AIX_OS |
|---|
| 277 |
#ifndef PLATFORM_NAME |
|---|
| 278 |
#define PLATFORM_NAME "IBM AIX" |
|---|
| 279 |
#endif |
|---|
| 280 |
#endif |
|---|
| 281 |
|
|---|
| 282 |
|
|---|
| 283 |
|
|---|
| 284 |
|
|---|
| 285 |
#if defined(__BEOS__) |
|---|
| 286 |
#define BE_OS |
|---|
| 287 |
#ifndef PLATFORM_NAME |
|---|
| 288 |
#define PLATFORM_NAME "BeOS" |
|---|
| 289 |
#endif |
|---|
| 290 |
#endif |
|---|
| 291 |
|
|---|
| 292 |
|
|---|
| 293 |
|
|---|
| 294 |
#if defined(__CYGWIN__) |
|---|
| 295 |
#define CYGWIN_OS |
|---|
| 296 |
#ifndef PLATFORM_NAME |
|---|
| 297 |
#define PLATFORM_NAME "Cygwin" |
|---|
| 298 |
#endif |
|---|
| 299 |
#define FILENAMES_CASE_SENSITIVE 0 |
|---|
| 300 |
#endif |
|---|
| 301 |
|
|---|
| 302 |
|
|---|
| 303 |
|
|---|
| 304 |
#if defined(__VMS) |
|---|
| 305 |
#define OPENVMS_OS |
|---|
| 306 |
#ifndef PLATFORM_NAME |
|---|
| 307 |
#define PLATFORM_NAME "OpenVMS" |
|---|
| 308 |
#endif |
|---|
| 309 |
#define FILENAMES_CASE_SENSITIVE 0 |
|---|
| 310 |
#endif |
|---|
| 311 |
|
|---|
| 312 |
|
|---|
| 313 |
|
|---|
| 314 |
#if defined(__osf__) |
|---|
| 315 |
#define OSF_OS |
|---|
| 316 |
#ifndef PLATFORM_NAME |
|---|
| 317 |
#define PLATFORM_NAME "DEC Alpha OSF" |
|---|
| 318 |
#endif |
|---|
| 319 |
#endif |
|---|
| 320 |
|
|---|
| 321 |
|
|---|
| 322 |
|
|---|
| 323 |
#if defined(__arm) |
|---|
| 324 |
#define ARM_OS |
|---|
| 325 |
|
|---|
| 326 |
#if defined(forARM) && defined(__NEWTON_H) |
|---|
| 327 |
|
|---|
| 328 |
|
|---|
| 329 |
#define NEWTON_OS |
|---|
| 330 |
#ifndef PLATFORM_NAME |
|---|
| 331 |
#define PLATFORM_NAME "Newton" |
|---|
| 332 |
#endif |
|---|
| 333 |
|
|---|
| 334 |
#else |
|---|
| 335 |
|
|---|
| 336 |
#ifndef PLATFORM_NAME |
|---|
| 337 |
#define PLATFORM_NAME "ARM" |
|---|
| 338 |
#endif |
|---|
| 339 |
|
|---|
| 340 |
#endif |
|---|
| 341 |
|
|---|
| 342 |
#endif |
|---|
| 343 |
|
|---|
| 344 |
#include <ctype.h> |
|---|
| 345 |
#include <stdio.h> |
|---|
| 346 |
#include <setjmp.h> |
|---|
| 347 |
#include <stdlib.h> |
|---|
| 348 |
#include <stdarg.h> |
|---|
| 349 |
#include <string.h> |
|---|
| 350 |
#include <assert.h> |
|---|
| 351 |
|
|---|
| 352 |
#ifdef NEEDS_MALLOC_H |
|---|
| 353 |
#include <malloc.h> |
|---|
| 354 |
#endif |
|---|
| 355 |
|
|---|
| 356 |
#ifdef SUPPORT_GETPWNAM |
|---|
| 357 |
#include <pwd.h> |
|---|
| 358 |
#endif |
|---|
| 359 |
|
|---|
| 360 |
#ifdef NEEDS_UNISTD_H |
|---|
| 361 |
#include <unistd.h> |
|---|
| 362 |
#endif |
|---|
| 363 |
|
|---|
| 364 |
|
|---|
| 365 |
|
|---|
| 366 |
|
|---|
| 367 |
#ifndef DFLT_REPL_CHARENC |
|---|
| 368 |
#define DFLT_REPL_CHARENC WIN1252 |
|---|
| 369 |
#endif |
|---|
| 370 |
|
|---|
| 371 |
|
|---|
| 372 |
|
|---|
| 373 |
#ifndef FILENAMES_CASE_SENSITIVE |
|---|
| 374 |
#define FILENAMES_CASE_SENSITIVE 1 |
|---|
| 375 |
#endif |
|---|
| 376 |
|
|---|
| 377 |
|
|---|
| 378 |
|
|---|
| 379 |
|
|---|
| 380 |
|
|---|
| 381 |
|
|---|
| 382 |
|
|---|
| 383 |
|
|---|
| 384 |
|
|---|
| 385 |
|
|---|
| 386 |
|
|---|
| 387 |
|
|---|
| 388 |
|
|---|
| 389 |
|
|---|
| 390 |
|
|---|
| 391 |
|
|---|
| 392 |
|
|---|
| 393 |
|
|---|
| 394 |
|
|---|
| 395 |
|
|---|
| 396 |
|
|---|
| 397 |
#ifdef PRESERVEFILETIMES |
|---|
| 398 |
#undef PRESERVE_FILE_TIMES |
|---|
| 399 |
#define PRESERVE_FILE_TIMES PRESERVEFILETIMES |
|---|
| 400 |
#endif |
|---|
| 401 |
|
|---|
| 402 |
#ifndef PRESERVE_FILE_TIMES |
|---|
| 403 |
#if defined(RISC_OS) || defined(OPENVMS_OS) || defined(OSF_OS) |
|---|
| 404 |
#define PRESERVE_FILE_TIMES 0 |
|---|
| 405 |
#else |
|---|
| 406 |
#define PRESERVE_FILE_TIMES 1 |
|---|
| 407 |
#endif |
|---|
| 408 |
#endif |
|---|
| 409 |
|
|---|
| 410 |
#if PRESERVE_FILE_TIMES |
|---|
| 411 |
|
|---|
| 412 |
#ifndef HAS_FUTIME |
|---|
| 413 |
#if defined(CYGWIN_OS) || defined(BE_OS) || defined(OS2_OS) || defined(HPUX_OS) || defined(SOLARIS_OS) || defined(LINUX_OS) || defined(BSD_BASED_OS) || defined(MAC_OS) || defined(__MSL__) || defined(IRIX_OS) || defined(AIX_OS) || defined(__BORLANDC__) |
|---|
| 414 |
#define HAS_FUTIME 0 |
|---|
| 415 |
#else |
|---|
| 416 |
#define HAS_FUTIME 1 |
|---|
| 417 |
#endif |
|---|
| 418 |
#endif |
|---|
| 419 |
|
|---|
| 420 |
#ifndef UTIME_NEEDS_CLOSED_FILE |
|---|
| 421 |
#if defined(SOLARIS_OS) || defined(BSD_BASED_OS) || defined(MAC_OS) || defined(__MSL__) || defined(LINUX_OS) |
|---|
| 422 |
#define UTIME_NEEDS_CLOSED_FILE 1 |
|---|
| 423 |
#else |
|---|
| 424 |
#define UTIME_NEEDS_CLOSED_FILE 0 |
|---|
| 425 |
#endif |
|---|
| 426 |
#endif |
|---|
| 427 |
|
|---|
| 428 |
#if defined(MAC_OS_X) || (!defined(MAC_OS_CLASSIC) && !defined(__MSL__)) |
|---|
| 429 |
#include <sys/types.h> |
|---|
| 430 |
#include <sys/stat.h> |
|---|
| 431 |
#else |
|---|
| 432 |
#include <stat.h> |
|---|
| 433 |
#endif |
|---|
| 434 |
|
|---|
| 435 |
#if HAS_FUTIME |
|---|
| 436 |
#include <sys/utime.h> |
|---|
| 437 |
#else |
|---|
| 438 |
#include <utime.h> |
|---|
| 439 |
#endif |
|---|
| 440 |
|
|---|
| 441 |
|
|---|
| 442 |
|
|---|
| 443 |
|
|---|
| 444 |
|
|---|
| 445 |
|
|---|
| 446 |
|
|---|
| 447 |
|
|---|
| 448 |
|
|---|
| 449 |
|
|---|
| 450 |
#if defined(_WIN32) && !defined(__MSL__) && !defined(__BORLANDC__) |
|---|
| 451 |
|
|---|
| 452 |
#define futime _futime |
|---|
| 453 |
#define fstat _fstat |
|---|
| 454 |
#define utimbuf _utimbuf |
|---|
| 455 |
#define stat _stat |
|---|
| 456 |
#define utime _utime |
|---|
| 457 |
#define vsnprintf _vsnprintf |
|---|
| 458 |
#endif |
|---|
| 459 |
|
|---|
| 460 |
#endif |
|---|
| 461 |
|
|---|
| 462 |
|
|---|
| 463 |
|
|---|
| 464 |
|
|---|
| 465 |
|
|---|
| 466 |
|
|---|
| 467 |
|
|---|
| 468 |
|
|---|
| 469 |
#if defined(_WIN32) && !defined(__MSL__) && !defined(__BORLANDC__) |
|---|
| 470 |
|
|---|
| 471 |
#ifndef __WATCOMC__ |
|---|
| 472 |
#define fileno _fileno |
|---|
| 473 |
#define setmode _setmode |
|---|
| 474 |
#endif |
|---|
| 475 |
|
|---|
| 476 |
#define access _access |
|---|
| 477 |
#define strcasecmp _stricmp |
|---|
| 478 |
|
|---|
| 479 |
#if _MSC_VER > 1000 |
|---|
| 480 |
#pragma warning( disable : 4189 ) |
|---|
| 481 |
#pragma warning( disable : 4100 ) |
|---|
| 482 |
#pragma warning( disable : 4706 ) |
|---|
| 483 |
#endif |
|---|
| 484 |
|
|---|
| 485 |
#endif |
|---|
| 486 |
|
|---|
| 487 |
#if defined(_WIN32) |
|---|
| 488 |
|
|---|
| 489 |
#if (defined(_USRDLL) || defined(_WINDLL)) && !defined(TIDY_EXPORT) |
|---|
| 490 |
#define TIDY_EXPORT __declspec( dllexport ) |
|---|
| 491 |
#endif |
|---|
| 492 |
|
|---|
| 493 |
#ifndef TIDY_CALL |
|---|
| 494 |
#define TIDY_CALL __stdcall |
|---|
| 495 |
#endif |
|---|
| 496 |
|
|---|
| 497 |
#endif |
|---|
| 498 |
|
|---|
| 499 |
|
|---|
| 500 |
|
|---|
| 501 |
#if defined(BE_OS) || defined(SOLARIS_OS) || defined(BSD_BASED_OS) || defined(OSF_OS) || defined(IRIX_OS) || defined(AIX_OS) |
|---|
| 502 |
#include <sys/types.h> |
|---|
| 503 |
#endif |
|---|
| 504 |
#if !defined(HPUX_OS) && !defined(CYGWIN_OS) && !defined(MAC_OS_X) && !defined(BE_OS) && !defined(SOLARIS_OS) && !defined(BSD_BASED_OS) && !defined(OSF_OS) && !defined(IRIX_OS) && !defined(AIX_OS) && !defined(LINUX_OS) |
|---|
| 505 |
typedef unsigned int uint; |
|---|
| 506 |
#endif |
|---|
| 507 |
#if defined(HPUX_OS) || defined(CYGWIN_OS) || defined(MAC_OS) || defined(BSD_BASED_OS) || defined(_WIN32) |
|---|
| 508 |
typedef unsigned long ulong; |
|---|
| 509 |
#endif |
|---|
| 510 |
|
|---|
| 511 |
#ifndef TIDY_EXPORT |
|---|
| 512 |
#define TIDY_EXPORT |
|---|
| 513 |
#endif |
|---|
| 514 |
|
|---|
| 515 |
#ifndef TIDY_STRUCT |
|---|
| 516 |
#define TIDY_STRUCT |
|---|
| 517 |
#endif |
|---|
| 518 |
|
|---|
| 519 |
typedef unsigned char byte; |
|---|
| 520 |
|
|---|
| 521 |
typedef uint tchar; |
|---|
| 522 |
typedef char tmbchar; |
|---|
| 523 |
#ifndef TMBSTR_DEFINED |
|---|
| 524 |
typedef tmbchar* tmbstr; |
|---|
| 525 |
typedef const tmbchar* ctmbstr; |
|---|
| 526 |
#define NULLSTR (tmbstr)"" |
|---|
| 527 |
#define TMBSTR_DEFINED |
|---|
| 528 |
#endif |
|---|
| 529 |
|
|---|
| 530 |
#ifndef TIDY_CALL |
|---|
| 531 |
#define TIDY_CALL |
|---|
| 532 |
#endif |
|---|
| 533 |
|
|---|
| 534 |
#if defined(__GNUC__) || defined(__INTEL_COMPILER) |
|---|
| 535 |
# define ARG_UNUSED(x) x __attribute__((unused)) |
|---|
| 536 |
#else |
|---|
| 537 |
# define ARG_UNUSED(x) x |
|---|
| 538 |
#endif |
|---|
| 539 |
|
|---|
| 540 |
|
|---|
| 541 |
|
|---|
| 542 |
|
|---|
| 543 |
#ifndef HAS_VSNPRINTF |
|---|
| 544 |
# define HAS_VSNPRINTF 1 |
|---|
| 545 |
#endif |
|---|
| 546 |
|
|---|
| 547 |
|
|---|
| 548 |
|
|---|
| 549 |
|
|---|
| 550 |
|
|---|
| 551 |
|
|---|
| 552 |
|
|---|
| 553 |
|
|---|
| 554 |
|
|---|
| 555 |
|
|---|
| 556 |
|
|---|
| 557 |
|
|---|
| 558 |
typedef enum |
|---|
| 559 |
{ |
|---|
| 560 |
no, |
|---|
| 561 |
yes |
|---|
| 562 |
} Bool; |
|---|
| 563 |
|
|---|
| 564 |
|
|---|
| 565 |
|
|---|
| 566 |
|
|---|
| 567 |
|
|---|
| 568 |
|
|---|
| 569 |
#if defined(DMALLOC) |
|---|
| 570 |
#include "dmalloc.h" |
|---|
| 571 |
#endif |
|---|
| 572 |
|
|---|
| 573 |
void *MemAlloc(size_t size); |
|---|
| 574 |
void *MemRealloc(void *mem, size_t newsize); |
|---|
| 575 |
void MemFree(void *mem); |
|---|
| 576 |
void ClearMemory(void *, size_t size); |
|---|
| 577 |
void FatalError( ctmbstr msg ); |
|---|
| 578 |
|
|---|
| 579 |
|
|---|
| 580 |
|
|---|
| 581 |
|
|---|
| 582 |
|
|---|
| 583 |
#if 1 |
|---|
| 584 |
#define opaque_type( typenam )\ |
|---|
| 585 |
struct _##typenam { int _opaque; };\ |
|---|
| 586 |
typedef struct _##typenam* typenam |
|---|
| 587 |
#else |
|---|
| 588 |
#define opaque_type(typenam) typedef void* typenam |
|---|
| 589 |
#endif |
|---|
| 590 |
|
|---|
| 591 |
|
|---|
| 592 |
|
|---|
| 593 |
|
|---|
| 594 |
|
|---|
| 595 |
opaque_type( TidyIterator ); |
|---|
| 596 |
|
|---|
| 597 |
#ifdef __cplusplus |
|---|
| 598 |
} |
|---|
| 599 |
#endif |
|---|
| 600 |
|
|---|
| 601 |
#endif |
|---|