home *** CD-ROM | disk | FTP | other *** search
- /*____________________________________________________________________________*\
- *
-
- Copyright (c) 1997 John Roy. All rights reserved.
-
- These sources, libraries and applications are
- FREE FOR COMMERCIAL AND NON-COMMERCIAL USE
- as long as the following conditions are adhered to.
-
- Redistribution and use in source and binary forms, with or without
- modification, are permitted provided that the following conditions
- are met:
-
- 1. Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-
- 2. Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in
- the documentation and/or other materials provided with the
- distribution.
-
- 3. Redistributions of any form whatsoever and all advertising materials
- mentioning features must contain the following
- acknowledgment:
- "This product includes software developed by John Roy
- (http://www.johnroy.com/pi3/)."
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
- WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- IN NO EVENT SHALL THE AUTHORS OR ITS CONTRIBUTORS BE LIABLE FOR ANY
- DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
- GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
- OF THE POSSIBILITY OF SUCH DAMAGE.
-
- *____________________________________________________________________________*|
- *
- * $Source: PIUtil.h$
- * $Date: Sun Aug 10 06:29:39 1997$
- *
- Description:
- \*____________________________________________________________________________*/
- /* $HeaderTop:$ */
-
- #ifndef PIUTIL_H_
- #define PIUTIL_H_
-
- #include "PiAPI.h"
-
- /*____________________________________________________________________________*\
- *
- Name:
- PIUtil_malloc
-
- Synopsis:
- void *PIUtil_malloc( unsigned long lSize )
-
- Description:
- Allocate memory.
-
- Notes:
- Memory allocated with PIUtil_malloc() should be freed with
- PIUtil_free().
-
- Return Values:
- On success this function returns a non-NULL pointer to a memory
- area of size equal to or greater than lSize.
-
- Errors:
- PIUtil_malloc() returns NULL if the requested memory could not
- be allocated.
-
- More error information is available via PIPlatform_getLastError().
-
- See Also:
- PIUtil_free().
- \*____________________________________________________________________________*/
- PUBLIC_PIAPI void *PIUtil_malloc( unsigned long ulData );
-
- /*____________________________________________________________________________*\
- *
- Name:
- PIUtil_stricmp
-
- Synopsis:
- int PIUtil_stricmp( const char *pS1, const char *pS2 )
-
- Description:
- Compare two strings without case sensitivity.
-
- Notes:
- The result is undefined if either parameter is NULL.
-
- Return Values:
- This function returns the following values
-
- > 0 if pS1 is lexigraphically greater than pS2
- < 0 if pS2 is lexigraphically greater than pS1
- 0 if both strings are lexigraphically equivalent
-
- Errors:
- There are no error return codes from this function.
-
- See Also:
- \*____________________________________________________________________________*/
- PUBLIC_PIAPI int PIUtil_stricmp( const char *pS1, const char *pS2 );
-
- /*____________________________________________________________________________*\
- *
- Name:
- PIUtil_strncmpi
-
- Synopsis:
- int PIUtil_strncmpi( const char *pS1, const char *pS2, int iLen )
-
- Description:
- Compare two strings without case sensitivity up to iLen characters.
-
- Notes:
- The result is undefined if either parameter is NULL.
-
- Return Values:
- This function returns the following values
-
- > 0 if pS1 is lexigraphically greater than pS2
- < 0 if pS2 is lexigraphically greater than pS1
- 0 if both strings are lexigraphically equivalent
-
- Errors:
- There are no error return codes from this function.
-
- See Also:
- \*____________________________________________________________________________*/
- PUBLIC_PIAPI int PIUtil_strncmpi( const char *pS1, const char *pS2, int iLen );
-
- /*____________________________________________________________________________*\
- *
- Name:
- PIUtil_strdup
-
- Synopsis:
- char *PIUtil_strdup( const char *pS )
-
- Description:
- Duplicate a NULL terminated character array.
-
- Notes:
- The function PIUtil_free() should be used to deallocate memory
- allocated via PIUtil_strdup().
-
- Return Values:
- On success PIUtil_strdup returns a copy of the character array
- pS.
-
- Errors:
- On error PIUtil_strdup() returns NULL.
-
- More information is available via PIPlatform_getLastError().
-
- See Also:
- PIUtil_free().
- \*____________________________________________________________________________*/
- PUBLIC_PIAPI char *PIUtil_strdup( const char *pS );
-
- /*____________________________________________________________________________*\
- *
- Name:
- PIUtil_free
-
- Synopsis:
- void PIUtil_free( void *pV )
-
- Description:
- Deallocate memory allocated by another function with the PIUtil_
- prefix.
-
- Notes:
- Return Values:
- PIUtil_free() does not return a value.
-
- Errors:
- None.
-
- See Also:
- PIUtil_malloc().
- \*____________________________________________________________________________*/
- PUBLIC_PIAPI void PIUtil_free( void *pV );
-
- #endif /* PIUTIL_H_ */
-
-