/*
 * webkernel.h
 *
 * A small embeddable web server.
 *
 * Header file.
 *
 * History:
 *      21/01/2014 Creation.
 *
 * Author: Dario Rodriguez dario@softhome.net
 * This library is licensed on the terms of the GNU LGPL v2+
 */

#ifndef WEBKERNEL_H
#define WEBKERNEL_H
#include "iobuf.h"

typedef void wk;

wk *wk_init(int port);
void wk_free(wk *web);

int wk_select(wk *web, int timemoutms,...);
int wk_httpaccept(wk *web, int *httpnum);
int wk_httpisrequest(char *line);
int wk_httpfromdisk(wk *web, int httpnum,char *firstline);
int wk_httpreset(wk *web, int httpnum);
int wk_httpclose(wk *web, int httpnum);

siobuf *wk_iobufget(wk *web);
wk_iobuffree(wk *web, int iobufnum);

#endif