/ basic-headers / MacTypes.h
MacTypes.h
  1  /*
  2   * Copyright (c) 1985-2011 by Apple Inc.. All rights reserved.
  3   *
  4   * @APPLE_LICENSE_HEADER_START@
  5   * 
  6   * This file contains Original Code and/or Modifications of Original Code
  7   * as defined in and that are subject to the Apple Public Source License
  8   * Version 2.0 (the 'License'). You may not use this file except in
  9   * compliance with the License. Please obtain a copy of the License at
 10   * http://www.opensource.apple.com/apsl/ and read it before using this
 11   * file.
 12   * 
 13   * The Original Code and all software distributed under the License are
 14   * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
 15   * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
 16   * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
 17   * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
 18   * Please see the License for the specific language governing rights and
 19   * limitations under the License.
 20   * 
 21   * @APPLE_LICENSE_HEADER_END@
 22   */
 23   
 24  /*
 25       File:       MacTypes.h
 26   
 27       Contains:   Basic Macintosh data types.
 28   
 29       Version:    CarbonCore-769~1
 30    
 31       Bugs?:      For bug reports, consult the following page on
 32                   the World Wide Web:
 33   
 34                       http://developer.apple.com/bugreporter/
 35   
 36  */
 37  #ifndef __MACTYPES__
 38  #define __MACTYPES__
 39  
 40  #ifndef __CONDITIONALMACROS__
 41  #include <ConditionalMacros.h>
 42  #endif
 43  
 44  #include <stdbool.h>
 45  
 46  #include <sys/types.h>
 47  
 48  #include <Availability.h>
 49  
 50  #if PRAGMA_ONCE
 51  #pragma once
 52  #endif
 53  
 54  #ifdef __cplusplus
 55  extern "C" {
 56  #endif
 57  
 58  #pragma pack(push, 2)
 59  
 60  
 61  /*
 62          CarbonCore Deprecation flags.
 63  
 64       Certain Carbon API functions are deprecated in 10.3 and later
 65        systems.  These will produce a warning when compiling on 10.3.
 66  
 67          Other functions and constants do not produce meaningful
 68          results when building Carbon for Mac OS X.  For these
 69        functions, no-op macros are provided, but only when the
 70          ALLOW_OBSOLETE_CARBON flag is defined to be 0: eg
 71        -DALLOW_OBSOLETE_CARBON=0.
 72  */
 73  
 74  #if  ! defined(ALLOW_OBSOLETE_CARBON) || ! ALLOW_OBSOLETE_CARBON
 75  
 76  #define ALLOW_OBSOLETE_CARBON_MACMEMORY        0
 77  #define ALLOW_OBSOLETE_CARBON_OSUTILS     0
 78  
 79  #else
 80  
 81  #define ALLOW_OBSOLETE_CARBON_MACMEMORY       1       /* Removes obsolete constants; turns HLock/HUnlock into no-op macros */
 82  #define ALLOW_OBSOLETE_CARBON_OSUTILS       1       /* Removes obsolete structures */
 83  
 84  #endif
 85  
 86  #ifndef NULL
 87  #define NULL    __DARWIN_NULL
 88  #endif /* ! NULL */
 89  #ifndef nil
 90    #if defined(__has_feature) 
 91      #if __has_feature(cxx_nullptr)
 92        #define nil nullptr
 93      #else
 94        #define nil __DARWIN_NULL
 95      #endif
 96    #else
 97      #define nil __DARWIN_NULL
 98    #endif
 99  #endif
100  
101  /********************************************************************************
102  
103      Base integer types for all target OS's and CPU's
104      
105          UInt8            8-bit unsigned integer 
106          SInt8            8-bit signed integer
107          UInt16          16-bit unsigned integer 
108          SInt16          16-bit signed integer           
109          UInt32          32-bit unsigned integer 
110          SInt32          32-bit signed integer   
111          UInt64          64-bit unsigned integer 
112          SInt64          64-bit signed integer   
113  
114  *********************************************************************************/
115  typedef unsigned char                   UInt8;
116  typedef signed char                     SInt8;
117  typedef unsigned short                  UInt16;
118  typedef signed short                    SInt16;
119  
120  #if __LP64__
121  typedef unsigned int                    UInt32;
122  typedef signed int                      SInt32;
123  #else
124  typedef unsigned long                   UInt32;
125  typedef signed long                     SInt32;
126  #endif
127  
128  /* avoid redeclaration if libkern/OSTypes.h */
129  #ifndef _OS_OSTYPES_H
130  #if TARGET_RT_BIG_ENDIAN
131  struct wide {
132    SInt32              hi;
133    UInt32              lo;
134  };
135  typedef struct wide                     wide;
136  struct UnsignedWide {
137    UInt32              hi;
138    UInt32              lo;
139  };
140  typedef struct UnsignedWide             UnsignedWide;
141  #else
142  struct wide {
143    UInt32              lo;
144    SInt32              hi;
145  };
146  typedef struct wide                     wide;
147  struct UnsignedWide {
148    UInt32              lo;
149    UInt32              hi;
150  };
151  typedef struct UnsignedWide             UnsignedWide;
152  #endif  /* TARGET_RT_BIG_ENDIAN */
153  
154  #endif
155  
156  #if TYPE_LONGLONG
157  /*
158    Note:   wide and UnsignedWide must always be structs for source code
159             compatibility. On the other hand UInt64 and SInt64 can be
160            either a struct or a long long, depending on the compiler.
161           
162             If you use UInt64 and SInt64 you should do all operations on 
163            those data types through the functions/macros in Math64.h.  
164             This will assure that your code compiles with compilers that
165             support long long and those that don't.
166              
167             The MS Visual C/C++ compiler uses __int64 instead of long long. 
168  */
169      #if defined(_MSC_VER) && !defined(__MWERKS__) && defined(_M_IX86)
170        typedef   signed __int64                SInt64;
171          typedef unsigned __int64                UInt64;
172      #else
173        typedef   signed long long              SInt64;
174          typedef unsigned long long              UInt64;
175      #endif
176  #else
177  
178  
179  typedef wide                            SInt64;
180  typedef UnsignedWide                    UInt64;
181  #endif  /* TYPE_LONGLONG */
182  
183  /********************************************************************************
184  
185      Base fixed point types 
186      
187          Fixed           16-bit signed integer plus 16-bit fraction
188          UnsignedFixed   16-bit unsigned integer plus 16-bit fraction
189          Fract           2-bit signed integer plus 30-bit fraction
190          ShortFixed      8-bit signed integer plus 8-bit fraction
191          
192  *********************************************************************************/
193  typedef SInt32                          Fixed;
194  typedef Fixed *                         FixedPtr;
195  typedef SInt32                          Fract;
196  typedef Fract *                         FractPtr;
197  typedef UInt32                          UnsignedFixed;
198  typedef UnsignedFixed *                 UnsignedFixedPtr;
199  typedef short                           ShortFixed;
200  typedef ShortFixed *                    ShortFixedPtr;
201  
202  
203  /********************************************************************************
204  
205      Base floating point types 
206      
207          Float32         32 bit IEEE float:  1 sign bit, 8 exponent bits, 23 fraction bits
208          Float64         64 bit IEEE float:  1 sign bit, 11 exponent bits, 52 fraction bits  
209          Float80         80 bit MacOS float: 1 sign bit, 15 exponent bits, 1 integer bit, 63 fraction bits
210          Float96         96 bit 68881 float: 1 sign bit, 15 exponent bits, 16 pad bits, 1 integer bit, 63 fraction bits
211          
212      Note: These are fixed size floating point types, useful when writing a floating
213            point value to disk.  If your compiler does not support a particular size 
214            float, a struct is used instead.
215            Use of of the NCEG types (e.g. double_t) or an ANSI C type (e.g. double) if
216            you want a floating point representation that is natural for any given
217            compiler, but might be a different size on different compilers.
218  
219  *********************************************************************************/
220  typedef float               Float32;
221  typedef double              Float64;
222  struct Float80 {
223      SInt16  exp;
224      UInt16  man[4];
225  };
226  typedef struct Float80 Float80;
227  
228  struct Float96 {
229      SInt16  exp[2];     /* the second 16-bits are undefined */
230      UInt16  man[4];
231  };
232  typedef struct Float96 Float96;
233  struct Float32Point {
234      Float32             x;
235      Float32             y;
236  };
237  typedef struct Float32Point Float32Point;
238  
239  /********************************************************************************
240  
241      MacOS Memory Manager types
242      
243          Ptr             Pointer to a non-relocatable block
244          Handle          Pointer to a master pointer to a relocatable block
245          Size            The number of bytes in a block (signed for historical reasons)
246          
247  *********************************************************************************/
248  typedef char *                          Ptr;
249  typedef Ptr *                           Handle;
250  typedef long                            Size;
251  
252  /********************************************************************************
253  
254      Higher level basic types
255      
256          OSErr                   16-bit result error code
257          OSStatus                32-bit result error code
258          LogicalAddress          Address in the clients virtual address space
259          ConstLogicalAddress     Address in the clients virtual address space that will only be read
260          PhysicalAddress         Real address as used on the hardware bus
261          BytePtr                 Pointer to an array of bytes
262          ByteCount               The size of an array of bytes
263          ByteOffset              An offset into an array of bytes
264          ItemCount               32-bit iteration count
265          OptionBits              Standard 32-bit set of bit flags
266          PBVersion               ?
267          Duration                32-bit millisecond timer for drivers
268          AbsoluteTime            64-bit clock
269          ScriptCode              A particular set of written characters (e.g. Roman vs Cyrillic) and their encoding
270          LangCode                A particular language (e.g. English), as represented using a particular ScriptCode
271          RegionCode              Designates a language as used in a particular region (e.g. British vs American
272                                  English) together with other region-dependent characteristics (e.g. date format)
273          FourCharCode            A 32-bit value made by packing four 1 byte characters together
274          OSType                  A FourCharCode used in the OS and file system (e.g. creator)
275          ResType                 A FourCharCode used to tag resources (e.g. 'DLOG')
276          
277  *********************************************************************************/
278  typedef SInt16                          OSErr;
279  typedef SInt32                          OSStatus;
280  typedef void *                          LogicalAddress;
281  typedef const void *                    ConstLogicalAddress;
282  typedef void *                          PhysicalAddress;
283  typedef UInt8 *                         BytePtr;
284  typedef unsigned long                   ByteCount;
285  typedef unsigned long                   ByteOffset;
286  typedef SInt32                          Duration;
287  typedef UnsignedWide                    AbsoluteTime;
288  typedef UInt32                          OptionBits;
289  typedef unsigned long                   ItemCount;
290  typedef UInt32                          PBVersion;
291  typedef SInt16                          ScriptCode;
292  typedef SInt16                          LangCode;
293  typedef SInt16                          RegionCode;
294  typedef UInt32                          FourCharCode;
295  typedef FourCharCode                    OSType;
296  typedef FourCharCode                    ResType;
297  typedef OSType *                        OSTypePtr;
298  typedef ResType *                       ResTypePtr;
299  /********************************************************************************
300  
301      Boolean types and values
302      
303          Boolean         Mac OS historic type, sizeof(Boolean)==1
304          bool            Defined in stdbool.h, ISO C/C++ standard type
305          false           Now defined in stdbool.h
306          true            Now defined in stdbool.h
307          
308  *********************************************************************************/
309  typedef unsigned char                   Boolean;
310  /********************************************************************************
311  
312      Function Pointer Types
313      
314          ProcPtr                 Generic pointer to a function
315          Register68kProcPtr      Pointer to a 68K function that expects parameters in registers
316          UniversalProcPtr        Pointer to classic 68K code or a RoutineDescriptor
317          
318          ProcHandle              Pointer to a ProcPtr
319          UniversalProcHandle     Pointer to a UniversalProcPtr
320          
321  *********************************************************************************/
322  typedef CALLBACK_API_C( long , ProcPtr )();
323  typedef CALLBACK_API( void , Register68kProcPtr )();
324  #if TARGET_RT_MAC_CFM
325  /*  The RoutineDescriptor structure is defined in MixedMode.h */
326  typedef struct RoutineDescriptor *UniversalProcPtr;
327  #else
328  typedef ProcPtr                         UniversalProcPtr;
329  #endif  /* TARGET_RT_MAC_CFM */
330  
331  typedef ProcPtr *                       ProcHandle;
332  typedef UniversalProcPtr *              UniversalProcHandle;
333  /********************************************************************************
334  
335      RefCon Types
336      
337          For access to private data in callbacks, etc.; refcons are generally
338          used as a pointer to something, but in the 32-bit world refcons in
339          different APIs have had various types: pointer, unsigned scalar, and
340          signed scalar. The RefCon types defined here support the current 32-bit
341          usage but provide normalization to pointer types for 64-bit.
342          
343          PRefCon is preferred for new APIs; URefCon and SRefCon are primarily
344          for compatibility with existing APIs.
345          
346  *********************************************************************************/
347  typedef void *                          PRefCon;
348  #if __LP64__
349  typedef void *                          URefCon;
350  typedef void *                          SRefCon;
351  #else
352  typedef UInt32                          URefCon;
353  typedef SInt32                          SRefCon;
354  #endif  /* __LP64__ */
355  
356  /********************************************************************************
357  
358      Common Constants
359      
360          noErr                   OSErr: function performed properly - no error
361          kNilOptions             OptionBits: all flags false
362          kInvalidID              KernelID: NULL is for pointers as kInvalidID is for ID's
363          kVariableLengthArray    array bounds: variable length array
364  
365      Note: kVariableLengthArray was used in array bounds to specify a variable length array,
366            usually the last field in a struct.  Now that the C language supports 
367  		  the concept of flexible array members, you can instead use: 
368  		
369  		struct BarList
370  		{
371  			short	listLength;
372  			Bar		elements[];
373  		};
374  
375  		However, this changes the semantics somewhat, as sizeof( BarList ) contains
376  		no space for any of the elements, so to allocate a list with space for
377  		the count elements
378  
379  		struct BarList* l = (struct BarList*) malloc( sizeof(BarList) + count * sizeof(Bar) );
380          
381  *********************************************************************************/
382  enum {
383    noErr                         = 0
384  };
385  
386  enum {
387    kNilOptions                   = 0
388  };
389  
390  #define kInvalidID   0
391  enum {
392    kVariableLengthArray  
393  #ifdef __has_extension
394     #if __has_extension(enumerator_attributes)
395  		__attribute__((deprecated))  
396  	#endif
397  #endif
398    = 1
399  };
400  
401  enum {
402    kUnknownType                  = 0x3F3F3F3F /* "????" QuickTime 3.0: default unknown ResType or OSType */
403  };
404  
405  
406  
407  /********************************************************************************
408  
409      String Types and Unicode Types
410      
411          UnicodeScalarValue,     A complete Unicode character in UTF-32 format, with
412          UTF32Char               values from 0 through 0x10FFFF (excluding the surrogate
413                                  range 0xD800-0xDFFF and certain disallowed values).
414  
415          UniChar,                A 16-bit Unicode code value in the default UTF-16 format.
416          UTF16Char               UnicodeScalarValues 0-0xFFFF are expressed in UTF-16
417                                  format using a single UTF16Char with the same value.
418                                  UnicodeScalarValues 0x10000-0x10FFFF are expressed in
419                                  UTF-16 format using a pair of UTF16Chars - one in the
420                                  high surrogate range (0xD800-0xDBFF) followed by one in
421                                  the low surrogate range (0xDC00-0xDFFF). All of the
422                                  characters defined in Unicode versions through 3.0 are
423                                  in the range 0-0xFFFF and can be expressed using a single
424                                  UTF16Char, thus the term "Unicode character" generally
425                                  refers to a UniChar = UTF16Char.
426  
427          UTF8Char                An 8-bit code value in UTF-8 format. UnicodeScalarValues
428                                  0-0x7F are expressed in UTF-8 format using one UTF8Char
429                                  with the same value. UnicodeScalarValues above 0x7F are
430                                  expressed in UTF-8 format using 2-4 UTF8Chars, all with
431                                  values in the range 0x80-0xF4 (UnicodeScalarValues
432                                  0x100-0xFFFF use two or three UTF8Chars,
433                                  UnicodeScalarValues 0x10000-0x10FFFF use four UTF8Chars).
434  
435          UniCharCount            A count of UTF-16 code values in an array or buffer.
436  
437          StrNNN                  Pascal string holding up to NNN bytes
438          StringPtr               Pointer to a pascal string
439          StringHandle            Pointer to a StringPtr
440          ConstStringPtr          Pointer to a read-only pascal string
441          ConstStrNNNParam        For function parameters only - means string is const
442          
443          CStringPtr              Pointer to a C string           (in C:  char*)
444          ConstCStringPtr         Pointer to a read-only C string (in C:  const char*)
445          
446      Note: The length of a pascal string is stored as the first byte.
447            A pascal string does not have a termination byte.
448            A pascal string can hold at most 255 bytes of data.
449            The first character in a pascal string is offset one byte from the start of the string. 
450            
451            A C string is terminated with a byte of value zero.  
452            A C string has no length limitation.
453            The first character in a C string is the zeroth byte of the string. 
454            
455          
456  *********************************************************************************/
457  typedef UInt32                          UnicodeScalarValue;
458  typedef UInt32                          UTF32Char;
459  typedef UInt16                          UniChar;
460  typedef UInt16                          UTF16Char;
461  typedef UInt8                           UTF8Char;
462  typedef UniChar *                       UniCharPtr;
463  typedef unsigned long                   UniCharCount;
464  typedef UniCharCount *                  UniCharCountPtr;
465  typedef unsigned char                   Str255[256];
466  typedef unsigned char                   Str63[64];
467  typedef unsigned char                   Str32[33];
468  typedef unsigned char                   Str31[32];
469  typedef unsigned char                   Str27[28];
470  typedef unsigned char                   Str15[16];
471  /*
472      The type Str32 is used in many AppleTalk based data structures.
473      It holds up to 32 one byte chars.  The problem is that with the
474      length byte it is 33 bytes long.  This can cause weird alignment
475      problems in structures.  To fix this the type "Str32Field" has
476      been created.  It should only be used to hold 32 chars, but
477      it is 34 bytes long so that there are no alignment problems.
478  */
479  typedef unsigned char                   Str32Field[34];
480  /*
481      QuickTime 3.0:
482      The type StrFileName is used to make MacOS structs work 
483      cross-platform.  For example FSSpec or SFReply previously
484      contained a Str63 field.  They now contain a StrFileName
485      field which is the same when targeting the MacOS but is
486      a 256 char buffer for Win32 and unix, allowing them to
487      contain long file names.
488  */
489  typedef Str63                           StrFileName;
490  typedef unsigned char *                 StringPtr;
491  typedef StringPtr *                     StringHandle;
492  typedef const unsigned char *           ConstStringPtr;
493  typedef const unsigned char *           ConstStr255Param;
494  typedef const unsigned char *           ConstStr63Param;
495  typedef const unsigned char *           ConstStr32Param;
496  typedef const unsigned char *           ConstStr31Param;
497  typedef const unsigned char *           ConstStr27Param;
498  typedef const unsigned char *           ConstStr15Param;
499  typedef ConstStr63Param                 ConstStrFileNameParam;
500  #ifdef __cplusplus
501  inline unsigned char StrLength(ConstStr255Param string) { return (*string); }
502  #else
503  #define StrLength(string) (*(unsigned char *)(string))
504  #endif  /* defined(__cplusplus) */
505  
506  #if OLDROUTINENAMES
507  #define Length(string) StrLength(string)
508  #endif  /* OLDROUTINENAMES */
509  
510  /********************************************************************************
511  
512      Process Manager type ProcessSerialNumber (previously in Processes.h)
513  
514  *********************************************************************************/
515  /* type for unique process identifier */
516  struct ProcessSerialNumber {
517    UInt32              highLongOfPSN;
518    UInt32              lowLongOfPSN;
519  };
520  typedef struct ProcessSerialNumber      ProcessSerialNumber;
521  typedef ProcessSerialNumber *           ProcessSerialNumberPtr;
522  /********************************************************************************
523  
524      Quickdraw Types
525      
526          Point               2D Quickdraw coordinate, range: -32K to +32K
527          Rect                Rectangular Quickdraw area
528          Style               Quickdraw font rendering styles
529          StyleParameter      Style when used as a parameter (historical 68K convention)
530          StyleField          Style when used as a field (historical 68K convention)
531          CharParameter       Char when used as a parameter (historical 68K convention)
532          
533      Note:   The original Macintosh toolbox in 68K Pascal defined Style as a SET.  
534              Both Style and CHAR occupy 8-bits in packed records or 16-bits when 
535              used as fields in non-packed records or as parameters. 
536          
537  *********************************************************************************/
538  struct Point {
539    short               v;
540    short               h;
541  };
542  typedef struct Point                    Point;
543  typedef Point *                         PointPtr;
544  struct Rect {
545    short               top;
546    short               left;
547    short               bottom;
548    short               right;
549  };
550  typedef struct Rect                     Rect;
551  typedef Rect *                          RectPtr;
552  struct FixedPoint {
553    Fixed               x;
554    Fixed               y;
555  };
556  typedef struct FixedPoint               FixedPoint;
557  struct FixedRect {
558    Fixed               left;
559    Fixed               top;
560    Fixed               right;
561    Fixed               bottom;
562  };
563  typedef struct FixedRect                FixedRect;
564  
565  typedef short                           CharParameter;
566  enum {
567    normal                        = 0,
568    bold                          = 1,
569    italic                        = 2,
570    underline                     = 4,
571    outline                       = 8,
572    shadow                        = 0x10,
573    condense                      = 0x20,
574    extend                        = 0x40
575  };
576  
577  typedef unsigned char                   Style;
578  typedef short                           StyleParameter;
579  typedef Style                           StyleField;
580  
581  
582  /********************************************************************************
583  
584      QuickTime TimeBase types (previously in Movies.h)
585      
586          TimeValue           Count of units
587          TimeScale           Units per second
588          CompTimeValue       64-bit count of units (always a struct) 
589          TimeValue64         64-bit count of units (long long or struct) 
590          TimeBase            An opaque reference to a time base
591          TimeRecord          Package of TimeBase, duration, and scale
592          
593  *********************************************************************************/
594  typedef SInt32                          TimeValue;
595  typedef SInt32                          TimeScale;
596  typedef wide                            CompTimeValue;
597  typedef SInt64                          TimeValue64;
598  typedef struct TimeBaseRecord*          TimeBase;
599  struct TimeRecord {
600    CompTimeValue       value;                  /* units (duration or absolute) */
601    TimeScale           scale;                  /* units per second */
602    TimeBase            base;                   /* refernce to the time base */
603  };
604  typedef struct TimeRecord               TimeRecord;
605  
606  /********************************************************************************
607  
608      THINK C base objects
609  
610          HandleObject        Root class for handle based THINK C++ objects
611          PascalObject        Root class for pascal style objects in THINK C++ 
612  
613  *********************************************************************************/
614  #if defined(__SC__) && !defined(__STDC__) && defined(__cplusplus)
615          class __machdl HandleObject {};
616          #if TARGET_CPU_68K
617              class __pasobj PascalObject {};
618          #endif
619  #endif
620  
621  
622  /********************************************************************************
623  
624      MacOS versioning structures
625      
626          VersRec                 Contents of a 'vers' resource
627          VersRecPtr              Pointer to a VersRecPtr
628          VersRecHndl             Resource Handle containing a VersRec
629          NumVersion              Packed BCD version representation (e.g. "4.2.1a3" is 0x04214003)
630          UniversalProcPtr        Pointer to classic 68K code or a RoutineDescriptor
631          
632          ProcHandle              Pointer to a ProcPtr
633          UniversalProcHandle     Pointer to a UniversalProcPtr
634          
635  *********************************************************************************/
636  #if TARGET_RT_BIG_ENDIAN
637  struct NumVersion {
638                                                /* Numeric version part of 'vers' resource */
639    UInt8               majorRev;               /*1st part of version number in BCD*/
640    UInt8               minorAndBugRev;         /*2nd & 3rd part of version number share a byte*/
641    UInt8               stage;                  /*stage code: dev, alpha, beta, final*/
642    UInt8               nonRelRev;              /*revision level of non-released version*/
643  };
644  typedef struct NumVersion               NumVersion;
645  #else
646  struct NumVersion {
647                                                /* Numeric version part of 'vers' resource accessable in little endian format */
648    UInt8               nonRelRev;              /*revision level of non-released version*/
649    UInt8               stage;                  /*stage code: dev, alpha, beta, final*/
650    UInt8               minorAndBugRev;         /*2nd & 3rd part of version number share a byte*/
651    UInt8               majorRev;               /*1st part of version number in BCD*/
652  };
653  typedef struct NumVersion               NumVersion;
654  #endif  /* TARGET_RT_BIG_ENDIAN */
655  
656  enum {
657                                          /* Version Release Stage Codes */
658    developStage                  = 0x20,
659    alphaStage                    = 0x40,
660    betaStage                     = 0x60,
661    finalStage                    = 0x80
662  };
663  
664  union NumVersionVariant {
665                                                /* NumVersionVariant is a wrapper so NumVersion can be accessed as a 32-bit value */
666    NumVersion          parts;
667    UInt32              whole;
668  };
669  typedef union NumVersionVariant         NumVersionVariant;
670  typedef NumVersionVariant *             NumVersionVariantPtr;
671  typedef NumVersionVariantPtr *          NumVersionVariantHandle;
672  struct VersRec {
673                                                /* 'vers' resource format */
674    NumVersion          numericVersion;         /*encoded version number*/
675    short               countryCode;            /*country code from intl utilities*/
676    Str255              shortVersion;           /*version number string - worst case*/
677    Str255              reserved;               /*longMessage string packed after shortVersion*/
678  };
679  typedef struct VersRec                  VersRec;
680  typedef VersRec *                       VersRecPtr;
681  typedef VersRecPtr *                    VersRecHndl;
682  /*********************************************************************************
683  
684      Old names for types
685          
686  *********************************************************************************/
687  typedef UInt8                           Byte;
688  typedef SInt8                           SignedByte;
689  typedef wide *                          WidePtr;
690  typedef UnsignedWide *                  UnsignedWidePtr;
691  typedef Float80                         extended80;
692  typedef Float96                         extended96;
693  typedef SInt8                           VHSelect;
694  /*********************************************************************************
695  
696      Debugger functions
697      
698  *********************************************************************************/
699  /*
700   *  Debugger()
701   *  
702   *  Availability:
703   *    Mac OS X:         in version 10.0 and later in CoreServices.framework
704   *    CarbonLib:        in CarbonLib 1.0 and later
705   *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
706   */
707  extern void 
708  Debugger(void)                                                __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_NA, __IPHONE_NA);
709  
710  
711  /*
712   *  DebugStr()
713   *  
714   *  Availability:
715   *    Mac OS X:         in version 10.0 and later in CoreServices.framework
716   *    CarbonLib:        in CarbonLib 1.0 and later
717   *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
718   */
719  extern void 
720  DebugStr(ConstStr255Param debuggerMsg)                        __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_NA, __IPHONE_NA);
721  
722  
723  /*
724   *  debugstr()
725   *  
726   *  Availability:
727   *    Mac OS X:         not available
728   *    CarbonLib:        not available
729   *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
730   */
731  
732  
733  #if TARGET_CPU_PPC
734  /* Only for Mac OS native drivers */
735  /*
736   *  SysDebug()
737   *  
738   *  Availability:
739   *    Mac OS X:         not available
740   *    CarbonLib:        not available
741   *    Non-Carbon CFM:   in DriverServicesLib 1.0 and later
742   */
743  
744  
745  /*
746   *  SysDebugStr()
747   *  
748   *  Availability:
749   *    Mac OS X:         not available
750   *    CarbonLib:        not available
751   *    Non-Carbon CFM:   in DriverServicesLib 1.0 and later
752   */
753  
754  
755  #endif  /* TARGET_CPU_PPC */
756  
757  /* SADE break points */
758  /*
759   *  SysBreak()
760   *  
761   *  Availability:
762   *    Mac OS X:         in version 10.0 and later in CoreServices.framework
763   *    CarbonLib:        in CarbonLib 1.0 and later
764   *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
765   */
766  extern void 
767  SysBreak(void)                                                __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_NA, __IPHONE_NA);
768  
769  
770  /*
771   *  SysBreakStr()
772   *  
773   *  Availability:
774   *    Mac OS X:         in version 10.0 and later in CoreServices.framework
775   *    CarbonLib:        in CarbonLib 1.0 and later
776   *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
777   */
778  extern void 
779  SysBreakStr(ConstStr255Param debuggerMsg)                     __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_NA, __IPHONE_NA);
780  
781  
782  /*
783   *  SysBreakFunc()
784   *  
785   *  Availability:
786   *    Mac OS X:         in version 10.0 and later in CoreServices.framework
787   *    CarbonLib:        in CarbonLib 1.0 and later
788   *    Non-Carbon CFM:   in InterfaceLib 7.1 and later
789   */
790  extern void 
791  SysBreakFunc(ConstStr255Param debuggerMsg)                    __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_0, __MAC_10_8, __IPHONE_NA, __IPHONE_NA);
792  
793  
794  /* old names for Debugger and DebugStr */
795  #if OLDROUTINENAMES && TARGET_CPU_68K
796      #define Debugger68k()   Debugger()
797      #define DebugStr68k(s)  DebugStr(s)
798  #endif
799  
800  
801  #pragma pack(pop)
802  
803  #ifdef __cplusplus
804  }
805  #endif
806  
807  #endif /* __MACTYPES__ */
808