libwinyl
Loading...
Searching...
No Matches
Data Structures | Macros | Typedefs | Functions
winyl.h File Reference

Contains the winyl_open function and related. More...

Data Structures

struct  winyl
 Represents a HTTP host. More...
 

Macros

#define WINYL_INTLEN(x)   ({int r = 1; int v = x; while(v > 9) { r++; v /= 10; }; r;})
 Calculates the amount of digits in a positive integer.
 
#define WINYL_HTTP_1_0   10
 HTTP/1.0 for winyl_change_http.
 
#define WINYL_HTTP_1_1   11
 HTTP/1.1 for winyl_change_http.
 
#define WINYL_ERROR_PORT   7
 Speficied port is not valid.
 
#define WINYL_ERROR_DNS   1
 Call to net_gethostbyname() failed.
 
#define WINYL_ERROR_NX   4
 Specified domain does not exist.
 
#define WINYL_ERROR_MALLOC   8
 Allocating memory failed.
 

Typedefs

typedef struct winyl winyl
 Represents a HTTP host.
 

Functions

winyl winyl_open (char *hostname, int port)
 Opens an HTTP host with the specified port.
 
void winyl_close (winyl *host)
 Frees memory used up by host.
 
int winyl_change_http (winyl *host, int version)
 Changes HTTP version used for requests to host.