rem: db_key_t keys[] = {domain_domain_col}; db_val_t vals[1]; db_key_t cols[] = {domain_domain_col}; db_res_t* res;
add: if (db_mode == 0) { db_key_t keys[] = {domain_domain_col}; db_val_t vals[1]; db_key_t cols[] = {domain_domain_col}; db_res_t* res;
context: int is_domain_local(str* _host){	db_key_t keys[] = {domain_domain_col};	db_val_t vals[1];	db_key_t cols[] = {domain_domain_col};	db_res_t* res;	if (db_use_table(db_handle, domain_table) < 0) {		LOG(L_ERR, "is_local(): Error while trying to use domain table\n");	}	VAL_TYPE(vals) = DB_STR;	VAL_NULL(vals) = 0;    	VAL_STR(vals).s = _host->s;	VAL_STR(vals).len = _host->len;	if (db_query(db_handle, keys, vals, cols, 1, 1, 0, &res) < 0) {		LOG(L_ERR, "is_local(): Error while querying database\n");		return -1;	}	if (RES_ROW_N(res) == 0) {		DBG("is_local(): Realm \'%.*s\' is not local\n", 		    _host->len, _host->s);		db_free_query(db_handle, res);		return -1;	} else {		DBG("is_local(): Realm \'%.*s\' is local\n", 		    _host->len, _host->s);		db_free_query(db_handle, res);		return 1;	}}