3 * Copyright 1998-2002 The OpenLDAP Foundation, All Rights Reserved.
4 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
7 * Copyright (c) 1996 Regents of the University of Michigan.
10 * Redistribution and use in source and binary forms are permitted
11 * provided that this notice is preserved and that due credit is given
12 * to the University of Michigan at Ann Arbor. The name of the University
13 * may not be used to endorse or promote products derived from this
14 * software without specific prior written permission. This software
15 * is provided ``as is'' without express or implied warranty.
19 * globals.c - initialization code for global data
26 #include <ac/stdlib.h>
27 #include <ac/string.h>
35 int ldap_syslog_level = LOG_DEBUG;
40 * Initialize the globals
47 g = ( Globals * ) malloc( sizeof( Globals ));
52 g->slapd_configfile = SLAPD_DEFAULT_CONFIGFILE;
53 g->no_work_interval = DEFAULT_NO_WORK_INTERVAL;
54 g->slurpd_shutdown = 0;
57 g->slurpd_rdir = DEFAULT_SLURPD_REPLICA_DIR "/replica";
58 strcpy( g->slurpd_status_file, DEFAULT_SLURPD_STATUS_FILE );
59 g->slapd_replogfile[ 0 ] = '\0';
60 g->slurpd_replogfile[ 0 ] = '\0';
61 g->slurpd_status_file[ 0 ] = '\0';
66 if ( St_init( &(g->st)) < 0 ) {
67 fprintf( stderr, "Cannot initialize status data\n" );
70 ldap_pvt_thread_mutex_init( &(g->rej_mutex) );
71 if ( Rq_init( &(g->rq)) < 0 ) {
72 fprintf( stderr, "Cannot initialize queue\n" );
75 #ifdef LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND
76 g->default_srvtab = SRVTAB;
77 #endif /* LDAP_API_FEATURE_X_OPENLDAP_V2_KBIND */