source: vendor/current/lib/tdb/test/external-agent.h

Last change on this file was 988, checked in by Silvan Scherrer, 9 years ago

Samba Server: update vendor to version 4.4.3

File size: 1.0 KB
Line 
1#ifndef TDB_TEST_EXTERNAL_AGENT_H
2#define TDB_TEST_EXTERNAL_AGENT_H
3
4/* For locking tests, we need a different process to try things at
5 * various times. */
6enum operation {
7 OPEN,
8 OPEN_WITH_CLEAR_IF_FIRST,
9 TRANSACTION_START,
10 FETCH,
11 STORE,
12 TRANSACTION_COMMIT,
13 CHECK,
14 NEEDS_RECOVERY,
15 CLOSE,
16 PING,
17 UNMAP,
18};
19
20/* Do this before doing any tdb stuff. Return handle, or -1. */
21struct agent *prepare_external_agent(void);
22void shutdown_agent(struct agent *agent);
23
24enum agent_return {
25 SUCCESS,
26 WOULD_HAVE_BLOCKED,
27 AGENT_DIED,
28 FAILED, /* For fetch, or NEEDS_RECOVERY */
29 OTHER_FAILURE,
30};
31
32/* Ask the external agent to try to do an operation.
33 * name == tdb name for OPEN/OPEN_WITH_CLEAR_IF_FIRST,
34 * record name for FETCH/STORE (store stores name as data too)
35 */
36enum agent_return external_agent_operation(struct agent *handle,
37 enum operation op,
38 const char *name);
39
40/* Mapping enum -> string. */
41const char *agent_return_name(enum agent_return ret);
42const char *operation_name(enum operation op);
43
44#endif /* TDB_TEST_EXTERNAL_AGENT_H */
Note: See TracBrowser for help on using the repository browser.