home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / warphead.zip / H / SEUTILS.H < prev    next >
C/C++ Source or Header  |  1997-02-28  |  3KB  |  112 lines

  1. /*====START_GENERATED_PROLOG======================================
  2.  */
  3. /*
  4.  *   COMPONENT_NAME: odutils
  5.  *
  6.  *   CLASSES: none
  7.  *
  8.  *   ORIGINS: 82,27
  9.  *
  10.  *
  11.  *   (C) COPYRIGHT International Business Machines Corp. 1995,1996
  12.  *   All Rights Reserved
  13.  *   Licensed Materials - Property of IBM
  14.  *   US Government Users Restricted Rights - Use, duplication or
  15.  *   disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  16.  *       
  17.  *   IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  18.  *   ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  19.  *   PURPOSE. IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  20.  *   CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
  21.  *   USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  22.  *   OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
  23.  *   OR PERFORMANCE OF THIS SOFTWARE.
  24.  */
  25. /*====END_GENERATED_PROLOG========================================
  26.  */
  27. /* @(#) 1.4 com/src/utils/include/SEUtils.h, odutils, od96os2, odos29646d 10/30/96 20:23:22 [11/15/96 15:29:02] */
  28. /*
  29.     File:        SEUtils.h
  30.  
  31.     Contains:    Interface to Semantic Events Utility Functions
  32.  
  33.     Owned by:    Nick Pilch
  34.  
  35.     Copyright:    ⌐ 1993 - 1995 by Apple Computer, Inc., all rights reserved.
  36.  
  37.     
  38.     In Progress:
  39.         
  40. */
  41.  
  42. #ifndef _SEUTILS_
  43. #define _SEUTILS_
  44.  
  45. #ifndef _ODTYPES_
  46. #include "ODTypes.h"
  47. #endif
  48. #if defined(_PLATFORM_WIN32_)
  49. #ifndef _ODTYPESP_
  50. #include "ODTypesP.h"
  51. #endif
  52. #endif // defined(_PLATFORM_WIN32_)
  53.  
  54. #ifndef SOM_ODPart_xh
  55. #include "Part.xh"
  56. #endif
  57.  
  58. //#ifndef _SEMTINTF_
  59. //#include "SemtIntf.h"
  60. //#endif
  61.  
  62. // the type should determine how many bytes are moved....
  63.  
  64. class ODAppleEvent;
  65. class ODNameResolver;
  66. class ODOSLToken;
  67.  
  68. #define SETBYTESOFHANDLE(h,typ,data,skipbytes)                            \
  69.     *((typ*)((*(h))+(skipbytes))) = (data)                                \
  70.  
  71. #define GETBYTESOFHANDLE(h,typ,skipbytes)                                \
  72.     *((typ*)((*(h))+(skipbytes)))                                        \
  73.  
  74. #define SETFIRSTBYTESOFHANDLE(h,typ,data)                                \
  75.     SETBYTESOFHANDLE(h,typ,data,0)                                        \
  76.  
  77. #define FIRSTBYTESFROMHANDLE(h, typ)                                    \
  78.         GETBYTESOFHANDLE(h,typ,0)                                        \
  79.  
  80. const Boolean kFromTypeIsDesc = kODTrue;
  81. const Boolean kFromTypeIsPtr = kODFalse;
  82. const Boolean kIsSysHandler = kODTrue;
  83.  
  84. const ODSLong kODCountProcSwapValue = -1;
  85.  
  86. #define NULL_DESCRIPTOR_DEFINITION {typeNull, NULL}
  87.  
  88. extern "C" {
  89.  
  90. ODBoolean MissingParams(const AppleEvent* message);
  91. OSErr DecodeOrdinal(AEDesc ordData, long count, long* index,
  92.                     Boolean* allFlag, Boolean* zeroFlag);
  93. ODSLong GetSLongAttr(AppleEvent* ae, AEKeyword keyword);
  94. ODSLong GetSLongAttrOD(ODAppleEvent* ae, AEKeyword keyword);
  95.  
  96. // does an in-place coercion!
  97. void ThrowIfCantCoerce( AEDesc* data, DescType desiredType ) ;
  98. void ThrowIfNotAbsent( OSErr err ) ;
  99. ODSLong CountEmbeddedParts(Environment* ev, ODPart* prt);
  100.  
  101. void UpdateUserToken(Environment* ev, ODNameResolver* resolver,
  102.                         ODOSLToken* odToken, AEDesc* desc);
  103.     // Update the user token in odToken with data in desc. desc is disposed.
  104.  
  105. // do a double-dispose of AppleEvents that are copies of what might be
  106. // send-to-self events, since copies of these (eg. what you get when you
  107. // call ODDescToAEDesc) cannot be disposed with a single call to AEDisposeDesc.
  108. OSErr ODDisposeAppleEvent( AppleEvent* aevt );
  109. }
  110.  
  111. #endif // _SEUTILS_
  112.