Lines Matching defs:dbi

141 	dbinstance_t *dbi = NULL;
145 dbi = ndbi;
146 ndbi = DLZ_LIST_NEXT(dbi, link);
148 sqlite3_destroy(dbi);
167 dbinstance_t *dbi = NULL, *head;
171 head = dbi = DLZ_LIST_HEAD(*(sqlite3->db));
176 if (dlz_mutex_trylock(&dbi->lock) == 0)
177 return (dbi); /* success, return the DBI for use. */
180 dbi = DLZ_LIST_NEXT(dbi, link);
183 if (dbi == NULL) {
185 dbi = head;
253 dbinstance_t *dbi = NULL;
271 dbi = sqlite3_find_avail(db);
277 dbi = (dbinstance_t *)(db->db);
280 if (dbi == NULL) {
288 if (dbi->allnodes_q == NULL) {
294 if (dbi->allowxfr_q == NULL) {
300 if (dbi->authority_q == NULL) {
306 if (dbi->findzone_q == NULL) {
315 if (dbi->countzone_q == NULL) {
321 if (dbi->lookup_q == NULL) {
339 if (dbi->zone != NULL)
340 free(dbi->zone);
342 dbi->zone = escape_string(zone);
343 if (dbi->zone == NULL) {
348 dbi->zone = NULL;
351 if (dbi->record != NULL)
352 free(dbi->record);
354 dbi->record = escape_string(record);
355 if (dbi->record == NULL) {
360 dbi->record = NULL;
363 if (dbi->client != NULL)
364 free(dbi->client);
366 dbi->client = escape_string(client);
367 if (dbi->client == NULL) {
372 dbi->client = NULL;
380 querystring = build_querystring(dbi->allnodes_q);
383 querystring = build_querystring(dbi->allowxfr_q);
386 querystring = build_querystring(dbi->authority_q);
389 querystring = build_querystring(dbi->findzone_q);
392 querystring = build_querystring(dbi->countzone_q);
395 querystring = build_querystring(dbi->lookup_q);
421 qres = sqlite3_get_table(dbi->dbconn, querystring, &rs->pazResult,
442 if (dbi == NULL)
445 if (dbi->zone != NULL) {
446 free(dbi->zone);
447 dbi->zone = NULL;
449 if (dbi->record != NULL) {
450 free(dbi->record);
451 dbi->record = NULL;
453 if (dbi->client != NULL) {
454 free(dbi->client);
455 dbi->client = NULL;
458 /* release the lock so another thread can use this dbi */
459 (void) dlz_mutex_unlock(&dbi->lock);
882 dbinstance_t *dbi = NULL;
981 &dbi, s3->log);
986 &dbi, s3->log);
991 &dbi, s3->log);
996 &dbi, s3->log);
1001 &dbi, s3->log);
1037 DLZ_LINK_INIT(dbi, link);
1038 DLZ_LIST_APPEND(*(s3->db), dbi, link);
1044 s3->db = dbi;
1047 dbi->dbconn = dbc;
1051 dbi = NULL;