1 /* config.c - ldbm backend configuration file routine */
3 * Copyright 1998-1999 The OpenLDAP Foundation, All Rights Reserved.
4 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
11 #include <ac/socket.h>
12 #include <ac/string.h>
15 #include "back-ldbm.h"
27 struct ldbminfo *li = (struct ldbminfo *) be->be_private;
30 fprintf( stderr, "%s: line %d: ldbm database info is null!\n",
35 /* directory where database files live */
36 if ( strcasecmp( argv[0], "directory" ) == 0 ) {
39 "%s: line %d: missing dir in \"directory <dir>\" line\n",
43 if ( li->li_directory )
44 free( li->li_directory );
45 li->li_directory = ch_strdup( argv[1] );
47 /* mode with which to create new database files */
48 } else if ( strcasecmp( argv[0], "mode" ) == 0 ) {
51 "%s: line %d: missing mode in \"mode <mode>\" line\n",
55 li->li_mode = strtol( argv[1], NULL, 0 );
57 /* attribute to index */
58 } else if ( strcasecmp( argv[0], "index" ) == 0 ) {
61 "%s: line %d: missing attr in \"index <attr> [pres,eq,approx,sub]\" line\n",
64 } else if ( argc > 3 ) {
66 "%s: line %d: extra junk after \"index <attr> [pres,eq,approx,sub]\" line (ignored)\n",
69 attr_index_config( li, fname, lineno, argc - 1, &argv[1], 0 );
71 /* size of the cache in entries */
72 } else if ( strcasecmp( argv[0], "cachesize" ) == 0 ) {
75 "%s: line %d: missing size in \"cachesize <size>\" line\n",
79 li->li_cache.c_maxsize = atoi( argv[1] );
81 /* size of each dbcache in bytes */
82 } else if ( strcasecmp( argv[0], "dbcachesize" ) == 0 ) {
85 "%s: line %d: missing size in \"dbcachesize <size>\" line\n",
89 li->li_dbcachesize = atoi( argv[1] );
92 } else if ( strcasecmp( argv[0], "dbcachenowsync" ) == 0 ) {
93 li->li_dbcachewsync = 0;
98 "%s: line %d: unknown directive \"%s\" in ldbm database definition (ignored)\n",
99 fname, lineno, argv[0] );