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

  1. /*====START_GENERATED_PROLOG======================================
  2.  */
  3. /*
  4.  *   COMPONENT_NAME: odconfig
  5.  *
  6.  *   CLASSES: none
  7.  *
  8.  *   ORIGINS: 82,27
  9.  *
  10.  *
  11.  *   (C) COPYRIGHT International Business Machines Corp. 1995,1996
  12.  *   All Rights Reserved
  13.  *   Licensed Materials - Property of IBM
  14.  *   US Government Users Restricted Rights - Use, duplication or
  15.  *   disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
  16.  *       
  17.  *   IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  18.  *   ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  19.  *   PURPOSE. IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  20.  *   CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
  21.  *   USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  22.  *   OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
  23.  *   OR PERFORMANCE OF THIS SOFTWARE.
  24.  */
  25. /*====END_GENERATED_PROLOG========================================
  26.  */
  27. /* @(#) 1.3 com/src/registry/xhandlrs.h, odconfig, od96os2, odos29646d 10/31/96 12:45:25 [11/15/96 15:49:48] */
  28. /* (use tabs = 2 to view this file correctly) */
  29. /*---------------------------------------------------------------------------*
  30.  |                                                                           |
  31.  |                         <<<    XHandlrs.h     >>>                         |
  32.  |                                                                           |
  33.  |            Example Container Manager Basic Handlers Interfaces            |
  34.  |                                                                           |
  35.  |                               Ira L. Ruben                                |
  36.  |                                 12/26/91                                  |
  37.  |                                                                           |
  38.  |                  Copyright Apple Computer, Inc. 1991-1992                 |
  39.  |                           All rights reserved.                            |
  40.  |                                                                           |
  41.  *---------------------------------------------------------------------------*
  42.  
  43.  This file represents the handler header file for the example handler file 
  44.  ExampleHandlers.c.  That file contains complete documentation and an example on how to
  45.  write a set of handlers and a metahandler for the Container Manager API that supports 
  46.  containers in a stream file.
  47.  
  48.  The example is a complete working set of handlers for containers that are stored in
  49.  stream files.  To make this a working example, and to hide its details from the "outside
  50.  world", this header is provided.  As documented in    XHandlrs.c     there are a few
  51.  additional routines that have nothing to do with the API handlers per-se.  Rather they
  52.  allow for manipulation of some of the hidden information.
  53.  
  54.  See    XHandlrs.c     for complete documentation on these routines.
  55. */
  56.  
  57. #ifndef __EXAMPLEHANDLERS__
  58. #define __EXAMPLEHANDLERS__
  59.  
  60. #include "CMAPI.h" 
  61.  
  62.                                   CM_CFUNCTIONS
  63.  
  64. typedef CMType (CM_FIXEDARGS *GetUpdatingTargetType)(CMContainer theUpdatingContainer);
  65.   /*
  66.   This defines the proptype for the getTargetType parameter passed to the refCon creator,
  67.   createRefConForMyHandlers(), defined below.  See that documentation for further details.
  68.   */
  69.   
  70.  
  71. /*------------------------------*
  72.  | Routines REQUIRED by the API |
  73.  *------------------------------*/
  74.   
  75. CMHandlerAddr CM_FIXEDARGS regContainerMetahandler(CMType targetType, CMconst_CMGlobalName operationType);
  76.   /*
  77.   Metahandler proc for determining the addresses of the handler operation routines.
  78.   Pass the address of this routine to a CMSetMetaHandler() call.
  79.   */
  80.  
  81.  
  82. /*------------------------------------------------------------------*
  83.  | Auxiliary routines to make the example available for general use |
  84.  *------------------------------------------------------------------*/
  85.  
  86. CMRefCon CM_FIXEDARGS createRefConForMyHandlers(CMSession sessionData,
  87.                                                 const char CM_PTR *pathname,
  88.                                                 GetUpdatingTargetType getTargetType);
  89.   /*
  90.   Create a reference constant (a "refCon") for container handler use.  Passed as the
  91.   "attributes" to CMOpen[New]Container() and used as the "refCon" for all handler calls.
  92.   
  93.   The sessionData is the pointer to the current global session deta defined by
  94.   CMStartSession().
  95.   
  96.   The pathname defines the name of the stream file to be used as a container.  
  97.   
  98.   The getTargetType defines a pointer to a user defined routine (must be a far pointer for
  99.   DOS 80x86 users) to create a type that, when used by CMNewValue() or CMUseValue() will
  100.   spawn a dynamic value for CMOpenNewContainer() to use when updating another container
  101.   (i.e., the useFlags were kCMUpdateTarget).  The type must be associated with a dynamic
  102.   value handler package that will access the target container to be updated.
  103.   
  104.   The prototype for the getTargetType function should be defined as follows:
  105.   
  106.         CMType CM_FIXEDARGS getTargetType(CMContainer theUpdatingContainer);
  107.     
  108.   The container in which the type is to be created is passed in theUpdatingContainer.
  109.   
  110.   See documentation for returnTargetType_Handler() in    XHandlrs.c     for further
  111.   details.
  112.   
  113.   Note, the getTargetType may be NULL if kCMUpdateTarget useFlags is never passed to 
  114.   CMOpenNewContainer() using this handler package.
  115.   */
  116.  
  117.   
  118. CMRefCon CM_FIXEDARGS setHandlersTrace(CMRefCon refCon, const char tracingState,
  119.                                         FILE CM_PTR *tracingFile);
  120.   /*
  121.   Enable (tracingState != 0) or disable (tracingState == 0) handler tracing to the
  122.   tracingFile.  This routine returns the refCon as its result.
  123.   */
  124.  
  125.                                 CM_END_CFUNCTIONS
  126.  
  127. #endif
  128.