Mac OS 9
AEDataModel.h
Go to the documentation of this file.
1 
19 #ifndef __AEDATAMODEL__
20 #define __AEDATAMODEL__
21 
22 #ifndef __MACTYPES__
23 #include <MacTypes.h>
24 #endif
25 
26 #ifndef __MIXEDMODE__
27 #include <MixedMode.h>
28 #endif
29 
30 #if PRAGMA_ONCE
31 #pragma once
32 #endif
33 
34 #ifdef __cplusplus
35 extern "C"
36 {
37 #endif
38 
39 #if PRAGMA_IMPORT
40 #pragma import on
41 #endif
42 
43 #if PRAGMA_STRUCT_ALIGN
44 #pragma options align = mac68k
45 #elif PRAGMA_STRUCT_PACKPUSH
46 #pragma pack(push, 2)
47 #elif PRAGMA_STRUCT_PACK
48 #pragma pack(2)
49 #endif
50 
52  enum
53  {
54  typeBoolean = FOUR_CHAR_CODE('bool'),
55  typeChar = FOUR_CHAR_CODE('TEXT')
56  };
57 
59  enum
60  {
61  typeSInt16 = FOUR_CHAR_CODE('shor'),
62  typeSInt32 = FOUR_CHAR_CODE('long'),
63  typeUInt32 = FOUR_CHAR_CODE('magn'),
64  typeSInt64 = FOUR_CHAR_CODE('comp'),
65  typeIEEE32BitFloatingPoint = FOUR_CHAR_CODE('sing'),
66  typeIEEE64BitFloatingPoint = FOUR_CHAR_CODE('doub'),
67  type128BitFloatingPoint = FOUR_CHAR_CODE('ldbl'),
68  typeDecimalStruct = FOUR_CHAR_CODE('decm')
69  };
70 
72  enum
73  {
74  typeSMInt = typeSInt16,
75  typeShortInteger = typeSInt16,
76  typeInteger = typeSInt32,
77  typeLongInteger = typeSInt32,
78  typeMagnitude = typeUInt32,
79  typeComp = typeSInt64,
80  typeSMFloat = typeIEEE32BitFloatingPoint,
81  typeShortFloat = typeIEEE32BitFloatingPoint,
82  typeFloat = typeIEEE64BitFloatingPoint,
83  typeLongFloat = typeIEEE64BitFloatingPoint,
84  typeExtended = FOUR_CHAR_CODE('exte')
85  };
86 
88  enum
89  {
90  typeAEList = FOUR_CHAR_CODE('list'),
91  typeAERecord = FOUR_CHAR_CODE('reco'),
92  typeAppleEvent = FOUR_CHAR_CODE('aevt'),
93  typeEventRecord = FOUR_CHAR_CODE('evrc'),
94  typeTrue = FOUR_CHAR_CODE('true'),
95  typeFalse = FOUR_CHAR_CODE('fals'),
96  typeAlias = FOUR_CHAR_CODE('alis'),
97  typeEnumerated = FOUR_CHAR_CODE('enum'),
98  typeType = FOUR_CHAR_CODE('type'),
99  typeAppParameters = FOUR_CHAR_CODE('appa'),
100  typeProperty = FOUR_CHAR_CODE('prop'),
101  typeFSS = FOUR_CHAR_CODE('fss '),
102  typeFSRef = FOUR_CHAR_CODE('fsrf'),
103  typeFileURL = FOUR_CHAR_CODE('furl'),
104  typeKeyword = FOUR_CHAR_CODE('keyw'),
105  typeSectionH = FOUR_CHAR_CODE('sect'),
106  typeWildCard = FOUR_CHAR_CODE('****'),
107  typeApplSignature = FOUR_CHAR_CODE('sign'),
108  typeQDRectangle = FOUR_CHAR_CODE('qdrt'),
109  typeFixed = FOUR_CHAR_CODE('fixd'),
110  typeProcessSerialNumber = FOUR_CHAR_CODE('psn '),
111  typeApplicationURL = FOUR_CHAR_CODE('aprl'),
112  typeNull = FOUR_CHAR_CODE('null')
113  };
114 
115 #if CALL_NOT_IN_CARBON
117  enum
118  {
119  typeSessionID = FOUR_CHAR_CODE('ssid'),
120  typeTargetID = FOUR_CHAR_CODE('targ'),
121  typeDispatcherID = FOUR_CHAR_CODE('dspt')
122  };
123 
124 #endif
127  enum
128  {
129  keyTransactionIDAttr = FOUR_CHAR_CODE('tran'),
130  keyReturnIDAttr = FOUR_CHAR_CODE('rtid'),
131  keyEventClassAttr = FOUR_CHAR_CODE('evcl'),
132  keyEventIDAttr = FOUR_CHAR_CODE('evid'),
133  keyAddressAttr = FOUR_CHAR_CODE('addr'),
134  keyOptionalKeywordAttr = FOUR_CHAR_CODE('optk'),
135  keyTimeoutAttr = FOUR_CHAR_CODE('timo'),
136  keyInteractLevelAttr = FOUR_CHAR_CODE(
137  'inte'),
138  keyEventSourceAttr = FOUR_CHAR_CODE(
139  'esrc'),
141  FOUR_CHAR_CODE('miss'),
142  keyOriginalAddressAttr = FOUR_CHAR_CODE('from'),
143  keyAcceptTimeoutAttr = FOUR_CHAR_CODE('actm')
144  };
145 
147  enum
148  {
149  kAEDescListFactorNone = 0,
150  kAEDescListFactorType = 4,
151  kAEDescListFactorTypeAndSize = 8
152  };
153 
155  enum
156  {
159  -1,
161  kAnyTransactionID = 0
162  };
163 
165  typedef ResType DescType;
166  typedef FourCharCode AEKeyword;
167 #if OPAQUE_TOOLBOX_STRUCTS
168  typedef struct OpaqueAEDataStorageType *AEDataStorageType;
169 #else
170 typedef Ptr AEDataStorageType;
171 #endif
173  typedef AEDataStorageType *AEDataStorage;
174  struct AEDesc
175  {
176  DescType descriptorType;
177  AEDataStorage dataHandle;
178  };
179  typedef struct AEDesc AEDesc;
180  typedef AEDesc *AEDescPtr;
181  struct AEKeyDesc
182  {
183  AEKeyword descKey;
184  AEDesc descContent;
185  };
186  typedef struct AEKeyDesc AEKeyDesc;
196  typedef AppleEvent *AppleEventPtr;
197  typedef SInt16 AEReturnID;
198  typedef SInt32 AETransactionID;
199  typedef FourCharCode AEEventClass;
200  typedef FourCharCode AEEventID;
201  typedef SInt8 AEArrayType;
202  enum
203  {
204  kAEDataArray = 0,
205  kAEPackedArray = 1,
206  kAEDescArray = 3,
207  kAEKeyDescArray = 4
208  };
209 
210  enum
211  {
212  kAEHandleArray = 2
213  };
214 
219  union AEArrayData
220  {
221  short AEDataArray[];
222  char AEPackedArray[];
223  Handle AEHandleArray[];
224  AEDesc AEDescArray[];
225  AEKeyDesc AEKeyDesc[];
226  } AEArrayData;
227  typedef union AEArrayData AEArrayData;
228  typedef AEArrayData *AEArrayDataPointer;
229  /***************************************************************************
230  These constants are used by AEMach and AEInteraction APIs. They are not
231  strictly part of the data format, but are declared here due to layering.
232  **************************************************************************/
233  typedef SInt16 AESendPriority;
234  enum
235  {
236  kAENormalPriority =
237  0x00000000,
238  kAEHighPriority = 0x00000001
240  };
241 
242  typedef SInt32 AESendMode;
243  enum
244  {
245  kAENoReply = 0x00000001,
246  kAEQueueReply = 0x00000002,
247  kAEWaitReply = 0x00000003,
248  kAEDontReconnect = 0x00000080,
250  kAEWantReceipt =
251  0x00000200,
252  kAENeverInteract = 0x00000010,
253  kAECanInteract = 0x00000020,
254  kAEAlwaysInteract = 0x00000030,
256  kAECanSwitchLayer = 0x00000040,
257  kAEDontRecord = 0x00001000,
259  kAEDontExecute = 0x00002000,
261  kAEProcessNonReplyEvents =
262  0x00008000
264  };
265 
267  enum
268  {
269  kAEDefaultTimeout = -1,
270  kNoTimeOut = -2
271  };
272 
273  /***************************************************************************
274  These calls are used to set up and modify the coercion dispatch table.
275  **************************************************************************/
276  typedef CALLBACK_API(OSErr, AECoerceDescProcPtr)(const AEDesc *fromDesc,
277  DescType toType,
278  long handlerRefcon,
279  AEDesc *toDesc);
280  typedef CALLBACK_API(OSErr,
281  AECoercePtrProcPtr)(DescType typeCode, const void *dataPtr,
282  Size dataSize, DescType toType,
283  long handlerRefcon, AEDesc *result);
284  typedef STACK_UPP_TYPE(AECoerceDescProcPtr) AECoerceDescUPP;
285  typedef STACK_UPP_TYPE(AECoercePtrProcPtr) AECoercePtrUPP;
294  AECoerceDescUPP
295  NewAECoerceDescUPP(AECoerceDescProcPtr userRoutine);
296 #if !OPAQUE_UPP_TYPES
297  enum
298  {
299  uppAECoerceDescProcInfo = 0x00003FE0
300  };
301 #ifdef __cplusplus
302  inline AECoerceDescUPP NewAECoerceDescUPP(AECoerceDescProcPtr userRoutine)
303  {
304  return (AECoerceDescUPP)NewRoutineDescriptor((ProcPtr)(userRoutine),
305  uppAECoerceDescProcInfo,
306  GetCurrentArchitecture());
307  }
308 #else
309 #define NewAECoerceDescUPP(userRoutine) \
310  (AECoerceDescUPP) \
311  NewRoutineDescriptor((ProcPtr)(userRoutine), uppAECoerceDescProcInfo, \
312  GetCurrentArchitecture())
313 #endif
314 #endif
315 
324  AECoercePtrUPP
325  NewAECoercePtrUPP(AECoercePtrProcPtr userRoutine);
326 #if !OPAQUE_UPP_TYPES
327  enum
328  {
329  uppAECoercePtrProcInfo = 0x0003FFE0
330  };
332 #ifdef __cplusplus
333  inline AECoercePtrUPP NewAECoercePtrUPP(AECoercePtrProcPtr userRoutine)
334  {
335  return (AECoercePtrUPP)NewRoutineDescriptor(
336  (ProcPtr)(userRoutine), uppAECoercePtrProcInfo, GetCurrentArchitecture());
337  }
338 #else
339 #define NewAECoercePtrUPP(userRoutine) \
340  (AECoercePtrUPP) \
341  NewRoutineDescriptor((ProcPtr)(userRoutine), uppAECoercePtrProcInfo, \
342  GetCurrentArchitecture())
343 #endif
344 #endif
345 
353  void
354  DisposeAECoerceDescUPP(AECoerceDescUPP userUPP);
355 #if !OPAQUE_UPP_TYPES
356 #ifdef __cplusplus
357  inline void DisposeAECoerceDescUPP(AECoerceDescUPP userUPP)
358  {
359  DisposeRoutineDescriptor((UniversalProcPtr)userUPP);
360  }
361 #else
362 #define DisposeAECoerceDescUPP(userUPP) DisposeRoutineDescriptor(userUPP)
363 #endif
364 #endif
365 
374  void
375  DisposeAECoercePtrUPP(AECoercePtrUPP userUPP);
376 #if !OPAQUE_UPP_TYPES
377 #ifdef __cplusplus
378  inline void DisposeAECoercePtrUPP(AECoercePtrUPP userUPP)
379  {
380  DisposeRoutineDescriptor((UniversalProcPtr)userUPP);
381  }
382 #else
383 #define DisposeAECoercePtrUPP(userUPP) DisposeRoutineDescriptor(userUPP)
384 #endif
385 #endif
386 
395  OSErr
396  InvokeAECoerceDescUPP(const AEDesc *fromDesc, DescType toType,
397  long handlerRefcon, AEDesc *toDesc,
398  AECoerceDescUPP userUPP);
399 #if !OPAQUE_UPP_TYPES
400 #ifdef __cplusplus
401  inline OSErr InvokeAECoerceDescUPP(const AEDesc *fromDesc, DescType toType,
402  long handlerRefcon, AEDesc *toDesc,
403  AECoerceDescUPP userUPP)
404  {
405  return (OSErr)CALL_FOUR_PARAMETER_UPP(userUPP, uppAECoerceDescProcInfo,
406  fromDesc, toType, handlerRefcon,
407  toDesc);
408  }
409 #else
410 #define InvokeAECoerceDescUPP(fromDesc, toType, handlerRefcon, toDesc, \
411  userUPP) \
412  (OSErr) \
413  CALL_FOUR_PARAMETER_UPP((userUPP), uppAECoerceDescProcInfo, (fromDesc), \
414  (toType), (handlerRefcon), (toDesc))
415 #endif
416 #endif
417 
426  OSErr
427  InvokeAECoercePtrUPP(DescType typeCode, const void *dataPtr, Size dataSize,
428  DescType toType, long handlerRefcon, AEDesc *result,
429  AECoercePtrUPP userUPP);
430 #if !OPAQUE_UPP_TYPES
431 #ifdef __cplusplus
432  inline OSErr InvokeAECoercePtrUPP(DescType typeCode, const void *dataPtr,
433  Size dataSize, DescType toType,
434  long handlerRefcon, AEDesc *result,
435  AECoercePtrUPP userUPP)
436  {
437  return (OSErr)CALL_SIX_PARAMETER_UPP(userUPP, uppAECoercePtrProcInfo,
438  typeCode, dataPtr, dataSize, toType,
439  handlerRefcon, result);
440  }
441 #else
442 #define InvokeAECoercePtrUPP(typeCode, dataPtr, dataSize, toType, \
443  handlerRefcon, result, userUPP) \
444  (OSErr) CALL_SIX_PARAMETER_UPP((userUPP), uppAECoercePtrProcInfo, \
445  (typeCode), (dataPtr), (dataSize), (toType), \
446  (handlerRefcon), (result))
447 #endif
448 #endif
449 
450 #if CALL_NOT_IN_CARBON || OLDROUTINENAMES
452 #define NewAECoerceDescProc(userRoutine) NewAECoerceDescUPP(userRoutine)
453 #define NewAECoercePtrProc(userRoutine) NewAECoercePtrUPP(userRoutine)
454 #define CallAECoerceDescProc(userRoutine, fromDesc, toType, handlerRefcon, \
455  toDesc) \
456  InvokeAECoerceDescUPP(fromDesc, toType, handlerRefcon, toDesc, userRoutine)
457 #define CallAECoercePtrProc(userRoutine, typeCode, dataPtr, dataSize, toType, \
458  handlerRefcon, result) \
459  InvokeAECoercePtrUPP(typeCode, dataPtr, dataSize, toType, handlerRefcon, \
460  result, userRoutine)
461 #endif
468  typedef AECoercionHandlerUPP AECoercionHandlerUPP;
477  OSErr
478  AEInstallCoercionHandler(DescType fromType, DescType toType,
479  AECoercionHandlerUPP handler, long handlerRefcon,
480  Boolean fromTypeIsDesc, Boolean isSysHandler);
481 
490  OSErr
491  AERemoveCoercionHandler(DescType fromType, DescType toType,
492  AECoercionHandlerUPP handler,
493  Boolean isSysHandler);
494 
503  OSErr
504  AEGetCoercionHandler(DescType fromType, DescType toType,
505  AECoercionHandlerUPP *handler, long *handlerRefcon,
506  Boolean *fromTypeIsDesc, Boolean isSysHandler);
507 
508  /***************************************************************************
509  The following calls provide for a coercion interface.
510  **************************************************************************/
519  OSErr
520  AECoercePtr(DescType typeCode, const void *dataPtr,
521  Size dataSize, DescType toType, AEDesc *result);
522 
531  OSErr
532  AECoerceDesc(const AEDesc *theAEDesc, DescType toType, AEDesc *result);
533 
534  /***************************************************************************
535  The function calls apply to any AEDesc. Every 'result' descriptor is
536  created for you, so you will be responsible for memory management
537  (including disposing) of the descriptors so created.
538  **************************************************************************/
549  void
550  AEInitializeDesc(AEDesc *desc);
551 
552 #ifdef __cplusplus
553  inline void AEInitializeDescInline(AEDesc *d)
554  {
555  d->descriptorType = typeNull;
556  d->dataHandle = NULL;
557  };
558 #else
559 #define AEInitializeDescInline(__d) \
560  do \
561  { \
562  AEDesc *d = __d; \
563  d->descriptorType = typeNull; \
564  d->dataHandle = NULL; \
565  } while (0)
566 #endif
567 
576  OSErr
577  AECreateDesc(
578  DescType typeCode,
579  const void *dataPtr,
580  Size dataSize,
581  AEDesc *result);
582 
591  OSErr AEDisposeDesc(AEDesc *theAEDesc);
592 
601  OSErr AEDuplicateDesc(const AEDesc *theAEDesc, AEDesc *result);
602 
603  /***************************************************************************
604  The following calls apply to AEDescList. Since AEDescList is a subtype of
605  AEDesc, the calls in the previous section can also be used for AEDescList.
606  All list and array indices are 1-based. If the data was greater than
607  maximumSize in the routines below, then actualSize will be greater than
608  maximumSize, but only maximumSize bytes will actually be retrieved.
609  **************************************************************************/
618  OSErr
619  AECreateList(const void *factoringPtr, Size factoredSize,
620  Boolean isRecord, AEDescList *resultList);
621 
640  OSErr AECountItems(const AEDescList *theAEDescList,
641  long *theCount);
650  OSErr AEPutPtr(AEDescList *theAEDescList, long index, DescType typeCode,
651  const void *dataPtr, Size dataSize);
652 
661  OSErr AEPutDesc(AEDescList *theAEDescList, long index, const AEDesc *theAEDesc);
662 
671  OSErr AEGetNthPtr(const AEDescList *theAEDescList, long index, DescType desiredType,
672  AEKeyword *theAEKeyword, DescType *typeCode, void *dataPtr,
673  Size maximumSize, Size *actualSize);
674 
683  OSErr AEGetNthDesc(const AEDescList *theAEDescList, long index, DescType desiredType,
684  AEKeyword *theAEKeyword, AEDesc *result);
685 
694  OSErr AESizeOfNthItem(const AEDescList *theAEDescList, long index, DescType *typeCode,
695  Size *dataSize);
696 
705  OSErr AEGetArray(const AEDescList *theAEDescList, AEArrayType arrayType,
706  AEArrayDataPointer arrayPtr, Size maximumSize, DescType *itemType,
707  Size *itemSize, long *itemCount);
708 
717  OSErr AEPutArray(AEDescList *theAEDescList, AEArrayType arrayType,
718  const AEArrayData *arrayPtr, DescType itemType, Size itemSize,
719  long itemCount);
720 
729  OSErr AEDeleteItem(AEDescList *theAEDescList, long index);
730 
731  /***************************************************************************
732  The following calls apply to AERecord. Since AERecord is a subtype of
733  AEDescList, the calls in the previous sections can also be used for
734  AERecord an AERecord can be created by using AECreateList with isRecord
735  set to true.
736  **************************************************************************/
737  /**************************************************************************
738  AERecords can have an abitrary descriptorType. This allows you to
739  check if desc is truly an AERecord
740  ************************************************************************/
749  Boolean
750  AECheckIsRecord(const AEDesc *theDesc);
751 
763 #define AEPutKeyPtr(theAERecord, theAEKeyword, typeCode, dataPtr, dataSize) \
764  AEPutParamPtr((theAERecord), (theAEKeyword), (typeCode), (dataPtr), \
765  (dataSize))
766 #define AEPutKeyDesc(theAERecord, theAEKeyword, theAEDesc) \
767  AEPutParamDesc((theAERecord), (theAEKeyword), (theAEDesc))
768 #define AEGetKeyPtr(theAERecord, theAEKeyword, desiredType, typeCode, dataPtr, \
769  maxSize, actualSize) \
770  AEGetParamPtr((theAERecord), (theAEKeyword), (desiredType), (typeCode), \
771  (dataPtr), (maxSize), (actualSize))
772 #define AEGetKeyDesc(theAERecord, theAEKeyword, desiredType, result) \
773  AEGetParamDesc((theAERecord), (theAEKeyword), (desiredType), (result))
774 #define AESizeOfKeyDesc(theAERecord, theAEKeyword, typeCode, dataSize) \
775  AESizeOfParam((theAERecord), (theAEKeyword), (typeCode), (dataSize))
776 #define AEDeleteKeyDesc(theAERecord, theAEKeyword) \
777  AEDeleteParam((theAERecord), (theAEKeyword))
778  /***************************************************************************
779  The following calls create and manipulate the AppleEvent data type.
780  **************************************************************************/
789  OSErr
790  AECreateAppleEvent(AEEventClass theAEEventClass, AEEventID theAEEventID,
791  const AEAddressDesc *target, AEReturnID returnID,
792  AETransactionID transactionID, AppleEvent *result);
793 
794  /***************************************************************************
795  The following calls are used to pack and unpack parameters from records
796  of the event. Since AppleEvent is a subtype of AERecord, the calls
797  in the previous sections can also be used for variables of type
798  AppleEvent. The next six calls are in fact identical to the six calls
799  for AERecord.
800  **************************************************************************/
809  OSErr
811  AppleEvent *theAppleEvent,
812  AEKeyword theAEKeyword,
813  DescType typeCode,
814  const void *dataPtr,
815  Size dataSize);
816 
825  OSErr
826  AEPutParamDesc(AppleEvent theAppleEvent, AEKeyword theAEKeyword,
827  const AEDesc *theAEDesc);
828 
837  OSErr
838  AEGetParamPtr(const AppleEvent *theAppleEvent, AEKeyword theAEKeyword,
839  DescType desiredType, DescType *typeCode, void *dataPtr,
840  Size maximumSize, Size *actualSize);
841 
850  OSErr
851  AEGetParamDesc(const AppleEvent *theAppleEvent, AEKeyword theAEKeyword,
852  DescType desiredType, AEDesc *result);
853 
862  OSErr
863  AESizeOfParam(const AppleEvent *theAppleEvent, AEKeyword theAEKeyword,
864  DescType *typeCode, Size *dataSize);
865 
874  OSErr
875  AEDeleteParam(AppleEvent *theAppleEvent, AEKeyword theAEKeyword);
876 
877  /***************************************************************************
878  The following calls also apply to type AppleEvent. Message attributes are
879  far more restricted, and can only be accessed through the following 5
880  calls. The various list and record routines cannot be used to access the
881  attributes of an event.
882  **************************************************************************/
891  OSErr
892  AEGetAttributePtr(const AppleEvent *theAppleEvent,
893  AEKeyword theAEKeyword, DescType desiredType,
894  DescType *typeCode, void *dataPtr, Size maximumSize,
895  Size *actualSize);
896 
903  OSErr
904  AEGetAttributeDesc(const AppleEvent *theAppleEvent, AEKeyword theAEKeyword,
905  DescType desiredType, AEDesc *result);
906 
913  OSErr
914  AESizeOfAttribute(const AppleEvent *theAppleEvent, AEKeyword theAEKeyword,
915  DescType *typeCode, Size *dataSize);
916 
925  OSErr
926  AEPutAttributePtr(AppleEvent *theAppleEvent, AEKeyword theAEKeyword,
927  DescType typeCode, const void *dataPtr, Size dataSize);
928 
937  OSErr
938  AEPutAttributeDesc(AppleEvent *theAppleEvent, AEKeyword theAEKeyword,
939  const AEDesc *theAEDesc);
940 
941  /***************************************************************************
942  AppleEvent Serialization Support
943 
944  AESizeOfFlattenedDesc, AEFlattenDesc, AEUnflattenDesc
945 
946  These calls will work for all AppleEvent data types and between different
947  versions of the OS (including between Mac OS 9 and X)
948 
949  Basic types, AEDesc, AEList and AERecord are OK, but AppleEvent records
950  that aren't basic may not be reliably flattened for storage.
951  **************************************************************************/
967  Size
968  AESizeOfFlattenedDesc(const AEDesc *theAEDesc);
969 
990  OSStatus
991  AEFlattenDesc(const AEDesc *theAEDesc, Ptr buffer, Size bufferSize,
992  Size actualSize);
993 
1010  OSStatus
1011  AEUnflattenDesc(Ptr buffer, AEDesc *result);
1012 
1013 /***************************************************************************
1014  The function calls are necessary to deal with opaque data in AEDescs, because
1015 the traditional way of dealing with a basic AEDesc has been to dereference the
1016 dataHandle directly. This is not supported under Carbon.
1017 **************************************************************************/
1018 #if ACCESSOR_CALLS_ARE_FUNCTIONS
1031  OSErr
1032  AEGetDescData(const AEDesc *theAEDesc, void *dataPtr, Size maximumSize);
1033 
1042  Size
1043  AEGetDescDataSize(const AEDesc *theAEDesc);
1044 
1053  OSErr
1054  AEReplaceDescData(DescType typeCode, const void *dataPtr, Size dataSize,
1055  AEDesc *theAEDesc);
1056 
1057 #endif
1059  /***************************************************************************
1060  A AEEventHandler is installed to process an AppleEvent
1061  **************************************************************************/
1062  typedef CALLBACK_API(OSErr,
1063  AEEventHandlerProcPtr)(const AppleEvent *theAppleEvent,
1064  AppleEvent *reply,
1065  long handlerRefcon);
1066  typedef STACK_UPP_TYPE(AEEventHandlerProcPtr) AEEventHandlerUPP;
1075  AEEventHandlerUPP
1076  NewAEEventHandlerUPP(AEEventHandlerProcPtr userRoutine);
1077 #if !OPAQUE_UPP_TYPES
1078  enum
1079  {
1080  uppAEEventHandlerProcInfo = 0x00000FE0
1081  };
1082 #ifdef __cplusplus
1083  inline AEEventHandlerUPP
1084  NewAEEventHandlerUPP(AEEventHandlerProcPtr userRoutine)
1085  {
1086  return (AEEventHandlerUPP)NewRoutineDescriptor((ProcPtr)(userRoutine),
1087  uppAEEventHandlerProcInfo,
1088  GetCurrentArchitecture());
1089  }
1090 #else
1091 #define NewAEEventHandlerUPP(userRoutine) \
1092  (AEEventHandlerUPP) \
1093  NewRoutineDescriptor((ProcPtr)(userRoutine), uppAEEventHandlerProcInfo, \
1094  GetCurrentArchitecture())
1095 #endif
1096 #endif
1097 
1106  void
1107  DisposeAEEventHandlerUPP(AEEventHandlerUPP userUPP);
1108 #if !OPAQUE_UPP_TYPES
1109 #ifdef __cplusplus
1110  inline void DisposeAEEventHandlerUPP(AEEventHandlerUPP userUPP)
1111  {
1112  DisposeRoutineDescriptor((UniversalProcPtr)userUPP);
1113  }
1114 #else
1115 #define DisposeAEEventHandlerUPP(userUPP) DisposeRoutineDescriptor(userUPP)
1116 #endif
1117 #endif
1118 
1127  OSErr
1129  long handlerRefcon, AEEventHandlerUPP userUPP);
1130 #if !OPAQUE_UPP_TYPES
1131 #ifdef __cplusplus
1132  inline OSErr InvokeAEEventHandlerUPP(const AppleEvent *theAppleEvent,
1133  AppleEvent *reply, long handlerRefcon,
1134  AEEventHandlerUPP userUPP)
1135  {
1136  return (OSErr)CALL_THREE_PARAMETER_UPP(userUPP, uppAEEventHandlerProcInfo,
1137  theAppleEvent, reply, handlerRefcon);
1138  }
1139 #else
1140 #define InvokeAEEventHandlerUPP(theAppleEvent, reply, handlerRefcon, userUPP) \
1141  (OSErr) CALL_THREE_PARAMETER_UPP((userUPP), uppAEEventHandlerProcInfo, \
1142  (theAppleEvent), (reply), (handlerRefcon))
1143 #endif
1144 #endif
1145 
1146 #if CALL_NOT_IN_CARBON || OLDROUTINENAMES
1148 #define NewAEEventHandlerProc(userRoutine) NewAEEventHandlerUPP(userRoutine)
1149 #define CallAEEventHandlerProc(userRoutine, theAppleEvent, reply, \
1150  handlerRefcon) \
1151  InvokeAEEventHandlerUPP(theAppleEvent, reply, handlerRefcon, userRoutine)
1152 #endif
1154 #if PRAGMA_STRUCT_ALIGN
1155 #pragma options align = reset
1156 #elif PRAGMA_STRUCT_PACKPUSH
1157 #pragma pack(pop)
1158 #elif PRAGMA_STRUCT_PACK
1159 #pragma pack()
1160 #endif
1161 
1162 #ifdef PRAGMA_IMPORT_OFF
1163 #pragma import off
1164 #elif PRAGMA_IMPORT
1165 #pragma import reset
1166 #endif
1167 
1168 #ifdef __cplusplus
1169 }
1170 #endif
1171 
1172 #endif
@ keyOriginalAddressAttr
Definition: AEDataModel.h:142
@ keyEventSourceAttr
Definition: AEDataModel.h:138
@ keyAcceptTimeoutAttr
Definition: AEDataModel.h:143
@ keyMissedKeywordAttr
Definition: AEDataModel.h:140
OSErr AEGetNthDesc(const AEDescList *theAEDescList, long index, DescType desiredType, AEKeyword *theAEKeyword, AEDesc *result)
AEDescList AERecord
Definition: AEDataModel.h:191
OSErr AEPutAttributePtr(AppleEvent *theAppleEvent, AEKeyword theAEKeyword, DescType typeCode, const void *dataPtr, Size dataSize)
OSErr AESizeOfNthItem(const AEDescList *theAEDescList, long index, DescType *typeCode, Size *dataSize)
AEDesc AEDescList
Definition: AEDataModel.h:189
OSStatus AEUnflattenDesc(Ptr buffer, AEDesc *result)
OSErr AEPutParamDesc(AppleEvent theAppleEvent, AEKeyword theAEKeyword, const AEDesc *theAEDesc)
OSErr InvokeAEEventHandlerUPP(const AppleEvent *theAppleEvent, AppleEvent *reply, long handlerRefcon, AEEventHandlerUPP userUPP)
typedef CALLBACK_API(OSErr, AEEventHandlerProcPtr)(const AppleEvent *theAppleEvent
OSErr AEGetArray(const AEDescList *theAEDescList, AEArrayType arrayType, AEArrayDataPointer arrayPtr, Size maximumSize, DescType *itemType, Size *itemSize, long *itemCount)
OSErr AEPutArray(AEDescList *theAEDescList, AEArrayType arrayType, const AEArrayData *arrayPtr, DescType itemType, Size itemSize, long itemCount)
void DisposeAEEventHandlerUPP(AEEventHandlerUPP userUPP)
OSErr AESizeOfParam(const AppleEvent *theAppleEvent, AEKeyword theAEKeyword, DescType *typeCode, Size *dataSize)
ResType DescType
Definition: AEDataModel.h:165
OSStatus AEFlattenDesc(const AEDesc *theAEDesc, Ptr buffer, Size bufferSize, Size actualSize)
#define NewAEEventHandlerUPP(userRoutine)
Definition: AEDataModel.h:1091
OSErr AEPutAttributeDesc(AppleEvent *theAppleEvent, AEKeyword theAEKeyword, const AEDesc *theAEDesc)
Boolean AECheckIsRecord(const AEDesc *theDesc)
OSErr AEGetAttributeDesc(const AppleEvent *theAppleEvent, AEKeyword theAEKeyword, DescType desiredType, AEDesc *result)
OSErr AEDeleteParam(AppleEvent *theAppleEvent, AEKeyword theAEKeyword)
OSErr AEGetParamPtr(const AppleEvent *theAppleEvent, AEKeyword theAEKeyword, DescType desiredType, DescType *typeCode, void *dataPtr, Size maximumSize, Size *actualSize)
OSErr AESizeOfAttribute(const AppleEvent *theAppleEvent, AEKeyword theAEKeyword, DescType *typeCode, Size *dataSize)
AERecord AppleEvent
Definition: AEDataModel.h:195
OSErr AECreateAppleEvent(AEEventClass theAEEventClass, AEEventID theAEEventID, const AEAddressDesc *target, AEReturnID returnID, AETransactionID transactionID, AppleEvent *result)
@ kAutoGenerateReturnID
Definition: AEDataModel.h:158
@ kAnyTransactionID
Definition: AEDataModel.h:161
OSErr AEPutPtr(AEDescList *theAEDescList, long index, DescType typeCode, const void *dataPtr, Size dataSize)
AEDataStorageType * AEDataStorage
Definition: AEDataModel.h:173
OSErr AECountItems(const AEDescList *theAEDescList, long *theCount)
Count number of descriptor records in a descriptor list.
OSErr AEDeleteItem(AEDescList *theAEDescList, long index)
OSErr AEGetNthPtr(const AEDescList *theAEDescList, long index, DescType desiredType, AEKeyword *theAEKeyword, DescType *typeCode, void *dataPtr, Size maximumSize, Size *actualSize)
AEDesc AEAddressDesc
Definition: AEDataModel.h:193
Size AESizeOfFlattenedDesc(const AEDesc *theAEDesc)
OSErr AEPutDesc(AEDescList *theAEDescList, long index, const AEDesc *theAEDesc)
OSErr AEGetParamDesc(const AppleEvent *theAppleEvent, AEKeyword theAEKeyword, DescType desiredType, AEDesc *result)
OSErr AEPutParamPtr(AppleEvent *theAppleEvent, AEKeyword theAEKeyword, DescType typeCode, const void *dataPtr, Size dataSize)
OSErr AEGetAttributePtr(const AppleEvent *theAppleEvent, AEKeyword theAEKeyword, DescType desiredType, DescType *typeCode, void *dataPtr, Size maximumSize, Size *actualSize)
Basic Macintosh data types.
#define NULL
Definition: MacTypes.h:61
unsigned char Boolean
Definition: MacTypes.h:318
Mixed Mode Manager Interfaces.
void DisposeRoutineDescriptor(UniversalProcPtr theUPP)
#define STACK_UPP_TYPE(name)
Definition: MixedMode.h:734
UniversalProcPtr NewRoutineDescriptor(ProcPtr theProc, ProcInfoType theProcInfo, ISAType theISA)
Definition: AEDataModel.h:175
Definition: AEDataModel.h:182