⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 piutil.h

📁 mini http server,可以集成嵌入到程序中,实现简单的web功能
💻 H
字号:
/*____________________________________________________________________________*\
 *

 Copyright (c) 1997-2003 John Roy, Holger Zimmermann. 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. The name of the author may not be used to endorse or promote products
    derived from this software without specific prior written permission.

 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: /cvsroot/pi3web/Pi3Web_200/Source/PiAPI/PIUtil.h,v $
 * $Date: 2003/05/13 18:42:12 $
 *
 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

	<ul compact>
		<li>&gt; 0 if pS1 is lexigraphically greater than pS2
		<li>&lt; 0 if pS2 is lexigraphically greater than pS1
		<li>0 if both strings are lexigraphically equivalent
	</ul>

 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

	<ul compact>
		<li>&gt; 0 if pS1 is lexigraphically greater than pS2<BR>
		<li>&lt; 0 if pS2 is lexigraphically greater than pS1<BR>
		<li>0 if both strings are lexigraphically equivalent
	</ul>

 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_ */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -