change the libctdb_ prefix to ctdb_
[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 struct ctdb_context *ctdb_connect(const char *addr);
24
25 int ctdb_get_fd(struct ctdb_context *ctdb);
26
27 int ctdb_which_events(struct ctdb_context *ctdb);
28
29 int ctdb_service(struct ctdb_context *ctdb);
30
31
32
33 typedef void ctdb_handle;
34
35
36 /*
37  * function to cancel a request/call
38  */
39 int ctdb_cancel(ctdb_handle *);
40
41
42 /*
43  * functions to read the recovery master of a node
44  */
45 typedef void (*get_recmaster_cb)(int32_t status, int32_t recmaster, void *private_data);
46
47 ctdb_handle *
48 ctdb_getrecmaster_send(struct ctdb_context *ctdb,
49                         uint32_t destnode,
50                         get_recmaster_cb callback,
51                         void *private_data);
52 int ctdb_getrecmaster_recv(struct ctdb_context *ctdb,
53                         ctdb_handle *handle,
54                         uint32_t *recmaster);
55 int ctdb_getrecmaster(struct ctdb_context *ctdb,
56                         uint32_t destnode,
57                         uint32_t *recmaster);
58
59
60 #endif