-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathhttpd.h
More file actions
16 lines (11 loc) · 759 Bytes
/
httpd.h
File metadata and controls
16 lines (11 loc) · 759 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//int wget(void* data, char* url, int out(void* data, char* s));
// TODO: cannot have auto in prototype
//int wget(void* data, char* url, auto out);
typedef void (*httpd_header)(char* buffer, char* method, char* path); // will be called for each header line, last time NULL
typedef void (*httpd_body)(char* buffer, char* method, char* path); // may be called several times, last time NULL
typedef void (*httpd_response)(int req, char* method, char* path); // you can write(req, ... don't close it, it'll be closed for you
int httpd_init(int port);
// all callbacks are optional
int httpd_next(int s, httpd_header emit_header, httpd_body emit_body, httpd_response emit_response);
// call default printer for testing, never returns
void httpd_loop(int s);