"Fossies" - the Fresh Open Source Software Archive

Member "tidy-html5-5.8.0/experimental/httpio.h" (16 Jul 2021, 1054 Bytes) of package /linux/www/tidy-html5-5.8.0.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "httpio.h" see the Fossies "Dox" file reference documentation.

    1 #ifndef __HTTPIO_H__
    2 #define __HTTPIO_H__
    3 
    4 #include "platform.h"
    5 #include "tidy.h"
    6 
    7 #ifdef WIN32
    8 # include <winsock.h>
    9 # define ECONNREFUSED WSAECONNREFUSED
   10 #else
   11 # include <sys/socket.h>
   12 # include <netdb.h>
   13 # include <netinet/in.h>
   14 #ifndef __BEOS__
   15 # include <arpa/inet.h>
   16 #endif
   17 #endif /* WIN32 */
   18 
   19 TIDY_STRUCT
   20 typedef struct _HTTPInputSource
   21 {
   22     TidyInputSource tis; /* This declaration must be first and must not be changed! */
   23 
   24     tmbstr pHostName;
   25     tmbstr pResource;
   26     unsigned short nPort, nextBytePos, nextUnGotBytePos, nBufSize;
   27     SOCKET s;
   28     char buffer[1024];
   29     char unGetBuffer[16];
   30 
   31 } HTTPInputSource;
   32 
   33 /*  get next byte from input source */
   34 int HTTPGetByte( HTTPInputSource *source );
   35 
   36 /*  unget byte back to input source */
   37 void HTTPUngetByte( HTTPInputSource *source, uint byteValue );
   38 
   39 /* check if input source at end */
   40 Bool HTTPIsEOF( HTTPInputSource *source );
   41 
   42 int parseURL( HTTPInputSource* source, tmbstr pUrl );
   43 
   44 int openURL( HTTPInputSource* source, tmbstr pUrl );
   45 
   46 void closeURL( HTTPInputSource *source );
   47 
   48 #endif