summaryrefslogtreecommitdiff
path: root/ext/dbm/dbm.c
AgeCommit message (Collapse)Author
2013-08-12* ext/dbm/dbm.c: [DOC] Reformat headings of DBM classzzak
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42530 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-12* safe.c (rb_set_safe_level, safe_setter): raise an ArgumentErrorshugo
when $SAFE is set to 4. $SAFE=4 is now obsolete. [ruby-core:55222] [Feature #8468] * object.c (rb_obj_untrusted, rb_obj_untrust, rb_obj_trust): Kernel#untrusted?, untrust, and trust are now deprecated. Their behavior is same as tainted?, taint, and untaint, respectively. * include/ruby/ruby.h (OBJ_UNTRUSTED, OBJ_UNTRUST): OBJ_UNTRUSTED() and OBJ_UNTRUST() are aliases of OBJ_TAINTED() and OBJ_TAINT(), respectively. * array.c, class.c, debug.c, dir.c, encoding.c, error.c, eval.c, ext/curses/curses.c, ext/dbm/dbm.c, ext/dl/cfunc.c, ext/dl/cptr.c, ext/dl/dl.c, ext/etc/etc.c, ext/fiddle/fiddle.c, ext/fiddle/pointer.c, ext/gdbm/gdbm.c, ext/readline/readline.c, ext/sdbm/init.c, ext/socket/ancdata.c, ext/socket/basicsocket.c, ext/socket/socket.c, ext/socket/udpsocket.c, ext/stringio/stringio.c, ext/syslog/syslog.c, ext/tk/tcltklib.c, ext/win32ole/win32ole.c, file.c, gc.c, hash.c, io.c, iseq.c, load.c, marshal.c, object.c, proc.c, process.c, random.c, re.c, safe.c, string.c, thread.c, transcode.c, variable.c, vm_insnhelper.c, vm_method.c, vm_trace.c: remove code for $SAFE=4. * test/dl/test_dl2.rb, test/erb/test_erb.rb, test/readline/test_readline.rb, test/readline/test_readline_history.rb, test/ruby/test_alias.rb, test/ruby/test_array.rb, test/ruby/test_dir.rb, test/ruby/test_encoding.rb, test/ruby/test_env.rb, test/ruby/test_eval.rb, test/ruby/test_exception.rb, test/ruby/test_file_exhaustive.rb, test/ruby/test_hash.rb, test/ruby/test_io.rb, test/ruby/test_method.rb, test/ruby/test_module.rb, test/ruby/test_object.rb, test/ruby/test_pack.rb, test/ruby/test_rand.rb, test/ruby/test_regexp.rb, test/ruby/test_settracefunc.rb, test/ruby/test_struct.rb, test/ruby/test_thread.rb, test/ruby/test_time.rb: remove tests for $SAFE=4. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41259 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-16* ext/socket/option.c: Document synonymous methods, by windwiny [GH-277]zzak
* ext/stringio/stringio.c: ditto * ext/io/wait/wait.c: ditto * ext/gdbm/gdbm.c: ditto * ext/dl/cfunc.c: ditto * ext/zlib/zlib.c: ditto * ext/win32ole/win32ole.c: ditto * ext/dbm/dbm.c: ditto * ext/json/generator/generator.c: ditto * ext/date/date_core.c: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40319 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-09-04remove trailing spaces.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36895 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-18* ext/dbm/dbm.c (fdbm_empty_p): fix wrong condtion introduced in r36438.naruse
* ext/sdbm/init.c (fsdbm_empty_p): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36448 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-18empty_p: optimize and warningsnobu
* ext/dbm/dbm.c (fdbm_empty_p): not empty if first key exists. suppress warnngs by gcc 4.7 -Wstrict-overflow. * ext/sdbm/init.c (fsdbm_empty_p): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36438 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-27* io.c, process.c, time.c, ext: use rb_sys_fail_str instead ofnobu
rb_sys_fail. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34825 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-25update comment.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34804 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-25* ext/curses/curses.c (Init_curses): use rb_define_const once forakr
Curses::VERSION. * ext/dbm/dbm.c (Init_dbm): ditto for DBM::VERSION. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34799 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-25* ext/curses/curses.c (Init_curses): make Curses::VERSIONakr
understandable without context. * ext/dbm/dbm.c (Init_dbm): ditto for DBM::VERSION. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34798 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-21* ext/dbm/extconf.rb: check DBM_SUFFIX for Mac OS X.akr
Its ndbm.h doesn't include db.h. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34726 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-21* ext/dbm/dbm.c (fdbm_initialize): disable Berkeley DB error messages.akr
* ext/dbm/extconf.rb: check DBC type for above. [ruby-dev:45269] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34724 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-19* ext/dbm/dbm.c (Init_dbm): refine DBM::VERSION definition.akr
* ext/dbm/extconf.rb: provide RUBYDBM_GDBM_HEADER macro. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34696 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-18* ext/dbm/extconf.rb: detect GDBM's ndbm.h by testing dbm_clearerr isakr
an empty macro. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34685 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-18* ext/dbm/extconf.rb (dblib): prefer recent GDBM over older GDBM.akr
(have_declared_libvar): new function to check a declared variable exists in a library. (have_undeclared_libvar): renamed from renamed from have_libvar. (headers.db_check2): check that GDBM version variable if GDBM header is choosen. * ext/dbm/dbm.c (Init_dbm): use HAVE_DECLARED_LIBVAR_GDBM_VERSION and HAVE_UNDECLARED_LIBVAR_GDBM_VERSION macro. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34679 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-18* ext/dbm/dbm.c (DBM::VERSION): define it by detecting _GDBM_H_ orakr
_DBM_IOERR. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34672 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-11update doc.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34560 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-10* ext/dbm/dbm.c (Init_dbm): fix a build error on mswin32.shirosaki
use `extern __declspec(dllimport)` for dll link with VC. [ruby-core:41996] [Bug #5869] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34265 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-09update doc.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34241 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-09update doc.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34240 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-06fix spaces.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33964 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-06* ext/dbm/dbm.c: use db_version() instead of DB_VERSION_STRING forakr
detect runtime Berkeley DB version. use dpversion instead of _QDBM_VERSION for detect runtime QDBM [ruby-dev:44948] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33963 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-06* ext/dbm/extconf.rb: detect gdbm_version in libgdbm.akr
* ext/dbm/dbm.c: make DBM::VERSION more informative for gdbm, qdbm and Berkeley DB 1.x. [ruby-dev:44944] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33959 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-13* ext/dbm/extconf.rb: use convertible_int.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33738 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-13update comments.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33735 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-12* ext/dbm/extconf.rb: dbm_clearerr should be available in all ndbmakr
implementation. If it is not available, it is caused by header/library mismatch such that Berkeley DB header & gdbm library. * ext/dbm/dbm.c (fdbm_store): use dbm_clearerr() unconditionally. gdbm 1.9 provides it as a real function instead of a empty macro. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33723 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-10add comment.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33700 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-08* ext/dbm/dbm.c (fdbm_fetch, fdbm_key, fdbm_delete, fdbm_store)nobu
(fdbm_has_key, fdbm_has_value): get rid of overflow. * ext/gdbm/gdbm.c (rb_gdbm_fetch2, rb_gdbm_nextkey) (rb_gdbm_delete, fgdbm_store, fgdbm_has_key): ditto. * ext/dbm/dbm.c (fdbm_delete_if): hide intermediate objects. * ext/gdbm/gdbm.c (fgdbm_delete_if): ditto. * ext/dbm/extconf.rb: check size of datum.dsize to get rid of overflow. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33676 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-07add comment.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33656 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-07* ext/dbm/extconf.rb: check dbm_pagfno() and dbm_dirfno().akr
* ext/dbm/dbm.c: use above to set close-on-exec flag. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33652 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-04* whitespace cleanup.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33634 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-01add comment.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33599 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-31* ext/dbm/dbm.c (fdbm_initialize): use O_CLOEXEC if available.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33586 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-03-21* enc/utf_16le.c: surpress warning: shorten-64-to-32.naruse
* ext/dbm/dbm.c: ditto. * ext/gdbm/gdbm.c: ditto. * parse.y (Init_ripper): surpress warning: unused value. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-02-06* ext/dbm/dbm.c: parenthesize macro arguments.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30802 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-20* ext/dbm/dbm.c: rdoc based on a patch by mathew meta ATnobu
pobox.com, at [ruby-core:32853]. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29540 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-16* ext/dbm/dbm.c (struct dbmdata, fdbm_key, fdbm_delete_if): fixednobu
type warnings. * time.c (calc_tm_yday): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28656 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-22* ext/**/*.[ch]: removed trailing spaces.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27437 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-23* ext/dbm/dbm.c (fdbm_initialize): Make the file variableknu
volatile, because FilePathValue() currently does not protect the given variable from GC. (Probably it should) * ext/sdbm/init.c (fsdbm_initialize): Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23057 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-07* ext/dbm/dbm.c (fdbm_index): make #index warn like Hash.matz
* ext/dbm/dbm.c (fdbm_key): new method. * ext/sdbm/init.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20146 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-20* include/ruby/ruby.h (ExportStringValue): new macro to convertmatz
string in internal encoding to external to export. * string.c (rb_str_export): new function to do conversion to external encoding. * ext/sdbm/init.c: encoding conversion support. * ext/dbm/dbm.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19855 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-08* array.c, bignum.c, cont.c, dir.c, dln.c, encoding.c, enumerator.c,ko1
enumerator.c (enumerator_allocate), eval_jump.c, file.c, hash.c, io.c, load.c, pack.c, proc.c, random.c, re.c, ruby.c, st.c, string.c, thread.c, thread_pthread.c, time.c, util.c, variable.c, vm.c, gc.c: allocated memory objects by xmalloc (ruby_xmalloc) should be freed by xfree (ruby_xfree). * ext/curses/curses.c, ext/dbm/dbm.c, ext/digest/digest.c, ext/gdbm/gdbm.c, ext/json/ext/parser/parser.c, ext/json/ext/parser/unicode.c, ext/openssl/ossl_cipher.c, ext/openssl/ossl_hmac.c, ext/openssl/ossl_pkey_ec.c, ext/sdbm/init.c, ext/strscan/strscan.c, ext/zlib/zlib.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17017 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-21 * ext/dbm/dbm.c (fdbm_each_value, fdbm_each_key, fdbm_each_pair):knu
GDBM#{each,each_pair,each_key,each_value}: Return an enumerator if no block is given. * ext/gdbm/gdbm.c (fgdbm_each_value, fgdbm_each_key, fgdbm_each_pair): GDBM#{each,each_pair,each_key,each_value}: Return an enumerator if no block is given. * ext/openssl/ossl_config.c (ossl_config_each): OpenSSL::Config#each: Return an enumerator if no block is given. * ext/readline/readline.c (hist_each): Readline::HISTORY#each: Return an enumerator if no block is given. * ext/sdbm/init.c (fsdbm_each_value, fsdbm_each_key, fsdbm_each_pair): SDBM#{each,each_pair,each_key,each_value}: Return an enumerator if no block is given. * ext/stringio/stringio.c (strio_each_byte, strio_each): StringIO#{each,each_line,each_byte}: Return an enumerator if no block is given. * ext/stringio/stringio.c (Init_stringio): Add #lines and #bytes, which are aliases to #each_line and #each_byte, respectively. * ext/win32ole/win32ole.c (fole_each): WIN32OLE#each: Return an enumerator if no block is given. * ext/zlib/zlib.c (rb_gzreader_each_byte, rb_gzreader_each): Zlib::GzipReader#{each,each_line,each_byte}: Return an enumerator if no block is given. * ext/zlib/zlib.c (Init_zlib): Add Zlib::GzipReader#lines and #bytes, which are aliases to #each_line and #each_byte, respectively. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16125 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-06* $Date$ keyword removed to avoid inclusion of locale dependentakr
string. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14912 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-09-02* ruby.h (struct RArray): embed small arrays.matz
(RARRAY_LEN): defined for accessing array members. (RARRAY_PTR): ditto. * array.c: use RARRAY_LEN and RARRAY_PTR. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10833 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-08-31* ruby.h (struct RString): embed small strings.matz
(RSTRING_LEN): defined for accessing string members. (RSTRING_PTR): ditto. * string.c: use RSTRING_LEN and RSTRING_PTR. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10809 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-02-13* parse.y (parser_parse_string): mention "regexp" in a errormatz
message. a patch from Mauricio Fernandez <mfp at acm.org> [ruby-core:07340] * eval.c (rb_f_autoload): check if ruby_cbase is nil (during instance_eval for objects cannot have singleton classes, e.g. fixnums and symbols). [ruby-dev:28178] * gc.c (rb_gc_call_finalizer_at_exit): turn on during_gc while invoking finalizers. * gc.c (rb_gc_finalize_deferred): ditto. * io.c (rb_write_error2): use fwrite(3) if rb_stderr is not updated or is already freed. [ruby-dev:28313] * eval.c (error_line): include the class name of a surrounding method in error position description. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9918 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-02-03* eval.c: unify ruby_class (for method definition) and ruby_cbasematz
(for constant reference). * eval.c (rb_call0): use TMP_ALLOC() instead of allocating a temporary array object. * eval.c (eval): need not to protect $SAFE value. [ruby-core:07177] * error.c (Init_Exception): change NameError to direct subclass of Exception so that default rescue do not handle it silently. * struct.c (rb_struct_select): update RDoc description. [ruby-core:7254] * numeric.c (int_upto): return an enumerator if no block is attached to the method. * numeric.c (int_downto): ditto. * numeric.c (int_dotimes): ditto. * enum.c (enum_first): new method Enumerable#first to take first n element from an enumerable. * enum.c (enum_group_by): new method Enumerable#group_by that groups enumerable values according to their block values. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9880 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-09-24banish some warnings.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9292 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2005-06-20* ext/dbm/dbm.c (fdbm_closed): new method DBM#closed?usa
* ext/gdbm/gdbm.c (fgdbm_closed): new method GDBM#closed? * ext/sdbm/init.c (fsdbm_closed): new method SDBM#closed? * test/dbm/test_dbm.rb, test/gdbm/test_gdbm.rb, test/sdbm/test_sdbm.rb (teardown): close all db objects before deleting data files. * win32/win32.{ch} (unlink): hook runtime function to change file attribute before unlinking. merge from 1.8, see [ruby-dev:26360] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8650 b2dd03c8-39d4-4d8f-98ff-823fe69b080e