2 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
4 * Copyright 1998-2004 The OpenLDAP Foundation.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted only as authorized by the OpenLDAP
11 * A copy of this license is available in file LICENSE in the
12 * top-level directory of the distribution or, alternatively, at
13 * <http://www.OpenLDAP.org/license.html>.
15 /* Portions Copyright (c) 1996 Regents of the University of Michigan.
16 * All rights reserved.
18 * Redistribution and use in source and binary forms are permitted
19 * provided that this notice is preserved and that due credit is given
20 * to the University of Michigan at Ann Arbor. The name of the University
21 * may not be used to endorse or promote products derived from this
22 * software without specific prior written permission. This software
23 * is provided ``as is'' without express or implied warranty.
26 * This work was originally developed by the University of Michigan
27 * (as part of U-MICH LDAP).
31 * globals.c - initialization code for global data
38 #include <ac/stdlib.h>
39 #include <ac/string.h>
48 int ldap_syslog_level = LOG_DEBUG;
50 int ldap_syslog_level = 0;
55 * Initialize the globals
62 g = ( Globals * ) malloc( sizeof( Globals ));
67 #ifdef HAVE_NT_SERVICE_MANAGER
68 g->slapd_configfile = ".\\slapd.conf";
69 g->slurpd_rdir = ".\\replica";
71 g->slapd_configfile = SLAPD_DEFAULT_CONFIGFILE;
72 g->slurpd_rdir = DEFAULT_SLURPD_REPLICA_DIR "/replica";
74 g->no_work_interval = DEFAULT_NO_WORK_INTERVAL;
75 g->slurpd_shutdown = 0;
78 strcpy( g->slurpd_status_file, DEFAULT_SLURPD_STATUS_FILE );
79 g->slapd_replogfile[ 0 ] = '\0';
80 g->slurpd_replogfile[ 0 ] = '\0';
81 g->slurpd_status_file[ 0 ] = '\0';
88 if ( St_init( &(g->st)) < 0 ) {
89 fprintf( stderr, "Cannot initialize status data\n" );
92 ldap_pvt_thread_mutex_init( &(g->rej_mutex) );
93 if ( Rq_init( &(g->rq)) < 0 ) {
94 fprintf( stderr, "Cannot initialize queue\n" );
97 #ifdef LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND
98 g->default_srvtab = SRVTAB;
99 #endif /* LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND */