Ruby 2.0.0p353(2013-11-22revision43784)

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

Macros | Functions | Variables
_sdbm.c File Reference
`#include "ruby/config.h"`
`#include "ruby/defines.h"`
`#include "sdbm.h"`
`#include <stdio.h>`
`#include <stdlib.h>`
`#include <sys/types.h>`
`#include <sys/stat.h>`
`#include <fcntl.h>`
`#include <errno.h>`
`#include <string.h>`
Include dependency graph for _sdbm.c:

Go to the source code of this file.

## Macros
#define | BYTESIZ 8
#define | SEEDUPS 1 /* always detect duplicates */
#define | BADMESS
#define | debug(x)
#define | GET_SHORT(p, i) ((p)[(i)])
#define | PUT_SHORT(p, i, s) ((p)[(i)] = (s))
#define | O_BINARY 0
#define | EPERM EACCES
#define | NULL 0
#define | bad(x) ((x).dptr == NULL || (x).dsize < 0)
#define | exhash(item) sdbm_hash((item).dptr, (item).dsize)
#define | ioerr(db) ((db)->flags |= DBM_IOERR)
#define | OFF_PAG(off) (long) (off) * PBLKSIZ
#define | OFF_DIR(off) (long) (off) * DBLKSIZ
#define | exhash(item) sdbm_hash((item).dptr, (item).dsize)

## Functions
static int fitpair | proto ((char *, int))
static void putpair | proto ((char *, datum, datum))
static datum getpair | proto ((char *, datum))
static int chkpage | proto ((char *))
static void splpage | proto ((char *, char *, long))
static int getdbit | proto ((DBM *, long))
static datum getnext | proto ((DBM *))
static int makroom | proto ((DBM *, long, int))
DBM * | sdbm_open (register char *file, register int flags, register int mode)
static int | fd_set_cloexec (int fd)
DBM * | sdbm_prep (char *dirname, char *pagname, int flags, int mode)
void | sdbm_close (register DBM *db)
datum | sdbm_fetch (register DBM *db, datum key)
int | sdbm_delete (register DBM *db, datum key)
int | sdbm_store (register DBM *db, datum key, datum val, int flags)
static int | makroom (register DBM *db, long int hash, int need)
datum | sdbm_firstkey (register DBM *db)
datum | sdbm_nextkey (register DBM *db)
static int | getpage (register DBM *db, register long int hash)
static int | getdbit (register DBM *db, register long int dbit)
static int | setdbit (register DBM *db, register long int dbit)
static datum | getnext (register DBM *db)
static int seepair | proto ((char *, int, char *, int))
static int | fitpair (char *pag, int need)
static void | putpair (char *pag, datum key, datum val)
static datum | getpair (char *pag, datum key)
static int | duppair (char *pag, datum key)
static datum | getnkey (char *pag, int num)
static int | delpair (char *pag, datum key)
static int | seepair (char *pag, register int n, register char *key, register int siz)
static void | splpage (char *pag, char *new, long int sbit)
static int | chkpage (char *pag)
long | sdbm_hash (register char *str, register int len)

## Variables
int | errno
static long | masks []
datum | nullitem = {NULL, 0}

## Macro Definition Documentation

#define bad | ( |  | x | ) | ((x).dptr == NULL || (x).dsize < 0)

Definition at line 125 of file _sdbm.c.

Referenced by get_addr(), getaddrinfo(), rb_cstr_to_dbl(), rb_cstr_to_inum(), sdbm_delete(), sdbm_fetch(), and sdbm_store().

#define BADMESS

Value:
1 /* generate a message for worst case:
cannot make room after SPLTMAX splits */

Definition at line 42 of file _sdbm.c.

#define BYTESIZ 8

Definition at line 25 of file _sdbm.c.

Referenced by getdbit(), sdbm_prep(), and setdbit().

#define debug | ( |  | x | ) |

Definition at line 52 of file _sdbm.c.

Referenced by delpair(), fitpair(), get_line_info(), getdbit(), getpage(), Init_syslog(), load_encoding(), makroom(), setdbit(), and splpage().

#define EPERM EACCES

Definition at line 94 of file _sdbm.c.

Referenced by fdbm_store(), fgdbm_store(), fsdbm_store(), kill(), p_gid_change_privilege(), p_gid_switch(), p_uid_change_privilege(), p_uid_switch(), sdbm_delete(), and sdbm_store().

#define exhash | ( |  | item | ) | sdbm_hash((item).dptr, (item).dsize)

Definition at line 639 of file _sdbm.c.

Referenced by sdbm_delete(), sdbm_fetch(), sdbm_store(), and splpage().

#define exhash | ( |  | item | ) | sdbm_hash((item).dptr, (item).dsize)

Definition at line 639 of file _sdbm.c.

#define GET_SHORT | ( |  | p,
|  |  | i
| ) |  | ((p)[(i)])

Definition at line 59 of file _sdbm.c.

Referenced by chkpage(), delpair(), duppair(), fitpair(), getnkey(), getpair(), putpair(), seepair(), and splpage().

#define ioerr | ( |  | db | ) | ((db)->flags |= DBM_IOERR)

Definition at line 127 of file _sdbm.c.

Referenced by getnext(), sdbm_delete(), sdbm_fetch(), sdbm_firstkey(), and sdbm_store().

#define NULL 0

Definition at line 103 of file _sdbm.c.

Referenced by alias(), aligned_malloc(), allocate(), allocate_cbsubst_info(), allocate_converted_string(), and_code_range_buf(), argf_getpartial(), ary2safe_array_index(), asn1integer_to_num(), assign_heap_slot(), autoload_defined_p(), before_gc_sweep(), BigDecimal_div2(), BigDecimal_divmod(), BigDecimal_divremain(), BigDecimal_DoDivmod(), BigDecimal_global_new(), BigDecimal_mod(), BigDecimal_power(), BigDecimal_s_allocate(), BigDecimalCmp(), BigMath_s_exp(), BigMath_s_log(), bigmul1_toom3(), bm_search(), bm_search_backward(), bm_search_ic(), bm_search_notrev(), bm_search_notrev_ic(), bracket(), call_getaddrinfo(), catch_interrupt(), cbsubst_init(), check_eventloop_interp(), check_if_dir(), check_redefined_method(), clear_optimize_info(), clear_readconv(), clear_writeconv(), CloseChildHandle(), clsid_from_remote(), compat_init_setproctitle(), compile_enclose_node(), compile_length_enclose_node(), compile_tree(), compile_warn_print(), CONF_get1_default_config_file(), console_cooked(), console_noecho(), console_set_cooked(), console_set_echo(), convert_mb_to_wchar(), convert_UTF8_to_JSON(), convert_wchar_to_mb(), cParser_parse_quirks_mode(), cParser_parse_strict(), CreateChild(), cState_array_nl_set(), cState_indent_set(), cState_object_nl_set(), cState_s_allocate(), cState_space_before_set(), cState_space_set(), d_lite_next(), date_strftime_with_tmx(), datetime_s_now(), decode_bool(), decode_bstr(), decode_enum(), decode_eoc(), decode_int(), decode_null(), decode_obj(), decode_time(), defined_expr(), dh_generate(), dir_close(), dir_each(), dir_initialize(), dir_s_alloc(), dln_find_1(), dln_load(), do_opendir(), dsa_generate(), DupPKCS7RecipientPtr(), DupPKCS7SignerPtr(), DupPrivPKeyPtr(), DupX509AttrPtr(), DupX509ExtPtr(), DupX509ReqPtr(), DupX509RevokedPtr(), econv_args(), econv_convert(), econv_description(), econv_finish(), econv_primitive_convert(), econv_putback(), econv_s_allocate(), econv_s_asciicompat_encoding(), enc_arg(), enumerator_each_with_index(), establishShell(), ev_on_event(), eval_string_with_cref(), eval_under(), EVENTSINK_Constructor(), EVENTSINK_Destructor(), EVENTSINK_GetTypeInfo(), EVENTSINK_QueryInterface(), EVP_MD_CTX_create(), exec_interrupts(), exit_handler(), expand_case_fold_string(), expand_case_fold_string_alt(), fdbm_initialize(), features_index_add(), fev_s_allocate(), fev_unadvise(), fiber_store(), file_path_convert(), fill_cbuf(), fill_random_seed(), find_coclass(), find_default_source(), find_iid(), find_time_t(), FindChildSlot(), FindChildSlotByHandle(), FindFreeChildSlot(), finish_writeconv(), flock(), fole_each(), fole_free(), fole_initialize(), fole_s_allocate(), folemethod_event_interface(), folemethod_s_allocate(), foleparam_s_allocate(), foletype_s_allocate(), foletypelib_library_name(), foletypelib_name(), foletypelib_ole_types(), foletypelib_s_allocate(), foletypelib_visible(), folevariant_ary_aref(), folevariant_ary_aset(), folevariant_s_array(), for(), forward_search_range(), free_stack_chunks(), freeaddrinfo(), fstrndup(), function_call(), get_addr(), get_device_once(), get_freefunc(), get_locked_safe_array(), get_name(), get_proc_address(), get_ptr_of_variant(), get_special_folder(), get_system_directory(), get_transcoder_entry(), get_wsa_extension_function(), getaddrinfo(), GetBNPtr(), getclockofday(), GetConfigPtr(), GetDigestPtr(), getnameinfo(), getnetbyaddr(), getnetbyname(), getnetent(), getnext(), GetPrivPKeyPtr(), getprotoent(), getservent(), GetVpValueWithPrec(), glob_helper(), gmtime_r(), gmtime_with_leapsecond(), gmtimew(), guess_local_offset(), hist_each(), hist_get(), home_dir(), host_str(), if(), Init_dbm(), Init_etc(), init_func(), init_funcname_len(), Init_IO(), init_leap_second_info(), init_libraries(), init_libraries_if_necessary(), Init_process(), Init_Range(), Init_readline(), init_stdhandle(), Init_Time(), initialize(), initialize_cclass(), inspect_sockaddr(), installed_code_page_proc(), integer_rationalize(), io_binwrite(), io_encoding_set(), io_fillbuf(), io_flush_buffer_async2(), io_s_write(), io_set_encoding_by_bom(), io_ungetbyte(), io_wait_readable(), io_wait_writable(), is_mark_stask_empty(), is_mbc_newline_ex(), is_readable_pipe(), is_socket(), iseq_compile_each(), JSON_parse_array(), JSON_parse_float(), JSON_parse_integer(), JSON_parse_object(), JSON_parse_string(), JSON_parse_value(), kill(), link(), load_transcoder_entry(), localtime_r(), localtime_with_gmtoff_zone(), localtimew(), main(), make_addrinfo(), make_hostent_internal(), make_ipaddr0(), make_transcoder_entry(), make_writeconv(), map_search(), map_search_backward(), match_at(), maygvl_copy_stream_wait_read(), mbstr_to_wstr(), Messaging_HandleMessage(), method_entry_i(), move_refined_method(), move_to_next_entry(), mSyslog_close(), name_add(), name_find(), newobj(), nilclass_rationalize(), nkf_locale_charmap(), nkf_xmalloc(), nkf_xrealloc(), nl_langinfo_codeset(), node_extended_grapheme_cluster(), node_linebreak(), node_new_backref(), node_new_cclass_by_codepoint_range(), node_new_empty(), node_new_enclose(), node_new_quantifier(), node_new_str(), nogvl_copy_stream_wait_write(), not_code_range_buf(), nucomp_rationalize(), num_exact(), num_to_asn1integer(), obj_to_asn1bstr(), obj_to_asn1derstr(), obj_to_asn1gtime(), obj_to_asn1int(), obj_to_asn1null(), obj_to_asn1str(), obj_to_asn1utime(), ole_bind_obj(), ole_const_load(), ole_cp2encoding(), ole_create_dcom(), ole_each_sub(), ole_event_free(), ole_excepinfo2msg(), ole_hresult2msg(), ole_initialize(), ole_invoke(), ole_invoke2(), ole_mb2wc(), ole_method_event(), ole_method_helpcontext(), ole_method_helpfile(), ole_method_helpstring(), ole_method_sub(), ole_methods_sub(), ole_msg_loop(), ole_propertyput(), ole_set_member(), ole_set_safe_array(), ole_type_from_itypeinfo(), ole_type_helpcontext(), ole_type_helpfile(), ole_type_helpstring(), ole_types_from_typelib(), ole_usertype2val(), ole_val2olevariantdata(), ole_val2variant_ex(), ole_val_ary2variant_ary(), ole_variables(), ole_variant2val(), ole_vstr2wc(), ole_wc2mb(), oleclass_from_typelib(), oletypelib_search_registry(), oletypelib_search_registry2(), onig_bbuf_init(), onig_chain_reduce(), onig_compile(), onig_free_shared_cclass_table(), onig_names_free(), onig_new(), onig_new_with_source(), onig_new_without_alloc(), onig_node_list_add(), onig_node_new_anchor(), onig_parse_make_tree(), onig_reg_init(), onig_search_gpos(), onig_syntax_warn(), onigenc_get_prev_char_head(), onigenc_get_right_adjust_char_head_with_prev(), onigenc_step(), onigenc_step_back(), open_ifs_socket(), opendir_internal(), options(), or_code_range_buf(), ossl_asn1_decode0(), ossl_asn1_get_asn1type(), ossl_asn1data_to_der(), ossl_asn1obj_s_register(), ossl_asn1prim_to_der(), ossl_bn_alloc(), ossl_bn_coerce(), ossl_bn_copy(), ossl_bn_div(), ossl_bn_initialize(), ossl_bn_is_prime(), ossl_bn_is_prime_fasttest(), ossl_bn_new(), ossl_bn_s_generate_prime(), ossl_bn_to_i(), ossl_bn_to_s(), ossl_cipher_copy(), ossl_cipher_final(), ossl_cipher_init(), ossl_cipher_initialize(), ossl_cipher_new(), ossl_cipher_pkcs5_keyivgen(), ossl_cipher_reset(), ossl_cipher_set_iv(), ossl_cipher_set_key(), ossl_cipher_set_key_length(), ossl_cipher_update(), ossl_client_cert_cb(), ossl_create_dh(), ossl_default_tmp_dh_callback(), ossl_dh_compute_key(), ossl_dh_export(), ossl_dh_initialize(), ossl_dh_new(), ossl_dh_s_generate(), ossl_dh_to_der(), ossl_dh_to_public_key(), ossl_dh_to_text(), ossl_digest_alloc(), ossl_digest_copy(), ossl_digest_finish(), ossl_digest_initialize(), ossl_digest_new(), ossl_digest_reset(), ossl_dsa_export(), ossl_dsa_initialize(), ossl_dsa_new(), ossl_dsa_s_generate(), ossl_dsa_sign(), ossl_dsa_to_der(), ossl_dsa_to_public_key(), ossl_dsa_to_text(), ossl_dsa_verify(), ossl_get_errors(), ossl_hmac_hexdigest(), ossl_hmac_reset(), ossl_hmac_s_digest(), ossl_hmac_s_hexdigest(), ossl_make_error(), ossl_obj2bio(), ossl_pkcs12_initialize(), ossl_pkcs12_s_allocate(), ossl_pkcs12_s_create(), ossl_pkcs12_to_der(), ossl_pkcs7_add_certificate(), ossl_pkcs7_add_crl(), ossl_pkcs7_add_data(), ossl_pkcs7_alloc(), ossl_pkcs7_copy(), ossl_pkcs7_decrypt(), ossl_pkcs7_get_recipient(), ossl_pkcs7_initialize(), ossl_pkcs7_s_encrypt(), ossl_pkcs7_s_read_smime(), ossl_pkcs7_s_sign(), ossl_pkcs7_s_write_smime(), ossl_pkcs7_set_cipher(), ossl_pkcs7_set_detached(), ossl_pkcs7_set_type(), ossl_pkcs7_sym2typeid(), ossl_pkcs7_to_der(), ossl_pkcs7_to_pem(), ossl_pkcs7_verify(), ossl_pkcs7ri_alloc(), ossl_pkcs7ri_initialize(), ossl_pkcs7ri_new(), ossl_pkcs7si_alloc(), ossl_pkcs7si_get_signed_time(), ossl_pkcs7si_initialize(), ossl_pkcs7si_new(), ossl_pkey_alloc(), ossl_pkey_new_from_data(), ossl_pkey_new_from_file(), ossl_pkey_sign(), ossl_pkey_verify(), ossl_protect_obj2bio(), ossl_rand_bytes(), ossl_rand_egd(), ossl_rand_egd_bytes(), ossl_rand_load_file(), ossl_rand_pseudo_bytes(), ossl_rand_write_file(), ossl_rsa_export(), ossl_rsa_initialize(), ossl_rsa_new(), ossl_rsa_private_decrypt(), ossl_rsa_private_encrypt(), ossl_rsa_public_decrypt(), ossl_rsa_public_encrypt(), ossl_rsa_s_generate(), ossl_rsa_to_der(), ossl_rsa_to_public_key(), ossl_rsa_to_text(), ossl_spki_alloc(), ossl_spki_get_public_key(), ossl_spki_initialize(), ossl_spki_print(), ossl_spki_set_challenge(), ossl_spki_set_public_key(), ossl_spki_sign(), ossl_spki_to_der(), ossl_spki_to_pem(), ossl_spki_verify(), ossl_ssl_close(), ossl_ssl_get_cert(), ossl_ssl_get_peer_cert(), ossl_ssl_s_alloc(), ossl_ssl_session_alloc(), ossl_ssl_session_initialize(), ossl_ssl_session_to_der(), ossl_sslctx_add_extra_chain_cert_i(), ossl_sslctx_free(), ossl_sslctx_session_get_cb(), ossl_sslctx_session_new_cb(), ossl_sslctx_session_remove_cb(), ossl_sslctx_set_ssl_version(), ossl_sslctx_setup(), ossl_tmp_dh_callback(), ossl_x509_add_extension(), ossl_x509_alloc(), ossl_x509_copy(), ossl_x509_get_issuer(), ossl_x509_get_not_after(), ossl_x509_get_not_before(), ossl_x509_get_public_key(), ossl_x509_get_signature_algorithm(), ossl_x509_get_subject(), ossl_x509_initialize(), ossl_x509_new(), ossl_x509_new_from_file(), ossl_x509_set_extensions(), ossl_x509_set_issuer(), ossl_x509_set_not_after(), ossl_x509_set_not_before(), ossl_x509_set_public_key(), ossl_x509_set_subject(), ossl_x509_set_version(), ossl_x509_sign(), ossl_x509_to_der(), ossl_x509_to_pem(), ossl_x509_to_text(), ossl_x509_verify(), ossl_x509attr_alloc(), ossl_x509attr_get_oid(), ossl_x509attr_get_value(), ossl_x509attr_initialize(), ossl_x509attr_new(), ossl_x509attr_set_oid(), ossl_x509attr_to_der(), ossl_x509crl_add_extension(), ossl_x509crl_add_revoked(), ossl_x509crl_alloc(), ossl_x509crl_copy(), ossl_x509crl_get_signature_algorithm(), ossl_x509crl_initialize(), ossl_x509crl_new(), ossl_x509crl_set_extensions(), ossl_x509crl_set_issuer(), ossl_x509crl_set_last_update(), ossl_x509crl_set_next_update(), ossl_x509crl_set_revoked(), ossl_x509crl_set_version(), ossl_x509crl_sign(), ossl_x509crl_to_der(), ossl_x509crl_to_pem(), ossl_x509crl_to_text(), ossl_x509crl_verify(), ossl_x509ext_alloc(), ossl_x509ext_get_oid(), ossl_x509ext_get_value(), ossl_x509ext_initialize(), ossl_x509ext_new(), ossl_x509ext_set_oid(), ossl_x509ext_set_value(), ossl_x509ext_to_der(), ossl_x509extfactory_create_ext(), ossl_x509name_add_entry(), ossl_x509name_alloc(), ossl_x509name_initialize(), ossl_x509name_new(), ossl_x509name_to_a(), ossl_x509name_to_der(), ossl_x509name_to_s(), ossl_x509name_to_s_old(), ossl_x509req_add_attribute(), ossl_x509req_alloc(), ossl_x509req_copy(), ossl_x509req_get_public_key(), ossl_x509req_get_signature_algorithm(), ossl_x509req_get_subject(), ossl_x509req_initialize(), ossl_x509req_new(), ossl_x509req_set_attributes(), ossl_x509req_set_public_key(), ossl_x509req_set_subject(), ossl_x509req_set_version(), ossl_x509req_sign(), ossl_x509req_to_der(), ossl_x509req_to_pem(), ossl_x509req_to_text(), ossl_x509req_verify(), ossl_x509revoked_add_extension(), ossl_x509revoked_alloc(), ossl_x509revoked_new(), ossl_x509revoked_set_extensions(), ossl_x509revoked_set_time(), ossl_x509stctx_alloc(), ossl_x509stctx_clear_ptr(), ossl_x509stctx_get_chain(), ossl_x509stctx_initialize(), ossl_x509store_add_cert(), ossl_x509store_add_crl(), ossl_x509store_add_file(), ossl_x509store_add_path(), ossl_x509store_alloc(), ossl_x509store_initialize(), ossl_x509store_set_default_paths(), overlapped_socket_io(), parse_branch(), parse_char_class(), parse_enclose(), parse_exp(), parse_mode_enc(), parse_posix_bracket(), parse_subexp(), parser_here_document(), parser_initialize(), path_initialize(), path_sub_ext(), PEM_def_callback(), pipe_open(), PPP_GetInterface(), PPP_InitializeModule(), prep_window(), print_guessed_code(), proc_exec_cmd(), proc_exec_sh(), pruby_cstr_to_var(), pruby_eval(), pruby_get_instance(), pruby_register_instance(), pruby_str_to_var(), pruby_var_equal_to_cstr_p(), pruby_var_prefixed_p(), pruby_var_to_cstr(), r_object0(), range_each(), rawmode_opt(), rb_ary_aref(), rb_ary_rotate_bang(), rb_ary_rotate_m(), rb_ary_slice_bang(), rb_bug(), rb_compile_error(), rb_compile_error_with_enc(), rb_disable_interrupt(), rb_dlcfunc2ptr(), rb_dlcfunc_initialize(), rb_dlcfunc_new(), rb_dlhandle_initialize(), rb_dlptr2cptr(), rb_dlptr_initialize(), rb_dlptr_s_malloc(), rb_dlptr_s_to_ptr(), rb_econv_alloc(), rb_econv_asciicompat_encoding(), rb_econv_encoding_to_insert_output(), rb_econv_init_by_convpath(), rb_econv_insert_output(), rb_econv_open(), rb_econv_open0(), rb_econv_open_by_transcoder_entries(), rb_econv_open_opts(), rb_econv_set_replacement(), rb_enable_interrupt(), rb_enc_path_last_separator(), rb_enc_reg_error_desc(), rb_enc_reg_new(), rb_enc_str_buf_cat(), rb_exec(), rb_exec_async_signal_safe(), rb_exec_fillarg(), rb_execarg_fixup(), rb_f_backquote(), rb_f_integer(), rb_f_system(), rb_fdopen(), rb_fiber_terminate(), rb_fiddle_handle_initialize(), rb_fiddle_ptr2cptr(), rb_fiddle_ptr_initialize(), rb_fiddle_ptr_s_malloc(), rb_fiddle_ptr_s_to_ptr(), rb_file_expand_path_internal(), rb_file_load_ok(), rb_file_open_generic(), rb_file_open_internal(), rb_file_s_utime(), rb_find_encoding(), rb_gc_force_recycle(), rb_gc_set_params(), rb_gmtime_r2(), rb_gzfile_ecopts(), rb_if_indextoname(), rb_io_ascii8bit_binmode(), rb_io_ext_int_to_encs(), rb_io_extract_encoding_option(), rb_io_extract_modeenc(), rb_io_modestr_fmode(), rb_io_reopen(), rb_io_s_binread(), rb_io_s_foreach(), rb_io_s_read(), rb_io_s_readlines(), rb_localtime_r2(), rb_mutex_lock(), rb_mutex_unlock_th(), rb_nkf_convert(), rb_nkf_guess(), rb_parser_free(), rb_parser_realloc(), rb_realpath_internal(), rb_reg_desc(), rb_reg_init_copy(), rb_reg_init_str(), rb_reg_initialize_m(), rb_reg_to_s(), rb_run_exec_options(), rb_spawn(), rb_spawn_process(), rb_stat_init(), rb_str_inspect(), rb_str_quote_unprintable(), rb_str_rstrip_bang(), rb_str_symname_p(), rb_strerrno(), rb_strftime(), rb_strftime_with_timespec(), rb_struct_define_without_accessor(), rb_thread_atfork(), rb_thread_mark(), rb_thread_select(), rb_thread_wait_fd_rw(), rb_trans_conv(), rb_type_str(), rb_vm_cref(), rb_vsprintf(), rb_w32_accept(), rb_w32_aspawn_flags(), rb_w32_asynchronize(), rb_w32_close(), rb_w32_cmdvector(), rb_w32_conv_from_wchar(), rb_w32_get_environ(), rb_w32_getcwd(), rb_w32_getenv(), rb_w32_gethostbyaddr(), rb_w32_gethostbyname(), rb_w32_getppid(), rb_w32_getprotobyname(), rb_w32_getprotobynumber(), rb_w32_getservbyname(), rb_w32_getservbyport(), rb_w32_inet_ntop(), rb_w32_io_cancelable_p(), rb_w32_mkdir(), rb_w32_open(), rb_w32_open_osfhandle(), rb_w32_opendir(), rb_w32_pipe(), rb_w32_read(), rb_w32_readdir(), rb_w32_recv(), rb_w32_rename(), rb_w32_rmdir(), rb_w32_select_with_thread(), rb_w32_send(), rb_w32_spawn(), rb_w32_stati64(), rb_w32_strerror(), rb_w32_uchdir(), rb_w32_uchmod(), rb_w32_ugetenv(), rb_w32_ulink(), rb_w32_umkdir(), rb_w32_unlink(), rb_w32_unwrap_io_handle(), rb_w32_uopen(), rb_w32_uopendir(), rb_w32_urename(), rb_w32_urmdir(), rb_w32_ustati64(), rb_w32_utime(), rb_w32_uunlink(), rb_w32_uutime(), rb_w32_wopen(), rb_w32_write(), rb_w32_write_console(), rb_wait_for_single_fd(), rb_waitpid_blocking(), rb_write_internal2(), rb_yield_refine_block(), read_den(), read_num(), readdir_internal(), readline_attempted_completion_function(), readline_readline(), recvmsg(), reg_enum_key(), reg_get_val(), reg_get_val2(), reinit(), rewrite_cref_stack(), ripper_token2eventid(), RMD160_Finish(), RMD160_Init(), RMD160_Transform(), RMD160_Update(), rsa_generate(), rsock_getaddrinfo(), rsock_ipaddr(), ruby_hdtoa(), ruby_strtod(), scalar(), scan_env_clear(), sdbm_close(), sdbm_delete(), sdbm_fetch(), sdbm_firstkey(), sdbm_nextkey(), sdbm_open(), sdbm_prep(), sdbm_store(), search_nonascii(), send_internal(), sendmsg(), setproctitle(), setup_overlapped(), setup_tree(), sip_hash_new(), slot_sweep(), slow_search(), slow_search_backward(), slow_search_backward_ic(), slow_search_ic(), sock_s_gethostbyaddr(), sock_s_getnameinfo(), ssl_renegotiation_cb(), STACK_OF(), start_document(), start_mapping(), start_sequence(), str_is_number(), str_transcode(), strio_seek(), stub_sysinit(), swallow(), switch(), tcl_protect_core(), terminate_atfork_i(), thread_free(), time_mload(), time_s_now(), time_zone(), timeofday(), timew2timespec_exact(), transcode_search_path(), transcode_search_path_i(), trap_check(), try_get_rnd(), typeinfo_from_ole(), typelib_file_from_typelib(), unlink_free_heap_slot(), unlink_heap_slot(), unpack_entries(), unswitch_mime_getc(), utime_internal(), val2variant_ptr(), vm_call_opt_send(), vm_exec(), vm_get_cref0(), VpAlloc(), VpCopy(), VpFree(), VpMult(), VpNumOfChars(), VpPower(), VpSqrt(), wait_connectable(), while(), WinMain(), wlink(), wmap_finalize(), wmkdir(), wstr_to_mbstr(), wutime(), X509_CRL_set_issuer_name(), X509_CRL_set_version(), yaml_alias_event_initialize(), yaml_document_add_mapping(), yaml_document_add_scalar(), yaml_document_add_sequence(), yaml_document_get_node(), yaml_document_get_root_node(), yaml_document_initialize(), yaml_document_start_event_initialize(), yaml_emitter_analyze_event(), yaml_emitter_append_tag_directive(), yaml_emitter_delete_document_and_anchors(), yaml_emitter_dump_node(), yaml_emitter_emit_document_start(), yaml_emitter_generate_anchor(), yaml_emitter_write_block_scalar_hints(), yaml_mapping_start_event_initialize(), yaml_parser_append_tag_directive(), yaml_parser_fetch_block_entry(), yaml_parser_fetch_key(), yaml_parser_fetch_value(), yaml_parser_load(), yaml_parser_load_mapping(), yaml_parser_load_sequence(), yaml_parser_parse_document_start(), yaml_parser_parse_flow_sequence_entry(), yaml_parser_parse_node(), yaml_parser_process_directives(), yaml_parser_process_empty_scalar(), yaml_parser_scan_directive(), yaml_parser_scan_tag(), yaml_parser_scan_tag_directive_value(), yaml_scalar_event_initialize(), yaml_sequence_start_event_initialize(), and yaml_strdup().

#define O_BINARY 0

Definition at line 89 of file _sdbm.c.

Referenced by copy_stream_body(), do_writeconv(), Init_IO(), init_stdhandle(), io_s_write(), load_file_internal(), prep_io(), rb_io_binmode(), rb_io_extract_modeenc(), rb_io_fmode_oflags(), rb_io_oflags_fmode(), rb_io_s_pipe(), rb_w32_accept(), rb_w32_open(), rb_w32_socket(), rb_w32_socketpair(), rb_w32_wopen(), and sdbm_prep().

#define OFF_DIR | ( |  | off | ) | (long) (off) * DBLKSIZ

Definition at line 130 of file _sdbm.c.

Referenced by getdbit(), and setdbit().

#define OFF_PAG | ( |  | off | ) | (long) (off) * PBLKSIZ

Definition at line 129 of file _sdbm.c.

Referenced by getnext(), getpage(), makroom(), sdbm_delete(), sdbm_firstkey(), and sdbm_store().

#define PUT_SHORT | ( |  | p,
|  |  | i,
|  |  | s
| ) |  | ((p)[(i)] = (s))

Definition at line 60 of file _sdbm.c.

Referenced by delpair(), and putpair().

#define SEEDUPS 1 /* always detect duplicates */

Definition at line 39 of file _sdbm.c.

## Function Documentation

static int chkpage | ( | char * | pag | ) |
| static

Definition at line 887 of file _sdbm.c.

References GET_SHORT, int, n, and PBLKSIZ.

Referenced by getnext(), and getpage().

static int delpair | ( | char * | pag,
|  | datum | key
| ) |  |
| static

Definition at line 760 of file _sdbm.c.

References debug, datum::dptr, datum::dsize, dst, GET_SHORT, i, m, memmove(), n, PBLKSIZ, PRIdPTRDIFF, PUT_SHORT, seepair(), and src.

Referenced by sdbm_delete(), and sdbm_store().

static int duppair | ( | char * | pag,
|  | datum | key
| ) |  |
| static

Definition at line 732 of file _sdbm.c.

References datum::dptr, datum::dsize, GET_SHORT, and seepair().

Referenced by sdbm_store().

static int fd_set_cloexec | ( | int | fd | ) |
| static

Definition at line 178 of file _sdbm.c.

References fcntl(), flags, and ret.

Referenced by sdbm_prep().

static int fitpair | ( | char * | pag,
|  | int | need
| ) |  |
| static

Definition at line 667 of file _sdbm.c.

References debug, free, GET_SHORT, int, n, and PBLKSIZ.

Referenced by makroom(), and sdbm_store().

static int getdbit | ( | register DBM * | db,
|  | register long int | dbit
| ) |  |
| static

Definition at line 541 of file _sdbm.c.

References BYTESIZ, c, DBLKSIZ, debug, DBM::dirbno, DBM::dirbuf, DBM::dirf, OFF_DIR, and SEEK_SET.

Referenced by getpage().

static datum getnext | ( | register DBM * | db | ) |
| static

Definition at line 596 of file _sdbm.c.

References DBM::blkptr, chkpage(), datum::dptr, getnkey(), ioerr, key, DBM::keyptr, NULL, nullitem, OFF_PAG, DBM::pagbno, DBM::pagbuf, DBM::pagf, PBLKSIZ, and SEEK_SET.

Referenced by sdbm_firstkey(), and sdbm_nextkey().

static datum getnkey | ( | char * | pag,
|  | int | num
| ) |  |
| static

Definition at line 741 of file _sdbm.c.

References datum::dptr, datum::dsize, GET_SHORT, key, and PBLKSIZ.

Referenced by getnext().

static int getpage | ( | register DBM * | db,
|  | register long int | hash
| ) |  |
| static

Definition at line 499 of file _sdbm.c.

References chkpage(), DBM::curbit, debug, getdbit(), DBM::hmask, memset(), OFF_PAG, DBM::pagbno, DBM::pagbuf, DBM::pagf, PBLKSIZ, SEEK_SET, and void.

Referenced by sdbm_delete(), sdbm_fetch(), and sdbm_store().

static datum getpair | ( | char * | pag,
|  | datum | key
| ) |  |
| static

Definition at line 712 of file _sdbm.c.

References datum::dptr, datum::dsize, GET_SHORT, i, n, seepair(), and val.

Referenced by sdbm_fetch().

static int makroom | ( | register DBM * | db,
|  | long int | hash,
|  | int | need
| ) |  |
| static

Definition at line 372 of file _sdbm.c.

References DBM::curbit, debug, fitpair(), DBM::hmask, memcpy(), memset(), OFF_PAG, DBM::pagbno, DBM::pagbuf, DBM::pagf, PBLKSIZ, SEEK_END, SEEK_SET, setdbit(), splpage(), SPLTMAX, and void.

Referenced by sdbm_store().

static datum getnkey proto | ( | (char *, int) |  | ) |
| static

static void putpair proto | ( | (char *, datum, datum) |  | ) |
| static

static int duppair proto | ( | (char *, datum) |  | ) |
| static

static int chkpage proto | ( | (char *) |  | ) |
| static

static void splpage proto | ( | (char *, char *, long) |  | ) |
| static

static int getpage proto | ( | (DBM *, long) |  | ) |
| static

static datum getnext proto | ( | (DBM *) |  | ) |
| static

static int makroom proto | ( | (DBM *, long, int) |  | ) |
| static

static int seepair proto | ( | (char *, int, char *, int) |  | ) |
| static

static void putpair | ( | char * | pag,
|  | datum | key,
|  | datum | val
| ) |  |
| static

Definition at line 684 of file _sdbm.c.

References datum::dptr, datum::dsize, GET_SHORT, memcpy(), n, PBLKSIZ, PUT_SHORT, and void.

Referenced by sdbm_store(), and splpage().

void sdbm_close | ( | register DBM * | db | ) |

Definition at line 266 of file _sdbm.c.

References DBM::dirf, free, NULL, DBM::pagf, and void.

Referenced by free_sdbm(), and fsdbm_close().

int sdbm_delete | ( | register DBM * | db,
|  | datum | key
| ) |  |

Definition at line 290 of file _sdbm.c.

References bad, delpair(), EPERM, exhash, getpage(), ioerr, NULL, OFF_PAG, DBM::pagbno, DBM::pagbuf, DBM::pagf, PBLKSIZ, sdbm_rdonly, and SEEK_SET.

Referenced by fsdbm_clear(), fsdbm_delete(), fsdbm_delete_if(), and fsdbm_shift().

datum sdbm_fetch | ( | register DBM * | db,
|  | datum | key
| ) |  |

Definition at line 278 of file _sdbm.c.

References bad, exhash, getpage(), getpair(), ioerr, NULL, nullitem, and DBM::pagbuf.

Referenced by fsdbm_delete(), fsdbm_delete_if(), fsdbm_each_pair(), fsdbm_each_value(), fsdbm_fetch(), fsdbm_has_key(), fsdbm_has_value(), fsdbm_invert(), fsdbm_key(), fsdbm_select(), fsdbm_shift(), fsdbm_to_a(), fsdbm_to_hash(), and fsdbm_values().

datum sdbm_firstkey | ( | register DBM * | db | ) |

Definition at line 469 of file _sdbm.c.

References DBM::blkptr, getnext(), ioerr, DBM::keyptr, memset(), NULL, nullitem, OFF_PAG, DBM::pagbno, DBM::pagbuf, DBM::pagf, PBLKSIZ, SEEK_SET, and void.

Referenced by fsdbm_clear(), fsdbm_delete_if(), fsdbm_each_key(), fsdbm_each_pair(), fsdbm_each_value(), fsdbm_empty_p(), fsdbm_has_value(), fsdbm_invert(), fsdbm_key(), fsdbm_keys(), fsdbm_length(), fsdbm_select(), fsdbm_shift(), fsdbm_to_a(), fsdbm_to_hash(), and fsdbm_values().

long sdbm_hash | ( | register char * | str,
|  | register int | len
| ) |  |

Definition at line 927 of file _sdbm.c.

References n.

datum sdbm_nextkey | ( | register DBM * | db | ) |

Definition at line 488 of file _sdbm.c.

References getnext(), NULL, and nullitem.

Referenced by fsdbm_delete_if(), fsdbm_each_key(), fsdbm_each_pair(), fsdbm_each_value(), fsdbm_empty_p(), fsdbm_has_value(), fsdbm_invert(), fsdbm_key(), fsdbm_keys(), fsdbm_length(), fsdbm_select(), fsdbm_to_a(), fsdbm_to_hash(), and fsdbm_values().

DBM* sdbm_open | ( | register char * | file,
|  | register int | flags,
|  | register int | mode
| ) |  |

Definition at line 149 of file _sdbm.c.

References DIRFEXT, free, malloc(), n, NULL, PAGFEXT, sdbm_prep(), strcpy(), and strlen().

Referenced by fsdbm_initialize().

DBM* sdbm_prep | ( | char * | dirname,
|  | char * | pagname,
|  | int | flags,
|  | int | mode
| ) |  |

Definition at line 201 of file _sdbm.c.

References DBM::blkptr, BYTESIZ, DBLKSIZ, DBM_RDONLY, DBM::dirbno, DBM::dirbuf, DBM::dirf, err, fd_set_cloexec(), DBM::flags, free, fstat, DBM::hmask, DBM::keyptr, malloc(), DBM::maxbno, memset(), NULL, O_BINARY, O_CLOEXEC, DBM::pagbno, DBM::pagbuf, DBM::pagf, PBLKSIZ, stat, and void.

Referenced by sdbm_open().

int sdbm_store | ( | register DBM * | db,
|  | datum | key,
|  | datum | val,
|  | int | flags
| ) |  |

Definition at line 314 of file _sdbm.c.

References bad, DBM_REPLACE, delpair(), datum::dsize, duppair(), EPERM, exhash, fitpair(), getpage(), hash, ioerr, makroom(), NULL, OFF_PAG, DBM::pagbno, DBM::pagbuf, DBM::pagf, PAIRMAX, PBLKSIZ, putpair(), sdbm_rdonly, SEEK_SET, and void.

Referenced by fsdbm_store().

static int seepair | ( | char * | pag,
|  | register int | n,
|  | register char * | key,
|  | register int | siz
| ) |  |
| static

Definition at line 830 of file _sdbm.c.

References GET_SHORT, i, memcmp(), n, and PBLKSIZ.

Referenced by delpair(), duppair(), and getpair().

static int setdbit | ( | register DBM * | db,
|  | register long int | dbit
| ) |  |
| static

Definition at line 562 of file _sdbm.c.

References BYTESIZ, c, DBLKSIZ, debug, DBM::dirbno, DBM::dirbuf, DBM::dirf, DBM::maxbno, OFF_DIR, and SEEK_SET.

Referenced by makroom().

static void splpage | ( | char * | pag,
|  | char * | new,
|  | long int | sbit
| ) |  |
| static

Definition at line 846 of file _sdbm.c.

References debug, datum::dptr, datum::dsize, exhash, GET_SHORT, key, memcpy(), memset(), n, PBLKSIZ, putpair(), val, and void.

Referenced by makroom().

## Variable Documentation

int errno

Referenced by argf_next_argv(), atanh(), BigDecimal_to_f(), call_asynchronous(), call_without_gvl(), check_if_wdir(), check_spawn_mode(), check_valid_dir(), cloexec_accept(), copy_stream_finalize(), CreateChild(), date_strftime_alloc(), date_strftime_with_tmx(), dir_initialize(), dir_read(), dln_load(), do_lstat(), do_opendir(), do_select(), do_stat(), dup2(), dupfd(), establishShell(), fcntl(), fdbm_store(), fgdbm_store(), fill_standard_fds(), finish_overlapped_socket(), finish_writeconv(), flock_winnt(), flush_before_seek(), fptr_finalize(), fsdbm_store(), function_call(), get_wsa_extension_function(), gmtime_r(), io_binwrite(), io_flush_buffer_async2(), io_flush_buffer_sync(), io_getpartial(), io_reopen(), io_unread(), ioctl(), kill(), lgamma_r(), load_file_internal(), localtime_r(), make_errno_exc(), make_errno_exc_str(), maygvl_copy_stream_continue_p(), maygvl_copy_stream_read(), maygvl_copy_stream_wait_read(), nogvl_copy_stream_read_write(), nogvl_copy_stream_wait_write(), nogvl_copy_stream_write(), open_dir_handle(), opendir_internal(), ossl_pkey_new_from_file(), ossl_ssl_write_internal(), ossl_start_ssl(), ossl_x509_new_from_file(), overlapped_socket_io(), p_gid_change_privilege(), p_gid_switch(), p_uid_change_privilege(), p_uid_switch(), pack_pack(), pack_unpack(), parser_yylex(), pipe_open(), poll_child_status(), proc_exec_cmd(), proc_exec_sh(), proc_exec_v(), proc_waitall(), rb_chsize(), rb_cloexec_dup2(), rb_cloexec_fcntl_dupfd(), rb_cloexec_pipe(), rb_cstr_to_dbl(), rb_dlcfunc_call(), rb_fdopen(), rb_file_flock(), rb_file_s_rename(), rb_io_each_byte(), rb_io_rewind(), rb_io_seek(), rb_io_set_pos(), rb_io_sysseek(), rb_io_tell(), rb_io_wait_readable(), rb_io_wait_writable(), rb_io_write_nonblock(), rb_maygvl_fd_fix_cloexec(), rb_pipe(), rb_strftime_alloc(), rb_strftime_with_timespec(), rb_sys_warning(), rb_sysopen(), rb_thread_blocking_region_end(), rb_thread_flock(), rb_thread_io_blocking_region(), rb_update_max_fd(), rb_w32_accept(), rb_w32_access(), rb_w32_aspawn_flags(), rb_w32_asynchronize(), rb_w32_bind(), rb_w32_close(), rb_w32_connect(), rb_w32_fclose(), rb_w32_getc(), rb_w32_getcwd(), rb_w32_gethostbyaddr(), rb_w32_gethostbyname(), rb_w32_gethostname(), rb_w32_getpeername(), rb_w32_getprotobyname(), rb_w32_getprotobynumber(), rb_w32_getservbyname(), rb_w32_getservbyport(), rb_w32_getsockname(), rb_w32_getsockopt(), rb_w32_ioctlsocket(), rb_w32_isatty(), rb_w32_listen(), rb_w32_open(), rb_w32_open_osfhandle(), rb_w32_pipe(), rb_w32_read(), rb_w32_select_with_thread(), rb_w32_setsockopt(), rb_w32_shutdown(), rb_w32_socket(), rb_w32_spawn(), rb_w32_truncate(), rb_w32_uaccess(), rb_w32_wopen(), rb_w32_wrap_io_handle(), rb_w32_write(), rb_wait_for_single_fd(), rb_waitpid(), readline_readline(), realpath_rec(), recvmsg(), rsock_connect(), rsock_s_accept(), rsock_s_accept_nonblock(), rsock_s_recvfrom_nonblock(), rsock_socket(), rsock_socket0(), ruby_close(), ruby_dup(), ruby_getcwd(), ruby_getpeername(), ruby_getsockname(), ruby_setenv(), ruby_shutdown(), ruby_strtod(), ruby_strtoul(), save_redirect_fd(), select_single(), sendmsg(), setfl(), setup_overlapped(), sock_connect_nonblock(), socketpair_internal(), strio_init(), sys_warning_1(), tgamma(), ttymode(), wait_connectable(), waitpid(), winnt_stat(), wlink(), wmkdir(), wrename(), wrmdir(), wstati64(), wunlink(), and wutime().

long masks[]
| static

Initial value:
= {
000000000000L, 000000000001L, 000000000003L,
000000000007L, 000000000017L, 000000000037L,
000000000077L, 000000000177L, 000000000377L,
000000000777L, 000000001777L, 000000003777L,
000000007777L, 000000017777L, 000000037777L,
000000077777L, 000000177777L, 000000377777L,
000000777777L, 000001777777L, 000003777777L,
000007777777L, 000017777777L, 000037777777L,
000077777777L, 000177777777L, 000377777777L,
000777777777L, 001777777777L, 003777777777L,
007777777777L, 017777777777L
}

Definition at line 132 of file _sdbm.c.

datum nullitem = {NULL, 0}

Definition at line 146 of file _sdbm.c.

Referenced by getnext(), sdbm_fetch(), sdbm_firstkey(), and sdbm_nextkey().