home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc / OpenDoc Development / Debugging Support / OpenDoc™ Source Code / Utilities / SIHelper.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1996-08-28  |  35.6 KB  |  1,281 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        SIHelper.cpp
  3.  
  4.     Contains:    xxx put contents here xxx
  5.  
  6.     Owned by:    Nick Pilch
  7.  
  8.     Copyright:    
  9.  
  10.     Change History (most recent first):
  11.  
  12.          <3>      1/8/96    TJ        Removed the duplicate function GetSLongAttr
  13.                                     that caused a build break on 68K.
  14.          <2>     5/01/96    NP        1269380: Call ODDisposeAppleEvent, not
  15.                                     AEDisposeDesc to eliminate memory leak.
  16.  
  17.     To Do:
  18. */
  19.  
  20. /*
  21.     File:        SIHelper.cpp
  22.  
  23.     Contains:    Implementation of Mac C++ version of SemanticInterface helper
  24.                 class
  25.  
  26.     Owned by:    Nick Pilch
  27.  
  28.     Copyright:    © 1994 - 1996 by Apple Computer, Inc., all rights reserved.
  29.  
  30.     
  31.     In Progress:
  32. */
  33.  
  34. #ifndef SOM_ODSession_xh
  35. #include "ODSessn.xh"
  36. #endif
  37.  
  38. #ifndef SOM_ODSemanticInterface_xh
  39. #include "SemtIntB.xh"
  40. #endif
  41.  
  42. #ifndef SOM_ODNameResolver_xh
  43. #include "NamRslvr.xh"
  44. #endif
  45.  
  46. #ifndef SOM_ODAppleEvent_xh
  47. #include "ODAplEvt.xh"
  48. #endif
  49.  
  50. #ifndef SOM_ODOSLToken_xh
  51. #include "ODOSLTkn.xh"
  52. #endif
  53.  
  54. #ifndef _SIHELPER_
  55. #include "SIHelper.h"
  56. #endif
  57.  
  58. #ifndef _SIHSHTBL_
  59. #include "SIHshTbl.h"
  60. #endif
  61.  
  62. #ifndef _EXCEPT_
  63. #include "Except.h"
  64. #endif
  65.  
  66. #ifndef _ODMEMORY_
  67. #include "ODMemory.h"
  68. #endif
  69.  
  70. #ifndef __AEOBJECTS__
  71. #include "AEObjects.h"
  72. #endif
  73.  
  74. #ifndef __ERRORS__
  75. #include "Errors.h"
  76. #endif
  77.  
  78. #ifndef __ODDESUTL__
  79. #include "ODDesUtl.h"
  80. #endif
  81.  
  82. #ifndef __SEUTILS__
  83. #include "SEUtils.h"
  84. #endif
  85.  
  86. #pragma segment SIHelper
  87.  
  88. //==============================================================================
  89. // Implementation Notes
  90. //==============================================================================
  91.  
  92. /*
  93. Cover routines for AppleEvent Manager and OSL routines try to mimic these
  94. routines exactly. I consulted the source code for the AE Mgr and the OSL to do
  95. this.
  96. */
  97.  
  98. //==============================================================================
  99. // Local Types
  100. //==============================================================================
  101.  
  102. struct SIGenericKey
  103. {
  104.     ODDescType        key1;
  105.     ODDescType        key2;
  106. };
  107.  
  108. struct SIGenericValue
  109. {
  110.     UniversalProcPtr    handler;
  111.     ODSLong                refCon;
  112.     ODBoolean            fromTypeIsDesc;
  113. };
  114.  
  115. struct SIEventHandlerKey
  116. {
  117.     ODEventClass    eventClass;
  118.     ODEventID        eventID;
  119. };
  120.  
  121. struct SIEventHandlerValue
  122. {
  123.     ODEventHandlerUPP    handler;
  124.     ODSLong                refCon;
  125. };
  126.  
  127. struct SIObjectAccessorKey
  128. {
  129.     ODDescType        desiredClass;
  130.     ODDescType        containerType;
  131. };
  132.  
  133. struct SIObjectAccessorValue
  134. {
  135.     ODObjectAccessorUPP    accessor;
  136.     ODSLong                refCon;
  137. };
  138.  
  139. struct SICoercionHandlerKey
  140. {
  141.     ODDescType        fromType;
  142.     ODDescType        toType;
  143. };
  144.  
  145. struct SICoercionHandlerValue
  146. {
  147.     ODCoercionHandlerUPP    handler;
  148.     ODSLong                    refCon;
  149.     ODBoolean                fromTypeIsDesc;
  150. };
  151.  
  152. //==============================================================================
  153. // Constants
  154. //==============================================================================
  155.  
  156. // for hash tables
  157.  
  158. const ODULong    kNumInitialSIHashTableEntries = 8;
  159.  
  160. const ODBoolean    kNotInSystemHeap = false;
  161.  
  162. const ODBoolean    kODSEUnusedBoolParam = 0;
  163.  
  164. //------------------------------------------------------------------------------
  165. // Functions
  166. //------------------------------------------------------------------------------
  167.  
  168. //------------------------------------------------------------------------------
  169. // NewSIHashTable
  170. //
  171. //    Creates, initializes and returns new SIHashTable object.
  172. //------------------------------------------------------------------------------
  173.  
  174. static SIHashTable* NewSIHashTable()
  175. {
  176.     SIHashTable*    table = new SIHashTable;
  177.     table->Initialize(kNumInitialSIHashTableEntries, sizeof(SIEventHandlerKey),
  178.                         sizeof(SIEventHandlerValue), kNotInSystemHeap);
  179.     return table;
  180. }
  181.  
  182. //------------------------------------------------------------------------------
  183. // NewSICoercionHashTable
  184. //
  185. //    Creates, initializes and returns new SIHashTable object.
  186. //------------------------------------------------------------------------------
  187.  
  188. static SIHashTable* NewSICoercionHashTable()
  189. {
  190.     SIHashTable*    table = new SIHashTable;
  191.     table->Initialize(kNumInitialSIHashTableEntries, sizeof(SICoercionHandlerKey),
  192.                         sizeof(SICoercionHandlerValue), kNotInSystemHeap);
  193.     return table;
  194. }
  195.  
  196. //------------------------------------------------------------------------------
  197. // ThrowIfBadHandler
  198. //
  199. //    Throws paramErr if the handler is odd or null.
  200. //------------------------------------------------------------------------------
  201.  
  202. static void ThrowIfBadHandler(UniversalProcPtr proc)
  203. {
  204.     if ((proc == (UniversalProcPtr)kODNULL)
  205.             || ((ODULong)proc & 1))
  206.         THROW(paramErr);
  207. }
  208.  
  209. //------------------------------------------------------------------------------
  210. // ReturnCallbackFuncCaller
  211. //------------------------------------------------------------------------------
  212.  
  213. //extern "C" {
  214.  
  215. //CallbackCallerProc ReturnCallbackFuncCaller(OSLCallbackSelector whichCallback);
  216.  
  217. //}
  218.  
  219. //==============================================================================
  220. // SIHelper
  221. //==============================================================================
  222.  
  223. //------------------------------------------------------------------------------
  224. // SIHelper::SIHelper
  225. //------------------------------------------------------------------------------
  226.  
  227. SIHelper::SIHelper()
  228. {
  229.     fEventHandlerTable         = kODNULL;
  230.     fObjectAccessorTable    = kODNULL;
  231.     fCoercionHandlerTable    = kODNULL;
  232.  
  233.     fCountProcPtr             = (ODCountUPP)kODNULL;
  234.     fCompareProcPtr             = (ODCompareUPP)kODNULL;
  235.     fDisposeTokenProcPtr    = (ODDisposeTokenUPP)kODNULL;
  236.     fErrDescProcPtr         = (ODGetErrDescUPP)kODNULL;
  237.     fGetMarkTokenProcPtr     = (ODGetMarkTokenUPP)kODNULL;
  238.     fMarkProcPtr            = (ODMarkUPP)kODNULL;
  239.     fAdjustMarksProcPtr     = (ODAdjustMarksUPP)kODNULL;
  240.     fPreDispatchProcPtr     = (ODPreDispatchUPP)kODNULL;
  241.     
  242.     fTokenInquiryProc         = (ODTokenInquiryUPP)kODNULL;
  243.  
  244.     fOSLSupportFlags = kAEIDoMinimum;
  245.  
  246.     fSemanticInterface = (ODSemanticInterface*)kODNULL;
  247. //    fNameResolver = kODNULL;
  248. }
  249.  
  250. //------------------------------------------------------------------------------
  251. // SIHelper::InitSIHelper
  252. //------------------------------------------------------------------------------
  253.  
  254. void SIHelper::InitSIHelper(ODSession* session, ODSemanticInterface* helpee)
  255. {
  256.     fSemanticInterface = helpee;
  257.  
  258.     fEventHandlerTable = NewSIHashTable();
  259.     fObjectAccessorTable = NewSIHashTable();
  260.     fCoercionHandlerTable = NewSICoercionHashTable();
  261.     
  262.     fNameResolver = session->GetNameResolver(somGetGlobalEnvironment());
  263. }
  264.  
  265. //------------------------------------------------------------------------------
  266. // SIHelper::~SIHelper
  267. //------------------------------------------------------------------------------
  268.  
  269. SIHelper::~SIHelper()
  270. {
  271.     if ( fEventHandlerTable )
  272.         delete fEventHandlerTable;
  273.  
  274.     if ( fObjectAccessorTable )
  275.         delete fObjectAccessorTable;
  276.  
  277.     if ( fCoercionHandlerTable )
  278.         delete fCoercionHandlerTable;
  279. }
  280.  
  281. //------------------------------------------------------------------------------
  282. // SIHelper::ThrowProcNotFound
  283. //
  284. //    Throws the error code according to the type of proc that wasn't found.
  285. //    errAEHandlerNotFound for coercion handlers and event handlers and
  286. //    errAEAccessorNotFound for object accessors.
  287. //------------------------------------------------------------------------------
  288.  
  289. void SIHelper::ThrowProcNotFound(SIHashTable* table)
  290. {
  291.     if (table == fObjectAccessorTable)
  292.         THROW(errAEAccessorNotFound);
  293.     else
  294.         THROW(errAEHandlerNotFound);
  295. }
  296.  
  297. //------------------------------------------------------------------------------
  298. // SIHelper::AddToTable
  299. //
  300. //    Adds a proc ptr to one of our SIHashTables. fromTypeIsDesc is only used
  301. //    when adding a coercion handler. fCoercionHandlerTable knows this.
  302. //
  303. //    For event handlers: key1 = AEEventClass, key2 = AEEventID
  304. //    For coercion handlers: key1 = fromType, key2 = toType
  305. //    For object accessors: key1 = desiredClass, key2 = containerClass
  306. //------------------------------------------------------------------------------
  307.  
  308. void SIHelper::AddToTable(DescType key1, DescType key2,
  309.                                             UniversalProcPtr    handler,
  310.                                             ODSLong        handlerRefCon,
  311.                                             ODBoolean        fromTypeIsDesc,
  312.                                             SIHashTable*    table)
  313. {
  314.     SIGenericKey    theKey;
  315.     SIGenericValue    theValue;
  316.     
  317.     ThrowIfBadHandler(handler);
  318.     
  319.     theKey.key1 = key1;
  320.     theKey.key2 = key2;
  321.     
  322.     theValue.handler = handler;
  323.     theValue.refCon = handlerRefCon;
  324.     theValue.fromTypeIsDesc = fromTypeIsDesc;
  325.     
  326.     table->ReplaceEntry((ODKeyPtr)&theKey, (ODEntryPtr)&theValue);
  327. }
  328.  
  329. //------------------------------------------------------------------------------
  330. // SIHelper::RetrieveFromTable
  331. //
  332. //    Retrieves a proc ptr from one of our SIHashTables. fromTypeIsDesc is only used
  333. //    when adding a coercion handler. fCoercionHandlerTable knows this.
  334. //
  335. //    For event handlers: key1 = AEEventClass, key2 = AEEventID
  336. //    For coercion handlers: key1 = fromType, key2 = toType
  337. //    For object accessors: key1 = desiredClass, key2 = containerClass
  338. //------------------------------------------------------------------------------
  339.  
  340. void SIHelper::RetrieveFromTable(DescType key1, DescType key2,
  341.                                                 UniversalProcPtr*        handler,
  342.                                                 ODSLong*        handlerRefCon,
  343.                                                 ODBoolean*        fromTypeIsDesc,
  344.                                                 SIHashTable*    table)
  345. {
  346.     SIGenericKey    theKey;
  347.     SIGenericValue    theValue;
  348.     
  349.     theKey.key1 = key1;
  350.     theKey.key2 = key2;
  351.     
  352.     if (table->GetValue((ODKeyPtr)&theKey, (ODEntryPtr)&theValue) != kODFalse)
  353.     {
  354.         *handler = theValue.handler;
  355.         *handlerRefCon = theValue.refCon;
  356.         *fromTypeIsDesc = theValue.fromTypeIsDesc;
  357.     }
  358.     else
  359.         ThrowProcNotFound(table);
  360. }
  361.  
  362. //------------------------------------------------------------------------------
  363. // SIHelper::RemoveFromTable
  364. //
  365. //    Removes a proc ptr from one of our SIHashTables. fromTypeIsDesc is only
  366. //    used when adding a coercion handler. fCoercionHandlerTable knows this.
  367. //
  368. //    For event handlers: key1 = AEEventClass, key2 = AEEventID
  369. //    For coercion handlers: key1 = fromType, key2 = toType
  370. //    For object accessors: key1 = desiredClass, key2 = containerClass
  371. //------------------------------------------------------------------------------
  372.  
  373. void SIHelper::RemoveFromTable(DescType            key1,
  374.                                                 DescType        key2,
  375.                                                 UniversalProcPtr    handler,
  376.                                                 SIHashTable*    table)
  377. {
  378.     SIGenericKey    theKey;
  379.     SIGenericValue    theValue;
  380.     ODBoolean        result;
  381.     
  382.     theKey.key1 = key1;
  383.     theKey.key2 = key2;
  384.     
  385.     result = table->GetValue((ODKeyPtr)&theKey, (ODEntryPtr)&theValue);
  386.  
  387.     if (result)
  388.     {
  389.         if (theValue.handler == (UniversalProcPtr)kODNULL
  390.             || theValue.handler == handler)
  391.             table->RemoveEntry((ODKeyPtr)&theKey);
  392.         else
  393.             ThrowProcNotFound(table);
  394.     }
  395.     else
  396.         ThrowProcNotFound(table);
  397. }
  398.  
  399. //------------------------------------------------------------------------------
  400. // SIHelper::CallEventHandler
  401. //------------------------------------------------------------------------------
  402.  
  403. ODError SIHelper::CallEventHandler(
  404.                                     ODPart* thePart,
  405.                                     ODAppleEvent* theODAppleEvent,
  406.                                     ODAppleEvent* reply)
  407. {
  408.     OSErr                result = noErr;
  409.     ODSLong                handlerRefCon;
  410.     AEEventClass        eventClass;
  411.     AEEventID            eventID;
  412.     ODEventHandlerUPP    proc;
  413.     AppleEvent            realEvent;
  414.  
  415.     TRY
  416.         ODDescToAEDesc(theODAppleEvent, &realEvent);
  417.         eventClass = (AEEventClass)GetSLongAttr(&realEvent,
  418.                                                 keyEventClassAttr);
  419.         eventID = (AEEventID)GetSLongAttr(&realEvent,
  420.                                             keyEventIDAttr);
  421.  
  422.         if (this->LookupEventHandler(eventClass, eventID, &proc,
  423.                                                     &handlerRefCon))
  424.         {
  425.             TRY // 1245972 - don't need to put exception handling here anymore.
  426.                 result = (OSErr)CallODEventHandlerProc(proc, thePart,
  427.                                                         theODAppleEvent,
  428.                                                         reply,
  429.                                                         handlerRefCon);
  430.             CATCH_ALL
  431.                 result = ErrorCode();
  432.             ENDTRY
  433.         }
  434.         else
  435.             result = errAEEventNotHandled;
  436.  
  437.         ODDisposeAppleEvent(&realEvent);
  438.     CATCH_ALL
  439.         result =  errAEEventNotHandled;
  440.     ENDTRY
  441.     
  442.     return result;
  443. }
  444.  
  445. //------------------------------------------------------------------------------
  446. // SIHelper::CallPredispatchProc
  447. //------------------------------------------------------------------------------
  448.  
  449. ODError SIHelper::CallPredispatchProc(
  450.                                     ODPart* thePart,
  451.                                     ODAppleEvent* theODAppleEvent,
  452.                                     ODAppleEvent* reply)
  453. {
  454.     OSErr    error;
  455.  
  456.     if (fPreDispatchProcPtr)
  457.         error = CallODPreDispatchProc(fPreDispatchProcPtr, thePart,
  458.                                         theODAppleEvent, reply,
  459.                                         fPreDispatchProcPtrRefCon);
  460.     else
  461.         error = errAEEventNotHandled;
  462.     
  463.     return error;
  464. }
  465.  
  466. //------------------------------------------------------------------------------
  467. // SIHelper::CallCoercionHandler
  468. //------------------------------------------------------------------------------
  469.  
  470. ODError SIHelper::CallCoercionHandler(
  471.                                         ODPart* thePart,
  472.                                         ODDesc* theODDesc,
  473.                                         ODDescType toType,
  474.                                         ODDesc* retDesc)
  475. {
  476.     OSErr                    result;
  477.     ODCoercionHandlerUPP    proc;
  478.     ODSLong                    refCon;
  479.     ODBoolean                fromTypeIsDesc;
  480.     AEDesc                    realInDesc;
  481.     AEDesc                    realOutDesc;
  482.  
  483.     ODDescToAEDesc(theODDesc, &realInDesc);
  484.     ODDescToAEDesc(retDesc, &realOutDesc);
  485.     if (this->LookupCoercionHandler(realInDesc.descriptorType, toType,
  486.                                     &proc, &refCon, &fromTypeIsDesc))
  487.     {
  488.         if (fromTypeIsDesc)
  489.         { // 1245972 - don't need to put exception handling here anymore.
  490.             TRY
  491.                 result = (OSErr)CallODDescCoercionHandlerProc(
  492.                                     (ODDescCoercionHandlerUPP)proc,
  493.                                     thePart,
  494.                                     theODDesc, toType,
  495.                                     refCon, retDesc);
  496.  
  497.             CATCH_ALL
  498.                 result = ErrorCode();
  499.             ENDTRY
  500.         }
  501.         else
  502.         {
  503.             ODLockHandle((ODHandle)realInDesc.dataHandle);
  504.             ODPtr dataPtr = *((ODPtr**)(realInDesc.dataHandle));
  505.             ODSize dataSize = ODGetHandleSize((ODHandle)realInDesc.dataHandle);
  506.  
  507.             // 1245972 - don't need to put exception handling here anymore.
  508.             TRY
  509.                 result = (OSErr)CallODPtrCoercionHandlerProc(
  510.                                     (ODPtrCoercionHandlerUPP)proc,
  511.                                     thePart,
  512.                                     realInDesc.descriptorType,
  513.                                     dataPtr, dataSize, toType,
  514.                                     refCon, retDesc);
  515.  
  516.             CATCH_ALL
  517.                 result = ErrorCode();
  518.             ENDTRY
  519.     
  520.             ODUnlockHandle((ODHandle)realInDesc.dataHandle);
  521.         }
  522.     }
  523.     else
  524.         result = errAECoercionFail;
  525.  
  526.     AEDisposeDesc(&realInDesc);
  527.     AEDisposeDesc(&realOutDesc);
  528.  
  529.     return result;
  530. }
  531.  
  532. //------------------------------------------------------------------------------
  533. // SIHelper::CallObjectAccessor
  534. //------------------------------------------------------------------------------
  535.  
  536. ODError SIHelper::CallObjectAccessor(
  537.                                         ODPart* thePart,
  538.                                         ODDescType desiredClass,
  539.                                         ODOSLToken* container,
  540.                                         ODDescType containerClass,
  541.                                         ODDescType form,
  542.                                         ODDesc* selectionData,
  543.                                         ODOSLToken* value)
  544. {
  545.     OSErr                result = noErr;
  546.     ODSLong                handlerRefCon;
  547.     ODObjectAccessorUPP    proc;
  548.     ODDesc*                userToken;
  549.     AEDesc                userAEToken;
  550.  
  551.     TRY
  552.  
  553.         /* THIS IS THE REAL CODE THAT SHOULD BE HERE. UNTIL WE ARE ALLOWED TO */
  554.         /* PASS THE SESSION TO INITSIHELPER, WE LIFT CODE FROM ELSEWHERE AND */
  555.         /* PLACE IT IN-LINE HERE. */
  556.  
  557.         userToken = fNameResolver->GetUserToken(somGetGlobalEnvironment(),
  558.                                                 container);
  559.         ODDescToAEDesc(userToken, &userAEToken);
  560.         DescType descType = userAEToken.descriptorType;
  561.         (void)AEDisposeDesc( &userAEToken );
  562.  
  563.         if (this->LookupObjectAccessor(desiredClass,
  564.                                         descType,
  565.                                         &proc, &handlerRefCon))
  566.         {
  567.             // 1245972 - don't need to put exception handling here anymore.
  568.             TRY
  569.                 result = (OSErr)CallODObjectAccessorProc(proc, thePart,
  570.                                                             desiredClass,
  571.                                                             container,
  572.                                                             containerClass,
  573.                                                             form, selectionData,
  574.                                                             value,
  575.                                                             handlerRefCon);
  576.             CATCH_ALL
  577.                 result = ErrorCode();
  578.             ENDTRY
  579.         }
  580.         else
  581.             result = errAEEventNotHandled;
  582.     CATCH_ALL
  583.         result =  errAEEventNotHandled;
  584.     ENDTRY
  585.     
  586.     return result;
  587. }
  588.  
  589. //------------------------------------------------------------------------------
  590. // SIHelper::CallCompareProc
  591. //------------------------------------------------------------------------------
  592.  
  593. ODError SIHelper::CallCompareProc(
  594.         ODPart* thePart,
  595.         ODDescType oper,
  596.         ODOSLToken* obj1,
  597.         ODOSLToken* obj2,
  598.         ODBoolean* result)
  599. {
  600.     OSErr    error;
  601.  
  602.     if (fCompareProcPtr)
  603.         error = CallODCompareProc(fCompareProcPtr, thePart, oper,
  604.                                     obj1, obj2, result, fCompareProcPtrRefCon);
  605.     else
  606.         error = errAEEventNotHandled;
  607.     
  608.     return error;
  609. }
  610.  
  611. //------------------------------------------------------------------------------
  612. // SIHelper::CallCountProc
  613. //------------------------------------------------------------------------------
  614.  
  615. ODError SIHelper::CallCountProc(
  616.         ODPart* thePart,
  617.         ODDescType desiredType,
  618.         ODDescType containerClass,
  619.         ODOSLToken* container,
  620.         ODSLong* result)
  621. {
  622.     OSErr    error;
  623.  
  624.     if (fCountProcPtr)
  625.         error = (OSErr)CallODCountProc(fCountProcPtr, thePart, desiredType,
  626.                                         containerClass, container,
  627.                                         result, fCountProcPtrRefCon);
  628.     else
  629.         error = errAEEventNotHandled;
  630.     
  631.     return error;
  632. }
  633.  
  634. //------------------------------------------------------------------------------
  635. // SIHelper::CallDisposeTokenProc
  636. //------------------------------------------------------------------------------
  637.  
  638. ODError SIHelper::CallDisposeTokenProc(
  639.         ODPart* thePart,
  640.         ODOSLToken* unneededToken)
  641. {
  642.     OSErr    error;
  643.  
  644.     if (fDisposeTokenProcPtr)
  645.         error = (OSErr)CallODDisposeTokenProc(fDisposeTokenProcPtr, thePart,
  646.                                                 unneededToken,
  647.                                                 fDisposeTokenProcPtrRefCon);
  648.     else
  649.         error = errAEEventNotHandled;
  650.     
  651.     return error;
  652. }
  653.  
  654. //------------------------------------------------------------------------------
  655. // SIHelper::CallGetErrDescProc
  656. //------------------------------------------------------------------------------
  657.  
  658. ODError SIHelper::CallGetErrDescProc(
  659.         ODPart* thePart,
  660.         ODDesc** errDesc)
  661. {
  662.     OSErr    error;
  663.  
  664.     if (fErrDescProcPtr)
  665.         error = (OSErr)CallODGetErrDescProc(fErrDescProcPtr, thePart, errDesc,
  666.                                             fErrDescProcPtrRefCon);
  667.     else
  668.         error = errAEEventNotHandled;
  669.     
  670.     return error;
  671. }
  672.  
  673. //------------------------------------------------------------------------------
  674. // SIHelper::CallGetMarkTokenProc
  675. //------------------------------------------------------------------------------
  676.  
  677. ODError SIHelper::CallGetMarkTokenProc(
  678.         ODPart* thePart,
  679.         ODOSLToken* dContainerToken,
  680.         ODDescType containerClass,
  681.         ODOSLToken* result)
  682. {
  683.     OSErr    error;
  684.  
  685.     if (fGetMarkTokenProcPtr)
  686.         error = (OSErr)CallODGetMarkTokenProc(fGetMarkTokenProcPtr, thePart,
  687.                                                 dContainerToken, containerClass,
  688.                                                 result,
  689.                                                 fGetMarkTokenProcPtrRefCon);
  690.     else
  691.         error = errAEEventNotHandled;
  692.     
  693.     return error;
  694. }
  695.  
  696. //------------------------------------------------------------------------------
  697. // SIHelper::CallMarkProc
  698. //------------------------------------------------------------------------------
  699.  
  700. ODError SIHelper::CallMarkProc(
  701.         ODPart* thePart,
  702.         ODOSLToken* dToken,
  703.         ODOSLToken* markToken,
  704.         ODSLong index)
  705. {
  706.     OSErr    error;
  707.  
  708.     if (fMarkProcPtr)
  709.         error = (OSErr)CallODMarkProc(fMarkProcPtr, thePart, dToken,
  710.                                                 markToken, index,
  711.                                                 fMarkProcPtrRefCon);
  712.     else
  713.         error = errAEEventNotHandled;
  714.     
  715.     return error;
  716. }
  717.  
  718. //------------------------------------------------------------------------------
  719. // SIHelper::CallAdjustMarksProc
  720. //------------------------------------------------------------------------------
  721.  
  722. ODError SIHelper::CallAdjustMarksProc(
  723.         ODPart* thePart,
  724.         ODSLong newStart,
  725.         ODSLong newStop,
  726.         ODOSLToken* markToken)
  727. {
  728.     OSErr    error;
  729.  
  730.     if (fAdjustMarksProcPtr)
  731.         error = (OSErr)CallODAdjustMarksProc(fAdjustMarksProcPtr, thePart,
  732.                                                 newStart, newStop, markToken,
  733.                                                 fAdjustMarksProcPtrRefCon);
  734.     else
  735.         error = errAEEventNotHandled;
  736.     
  737.     return error;
  738. }
  739.  
  740. //------------------------------------------------------------------------------
  741. // SIHelper::InstallObjectAccessor
  742. //------------------------------------------------------------------------------
  743.  
  744. void SIHelper::InstallObjectAccessor(ODDescType                desiredClass,
  745.                                         ODDescType            containerType,
  746.                                         ODObjectAccessorUPP    theAccessor,
  747.                                         ODSLong            accessorRefcon)
  748. {
  749.     this->AddToTable(desiredClass, containerType, (UniversalProcPtr)theAccessor,
  750.                         accessorRefcon, kODSEUnusedBoolParam,
  751.                         fObjectAccessorTable);
  752. }
  753.  
  754. //------------------------------------------------------------------------------
  755. // SIHelper::GetObjectAccessor
  756. //------------------------------------------------------------------------------
  757.  
  758. void SIHelper::GetObjectAccessor(ODDescType                desiredClass,
  759.                                    ODDescType                containerType,
  760.                                    ODObjectAccessorUPP*    theAccessor,
  761.                                    ODSLong*            accessorRefcon)
  762. {
  763.     ODBoolean    unusedBoolParam;
  764.  
  765.     this->RetrieveFromTable(desiredClass, containerType,
  766.                             (UniversalProcPtr*)theAccessor, accessorRefcon,
  767.                             &unusedBoolParam, fObjectAccessorTable);
  768. }
  769.  
  770. //------------------------------------------------------------------------------
  771. // SIHelper::RemoveObjectAccessor
  772. //------------------------------------------------------------------------------
  773.  
  774. void SIHelper::RemoveObjectAccessor(ODDescType            desiredClass,
  775.                                       ODDescType                containerType,
  776.                                       ODObjectAccessorUPP        theAccessor)
  777. {
  778.     this->RemoveFromTable(desiredClass, containerType, (UniversalProcPtr)theAccessor,
  779.                             fObjectAccessorTable);
  780. }
  781.  
  782. //------------------------------------------------------------------------------
  783. // SIHelper::InstallCompareProc
  784. //------------------------------------------------------------------------------
  785.  
  786. void SIHelper::InstallCompareProc(ODCompareUPP    compareProc,
  787.                                     ODSLong        refCon)
  788. {
  789.     ThrowIfBadHandler((UniversalProcPtr)compareProc);
  790.  
  791.     fCompareProcPtr = compareProc;
  792.     fCompareProcPtrRefCon = refCon;
  793. }
  794.  
  795. //------------------------------------------------------------------------------
  796. // SIHelper::InstallCountProc
  797. //------------------------------------------------------------------------------
  798.  
  799. void SIHelper::InstallCountProc(ODCountUPP    countProc,
  800.                                 ODSLong    refCon)
  801. {
  802.     ThrowIfBadHandler((UniversalProcPtr)countProc);
  803.  
  804.     fCountProcPtr = countProc;
  805.     fCountProcPtrRefCon = refCon;
  806. }
  807.  
  808. //------------------------------------------------------------------------------
  809. // SIHelper::InstallDisposeTokenProc
  810. //------------------------------------------------------------------------------
  811.  
  812. void SIHelper::InstallDisposeTokenProc(ODDisposeTokenUPP    disposeTokenProc,
  813.                                         ODSLong                    refCon)
  814. {
  815.     ThrowIfBadHandler((UniversalProcPtr)disposeTokenProc);
  816.  
  817.     fDisposeTokenProcPtr = disposeTokenProc;
  818.     fDisposeTokenProcPtrRefCon = refCon;
  819. }
  820.  
  821. //------------------------------------------------------------------------------
  822. // SIHelper::InstallGetMarkTokenProc
  823. //------------------------------------------------------------------------------
  824.  
  825. void SIHelper::InstallGetMarkTokenProc(ODGetMarkTokenUPP    getMarkTokenProc,
  826.                                         ODSLong                refCon)
  827. {
  828.     ThrowIfBadHandler((UniversalProcPtr)getMarkTokenProc);
  829.  
  830.     fGetMarkTokenProcPtr = getMarkTokenProc;
  831.     fGetMarkTokenProcPtrRefCon = refCon;
  832. }
  833.  
  834. //------------------------------------------------------------------------------
  835. // SIHelper::InstallMarkProc
  836. //------------------------------------------------------------------------------
  837.  
  838. void SIHelper::InstallMarkProc(ODMarkUPP    markProc,
  839.                                 ODSLong    refCon)
  840. {
  841.     ThrowIfBadHandler((UniversalProcPtr)markProc);
  842.  
  843.     fMarkProcPtr = markProc;
  844.     fMarkProcPtrRefCon = refCon;
  845. }
  846.  
  847. //------------------------------------------------------------------------------
  848. // SIHelper::InstallAdjustMarksProc
  849. //------------------------------------------------------------------------------
  850.  
  851. void SIHelper::InstallAdjustMarksProc(ODAdjustMarksUPP    adjustMarksProc,
  852.                                         ODSLong                refCon)
  853. {
  854.     ThrowIfBadHandler((UniversalProcPtr)adjustMarksProc);
  855.  
  856.     fAdjustMarksProcPtr = adjustMarksProc;
  857.     fAdjustMarksProcPtrRefCon = refCon;
  858. }
  859.  
  860. //------------------------------------------------------------------------------
  861. // SIHelper::InstallGetErrDescProc
  862. //------------------------------------------------------------------------------
  863.  
  864. void SIHelper::InstallGetErrDescProc(ODGetErrDescUPP    errorDescProc,
  865.                                         ODSLong            refCon)
  866. {
  867.     ThrowIfBadHandler((UniversalProcPtr)errorDescProc);
  868.  
  869.     fErrDescProcPtr = errorDescProc;
  870.     fErrDescProcPtrRefCon = refCon;
  871. }
  872.  
  873. //------------------------------------------------------------------------------
  874. // SIHelper::InstallTokenInquiryProc
  875. //------------------------------------------------------------------------------
  876.  
  877. void SIHelper::InstallTokenInquiryProc(ODTokenInquiryUPP    tokenInquiryProc,
  878.                                         ODSLong            refCon)
  879. {
  880.     ThrowIfBadHandler((UniversalProcPtr)tokenInquiryProc);
  881.  
  882.     fTokenInquiryProc = tokenInquiryProc;
  883.     fTokenInquiryProcRefCon = refCon;
  884. }
  885.  
  886. //------------------------------------------------------------------------------
  887. // SIHelper::InstallEventHandler
  888. //------------------------------------------------------------------------------
  889.  
  890. void SIHelper::InstallEventHandler(    ODEventClass            theAEEventClass,
  891.                                     ODEventID                theAEEventID,
  892.                                     ODEventHandlerUPP        handler,
  893.                                     ODSLong                    handlerRefCon)
  894. {
  895.     this->AddToTable(theAEEventClass, theAEEventID, (UniversalProcPtr)handler,
  896.                         handlerRefCon, kODSEUnusedBoolParam,
  897.                         fEventHandlerTable);
  898. //    fSemanticInterface->ForwardEvent(somGetGlobalEnvironment(), (ODBoolean)mode,
  899. //                                        theAEEventClass, theAEEventID);
  900. }
  901.  
  902. //------------------------------------------------------------------------------
  903. // SIHelper::RemoveEventHandler
  904. //------------------------------------------------------------------------------
  905.  
  906. void SIHelper::RemoveEventHandler(ODEventClass                    theAEEventClass,
  907.                                           ODEventID                    theAEEventID,
  908.                                           ODEventHandlerUPP    handler)
  909. {
  910.     this->RemoveFromTable(theAEEventClass, theAEEventID, (UniversalProcPtr)handler,
  911.                             fEventHandlerTable);
  912. }
  913.     
  914. //------------------------------------------------------------------------------
  915. // SIHelper::GetEventHandler
  916. //------------------------------------------------------------------------------
  917.  
  918. void SIHelper::GetEventHandler(ODEventClass                theAEEventClass,
  919.                                        ODEventID                theAEEventID,
  920.                                        ODEventHandlerUPP*        handler,
  921.                                        ODSLong*                handlerRefcon)
  922. {
  923.     ODBoolean    unusedBoolParam;
  924.  
  925.     this->RetrieveFromTable(theAEEventClass, theAEEventID,
  926.                             (UniversalProcPtr*)handler, handlerRefcon,
  927.                             &unusedBoolParam, fEventHandlerTable);
  928. }
  929.     
  930. //------------------------------------------------------------------------------
  931. // SIHelper::InstallCoercionHandler
  932. //------------------------------------------------------------------------------
  933.  
  934. void SIHelper::InstallCoercionHandler(ODDescType                    fromType,
  935.                                       ODDescType                toType,
  936.                                       ODCoercionHandlerUPP    handler,
  937.                                       ODSLong                handlerRefCon,
  938.                                       ODBoolean            fromTypeIsDesc)
  939. {
  940.     this->AddToTable(fromType, toType, (UniversalProcPtr)handler, handlerRefCon,
  941.                         fromTypeIsDesc, fCoercionHandlerTable);
  942. }
  943.  
  944. //------------------------------------------------------------------------------
  945. // SIHelper::RemoveCoercionHandler
  946. //------------------------------------------------------------------------------
  947.  
  948. void SIHelper::RemoveCoercionHandler(ODDescType                fromType,
  949.                                              ODDescType            toType,
  950.                                              ODCoercionHandlerUPP    handler)
  951. {
  952.     this->RemoveFromTable(fromType, toType, (UniversalProcPtr)handler,
  953.                             fCoercionHandlerTable);
  954. }
  955.     
  956. //------------------------------------------------------------------------------
  957. // SIHelper::GetCoercionHandler
  958. //------------------------------------------------------------------------------
  959.  
  960. void SIHelper::GetCoercionHandler(ODDescType                    fromType,
  961.                                           ODDescType                toType,
  962.                                           ODCoercionHandlerUPP*    handler,
  963.                                           ODSLong*                handlerRefcon,
  964.                                           ODBoolean*            fromTypeIsDesc)
  965. {
  966.     this->RetrieveFromTable(fromType, toType, (UniversalProcPtr*)handler, handlerRefcon,
  967.                             fromTypeIsDesc, fCoercionHandlerTable);
  968. }
  969.     
  970. //------------------------------------------------------------------------------
  971. // SIHelper::InstallSpecialHandler
  972. //------------------------------------------------------------------------------
  973.  
  974. void SIHelper::InstallSpecialHandler(AEKeyword                    functionClass,
  975.                                         ODSpecialHandlerUPP    handler,
  976.                                         ODSLong                refCon)
  977. {
  978.     switch( functionClass )
  979.     {
  980.         case keyAECountProc:
  981.             fCountProcPtr = (ODCountUPP)handler;
  982.             fCountProcPtrRefCon = refCon;
  983.             break;
  984.         case keyAECompareProc:
  985.             fCompareProcPtr = (ODCompareUPP)handler;
  986.             fCompareProcPtrRefCon = refCon;
  987.             break;
  988.         case keyDisposeTokenProc:
  989.             fDisposeTokenProcPtr = (ODDisposeTokenUPP)handler;
  990.             fDisposeTokenProcPtrRefCon = refCon;
  991.             break;
  992.         case keyAEGetErrDescProc:
  993.             fErrDescProcPtr = (ODGetErrDescUPP)handler;
  994.             fErrDescProcPtrRefCon = refCon;
  995.             break;
  996.         case keyAEMarkTokenProc:
  997.             fGetMarkTokenProcPtr = (ODGetMarkTokenUPP)handler;
  998.             fGetMarkTokenProcPtrRefCon = refCon;
  999.             break;
  1000.         case keyAEMarkProc:
  1001.             fMarkProcPtr = (ODMarkUPP)handler;
  1002.             fMarkProcPtrRefCon = refCon;
  1003.             break;
  1004.         case keyAEAdjustMarksProc:
  1005.             fAdjustMarksProcPtr = (ODAdjustMarksUPP)handler;
  1006.             fAdjustMarksProcPtrRefCon = refCon;
  1007.             break;
  1008.         case keyPreDispatch:
  1009.             fPreDispatchProcPtr = (ODPreDispatchUPP)handler;
  1010.             fPreDispatchProcPtrRefCon = refCon;
  1011.             fSemanticInterface->UsingPredispatchProc(somGetGlobalEnvironment(),
  1012.                                                         kODTrue);
  1013. //            fMessageInterface->PreHandlerAdded((ODPart*)this->GetBase(),
  1014. //                                                (ODPreDispatchUPP)handler,
  1015. //                                                refCon);
  1016.             break;
  1017.         default:
  1018.             THROW( errAENotASpecialFunction );
  1019.             break;
  1020.     }
  1021. }
  1022.     
  1023. //------------------------------------------------------------------------------
  1024. // SIHelper::RemoveSpecialHandler
  1025. //------------------------------------------------------------------------------
  1026.  
  1027. void SIHelper::RemoveSpecialHandler(AEKeyword                    functionClass,
  1028.                                                 ODSpecialHandlerUPP    handler)
  1029. {
  1030.     switch( functionClass )
  1031.     {
  1032.         case keyAECountProc:
  1033.             if (handler == (ODSpecialHandlerUPP)fCountProcPtr)
  1034.                 fCountProcPtr = (ODCountUPP)kODNULL;
  1035.             break;
  1036.         case keyAECompareProc:
  1037.             if (handler == (ODSpecialHandlerUPP)fCompareProcPtr )
  1038.                 fCompareProcPtr = (ODCompareUPP)kODNULL;
  1039.             break;
  1040.         case keyDisposeTokenProc:
  1041.             if (handler == (ODSpecialHandlerUPP)fDisposeTokenProcPtr )
  1042.                 fDisposeTokenProcPtr = (ODDisposeTokenUPP)kODNULL;
  1043.             break;
  1044.         case keyAEGetErrDescProc:
  1045.             if (handler == (ODSpecialHandlerUPP)fErrDescProcPtr )
  1046.                 fErrDescProcPtr = (ODGetErrDescUPP)kODNULL;
  1047.             break;
  1048.         case keyAEMarkTokenProc:
  1049.             if (handler == (ODSpecialHandlerUPP)fGetMarkTokenProcPtr )
  1050.                 fGetMarkTokenProcPtr = (ODGetMarkTokenUPP)kODNULL;
  1051.             break;
  1052.         case keyAEMarkProc:
  1053.             if (handler == (ODSpecialHandlerUPP)fMarkProcPtr )
  1054.                 fMarkProcPtr = (ODMarkUPP)kODNULL;
  1055.             break;
  1056.         case keyAEAdjustMarksProc:
  1057.             if (handler == (ODSpecialHandlerUPP)fAdjustMarksProcPtr )
  1058.                 fAdjustMarksProcPtr = (ODAdjustMarksUPP)kODNULL;
  1059.             break;
  1060.         case keyPreDispatch:
  1061.             if (handler == (ODSpecialHandlerUPP)fPreDispatchProcPtr )
  1062.             {
  1063.                 fPreDispatchProcPtr = (ODPreDispatchUPP)kODNULL;
  1064.                 fSemanticInterface->UsingPredispatchProc(somGetGlobalEnvironment(),
  1065.                                                             kODFalse);
  1066. //                fMessageInterface->PreHandlerRemoved((ODPart*)this->GetBase(),
  1067. //                                                    (ODPreDispatchUPP)handler,
  1068. //                                                    fPreDispatchProcPtrRefCon);
  1069.             }
  1070.             break;
  1071.         default:
  1072.             THROW( errAENotASpecialFunction );
  1073.             break;
  1074.     }
  1075. }
  1076.     
  1077. //------------------------------------------------------------------------------
  1078. // SIHelper::GetSpecialHandler
  1079. //------------------------------------------------------------------------------
  1080.  
  1081. void SIHelper::GetSpecialHandler(AEKeyword                    functionClass,
  1082.                                             ODSpecialHandlerUPP*    handler,
  1083.                                             ODSLong*                refCon)
  1084. {
  1085.     switch( functionClass )
  1086.     {
  1087.         case keyAECountProc:
  1088.             *handler = (ODSpecialHandlerUPP)fCountProcPtr;
  1089.             *refCon = fCountProcPtrRefCon;
  1090.             break;
  1091.         case keyAECompareProc:
  1092.             *handler = (ODSpecialHandlerUPP)fCompareProcPtr;
  1093.             *refCon = fCompareProcPtrRefCon;
  1094.             break;
  1095.         case keyDisposeTokenProc:
  1096.             *handler = (ODSpecialHandlerUPP)fDisposeTokenProcPtr;
  1097.             *refCon = fDisposeTokenProcPtrRefCon;
  1098.             break;
  1099.         case keyAEGetErrDescProc:
  1100.             *handler = (ODSpecialHandlerUPP)fErrDescProcPtr;
  1101.             *refCon = fErrDescProcPtrRefCon;
  1102.             break;
  1103.         case keyAEMarkTokenProc:
  1104.             *handler = (ODSpecialHandlerUPP)fGetMarkTokenProcPtr;
  1105.             *refCon = fGetMarkTokenProcPtrRefCon;
  1106.             break;
  1107.         case keyAEMarkProc:
  1108.             *handler = (ODSpecialHandlerUPP)fMarkProcPtr;
  1109.             *refCon = fMarkProcPtrRefCon;
  1110.             break;
  1111.         case keyAEAdjustMarksProc:
  1112.             *handler = (ODSpecialHandlerUPP)fAdjustMarksProcPtr;
  1113.             *refCon = fAdjustMarksProcPtrRefCon;
  1114.             break;
  1115.         case keyPreDispatch:
  1116.             *handler = (ODSpecialHandlerUPP)fPreDispatchProcPtr;
  1117.             *refCon = fPreDispatchProcPtrRefCon;
  1118.             break;
  1119.         default:
  1120.             THROW( errAENotASpecialFunction );
  1121.             break;
  1122.     }
  1123. }
  1124.  
  1125. //------------------------------------------------------------------------------
  1126. // SIHelper::LookupEventHandler
  1127. //------------------------------------------------------------------------------
  1128.  
  1129. ODBoolean SIHelper::LookupEventHandler(ODEventClass                eventClass,
  1130.                                    ODEventID                eventID,
  1131.                                    ODEventHandlerUPP*        handler,
  1132.                                    ODSLong*                handlerRefcon)
  1133. {
  1134.     SIEventHandlerValue    value;
  1135.     ODBoolean            result;
  1136.     
  1137.     result = HandlerLookup(eventClass, eventID , fEventHandlerTable,
  1138.                             &value);
  1139.  
  1140.     if (result)
  1141.     {
  1142.         *handler = value.handler;
  1143.         *handlerRefcon = value.refCon;
  1144.     }
  1145.     
  1146.     return result;
  1147. }
  1148.  
  1149. //------------------------------------------------------------------------------
  1150. // SIHelper::LookupCoercionHandler
  1151. //------------------------------------------------------------------------------
  1152.  
  1153. ODBoolean SIHelper::LookupCoercionHandler(ODDescType                fromType,
  1154.                                        ODDescType                toType,
  1155.                                        ODCoercionHandlerUPP*    handler,
  1156.                                        ODSLong*            handlerRefcon,
  1157.                                        ODBoolean*            fromTypeIsDesc)
  1158. {
  1159.     SICoercionHandlerValue    value;
  1160.     ODBoolean                result;
  1161.     
  1162.     result = HandlerLookup(fromType, toType, fCoercionHandlerTable,
  1163.                             (ODEntryPtr)&value);
  1164.     
  1165.     if (result)
  1166.     {
  1167.         *handler = value.handler;
  1168.         *handlerRefcon = value.refCon;
  1169.         *fromTypeIsDesc = value.fromTypeIsDesc;
  1170.     }
  1171.     
  1172.     return result;
  1173. }
  1174.  
  1175. //------------------------------------------------------------------------------
  1176. // SIHelper::LookupObjectAccessor
  1177. //------------------------------------------------------------------------------
  1178.  
  1179. ODBoolean SIHelper::LookupObjectAccessor(ODDescType                desiredClass,
  1180.                                        ODDescType                containerType,
  1181.                                        ODObjectAccessorUPP*    theAccessor,
  1182.                                        ODSLong*            accessorRefcon)
  1183. {
  1184.     SIObjectAccessorValue    value;
  1185.     ODBoolean                result;
  1186.     
  1187.     result = HandlerLookup(desiredClass, containerType , fObjectAccessorTable,
  1188.                             (ODEntryPtr)&value);
  1189.  
  1190.     if (result)
  1191.     {
  1192.         *theAccessor = value.accessor;
  1193.         *accessorRefcon = value.refCon;
  1194.     }
  1195.     
  1196.     return result;
  1197. }
  1198.  
  1199. //------------------------------------------------------------------------------
  1200. // SIHelper::GetOSLContext
  1201. //------------------------------------------------------------------------------
  1202.  
  1203. //OSLContext* SIHelper::GetOSLContext()
  1204. //{
  1205. //    return kODNULL;
  1206. //}
  1207.  
  1208. //------------------------------------------------------------------------------
  1209. // SIHelper::HandlerLookup
  1210. //------------------------------------------------------------------------------
  1211.  
  1212. ODBoolean SIHelper::HandlerLookup(
  1213.                                 ODDescType        key1,
  1214.                                 ODDescType        key2,
  1215.                                 SIHashTable*    theSIHashTable,
  1216.                                   void*        theValue)
  1217. {
  1218.     // This algorithm is duplicated in GetTableInfo in the AE Manager and
  1219.     //    OSLClAcc.GetTableInfo. Here we go, duplicating it again.
  1220.  
  1221.     SIGenericKey    key;
  1222.     ODBoolean        result;
  1223.     
  1224.     key.key1 = key1;
  1225.     key.key2 = key2;
  1226.  
  1227.     result = theSIHashTable->GetValue((ODKeyPtr)&key, theValue);
  1228.     if (!result)
  1229.     {
  1230.         key.key1 = typeWildCard;
  1231.         result = theSIHashTable->GetValue((ODKeyPtr)&key, theValue);
  1232.         if (!result)
  1233.         {
  1234.             key.key1 = key1;
  1235.             key.key2 = typeWildCard;
  1236.             result = theSIHashTable->GetValue((ODKeyPtr)&key, theValue);
  1237.             if (!result)
  1238.             {
  1239.                 key.key1 = typeWildCard;
  1240.                 result = theSIHashTable->GetValue((ODKeyPtr)&key, theValue);
  1241.             }
  1242.         }
  1243.     }
  1244.     
  1245.     return result;
  1246. }
  1247. #if 0
  1248. //------------------------------------------------------------------------------
  1249. // GetTokenDescType
  1250. //------------------------------------------------------------------------------
  1251.  
  1252. ODDescType GetTokenDescType(ODOSLToken* token)
  1253. {
  1254. }
  1255.  
  1256. //------------------------------------------------------------------------------
  1257. // SetTokenDescType
  1258. //------------------------------------------------------------------------------
  1259.  
  1260. void SetTokenDescType(ODOSLToken* token, ODDescType type)
  1261. {
  1262. }
  1263.  
  1264. //------------------------------------------------------------------------------
  1265. // GetTokenDataHandle
  1266. //------------------------------------------------------------------------------
  1267.  
  1268. ODHandle GetTokenDataHandle(ODOSLToken* token)
  1269. {
  1270. }
  1271.  
  1272. //------------------------------------------------------------------------------
  1273. // SetTokenDataHandle
  1274. //------------------------------------------------------------------------------
  1275.  
  1276. void SetTokenDataHandle(ODOSLToken* token, ODHandle handle)
  1277. {
  1278. }
  1279. #endif /* 0 */
  1280.  
  1281.