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

  1. /* @(#)Z 1.4 com/src/bento/EmbedHdr.h, odstorage, od96os2, odos29646d 96/11/15 15:29:28 (96/10/29 09:12:24) */
  2. /*====START_GENERATED_PROLOG======================================
  3.  */
  4. /*
  5.  *   COMPONENT_NAME: odstorage
  6.  *
  7.  *   CLASSES:   ODEmbeddedHandlers
  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:        EmbedHdr.h
  31.  
  32.     Contains:    ODEmbbeddedHandlers 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.          <6>     8/16/95    EL        1242376: Buffer embedded handler so there
  41.                                     is less fragmentation on top level
  42.                                     container.
  43.          <5>      5/2/95    EL        1245113: Turn off buffering because it
  44.                                     currently cause problem in this bug.
  45.          <4>     4/25/95    EL        1213321: turn on embedded container
  46.                                     buffering.
  47.          <3>      4/7/95    EL        1213321: New buffering scheme but leave it
  48.                                     inactivated until after DR2.
  49.          <2>     8/26/94    EL        #1182275 Allows writing embeded value in
  50.                                     large block to decrease fragmentation.
  51.          <1>     5/27/94    VL        first checked in
  52.  
  53.     To Do:
  54. */
  55.  
  56. #ifndef _EMBEDHDR_
  57. #define _EMBEDHDR_
  58.  
  59. #ifndef _ODTYPES_
  60. #include "ODTypes.h"
  61. #endif
  62.  
  63. #ifndef _BENTOHDR_
  64. #include "BentoHdr.h"
  65. #endif
  66.  
  67. #ifndef __CM_API__
  68. #include "CMAPI.h"
  69. #endif
  70.  
  71. #ifndef __CM_API_TYPES__
  72. #include "CMAPITyp.h"
  73. #endif
  74.  
  75. #ifndef _PLFMDEF_
  76. #include "PlfmDef.h"
  77. #endif
  78.  
  79. #define kLargeEmbeddedBlock 1
  80.  
  81. //==============================================================================
  82. // Theory of Operation
  83. //==============================================================================
  84.  
  85. //==============================================================================
  86. // Constants
  87. //==============================================================================
  88. const    kBentoTypeNameSize = 512;
  89. const    kEmbeddedBlockSize = 2048;
  90. extern const ODType    kODEmbeddedContainerTypeName; // = "EmbedHdr";
  91.  
  92. //==============================================================================
  93. // Scalar Types
  94. //==============================================================================
  95.  
  96. //==============================================================================
  97. // Classes defined in this interface
  98. //==============================================================================
  99. class ODEmbeddedHandlers;
  100.  
  101. //==============================================================================
  102. // Classes used by this interface
  103. //==============================================================================
  104.  
  105. //==============================================================================
  106. // ODEmbeddedHandlers
  107. //==============================================================================
  108.  
  109. class ODEmbeddedHandlers : public ODBentoHandlers
  110. {
  111. public:
  112.  
  113.     ODEmbeddedHandlers(CMSession session, CMValue parentValue);
  114.     ODVMethod ~ODEmbeddedHandlers();
  115.     
  116.     ODMethod void Initialize();
  117.     ODMethod CMSession GetCMSession();
  118.     
  119.     ODMethod CMRefCon OpenHandler(CMOpenMode mode);
  120.     ODMethod void CloseHandler();
  121.     ODMethod CMSize FlushHandler();
  122.     ODMethod CMSize SeekHandler(CM_LONG posOff, CMSeekMode mode);
  123.     ODMethod CMSize TellHandler();
  124.     ODMethod CMSize ReadHandler(CMPtr buffer, CMSize elementSize, CMCount theCount);
  125.     ODMethod CMSize WriteHandler(CMPtr buffer, CMSize elementSize, CMCount theCount);
  126.     ODMethod CMEofStatus EOFHandler();
  127.     ODMethod CMBoolean TruncHandler(CMSize containerSize);
  128.     ODMethod CMSize ContainerSizeHandler();
  129.     ODMethod void ReadLabelHandler(CMMagicBytes magicByteSequence,
  130.                         CMContainerFlags *flags, CM_USHORT *bufSize,
  131.                         CM_USHORT *majorVersion, CM_USHORT *minorVersion,
  132.                         CMSize *tocOffset, CMSize *tocSize);
  133.     ODMethod void WriteLabelHandler(CMMagicBytes magicByteSequence,
  134.                         CMContainerFlags flags, CM_USHORT bufSize,
  135.                         CM_USHORT majorVersion, CM_USHORT minorVersion,
  136.                         CMSize tocOffset, CMSize tocSize);
  137.     ODMethod CMValue ReturnParentValueHandler();
  138.     ODMethod CM_UCHAR* ReturnContainerNameHandler();
  139.     ODMethod CMType ReturnTargetTypeHandler(CMContainer container);
  140.     ODMethod void ExtractDataHandler(CMDataBuffer buffer,
  141.                             CMSize size, CMPrivateData data);
  142.     ODMethod void FormatDataHandler(CMDataBuffer buffer,
  143.                             CMSize size,
  144.                             CMPrivateData data);
  145.  
  146. private:
  147.  
  148.     CMSession    fSession;
  149.     CMValue        fParentValue;
  150.     CMSize        fPosition;
  151.     CMSize        fSize;
  152. #if kLargeEmbeddedBlock
  153.     CMSize        fBufferBegin;
  154.     ODSByte*    fBuffer;
  155. #endif
  156.     ODSByte    fTypeName[kBentoTypeNameSize];
  157.     ODBoolean    fReverseEndian;
  158. };
  159.  
  160. #endif // _EMBEDHDR_
  161.