tinywebd
annotate libtinyweb/src/tinyweb.h @ 11:b13fda5c01bc
comments in tinyweb.h and README file
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sat, 18 Apr 2015 23:55:34 +0300 |
parents | 0dd50a23f3dd |
children | 86f703031228 |
rev | line source |
---|---|
nuclear@7 | 1 #ifndef TINYWEB_H_ |
nuclear@7 | 2 #define TINYWEB_H_ |
nuclear@7 | 3 |
nuclear@7 | 4 void tw_set_port(int port); |
nuclear@7 | 5 int tw_set_root(const char *path); |
nuclear@7 | 6 int tw_set_logfile(const char *fname); |
nuclear@7 | 7 |
nuclear@7 | 8 int tw_start(void); |
nuclear@7 | 9 int tw_stop(void); |
nuclear@7 | 10 |
nuclear@11 | 11 /* tw_get_sockets returns the number of active sockets managed by tinyweb |
nuclear@11 | 12 * (clients plus the listening socket), and fills in the array sockets |
nuclear@11 | 13 * passed through the socks pointer, if it's not null. |
nuclear@11 | 14 * |
nuclear@11 | 15 * Call it with a null pointer initially to get the number of sockets, then |
nuclear@11 | 16 * make sure you have enough space in the array and pass it in a second call |
nuclear@11 | 17 * to fill it. |
nuclear@11 | 18 */ |
nuclear@7 | 19 int tw_get_sockets(int *socks); |
nuclear@11 | 20 |
nuclear@11 | 21 /* returns the maximum file descriptor number in the set of sockets managed |
nuclear@11 | 22 * by the library (useful for calling select). |
nuclear@11 | 23 */ |
nuclear@7 | 24 int tw_get_maxfd(void); |
nuclear@11 | 25 |
nuclear@11 | 26 /* call tw_handle_socket to let tinyweb handle incoming traffic to any of the |
nuclear@11 | 27 * tinyweb managed sockets. |
nuclear@11 | 28 */ |
nuclear@7 | 29 int tw_handle_socket(int s); |
nuclear@7 | 30 |
nuclear@7 | 31 |
nuclear@7 | 32 #endif /* TINYWEB_H_ */ |