/* Header file for RocketAware High Reuse High Compatibility Library librock/html.h - - - - - - - - - - - - Copyright Notice - - - - - - - - - - - - Copyright 1998-2000 Forrest J. Cavalier III See http://www.rocketaware.com/librock/ for documentation and original copies of this software. This software shall be distributed with the implementation source code according to the license terms therein. License text in librock_LIDESC_HC=12440211096131f5976d36be0cddca4cd9152e45 */ #ifndef librock_INC_HTML_H #define librock_INC_HTML_H #include #ifdef __cplusplus extern "C" { #endif /**************************************************************/ char *librock_HTML_astrcatEntityEncode(char * *ppasz,const char *text,int len); char *librock_HTML_astrcatEntityDecode(char * *ppasz,const char *textHTML,int len); char *librock_HTML_astrcatValueEncode(char * *ppasz,const char *pString,int cbString); char *librock_HTTP_astrcatUrlEncode(char **ppasz,const char *pString,int cbString); char *librock_HTTP_astrcpyFieldFromUrlEncode(char * *ppasz,const char *pszName,const char *pszQuerystring); char *librock_HTTP_astrSetFieldUrlEncode(char * *ppaszQueryString,const char *pszName,const char *pszValue); /**************************************************************/ #ifdef librock_SOCKET struct librock_HTTPaccess_s { librock_SOCKET s; int bPERSIST; /* already a connection open */ int bHTTP1_1; /* Attempt connection as HTTP/1.1 */ struct sockaddr_in saddr; int bSKIPDNS; /* Set nonzero when saddr is filled in, the lookup is done once */ const char *pszHost; char *pszURI; int nPort; const char *pszAuthUser; const char *pszAuthPass; const char *pszProxy; int nProxyPort; void (*progress)(struct librock_HTTPaccess_s *,const char *); long cbContent; /* Content length, or one of the following */ #define librock_HTTPaccess_CHUNKED -1 #define librock_HTTPaccess_UNTILCLOSE -2 int cbInbuf; char *buf; int cbBuf; int cAttempt; const char *pszError; struct librock_SSL_CTX_s* ctx; struct librock_SSL_s* ssl; }; void librock_HTTPaccess_Initialize(struct librock_HTTPaccess_s *pHTA, char * buf,int cbBuf); const char *librock_HTTPaccess_ParseURL(struct librock_HTTPaccess_s *pHTA,const char *pszURL,const char *pszProxy); const char *librock_HTTPaccess_OpenConn(struct librock_HTTPaccess_s *pHTA); void librock_HTTPaccess_CloseConn(struct librock_HTTPaccess_s *pHTA); const char *librock_HTTPaccess_GenRequest(struct librock_HTTPaccess_s *pHTA, const char *pszURI); const char *librock_HTTPaccess_SendRequest(struct librock_HTTPaccess_s *pHTA, const char *pszRequest); const char * librock_HTTPaccess_ReadHead(struct librock_HTTPaccess_s *pHTA,int *pcbHead); const char * librock_HTTPaccess_ProcessHead(struct librock_HTTPaccess_s *pHTA,int cbHead); const char *librock_HTTPaccess_ReadBody(struct librock_HTTPaccess_s *pHTA, int (*fn)(void *,const char *,int), void *pID); /* passed to fn */ const char *librock_HTTPaccess_Retrieve(struct librock_HTTPaccess_s *pHTA, char *pszURI, int (*fn)(void *,const char *,int), void *pID); #endif #ifdef __cplusplus }; #endif #include #endif /* $Log: html.h,v $ Revision 1.5 2002/03/18 19:30:47 forrest@mibsoftware.com rights=#1 Prototypes for httpacc.c Revision 1.4 2002/02/10 03:17:44 forrest@mibsoftware.com rights=#1 Fix LIDESC Revision 1.3 2002/02/10 02:39:26 forrest@mibsoftware.com rights=#1 Space/Tab cleanup. Fix lidesc. Standardized chg log Revision 1.2 2002/01/29 04:40:02 forrest@mibsoftware.com rights=#1 Prep for publish. API clean up, TAB, space at eol removal Revision 1.1 2001/01/06 19:36:17 forrest@mibsoftware.com rights=#1 Initial import to CVS rights#1 Copyright (c) Forrest J Cavalier III d-b-a Mib Software rights#1 License text in librock_LIDESC_HC=12440211096131f5976d36be0cddca4cd9152e45 */