home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1998 May / Pcwk5b98.iso / WEBSERVE / PI3 / PI3WEB.EXE / DEVEL / INCLUDE / PIProg.h < prev    next >
C/C++ Source or Header  |  1997-10-19  |  4KB  |  132 lines

  1. /*____________________________________________________________________________*\
  2.  *
  3.  
  4.  Copyright (c) 1997 John Roy. All rights reserved.
  5.  
  6.  These sources, libraries and applications are
  7.  FREE FOR COMMERCIAL AND NON-COMMERCIAL USE
  8.  as long as the following conditions are adhered to.
  9.  
  10.  Redistribution and use in source and binary forms, with or without
  11.  modification, are permitted provided that the following conditions
  12.  are met:
  13.  
  14.  1. Redistributions of source code must retain the above copyright
  15.     notice, this list of conditions and the following disclaimer. 
  16.  
  17.  2. Redistributions in binary form must reproduce the above copyright
  18.     notice, this list of conditions and the following disclaimer in
  19.     the documentation and/or other materials provided with the
  20.     distribution.
  21.  
  22.  3. Redistributions of any form whatsoever and all advertising materials 
  23.     mentioning features must contain the following
  24.     acknowledgment:
  25.     "This product includes software developed by John Roy
  26.     (http://www.johnroy.com/pi3/)."
  27.  
  28.  THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  29.  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  30.  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  31.  IN NO EVENT SHALL THE AUTHORS OR ITS CONTRIBUTORS BE LIABLE FOR ANY
  32.  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  33.  DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
  34.  GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  35.  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
  36.  STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  37.  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
  38.  OF THE POSSIBILITY OF SUCH DAMAGE.
  39.  
  40.  *____________________________________________________________________________*|
  41.  *
  42.  * $Source: PIProg.h$
  43.  * $Date: Sun Aug 10 06:42:19 1997$
  44.  *
  45.  Description:
  46.     Functions which manipulate the program database to do standard things
  47.     like read configuration files, load libraries and classes and set
  48.     standard program values.
  49. \*____________________________________________________________________________*/
  50. /* $HeaderTop:$ */
  51.  
  52. #ifndef PIPROG_H_
  53. #define PIPROG_H_
  54.  
  55. #include "Pi2API.h"
  56.  
  57. /*____________________________________________________________________________*\
  58.  *
  59.  Typedefs:
  60. \*____________________________________________________________________________*/
  61. typedef void (* PIProgramFn)( PIDB *pDB );
  62. #define PIPROGRAM_VERSION_1_0    100
  63.  
  64. /*____________________________________________________________________________*\
  65.  *
  66.  Name:
  67.     PIProgram_enter
  68.  
  69.  Synopsis:
  70.     int PIProgram_enter( const char *pProgramName, int iVersion,
  71.         PIProgramFn fn )
  72.  
  73.  Description:
  74.     Initializes the program database and platform facilities. If successful
  75.     it invokes the user supplied function fn.
  76.  
  77.  Notes:
  78.     PIProgam_enter should be invoked with the value PIPROGRAM_VERSION_1_0
  79.     for parameter iVersion.
  80.  
  81.     PIProgram_enter automatically invokes PIPlatform_enter with the
  82.     platform version PIPLATFORM_VERSION_1_0 to initialize multithreading
  83.     and custom memory management facilities.
  84.  
  85.     The parameter pProgramName should be passed argv[0] from the main()
  86.     entry point to the program. This may be used by certain platform
  87.     implementations.
  88.  
  89.  Return Values:
  90.     On success PIProgram_enter() returns zero (PIAPI_COMPLETED)
  91.  
  92.  Errors:
  93.     PIAPI_EINVAL     if iVersion is not supported or fn is NULL.
  94.     PIAPI_ERROR        if another error occurred.
  95.  
  96.  See Also:
  97. \*____________________________________________________________________________*/
  98. PUBLIC_PIAPI int PIProgram_enter( const char *pProgramName, int iVersion,
  99.     PIProgramFn fn );
  100.  
  101. /*____________________________________________________________________________*\
  102.  *
  103.  Name:
  104.     PIProgram_dbgDump
  105.  
  106.  Synopsis:
  107.     int PIProgram_dbgDump( PIDB *pDB, const char *pDumpFile )
  108.  
  109.  Description:
  110.     Dump the entire contents of the database referenced by pDB to the
  111.     file pDumpFile. The file is opened in write truncate mode.
  112.     If pDumpFile is NULL PIProgram_dbgDump will attempt to write data
  113.     to the standard output stream.
  114.  
  115.  Notes:
  116.     PIProgram_dbgDump formats the data in a hierarchical tree
  117.     format.
  118.  
  119.  Return Values:
  120.     On success PIProgram_dbgDump() returns zero (PIAPI_COMPLETED).
  121.  
  122.  Errors:
  123.     PIAPI_EINVAL    if pDB is NULL.
  124.     PIAPI_ERROR     if another error occurred.
  125.  
  126.  See Also:
  127. \*____________________________________________________________________________*/
  128. PUBLIC_PIAPI int PIProgram_dbgDump( PIDB *pDB, const char *pDumpFile );
  129.  
  130. #endif    /* PIPROG_H_ */
  131.  
  132.