pike.git / src / modules / Gdbm / gdbmmod.c

version» Context lines:

pike.git/src/modules/Gdbm/gdbmmod.c:713:    *! 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 UNUSED(args))   {    do_free();   }    - static void init_gdbm_glue(struct object *UNUSED(o)) - { -  THIS->dbf=0; -  THIS->iter=0; - } -  - static void init_gdbm_iterator(struct object *UNUSED(o)) - { -  THIS->dbf=0; -  THIS->iter=0; - } -  +    static void exit_gdbm_glue(struct object *UNUSED(o))   {    do_free();   }      static void exit_gdbm_iterator(struct object *UNUSED(o))   {    if( THIS->iter )    free_string( THIS->iter );   }
pike.git/src/modules/Gdbm/gdbmmod.c:803: Inside #if defined(HAVE_GDBM_H) && defined(HAVE_LIBGDBM)
   ADD_FUNCTION("sync",gdbmmod_sync,tFunc(tNone,tVoid),0);       /* iterator API.*/    ADD_FUNCTION("_get_iterator", gdbmmod_get_iterator,tFunc(tNone,tObj),0);       /* some mapping operator overloading */    ADD_FUNCTION("_m_delete",gdbmmod_m_delete,tFunc(tStr,tStr8),0);    ADD_FUNCTION("_values",gdbmmod_values,tFunc(tNone,tArr(tStr8)),0);    ADD_FUNCTION("_indices",gdbmmod_indices,tFunc(tNone,tArr(tStr8)),0);    -  set_init_callback(init_gdbm_glue); +     set_exit_callback(exit_gdbm_glue);    db = end_program();    add_program_constant( "DB", db, 0 );    add_program_constant( "gdbm", db, 0 ); /* compat (...-7.8). */    free_program(db);       start_new_program();    ADD_STORAGE(struct gdbm_glue);    ADD_FUNCTION("first", gdbmmod_iter_first,tFunc(tNone,tInt01),0);    ADD_FUNCTION("next", gdbmmod_iter_next, tFunc(tNone,tInt01),0);    ADD_FUNCTION("index", gdbmmod_iter_index,tFunc(tNone,tStr8),0);    ADD_FUNCTION("value", gdbmmod_iter_value,tFunc(tNone,tStr8),0);    ADD_FUNCTION("`!", gdbmmod_iter_no_value,tFunc(tNone,tInt01),0); -  set_init_callback(init_gdbm_iterator); +     set_exit_callback(exit_gdbm_iterator);    iterator = end_program();    add_program_constant( "Iterator", iterator, 0 );    free_program(iterator);   #else    HIDE_MODULE();   #endif   }