tinywebd

view 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
line source
1 #ifndef TINYWEB_H_
2 #define TINYWEB_H_
4 void tw_set_port(int port);
5 int tw_set_root(const char *path);
6 int tw_set_logfile(const char *fname);
8 int tw_start(void);
9 int tw_stop(void);
11 /* tw_get_sockets returns the number of active sockets managed by tinyweb
12 * (clients plus the listening socket), and fills in the array sockets
13 * passed through the socks pointer, if it's not null.
14 *
15 * Call it with a null pointer initially to get the number of sockets, then
16 * make sure you have enough space in the array and pass it in a second call
17 * to fill it.
18 */
19 int tw_get_sockets(int *socks);
21 /* returns the maximum file descriptor number in the set of sockets managed
22 * by the library (useful for calling select).
23 */
24 int tw_get_maxfd(void);
26 /* call tw_handle_socket to let tinyweb handle incoming traffic to any of the
27 * tinyweb managed sockets.
28 */
29 int tw_handle_socket(int s);
32 #endif /* TINYWEB_H_ */