1 /* config.c - ldbm backend configuration file routine */
11 #include "back-ldbm.h"
22 struct ldbminfo *li = (struct ldbminfo *) be->be_private;
25 fprintf( stderr, "%s: line %d: ldbm backend info is null!\n",
30 /* directory where database files live */
31 if ( strcasecmp( argv[0], "directory" ) == 0 ) {
34 "%s: line %d: missing dir in \"directory <dir>\" line\n",
38 li->li_directory = ch_strdup( argv[1] );
40 /* mode with which to create new database files */
41 } else if ( strcasecmp( argv[0], "mode" ) == 0 ) {
44 "%s: line %d: missing mode in \"mode <mode>\" line\n",
48 li->li_mode = strtol( argv[1], NULL, 0 );
50 /* attribute to index */
51 } else if ( strcasecmp( argv[0], "index" ) == 0 ) {
54 "%s: line %d: missing attr in \"index <attr> [pres,eq,approx,sub]\" line\n",
57 } else if ( argc > 3 ) {
59 "%s: line %d: extra junk after \"index <attr> [pres,eq,approx,sub]\" line (ignored)\n",
62 attr_index_config( li, fname, lineno, argc - 1, &argv[1], 0 );
64 /* size of the cache in entries */
65 } else if ( strcasecmp( argv[0], "cachesize" ) == 0 ) {
68 "%s: line %d: missing size in \"cachesize <size>\" line\n",
72 li->li_cache.c_maxsize = atoi( argv[1] );
74 /* size of each dbcache in bytes */
75 } else if ( strcasecmp( argv[0], "dbcachesize" ) == 0 ) {
78 "%s: line %d: missing size in \"dbcachesize <size>\" line\n",
82 li->li_dbcachesize = atoi( argv[1] );
85 } else if ( strcasecmp( argv[0], "dbcachenowsync" ) == 0 ) {
86 li->li_dbcachewsync = 0;
91 "%s: line %d: unknown directive \"%s\" in ldbm database definition (ignored)\n",
92 fname, lineno, argv[0] );