File: httpio.h

package info (click to toggle)
tidy-html5 2%3A5.8.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 10,668 kB
  • sloc: ansic: 43,061; ruby: 1,368; sh: 404; xml: 225; cpp: 30; makefile: 26
file content (48 lines) | stat: -rw-r--r-- 1,054 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#ifndef __HTTPIO_H__
#define __HTTPIO_H__

#include "platform.h"
#include "tidy.h"

#ifdef WIN32
# include <winsock.h>
# define ECONNREFUSED WSAECONNREFUSED
#else
# include <sys/socket.h>
# include <netdb.h>
# include <netinet/in.h>
#ifndef __BEOS__
# include <arpa/inet.h>
#endif
#endif /* WIN32 */

TIDY_STRUCT
typedef struct _HTTPInputSource
{
    TidyInputSource tis; /* This declaration must be first and must not be changed! */

    tmbstr pHostName;
    tmbstr pResource;
    unsigned short nPort, nextBytePos, nextUnGotBytePos, nBufSize;
    SOCKET s;
    char buffer[1024];
    char unGetBuffer[16];

} HTTPInputSource;

/*  get next byte from input source */
int HTTPGetByte( HTTPInputSource *source );

/*  unget byte back to input source */
void HTTPUngetByte( HTTPInputSource *source, uint byteValue );

/* check if input source at end */
Bool HTTPIsEOF( HTTPInputSource *source );

int parseURL( HTTPInputSource* source, tmbstr pUrl );

int openURL( HTTPInputSource* source, tmbstr pUrl );

void closeURL( HTTPInputSource *source );

#endif