Lines Matching defs:dbm
54 static apr_status_t set_error(apr_dbm_t *dbm, apr_status_t dbm_said)
60 if ((dbm->errcode = gdbm_errno) == GDBM_NO_ERROR) {
61 dbm->errmsg = NULL;
64 dbm->errmsg = gdbm_strerror(gdbm_errno);
123 static void vt_gdbm_close(apr_dbm_t *dbm)
125 gdbm_close(dbm->file);
128 static apr_status_t vt_gdbm_fetch(apr_dbm_t *dbm, apr_datum_t key,
136 rd = gdbm_fetch(dbm->file, kd);
142 apr_pool_cleanup_register(dbm->pool, pvalue->dptr, datum_cleanup,
147 return set_error(dbm, APR_SUCCESS);
150 static apr_status_t vt_gdbm_store(apr_dbm_t *dbm, apr_datum_t key,
162 rc = gdbm_store(dbm->file, kd, vd, GDBM_REPLACE);
165 return set_error(dbm, g2s(rc));
168 static apr_status_t vt_gdbm_del(apr_dbm_t *dbm, apr_datum_t key)
176 rc = gdbm_delete(dbm->file, kd);
179 return set_error(dbm, g2s(rc));
182 static int vt_gdbm_exists(apr_dbm_t *dbm, apr_datum_t key)
189 return gdbm_exists(dbm->file, kd) != 0;
192 static apr_status_t vt_gdbm_firstkey(apr_dbm_t *dbm, apr_datum_t *pkey)
196 rd = gdbm_firstkey(dbm->file);
202 apr_pool_cleanup_register(dbm->pool, pkey->dptr, datum_cleanup,
206 return set_error(dbm, APR_SUCCESS);
209 static apr_status_t vt_gdbm_nextkey(apr_dbm_t *dbm, apr_datum_t *pkey)
216 rd = gdbm_nextkey(dbm->file, kd);
222 apr_pool_cleanup_register(dbm->pool, pkey->dptr, datum_cleanup,
226 return set_error(dbm, APR_SUCCESS);
229 static void vt_gdbm_freedatum(apr_dbm_t *dbm, apr_datum_t data)
231 (void) apr_pool_cleanup_run(dbm->pool, data.dptr, datum_cleanup);