1 #ifndef NTDB_TEST_LAYOUT_H
2 #define NTDB_TEST_LAYOUT_H
3 #include "../private.h"
5 struct ntdb_layout *new_ntdb_layout(void);
6 void ntdb_layout_add_freetable(struct ntdb_layout *layout);
7 void ntdb_layout_add_free(struct ntdb_layout *layout, ntdb_len_t len,
9 void ntdb_layout_add_used(struct ntdb_layout *layout,
10 NTDB_DATA key, NTDB_DATA data,
12 void ntdb_layout_add_capability(struct ntdb_layout *layout,
19 #if 0 /* FIXME: Allow allocation of subtables */
20 void ntdb_layout_add_hashtable(struct ntdb_layout *layout,
21 int htable_parent, /* -1 == toplevel */
25 /* freefn is needed if we're using failtest_free. */
26 struct ntdb_context *ntdb_layout_get(struct ntdb_layout *layout,
27 void (*freefn)(void *),
28 union ntdb_attribute *attr);
29 void ntdb_layout_write(struct ntdb_layout *layout, void (*freefn)(void *),
30 union ntdb_attribute *attr, const char *filename);
32 void ntdb_layout_free(struct ntdb_layout *layout);
35 FREETABLE, FREE, DATA, CAPABILITY
38 /* Shared by all union members. */
40 enum layout_type type;
44 struct tle_freetable {
61 struct tle_capability {
67 union ntdb_layout_elem {
69 struct tle_freetable ftable;
72 struct tle_capability capability;
76 unsigned int num_elems;
77 union ntdb_layout_elem *elem;
80 #include "helprun-layout.h"
81 #endif /* NTDB_TEST_LAYOUT_H */