tinywebd
annotate libtinyweb/src/tinyweb.h @ 17:2874f61a43b1
implementing the directory index generation
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Tue, 21 Apr 2015 04:33:02 +0300 |
parents | b13fda5c01bc |
children |
rev | line source |
---|---|
nuclear@12 | 1 /* tinyweb - tiny web server library and daemon |
nuclear@12 | 2 * Author: John Tsiombikas <nuclear@member.fsf.org> |
nuclear@12 | 3 * |
nuclear@12 | 4 * This program is placed in the public domain. Feel free to use it any |
nuclear@12 | 5 * way you like. Mentions and retaining this attribution header will be |
nuclear@12 | 6 * appreciated, but not required. |
nuclear@12 | 7 */ |
nuclear@7 | 8 #ifndef TINYWEB_H_ |
nuclear@7 | 9 #define TINYWEB_H_ |
nuclear@7 | 10 |
nuclear@7 | 11 void tw_set_port(int port); |
nuclear@7 | 12 int tw_set_root(const char *path); |
nuclear@7 | 13 int tw_set_logfile(const char *fname); |
nuclear@7 | 14 |
nuclear@7 | 15 int tw_start(void); |
nuclear@7 | 16 int tw_stop(void); |
nuclear@7 | 17 |
nuclear@11 | 18 /* tw_get_sockets returns the number of active sockets managed by tinyweb |
nuclear@11 | 19 * (clients plus the listening socket), and fills in the array sockets |
nuclear@11 | 20 * passed through the socks pointer, if it's not null. |
nuclear@11 | 21 * |
nuclear@11 | 22 * Call it with a null pointer initially to get the number of sockets, then |
nuclear@11 | 23 * make sure you have enough space in the array and pass it in a second call |
nuclear@11 | 24 * to fill it. |
nuclear@11 | 25 */ |
nuclear@7 | 26 int tw_get_sockets(int *socks); |
nuclear@11 | 27 |
nuclear@11 | 28 /* returns the maximum file descriptor number in the set of sockets managed |
nuclear@11 | 29 * by the library (useful for calling select). |
nuclear@11 | 30 */ |
nuclear@7 | 31 int tw_get_maxfd(void); |
nuclear@11 | 32 |
nuclear@11 | 33 /* call tw_handle_socket to let tinyweb handle incoming traffic to any of the |
nuclear@11 | 34 * tinyweb managed sockets. |
nuclear@11 | 35 */ |
nuclear@7 | 36 int tw_handle_socket(int s); |
nuclear@7 | 37 |
nuclear@7 | 38 |
nuclear@7 | 39 #endif /* TINYWEB_H_ */ |