1 /* config.h - configuration abstraction structure */
4 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
6 * Copyright 1998-2005 The OpenLDAP Foundation.
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted only as authorized by the OpenLDAP
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>.
18 typedef struct config_table_s {
24 unsigned long arg_type;
27 AttributeDescription *ad;
31 #define ARGS_USERLAND 0x0000ffff
32 #define ARGS_TYPES 0x00ff0000
33 #define ARGS_POINTER 0x001f0000
34 #define ARGS_NUMERIC 0x000f0000
35 #define ARG_INT 0x00010000
36 #define ARG_LONG 0x00020000
37 #define ARG_BER_LEN_T 0x00040000
38 #define ARG_ON_OFF 0x00080000
39 #define ARG_STRING 0x00100000
40 #define ARG_BERVAL 0x00200000 /* XXX not yet */
41 #define ARG_EXISTS 0x00400000 /* XXX not yet */
42 #define ARG_IGNORED 0x00800000
44 #define ARGS_SYNTAX 0xff000000
45 #define ARG_DB 0x01000000
46 #define ARG_PRE_DB 0x02000000
47 #define ARG_PAREN 0x04000000
48 #define ARG_NONZERO 0x08000000
49 #define ARG_UNIQUE 0x10000000 /* XXX not yet */
50 #define ARG_SPECIAL 0x20000000 /* one special case */
51 #define ARG_OFFSET 0x40000000
52 #define ARG_MAGIC 0x80000000
54 #define ARG_BAD_CONF 0xdead0000 /* overload return values */
55 #define ARG_UNKNOWN 0xc0de0000
57 typedef struct config_args_s {
64 char log[PATH_MAX + STRLENOF(": line 18446744073709551615") + 1];
66 int value_int; /* parsed first val */
67 long value_long; /* for simple cases */
68 ber_len_t value_ber_t;
70 int emit; /* emit instead of setting */
71 int type; /* ConfigTable.arg_type & ARGS_USERLAND */
76 typedef int (ConfigDriver)(ConfigArgs *c);