1 /* config.c - ldbm backend configuration file routine */
8 #include <sys/socket.h>
10 #include "back-ldbm.h"
20 struct ldbminfo *li = (struct ldbminfo *) be->be_private;
23 fprintf( stderr, "%s: line %d: ldbm backend info is null!\n",
28 /* directory where database files live */
29 if ( strcasecmp( argv[0], "directory" ) == 0 ) {
32 "%s: line %d: missing dir in \"directory <dir>\" line\n",
36 li->li_directory = strdup( argv[1] );
38 /* mode with which to create new database files */
39 } else if ( strcasecmp( argv[0], "mode" ) == 0 ) {
42 "%s: line %d: missing mode in \"mode <mode>\" line\n",
46 li->li_mode = strtol( argv[1], NULL, 0 );
48 /* attribute to index */
49 } else if ( strcasecmp( argv[0], "index" ) == 0 ) {
52 "%s: line %d: missing attr in \"index <attr> [pres,eq,approx,sub]\" line\n",
55 } else if ( argc > 3 ) {
57 "%s: line %d: extra junk after \"index <attr> [pres,eq,approx,sub]\" line (ignored)\n",
60 attr_index_config( li, fname, lineno, argc - 1, &argv[1], 0 );
62 /* size of the cache in entries */
63 } else if ( strcasecmp( argv[0], "cachesize" ) == 0 ) {
66 "%s: line %d: missing size in \"cachesize <size>\" line\n",
70 li->li_cache.c_maxsize = atoi( argv[1] );
72 /* size of each dbcache in bytes */
73 } else if ( strcasecmp( argv[0], "dbcachesize" ) == 0 ) {
76 "%s: line %d: missing size in \"dbcachesize <size>\" line\n",
80 li->li_dbcachesize = atoi( argv[1] );
83 } else if ( strcasecmp( argv[0], "flushwrites" ) == 0 ) {
89 "%s: line %d: unknown directive \"%s\" in ldbm database definition (ignored)\n",
90 fname, lineno, argv[0] );