Change the ifdefs to match the filename
[sahlberg/ctdb.git] / include / ctdb.h
1 /* 
2    ctdb database library
3
4    Copyright (C) Ronnie sahlberg 2010
5
6    This program is free software; you can redistribute it and/or modify
7    it under the terms of the GNU General Public License as published by
8    the Free Software Foundation; either version 3 of the License, or
9    (at your option) any later version.
10    
11    This program is distributed in the hope that it will be useful,
12    but WITHOUT ANY WARRANTY; without even the implied warranty of
13    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14    GNU General Public License for more details.
15    
16    You should have received a copy of the GNU General Public License
17    along with this program; if not, see <http://www.gnu.org/licenses/>.
18 */
19
20 #ifndef _CTDB_H
21 #define _CTDB_H
22
23 /* all functions except libctdb_connect() and libctdb_service()
24  * are non-blocking
25  */
26
27 struct ctdb_context *libctdb_connect(const char *addr);
28
29 int libctdb_get_fd(struct ctdb_context *ctdb);
30
31 int libctdb_which_events(struct ctdb_context *ctdb);
32
33 int libctdb_service(struct ctdb_context *ctdb);
34
35
36
37 typedef void libctdb_handle;
38
39
40 typedef void (*get_recmaster_cb)(int32_t status, int32_t recmaster, void *private_data);
41
42
43
44 libctdb_handle *
45 libctdb_getrecmaster_send(struct ctdb_context *ctdb,
46                         uint32_t destnode,
47                         get_recmaster_cb callback,
48                         void *private_data);
49 int libctdb_getrecmaster_recv(struct ctdb_context *ctdb,
50                         libctdb_handle *handle,
51                         uint32_t *recmaster);
52 int libctdb_getrecmaster(struct ctdb_context *ctdb,
53                         uint32_t destnode,
54                         uint32_t *recmaster);
55
56
57 int libctdb_cancel(libctdb_handle *);
58
59 #endif