createdb and getdbpath does not need to be in the public api
[sahlberg/ctdb.git] / include / ctdb_protocol.h
index 694fdae6d17bfa2726e2f91c5f5dc7715da942c2..8eda5d44d628b2336ebf4f800e829c0da316e880 100644 (file)
@@ -721,4 +721,46 @@ struct ctdb_db_priority {
 int ctdb_ctrl_set_db_priority(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode, struct ctdb_db_priority *db_prio);
 int ctdb_ctrl_get_db_priority(struct ctdb_context *ctdb, struct timeval timeout, uint32_t destnode, uint32_t db_id, uint32_t *priority);
 
+
+/*
+ * functions to create a database
+ * if the database already exists this function is a NOP
+ */
+typedef void (*ctdb_createdb_cb)(int32_t status, uint32_t db_id, void *private_data);
+
+ctdb_handle *
+ctdb_createdb_send(struct ctdb_context *ctdb, uint32_t destnode,
+                  const char *name, int persistent, uint32_t tdb_flags,
+                  ctdb_createdb_cb callback,
+                  void *private_data);
+int ctdb_createdb_recv(struct ctdb_context *ctdb,
+                      ctdb_handle *handle, uint32_t *db_id);
+int ctdb_createdb(struct ctdb_context *ctdb, uint32_t destnode,
+                 const char *name, int persistent, uint32_t tdb_flags,
+                 uint32_t *db_id);
+
+
+
+
+/*
+ * functions to find the filename of a database
+ *
+ * the caller is responsible to release *path when finished with it using
+ * ctdb_free()
+ */
+typedef void (*ctdb_getdbpath_cb)(int32_t status, const char *path, void *private_data);
+
+ctdb_handle *
+ctdb_getdbpath_send(struct ctdb_context *ctdb, uint32_t destnode,
+                   uint32_t db_id,
+                   ctdb_getdbpath_cb callback,
+                   void *private_data);
+int ctdb_getdbpath_recv(struct ctdb_context *ctdb,
+                       ctdb_handle *handle, const char **path);
+int ctdb_getdbpath(struct ctdb_context *ctdb, uint32_t destnode,
+                  uint32_t db_id,
+                  const char **path);
+
+
+
 #endif