File: server.h

package info (click to toggle)
webdis 0.1.2%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 564 kB
  • ctags: 798
  • sloc: ansic: 5,240; sh: 254; python: 247; makefile: 93
file content (37 lines) | stat: -rw-r--r-- 442 bytes parent folder | download | duplicates (5)
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
26
27
28
29
30
31
32
33
34
35
36
37
#ifndef SERVER_H
#define SERVER_H

#include <event.h>
#include <hiredis/async.h>
#include <pthread.h>

struct worker;
struct conf;

struct server {

	int fd;
	struct event ev;
	struct event_base *base;

	struct conf *cfg;

	/* worker threads */
	struct worker **w;
	int next_worker;

	/* log lock */
	struct {
		pid_t self;
		int fd;
	} log;
};

struct server *
server_new(const char *cfg_file);

int
server_start(struct server *s);

#endif