home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / opendc12.zip / od124os2.exe / od12osr1.exe / src / ILINKSRC.idl < prev    next >
Text File  |  1997-03-21  |  8KB  |  233 lines

  1. /* @(#)Z 1.6 os2/src/storage/idl/ILINKSRC.idl, oddataxfer, od96os2, odos29712d 97/03/21 17:21:41 (96/10/01 12:46:59) */
  2. //#====START_GENERATED_PROLOG======================================
  3. //#
  4. //#
  5. //#   COMPONENT_NAME: oddataxfer
  6. //#
  7. //#   CLASSES: none
  8. //#
  9. //#   ORIGINS: 82,27
  10. //#
  11. //#
  12. //#   (C) COPYRIGHT International Business Machines Corp. 1995,1996
  13. //#   All Rights Reserved
  14. //#   Licensed Materials - Property of IBM
  15. //#   US Government Users Restricted Rights - Use, duplication or
  16. //#   disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  17. //#       
  18. //#   IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  19. //#   ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  20. //#   PURPOSE. IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  21. //#   CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
  22. //#   USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  23. //#   OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
  24. //#   OR PERFORMANCE OF THIS SOFTWARE.
  25. //#
  26. //#====END_GENERATED_PROLOG========================================
  27. //#
  28.  
  29. /********************************************************************/
  30. /*                                                                  */
  31. /* Copyright (C) Apple Computer, Inc., 1994                         */
  32. /*                                                                  */
  33. /********************************************************************/
  34.  
  35. #ifndef _ILINKSRC_
  36. #define _ILINKSRC_
  37.  
  38. #include <LinkSrc.idl>
  39. #include <ILTr2LSr.idl>
  40. #include <ICIDItr.idl>
  41.  
  42. #ifdef __PRIVATE__
  43.   #ifndef _OpenHashTable_
  44.     #define _OpenHashTable_
  45.     typedef somToken OpenHashTable;
  46.   #endif
  47.  
  48.   #ifndef _HEV_
  49.     #define _HEV_
  50.     typedef somToken HEV;
  51.   #endif
  52. #endif //__PRIVATE__
  53.  
  54. interface IODMutex;
  55. interface IODConnIDIterator;
  56.  
  57. interface IODLinkSource : ODLinkSource,
  58.                           IODLinkTargetToLinkSource
  59. {
  60.  
  61.   #ifdef __PRIVATE__
  62.  
  63.     enum State {
  64.       EMPTY,      // E state
  65.       INITED,     // I state
  66.       CONNECTED   // C state
  67.     };
  68.       //# Possible states of the LinkSource
  69.  
  70.     enum LockState {
  71.       UNLOCKED,//nobody holds a lock on the content SU; Lock requests are OK
  72.       LOCKED,  //somebody holds a lock on an INDOC instance of the content SU
  73.       LOCKEDINAS, //somebody holds a lock on an INAS instance of the content SU
  74.      BROKEN    //nobody holds a lock on the content SU; lock requests not OK
  75.     };
  76.  
  77.     #if defined(_PLATFORM_OS2_) || defined(_PLATFORM_WIN32_)
  78.         // an instance of this structure is allocated for
  79.         // each caller who is currently unable to get the lock
  80.         // and is waiting until either:
  81.         //  the lock becomes available
  82.         //  a timeout happens
  83.         //  or the linksource closes down and breaks all locks
  84.       typedef struct LWE
  85.       {
  86.         IODMutex mutex; // to serialize access by unlock, release, and wait
  87.         HEV event;    // posted when lock wait terminated
  88.         ODLinkKey key; // key: nonzero means successful lock
  89.         ODBoolean timedout; // true if timed out and waiter detected this
  90.         ODBoolean broken; // true if linksrc is breaking all locks
  91.         LWE* next;// next on linked list
  92.       }LockWaitElement ;
  93.  
  94.    #endif/* _PLATFORM_OS2_  or _PLATFORM_WIN32_ */
  95.  
  96.     void GetPersistentLinkInfo(out ODLinkID linkID,
  97.                                out ODISOStr ASName);
  98.       // called:
  99.       // (1) when a persistent linkspec is made from a linksource
  100.       // (2) when a linktarget is copied together with its
  101.       // linksource and the linktarget needs to get the
  102.       // new linkinfo for the copied linksource
  103.  
  104.     void InitILinkSource (in ODStorageUnit su,
  105.                           in ODPart srcPart,
  106.                           in ODISOStr hostName,
  107.                           in ODISOStr docName);
  108.  
  109.       // Called in Draft::CreateLinkSource to initialize the LinkSource after
  110.       //    it is created.
  111.       // LinkSource will not be fully init until CompleteInitILinkSource called
  112.  
  113.     ODLinkID InitILinkSourceFromStorage (in ODStorageUnit su);
  114.       // Called in Draft::AcquireLinkSource to initialize the LinkSource from
  115.       //    a pre-existing storage unit.
  116.       // Returns the stored linkid
  117.       // LinkSource will not be fully init until CompleteInitILinkSource called
  118.  
  119.    void CompleteInitILinkSource(in ODStorageUnit su,
  120.                                  in ODLinkID linkIDIfNew,
  121.                                  in IODAuxiliaryState auxState,
  122.                                  in ODBoolean isLocked,
  123.                                  in ODISOStr ASName);
  124.     // called after InitILinkSource or InitILinkSourceFromStorage
  125.     // linkIDIFNew will always be supplied (nonzero) for a brand new link source
  126.     // linkIDIfNew will be supplied for a previously stored link source
  127.     //     only if the draft determines that this link source is
  128.     //     a copy in which case a new linkid will be supplied
  129.  
  130.     void GetAuxState (out IODAuxiliaryState* auxState);
  131.  
  132.     void ResetAuxState (in IODAuxiliaryState auxState);
  133.  
  134.   #endif //__PRIVATE__
  135.  
  136.    void WritePersistentLinkSpec(in ODStorageUnit su);
  137.     // eventually this method will be moved to ODLinkSource and
  138.     // will become public.
  139.     // This writes out a linkspec giving rights to link to this linksource
  140.  
  141.   #ifdef __SOMIDL__
  142.     implementation {
  143.       override:
  144.         somInit,
  145.         somUninit,
  146.         #ifdef __PRIVATE__
  147.           AddLinkTarget,
  148.           ForwardGetUpdateID,
  149.           ForwardGetChangeTime,
  150.           ForwardGetContentStorageUnit,
  151.           ForwardLock,
  152.           ForwardUnlock,
  153.           GetSourcePartDescription,
  154.           LinkTargetClosed,
  155.           LinkTargetRemoved,
  156.           LinkTargetReopened,
  157.           LockToRead,
  158.           RegisterTrackedLinkTarget,
  159.           RegisterUntrackedLinkTarget,
  160.           ShowSourceContentFor,
  161.           TargetPartDescriptionChanged,
  162.           UnregisterLinkTarget,
  163.           GetConnectionData,
  164.           GetLink,
  165.           GetLinkConnectionData,
  166.           GetLinkConnections,
  167.           InitCallBackMode,
  168.           BreakLinkConnection,
  169.           SetDescription,
  170.           GetDescription,
  171.         #endif /*__PRIVATE__*/
  172.         CloneInto,
  173.         Externalize,
  174.         Release,
  175.         ReleaseAll,
  176.         SetAutoUpdate,
  177.         Lock,
  178.         Unlock;
  179.  
  180.  
  181.       releaseorder:
  182.         WritePersistentLinkSpec, 
  183.         #ifdef __PRIVATE__
  184.           InitILinkSource,
  185.           InitILinkSourceFromStorage,
  186.           CompleteInitILinkSource,
  187.           GetAuxState,
  188.           ResetAuxState,
  189.           GetPersistentLinkInfo;
  190.         #else
  191.           reserved1,
  192.           reserved2,
  193.           reserved3,
  194.           reserved4,
  195.           reserved5,
  196.           reserved6;
  197.         #endif //__PRIVATE__
  198.  
  199.       #ifdef __PRIVATE__
  200.         passthru C_xh = ""
  201.                         "#if defined(_PLATFORM_OS2_) || defined(_PLATFORM_WIN32)"
  202.                         "typedef unsigned long EditionContainerSpec;"
  203.                         "#endif // _PLATFORM_OS2_ or _PLATFORM_WIN32"
  204.                         ""
  205.                         "#ifdef _PLATFORM_OS2_"
  206.                         "#define INCL_WINATOM"
  207.                         "#include <os2.h>"
  208.                         "#endif // _PLATFORM_OS2_"
  209.                         "";
  210.       #endif /*__PRIVATE__*/
  211.  
  212.       #ifdef __PRIVATE__
  213.         ODLinkConnectionID    fIDCounter;
  214.         ODLinkID           fLinkID;
  215.         OpenHashTable*       fLocalLinkInfos;
  216.         OpenHashTable*       fRemoteLinkInfos;
  217.         IODMutex           fMutex;
  218.         ODLinkConnectionData fSrcConnData;
  219.         State              fState;
  220.         ODBoolean          fTrackTrgts;
  221.         LockState          fLockState;
  222.         ODULong            fPID;
  223.         ODULong            fVersion;
  224.         LockWaitElement* fFirstWE;
  225.         LockWaitElement* fLastWE;
  226.         ODISOStr           fASName;
  227.       #endif //__PRIVATE__
  228.     };
  229. #endif //__SOMIDL__
  230. };
  231.  
  232. #endif //_ILINKSRC_
  233.