1 /* config.c - ldbm backend configuration file routine */
6 #include <sys/socket.h>
18 struct ldbminfo *li = (struct ldbminfo *) be->be_private;
21 fprintf( stderr, "%s: line %d: ldbm backend info is null!\n",
26 /* directory where database files live */
27 if ( strcasecmp( argv[0], "directory" ) == 0 ) {
30 "%s: line %d: missing dir in \"directory <dir>\" line\n",
34 li->li_directory = strdup( argv[1] );
36 /* mode with which to create new database files */
37 } else if ( strcasecmp( argv[0], "mode" ) == 0 ) {
40 "%s: line %d: missing mode in \"mode <mode>\" line\n",
44 li->li_mode = strtol( argv[1], NULL, 0 );
46 /* attribute to index */
47 } else if ( strcasecmp( argv[0], "index" ) == 0 ) {
50 "%s: line %d: missing attr in \"index <attr> [pres,eq,approx,sub]\" line\n",
53 } else if ( argc > 3 ) {
55 "%s: line %d: extra junk after \"index <attr> [pres,eq,approx,sub]\" line (ignored)\n",
58 attr_index_config( li, fname, lineno, argc - 1, &argv[1], 0 );
60 /* size of the cache in entries */
61 } else if ( strcasecmp( argv[0], "cachesize" ) == 0 ) {
64 "%s: line %d: missing size in \"cachesize <size>\" line\n",
68 li->li_cache.c_maxsize = atoi( argv[1] );
70 /* size of each dbcache in bytes */
71 } else if ( strcasecmp( argv[0], "dbcachesize" ) == 0 ) {
74 "%s: line %d: missing size in \"dbcachesize <size>\" line\n",
78 li->li_dbcachesize = atoi( argv[1] );
83 "%s: line %d: unknown directive \"%s\" in ldbm database definition (ignored)\n",
84 fname, lineno, argv[0] );