pike.git
/
src
/
modules
/
Gdbm
/
gdbmmod.c
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/src/modules/Gdbm/gdbmmod.c:217:
mt_unlock(& gdbm_lock); THREADS_DISALLOW(); if(!Pike_fp->current_object->prog) { if(tmp) gdbm_close(tmp); Pike_error("Object destructed in gdbm->create()\n"); } this->dbf=tmp;
-
pop_n_elems(args);
+
if(!this->dbf) Pike_error("Failed to open GDBM database: %d: %s.\n", gdbm_errno, gdbm_strerror(gdbm_errno)); } } #define STRING_TO_DATUM(dat, st) dat.dptr=st->str,dat.dsize=st->len; #define DATUM_TO_STRING(dat) make_shared_binary_string(dat.dptr, dat.dsize) /*! @decl string(8bit) fetch(string(8bit) key)
pike.git/src/modules/Gdbm/gdbmmod.c:582:
static void gdbmmod_sync(INT32 UNUSED(args)) { struct gdbm_glue *this=THIS; if(!THIS->dbf) Pike_error("GDBM database not open.\n"); THREADS_ALLOW(); mt_lock(& gdbm_lock); gdbm_sync(this->dbf); mt_unlock(& gdbm_lock); THREADS_DISALLOW();
-
push_int(0);
+
} static void gdbmmod_iter_first(INT32 UNUSED(args)) { struct gdbm_glue *this=THIS; gdbmmod_firstkey(0); if( Pike_sp[-1].u.string ) this->iter = Pike_sp[-1].u.string; Pike_sp--;
pike.git/src/modules/Gdbm/gdbmmod.c:712:
*! *! Closes the database. The object is no longer usable after this function has been called. *! *! This is also done automatically when the object is destructed for *! any reason (running out of references or explicit destruct, as an *! example) */ static void gdbmmod_close(INT32 args) {
-
pop_n_elems(args);
-
+
do_free();
-
push_int(0);
+
} static void init_gdbm_glue(struct object *UNUSED(o)) { THIS->dbf=0; THIS->iter=0; } static void init_gdbm_iterator(struct object *UNUSED(o)) {