Home | History | Annotate | Download | only in db

Lines Matching defs:oi

104 	} oi;
118 memset(&oi, 0, sizeof(oi));
119 oi.mode = 0644;
120 oi.pagesize = 4096;
183 oi.mode = (mode_t)lval;
200 oi.pagesize = (unsigned int)lval;
255 oi.type = argv[0];
256 oi.file = argv[1];
267 oi.dbflags = O_RDWR | O_CREAT | O_EXLOCK;
269 oi.dbflags |= O_TRUNC;
277 oi.dbflags = O_RDWR | O_CREAT | O_EXLOCK;
281 oi.dbflags = O_RDONLY | O_SHLOCK;
284 /* validate oi.type */
285 if (strcmp(oi.type, "btree") == 0) {
293 btreeinfo.psize = oi.pagesize;
295 oi.info = &btreeinfo;
296 oi.dbtype = DB_BTREE;
297 } else if (strcmp(oi.type, "hash") == 0) {
303 hashinfo.bsize = oi.pagesize;
305 oi.info = &hashinfo;
306 oi.dbtype = DB_HASH;
308 warnx("Unknown database type `%s'", oi.type);
320 db = dbopen(oi.file, oi.dbflags, oi.mode, oi.dbtype, oi.info);
322 err(1, "Opening database `%s'", oi.file);
348 else if (DB_BTREE == oi.dbtype)
350 else if (DB_HASH == oi.dbtype)
354 oi.dbtype);
374 err(1, "Closing database `%s'", oi.file);