CPUDEFS.H

Go to the documentation of this file.
00001 
00002 /*  $Id: CPUDEFS.H 1220 2006-04-07 18:06:06Z andreradke $    */
00003 
00004 #ifndef CPUDEFS_H
00005 #define CPUDEFS_H
00006 
00007 /* CPUDefs.h defines the machine-specific macros to compile Paige
00008 source files for a specific platform.
00009 
00010 The idea is to change THIS source file, and this source file only, to
00011 satisfy your local compiler. */
00012 
00013 /* Updated by TR Shaw, OITC, Inc. 14 Feb/19 Apr 1994 for linkages and power PC control
00014     and finer control over configurations.
00015 */
00016 
00017 /* Updated by G. Crandall 27 April 1994 to allow for *memory_ref instead of
00018 **memory_ref for Windows (and possibly others) platform.
00019 Updated again by G. Crandall 6 May 1994 to lessen the complexity of ifdefs since
00020 some each compiler seems to interpret differently.  */
00021 
00022 /* Updated by TR Shaw, OITC, Inc. 26 Sep 1994 for mixed C and C++ support with 
00023     Symantic C++ and Think C++.
00024 */
00025 
00026 /* Updated by TR Shaw/J Smith/C Priddy, OITC, Inc. 27 JUL 1995 for Window 32, NT, 95. */
00027 /* More changes for INTEL by TR Shaw/C Priddy, OITC, Inc. 04 SEP 1995 for Window 32, NT, 95. */
00028 
00029 /******** THE FOLLOWING DEFINES CONTROL BASIC CONFIGURATIONS *********/
00030 
00031 /* Version Control: */
00032 
00033 #define PAIGE_VERSION       0x00010017      /* Version number */
00034 
00035 //Auto configure for Metrowerks
00036 
00037 #ifdef __MWERKS__
00038 //#define PG_DEBUG              /* If defined then everything is in debug mode. */
00039 //#define PG_DEBUG_STATICS      /* If defined then debugging remembers. */
00040 //#define PG_BIG_CHECKSUMS      /* If defined then checksum memory debugging. */
00041 //define NO_C_INLINE            /* If defined then no inline code generated */
00042 //define NO_OS_INLINE           /* If defined no OS function inline code */
00043 //define C_LIBRARY              /* If defined then assume standard C libraries */
00044 //#define C_LINKAGE             /* If defines than extern functions are "C" */
00045 //#define DO_RTF                    /* If defined then including Paige RTF */
00046 #endif
00047 
00048 /* General Compiler Options: */
00049 
00050 // #define PG_DEBUG             /* If defined then everything is in debug mode. */
00051 //#define PG_DEBUG_STATICS      /* If defined then debugging remembers. */
00052 //#define PG_BIG_CHECKSUMS      /* If defined then checksum memory debugging. */
00053 
00054 // #define NO_C_INLINE          /* If defined then no inline code generated */
00055 // #define NO_OS_INLINE         /* If defined no OS function inline code */
00056 // #define C_LIBRARY            /* If defined then assume standard C libraries */
00057 // #define C_LINKAGE            /* If defined then extern functions are "C" */
00058 
00059 /* Platform Control (define only one!) */
00060 
00061 //#define PPC_COMPILE               /* If defined then compiles for Mac Power PC */
00062 //#define MAC_COMPILE               /* If defined then source is for Macintosh */
00063 //#define WIN16_COMPILE             /* If defined then source is for Windows 3.1 */
00064 //#define WIN32_COMPILE             /* If defined then source is for Windows NT */
00065 //#define WIN95_COMPILE             /* If defined then source is for Windows 95 */
00066 //#define UNIX_COMPILE              /* If defined then source is for Unix */
00067 //#define OS2_COMPILE               /* If defined then source is for OS/2 */
00068 //#define WINDOWS_EMULATE_COMPILE   /* Fakes Windows environment on Mac */
00069 //#define MAC2WIN_COMPILE           /* Fakes Mac environment in Windows (for Altura) */
00070 //#define ACCESS_MS_DLL             /* if using Paige as a DLL,this is defined in the make file */
00071 //#define CREATE_MS_DLL             /* if making a Paige DLL,this is defined in the make file */
00072 
00073 //Auto configure for Metrowerks
00074 #ifdef __MWERKS__
00075     #ifdef _X86_
00076         #define WIN32_COMPILE
00077     //define MS_DLL                 // if making a DLL,this is defined in the make file
00078     #else
00079         //Code change by Timothy Paustian Sunday, May 7, 2000 9:58:30 PM
00080         //Changed to Opaque call for Carbon
00081         #if TARGET_CARBON
00082             #define PPC_COMPILE
00083         #else
00084             #if GENERATINGPOWERPC
00085             #define PPC_COMPILE
00086             #else
00087             #define MAC_COMPILE
00088             #endif
00089         #endif
00090     #endif
00091 #endif
00092 
00093 //Auto configure for Apple
00094 #ifdef applec
00095 #if GENERATINGPOWERPC
00096 #define PPC_COMPILE
00097 #else
00098 #define MAC_COMPILE
00099 #endif
00100 #endif
00101 
00102 //Auto configure for Think
00103 #ifdef THINK_C
00104 #if GENERATINGPOWERPC
00105 #define PPC_COMPILE
00106 #else
00107 #define MAC_COMPILE
00108 #endif
00109 #endif
00110 
00111 //Auto configure for Symantec
00112 #ifdef __SC__
00113 #if GENERATINGPOWERPC
00114 #define PPC_COMPILE
00115 #else
00116 #define MAC_COMPILE
00117 #endif
00118 #endif
00119 
00120 //Auto configure for WINE - TRT - 29 Dec 2004
00121 #ifdef __GNUC__
00122     #ifdef __WINE__
00123         #define WIN32_COMPILE
00124         //#define WINDOWS_EMULATE_COMPILE   /* Fakes Windows environment on Mac */
00125     #else
00126         #define MAC_COMPILE     /* 2006-04-07 aradke: compiling with Xcode */
00127     #endif
00128 #endif
00129 
00130 #ifdef ACCESS_MS_DLL
00131 #define MS_DLL
00132 #endif
00133 #ifdef CREATE_MS_DLL
00134 #define MS_DLL
00135 #endif
00136 
00137 //DSI-only configurations (DO NOT UNCOMMENT, for DSI only):
00138 //#define PG_SUBSETS
00139 //#define DOING_EQ
00140 
00141 //OITC-only configurations (DO NOT UNCOMMENT, for OITC only):
00142 //define PG_OITC_SUBSETS
00143 
00144 // Do NOT COMMENT THIS NEXT LINE OUT!!!  PG_DEBUG IS ABOVE!!!
00145 #ifdef PG_DEBUG
00146 
00147 // Define the following for easier source-level debugging
00148 
00149 #define SOURCE_LEVEL_DEBUG
00150     // SOURCE_LEVEL_DEBUG does not break to MacsBug (place source breakpoint instead)
00151 
00152 #endif
00153 
00154 /* Other platform-specific controls */
00155 
00156 // #define ASLMBUILD                /* If defined then using Mac SLM */
00157 #define CONTINUE_AFTER_FAILURE      /* Continue execution after debugger assert */
00158 
00159 
00160 //OITC RTF Defines
00161 //#define DO_RTF                        /* If defined then including Paige RTF */
00162 #ifdef DO_RTF
00163 /* Required compiler variables' states for Paige RTF */
00164 #define AUTO_DEFINE
00165 #define RTF_NO_INTERNAL_STATIC_TABLES
00166 #define RTF_EXTERNAL_CHAR_SETS
00167 #define RTF_AS_EMBEDDED
00168 #define RTF_USE_ALTERNATE_IO
00169 #define RTF_USING_ERROR_CODES
00170 #define RTF_NO_EXIT
00171 #define RFT_NO_CHAR_TABLES
00172 #define STDARG
00173 #undef NO_TRANS_DOC
00174 #endif
00175 
00176 /*********************************************************************/
00177 
00178 #ifdef WIN16_COMPILE
00179 #define WINDOWS_COMPILE
00180 
00181 /* Win 16 Multilingual defines for source code users only */
00182 /* Change the below to match your destination configuration */
00183 /* Default to English */
00184 //define WIN_MULTILINGUAL   //Define the following for Windows multilingual
00185 #define WIN_CHARSET         ANSI_CHARSET    //Define for Windows 16 chracter set
00186 #define WIN_CODEPAGE        CP_WINANSI      //Define for Windows 16 code page
00187 #define WIN_LANGUAGE        MAKELCID(MAKELANGID(LANG_ENGLISH, SUBLANG_NEUTRAL), SORT_DEFAULT)   //Define for Windows 16 language
00188 #define WIN_DIRECTION       1               //Define for Windows 16 language direction (matches left_right_direction in Paige.h)
00189 
00190 #ifdef MS_DLL
00191 #define WIN16_DLL
00192 #undef C_LINKAGE
00193 #endif
00194 #endif
00195 
00196 #ifdef WIN32_COMPILE
00197 #define WINDOWS_COMPILE
00198 #define WIN_MULTILINGUAL    //Define the following for Windows multilingual
00199 #ifdef MS_DLL
00200 #define WIN32_DLL
00201 #undef C_LINKAGE
00202 #endif
00203 #define C_LIBRARY
00204 #endif
00205 
00206 #ifdef WIN95_COMPILE
00207 #define WINDOWS_COMPILE
00208 #define WIN32_COMPILE
00209 #define WIN_MULTILINGUAL    //Define the following for Windows multilingual
00210 #ifdef MS_DLL
00211 #define WIN32_DLL
00212 #undef C_LINKAGE
00213 #endif
00214 #define C_LIBRARY
00215 #endif
00216 
00217 #ifdef WINDOWS_EMULATE_COMPILE
00218 #ifndef NO_OS_INLINE
00219 #define NO_OS_INLINE
00220 #endif
00221 #endif
00222 
00223 #ifdef ASLMBUILD                        /* Required for ASLM */
00224 #ifdef C_LIBRARY
00225 #undef C_LIBRARY                        /* Some C Libs don't work in ALSM!  Remove with caution. */
00226 #endif
00227 #endif
00228 
00229 #ifdef PPC_COMPILE
00230 #ifndef C_LINKAGE
00231 #define C_LINKAGE
00232 #endif
00233 #endif
00234 
00235 #ifdef WINDOWS_COMPILE
00236 #ifndef NO_OS_INLINE
00237 #define NO_OS_INLINE
00238 #endif
00239 #ifndef NO_STRICT
00240 #ifndef STRICT
00241 #define STRICT 1
00242 #endif
00243 #endif
00244 #include <windows.h>
00245 #ifdef WIN32_COMPILE
00246 #include <windowsx.h>
00247 #endif
00248 
00249 #ifdef MS_DLL
00250 
00251 #ifdef WIN16_DLL
00252 #define LIB_PREFIX _export
00253 #define DLL_PREFIX 
00254 #endif
00255 
00256 #ifdef WIN32_DLL
00257 #ifdef ACCESS_MS_DLL
00258 #define LIB_PREFIX __declspec(dllimport)
00259 #define DLL_PREFIX __declspec(dllimport)
00260 #endif
00261 #ifdef CREATE_MS_DLL
00262 #define LIB_PREFIX __declspec(dllexport)
00263 #define DLL_PREFIX __declspec(dllexport)
00264 #endif
00265 #endif
00266 
00267 #else
00268 #define DLL_PREFIX      /* nothing */
00269 #define LIB_PREFIX      /* nothing */
00270 #endif
00271 
00272 #else
00273 #define DLL_PREFIX      /* nothing */
00274 #define LIB_PREFIX      /* nothing */
00275 #endif
00276 
00277 /* Some platform pre-defined constants (placed in Paige structures): */
00278 
00279 /* Hardware configurations */
00280 
00281 #define MACINTOSH_68000     0x00000001  /* Macintosh, MC68000 or greater */
00282 #define MACINTOSH_68020     0x00000002  /* Macintosh, MC68020 or greater */
00283 #define MACINTOSH_68030     0x00000003  /* Macintosh, MC68030 or greater */
00284 #define MACINTOSH_68040     0x00000004  /* Macintosh, MC68040 or greater */
00285 #define MAC_POWER_PC        0x10000001  /* Macintosh PowerPC 601 or greater */
00286 
00287 #define INTEL_80286         0x00000101  /* Intel, 80286 or greater */
00288 #define INTEL_80386         0x00000102  /* Intel, 80386 or greater */
00289 #define INTEL_80486         0x00000103  /* Intel, 80486 or greater */
00290 #define INTEL_PENTIUM       0x00000105  /* Intel, PENTIUM or greater */
00291 
00292 #define OTHER               0x01000001  /* Other */
00293 #define OTHER_RISC          0x11000001  /* Other, RISC */
00294 
00295 /* Operating System Configurations */
00296 
00297 #define MACINTOSH_6         0x00000001  /* Macintosh, System 6.0.5 or greater */
00298 #define MACINTOSH_7         0x00000002  /* Macintosh, System 7 or greater */
00299 #define MACINTOSH_71        0x00000003  /* Macintosh, System 7.1 or greater */
00300 #define MACINTOSH_711       0x00000004  /* Macintosh, System 7 Pro or greater */
00301 #define MACINTOSH_72        0x00000005  /* Macintosh, System 7.2 or greater */
00302 #define MACINTOSH_75        0x00000006  /* Macintosh, System 7.5 or greater */
00303 #define MACINTOSH_751       0x00000007  /* Macintosh, System 7.5.1 or greater */
00304 #define MACINTOSH_752       0x00000008  /* Macintosh, System 7.5.2 or greater */
00305 #define MACINTOSH_753       0x00000008  /* Macintosh, System 7.5.3 or greater */
00306 #define MAX_MAC_OS          MACINTOSH_753
00307 
00308 #define WINDOWS_2           0x00000100  /* Windows version 2.0 */
00309 #define WINDOWS_3           0x00000101  /* Windows version 3.0/3.1 */
00310 #define WINDOWS_MAC         0x00000105  /* Windows version 3.0/3.1 emulated */
00311 #define WINDOWS_NT          0x00000110  /* Windows NT version 1.0 */
00312 #define WINDOWS_95          0x00000120  /* Windows 95 version 1.0 */
00313 #define MAX_WINDOWS_OS      WINDOWS_NT
00314 
00315 #define UNIX_4              0x00100001  /* Generic unix system 4 */
00316 #define UNIX_5              0x00100002  /* Generic unix system 5 */
00317 #define MAX_UNIX_OS         UNIX_5
00318 
00319 #define OS2_WARP            0x01000001  /* Generic OS/2 Warp */
00320 #define MAX_OS2_OS          OS2_WARP
00321 
00322 /* Graphic Configurations */
00323 
00324 #define ORIGINAL_QUICKDRAW  0x00000001  /* Macintosh, original QuickDraw or greater */
00325 #define COLOR_QUICKDRAW     0x00000002  /* Macintosh, color QuickDraw or greater */
00326 #define COLOR_QUICKDRAW_32  0x00000003  /* Macintosh, 32-bit color QuickDraw or greater */
00327 #define QUICKDRAW_GX        0x00000004  /* Macintosh, QuickDraw GX or greater */
00328 #define QUICKDRAW_GX1       0x00000005  /* Macintosh, QuickDraw GX 1.1 or greater */
00329 #define MAX_MAC_GRAPHICS    QUICKDRAW_GX1
00330 
00331 #define WINDOWS_CGA         0x00000100  /* Windows CGA  or greater */
00332 #define WINDOWS_VGA         0x00000101  /* Windows VGA  or greater */
00333 #define WINDOWS_EGA         0x00000102  /* Windows EGA  or greater */
00334 #define MAX_WINDOWS_GRAPHICS WINDOWS_EGA
00335 
00336 #define X_WINDOWS_11        0x00100010  /* Unix X-Windows v11 or greater */
00337 #define X_WINDOWS_12        0x00100020  /* Unix X-Windows v12 or greater */
00338 #define MOTIF               0x00100030  /* Unix Motif or greater */
00339 #define OPEN_LOOK           0x00100040  /* Unix OpenLook or greater */
00340 #define MAX_UNIX_GRAPHICS   OPEN_LOOK
00341 
00342 #define OS2_VGA             0x01000001  /* OS/2 VGA  or greater */
00343 #define OS2_EGA             0x01000002  /* OS/2 EGA  or greater */
00344 #define MAX_OS2_GRAPHICS    OS2_EGA
00345 
00346 #define MACINTOSH_OS        1
00347 #define WINDOWS_OS          2
00348 #define UNIX_OS             3
00349 #define OS2_OS              4
00350 
00351 /* Paige configuration constants */
00352 
00353 #ifdef MAC_COMPILE
00354 #ifndef PPC_COMPILE
00355 #define PAIGE_PLATFORM      MACINTOSH_68000     /* Minimum hardware platform this header works with */
00356 #define PAIGE_OS            MACINTOSH_6         /* Minimum OS this header works with */
00357 #define PAIGE_GRAPHICS      ORIGINAL_QUICKDRAW  /* Minimum graphics this header works with */
00358 #define CURRENT_OS          MACINTOSH_OS        /* Generic OS */
00359 #endif
00360 #endif
00361 
00362 #ifdef PPC_COMPILE
00363 #define PAIGE_PLATFORM      MAC_POWER_PC        /* Minimum hardware platform this header works with */
00364 #define PAIGE_OS            MACINTOSH_75        /* Minimum OS this header works with */
00365 #define PAIGE_GRAPHICS      ORIGINAL_QUICKDRAW  /* Minimum graphics this header works with */
00366 #define CURRENT_OS          MACINTOSH_OS        /* Generic OS */
00367 #endif
00368 
00369 #ifdef WINDOWS_COMPILE
00370 #define PAIGE_PLATFORM      WINDOWS_3       /* Minimum hardware platform this header works with */
00371 #define PAIGE_OS            WINDOWS_3       /* Minimum OS this header works with */
00372 #define PAIGE_GRAPHICS      WINDOWS_VGA     /* Minimum graphics this header works with */
00373 #define CURRENT_OS          WINDOWS_OS      /* Generic OS */
00374 #endif
00375 
00376 #ifdef UNIX_COMPILE
00377 #define PAIGE_PLATFORM      UNIX_5          /* Minimum hardware platform this header works with */
00378 #define PAIGE_OS            UNIX_5          /* Minimum OS this header works with */
00379 #define PAIGE_GRAPHICS      X_WINDOWS_11    /* Minimum graphics this header works with */
00380 #define CURRENT_OS          UNIX_OS         /* Generic OS */
00381 #endif
00382 
00383 #ifdef OS2_COMPILE
00384 #define PAIGE_PLATFORM      OS2_WARP        /* Minimum hardware platform this header works with */
00385 #define PAIGE_OS            OS2_WARP        /* Minimum OS this header works with */
00386 #define PAIGE_GRAPHICS      OS2_VGA         /* Minimum graphics this header works with */
00387 #define CURRENT_OS          OS2_OS          /* Generic OS */
00388 #endif
00389 
00390 #ifdef WINDOWS_EMULATE_COMPILE
00391 #define PAIGE_PLATFORM      WINDOWS_MAC
00392 #define PAIGE_OS            WINDOWS_MAC
00393 #define PAIGE_GRAPHICS      ORIGINAL_QUICKDRAW
00394 #endif
00395 
00396 
00397 /* General platform identifications for character set mapping: */
00398 
00399 #define GENERAL_PLATFORM_MASK   0x0FFFFF00  /* AND with this to get general platform */
00400 #define GENERAL_MACINTOSH       0x00000000  /* Macintosh, all versions */
00401 #define GENERAL_WINDOWS         0x00000100  /* Windows, all versions */
00402 #define GENERAL_UNIX            0x00100000  /* Unix, all versions */
00403 #define GENERAL_OS2             0x01000000  /* OS/2, all versions */
00404 
00405 /* Which platform */
00406 #ifdef MAC_COMPILE
00407 #define GENERAL_PLATFORM        GENERAL_MACINTOSH
00408 #endif
00409 #ifdef PPC_COMPILE
00410 #define GENERAL_PLATFORM        GENERAL_MACINTOSH
00411 #endif
00412 #ifdef WINDOWS_COMPILE
00413 #define GENERAL_PLATFORM        GENERAL_WINDOWS
00414 #endif
00415 #ifdef UNIX_COMPILE
00416 #define GENERAL_PLATFORM        GENERAL_UNIX
00417 #endif
00418 #ifdef OS2_COMPILE
00419 #define GENERAL_PLATFORM        GENERAL_OS2
00420 #endif
00421 #ifdef WINDOWS_EMULATE_COMPILE
00422 #define GENERAL_PLATFORM        GENERAL_WINDOWS
00423 #endif
00424 
00425 #define pgFromThisPlatform(platform)    ((platform & GENERAL_PLATFORM_MASK) == GENERAL_PLATFORM)
00426 
00427 /* Automatic Configurations */
00428 
00429 #if (PAIGE_OS <= MAX_MAC_OS)
00430 #define MAC_PLATFORM                    /* This version is for Macintosh */
00431 #elif (PAIGE_OS <= MAX_WINDOWS_OS)
00432 #define WINDOWS_PLATFORM                /* This version is for Windows */
00433 #elif (PAIGE_OS <= MAX_UNIX_OS)
00434 #define UNIX_PLATFORM                   /* This version is for Unix */
00435 #elif (PAIGE_OS <= MAX_OS2_OS)
00436 #define OS2_PLATFORM                    /* This version is for OS/2 */
00437 #endif
00438 
00439 
00440 /* Misc Defines */
00441 
00442 #ifndef FALSE
00443 #define FALSE       0
00444 #endif
00445 
00446 #ifndef TRUE
00447 #define TRUE        1
00448 #endif
00449 
00450 #ifndef NULL
00451 #ifdef __cplusplus
00452 #define NULL        0L
00453 #else
00454 #ifdef WINDOWS_PLATFORM
00455 #define NULL        ((void far *) 0)
00456 #else
00457 #define NULL        ((void *) 0)
00458 #endif
00459 #endif
00460 #endif
00461 
00462 
00463 /* ------------------ Platform-specific Definitions ----------------- */
00464 
00465 #ifdef MAC_PLATFORM
00466 
00467 #if !TARGET_API_MAC_CARBON
00468 #include <MacTypes.h>       /* 2004-09-29 AR: renamed from types.h */
00469 #include <Quickdraw.h>      // for RGBColor
00470 #include <OSUtils.h>        // for DateTimeRec
00471 #endif
00472 
00473 #define PG_FAR
00474 #define REGISTER_PREFIX
00475 
00476 #define ADDRESS_2           /* Memory is aligned to words */
00477 
00478 // TRS/OITC
00479 #define PG_CDECL            /* Support Everyone else and Think C */
00480 #ifdef C_LINKAGE
00481 #ifdef __SC__
00482 #undef PG_CDECL
00483 #define PG_CDECL    _cdecl  /* Allow support for Symantic C++ */
00484 #endif
00485 #define PG_PASCAL(return_type) return_type PG_CDECL
00486 #define PG_C(return_type) return_type PG_CDECL
00487 #define PG_DLL_IMPORT(return_type) return_type PG_CDECL
00488 #define PG_DLL_EXPORT(return_type) return_type PG_CDECL
00489 #define PG_FN_PASCAL(returnType,functionName)   returnType (PG_CDECL *functionName)     /* For function pointer typedefs */
00490 #define PG_FN_C(returnType,functionName)    returnType (PG_CDECL *functionName)     /* For C function pointer typedefs */
00491 #define STATIC_PASCAL(return_type) static return_type
00492 #define STATIC_C(return_type) static return_type
00493 #else
00494 #define PG_PASCAL(return_type) pascal return_type
00495 #define PG_C(return_type) return_type PG_CDECL
00496 #define PG_DLL_IMPORT(return_type) pascal return_type
00497 #define PG_DLL_EXPORT(return_type) pascal return_type
00498 #define PG_FN_PASCAL(returnType,functionName)   pascal returnType (*functionName)       /* For function pointer typedefs */
00499 #define PG_FN_C(returnType,functionName)    returnType (PG_CDECL *functionName)     /* For C function pointer typedefs */
00500 #define STATIC_PASCAL(return_type) static pascal return_type
00501 #define STATIC_C(return_type) static return_type
00502 #endif
00503 
00504 #define PG_LONGWORD(cast) (cast)
00505 
00506 /* General Types: */
00507 
00508 typedef unsigned short pg_word;             /* WORD type */
00509 typedef unsigned short pg_text_int;         /* Used for measuring text */
00510 typedef unsigned short pg_short_t;          /* 64K address range value */
00511 
00512 #define PG_BOM          0xFFFE
00513 #define PG_REVERSE_BOM  0xFEFF
00514 
00515 #ifdef UNICODE
00516 
00517 #ifndef _UNICODE
00518 #define _UNICODE
00519 #endif
00520 
00521 typedef pg_word pg_char;                    /* General purpose byte / char / whatever */
00522 typedef pg_char *pg_char_ptr;               /* Pointer to pg_char */
00523 #else
00524 typedef unsigned char pg_char;              /* General purpose byte / char / whatever */
00525 typedef pg_char *pg_char_ptr;               /* Pointer to pg_char */
00526 #endif
00527 
00528 /* The following is defined for historical purposes and backwards compatibility: */
00529 
00530 typedef pg_char     pg_byte;
00531 typedef pg_byte     *pg_byte_ptr;
00532 
00533 typedef unsigned char   pg_bits8;
00534 typedef pg_bits8        *pg_bits8_ptr;
00535 
00536 typedef OSErr pg_error;                     /* Error result */
00537 typedef short pg_boolean;                   /* TRUE/FALSE parameter */
00538 typedef long pg_fixed;                      /* "Fixed" fraction */
00539 typedef StringPtr pg_file_name_ptr;         /* Pointer to filename */
00540 typedef StringPtr pg_font_name_ptr;         /* Pointer to font name */
00541 typedef short pg_file_unit;                 /* File unit reference number */
00542 typedef pg_file_unit *pg_file_unit_ptr;     /* Pointer to file unit reference number */
00543 typedef unsigned long pg_filetype;          /* File type indicator */
00544 typedef pg_filetype PG_FAR *pg_filetype_ptr;
00545 typedef pg_char *pg_c_string_ptr;           /* Pointer to C string */
00546 typedef pg_char *pg_p_string_ptr;           /* Pointer to Pascal string */
00547 typedef pg_char *PGSTR;                     /* General portable string */
00548 typedef RGBColor pg_plat_color_value;       /* Platform color value */
00549 typedef short pg_font_script;               /* Mac script value */
00550 
00551 /* All-purpose variable for pointers or memory ID's: */
00552 
00553 typedef void *          void_ptr;           /* Used for type void pointers */
00554 typedef void PG_FAR*    generic_var;        /* Used for RgnHandles, GrafPtr, etc. */
00555 typedef Handle          pg_handle;          /* Used for type 'Handle' */
00556 typedef RgnHandle       pg_region;          /* Used for machine-specific region */
00557 
00558 #define REGION_NULL     (RgnHandle)NULL
00559 
00560 /* Time types for Paige based time (ie seconds since 00:00 01 JAN 1900: */
00561 
00562 #define PLATFORM_DELTA_TIME     126144000
00563 typedef unsigned long           pg_time_t;
00564 typedef DateTimeRec             pg_datetime;
00565 typedef pg_time_t PG_FAR *      pg_time_ptr;
00566 typedef pg_datetime PG_FAR *    pg_datetime_ptr;
00567 
00568 #endif
00569 
00570 
00571 #ifdef WINDOWS_PLATFORM
00572 
00573 #include <windows.h>
00574 #include <time.h>
00575 
00576 #ifdef WINDOWS_EMULATE_COMPILE
00577 
00578 #define PG_FAR
00579 #define REGISTER_PREFIX
00580 
00581 #define ADDRESS_2           /* Memory is aligned to words */
00582 
00583 #define PG_CDECL            /* Support Everyone else and Think C */
00584 #ifdef C_LINKAGE
00585 #ifdef __SC__
00586 #undef PG_CDECL
00587 #define PG_CDECL    _cdecl  /* Allow support for Symantic C++ */
00588 #endif
00589 #define PG_PASCAL(return_type) return_type PG_CDECL
00590 #define PG_C(return_type) return_type PG_CDECL
00591 #define PG_DLL_IMPORT(return_type) return_type PG_CDECL
00592 #define PG_DLL_EXPORT(return_type) return_type PG_CDECL
00593 #define PG_FN_PASCAL(returnType,functionName)   returnType (PG_CDECL *functionName)     /* For function pointer typedefs */
00594 #define PG_FN_C(returnType,functionName)    returnType (PG_CDECL *functionName)     /* For C function pointer typedefs */
00595 #define STATIC_PASCAL(return_type) static return_type
00596 #define STATIC_C(return_type) static return_type
00597 #else
00598 #define PG_PASCAL(return_type) pascal return_type
00599 #define PG_C(return_type) return_type PG_CDECL
00600 #define PG_DLL_IMPORT(return_type) pascal return_type
00601 #define PG_DLL_EXPORT(return_type) pascal return_type
00602 #define PG_FN_PASCAL(returnType,functionName)   pascal returnType (*functionName)       /* For function pointer typedefs */
00603 #define PG_FN_C(returnType,functionName)    returnType (PG_CDECL *functionName)     /* For C function pointer typedefs */
00604 #define STATIC_PASCAL(return_type) static pascal return_type
00605 #define STATIC_C(return_type) static return_type
00606 #endif
00607 
00608 #else
00609 
00610 #ifdef WIN16_COMPILE
00611 #define PG_FAR      __huge
00612 #define REGISTER_PREFIX __loadds
00613 #else
00614 #define PG_FAR
00615 #define ADDRESS_2           /* Flat memory model is aligned to words */
00616 #define REGISTER_PREFIX
00617 #endif
00618 
00619 #define PG_CDECL    CDECL
00620 
00621 #ifdef C_LINKAGE
00622 #define PG_DLL_IMPORT(return_type) DLL_PREFIX return_type WINAPI
00623 #define PG_DLL_EXPORT(return_type) LIB_PREFIX return_type WINAPI
00624 #define PG_DLL(return_type) LIB_PREFIX return_type WINAPI
00625 #ifdef WIN32_DLL
00626 #define PG_PASCAL(return_type) DLL_PREFIX return_type WINAPI
00627 #define PG_C(return_type) DLL_PREFIX return_type PG_CDECL
00628 #else
00629 #define PG_PASCAL(return_type) return_type WINAPI LIB_PREFIX
00630 #define PG_C(return_type) return_type PG_CDECL LIB_PREFIX
00631 #endif
00632 #define PG_FN_PASCAL(returnType,functionName)   returnType (WINAPI *functionName)   /* For function pointer typedefs */
00633 #define PG_FN_C(returnType,functionName)    returnType (PG_CDECL *functionName)     /* For C function pointer typedefs */
00634 #define STATIC_PASCAL(return_type) static return_type WINAPI
00635 #define STATIC_C(return_type) static return_type
00636 #else
00637 #define PG_DLL_IMPORT(return_type) DLL_PREFIX return_type WINAPI
00638 #define PG_DLL_EXPORT(return_type) LIB_PREFIX return_type WINAPI
00639 #define PG_DLL(return_type) LIB_PREFIX return_type WINAPI
00640 #ifdef WIN32_DLL
00641 #define PG_PASCAL(return_type) DLL_PREFIX return_type WINAPI
00642 #define PG_C(return_type) DLL_PREFIX return_type PG_CDECL
00643 #else
00644 #define PG_PASCAL(return_type) return_type WINAPI LIB_PREFIX
00645 #define PG_C(return_type) return_type PG_CDECL LIB_PREFIX
00646 #endif
00647 #define PG_FN_PASCAL(returnType,functionName)   returnType (WINAPI *functionName)  /* For function pointer typedefs */
00648 #define PG_FN_C(returnType,functionName)    returnType (PG_CDECL *functionName)     /* For C function pointer typedefs */
00649 #define STATIC_PASCAL(return_type) static return_type WINAPI
00650 #define STATIC_C(return_type) static return_type
00651 #endif
00652 #endif
00653 
00654 /* General Types: */
00655 
00656 typedef WORD pg_word;                       /* WORD type */
00657 typedef int pg_text_int;                    /* Used for measuring text that works with 3.1, Win32 and Win95 */
00658 typedef unsigned short pg_short_t;          /* 64K address range value */
00659 
00660 #define PG_BOM          0xFFFE
00661 #define PG_REVERSE_BOM  0xFEFF
00662 
00663 #ifdef UNICODE
00664 typedef unsigned short  pg_char;
00665 typedef unsigned short PG_FAR *pg_char_ptr;
00666 #ifndef _UNICODE
00667 #define _UNICODE
00668 #endif
00669 #else
00670 typedef unsigned char pg_char;              /* General purpose byte / char / whatever */
00671 typedef pg_char PG_FAR *pg_char_ptr;        /* Pointer to pg_char */
00672 #endif
00673 
00674 typedef pg_char_ptr PGSTR;
00675 
00676 /* The following is defined for historical purposes and backwards compatibility: */
00677 
00678 typedef pg_char         pg_byte;
00679 typedef pg_byte PG_FAR  *pg_byte_ptr;
00680 
00681 typedef unsigned char   pg_bits8;
00682 typedef pg_bits8 PG_FAR *pg_bits8_ptr;
00683 
00684 typedef pg_short_t pg_error;                /* Error result */
00685 typedef short pg_boolean;                   /* TRUE/FALSE parameter */
00686 typedef long pg_fixed;                      /* "Fixed" fraction */
00687 typedef pg_char_ptr pg_file_name_ptr;               /* Pointer to filename */
00688 typedef pg_char_ptr pg_font_name_ptr;               /* Pointer to font name */
00689 typedef HFILE pg_file_unit;                 /* File unit reference number */
00690 typedef HFILE PG_FAR *pg_file_unit_ptr;     /* Pointer to file unit reference number */
00691 typedef pg_char_ptr pg_c_string_ptr;        /* Pointer to C string */
00692 typedef unsigned long pg_filetype;          /* File type indicator */
00693 typedef pg_filetype PG_FAR *pg_filetype_ptr;
00694 typedef pg_char_ptr pg_p_string_ptr;                /* Pointer to Pascal string */
00695 typedef COLORREF pg_plat_color_value;       /* Platform color value */
00696 typedef UINT pg_font_script;                /* Windows CodePage or CharSet value */
00697 
00698 /* All-purpose variable for pointers or memory ID's: */
00699 
00700 typedef void PG_FAR *   void_ptr;           /* Used for type void pointers */
00701 typedef unsigned long   generic_var;        /* Used for type 'HANDLE' */
00702 typedef HANDLE          pg_handle;          /* Used for type 'HANDLE' */
00703 typedef HRGN            pg_region;          /* Used as a region */
00704 
00705 #define REGION_NULL     (HRGN)NULL
00706 
00707 /* Macros for casting "near" pointers to long int: */
00708 
00709 #ifdef WIN32_COMPILE
00710 #define PG_LONGWORD(cast) (cast)
00711 #else
00712 #define PG_LONGWORD(cast) (cast)(int)
00713 #endif
00714 
00715 /* Time types for Paige based time (ie seconds since 00:00 01 JAN 1900: */
00716 
00717 #define PLATFORM_DELTA_TIME     0
00718 typedef time_t                  pg_time_t;
00719 typedef struct tm               pg_datetime;
00720 typedef pg_time_t PG_FAR *      pg_time_ptr;
00721 typedef pg_datetime PG_FAR *    pg_datetime_ptr;
00722 
00723 #endif
00724 
00725 /* Miscellaneous definitions */
00726 
00727 #define GLOBALS_ARE_PSTRINGS                /* Global chars = Pascal strings
00728                                             (otherwise cstrings)  */
00729 
00730 #endif

Generated on Wed May 31 18:19:45 2006 for frontierkernel 10.1.10a by  doxygen 1.4.6