]> git.ozlabs.org Git - ccan/blob - ccan/tdb/test/external-transaction.h
Import 898b5edfe757cb145960b8f3631029bfd5592119 from ctdb:
[ccan] / ccan / tdb / test / external-transaction.h
1 #ifndef TDB_TEST_EXTERNAL_TRANSACTION_H
2 #define TDB_TEST_EXTERNAL_TRANSACTION_H
3 #include <stdbool.h>
4
5 enum operation {
6         OPEN,
7         OPEN_WITH_CLEAR_IF_FIRST,
8         TRANSACTION,
9 };
10
11 /* Do this before doing any tdb stuff.  Return handle, or -1. */
12 struct agent *prepare_external_agent(void);
13
14 /* Ask the external agent to try to do an operation. */
15 bool external_agent_operation(struct agent *handle,
16                               enum operation op,
17                               const char *tdbname);
18
19 /* Ask... */
20 void external_agent_operation_start(struct agent *agent,
21                                     enum operation op, const char *tdbname);
22
23 /* See if they've done it. */
24 bool external_agent_operation_check(struct agent *agent, bool block, int *res);
25 #endif /* TDB_TEST_EXTERNAL_TRANSACTION_H */