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

📄 pifinfo.h

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

 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/PIFInfo.h,v $
 * $Date: 2003/05/13 18:42:12 $
 *
 Description:
\*____________________________________________________________________________*/
/* $HeaderTop:$ */

#ifndef PIFINFO_H_
#define PIFINFO_H_

#include "PiAPI.h"

/*____________________________________________________________________________*\
 *
 Typedefs:
\*____________________________________________________________________________*/
typedef struct FileSystemEntity PIFInfo;
#define PIPLATFORM_FSIZE unsigned long

/*____________________________________________________________________________*\
 *
 Name:
	PIFInfo_new

 Synopsis:
	PIFInfo *PIFInfo_new( const char *pPath )

 Description:
	Create a new file information object.

 Notes:
	This object should be deleted with PIFInfo_delete() when it is
	no longer needed.

 Return Values:
	On success PIFInfo_new() return a pointer to a new PIFInfo object.

 Errors:
	NULL will be returned if an pPath is NULL or memory could not be 
	allocated for the new PIFInfo object.
	
	More specific error information can be retrieved using
	PIPlatform_getLastError().
		
 See Also:
	PIFInfo_delete().
\*____________________________________________________________________________*/
PUBLIC_PIAPI PIFInfo *PIFInfo_new( const char *pPath );

/*____________________________________________________________________________*\
 *
 Name:
	PIFInfo_delete

 Synopsis:
	int PIFInfo_delete( PIFInfo *pFileInfo );

 Description:
	Destroys an PIFInfo object and free any memory associated with it.

 Notes:
	Using pFileInfo for any further operations after PIFInfo_delete()
	has been used will cause undefined behaviour.
	
 Return Values:
	On success PIFInfo_delete() returns zero (PIAPI_COMPLETED).

 Errors:
	On error PIFInfo_delete() will return a non-zero value. The function
	PIPlatform_getLastError() can be used to retreve more specific error
	information.

 See Also:
	PIFInfo_new().
\*____________________________________________________________________________*/
PUBLIC_PIAPI int PIFInfo_delete( PIFInfo *pFileInfo );

/*____________________________________________________________________________*\
 *
 Name:
	PIFInfo_exists

 Synopsis:
	int PIFInfo_exists( PIFInfo *pFileInfo )

 Description:
	Specifies whether or not the file information object pFileInfo
	refers to a file that actually exists.
	
 Notes:
	Always compare this return code against PIAPI_TRUE as some
	error return value may be non-negative.

 Return Values:
	On success PIFInfo_exists() returns either PIAPI_TRUE or
	PIAPI_FALSE, indicating whether or not a file respresented by
	pFileInfo exists.

 Errors:
	This function does not generate an error.
		
 See Also:
	PIFInfo_isRegular(), PIFInfo_isReadable(),
	PIFInfo_isDirectory(), PIFInfo_isLink().
\*____________________________________________________________________________*/
PUBLIC_PIAPI int PIFInfo_exists( PIFInfo *pFileInfo );

/*____________________________________________________________________________*\
 *
 Name:
	PIFInfo_getName

 Synopsis:
	const char *PIFInfo_getName( PIFInfo *pFileInfo )

 Description:
	Returns the name of the file referred to by pFileInfo.
	
 Notes:
 Return Values:
	On sucess PIFInfo_getName() returns a non-NULL pointer to
	the filename.

 Errors:
	On error PIFInfo_getName() returns NULL. The function
	PIPlatform_getLastError() can be used to retrieve more specific
	error information.

 See Also:
	PIFInfo_getPath()
\*____________________________________________________________________________*/
PUBLIC_PIAPI const char *PIFInfo_getName( PIFInfo *pFileInfo );

/*____________________________________________________________________________*\
 *
 Name:
	PIFInfo_getAlternateName

 Synopsis:
	const char *PIFInfo_getAlternateName( PIFInfo *pFileInfo )

 Description:
	Returns the alternet name of the file referred to by pFileInfo.
	
 Notes:
	Some operating systems maintain alternate filenames for files. This
	function can be used to access the alternate filename. When the
	operating system does not define an alternate file 
	PIFInfo_getAlternateName() behaves as PIFInfo_getName().

 Return Values:
	On sucess PIFInfo_getAlternateName() returns a non-NULL pointer to
	the alternate filename.

 Errors:
	On error PIFInfo_getAlternateName() returns NULL. The function
	PIPlatform_getLastError() can be used to retrieve more specific
	error information.

 See Also:
	PIFInfo_getPath()
\*____________________________________________________________________________*/
PUBLIC_PIAPI const char *PIFInfo_getAlternateName( PIFInfo *pFileInfo );

/*____________________________________________________________________________*\
 *
 Name:
	PIFInfo_getPath

 Synopsis:
	const char *PIFInfo_getPath( PIFInfo *pFileInfo )

 Description:
	Returns the full path to the file referred to by pFileInfo.
	
 Notes:
 Return Values:
	On sucess PIFInfo_getPath() returns a non-NULL pointer to
	the files path.

 Errors:
	On error PIFInfo_getPath() returns NULL. The function
	PIPlatform_getLastError() can be used to retrieve more specific
	error information.

 See Also:
	PIFInfo_getName()
\*____________________________________________________________________________*/
PUBLIC_PIAPI const char *PIFInfo_getPath( PIFInfo *pFileInfo );

/*____________________________________________________________________________*\
 *
 Name:
	PIFInfo_getPathRoot

 Synopsis:
	const char *PIFInfo_getPathRoot( PIFInfo *pFileInfo )

 Description:
	Returns the file path to the directory containing the file 	
	referred to by pFileInfo.
	
 Notes:

 Return Values:
	On sucess PIFInfo_getPathRoot() returns a non-NULL pointer.

 Errors:
	On error PIFInfo_getPathRoot() returns NULL. The function
	PIPlatform_getLastError() can be used to retrieve more specific
	error information.

 See Also:
	PIFInfo_getPath()
\*____________________________________________________________________________*/
PUBLIC_PIAPI const char *PIFInfo_getPathRoot( PIFInfo *pFileInfo );

/*____________________________________________________________________________*\
 *
 Name:
	PIFInfo_isRegular

 Synopsis:
	int PIFInfo_isRegular( PIFInfo *pFileInfo )

 Description:
	Specifies whether or not the file information object pFileInfo
	refers to a file that is a regular file. 
	
 Notes:
	Directories and symbolic links are some of the valid PIFInfo 
	objects that are not regular files.

 Return Values:
	On success PIFInfo_isRegular() returns either PIAPI_TRUE or
	PIAPI_FALSE, indicating whether or not a file respresented by
	pFileInfo is a regular file.

 Errors:
	This function does not generate an error.

 See Also:
	PIFInfo_exists(), PIFInfo_isReadable(),
	PIFInfo_isDirectory(), PIFInfo_isLink().
\*____________________________________________________________________________*/
PUBLIC_PIAPI int PIFInfo_isRegular( PIFInfo *pFileInfo );

/*____________________________________________________________________________*\
 *
 Name:
	PIFInfo_isDirectory

 Synopsis:
	int PIFInfo_isDirectory( PIFInfo *pFileInfo )

 Description:
	Specifies whether or not the file information object pFileInfo
	refers to a directory.
	
 Notes:

 Return Values:
	On success PIFInfo_isDirectory() returns either PIAPI_TRUE or
	PIAPI_FALSE, indicating whether or not a file respresented by
	pFileInfo is a directory.

⌨️ 快捷键说明

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