1 /* config.c - ldbm backend configuration file routine */
4 * Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved.
5 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
11 #include <ac/string.h>
23 struct bdb_info *bdb = (struct bdb_info *) be->be_private;
26 fprintf( stderr, "%s: line %d: "
27 "bdb database info is null!\n",
32 /* directory is the DB_HOME */
33 if ( strcasecmp( argv[0], "directory" ) == 0 ) {
35 fprintf( stderr, "%s: line %d: "
36 "missing dir in \"directory <dir>\" line\n",
40 if ( bdb->bi_dbenv_home ) {
41 free( bdb->bi_dbenv_home );
43 bdb->bi_dbenv_home = ch_strdup( argv[1] );
46 /* mode with which to create new database files */
47 } else if ( strcasecmp( argv[0], "checkpoint" ) == 0 ) {
49 fprintf( stderr, "%s: line %d: "
50 "missing parameters in \"checkpoint <kbyte> <min>\" line\n",
55 bdb->bi_txn_cp_kbyte = strtol( argv[1], NULL, 0 );
56 bdb->bi_txn_cp_min = strtol( argv[2], NULL, 0 );
58 /* mode with which to create new database files */
59 } else if ( strcasecmp( argv[0], "mode" ) == 0 ) {
61 fprintf( stderr, "%s: line %d: "
62 "missing mode in \"mode <mode>\" line\n",
66 bdb->bi_dbenv_mode = strtol( argv[1], NULL, 0 );
69 /* attribute to index */
70 } else if ( strcasecmp( argv[0], "index" ) == 0 ) {
73 fprintf( stderr, "%s: line %d: "
74 "missing attr in \"index <attr> [pres,eq,approx,sub]\" line\n",
77 } else if ( argc > 3 ) {
78 fprintf( stderr, "%s: line %d: "
79 "extra junk after \"index <attr> [pres,eq,approx,sub]\" "
83 rc = attr_index_config( li, fname, lineno, argc - 1, &argv[1] );
85 if( rc != LDAP_SUCCESS ) return 1;
90 fprintf( stderr, "%s: line %d: "
91 "unknown directive \"%s\" in bdb database definition (ignored)\n",
92 fname, lineno, argv[0] );