4 #define FLAG_GOT_ALL_DATA (1 << 2)
6 #define FLAG_STREAM (1 << 9)
7 #define FLAG_REUSE_BUFFER (1 << 10)
12 int socket
; // socket on which the actual transfer happens
13 int flags
; // flags, reflects status of the transfer using bitflags
14 int write_ptr
; // internal use only (where to write new data in buffer)
15 int buffer_length
; // internal use only (number of available bytes in buffer)
16 int chunk_ptr
; // internal use only (where the next chunk begins)
17 int timestamp
; // internal use only (when last data was received)
19 int status
; // HTTP status
20 int header_length
; // length of HTTP header
21 void *content_ptr
; // ptr to content
22 int content_length
; // total length of HTTP content
23 int content_received
; // number of currently received content bytes
27 int http_load(char *buf
, const char *path
);
29 http_t
* __stdcall
http_get(const char *url
, http_t
*conn
, int flags
, const char *header
);
30 int __stdcall
http_receive(http_t
*conn
);
31 void __stdcall
http_free(http_t
*conn
);
33 static inline int http_receive_with_retry(http_t
*http
, int retry_count
)
39 err
= http_receive(http
);
43 }while(err
&& --retry_count
);
48 void __stdcall
con_init(unsigned w_w
, unsigned w_h
, unsigned s_w
, unsigned s_h
, const char* t
);
49 void __stdcall
con_exit(char bCloseWindow
);
50 unsigned __stdcall
con_get_flags(void);
51 unsigned __stdcall
con_set_flags(unsigned new_flags
);
52 void __stdcall
con_cls(void);
53 void __stdcall
con_write_asciiz(const char* string
);
55 char *make_url(const char *name
);
56 char *make_tmp_path(const char *path
);
57 char *make_cache_path(const char *path
);
59 #endif /* __HTTP_H__ */