1 /* config.c - ldbm backend configuration file routine */
11 #include "back-ldbm.h"
21 struct ldbminfo *li = (struct ldbminfo *) be->be_private;
24 fprintf( stderr, "%s: line %d: ldbm backend info is null!\n",
29 /* directory where database files live */
30 if ( strcasecmp( argv[0], "directory" ) == 0 ) {
33 "%s: line %d: missing dir in \"directory <dir>\" line\n",
37 li->li_directory = strdup( argv[1] );
39 /* mode with which to create new database files */
40 } else if ( strcasecmp( argv[0], "mode" ) == 0 ) {
43 "%s: line %d: missing mode in \"mode <mode>\" line\n",
47 li->li_mode = strtol( argv[1], NULL, 0 );
49 /* attribute to index */
50 } else if ( strcasecmp( argv[0], "index" ) == 0 ) {
53 "%s: line %d: missing attr in \"index <attr> [pres,eq,approx,sub]\" line\n",
56 } else if ( argc > 3 ) {
58 "%s: line %d: extra junk after \"index <attr> [pres,eq,approx,sub]\" line (ignored)\n",
61 attr_index_config( li, fname, lineno, argc - 1, &argv[1], 0 );
63 /* size of the cache in entries */
64 } else if ( strcasecmp( argv[0], "cachesize" ) == 0 ) {
67 "%s: line %d: missing size in \"cachesize <size>\" line\n",
71 li->li_cache.c_maxsize = atoi( argv[1] );
73 /* size of each dbcache in bytes */
74 } else if ( strcasecmp( argv[0], "dbcachesize" ) == 0 ) {
77 "%s: line %d: missing size in \"dbcachesize <size>\" line\n",
81 li->li_dbcachesize = atoi( argv[1] );
84 } else if ( strcasecmp( argv[0], "dbcachenowsync" ) == 0 ) {
85 li->li_dbcachewsync = 0;
90 "%s: line %d: unknown directive \"%s\" in ldbm database definition (ignored)\n",
91 fname, lineno, argv[0] );