summaryrefslogtreecommitdiffhomepage
path: root/plop.h
blob: d2b68f52ac8a9c02db1ce063b2ef4b3c6c9f1e0c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#pragma once

#include <poll.h>

#include <lua.h>

#include "connection.h"

struct plop
{
	const char * handler;
	lua_State * L;
	struct pollfd * fds;
	struct connection ** data;
	int nfds;
};

extern struct plop plop;

lua_State * plop_initialize_lua(void);
int open_server(const char *, const char *);
int plop_load_handler(lua_State *, const char *);
void plop_drop_thread(const int);
int plop_handle_client(struct connection *);
int plop_handle_server(const int);