r435: a major upgrade for ldb
[metze/samba/wip.git] / source4 / lib / ldb / ldb_tdb / ldb_tdb.h
1 /* this private structure is used by the ltdb backend in the
2    ldb_context */
3 struct ltdb_private {
4         TDB_CONTEXT *tdb;
5         unsigned int connect_flags;
6         
7         /* a double is used for portability and ease of string
8            handling. It has plenty of digits of precision */
9         double sequence_number;
10
11         struct {
12                 struct ldb_message baseinfo;
13                 struct ldb_message indexlist;
14                 struct ldb_message attributes;
15                 struct ldb_message subclasses;
16
17                 struct {
18                         char *name;
19                         int flags;
20                 } last_attribute;
21         } cache;
22 };
23
24 /* special record types */
25 #define LTDB_INDEX      "@INDEX"
26 #define LTDB_INDEXLIST  "@INDEXLIST"
27 #define LTDB_IDX        "@IDX"
28 #define LTDB_IDXATTR    "@IDXATTR"
29 #define LTDB_BASEINFO   "@BASEINFO"
30 #define LTDB_ATTRIBUTES "@ATTRIBUTES"
31 #define LTDB_SUBCLASSES "@SUBCLASSES"
32
33 /* special attribute types */
34 #define LTDB_SEQUENCE_NUMBER "sequenceNumber"
35 #define LTDB_OBJECTCLASS "objectClass"
36
37 /* well known attribute flags */
38 #define LTDB_FLAG_CASE_INSENSITIVE (1<<0)
39 #define LTDB_FLAG_INTEGER          (1<<1)
40 #define LTDB_FLAG_WILDCARD         (1<<2)
41 #define LTDB_FLAG_OBJECTCLASS      (1<<3)
42
43
44 #ifndef IVAL
45 #define IVAL(p, ofs) (((unsigned *)((char *)(p) + (ofs)))[0])
46 #endif
47 #ifndef SIVAL
48 #define SIVAL(p, ofs, v) do { IVAL(p, ofs) = (v); } while (0)
49 #endif