]> git.sur5r.net Git - openldap/blob - servers/slapd/config.h
remove all referral specific code; now referrals can be used by defining appropriate...
[openldap] / servers / slapd / config.h
1 /* config.h - configuration abstraction structure */
2
3 /* $OpenLDAP$ */
4 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
5  *
6  * Copyright 1998-2005 The OpenLDAP Foundation.
7  * All rights reserved.
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted only as authorized by the OpenLDAP
11  * Public License.
12  *
13  * A copy of this license is available in the file LICENSE in the
14  * top-level directory of the distribution or, alternatively, at
15  * <http://www.OpenLDAP.org/license.html>.
16  */
17
18 typedef struct config_table_s {
19         char *name;
20         int min_args;
21         int max_args;
22         int length;
23         char *what;
24         unsigned long arg_type;
25         void *arg_item;
26         char *attribute;
27         AttributeDescription *ad;
28         void *notify;
29 } ConfigTable;
30
31 #define ARGS_USERLAND   0x0000ffffL
32 #define ARGS_TYPES      0x00ff0000L
33 #define ARGS_POINTER    0x001f0000L
34 #define ARGS_NUMERIC    0x000f0000L
35 #define ARG_INT         0x00010000L
36 #define ARG_LONG        0x00020000L
37 #define ARG_BER_LEN_T   0x00040000L
38 #define ARG_ON_OFF      0x00080000L
39 #define ARG_STRING      0x00100000L
40 #define ARG_BERVAL      0x00200000L     /* XXX not yet */
41 #define ARG_EXISTS      0x00400000L     /* XXX not yet */
42 #define ARG_IGNORED     0x00800000L
43
44 #define ARGS_SYNTAX     0xff000000L
45 #define ARG_DB          0x01000000L
46 #define ARG_PRE_DB      0x02000000L
47 #define ARG_PAREN       0x04000000L
48 #define ARG_NONZERO     0x08000000L
49 #define ARG_UNIQUE      0x10000000L     /* XXX not yet */
50 #define ARG_SPECIAL     0x20000000L     /* one special case */
51 #define ARG_OFFSET      0x40000000L
52 #define ARG_MAGIC       0x80000000L
53
54 #define ARG_BAD_CONF    0xdead0000L     /* overload return values */
55 #define ARG_UNKNOWN     0xc0de0000L
56
57 typedef struct config_args_s {
58         int argc;
59         char **argv;
60         int argv_size;
61         char *line;
62         const char *fname;
63         unsigned long lineno;
64         char log[PATH_MAX + STRLENOF(": line 18446744073709551615") + 1];
65         int depth;
66         int value_int;   /* parsed first val */
67         long value_long; /* for simple cases */
68         ber_len_t value_ber_t;
69         char *value_string;
70         int emit;       /* emit instead of setting */
71         int type;       /* ConfigTable.arg_type & ARGS_USERLAND */
72         BackendDB *be;
73         BackendInfo *bi;
74 } ConfigArgs;
75
76 typedef int (ConfigDriver)(ConfigArgs *c);