home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1998 May / Pcwk5b98.iso / WEBSERVE / PI3 / PI3WEB.EXE / DEVEL / INCLUDE / PIUtil.h < prev   
C/C++ Source or Header  |  1997-10-19  |  6KB  |  195 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: PIUtil.h$
  43.  * $Date: Sun Aug 10 06:29:39 1997$
  44.  *
  45.  Description:
  46. \*____________________________________________________________________________*/
  47. /* $HeaderTop:$ */
  48.  
  49. #ifndef PIUTIL_H_
  50. #define PIUTIL_H_
  51.  
  52. #include "PiAPI.h"
  53.  
  54. /*____________________________________________________________________________*\
  55.  *
  56.  Name:
  57.     PIUtil_malloc
  58.  
  59.  Synopsis:
  60.     void *PIUtil_malloc( unsigned long lSize )
  61.     
  62.  Description:
  63.     Allocate memory.    
  64.  
  65.  Notes:
  66.     Memory allocated with PIUtil_malloc() should be freed with 
  67.     PIUtil_free().
  68.  
  69.  Return Values:
  70.     On success this function returns a non-NULL pointer to a memory
  71.     area of size equal to or greater than lSize.
  72.  
  73.  Errors:
  74.     PIUtil_malloc() returns NULL if the requested memory could not
  75.     be allocated.
  76.  
  77.     More error information is available via PIPlatform_getLastError().
  78.  
  79.  See Also:
  80.     PIUtil_free().
  81. \*____________________________________________________________________________*/
  82. PUBLIC_PIAPI void *PIUtil_malloc( unsigned long ulData );
  83.  
  84. /*____________________________________________________________________________*\
  85.  *
  86.  Name:
  87.     PIUtil_stricmp
  88.  
  89.  Synopsis:
  90.     int PIUtil_stricmp( const char *pS1, const char *pS2 )
  91.     
  92.  Description:
  93.     Compare two strings without case sensitivity.
  94.  
  95.  Notes:
  96.     The result is undefined if either parameter is NULL.
  97.  
  98.  Return Values:
  99.     This function returns the following values
  100.  
  101.     > 0 if pS1 is lexigraphically greater than pS2
  102.     < 0 if pS2 is lexigraphically greater than pS1
  103.     0 if both strings are lexigraphically equivalent
  104.  
  105.  Errors:
  106.     There are no error return codes from this function.
  107.  
  108.  See Also:
  109. \*____________________________________________________________________________*/
  110. PUBLIC_PIAPI int PIUtil_stricmp( const char *pS1, const char *pS2 );
  111.  
  112. /*____________________________________________________________________________*\
  113.  *
  114.  Name:
  115.     PIUtil_strncmpi
  116.  
  117.  Synopsis:
  118.     int PIUtil_strncmpi( const char *pS1, const char *pS2, int iLen )
  119.     
  120.  Description:
  121.     Compare two strings without case sensitivity up to iLen characters.
  122.  
  123.  Notes:
  124.     The result is undefined if either parameter is NULL.
  125.  
  126.  Return Values:
  127.     This function returns the following values
  128.  
  129.     > 0 if pS1 is lexigraphically greater than pS2
  130.     < 0 if pS2 is lexigraphically greater than pS1
  131.     0 if both strings are lexigraphically equivalent
  132.  
  133.  Errors:
  134.     There are no error return codes from this function.
  135.  
  136.  See Also:
  137. \*____________________________________________________________________________*/
  138. PUBLIC_PIAPI int PIUtil_strncmpi( const char *pS1, const char *pS2, int iLen );
  139.  
  140. /*____________________________________________________________________________*\
  141.  *
  142.  Name:
  143.     PIUtil_strdup
  144.  
  145.  Synopsis:
  146.     char *PIUtil_strdup( const char *pS )
  147.     
  148.  Description:
  149.     Duplicate a NULL terminated character array.
  150.  
  151.  Notes:
  152.     The function PIUtil_free() should be used to deallocate memory
  153.     allocated via PIUtil_strdup().
  154.  
  155.  Return Values:
  156.     On success PIUtil_strdup returns a copy of the character array
  157.     pS.
  158.  
  159.  Errors:
  160.     On error PIUtil_strdup() returns NULL.
  161.  
  162.     More information is available via PIPlatform_getLastError().
  163.  
  164.  See Also:
  165.     PIUtil_free().
  166. \*____________________________________________________________________________*/
  167. PUBLIC_PIAPI char *PIUtil_strdup( const char *pS );
  168.  
  169. /*____________________________________________________________________________*\
  170.  *
  171.  Name:
  172.     PIUtil_free
  173.  
  174.  Synopsis:
  175.     void PIUtil_free( void *pV )
  176.     
  177.  Description:
  178.     Deallocate memory allocated by another function with the PIUtil_
  179.     prefix.
  180.  
  181.  Notes:
  182.  Return Values:
  183.     PIUtil_free() does not return a value.
  184.  
  185.  Errors:
  186.     None.
  187.  
  188.  See Also:
  189.     PIUtil_malloc().
  190. \*____________________________________________________________________________*/
  191. PUBLIC_PIAPI void PIUtil_free( void *pV );
  192.  
  193. #endif    /* PIUTIL_H_ */
  194.  
  195.