Lines Matching refs:sm_cdbmap
129 SMDB_CDB_DATABASE *sm_cdbmap = (SMDB_CDB_DATABASE *) database->smdb_impl; local
131 if (NULL == sm_cdbmap)
134 if (sm_cdbmap->cdbmap_create)
135 result = cdb_make_finish(&sm_cdbmap->cdbmap_map.cdbs_cdb_wr);
137 fd = sm_cdbmap->cdbmap_fd;
141 sm_cdbmap->cdbmap_fd = -1;
144 free(sm_cdbmap);
156 SMDB_CDB_DATABASE *sm_cdbmap = (SMDB_CDB_DATABASE *) database->smdb_impl; local
158 assert(sm_cdbmap != NULL);
167 SMDB_CDB_DATABASE *sm_cdbmap = (SMDB_CDB_DATABASE *) database->smdb_impl; local
168 return sm_cdbmap->cdbmap_fd;
175 SMDB_CDB_DATABASE *sm_cdbmap = (SMDB_CDB_DATABASE *) database->smdb_impl; local
177 return sm_cdbmap->smcdb_lock_fd;
212 SMDB_CDB_DATABASE *sm_cdbmap = (SMDB_CDB_DATABASE *) database->smdb_impl; local
218 if (NULL == sm_cdbmap )
223 ret = cdb_find(&sm_cdbmap->cdbmap_map.cdbs_cdb_rd,
227 l = cdb_datalen(&sm_cdbmap->cdbmap_map.cdbs_cdb_rd);
229 ret = cdb_read(&sm_cdbmap->cdbmap_map.cdbs_cdb_rd,
231 cdb_datapos(&sm_cdbmap->cdbmap_map.cdbs_cdb_rd));
254 SMDB_CDB_DATABASE *sm_cdbmap = (SMDB_CDB_DATABASE *) database->smdb_impl; local
256 assert(sm_cdbmap != NULL);
262 r = cdb_make_put(&sm_cdbmap->cdbmap_map.cdbs_cdb_wr,
285 SMDB_CDB_DATABASE *sm_cdbmap = (SMDB_CDB_DATABASE *) database->smdb_impl; local
287 assert(sm_cdbmap != NULL);
288 fd = sm_cdbmap->cdbmap_fd;
335 SMDB_CDB_DATABASE *sm_cdbmap; local
340 sm_cdbmap = cursor->smdbc_impl;
341 ret = cdb_seqnext(&sm_cdbmap->smcdb_pos, &sm_cdbmap->cdbmap_map.cdbs_cdb_rd);
347 l = cdb_keylen(&sm_cdbmap->cdbmap_map.cdbs_cdb_rd);
350 ret = cdb_read(&sm_cdbmap->cdbmap_map.cdbs_cdb_rd,
352 cdb_keypos(&sm_cdbmap->cdbmap_map.cdbs_cdb_rd));
357 l = cdb_datalen(&sm_cdbmap->cdbmap_map.cdbs_cdb_rd);
360 ret = cdb_read(&sm_cdbmap->cdbmap_map.cdbs_cdb_rd,
362 cdb_datapos(&sm_cdbmap->cdbmap_map.cdbs_cdb_rd));
387 SMDB_CDB_DATABASE *sm_cdbmap; local
394 sm_cdbmap = (SMDB_CDB_DATABASE *) database->smdb_impl;
399 (*cursor)->smdbc_impl = sm_cdbmap;
401 cdb_seqinit(&sm_cdbmap->smcdb_pos, &sm_cdbmap->cdbmap_map.cdbs_cdb_rd);
443 SMDB_CDB_DATABASE *sm_cdbmap; local
476 sm_cdbmap = smcdb_malloc_database();
477 if (sm_cdbmap == NULL || smdb_db == NULL)
481 if (sm_cdbmap != NULL)
482 free(sm_cdbmap);
486 sm_cdbmap->smcdb_lock_fd = lock_fd;
508 sm_cdbmap->cdbmap_create = (mode != O_RDONLY);
510 result = cdb_init(&sm_cdbmap->cdbmap_map.cdbs_cdb_rd, db_fd);
512 result = cdb_make_start(&sm_cdbmap->cdbmap_map.cdbs_cdb_wr, db_fd);
548 smdb_db->smdb_impl = sm_cdbmap;
556 if (sm_cdbmap != NULL)
561 smdb_unlock_file(sm_cdbmap->smcdb_lock_fd);
562 free(sm_cdbmap);