change the libctdb_ prefix to ctdb_
[sahlberg/ctdb.git] / libctdb / libctdb.c
index a44e3c9cebd6c67cfc294c84339139d0846b4e8b..40369be36b8dd365bdb421aaaf4356d89d002151 100644 (file)
@@ -26,7 +26,7 @@
 #include "include/ctdb_protocol.h"
 #include "include/ctdb_private.h"
 
-struct ctdb_context *libctdb_connect(const char *addr)
+struct ctdb_context *ctdb_connect(const char *addr)
 {
        struct event_context *ev;
        struct ctdb_context *ctdb;
@@ -59,12 +59,12 @@ struct ctdb_context *libctdb_connect(const char *addr)
 }
 
 
-int libctdb_get_fd(struct ctdb_context *ctdb)
+int ctdb_get_fd(struct ctdb_context *ctdb)
 {
        return ctdb->daemon.sd;
 }
 
-int libctdb_which_events(struct ctdb_context *ctdb)
+int ctdb_which_events(struct ctdb_context *ctdb)
 {
        if (ctdb_queue_length(ctdb->daemon.queue) > 0) {
                return POLLIN|POLLOUT;
@@ -117,7 +117,7 @@ struct ctdb_context *ctdb_init(struct event_context *ev)
  * we probably need a new event function to handle these timed events
  * event_loop_all_queued() or similar
  */
-int libctdb_service(struct ctdb_context *ctdb)
+int ctdb_service(struct ctdb_context *ctdb)
 {
        int ret;
 
@@ -129,21 +129,21 @@ int libctdb_service(struct ctdb_context *ctdb)
 
 
 
-int libctdb_cancel(libctdb_handle *handle)
+int ctdb_cancel(ctdb_handle *handle)
 {
        talloc_free(handle);
        return 0;
 }
 
-struct libctdb_control_cb_data {
+struct ctdb_control_cb_data {
        void *callback;
        void *private_data;
 };
 
 static void
-libctdb_getrecmaster_recv_cb(struct ctdb_client_control_state *state)
+ctdb_getrecmaster_recv_cb(struct ctdb_client_control_state *state)
 {
-       struct libctdb_control_cb_data *cb_data = state->async.private_data;
+       struct ctdb_control_cb_data *cb_data = state->async.private_data;
        get_recmaster_cb callback = (get_recmaster_cb)cb_data->callback;
 
        callback(0, state->status, cb_data->private_data);
@@ -153,32 +153,32 @@ libctdb_getrecmaster_recv_cb(struct ctdb_client_control_state *state)
 /*
   get the recovery master of a remote node
  */
-libctdb_handle *
-libctdb_getrecmaster_send(struct ctdb_context *ctdb,
+ctdb_handle *
+ctdb_getrecmaster_send(struct ctdb_context *ctdb,
                        uint32_t destnode,
                        get_recmaster_cb callback,
                        void *private_data)
 {
        struct ctdb_client_control_state *state;
-       struct libctdb_control_cb_data *cb_data;
+       struct ctdb_control_cb_data *cb_data;
 
        state = ctdb_control_send(ctdb, destnode, 0, 
                           CTDB_CONTROL_GET_RECMASTER, 0, tdb_null, 
                           ctdb, NULL, NULL);
 
        if (callback != NULL) {
-               cb_data = talloc(state, struct libctdb_control_cb_data);
+               cb_data = talloc(state, struct ctdb_control_cb_data);
                cb_data->callback     = callback;
                cb_data->private_data = private_data;
 
-               state->async.fn           = libctdb_getrecmaster_recv_cb;
+               state->async.fn           = ctdb_getrecmaster_recv_cb;
                state->async.private_data = cb_data;
        }
 
-       return (libctdb_handle *)state;
+       return (ctdb_handle *)state;
 }
 
-int libctdb_getrecmaster_recv(struct ctdb_context *ctdb, libctdb_handle *handle, uint32_t *recmaster)
+int ctdb_getrecmaster_recv(struct ctdb_context *ctdb, ctdb_handle *handle, uint32_t *recmaster)
 {
        struct ctdb_client_control_state *state = talloc_get_type(handle, struct ctdb_client_control_state);
        int ret;
@@ -186,7 +186,7 @@ int libctdb_getrecmaster_recv(struct ctdb_context *ctdb, libctdb_handle *handle,
 
        ret = ctdb_control_recv(ctdb, state, state, NULL, &res, NULL);
        if (ret != 0) {
-               DEBUG(DEBUG_ERR,(__location__ " libctdb_getrecmaster_recv failed\n"));
+               DEBUG(DEBUG_ERR,(__location__ " ctdb_getrecmaster_recv failed\n"));
                return -1;
        }
 
@@ -197,17 +197,17 @@ int libctdb_getrecmaster_recv(struct ctdb_context *ctdb, libctdb_handle *handle,
        return 0;
 }
 
-int libctdb_getrecmaster(struct ctdb_context *ctdb, uint32_t destnode, uint32_t *recmaster)
+int ctdb_getrecmaster(struct ctdb_context *ctdb, uint32_t destnode, uint32_t *recmaster)
 {
        struct ctdb_client_control_state *state;
        
-       state = libctdb_getrecmaster_send(ctdb, destnode, NULL, recmaster);
+       state = ctdb_getrecmaster_send(ctdb, destnode, NULL, recmaster);
        if (state == NULL) {
-               DEBUG(DEBUG_ERR,(__location__ " libctdb_getrecmaster_send() failed.\n"));
+               DEBUG(DEBUG_ERR,(__location__ " ctdb_getrecmaster_send() failed.\n"));
                return -1;
        }
 
-       return libctdb_getrecmaster_recv(ctdb, state, recmaster);
+       return ctdb_getrecmaster_recv(ctdb, state, recmaster);
 }