Lines Matching defs:dbi

112 	dbinfo *dbi;
131 for (dbi = ISC_LIST_HEAD(dbs);
132 dbi != NULL;
133 dbi = ISC_LIST_NEXT(dbi, link)) {
134 if (dns_name_compare(dns_db_origin(dbi->db), origin) == 0)
138 return (dbi);
142 list(dbinfo *dbi, char *seektext) {
157 if (dbi->dbiterator == NULL) {
158 INSIST(dbi->iversion == NULL);
159 if (dns_db_iszone(dbi->db)) {
160 if (dbi->version != NULL)
161 dns_db_attachversion(dbi->db, dbi->version,
162 &dbi->iversion);
164 dns_db_currentversion(dbi->db, &dbi->iversion);
167 result = dns_db_createiterator(dbi->db, 0, &dbi->dbiterator);
177 dbi->db),
181 dbi->dbiterator,
183 } else if (dbi->ascending)
184 result = dns_dbiterator_first(dbi->dbiterator);
186 result = dns_dbiterator_last(dbi->dbiterator);
195 result = dns_dbiterator_current(dbi->dbiterator, &node, name);
198 result = dns_db_allrdatasets(dbi->db, node, dbi->iversion, 0,
201 dns_db_detachnode(dbi->db, &node);
206 dns_db_detachnode(dbi->db, &node);
207 if (dbi->ascending)
208 result = dns_dbiterator_next(dbi->dbiterator);
210 result = dns_dbiterator_prev(dbi->dbiterator);
212 if (result == ISC_R_SUCCESS && i == dbi->pause_every) {
214 result = dns_dbiterator_pause(dbi->dbiterator);
222 dns_dbiterator_destroy(&dbi->dbiterator);
223 if (dbi->iversion != NULL)
224 dns_db_closeversion(dbi->db, &dbi->iversion, ISC_FALSE);
234 dbinfo *dbi;
237 dbi = isc_mem_get(mctx, sizeof(*dbi));
238 if (dbi == NULL)
241 dbi->db = NULL;
242 dbi->version = NULL;
243 dbi->wversion = NULL;
245 dbi->rversions[i] = NULL;
246 dbi->hold_count = 0;
248 dbi->hold_nodes[i] = NULL;
249 dbi->dbiterator = NULL;
250 dbi->iversion = NULL;
251 dbi->pause_every = pause_every;
252 dbi->ascending = ascending;
253 ISC_LINK_INIT(dbi, link);
262 isc_mem_put(mctx, dbi, sizeof(*dbi));
269 0, NULL, &dbi->db);
271 isc_mem_put(mctx, dbi, sizeof(*dbi));
276 result = dns_db_load(dbi->db, filename);
278 dns_db_detach(&dbi->db);
279 isc_mem_put(mctx, dbi, sizeof(*dbi));
286 dns_dbtable_adddefault(dbtable, dbi->db);
287 cache_dbi = dbi;
289 result = dns_dbtable_add(dbtable, dbi->db);
291 dns_db_detach(&dbi->db);
292 isc_mem_put(mctx, dbi, sizeof(*dbi));
296 ISC_LIST_APPEND(dbs, dbi, link);
303 dbinfo *dbi, *dbi_next;
305 for (dbi = ISC_LIST_HEAD(dbs); dbi != NULL; dbi = dbi_next) {
306 dbi_next = ISC_LIST_NEXT(dbi, link);
307 if (dns_db_iszone(dbi->db))
308 dns_dbtable_remove(dbtable, dbi->db);
310 INSIST(dbi == cache_dbi);
314 dns_db_detach(&dbi->db);
315 ISC_LIST_UNLINK(dbs, dbi, link);
316 isc_mem_put(mctx, dbi, sizeof(*dbi));
320 #define DBI_CHECK(dbi) \
321 if ((dbi) == NULL) { \
362 dbinfo *dbi;
458 dbi = NULL;
478 if (verbose && dbi != NULL) {
479 if (dbi->wversion != NULL)
480 printf("future version (%p)\n", dbi->wversion);
481 for (i = 0; i < dbi->rcount; i++)
482 if (dbi->rversions[i] != NULL)
484 dbi->rversions[i]);
488 DBI_CHECK(dbi);
489 if (dbi->rcount == MAXVERSIONS) {
493 dns_db_currentversion(dbi->db,
494 &dbi->rversions[dbi->rcount]);
495 printf("opened version %d\n", dbi->rcount);
496 dbi->version = dbi->rversions[dbi->rcount];
497 version = dbi->version;
498 dbi->rcount++;
501 DBI_CHECK(dbi);
502 if (dbi->wversion != NULL) {
504 dbi->version = dbi->wversion;
505 version = dbi->version;
508 result = dns_db_newversion(dbi->db, &dbi->wversion);
513 dbi->version = dbi->wversion;
514 version = dbi->version;
517 DBI_CHECK(dbi);
520 if (dbi->version == NULL)
522 if (dbi->version == dbi->wversion) {
524 dbi->wversion = NULL;
526 for (i = 0; i < dbi->rcount; i++) {
527 if (dbi->version ==
528 dbi->rversions[i]) {
529 dbi->rversions[i] = NULL;
536 dns_db_closeversion(dbi->db, &dbi->version, ISC_TRUE);
540 DBI_CHECK(dbi);
543 if (dbi->version == NULL)
545 if (dbi->version == dbi->wversion) {
547 dbi->wversion = NULL;
549 for (i = 0; i < dbi->rcount; i++) {
550 if (dbi->version ==
551 dbi->rversions[i]) {
552 dbi->rversions[i] = NULL;
559 dns_db_closeversion(dbi->db, &dbi->version, ISC_FALSE);
563 DBI_CHECK(dbi);
572 DBI_CHECK(dbi);
581 DBI_CHECK(dbi);
589 DBI_CHECK(dbi);
590 for (i = 0; i < dbi->hold_count; i++)
591 dns_db_detachnode(dbi->db,
592 &dbi->hold_nodes[i]);
593 dbi->hold_count = 0;
598 DBI_CHECK(dbi);
600 dbi->version = NULL;
604 DBI_CHECK(dbi);
606 if (v >= dbi->rcount || v < 0) {
610 if (dbi->rversions[v] == NULL) {
615 dbi->version = dbi->rversions[v];
616 version = dbi->version;
654 DBI_CHECK(dbi);
655 list(dbi, &s[4]);
658 DBI_CHECK(dbi);
659 list(dbi, NULL);
662 DBI_CHECK(dbi);
663 result = dns_db_dump(dbi->db, dbi->version, s+4);
678 DBI_CHECK(dbi);
680 dbi->pause_every = v;
683 DBI_CHECK(dbi);
684 dbi->ascending = ISC_TRUE;
687 DBI_CHECK(dbi);
688 dbi->ascending = ISC_FALSE;
691 dbi = NULL;
697 dbi = select_db(s+4);
698 if (dbi != NULL) {
699 db = dbi->db;
700 origin = dns_db_origin(dbi->db);
701 version = dbi->version;
740 if (dbi == NULL) {
787 if (dbi != NULL)
806 if (dbi != NULL) {
808 RUNTIME_CHECK(dbi->hold_count <
810 dbi->hold_nodes[dbi->hold_count++] =
825 if (dbi == NULL)
838 if (dbi == NULL)
846 if (dbi == NULL)
878 if (dbi != NULL && addmode && !found_as) {
892 } else if (dbi != NULL && delmode && !found_as) {
904 if (dbi != NULL) {
906 RUNTIME_CHECK(dbi->hold_count < MAXHOLD);
907 dbi->hold_nodes[dbi->hold_count++] = node;