1 #ifndef SERVER_H
 2 #define SERVER_H
 3 
 4 #include "queue.h"
 5 #include "rh_socket.h"
 6 #include "rh_event.h"
 7 #include "rh_stat.h"
 8 #include "rh_gmtime.h"
 9 #include "config.h"
10 #include "handler.h"
11 #include "memcache.h"
12 
13 typedef struct server server_t;
14 
15 TAILQ_HEAD(client_list, client);
16 
17 struct server {
18         rh_socket_t             socket;
19         struct rh_event_base    *ev_base;
20         struct client_list      clients;
21 
22         memcache_t              *memcache;
23 
24         rh_gmtime_t             gmtime;
25 
26         rh_stat_cache_t         *stat_cache;
27         
28         config_t                *config;
29 
30         handler_base_t          *handler_base;
31 
32         handler_t               *handler_error;
33         
34         handler_t               *handler_accesslog;
35         
36         handler_t               *handler_range;
37 };
38 
39 void server_init (server_t *server, rh_stat_cache_t *stat_cache,
40                 config_t *config, handler_base_t *handler_base,
41                 memcache_t *memcache );
42 
43 void server_destroy (server_t *);
44 
45 int server_bind (server_t *server, struct rh_event_base *ev_base,
46                 const char *hostname, unsigned short port);
47 
48 #endif /* SERVER_H */


syntax highlighted by Code2HTML, v. 0.9.1