]> git.sur5r.net Git - openldap/blob - servers/slapd/slapcommon.h
Fix prev commit
[openldap] / servers / slapd / slapcommon.h
1 /* slapcommon.h - common definitions for the slap tools */
2 /* $OpenLDAP$ */
3 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
4  *
5  * Copyright 1998-2004 The OpenLDAP Foundation.
6  * All rights reserved.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted only as authorized by the OpenLDAP
10  * Public License.
11  *
12  * A copy of this license is available in the file LICENSE in the
13  * top-level directory of the distribution or, alternatively, at
14  * <http://www.OpenLDAP.org/license.html>.
15  */
16
17 #ifndef SLAPCOMMON_H_
18 #define SLAPCOMMON_H_ 1
19
20 #define SLAPD_TOOLS 1
21 #include "slap.h"
22
23 enum slaptool {
24         SLAPADD=1,      /* LDIF -> database tool */
25         SLAPCAT,        /* database -> LDIF tool */
26         SLAPINDEX,      /* database index tool */
27         SLAPPASSWD      /* password generation tool */
28 };
29
30 #define SLAP_TOOL_CTXCSN_KEEP   0
31 #define SLAP_TOOL_CTXCSN_ENTRY  1
32 #define SLAP_TOOL_CTXCSN_BATCH  2
33
34 typedef struct tool_vars {
35         Backend *tv_be;
36         int tv_verbose;
37         int tv_update_ctxcsn;
38         int tv_retrieve_ctxcsn;
39         int tv_retrieve_synccookie;
40         int tv_replica_promotion;
41         int tv_replica_demotion;
42         char    *tv_replica_id_string;
43         char    **tv_replica_id_strlist;
44         int     *tv_replica_id_list;
45         int tv_continuemode;
46         int tv_nosubordinates;
47         int tv_dryrun;
48         struct berval tv_sub_ndn;
49         FILE    *tv_ldiffp;
50 } tool_vars;
51
52 extern tool_vars tool_globals;
53
54 #define be tool_globals.tv_be
55 #define verbose tool_globals.tv_verbose
56 #define update_ctxcsn tool_globals.tv_update_ctxcsn
57 #define retrieve_ctxcsn tool_globals.tv_retrieve_ctxcsn
58 #define retrieve_synccookie tool_globals.tv_retrieve_synccookie
59 #define replica_promotion tool_globals.tv_replica_promotion
60 #define replica_demotion tool_globals.tv_replica_demotion
61 #define replica_id_string tool_globals.tv_replica_id_string
62 #define replica_id_strlist tool_globals.tv_replica_id_strlist
63 #define replica_id_list tool_globals.tv_replica_id_list
64 #define continuemode tool_globals.tv_continuemode
65 #define nosubordinates tool_globals.tv_nosubordinates
66 #define dryrun tool_globals.tv_dryrun
67 #define sub_ndn tool_globals.tv_sub_ndn
68 #define ldiffp tool_globals.tv_ldiffp
69
70 void slap_tool_init LDAP_P((
71         const char* name,
72         int tool,
73         int argc, char **argv ));
74
75 void slap_tool_destroy LDAP_P((void));
76
77 #endif /* SLAPCOMMON_H_ */