X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Ftdb%2Ftest%2Fexternal-transaction.h;h=843b697917522f13690352cbe03798fb253a273e;hb=03d4aa56b8bd381db449b36befa6928594cea994;hp=8f28a624e4ad5298aad3c35144c169c90dfa55f2;hpb=15758cca5f15f362edaf9da25f831d10e58b1b9a;p=ccan diff --git a/ccan/tdb/test/external-transaction.h b/ccan/tdb/test/external-transaction.h index 8f28a624..843b6979 100644 --- a/ccan/tdb/test/external-transaction.h +++ b/ccan/tdb/test/external-transaction.h @@ -2,10 +2,24 @@ #define TDB_TEST_EXTERNAL_TRANSACTION_H #include +enum operation { + OPEN, + OPEN_WITH_CLEAR_IF_FIRST, + TRANSACTION, +}; + /* Do this before doing any tdb stuff. Return handle, or -1. */ -int prepare_external_agent(void); +struct agent *prepare_external_agent(void); + +/* Ask the external agent to try to do an operation. */ +bool external_agent_operation(struct agent *handle, + enum operation op, + const char *tdbname); -/* Ask the external agent to try to do a transaction. */ -bool external_agent_transaction(int handle, const char *tdbname); +/* Ask... */ +void external_agent_operation_start(struct agent *agent, + enum operation op, const char *tdbname); +/* See if they've done it. */ +bool external_agent_operation_check(struct agent *agent, bool block, int *res); #endif /* TDB_TEST_EXTERNAL_TRANSACTION_H */