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

  1. /* @(#)Z 1.4 com/src/cm/CMAPIDbg.h, odstorage, od96os2, odos29646d 96/11/15 15:26:41 (96/10/29 09:15:55) */
  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:        CMAPIDbg.h
  31.  
  32.     Contains:    Container Manager Global Name Values Interfaces
  33.  
  34.     Written by:    Ira L. Ruben
  35.  
  36.     Owned by:    Ed Lai
  37.  
  38.     Copyright:    ⌐ 1994 by Apple Computer, Inc., all rights reserved.
  39.  
  40.     Change History (most recent first):
  41.  
  42.          <2>     8/26/94    EL        #1181622 Ownership update.
  43.  
  44.     To Do:
  45. */
  46.  
  47. /*---------------------------------------------------------------------------*
  48.  |                                                                           |
  49.  |                           <<< CM_API_Debug.h >>>                          |
  50.  |                                                                           |
  51.  |              Container Manager Global Name Values Interfaces              |
  52.  |                                                                           |
  53.  |                               Ira L. Ruben                                |
  54.  |                                  3/30/92                                  |
  55.  |                                                                           |
  56.  |                    Copyright Apple Computer, Inc. 1992-1994               |
  57.  |                           All rights reserved.                            |
  58.  |                                                                           |
  59.  *---------------------------------------------------------------------------*
  60.  
  61.  This file defines a set of special debugging API routines and switches.  They are kept
  62.  separate from the API since they may or may not be supported in a particular installation.
  63.  
  64.  There are three routines:
  65.  
  66.      1. CMDebugging()                    - to set some internal debugging "options"
  67.     2. CMDumpTOCStructures()    - to dump in-memory TOC as a tree-like format
  68.     3. CMDumpContainerTOC()        - to read in container TOC and display it in a table format
  69. */
  70.  
  71. #ifndef __CM_API_DEBUG__
  72. #define __CM_API_DEBUG__
  73.  
  74. #include <stdio.h>
  75.  
  76. #ifndef __CM_API__
  77. #include "CMAPI.h"
  78. #endif
  79.  
  80.  
  81. /*                        C A U T I O N   A N D   N O T E!                                                            */
  82. /*                        --------------------------------                                                            */
  83.  
  84. /* In order to be able to use these routines the Container Manager API code must have        */
  85. /* the routines defined!  They may be suppressed as a function of the installation.          */
  86. /* Thus this file should NOT be supplied if the Container Manager is built with these     */
  87. /* suppressed.  Even if it is, it is left up to the builder is s/he wants these routines*/
  88. /* publically known.                                                                                                                                        */
  89.  
  90.  
  91.                                                                          CM_CFUNCTIONS
  92.  
  93. void CM_FIXEDARGS CMDebugging(CMSession sessionData, CM_USHORT tocTableSize, 
  94.                                                             FILE CM_PTR *debuggingFile, CMBoolean doValidations);
  95.     /*
  96.     This routine provides some debugging "options" to the API.  It must be called AFTER 
  97.      CMStartSession() but BEFORE any containers are opened.  It takes the session global data
  98.   pointer returned by CMStartSession() and adds (actually modifies) some of the data there
  99.   to enable debugging.
  100.     
  101.     The current options that can be set are:
  102.     
  103.     1. The size of the TOC index tables.  If 0 is passed, the default is used.  The 
  104.          current in-memory TOC implementation scheme utilizes index tables.  Each level of
  105.          table represents one digit of an object descriptor ID.  For ID=123 there are three
  106.          tables.  A hundereds table, a tens table, and finally the unit (lowest level)
  107.          table.  The i'th entry of a table points to the next lower table.  The lowest
  108.          table of course points to the object itself in memory.  The tocTableSize determines
  109.          the size of these tables.  The current defualt is 256.
  110.     
  111.     2. A FILE* debugging output variable. It is usually stdout, stderr, or NULL. For NULL,
  112.          no debugging output is produced.  Currently this thing is used to display the TOC
  113.          as a table when it is open for input (if CMDUMPTOC was set).
  114.               
  115.     3. The dynamic switch controlling the refNum validations (e.g., checking for NULL) and
  116.          various other protections.  If set to 0 the protection checks are suppressed.  If
  117.          nonzero they are performed, but only if the protection code is present.  On a per-
  118.          installation basis it may be suppressed.  In that case the switch has no effect.
  119. */
  120.  
  121.  
  122. void CM_FIXEDARGS CMDumpTOCStructures(CMContainer container, FILE CM_PTR *f);
  123.     /*
  124.     This routine is used for internal debugging of the TOC data structures for the specified
  125.     container.  It displays their current state to the (open) file associated with the
  126.     specified file variable, f.
  127.     */
  128.  
  129.  
  130. void CM_FIXEDARGS CMDumpContainerTOC(CMconst_CMContainer container, FILE CM_PTR *f,
  131.                                                                         const CM_ULONG tocOffset, const CM_ULONG tocSize);
  132.     /*
  133.     This routine is used for internal debugging of the TOC data as it appears in its final
  134.     form in the container itself.  The entire TOC in the container, starting at container
  135.     offset tocOffset for tocSize bytes, is displayed to the (open) file associated with the
  136.     file variable f.  It is formatted, but otherwise  unchanged.  You can use this routine to
  137.     see if the TOC was correctly written to its container.
  138.     
  139.     Note, the container's handler routines are used to do the positioning and reading.  It
  140.     is assumed that the passed tocOffset and tocSize are valid (from a container label).
  141.     */
  142.  
  143.                                                                     CM_END_CFUNCTIONS
  144. #endif
  145.