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

  1. /* @(#)Z 1.6 com/src/cm/CMAPIEnv.h, odstorage, od96os2, odos29646d 96/11/15 15:26:41 (96/10/29 09:15:59) */
  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:        CMAPIEnv.h
  31.  
  32.     Contains:    Container Manager API Environment Specific Definitions
  33.  
  34.     Written by:    Ira L. Ruben
  35.  
  36.     Owned by:    Ed Lai
  37.  
  38.     Copyright:    ⌐ 1992-1994 by Apple Computer, Inc., all rights reserved.
  39.  
  40.     Change History (most recent first):
  41.  
  42.          <3>     1/19/95    VL        1183685: Turned on Merge Container flag.
  43.          <2>     8/26/94    EL        #1182308 Make endian flag platform
  44.                                     independent
  45.          <3>     3/17/94    EL        Add endian-ness flag #1149979
  46.  
  47.     To Do:
  48. */
  49.  
  50. /* (use tabs = 2 to view this file correctly) */
  51. /*---------------------------------------------------------------------------*
  52.  |                                                                           |
  53.  |                       <<< CM_API_Environment.h >>>                        |
  54.  |                                                                           |
  55.  |           Container Manager API Environment Specific Definitions          |
  56.  |                                                                           |
  57.  |                               Ira L. Ruben                                |
  58.  |                                  4/27/92                                  |
  59.  |                                                                           |
  60.  |                    Copyright Apple Computer, Inc. 1992-1994               |
  61.  |                           All rights reserved.                            |
  62.  |                                                                           |
  63.  *---------------------------------------------------------------------------*
  64.  
  65.  This file is included by CM_API.h and is intended to contain site-specific and compiler-
  66.  specific stuff that should be defined for the particular installation which is used to
  67.  compile the Container Manager code and the user's API calls.  People responsible for
  68.  installing the Container Manager on specific environments are EXPECTED to change this
  69.  file.
  70.  
  71.  The stuff here is assumed to be global macros utilized by the API and the Container
  72.  Manager code itself.
  73.  
  74.  
  75.                                               *------------------------------*
  76.                                                 | NOTE TO DOS (80x86) USERS... |
  77.                                                 *------------------------------*
  78.  
  79.  The Container Manager should be compiled with the "large" memory model so that all
  80.  routines, pointers, etc. are "far".  All external API interfaces are appropriately
  81.  qualified this way.  Since handlers are implementation or user dependent, these files
  82.  must be compiled with the large memory model.  The only exception is local static
  83.  routines which usually can be qualified with "near" (except, of course, for handlers).
  84. */
  85.  
  86. #ifndef __CM_API_ENV__
  87. #define __CM_API_ENV__
  88.  
  89. #ifndef MergeContainersAvailable
  90. #define MergeContainersAvailable    1
  91. #endif
  92.  
  93.  
  94. /*--------------------------*
  95.  | Target Machines Switches |
  96.  *--------------------------*
  97.  
  98.  If there are machine specific definitions, define an appropriate macro switch here...
  99. */
  100.  
  101. #ifndef _PLATFORM_BIG_ENDIAN_
  102. #define CM_80x86        1
  103. #endif
  104.  
  105. #ifndef CM_80x86                                                            /* 1 if target is x86 machine                            */
  106. #define CM_80x86     0
  107. #endif
  108.  
  109. #if CM_80x86
  110. #define kCMDefaultEndian 0x0101U
  111. #else
  112. #define kCMDefaultEndian 0x0000U
  113. #endif
  114.  
  115. /*--------------------------*
  116.  | Target Compiler Switches |
  117.  *--------------------------*
  118.  
  119.  If there are compiler specific definitions, define an appropriate macro switch here...
  120. */
  121.  
  122. #ifndef CM_MICROSOFT
  123. #define CM_MICROSOFT     0                                /* 80x86 machines using Microsoft DOS compilers        */
  124. #endif
  125.  
  126. #ifndef CM_BORLAND
  127. #define CM_BORLAND         0                                /* 80x86 machines using Borland DOS compilers            */
  128. #endif
  129.  
  130. #ifndef CM_ZORTECH
  131. #define CM_ZORTECH         0                                /* 80x86 machines using Zortech DOS compilers            */
  132. #endif
  133.  
  134. #ifndef CM_MPW                                                /* Macintosh MPW C compiler/environment                        */
  135. #define CM_MPW                 0
  136. #endif
  137.  
  138.  
  139. /*----------*
  140.  | #pragmas |
  141.  *----------*
  142.  
  143.  Environment #pragmas should go here.  Remember this file is included to build the
  144.  Container Manager too!
  145. */
  146.  
  147.  
  148. /*-------------------------------*
  149.  | Compiler Specific Definitions |
  150.  *-------------------------------*
  151.  
  152.  The following are used in to modify the source to satisfy the "peculiarities" of various
  153.  compilers used to compile the Container Manager.
  154. */
  155.  
  156. /* Compilers in 80x86 environments define the "size" of pointers as a function of the     */
  157. /* memory modes used.  In these environments, it is assumed and required that the             */
  158. /* Container Manager code is ALWAYS compiled with a "large" memory module.  The                 */
  159. /* following define common names to use for the keywords that control pointer sizes:        */
  160.  
  161. #if CM_MICROSOFT
  162. #define CM_NEAR _near                                    /* the "near" keyword for Microsoft C                            */
  163. #define CM_FAR  _far                                    /* the "far" keyword for Microsoft C                            */
  164. #elif CM_BORLAND
  165. #define CM_NEAR near                                    /* the "near" keyword for Borland C                                */
  166. #define CM_FAR  far                                        /* the "far" keyword for Borland C                                */
  167. #elif CM_ZORTECH
  168. #define CM_NEAR near                                    /* the "near" keyword for Zortech C                                */
  169. #define CM_FAR  far                                        /* the "far" keyword for Zortech C                                */
  170. #else
  171. #define CM_NEAR                                                /* Non-DOS environments don't need this stuff!            */
  172. #define CM_FAR
  173. #endif
  174.  
  175. /* Microsoft, Borland, and Zortech DOS C compilers support multiple linkage conventions.*/
  176. /* In particular, C and Pascal conventions.  As it turns out, in general, the Pascal        */
  177. /* calling conventions are more efficient than the C conventions for these compilers.      */
  178. /* But Pascal calling conventions cannot be used when there are "..." (variable number     */
  179. /* of) arguments.  So the following allow for overriding the default calling                         */
  180. /* conventions:                                                                                                                                                    */
  181.  
  182. #ifndef CM_C
  183. #if CM_MICROSOFT
  184. #define CM_C             _cdecl                            /* the "cdecl" keyword for Microsoft C                        */
  185. #elif CM_BORLAND
  186. #define CM_C             cdecl                                /* the "cdecl" keyword for Borland C                            */
  187. #elif CM_ZORTECH
  188. #define CM_C             cdecl                                /* the "cdecl" keyword for Zortech C                            */
  189. #else
  190. #define CM_C                                                     /* no override provided for C calling conventions    */
  191. #endif
  192. #endif
  193.  
  194. #ifndef CM_PASCAL
  195. #if CM_MICROSOFT
  196. #define CM_PASCAL _pascal                            /* the "pascal" keyword for Microsoft C                        */
  197. #elif CM_BORLAND
  198. #define CM_PASCAL pascal                            /* the "pascal" keyword for Borland C                            */
  199. #elif CM_ZORTECH
  200. #define CM_PASCAL pascal                            /* the "pascal" keyword for Zortech C                            */
  201. #else
  202. #define CM_PASCAL                                         /* no override provided for Pascal                                */
  203. #endif
  204. #endif
  205.  
  206. /* Note: Because default linkage conventions are usually a function of the options            */
  207. /*             specified to the compiler, the C and Pascal macros may also be controlled from    */
  208. /*              the options.  Hence the #ifndef's.                                                                                            */
  209.  
  210. /* Finally, the API user doesn't want know or care how the Container Manager is built.    */
  211. /* Nor should the user care what linkage conventions are being used. So the API headers */
  212. /* use the following and more generic attributes of the functions and pointers to                */
  213. /* explicitly override whatever memory model the user is using.  These attributes fall    */
  214. /* into three classes:                                                                                                                                    */
  215.  
  216. /*        1. Pointer sizes: CM_PTR                                                                                                                    */
  217.  
  218. /*             Since the Container Manager is built with the large memory model in 80x86            */
  219. /*             environments, all pointers are "far" pointers.                                                                 */
  220.  
  221. /*        2. Functions that take a variable number of arguments: CM_VARARGS                                    */
  222.  
  223. /*             This is a unique class of functions since the calling conventions for these        */
  224. /*             functions may be different from those with a fixed number of arguments.  For        */
  225. /*             example, in Microsoft, C calling conventions must be used here while the more    */
  226. /*             efficient Pascal calling conventions can be used for functions with a fixed        */
  227. /*             number of arguments (which is class 3).                                                                                */
  228.  
  229. /*        3. Functions that take a fixed number of arguments: CM_FIXEDARGS                                    */
  230.  
  231. /*             API functions that take a fixed number of arguments are given this attribute.    */
  232. /*             This allows the Container Manager builder to use different calling conventions    */
  233. /*             from those used for functions that take a variable number of arguments.                */
  234.  
  235. #define CM_PTR             CM_FAR                        /* pointer attribute                                                            */
  236. #define CM_VARARGS     CM_FAR CM_C             /* variable nbr of arguments function attribute        */
  237. #define CM_FIXEDARGS CM_FAR CM_PASCAL    /* fixed nbr of arguments function attribute            */
  238.  
  239. /* The following are all defined to allow compiling the source under C++.  These are        */
  240. /* used to define all API and handler interfaces as C functions rather than C++                 */
  241. /* functions.  Bracket each function, or group of functions, or their prototypes with        */
  242. /* CM_CFUNCTION and CM_END_CFUNCTION.  Plural versions are also defined to aid                     */
  243. /* readability.                                                                                                                                                    */
  244.  
  245. #ifdef __cplusplus
  246. #define CM_CFUNCTION             extern "C" {
  247. #define CM_CFUNCTIONS         extern "C" {
  248. #define CM_END_CFUNCTION    }
  249. #define CM_END_CFUNCTIONS    }
  250. #else
  251. #define CM_CFUNCTION
  252. #define CM_CFUNCTIONS
  253. #define CM_END_CFUNCTION
  254. #define CM_END_CFUNCTIONS
  255. #endif
  256.  
  257. /* NOTE: There is a subtle C++ semantic rule involving linkage specifications.  When a    */
  258. /*             function is declared as a C function, and that function takes a function             */
  259. /*             pointer as a parameter (e.g., in API calls like CMSetMetaHandler(), handler        */
  260. /*             addresses, etc.), then the passed function must itself be a C function!  Thus    */
  261. /*              such functions must also be bracketed with the above definitions.  Thanks a         */
  262. /*             lot Bjarne (%^%$#@!).                                                                                                                    */
  263.  
  264. #endif
  265.