home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1998 May
/
Pcwk5b98.iso
/
WEBSERVE
/
PI3
/
PI3WEB.EXE
/
DEVEL
/
INCLUDE
/
HTTPUtil.h
< prev
next >
Wrap
C/C++ Source or Header
|
1997-10-19
|
10KB
|
360 lines
/*____________________________________________________________________________*\
*
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: HTTPUtil.h$
* $Date: Sun Aug 10 06:36:31 1997$
*
Description:
HTTP utilities which require no context other than thier parameters.
\*____________________________________________________________________________*/
/* $SourceTop:$ */
#ifndef HTTPUTIL_H_
#define HTTPUTIL_H_
#include <time.h>
#include "Pi3API.h"
/*____________________________________________________________________________*\
*
Name:
HTTPUtil_contractPath
Synopsis:
int HTTPUtil_contractPath( char *pPath )
Description:
Contract the directory path <B>pPath</B> in place by removing directories
with the name '..'.
Notes:
Return Values:
Returns the number of directories above the root pPath which should be
discarded. Typically a value of 0 is the desired result.
Errors:
See Also:
\*____________________________________________________________________________*/
PUBLIC_PIAPI int HTTPUtil_contractPath( char *pPath );
/*____________________________________________________________________________*\
*
Name:
HTTPUtil_rFC822Time
Synopsis:
int HTTPUtil_rFC822Time( struct tm *pT, Pi3String *pResult )
Description:
This function is not yet documented.
Notes:
Return Values:
Errors:
See Also:
\*____________________________________________________________________________*/
PUBLIC_PIAPI int HTTPUtil_rFC822Time( struct tm *pT, Pi3String *pResult );
/*____________________________________________________________________________*\
*
Name:
HTTPUtil_rcNumberToName
Synopsis:
const char *HTTPUtil_rcNumberToName( int iRC )
Description:
This function is not yet documented.
Notes:
Return Values:
Errors:
See Also:
\*____________________________________________________________________________*/
PUBLIC_PIAPI const char *HTTPUtil_rcNumberToName( int iRC );
/*____________________________________________________________________________*\
*
Name:
HTTPUtil_rcNameToNumber
Synopsis:
int HTTPUtil_rcNameToNumber( const char *pName )
Description:
This function is not yet documented.
Notes:
Return Values:
Errors:
See Also:
\*____________________________________________________________________________*/
PUBLIC_PIAPI int HTTPUtil_rcNameToNumber( const char *pName );
/*____________________________________________________________________________*\
*
Name:
HTTPUtil_phaseNumberToName
Synopsis:
const char *HTTPUtil_phaseNumberToName( int iPhaseNumber )
Description:
This function is not yet documented.
Notes:
Return Values:
Errors:
See Also:
\*____________________________________________________________________________*/
PUBLIC_PIAPI const char *HTTPUtil_phaseNumberToName( int iPhaseNumber );
/*____________________________________________________________________________*\
*
Name:
HTTPUtil_phaseNameToNumber
Synopsis:
int HTTPUtil_phaseNameToNumber( const char *pPhaseName )
Description:
This function is not yet documented.
Notes:
Return Values:
Errors:
See Also:
\*____________________________________________________________________________*/
PUBLIC_PIAPI int HTTPUtil_phaseNameToNumber( const char *pPhaseName );
/*____________________________________________________________________________*\
*
Name:
HTTPUtil_getHostName
Synopsis:
const char *HTTPUtil_getHostName( PIHTTP *pPIHTTP )
Description:
This function is not yet documented.
Notes:
Return Values:
Errors:
See Also:
\*____________________________________________________________________________*/
PUBLIC_PIAPI const char *HTTPUtil_getHostName( PIHTTP *pPIHTTP );
/*____________________________________________________________________________*\
*
Name:
HTTPUtil_getHostPort
Synopsis:
const char *HTTPUtil_getHostPort( PIHTTP *pPIHTTP )
Description:
This function is not yet documented.
Notes:
Return Values:
Errors:
See Also:
\*____________________________________________________________________________*/
PUBLIC_PIAPI const char *HTTPUtil_getHostPort( PIHTTP *pPIHTTP );
/*____________________________________________________________________________*\
*
Name:
HTTPUtil_protocolNumberToName
Synopsis:
const char *HTTPUtil_protocolNumberToName( int iProtocol )
Description:
This function is not yet documented.
Notes:
Return Values:
Errors:
See Also:
\*____________________________________________________________________________*/
PUBLIC_PIAPI const char *HTTPUtil_protocolNumberToName( int iProtocol );
/*____________________________________________________________________________*\
*
Name:
HTTPUtil_readTime
Synopsis:
HTTPUtil_readTime( const char *pLine, struct tm *pT )
Description:
This function is not yet documented.
Notes:
Return Values:
Errors:
See Also:
\*____________________________________________________________________________*/
PUBLIC_PIAPI int HTTPUtil_readTime( const char *pLine, struct tm *pT );
/*____________________________________________________________________________*\
*
Name:
HTTPUtil_regexMatch
Synopsis:
HTTPUtil_regexMatch( const char *pRegex, int iRegex, const char *pString,
int iStringLen )
Description:
This function is not yet documented.
Notes:
Return Values:
Errors:
See Also:
\*____________________________________________________________________________*/
PUBLIC_PIAPI int HTTPUtil_regexMatch( const char *pRegex, int iRegex,
const char *pString, int iStringLen );
/*____________________________________________________________________________*\
*
Name:
HTTPUtil_regexMatchPi3String
Synopsis:
HTTPUtil_regexMatchPi3String( const Pi3String *pRegexPattern,
const Pi3String *pString )
Description:
This function is not yet documented.
Notes:
Return Values:
Errors:
See Also:
\*____________________________________________________________________________*/
PUBLIC_PIAPI int HTTPUtil_regexMatchPi3String( const Pi3String *pRegexPattern,
const Pi3String *pString );
/*____________________________________________________________________________*\
*
Name:
HTTPUtil_urlEncode
Synopsis:
HTTPUtil_urlEncode( const Pi3String *pToEncode, Pi3String *pResult )
Description:
This function is not yet documented.
Notes:
Return Values:
Errors:
See Also:
\*____________________________________________________________________________*/
PUBLIC_PIAPI void HTTPUtil_urlEncode( const Pi3String *pToEncode,
Pi3String *pResult );
/*____________________________________________________________________________*\
*
Name:
HTTPUtil_urlDecode
Synopsis:
HTTPUtil_urlDecode( const Pi3String *pToDecode, Pi3String *pResult )
Description:
This function is not yet documented.
Notes:
Return Values:
Errors:
See Also:
\*____________________________________________________________________________*/
PUBLIC_PIAPI void HTTPUtil_urlDecode( const Pi3String *pToDecode,
Pi3String *pResult );
/*____________________________________________________________________________*\
*
Name:
HTTPUtil_doHTTPError
Synopsis:
HTTPUtil_doHTTPError( PIHTTP *pPIHTTP, int iError )
Description:
This function is not yet documented.
Notes:
Return Values:
Errors:
See Also:
\*____________________________________________________________________________*/
PUBLIC_PIAPI int HTTPUtil_doHTTPError( PIHTTP *pPIHTTP, int iError );
/*____________________________________________________________________________*\
*
Name:
HTTPUtil_sendFile
Synopsis:
HTTPUtil_sendFile( PIIOBuffer *pBuffer, PIFInfo *pFInfo,
int iBufferingFlags, int iSendFlags )
Description:
This function is not yet documented.
Notes:
Return Values:
Errors:
See Also:
\*____________________________________________________________________________*/
PUBLIC_PIAPI int HTTPUtil_sendFile( PIIOBuffer *pBuffer, PIFInfo *pFInfo,
int iBufferingFlags, int iSendFlags );
#endif /* HTTPUTIL_H_ */