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

  1. /* @(#)Z 1.4 com/src/cm/CMAPITyp.h, odstorage, od96os2, odos29646d 96/11/15 15:26:43 (96/10/29 09:16:13) */
  2. /*====START_GENERATED_PROLOG======================================
  3.  */
  4. /*
  5.  *   COMPONENT_NAME: odstorage
  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.     File:        CMAPITyp.h
  31.  
  32.     Contains:    Container Manager API Types and Constants
  33.  
  34.     Written by:    Ira L. Ruben
  35.  
  36.     Owned by:    Ed Lai
  37.  
  38.     Copyright:    ⌐ 1991-1994 by Apple Computer, Inc., all rights reserved.
  39.  
  40.     Change History (most recent first):
  41.  
  42.          <2>     8/26/94    EL        #1182308 Add kCMLittleEndianTwin flag.
  43.                                     #1182275 Add kCMMerging to open mode
  44.          <4>     1/19/94    EL        Add kCMNextGeneration for automatic
  45.                                                     generation of generation number.
  46.  
  47.     To Do:
  48. */
  49.  
  50. /* (use tabs = 2 to view this file correctly) */
  51. /*---------------------------------------------------------------------------*
  52.  |                                                                           |
  53.  |                           <<< CM_API_Types.h >>>                          |
  54.  |                                                                           |
  55.  |                  Container Manager API Types and Constants                |
  56.  |                                                                           |
  57.  |                               Ira L. Ruben                                |
  58.  |                                 11/18/91                                  |
  59.  |                                                                           |
  60.  |                  Copyright Apple Computer, Inc. 1991-1994                 |
  61.  |                           All rights reserved.                            |
  62.  |                                                                           |
  63.  *---------------------------------------------------------------------------*
  64.  
  65.  This file contains all the type and constant definitions used by the Container Manager
  66.  API.
  67.  
  68.  
  69.                                               *------------------------------*
  70.                                                 | NOTE TO DOS (80x86) USERS... |
  71.                                                 *------------------------------*
  72.  
  73.  The Container Manager should be compiled with the "large" memory model so that all
  74.  routines, pointers, etc. are "far".  All external API interfaces are appropriately
  75.  qualified this way.  Since handlers are implementation or user dependent, these files
  76.  must be compiled with the large memory model.  The only exception is local static
  77.  routines which usually can be qualified with "near" (except, of course, for handlers).
  78.  
  79.  This file uses the function and pointer memory model attribute macros defined
  80.  CM_API_Environment.h.  See that file for further details.
  81. */
  82.  
  83. #ifndef __CM_API_TYPES__
  84. #define __CM_API_TYPES__
  85.  
  86. #ifndef __CM_API_ENV__
  87. #include "CMAPIEnv.h"
  88. #endif
  89.  
  90.  
  91. /*--------------------------*
  92.  | Low level basic types... |
  93.  *--------------------------*/
  94.  
  95. typedef char                         CM_CHAR;                                    /* 1-byte objects                                            */
  96. typedef unsigned char     CM_UCHAR;
  97.  
  98. typedef short                        CM_SHORT;                                    /* 2-byte objects                                            */
  99. typedef unsigned short    CM_USHORT;
  100.  
  101. typedef long                        CM_LONG;                                    /* 4-byte objects                                            */
  102. typedef unsigned long        CM_ULONG;
  103.  
  104.  
  105. /*----------*
  106.  | Types... |
  107.  *----------*
  108.  
  109.  All Container Manager types are defined here with the intent to aid in enforcing compiler
  110.  type checking.  Note that "refNums" for session data, container control blocks, values,
  111.  and objects are uniquely typed to strictly enforce type checking of those entities. These
  112.  types are defined as pointers derived from an "incomplete type", i.e. structs.  The
  113.  structs are NOT defined.  In ANSI C, an "incomplete type" need not be defined.
  114.  
  115.  Further, for all the following types defined as pointers, a corresponding "CMconst_..." is
  116.  defined.  These allow for function paramters of the form "pointer to constant CM type".
  117.  Note that, in ANSI, "const CMFooPtr p" is NOT the same as "const CMFoo *p". The latter is
  118.  what we desire, but the former defines a "consting pointer to a CMFoo" not a "pointer to a
  119.  constant CMFoo".  Hence the additional types are required.  Hey, I didn't make the rules!
  120. */
  121.  
  122. typedef    struct CMSession_     CM_PTR *CMSession;        /* pointer to session (task) data            */
  123. typedef struct CMContainer_ CM_PTR *CMContainer;    /* "refNum" for containers                        */
  124.  
  125. typedef struct CMObject_         CM_PTR *CMObject;            /* "refNum" for objects                                */
  126. typedef CMObject                                         CMProperty;        /* "refNum" for property objects            */
  127. typedef CMObject                                         CMType;                /* "refNum" for type objects                    */
  128.  
  129. typedef struct CMValue_         CM_PTR *CMValue;            /* "refNum" for values                                */
  130.  
  131. typedef CM_CHAR        CM_PTR *CMOpenMode;                            /* handler open mode string pointers    */
  132. typedef CM_CHAR     CM_PTR *CMGlobalName;                        /* global unique name pointers                */
  133. typedef CM_CHAR        CM_PTR *CMErrorString;                    /* error message string pointers            */
  134. typedef CM_CHAR        CM_PTR *CMMetaData;                            /* type metadata string pointers            */
  135.  
  136. typedef void            CM_PTR *CMRefCon;                                /* reference constants ("refCon"s)        */
  137. typedef void             CM_PTR *CMPtr;                                    /* arbitrary data pointers                        */
  138.  
  139. typedef CM_UCHAR    CM_PTR *CMMagicBytes;                        /* magic byte pointers                                */
  140. typedef CM_UCHAR    CM_PTR *CMDataPacket;                        /* "new value" handler data packets        */
  141. typedef CM_UCHAR    CM_PTR *CMDataBuffer;                        /* ptr to data buffer for handlers        */
  142. typedef CM_UCHAR    CM_PTR *CMPrivateData;                    /* ptr to private CM data for handlers*/
  143.  
  144. typedef    const struct CMSession_     CM_PTR *CMconst_CMSession;        /* ptr to const types...*/
  145. typedef const struct CMContainer_ CM_PTR *CMconst_CMContainer;
  146. typedef const struct CMObject_         CM_PTR *CMconst_CMObject;
  147. typedef CMconst_CMObject                                     CMconst_CMProperty;
  148. typedef CMconst_CMObject                                     CMconst_CMType;
  149. typedef const struct CMValue_         CM_PTR *CMconst_CMValue;
  150. typedef const CM_CHAR                            CM_PTR *CMconst_CMOpenMode;
  151. typedef const CM_CHAR                         CM_PTR *CMconst_CMGlobalName;
  152. typedef const CM_CHAR                            CM_PTR *CMconst_CMErrorString;
  153. typedef const CM_CHAR                            CM_PTR *CMconst_CMMetaData;
  154. typedef const void                                CM_PTR *CMconst_CMconst_CMRefCon;
  155. typedef const void                                 CM_PTR *CMconst_CMPtr;
  156. typedef const CM_UCHAR                        CM_PTR *CMconst_CMMagicBytes;
  157. typedef const CM_UCHAR                        CM_PTR *CMconst_CMDataPacket;
  158. typedef const CM_UCHAR                        CM_PTR *CMconst_CMDataBuffer;
  159. typedef const CM_UCHAR                        CM_PTR *CMconst_CMPrivateData;
  160.  
  161. typedef CM_UCHAR    CMReference[4];                                    /* referenced object data pointers        */
  162.  
  163. typedef CM_UCHAR     CMSeekMode;                                            /* container "fseek()" handler modes    */
  164. typedef CM_UCHAR     CMBoolean;                                            /* boolean values/functs. (0==>false)    */
  165.  
  166. typedef CM_USHORT CMContainerUseMode;                            /* container open use mode flags            */
  167. typedef CM_USHORT CMContainerFlags;                                /* container label flags                            */
  168. typedef CM_USHORT    CMContainerModeFlags;                        /* container open mode flags                    */
  169. typedef CM_USHORT CMValueFlags;                                        /* value flags                                                */
  170. typedef CM_USHORT CMEofStatus;                                        /* "feof()" handler result status            */
  171.  
  172. typedef CM_LONG     CMErrorNbr;                                            /* error handler error numbers                */
  173.  
  174. typedef CM_ULONG     CMGeneration;                                        /* container generation numbers                */
  175. typedef CM_ULONG     CMSize;                                                    /* sizes                                                            */
  176. typedef CM_ULONG     CMCount;                                                /* amounts or counts                                    */
  177. typedef CM_ULONG     CMObjectID;                                            /* object ID's                                                */
  178.  
  179. CM_CFUNCTIONS                                                                            /* see CM_API_Environment.h about this*/
  180. typedef void (CM_FIXEDARGS *CMHandlerAddr)();            /* handler address pointers                      */
  181. typedef    CMHandlerAddr (CM_FIXEDARGS *CMMetaHandler)(CMType,                            /* metahandlers    */
  182.                                                                                                         CMconst_CMGlobalName);
  183. CM_END_CFUNCTIONS
  184.  
  185.  
  186. /*--------------*
  187.  | Constants... |
  188.  *--------------*/
  189.  
  190. /* The following flags are passed to CMOpenNewContainer() as CMContainerFlags.  These     */
  191. /* flags are stored in the container label and define some constant attributes about the*/
  192. /* container.     The container flags may be retrieved by calling the CMGetContainerInfo() */
  193. /* API routine.                                                                                                                                                    */
  194.  
  195. #define kCMLittleEndian        0x0001U                                    /* little-endian byte ordering                */
  196. #define kCMLittleEndianTwin    0x0101U                                    /* little-endian byte ordering                */
  197.  
  198. /* The following flags are passed to CMOpen[New]Container() as CMContainerUseMode             */
  199. /* useFlags.  They modify the open in the indicated ways. Note, kCMReading, kCMWriting, */
  200. /* kCMUpdating are also returned from CMGetContainerInfo() to indicate the mode of the     */
  201. /* container, i.e., it was opened for reading, writing, or updating.                                        */
  202.  
  203. #define kCMReading                0x0001U                                    /* container was opened for reading        */
  204. #define    kCMWriting                0x0002U                                    /* container was opened for writing        */
  205. #define kCMReuseFreeSpace    0x0004U                                    /* try to reuse freed space                      */
  206. #define kCMUpdateByAppend    0x0008U                                 /* open container for update-by-append*/
  207. #define kCMUpdateTarget        0x0010U                                    /* open container for updating target */
  208. #define kCMConverting          0x0020U                                 /* open container for converting          */
  209. #define kCMMerging              0x0040U                                 /* container may be merged                      */
  210.  
  211. #define kCMUpdating                (kCMReuseFreeSpace | kCMUpdateByAppend | kCMUpdateTarget)
  212.  
  213. /* The following flags are options to the "seek" I/O handler.                                                        */
  214.  
  215. #define kCMSeekSet                 0x00                                         /* "fseek()" handler mode (pos)                */
  216. #define kCMSeekCurrent         0x01                                         /* "fseek()" handler mode (curr+pos)    */
  217. #define kCMSeekEnd                 0x02                                         /* "fseek()" handler mode (end+pos)        */
  218.  
  219. /* The following are the flags that appear in the flags field of the TOC itself.  Some     */
  220. /* are for internal use only and do not appear in TOC entries in the container.  The         */
  221. /* comments designate which are these.                                                                                                    */
  222.  
  223. #define kCMImmediate             0x0001U                                 /* immediate value flag                                */
  224. #define kCMContinued             0x0002U                                 /* continue value flag                                */
  225.  
  226. #define kCMDynValue             0x4000U                                 /* dynamic value flag (internal use)    */
  227. #define kCMGlobalName         0x8000U                                 /* global name flag        (internal use)    */
  228.  
  229. /* The Container label contains a buffer size field which is used by the Container             */
  230. /* Manager for buffered TOC I/O. This field, times 1024, yields the actual buffer size. */
  231. /* Since this field (as it is in the label) can be returned by CMGetContainerInfo(), the*/
  232. /* following constant is provided to get the actual buffer size in bytes.                                */
  233.  
  234. #define kCMBufSizeUnits        1024                                        /* bufSize*1024==actual TOC bufr size    */
  235.  
  236. /* When we do CMOpenNewContainer updating another container, we may want to have a            */
  237. /* generation number equal to target container plus 1. It may not be easy since we do        */
  238. /* not know the generation number of the target container without opening it.                        */
  239. /* Use kCMNextGeneration in the generation number would automatically do it for you            */
  240.  
  241. #define    kCMNextGeneration    0x0000U
  242.  
  243. #endif
  244.