#include "ruby.h"
#include <gdbm.h>
#include <fcntl.h>
#include <errno.h>
Include dependency graph for gdbm.c:
Go to the source code of this file.
#define GetDBM | ( | obj, | |||
dbmp | ) |
Value:
do {\ Data_Get_Struct(obj, struct dbmdata, dbmp);\ if (dbmp == 0) closed_dbm();\ if (dbmp->di_dbm == 0) closed_dbm();\ } while (0)
#define GetDBM2 | ( | obj, | |||
data, | |||||
dbm | ) |
#define MY_BLOCK_SIZE (2048) |
#define MY_FATAL_FUNC rb_gdbm_fatal |
#define RUBY_GDBM_RW_BIT 0x20000000 |
static void closed_dbm | ( | void | ) | [static] |
Definition at line 606 of file gdbm.c.
References dbmdata::di_size, datum::dptr, free, GetDBM2, if(), rb_eGDBMError, rb_gdbm_modify(), and rb_raise().
Referenced by fgdbm_replace(), and Init_gdbm().
Definition at line 124 of file gdbm.c.
References dbmdata::di_dbm, GetDBM, and Qnil.
Referenced by fgdbm_s_open(), and Init_gdbm().
Definition at line 142 of file gdbm.c.
References Data_Get_Struct, dbmdata::di_dbm, Qfalse, and Qtrue.
Referenced by Init_gdbm().
Definition at line 527 of file gdbm.c.
References fgdbm_fetch(), Qnil, and rb_gdbm_delete().
Referenced by Init_gdbm().
Definition at line 568 of file gdbm.c.
References dbmdata::di_size, GetDBM2, RARRAY_LEN, RARRAY_PTR, rb_ary_new(), rb_ary_push(), rb_assoc_new(), rb_gdbm_delete(), rb_gdbm_fetch2(), rb_gdbm_firstkey(), rb_gdbm_modify(), rb_gdbm_nextkey(), rb_jump_tag(), rb_protect(), rb_yield(), and RTEST.
Referenced by Init_gdbm().
Definition at line 833 of file gdbm.c.
References GetDBM2, rb_gdbm_firstkey(), rb_gdbm_nextkey(), rb_yield(), RETURN_ENUMERATOR, and RTEST.
Referenced by Init_gdbm().
Definition at line 859 of file gdbm.c.
References GetDBM2, rb_assoc_new(), rb_gdbm_fetch2(), rb_gdbm_firstkey(), rb_gdbm_nextkey(), rb_yield(), RETURN_ENUMERATOR, and RTEST.
Referenced by Init_gdbm().
Definition at line 807 of file gdbm.c.
References GetDBM2, rb_gdbm_fetch2(), rb_gdbm_firstkey(), rb_gdbm_nextkey(), rb_yield(), RETURN_ENUMERATOR, and RTEST.
Referenced by Init_gdbm().
Definition at line 777 of file gdbm.c.
References dbmdata::di_dbm, dbmdata::di_size, datum::dptr, free, GetDBM, Qfalse, and Qtrue.
Referenced by Init_gdbm().
Definition at line 353 of file gdbm.c.
References NIL_P, Qnil, rb_block_given_p(), rb_gdbm_fetch3(), and rb_yield().
Referenced by fgdbm_delete(), and fgdbm_fetch_m().
Definition at line 386 of file gdbm.c.
References fgdbm_fetch(), NIL_P, rb_block_given_p(), rb_eIndexError, rb_raise(), and rb_scan_args().
Referenced by Init_gdbm().
Definition at line 937 of file gdbm.c.
References datum::dptr, datum::dsize, GetDBM2, Qfalse, Qtrue, RSTRING_LEN, RSTRING_PTR, and StringValue.
Referenced by Init_gdbm().
Definition at line 962 of file gdbm.c.
References GetDBM2, memcmp(), NIL_P, Qfalse, Qtrue, rb_gdbm_fetch2(), rb_gdbm_firstkey(), rb_gdbm_nextkey(), RSTRING_LEN, RSTRING_PTR, RTEST, and StringValue.
Referenced by Init_gdbm().
Definition at line 430 of file gdbm.c.
References fgdbm_key(), and rb_warn().
Referenced by Init_gdbm().
Definition at line 185 of file gdbm.c.
References ALLOC, DATA_PTR, dbmdata::di_dbm, dbmdata::di_size, free_dbm(), MY_BLOCK_SIZE, MY_FATAL_FUNC, NIL_P, NUM2INT, Qnil, rb_eGDBMError, rb_raise(), rb_scan_args(), rb_sys_fail, RSTRING_PTR, RUBY_GDBM_RW_BIT, and SafeStringValue.
Referenced by fgdbm_s_open(), and Init_gdbm().
Definition at line 650 of file gdbm.c.
References GetDBM2, hash(), rb_gdbm_fetch2(), rb_gdbm_firstkey(), rb_gdbm_nextkey(), rb_hash_aset(), rb_hash_new(), and RTEST.
Referenced by Init_gdbm().
Definition at line 406 of file gdbm.c.
References GetDBM2, memcmp(), NIL_P, Qnil, rb_gdbm_fetch2(), rb_gdbm_firstkey(), rb_gdbm_nextkey(), RSTRING_LEN, RSTRING_PTR, RTEST, and StringValue.
Referenced by fgdbm_index(), and Init_gdbm().
Definition at line 885 of file gdbm.c.
References GetDBM2, rb_ary_new(), rb_ary_push(), rb_gdbm_firstkey(), rb_gdbm_nextkey(), and RTEST.
Referenced by Init_gdbm().
Definition at line 750 of file gdbm.c.
References dbmdata::di_size, datum::dptr, free, GetDBM2, and INT2FIX.
Referenced by Init_gdbm().
Definition at line 1168 of file gdbm.c.
References fgdbm_to_hash(), and rb_hash_delete_if().
Referenced by Init_gdbm().
Definition at line 1018 of file gdbm.c.
References GetDBM2, and rb_gdbm_modify().
Referenced by Init_gdbm().
Definition at line 735 of file gdbm.c.
References fgdbm_clear(), rb_block_call, rb_intern, and update_i().
Referenced by Init_gdbm().
Definition at line 156 of file gdbm.c.
References Data_Wrap_Struct, and free_dbm().
Referenced by Init_gdbm().
Definition at line 265 of file gdbm.c.
References Data_Wrap_Struct, fgdbm_close(), fgdbm_initialize(), free_dbm(), NIL_P, Qnil, rb_block_given_p(), rb_ensure(), and rb_yield().
Referenced by Init_gdbm().
Definition at line 444 of file gdbm.c.
References GetDBM2, rb_ary_new(), rb_ary_push(), rb_assoc_new(), rb_gdbm_fetch2(), rb_gdbm_firstkey(), rb_gdbm_nextkey(), rb_yield(), and RTEST.
Referenced by Init_gdbm().
Definition at line 1058 of file gdbm.c.
References FIX2INT, GetDBM2, rb_eGDBMError, and rb_raise().
Referenced by Init_gdbm().
Definition at line 1083 of file gdbm.c.
References GetDBM2, rb_eGDBMError, rb_raise(), and RTEST.
Referenced by fgdbm_set_syncmode(), and Init_gdbm().
Definition at line 1114 of file gdbm.c.
References fgdbm_set_fastmode(), GetDBM2, Qfalse, Qtrue, rb_eGDBMError, rb_raise(), and RTEST.
Referenced by Init_gdbm().
Definition at line 544 of file gdbm.c.
References GetDBM2, NIL_P, Qnil, rb_assoc_new(), rb_gdbm_delete(), rb_gdbm_fetch2(), rb_gdbm_firstkey(), and rb_gdbm_modify().
Referenced by Init_gdbm().
Definition at line 675 of file gdbm.c.
References dbmdata::di_size, datum::dptr, datum::dsize, EPERM, errno, GetDBM2, rb_eGDBMError, rb_gdbm_modify(), rb_raise(), rb_sys_fail, RSTRING_LEN, RSTRING_PTR, and StringValue.
Referenced by Init_gdbm(), and update_i().
Definition at line 1040 of file gdbm.c.
References GetDBM2, and rb_gdbm_modify().
Referenced by Init_gdbm().
Definition at line 992 of file gdbm.c.
References GetDBM2, rb_ary_new(), rb_ary_push(), rb_assoc_new(), rb_gdbm_fetch2(), rb_gdbm_firstkey(), rb_gdbm_nextkey(), and RTEST.
Referenced by Init_gdbm().
Definition at line 1143 of file gdbm.c.
References GetDBM2, hash(), rb_gdbm_fetch2(), rb_gdbm_firstkey(), rb_gdbm_nextkey(), rb_hash_aset(), rb_hash_new(), and RTEST.
Referenced by fgdbm_reject(), and Init_gdbm().
Definition at line 721 of file gdbm.c.
References rb_block_call, rb_intern, and update_i().
Referenced by Init_gdbm().
Definition at line 909 of file gdbm.c.
References datum::dptr, free, GetDBM2, rb_ary_new(), rb_ary_push(), and rb_gdbm_fetch().
Referenced by Init_gdbm().
Definition at line 473 of file gdbm.c.
References rb_ary_new2(), rb_ary_push(), and rb_gdbm_fetch3().
Referenced by Init_gdbm().
static void free_dbm | ( | struct dbmdata * | dbmp | ) | [static] |
void Init_gdbm | ( | void | ) |
Definition at line 1174 of file gdbm.c.
References fgdbm_aref(), fgdbm_clear(), fgdbm_close(), fgdbm_closed(), fgdbm_delete(), fgdbm_delete_if(), fgdbm_each_key(), fgdbm_each_pair(), fgdbm_each_value(), fgdbm_empty_p(), fgdbm_fetch_m(), fgdbm_has_key(), fgdbm_has_value(), fgdbm_index(), fgdbm_initialize(), fgdbm_invert(), fgdbm_key(), fgdbm_keys(), fgdbm_length(), fgdbm_reject(), fgdbm_reorganize(), fgdbm_replace(), fgdbm_s_alloc(), fgdbm_s_open(), fgdbm_select(), fgdbm_set_cachesize(), fgdbm_set_fastmode(), fgdbm_set_syncmode(), fgdbm_shift(), fgdbm_store(), fgdbm_sync(), fgdbm_to_a(), fgdbm_to_hash(), fgdbm_update(), fgdbm_values(), fgdbm_values_at(), INT2FIX, rb_cGDBM, rb_cObject, rb_define_alloc_func(), rb_define_class(), rb_define_const(), rb_define_method(), rb_define_singleton_method(), rb_eException, rb_eGDBMError, rb_eGDBMFatalError, rb_eStandardError, rb_include_module(), rb_mEnumerable, rb_str_new2, and RUBY_GDBM_RW_BIT.
Definition at line 493 of file gdbm.c.
References dbmdata::di_size, datum::dptr, datum::dsize, GetDBM2, Qnil, rb_eGDBMError, rb_gdbm_modify(), rb_raise(), RSTRING_LEN, RSTRING_PTR, and StringValue.
Referenced by fgdbm_delete(), fgdbm_delete_if(), and fgdbm_shift().
static void rb_gdbm_fatal | ( | char * | msg | ) | [static] |
Definition at line 281 of file gdbm.c.
References datum::dptr, datum::dsize, free, OBJ_TAINT, Qnil, and rb_str_new().
Referenced by fgdbm_values(), and rb_gdbm_fetch2().
Definition at line 297 of file gdbm.c.
References datum::dptr, datum::dsize, rb_gdbm_fetch(), RSTRING_LEN, RSTRING_PTR, and StringValue.
Referenced by fgdbm_delete_if(), fgdbm_each_pair(), fgdbm_each_value(), fgdbm_has_value(), fgdbm_invert(), fgdbm_key(), fgdbm_select(), fgdbm_shift(), fgdbm_to_a(), fgdbm_to_hash(), and rb_gdbm_fetch3().
Definition at line 309 of file gdbm.c.
References GetDBM2, and rb_gdbm_fetch2().
Referenced by fgdbm_aref(), fgdbm_fetch(), and fgdbm_values_at().
static VALUE rb_gdbm_firstkey | ( | GDBM_FILE | dbm | ) | [static] |
Definition at line 319 of file gdbm.c.
References datum::dptr, datum::dsize, free, OBJ_TAINT, Qnil, and rb_str_new().
Referenced by fgdbm_delete_if(), fgdbm_each_key(), fgdbm_each_pair(), fgdbm_each_value(), fgdbm_has_value(), fgdbm_invert(), fgdbm_key(), fgdbm_keys(), fgdbm_select(), fgdbm_shift(), fgdbm_to_a(), and fgdbm_to_hash().
static void rb_gdbm_modify | ( | VALUE | obj | ) | [static] |
Definition at line 486 of file gdbm.c.
References OBJ_FROZEN, rb_error_frozen(), and rb_secure().
Referenced by fgdbm_clear(), fgdbm_delete_if(), fgdbm_reorganize(), fgdbm_shift(), fgdbm_store(), fgdbm_sync(), and rb_gdbm_delete().
Definition at line 335 of file gdbm.c.
References datum::dptr, datum::dsize, free, OBJ_TAINT, Qnil, rb_str_new(), RSTRING_LEN, and RSTRING_PTR.
Referenced by fgdbm_delete_if(), fgdbm_each_key(), fgdbm_each_pair(), fgdbm_each_value(), fgdbm_has_value(), fgdbm_invert(), fgdbm_key(), fgdbm_keys(), fgdbm_select(), fgdbm_to_a(), and fgdbm_to_hash().
Definition at line 702 of file gdbm.c.
References Check_Type, fgdbm_store(), Qnil, RARRAY_LEN, RARRAY_PTR, rb_eArgError, rb_raise(), and T_ARRAY.
VALUE rb_eGDBMError [static] |
Definition at line 74 of file gdbm.c.
Referenced by fgdbm_clear(), fgdbm_initialize(), fgdbm_set_cachesize(), fgdbm_set_fastmode(), fgdbm_set_syncmode(), fgdbm_store(), Init_gdbm(), and rb_gdbm_delete().
VALUE rb_eGDBMFatalError [static] |