Just hand over memory ownership when the caller is supposed to free it (we have befor...
[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 memcached_server_st *servers;
31 char *server_list;
32 char pid_file[SERVERS_TO_CREATE][FILENAME_MAX];
33 in_port_t port[SERVERS_TO_CREATE];
34 int pids[SERVERS_TO_CREATE];
35 bool is_used[SERVERS_TO_CREATE]; // Did we start it, or was it just sitting there?
36 };
37
38 void server_startup(server_startup_st *construct);
39 void server_shutdown(server_startup_st *construct);
40
41 #ifdef __cplusplus
42 }
43 #endif