Merge in next patch for --socket
[m6w6/libmemcached] / libtest / server.h
1 /*
2 * Copyright (C) 2011 Data Differential, http://datadifferential.com/
3 * Copyright (C) 2006-2009 Brian Aker
4 * All rights reserved.
5 *
6 * Use and distribution licensed under the BSD license. See
7 * the COPYING file in the parent directory for full text.
8 */
9
10 #pragma once
11
12 #include <unistd.h>
13
14 /*
15 Server startup and shutdown functions.
16 */
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20
21 #include <libmemcached/memcached.h>
22
23 typedef struct server_startup_st server_startup_st;
24 #define SERVERS_TO_CREATE 5
25
26 struct server_startup_st
27 {
28 uint8_t count;
29 uint8_t udp;
30 char *server_list;
31 char pid_file[SERVERS_TO_CREATE][FILENAME_MAX];
32 in_port_t port[SERVERS_TO_CREATE];
33 int pids[SERVERS_TO_CREATE];
34 bool is_used[SERVERS_TO_CREATE]; // Did we start it, or was it just sitting there?
35 };
36
37 void server_startup(server_startup_st *construct);
38 void server_shutdown(server_startup_st *construct);
39
40 #ifdef __cplusplus
41 }
42 #endif