home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1998 May / Pcwk5b98.iso / WEBSERVE / PI3 / PI3WEB.EXE / DEVEL / INCLUDE / PILib.h < prev    next >
C/C++ Source or Header  |  1997-10-19  |  5KB  |  149 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: PILib.h$
  43.  * $Date: Sun Aug 10 06:42:18 1997$
  44.  *
  45.  Description:
  46. \*____________________________________________________________________________*/
  47. /* $HeaderTop:$ */
  48.  
  49. #ifndef PILIB_H_
  50. #define PILIB_H_
  51.  
  52. #include "Pi2API.h"
  53.  
  54. /*____________________________________________________________________________*\
  55.  *
  56. Definitions
  57. \*____________________________________________________________________________*/
  58. typedef struct DLL PILibrary;
  59.  
  60. /*____________________________________________________________________________*\
  61.  *
  62.  Name:
  63.     PILibrary_load
  64.  
  65.  Synopsis:
  66.     const PILibrary *PILibrary_load( PIDB *pDB, PIConfig *pConfig,
  67.         const char *pLibraryName )
  68.     
  69.  Description:
  70.     Attempts to load the library with name pLibraryName from the 
  71.     parsed configuration file pConfigDB.
  72.  
  73.     If pConfigDB is NULL then PIConfig_findConfiguration() is used to
  74.     find the configuration DB from pDB.
  75.  
  76.  Notes:
  77.  Return Values:
  78.     On success PILibrary_load() returns a const pointer to the a new PILibrary
  79.     object.
  80.  
  81.  Errors:
  82.     PIAPI_EINVAL    if pDB or pLibraryName is NULL.
  83.     PIAPI_ERROR        if another error occurred.
  84.  
  85.  See Also:
  86. \*____________________________________________________________________________*/
  87. PUBLIC_PIAPI const PILibrary *PILibrary_load( PIDB *pDB, PIConfig *pConfig,
  88.     const char *pLibraryName );
  89.  
  90. /*____________________________________________________________________________*\
  91.  *
  92.  Name:
  93.     PILibrary_lookup
  94.  
  95.  Synopsis:
  96.     const PILibrary *PILibrary_lookup( PIDB *pDB, const char *pLibraryName );
  97.     
  98.  Description:
  99.     Looks under the root node of pDB for a PIDB tree with a key of
  100.     PIDBKEY_LIBRARIES, then searches within this tree for an element
  101.     with key pLibraryName. If found this element is returned.
  102.  
  103.  Notes:
  104.  Return Values:
  105.     On success PILibrary_lookup() returns a const pointer to a new
  106.     PILibrary object.
  107.  
  108.  Errors:
  109.     PIAPI_EINVAL    if pDB or pLibraryName is NULL.
  110.     PIAPI_ERROR        if another error occurred.
  111.  
  112.  See Also:
  113. \*____________________________________________________________________________*/
  114. PUBLIC_PIAPI const PILibrary *PILibrary_lookup( PIDB *pDB,
  115.     const char *pLibrary );
  116.  
  117. /*____________________________________________________________________________*\
  118.  *
  119.  Name:
  120.     PILibrary_lookupOrLoad
  121.  
  122.  Synopsis:
  123.     const PILibrary *PILibrary_lookupOrLoad( PIDB *pDB, PIConfig *pConfig,
  124.         const char *pLibraryName )
  125.     
  126.  Description:
  127.     This function first attempts to find an existing library using
  128.     PILibrary_lookup(). If that fails it attempts to load the library
  129.     from the parsed configuration DB pConfigDB using PILibrary_load().
  130.  
  131.  Notes:
  132.     See PILibrary_lookup() and PILibrary_load() for more details.
  133.  
  134.  Return Values:
  135.     On success PILibrary_lookup() returns a const pointer to the 
  136.     specificed PILibrary object.
  137.  
  138.  Errors:
  139.     PIAPI_EINVAL    if pDB or pLibraryName is NULL.
  140.     PIAPI_ERROR        if another error occurred.
  141.  
  142.  See Also:
  143. \*____________________________________________________________________________*/
  144. PUBLIC_PIAPI const PILibrary *PILibrary_lookupOrLoad( PIDB *pDB, 
  145.     PIConfig *pConfig, const char *pLibraryName );
  146.  
  147. #endif    /* PILIB_H_ */
  148.  
  149.