home *** CD-ROM | disk | FTP | other *** search
- /*
- File: SEUtils.h
-
- Contains: Interface to Semantic Events Utility Functions
-
- Owned by: Nick Pilch
-
- Copyright: © 1993 - 1995 by Apple Computer, Inc., all rights reserved.
-
-
- In Progress:
-
- */
-
- #ifndef _SEUTILS_
- #define _SEUTILS_
-
- #ifndef _ODTYPES_
- #include "ODTypes.h"
- #endif
-
- #ifndef SOM_ODPart_xh
- #include "Part.xh"
- #endif
-
- //#ifndef _SEMTINTF_
- //#include "SemtIntf.h"
- //#endif
-
- // the type should determine how many bytes are moved....
-
- class ODAppleEvent;
- class ODNameResolver;
- class ODOSLToken;
-
- #define SETBYTESOFHANDLE(h,typ,data,skipbytes) \
- *((typ*)((*(h))+(skipbytes))) = (data) \
-
- #define GETBYTESOFHANDLE(h,typ,skipbytes) \
- *((typ*)((*(h))+(skipbytes))) \
-
- #define SETFIRSTBYTESOFHANDLE(h,typ,data) \
- SETBYTESOFHANDLE(h,typ,data,0) \
-
- #define FIRSTBYTESFROMHANDLE(h, typ) \
- GETBYTESOFHANDLE(h,typ,0) \
-
- const Boolean kFromTypeIsDesc = kODTrue;
- const Boolean kFromTypeIsPtr = kODFalse;
- const Boolean kIsSysHandler = kODTrue;
-
- const ODSLong kODCountProcSwapValue = -1;
-
- #define NULL_DESCRIPTOR_DEFINITION {typeNull, NULL}
-
- extern "C" {
-
- ODBoolean MissingParams(const AppleEvent* message);
- OSErr DecodeOrdinal(AEDesc ordData, long count, long* index,
- Boolean* allFlag, Boolean* zeroFlag);
- ODSLong GetSLongAttr(AppleEvent* ae, AEKeyword keyword);
- ODSLong GetSLongAttrOD(ODAppleEvent* ae, AEKeyword keyword);
-
- // does an in-place coercion!
- void ThrowIfCantCoerce( AEDesc* data, DescType desiredType ) ;
- void ThrowIfNotAbsent( OSErr err ) ;
- ODSLong CountEmbeddedParts(Environment* ev, ODPart* prt);
-
- void UpdateUserToken(Environment* ev, ODNameResolver* resolver,
- ODOSLToken* odToken, AEDesc* desc);
- // Update the user token in odToken with data in desc. desc is disposed.
-
- // do a double-dispose of AppleEvents that are copies of what might be
- // send-to-self events, since copies of these (eg. what you get when you
- // call ODDescToAEDesc) cannot be disposed with a single call to AEDisposeDesc.
- OSErr ODDisposeAppleEvent( AppleEvent* aevt );
- }
-
- #endif // _SEUTILS_
-