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

  1. /* @(#)Z 1.6 com/src/bento/MemHdr.h, odstorage, od96os2, odos29646d 96/11/15 15:29:29 (96/10/29 09:13:09) */
  2. /*====START_GENERATED_PROLOG======================================
  3.  */
  4. /*
  5.  *   COMPONENT_NAME: odstorage
  6.  *
  7.  *   CLASSES:   ODMemBentoHandlers
  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.     File:        MemHdr.h
  31.  
  32.     Contains:    ODMemContainer header
  33.  
  34.     Written by:    Vincent Lo
  35.  
  36.     Copyright:    ⌐ 1993-1994 by Apple Computer, Inc., all rights reserved.
  37.  
  38.     Change History (most recent first):
  39.  
  40.          <2>     6/20/94    CC        ODMemoryHeap* changed to ODMemoryHeapID.
  41.          <1>     5/27/94    VL        first checked in
  42.     To Do:
  43. */
  44.  
  45. #ifndef _MEMHDR_
  46. #define _MEMHDR_
  47.  
  48. #ifndef _ODTYPES_
  49. #include "ODTypes.h"
  50. #endif
  51.  
  52. #ifndef _BENTOHDR_
  53. #include "BentoHdr.h"
  54. #endif
  55.  
  56. #ifndef __CM_API__
  57. #include "CMAPI.h"
  58. #endif
  59.  
  60. #ifndef __CM_API_TYPES__
  61. #include "CMAPITyp.h"
  62. #endif
  63.  
  64. #ifndef _ODMEMORY_
  65. #include "ODMemory.h"
  66. #endif
  67.  
  68. #ifndef _PLFMDEF_
  69. #include "PlfmDef.h"
  70. #endif
  71.  
  72. // removed ifdef _PLATFORM_NT_ 22470
  73. typedef char* Zone;
  74. typedef Zone* THz;
  75.  
  76. //==============================================================================
  77. // Theory of Operation
  78. //==============================================================================
  79.  
  80. //==============================================================================
  81. // Constants
  82. //==============================================================================
  83. extern const ODType kODBentoMemoryTypeName; // = "MemoryCtr";
  84.  
  85. //==============================================================================
  86. // Scalar Types
  87. //==============================================================================
  88.  
  89. //==============================================================================
  90. // Classes defined in this interface
  91. //==============================================================================
  92. class ODMemBentoHandlers;
  93.  
  94. //==============================================================================
  95. // Classes used by this interface
  96. //==============================================================================
  97.  
  98. //==============================================================================
  99. // ODMemBentoHandlers
  100. //==============================================================================
  101.  
  102. class ODMemBentoHandlers : public ODBentoHandlers
  103. {
  104. public:
  105.  
  106.     ODMemBentoHandlers(CMSession session, ODHandle data);
  107.     ODVMethod ~ODMemBentoHandlers();
  108.     
  109.     ODMethod void Initialize();
  110.     ODMethod CMSession GetCMSession();
  111.     
  112.     ODMethod CMRefCon OpenHandler(CMOpenMode mode);
  113.     ODMethod void CloseHandler();
  114.     ODMethod CMSize FlushHandler();
  115.     ODMethod CMSize SeekHandler(CM_LONG posOff, CMSeekMode mode);
  116.     ODMethod CMSize TellHandler();
  117.     ODMethod CMSize ReadHandler(CMPtr buffer, CMSize elementSize, CMCount theCount);
  118.     ODMethod CMSize WriteHandler(CMPtr buffer, CMSize elementSize, CMCount theCount);
  119.     ODMethod CMEofStatus EOFHandler();
  120.     ODMethod CMBoolean TruncHandler(CMSize containerSize);
  121.     ODMethod CMSize ContainerSizeHandler();
  122.     ODMethod void ReadLabelHandler(CMMagicBytes magicByteSequence,
  123.                         CMContainerFlags *flags, CM_USHORT *bufSize,
  124.                         CM_USHORT *majorVersion, CM_USHORT *minorVersion,
  125.                         CMSize *tocOffset, CMSize *tocSize);
  126.     ODMethod void WriteLabelHandler(CMMagicBytes magicByteSequence,
  127.                         CMContainerFlags flags, CM_USHORT bufSize,
  128.                         CM_USHORT majorVersion, CM_USHORT minorVersion,
  129.                         CMSize tocOffset, CMSize tocSize);
  130.     ODMethod CMValue ReturnParentValueHandler();
  131.     ODMethod CM_UCHAR* ReturnContainerNameHandler();
  132.     ODMethod CMType ReturnTargetTypeHandler(CMContainer container);
  133.     ODMethod void ExtractDataHandler(CMDataBuffer buffer,
  134.                             CMSize size, CMPrivateData data);
  135.     ODMethod void FormatDataHandler(CMDataBuffer buffer,
  136.                             CMSize size,
  137.                             CMPrivateData data);
  138.  
  139. private:
  140.  
  141.                 void SaveZone();
  142.                 void RestoreZone();
  143.  
  144.     CMSession    fSession;
  145.     ODHandle   fData;
  146.     ODBoolean  fAllocated;
  147.     CMSize      fSize;
  148.     ODBoolean    fSeekValid;
  149.     ODULong    fSeekPos;
  150.     ODSLong    fLastSeekOffset;
  151.     ODSShort    fLastSeekMode;
  152.     ODBoolean  fEOFReached;
  153.     THz            fZone;
  154.     THz            fCurZone;
  155. };
  156.  
  157. #endif // _MEMHDR_
  158.