akr
19fee2e2e0
* io.c (rb_io_init_copy): call io_seek only if io_tell succeeds.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20954 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-23 15:22:18 +00:00
akr
423bbf80d5
* process.c (rb_fork): propagete an error message from child to parent.
...
(rb_f_exec): show details of error in child process on
exception.
(save_redirect_fd): add error message arguments.
(run_exec_dup2): ditto.
(run_exec_close): ditto.
(run_exec_open): ditto.
(run_exec_dup2_child): ditto.
(run_exec_pgroup): ditto.
(run_exec_rlimit): ditto.
(rb_run_exec_options): ditto.
(rb_exec): ditto.
(rb_exec_atfork): ditto.
(rb_spawn_internal): ditto.
(rb_spawn): ditto.
(rb_f_system): follow arguments change.
(proc_daemon): ditto.
(rb_f_spawn): show details of error in child process on exception.
* io.c (popen_exec): add error message arguments.
(pipe_open): show details of error in child process on exception.
* include/ruby/intern.h (rb_run_exec_options): add error message
arguments.
(rb_exec): ditto.
(rb_fork): ditto.
(rb_spawn): ditto.
* ext/pty/pty.c (chfunc): add error message arguments.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20950 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-23 13:15:54 +00:00
yugui
5677106ec9
* io.c: rdoc for File::open and 1.9 feature in file modes.
...
* transcode.c: rdoc for String#encode
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20946 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-23 11:30:44 +00:00
akr
fbcc23a8fa
* io.c (rb_io_inspect): show fd number if there is no pathname.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20940 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-23 07:24:13 +00:00
usa
7d02404765
* io.c (pipe_open): need to initialize args.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20934 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-23 06:30:33 +00:00
akr
a61a5f171d
* io.c (pipe_close): fix coding style. [ruby-dev:37554]
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20928 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-23 03:00:31 +00:00
akr
b795b5c537
rdoc update.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20917 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-22 12:29:04 +00:00
akr
3a7daf882b
* io.c (rb_io_s_pipe): IO.pipe can take a block.
...
(pipe_close): new function.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20916 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-22 12:27:26 +00:00
nobu
7ac32d7a16
* dln.c (dln_find_1): supplements an extension for executable
...
files on DOSish platforms.
* io.c (pipe_open): use rb_w32_aspawn() for array form.
* win32/win32.c (rb_w32_pipe_exec): no longer used.
* win32/win32.c (rb_w32_spawn, rb_w32_aspawn): deals with batch
files and commands with extensions. [ruby-core:20695]
* win32/win32.c (has_redirection): supports environment variables
references.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20892 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-20 09:28:29 +00:00
matz
63219d8a24
* io.c (rb_io_extract_encoding_option): "internal_encoding: nil"
...
to specify no-transcoding. and other corner case fixed.
[ruby-dev:37496]
* hash.c (rb_hash_lookup2): new function to look-up hash with
default value.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20870 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-19 08:22:45 +00:00
akr
b314ab3e44
rdoc update.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20617 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-10 17:18:31 +00:00
akr
4433defb46
* io.c (io_binwrite): arg.offset should be updated after retry.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20532 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-04 22:59:25 +00:00
usa
a9a4435e12
* win32/win32.c (rb_w32_read): ERROR_BROKEN_PIPE is not a real error
...
at this point.
* io.c (pipe_open): use rb_w32_spawn() instead of rb_w32_pipe_exec()
to use our own redirection scheme.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20528 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-04 16:39:03 +00:00
akr
49b10fd508
rdoc update.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20522 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-04 15:21:32 +00:00
akr
ec324872d5
update rdoc.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20472 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-03 15:02:49 +00:00
nobu
aa39c4491a
* io.c (rb_io_getc, rb_io_readchar): documentation correction from
...
Emiel van de Laar. [ruby-core:20212]
* ext/stringio/stringio.c (strio_ungetbyte): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20458 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-03 03:22:12 +00:00
nobu
551dfe9d8b
* include/ruby/io.h (rb_io_t): added write_lock to serialize.
...
[ruby-core:19668]
* gc.c (gc_mark_children): mark write_lock.
* gc.c (rb_gc_call_finalizer_at_exit): Mutex also needs to be
deferred.
* io.c (io_fflush, io_binwrite, fptr_finalize): serializes writing.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20144 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-07 20:47:02 +00:00
matz
86ade65104
* io.c (rb_io_rewind): should reset fptr->readconv if it's
...
available.
* io.c (more_char): clear readconv at EOF.
* test/ruby/test_file.rb: should not read after EOF. use rewind
instead.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20045 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-29 16:40:05 +00:00
usa
f3ac3e8774
* io.c (extract_binmode): new function to extract binmode/textmode
...
options from hash.
* io.c (rb_io_extract_modeenc): use above function.
* io.c (rb_io_s_pipe): recognize binmode/textmode options.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19996 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-28 12:00:42 +00:00
usa
7d934c47d1
* io.c (make_readconv): now can specify the size of cbuf.
...
* io.c (read_all, appendline, io_getc, rb_io_ungetc): follow above
change.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19994 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-28 11:18:28 +00:00
nobu
782f3bd3f9
* io.c (argf_init): initial value of $. should be 0.
...
see [ruby-dev:36937].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19964 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-27 06:55:06 +00:00
usa
db8e3024e7
* io.c (read_all): the 3rd argument maybe Qnil.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19956 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-27 01:03:22 +00:00
nobu
0db5641dae
* io.c (read_all): use the given buffer to read when needs readconv.
...
based on the patch by wanabe <s.wanabe AT gmail.com> at
[ruby-dev:36931].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19943 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-26 04:30:45 +00:00
matz
a9a23756b5
* io.c (pipe_open): remove unnecessary flush before fork.
...
a patch from Kazuhiro NISHIYAMA <zn at mbf.nifty.com>
in [ruby-dev:36840].
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19888 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-22 08:27:48 +00:00
matz
c5377c2bcc
* io.c (open_key_args): should adjust argc, argv in struct
...
foreach_arg.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19873 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-21 13:57:16 +00:00
matz
b6ef272d02
* ext/zlib/zlib.c: remove obsolete prototype macros.
...
* ext/zlib/zlib.c (struct gzfile): add encoding field to gzfile
structure.
* ext/zlib/zlib.c (rb_gzreader_getc): now works on characters.
* ext/zlib/zlib.c (rb_gzreader_getbyte): new method to retrieve
single byte.
* ext/zlib/zlib.c (rb_gzreader_readbyte): ditto.
* ext/zlib/zlib.c (rb_gzreader_each_byte): renamed from each_char
* ext/zlib/zlib.c (rb_gzreader_ungetc): allow unget strings.
* ext/zlib/zlib.c (rb_gzreader_ungetbyte): renamed from ungetc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19869 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-21 09:18:34 +00:00
shugo
d423b884b8
* io.c, include/ruby/intern.h (rb_io_ascii8bit_binmode): externed.
...
* ext/socket/socket.c (init_sock): use rb_io_ascii8bit_binmode()
instead of rb_io_binmode().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19868 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-21 04:31:15 +00:00
nobu
4442095d4c
* io.c (rb_file_open_internal): should initialize fmode before using.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19865 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-21 01:40:41 +00:00
matz
e50a5bcef0
* io.c (rb_io_extract_modeenc): plain rb/wb should set ASCII-8BIT
...
to the external_encoding.
* io.c (rb_file_open_internal): ditto.
* io.c (NEED_WRITECONV): no conversion when the external_encoding
is ASCII-8BIT.
* io.c (do_writeconv): skip ASCII-8BIT.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19862 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-20 16:57:19 +00:00
akr
7d48eab260
* io.c (rb_io_ascii8bit_binmode): renamed from rb_io_binmode.
...
(rb_io_binmode): don't change encoding conversion.
(rb_io_binmode_m): call rb_io_ascii8bit_binmode.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19860 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-20 15:53:14 +00:00
akr
de55ffd024
rdoc update.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19829 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-18 05:07:38 +00:00
akr
0cda4bb3bf
* io.c (rb_io_binmode): reset encoding conversion.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19807 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-16 15:25:25 +00:00
mame
ca9589aeb0
* io.c (rb_getc, rb_io_fread, rb_io_fwrite, rb_read_pending):
...
remove deprecated functions which do not work. [ruby-dev:36697]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19805 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-16 15:18:17 +00:00
akr
5c9dd204f5
rdoc update.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19792 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-15 09:15:46 +00:00
nobu
1288965f4e
* io.c (Init_IO): $FILENAME and $* must be read-only. [ruby-dev:36698]
...
* variable.c (*_getter, *_setter, *_marker): made public.
* include/ruby/ruby.h (rb_gvar_*_{getter,setter,marker}): declared.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19781 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-14 11:45:32 +00:00
akr
43f910a9aa
rdoc update.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19759 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-11 13:44:31 +00:00
akr
470a309c4a
rdoc update.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19715 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-08 10:06:16 +00:00
matz
baeeebf474
* encoding.c (rb_default_internal_encoding): merged a patch from
...
Michael Selig <michael.selig at fs.com.au> in [ruby-core:18985].
* io.c (rb_io_ext_int_to_encs): ditto.
* ruby.c (proc_options): support default internal encoding in -E
option.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19709 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-07 17:39:44 +00:00
yugui
e8ee99ff1a
* dln.c: Ruby no longer supports VMS.
...
* error.c: ditto.
* eval.c: ditto.
* eval_intern.h: ditto.
* include/ruby/defines.h: ditto.
* include/ruby/ruby.h: ditto.
* io.c: ditto.
* process.c: ditto.
* ruby.c: ditto.
* vms/config.h: removed.
* vms/vms.h: ditto.
* vms/vmsruby_private.c: ditto.
* vms/vmsruby_private.h: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19682 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-04 13:57:06 +00:00
yugui
ae7ea3332b
* dln.c: Ruby no longer supports MS-DOS.
...
* ext/sdbm/_sdbm.c: ditto.
* ext/sdbm/sdbm.h: ditto.
* gc.c: ditto.
* hash.c: ditto.
* include/ruby/defines.h: ditto.
* include/ruby/util.h: ditto.
* io.c: ditto.
* process.c: ditto.
* ruby.c: ditto.
* strftime.c: ditto.
* util.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19679 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-04 13:33:22 +00:00
yugui
8dd118c0db
* djgpp/GNUmakefile.in: removed. Ruby no longer supports djgpp.
...
* djgpp/README.djgpp: ditto.
* djgpp/config.hin: ditto.
* djgpp/config.sed: ditto.
* djgpp/configure.bat: ditto.
* djgpp/mkver.sed: ditto.
* ext/Setup.dj: ditto.
* dln.c: removed djgpp supports.
* file.c: ditto.
* gc.c: ditto.
* io.c: ditto.
* process.c: ditto.
* ruby.c: ditto.
* signal.c: ditto.
* util.c: ditto.
* vm_core.h: ditto.
* lib/fileutils.rb: ditto.
* lib/mkmf.rb: ditto.
* ext/socket/socket.c: ditto.
* test/fileutils/test_fileutils.rb: ditto.
* test/ruby/test_env.rb: ditto.
* test/ruby/test_path.rb: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19678 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-04 13:25:12 +00:00
yugui
bbbd9c0b7b
* x68/_dtos18.c: removed. Ruby no longer supports human68k.
...
* x68/_round.c: ditto.
* x68/fconvert.c: ditto.
* x68/select.c: ditto.
* ext/Setup.x68: ditto.
* missing/x68.c: ditto.
* dln.c (dln_find_exe_r): removed human68k supports.
(dln_find_1): ditto.
* lib/mkmf.rb: ditto.
* ext/extmk.rb (Init_ext): ditto.
* ext/socket/socket.c (init_sock): ditto.
* gc.c (GC_MALLOC_LIMIT): ditto.
(rb_setjmp, rb_jmpbuf): ditto.
(mark_current_machine_context): ditto.
* include/ruby/defines.h (PATH_ENV): ditto.
* io.c: ditto.
* process.c: ditto.
* ruby.c: ditto.
* test/ruby/test_env.rb: ditto.
* test/ruby/test_path.rb: ditto.
* LEGAL
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19677 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-10-04 13:12:13 +00:00
matz
414605560f
* io.c (rb_io_extract_modeenc): should honor value of the
...
textmode: and binmode: options.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19650 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-30 17:55:25 +00:00
akr
a3bebd5564
* include/ruby/encoding.h (rb_str_encode): renamed from
...
rb_str_transcode. [ruby-dev:36593]
(rb_econv_has_convpath_p): renamed from rb_transcode_convertible.
* transcode.c: follow the renaming.
* io.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19589 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-26 10:35:00 +00:00
akr
48fdf59dcf
* io.c (rb_io_mode_enc): make it static.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19535 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-24 17:10:03 +00:00
matz
9bf27f6b17
* io.c (rb_io_s_binread): offset argument was wrongly passed to
...
internal IO#read call. [ruby-core:18810]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19507 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-24 02:31:12 +00:00
akr
c1759a9f18
* io.c (io_binwrite): allocate wbuf if nosync.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19493 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-23 12:51:39 +00:00
akr
0f1a1073f7
* io.c (copy_stream_body): use io_binwrite instead of io_fwrite.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19492 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-23 12:46:17 +00:00
akr
55783c696d
* io.c (io_binwrite): add nosync argument.
...
(do_writeconv): extracted from io_fwrite.
(io_fwrite): add nosync argument. use do_writeconv.
(io_write): add nosync argument.
(io_write_m): new function for IO#write.
(rb_p): don't append record separator.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19489 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-23 11:55:48 +00:00
matz
6b90013d1e
* io.c (rb_io_s_binread): a new method to read binary chunk from a
...
file. [ruby-core:18674]
* io.c (open_key_args): wrong permission specified for read-open.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19485 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-23 10:48:17 +00:00
ko1
b9a12116fb
* thread.c, include/ruby/intern.h (rb_thread_interrupted): added.
...
* io.c: use VALUE of thead instead of rb_tread_t to check interrupts.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19477 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-23 08:17:17 +00:00
matz
b09322c61a
* io.c (rb_io_extract_modeenc): process option mode: and perm: as
...
well.
* io.c (open_key_args): move mode: and perm: related code to
rb_io_extract_modeenc().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19399 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-17 16:39:47 +00:00
matz
73c8f02384
* io.c (rb_io_readbyte): rdoc updated. [ruby-core:18617]
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19381 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-16 09:36:06 +00:00
matz
428661eccf
* io.c (rb_io_gets_m): rdoc updated. limit counts in bytes.
...
[ruby-core:18617]
* io.c (rb_io_readlines, rb_f_gets): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19380 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-16 09:29:40 +00:00
ko1
69029b90fe
* gc.c, include/ruby/ruby.h: rename rb_register_mark_object()
...
to rb_gc_register_mark_object().
* eval.c, vm.c: initialize vm->mark_object_ary at
Init_top_self().
* bignum.c, complex.c, encoding.c, ext/win32ole/win32ole.c,
io.c, load.c, marshal.c, rational.c, ruby.c, vm.c:
use rb_gc_register_mark_object() instead of
rb_global_variable() or rb_gc_register_address().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19365 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-15 14:59:14 +00:00
akr
a517395056
* encoding.c (rb_enc_get_index): don't return -1.
...
* io.c (rb_scan_open_args): call FilePathValue before encoding
conversion.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19362 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-15 14:29:09 +00:00
akr
19416601a0
* include/ruby/oniguruma.h (OnigEncodingTypeST): add end argument for
...
left_adjust_char_head.
(ONIGENC_LEFT_ADJUST_CHAR_HEAD): add end argument.
(onigenc_get_left_adjust_char_head): ditto.
* include/ruby/encoding.h (rb_enc_left_char_head): add end argument.
* regenc.h (onigenc_single_byte_left_adjust_char_head): ditto.
* regenc.c (onigenc_get_right_adjust_char_head): follow the interface
change.
(onigenc_get_right_adjust_char_head_with_prev): ditto.
(onigenc_get_prev_char_head): ditto.
(onigenc_step_back): ditto.
(onigenc_get_left_adjust_char_head): ditto.
(onigenc_single_byte_code_to_mbc): ditto.
* re.c: ditto.
* string.c: ditto.
* io.c: ditto.
* regexec.c: ditto.
* enc/euc_jp.c: ditto.
* enc/cp949.c: ditto.
* enc/shift_jis.c: ditto.
* enc/gbk.c: ditto.
* enc/big5.c: ditto.
* enc/euc_tw.c: ditto.
* enc/euc_kr.c: ditto.
* enc/emacs_mule.c: ditto.
* enc/gb18030.c: ditto.
* enc/utf_8.c: ditto.
* enc/utf_16le.c: ditto.
* enc/utf_16be.c: ditto.
* enc/utf_32le.c: ditto.
* enc/utf_32be.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19334 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-13 19:23:52 +00:00
akr
4dcf54aea1
* io.c (io_encoding_set): don't need argc argument.
...
(rb_io_s_pipe): update io_encoding_set call.
(rb_io_set_encoding): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19327 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-13 10:28:06 +00:00
akr
8d7e774f5f
* io.c (make_writeconv): use rb_enc_name.
...
(make_readconv): ditto.
* transcode.c (rb_econv_open_opts): ditto.
(econv_args): ditto.
(decorate_convpath): ditto.
(econv_set_replacement): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19324 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-13 09:06:51 +00:00
akr
965ff82341
* iseq.c (iseq_s_compile_file): use rb_file_open_str.
...
* io.c (rb_file_open_generic): call validate_enc_binmode.
(rb_file_open_str): call FilePathValue.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19315 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-12 18:32:19 +00:00
akr
76c02f05a2
* io.c (validate_enc_binmode): extracted from rb_io_extract_modeenc.
...
(rb_io_extract_modeenc): use validate_enc_binmode.
(io_encoding_set): call validate_enc_binmode.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19313 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-12 17:58:58 +00:00
akr
7e0b2b1d9b
* io.c (io_binwrite): extracted from io_fwrite.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19290 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-10 18:00:36 +00:00
akr
2d26208a55
* include/ruby/encoding.h (econv_after_output): renamed from
...
econv_output_followed_by_input.
(ECONV_AFTER_OUTPUT): renamed from ECONV_OUTPUT_FOLLOWED_BY_INPUT.
* transcode.c: follow the renaming.
* io.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19278 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-09 16:27:02 +00:00
akr
baac56be36
* include/ruby/io.h (rb_io_t): rename field: writeconv_stateless to
...
writeconv_asciicompat.
* io.c: follow the renaming.
* gc.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19274 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-09 15:02:42 +00:00
akr
dda64cab99
* io.c (io_fwrite): raise an error if ASCII incompatible string
...
written for text mode IO without encoding conversion.
(rb_io_extract_modeenc): binmode requirement changed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19273 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-09 14:56:55 +00:00
akr
d456f7e357
* include/ruby/encoding.h (ECONV_DECORATOR_MASK): merge
...
ECONV_ENCODER_MASK and ECONV_DECORATOR_MASK.
(ECONV_UNIVERSAL_NEWLINE_DECORATOR): renamed from
ECONV_UNIVERSAL_NEWLINE_DECODER.
(ECONV_CRLF_NEWLINE_DECORATOR): renamed from
ECONV_CRLF_NEWLINE_ENCODER.
(ECONV_CR_NEWLINE_DECORATOR): renamed from ECONV_CR_NEWLINE_ENCODER.
(ECONV_XML_TEXT_DECORATOR): renamed from ECONV_XML_TEXT_ENCODER.
(ECONV_XML_ATTR_CONTENT_DECORATOR): renamed from
ECONV_XML_ATTR_CONTENT_ENCODER.
(ECONV_STATEFUL_DECORATOR_MASK): renamed from
ECONV_STATEFUL_ENCODER_MASK.
(ECONV_XML_ATTR_QUOTE_DECORATOR): renamed from
ECONV_XML_ATTR_CONTENT_DECORATOR.
* io.c: follow the renaming.
* transcode.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19271 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-09 12:22:43 +00:00
akr
c5d9a3cc3a
* io.c (make_writeconv): useless branch removed.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19263 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-08 19:01:00 +00:00
akr
6270ad5b7f
* include/ruby/encoding.h (rb_econv_asciicompat_encoding): renamed
...
from rb_econv_stateless_encoding to apply stateless ASCII
incompatible encodings such as UTF-16BE.
* io.c (make_writeconv): use rb_econv_asciicompat_encoding.
* transcode_data.h (rb_transcoder_asciicompat_type_t): renamed from
rb_transcoder_stateful_type_t.
(rb_transcoder): use rb_transcoder_asciicompat_type_t.
* transcode.c: follow the type change.
(asciicompat_encoding_i): renamed from stateless_encoding_i.
(rb_econv_asciicompat_encoding): renamed from
rb_econv_stateless_encoding.
(econv_s_asciicompat_encoding): method renamed.
* tool/transcode-tblgen.rb: follow the type change.
* enc/trans/utf_16_32.trans: follow the type change.
rb_from_UTF_16BE to UTF-8 is asciicompat_decoder.
rb_from_UTF_16LE to UTF-8 is asciicompat_decoder.
rb_from_UTF_32BE to UTF-8 is asciicompat_decoder.
rb_from_UTF_32LE to UTF-8 is asciicompat_decoder.
UTF-8 to rb_to_UTF_16BE is asciicompat_encoder.
UTF-8 to rb_to_UTF_16LE is asciicompat_encoder.
UTF-8 to rb_to_UTF_32BE is asciicompat_encoder.
UTF-8 to rb_to_UTF_32LE is asciicompat_encoder.
* enc/trans/newline.trans: follow the type change. universal newline
decoder is asciicompat_converter.
* enc/trans/escape.trans: follow the type change.
* enc/trans/iso2022.trans: ditto.
* enc/trans/japanese.trans: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19249 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-08 14:33:17 +00:00
akr
a788a2e531
* io.c (make_writeconv): choose ASCII compatible encoding as
...
intermediate encoding if stateful encoder exists.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19210 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-07 03:45:12 +00:00
akr
020e681eec
* include/ruby/encoding.h (ECONV_XML_ATTR_CONTENT_ENCODER): defined.
...
(ECONV_STATEFUL_ENCODER_MASK): defined.
(ECONV_XML_ATTR_QUOTE_ENCODER): defined.
(ECONV_XML_ATTR_ENCODER): removed.
* enc/trans/escape.trans (rb_escape_xml_attr_content): defined.
(rb_escape_xml_attr_quote): defined.
(rb_escape_xml_attr): removed.
* io.c (NEED_WRITECONV): writeconv is required if supplemental
converter is used.
(make_writeconv): apply stateful encoder in writeconv.
* transcode.c: follow the constant change.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19209 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-07 03:13:29 +00:00
akr
0508672f0e
* include/ruby/encoding.h (ECONV_ERROR_HANDLER_MASK): defined.
...
(ECONV_DECODER_MASK): defined.
(ECONV_ENCODER_MASK): defined.
* io.c (make_writeconv): restrict ecflags for writeconv with
ECONV_ERROR_HANDLER_MASK.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19193 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-06 15:39:00 +00:00
akr
683eec7a5d
* io.c (rb_io_binmode): clear newline flags in writeconv_pre_ecflags.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19185 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-06 10:37:02 +00:00
akr
d4384f1230
* io.c (rb_io_extract_modeenc): raise an error for ASCII incompatible
...
encoding without binmode.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19166 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-05 22:26:39 +00:00
akr
01acf18704
* include/ruby/io.h (rb_io_modestr_fmode): renamed from
...
rb_io_mode_flags.
(rb_io_modestr_oflags): renamed from rb_io_mode_modenum.
(rb_io_oflags_fmode): renamed from rb_io_modenum_flags.
(rb_io_mode_flags): defined as a macro.
(rb_io_modenum_flags): ditto.
* io.c: follow the renaming with consistency.
* process.c (check_exec_redirect): call rb_io_modestr_oflags.
* ext/pty/depend: pty.o depends on io.h.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19153 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-05 11:30:35 +00:00
akr
0153a4ea07
* io.c (MODENUM_MAX): removed.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19149 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-05 10:59:58 +00:00
nobu
6c2108e2ac
* io.c (copy_stream_fallback_body): use read method unless readpartial
...
is available. [ruby-dev:36124]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19148 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-05 09:37:55 +00:00
akr
205d9ef125
* io.c (argf_mark): mark p->encs.ecopts.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19143 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-04 16:22:57 +00:00
akr
dac421a9c9
* include/ruby/intern.h (rb_file_open_str): declared.
...
* io.c (rb_file_open_str): defined.
* ext/zlib/zlib.c (gzfile_s_open): use rb_file_open_str instead of
rb_file_open.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19137 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-04 14:43:45 +00:00
akr
b53f7a1cbf
* io.c: variables renamed for consistency.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19126 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-04 11:20:53 +00:00
akr
49e9f42703
* include/ruby/io.h (rb_io_enc_t): rename flags to ecflags.
...
(rb_io_t): rename writeconv_pre_flags to writeconv_pre_ecflags.
(MakeOpenFile): follow the renaming.
* io.c: follow the renaming.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19124 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-04 10:22:11 +00:00
nobu
83e28e5176
* io.c (struct sysopen_struct, rb_sysopen_internal, rb_sysopen):
...
constified.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19118 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-04 04:01:13 +00:00
nobu
8f0f91e155
* io.c: expanded ARGF members macros.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-04 03:33:27 +00:00
nobu
747d9b3925
* io.c (argf_next_argv, argf_set_encoding): copy struct wise.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19115 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-04 01:33:47 +00:00
akr
31b054122c
* io.c (rb_scan_open_args): follow rb_str_transcode change.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19114 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-04 00:48:01 +00:00
akr
dead0a4c51
rdoc update.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19111 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-03 19:05:24 +00:00
akr
58964e3249
* include/ruby/io.h (rb_io_t): new fields: encs.ecopts and
...
writeconv_pre_ecopts.
(MakeOpenFile): initialize them.
* include/ruby/encoding.h (rb_str_transcode): take ecopts argument.
(rb_econv_flags): removed.
(rb_econv_prepare_opts): declared.
(rb_econv_open_opts): declared.
* io.c (make_writeconv): use rb_econv_open_opts.
(make_readconv): ditto.
(io_fwrite): follow rb_str_transcode change.
(rb_io_extract_modeenc): use rb_econv_prepare_opts.
(rb_file_open_generic): initialize encs.ecopts.
(rb_file_open_internal): ditto.
(rb_io_reopen): ditto.
(argf_ecopts): defined.
(argf_next_argv): set encs.ecopts.
(io_encoding_set): use rb_econv_prepare_opts.
(argf_set_encoding): set argf_ecopts.
* gc.c (gc_mark_children): mark encs.ecopts and writeconv_pre_ecopts
in T_FILE.
* transcode.c (transcode_loop): take ecopts argument. use
rb_econv_open_opts.
(rb_econv_flags): removed.
(rb_econv_prepare_opts): defined.
(rb_econv_open_opts): defined.
(str_transcode0): take ecopts.
(str_transcode): use rb_econv_prepare_opts.
(rb_str_transcode): take ecopts.
(econv_init): accept hash argument.
(econv_insert_output): follow rb_str_transcode change.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19109 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-03 18:18:10 +00:00
usa
71e00fd061
* io.c (make_writeconv): follow akr's previous commit.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19104 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-03 15:27:12 +00:00
akr
56343375b8
* include/ruby/encoding.h (rb_econv_option_t): removed. Since
...
rb_econv_option_t has only one field, int flags, rb_econv_option_t is
replaced by int.
* include/ruby/io.h: follow the above change.
* io.c: ditto.
* transcode.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19103 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-03 15:11:46 +00:00
ko1
204929af9d
* include/ruby/signal.h: removed.
...
* common.mk, class.c, eval.c, eval_intern.h, file.c, gc.c, hash.c,
io.c, process.c, signal.c: vm_core.h: ditto.
Some unused external global variables are also removed.
(rb_prohibit_interrupt, rb_trap_immediate, rb_trap_pending,
rb_thread_critical)
* ext/openssl/ossl_ssl.c, ext/openssl/ossl_x509store.c,
ext/readline/readline.c, ext/socket/depend,
ext/socket/socket.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19080 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-03 08:00:05 +00:00
akr
a017cecf42
fix typos.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18999 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-31 14:24:51 +00:00
ko1
ca6a8b1e2c
* include/ruby/intern.h: rename RB_UBF_DFL to
...
RUBY_UBF_IO and RUBY_UBF_PROCESS.
Because there is no default (universal) unblocking function.
* ext/socket/socket.c, file.c, io.c, process.c, thread.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18985 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-31 07:44:24 +00:00
akr
a08b97c2f6
* include/ruby/io.h (rb_io_t): refcnt field removed.
...
(MakeOpenFile): refcnt initialization removed.
* io.c (rb_io_fptr_finalize): don't check refcnt.
(rb_io_close_read): don't use refcnt.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18885 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-27 17:19:19 +00:00
akr
d05d66e2ac
* io.c (rb_io_initialize): don't accept IO object. [ruby-dev:35895]
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18883 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-27 15:09:47 +00:00
akr
db6ec3105e
* include/ruby/encoding.h (rb_econv_result_t): enumeration constant:
...
econv_incomplete_input.
* io.c (finish_writeconv): check econv_incomplete_input.
* transcode.c (transcode_restartable0): return econv_incomplete_input
for unexpected end of source buffer.
(trans_sweep): check econv_incomplete_input.
(rb_trans_conv): ditto.
(rb_econv_convert0): ditto.
(rb_econv_convert): ditto.
(transcode_loop): ditto.
(make_econv_exception): change message for econv_incomplete_input.
(econv_result_to_symbol): return :incomplete_input for
econv_incomplete_input.
(ecerr_incomplete_input): new method.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18875 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-26 16:09:29 +00:00
akr
99a26ac164
* include/ruby/io.h (rb_io_t): rename crbuf to cbuf.
...
* io.c: follow the renaming.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18874 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-26 15:06:28 +00:00
akr
3c66a5b25e
* io.c (make_writeconv): copy invalid/undef flags.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18859 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-25 18:08:08 +00:00
akr
75b2d7cbe8
* include/ruby/io.h (rb_io_t): new field: writeconv_pre_opts.
...
* io.c (make_writeconv): initialize writeconv_pre_opts.
(io_fwrite): use writeconv_pre_opts.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18856 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-25 17:45:30 +00:00
akr
08911df311
* io.c: test _WIN32 for CRLF platform. (cygwin defines O_BINARY.)
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18855 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-25 16:49:31 +00:00
akr
5c6d113a4b
* io.c: force CRLF handling if RUBY_TEST_CRLF_ENVIRONMENT is defined.
...
This is only for testing.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18854 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-25 16:30:43 +00:00
akr
6c1190d10f
* io.c (io_fwrite): add TEXTMODE_NEWLINE_ENCODER to option for
...
rb_str_transcode.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18851 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-25 15:37:04 +00:00
nobu
ce60bbc851
* include/ruby/intern.h (rb_io_ungetbyte): added prototype.
...
* io.c (rb_io_gets): use rb_io_getline_1 for unget buffer.
* ruby.c (load_file): use rb_io_ungetbyte.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18832 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-25 08:36:46 +00:00
akr
329729da55
* io.c (rb_io_init_copy): copy encs.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18822 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-24 10:40:37 +00:00
akr
98e34b223b
rdoc updated.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18821 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-24 10:32:59 +00:00
akr
7918141932
* io.c (rb_io_open): add an argument: vperm.
...
(open_key_args): call rb_io_open with perm.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18820 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-24 10:18:32 +00:00
akr
6f8c2ea9c4
* io.c (sym_invalid): removed.
...
(sym_undef): removed.
(sym_ignore): removed.
(sym_replace): removed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18819 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-24 10:11:52 +00:00
akr
c22f52c06f
* io.c (rb_io_reopen): initialize fptr->encs.opts.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18818 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-24 10:07:46 +00:00
akr
071319fde1
* io.c (rb_io_s_pipe): accept optional hash.
...
(rb_io_set_encoding): ditto.
(rb_io_extract_modeenc): use rb_econv_opts to initialize
ecopts.
(rb_file_open_generic): ditto.
(rb_file_open_internal): ditto.
(io_encoding_set): new argument: opt.
(argf_set_encoding): copy fptr->encs.opts to argf_ecopts.
* transcode.c (rb_econv_opts): accept Qnil for initialization.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18817 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-24 09:40:31 +00:00
akr
571b114708
* include/ruby/io.h (rb_io_enc_t): add opts field.
...
(FMODE_INVALID_MASK): removed.
(FMODE_INVALID_IGNORE): ditto.
(FMODE_INVALID_REPLACE): ditto.
(FMODE_UNDEF_MASK): ditto.
(FMODE_UNDEF_IGNORE): ditto.
(FMODE_UNDEF_REPLACE): ditto.
(MakeOpenFile): initialize the opts field.
* io.c (make_writeconv): use the opts field.
(io_fwrite): ditto.
(make_readconv): ditto.
(argf_ecopts): new macro.
(rb_io_extract_modeenc): fill the opts field.
(argf_next_argv): ditto.
(rb_file_open_generic): initialize the opts field.
(rb_file_open_internal): ditto.
(io_encoding_set): ditto.
(argf_set_encoding): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18816 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-24 09:13:55 +00:00
akr
6d019ccbd0
* io.c (struct argf): use struct rb_io_enc_t.
...
(argf_enc): follow the struct argf change.
(argf_enc2): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18815 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-24 09:03:04 +00:00
akr
09c7eba7b1
* include/ruby/encoding.h (rb_str_transcode): make 3rd argument
...
rb_econv_option_t*.
* transcode.c (transcode_loop): take rb_econv_option_t* as a argument.
(str_transcode0): ditto.
(str_transcode): make rb_econv_option_t and call str_transcode0 with
it.
(rb_str_transcode): take rb_econv_option_t*.
* io.c (io_fwrite): follow the rb_str_transcode change.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18814 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-24 08:39:09 +00:00
akr
d7bf454666
* include/ruby/io.h (rb_io_t): make enc and enc2 as struct
...
rb_io_enc_t;
* io.c: follow the structure change.
(convconfig_t): defined by rb_io_enc_t.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18813 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-24 07:49:13 +00:00
akr
f27b74142e
* include/ruby/encoding.h (rb_econv_opts): declared.
...
* transcode.c (rb_econv_opts): defined.
* io.c (rb_io_extract_modeenc): use rb_econv_opts.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18811 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-24 07:20:21 +00:00
akr
9b8adfed22
* include/ruby/encoding.h (rb_econv_option_t): defined.
...
(rb_econv_open): 3rd arg changed.
(rb_econv_open_exc): ditto.
* io.c (make_writeconv): use rb_econv_option_t.
(make_readconv): ditto.
(rb_econv_open): take rb_econv_option_t for options.
(rb_econv_open_exc): ditto.
(transcode_loop): use rb_econv_option_t.
(econv_init): use rb_econv_option_t.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18810 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-24 07:12:44 +00:00
akr
c6d291b003
* include/ruby/encoding.h (rb_str_transcode): add ecflags argument.
...
* transcode.c (econv_opts): extracted from str_transcode.
(str_transcode_enc_args): extracted from str_transcode.
(str_transcode0): extracted from str_transcode.
(str_transcode): use econv_opts, str_transcode_enc_args,
str_transcode0.
(rb_str_transcode): call str_transcode0.
(econv_primitive_insert_output): give the additional argument for
rb_str_transcode.
* io.c (make_writeconv): use invalid/undef flags.
(io_fwrite): ditto.
(rb_scan_open_args): give the additional argument for
rb_str_transcode.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18808 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-24 06:25:24 +00:00
akr
bc0efbc9cd
* include/ruby/encoding.h (rb_econv_substr_append): renamed from
...
rb_econv_string.
(rb_econv_str_convert): declared.
(rb_econv_substr_convert): declared.
(rb_econv_str_append): declared.
* io.c (io_fwrite): use rb_econv_str_convert instead of
rb_econv_string.
* transcode.c (rb_econv_substr_append): renamed from rb_econv_string.
(rb_econv_str_append): new function.
(rb_econv_substr_convert): ditto.
(rb_econv_str_convert): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18806 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-24 03:22:43 +00:00
akr
8f9ed3c464
* include/ruby/encoding.h (rb_econv_open_exc): declared.
...
* transcode.c (rb_eNoConverter): new exception.
(rb_econv_open_exc): new function.
(transcode_loop): use rb_econv_open_exc.
* io.c (make_writeconv): use rb_econv_open_exc.
(make_readconv): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18803 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-24 02:42:37 +00:00
akr
cefcbd24f6
* io.c (rb_scan_open_args): use pop_last_hash.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18792 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-23 09:30:06 +00:00
akr
2b78afebc7
* include/ruby/io.h (FMODE_INVALID_MASK): defined.
...
(FMODE_INVALID_IGNORE): defined.
(FMODE_INVALID_REPLACE): defined.
(FMODE_UNDEF_MASK): defined.
(FMODE_UNDEF_IGNORE): defined.
(FMODE_UNDEF_REPLACE): defined.
* io.c (sym_invalid): defined.
(sym_undef): defined.
(sym_ignore): defined.
(sym_replace): defined.
(make_readconv): specify ECONV_INVALID_* and ECONV_UNDEF_* if
FMODE_INVALID_* and FMODE_UNDEF_* is set.
(rb_io_extract_modeenc): check {:invalid, :undef} => {:replace,
:ignore} for FMODE_INVALID_* and FMODE_UNDEF_*.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18791 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-23 08:41:02 +00:00
akr
860c233103
* io.c (rb_io_extract_modeenc): check :textmode and :binmode in option
...
hash.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18786 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-23 02:23:42 +00:00
akr
d2cb86c532
* io.c (check_pipe_command): extracted from rb_f_open and rb_io_open.
...
(rb_f_open): use check_pipe_command.
(rb_io_open): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-23 01:45:49 +00:00
akr
341abd3f88
* io.c (read_all): fptr->enc2 is 0 if no conversion.
...
(rb_io_getline_fast): ditto.
(io_getc): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18783 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-23 01:14:33 +00:00
akr
895fd7ec5e
* include/ruby/io.h (rb_io_t): remove path field and add pathv field.
...
(MakeOpenFile): initialize pathv as Qnil.
* gc.c: mark pathv field in T_FILE.
* io.c: follow the rb_io_t field change.
* file.c: ditto.
* ext/socket/socket.c: ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18782 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-23 00:47:54 +00:00
akr
c0d3881e0e
* include/ruby/io.h (FMODE_TEXTMODE): defined.
...
* include/ruby/encoding.h (rb_econv_t): new field: flags.
(rb_econv_binmode): declared.
* io.c (io_unread): text mode hack removed.
(NEED_NEWLINE_DECODER): defined.
(NEED_NEWLINE_ENCODER): defined.
(NEED_READCONV): defined.
(NEED_WRITECONV): defined.
(TEXTMODE_NEWLINE_ENCODER): defined for windows.
(make_writeconv): setup converter with TEXTMODE_NEWLINE_ENCODER for
text mode.
(io_fwrite): use NEED_WRITECONV. character code conversion is
disabled if fptr->writeconv_stateless is nil.
(make_readconv): setup converter with
ECONV_UNIVERSAL_NEWLINE_DECODER for text mode.
(read_all): use NEED_READCONV.
(appendline): use NEED_READCONV.
(rb_io_getline_1): use NEED_READCONV.
(io_getc): use NEED_READCONV.
(rb_io_ungetc): use NEED_READCONV.
(rb_io_binmode): OS-level text mode test removed. call
rb_econv_binmode.
(rb_io_binmode_m): call rb_io_binmode_m with write_io as well.
(rb_io_flags_mode): return mode string including "t".
(rb_io_mode_flags): detect "t" for text mode.
(rb_sysopen): always specify O_BINARY.
* transcode.c (rb_econv_open_by_transcoder_entries): initialize flags.
(rb_econv_open): if source and destination encoding is
both empty string, open newline converter. last_tc will be NULL in
this case.
(rb_econv_encoding_to_insert_output): last_tc may be NULL now.
(rb_econv_string): ditto.
(output_replacement_character): ditto.
(transcode_loop): ditto.
(econv_init): ditto.
(econv_inspect): ditto.
(rb_econv_binmode): new function.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18780 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-22 16:44:00 +00:00
akr
1dce3b071e
* io.c (rb_io_pid): use PIDT2NUM.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18771 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-22 03:42:09 +00:00
akr
f61354c405
* io.c (rb_file_open_generic): take filename as a VALUE.
...
(rb_file_open_internal): ditto.
(rb_io_open): ditto.
(rb_file_open): pass filename as a VALUE to rb_file_open_internal.
(rb_open_file): pass filename as a VALUE to rb_file_open_generic.
(open_key_args): pass filename as a VALUE to rb_io_open.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18765 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-21 20:12:29 +00:00
akr
fbc6ea6c95
* io.c (rb_io_s_sysopen): mode can be a Bignum.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18761 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-21 18:03:52 +00:00
akr
ddda4e5508
* io.c (rb_io_extract_modeenc): notify coerced to caller.
...
(rb_io_initialize): mode may be a Bignum.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18760 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-21 17:58:50 +00:00
akr
9910ee4f5c
* io.c (rb_io_extract_modeenc): use rb_check_to_integer to test
...
integer.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18759 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-21 17:44:38 +00:00
akr
dd7cf02eab
* io.c (rb_io_initialize): accept hash argument.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18756 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-21 17:09:56 +00:00
akr
d34079b17a
* io.c (io_extract_encoding_option): if internal encoding is not
...
specified, enc is external encoding.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18751 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-21 10:07:21 +00:00
akr
caf34a9305
* io.c (io_extract_encoding_option): enc2 is external encoding if
...
external encoding and internal encoding is given.
(pipe_open): add flags and convconfig argument to initialize
fptr->{mode,enc,enc2}.
(pipe_open_v): pass flags and convconfig from caller to pipe_open.
(pipe_open_s): ditto.
(pop_last_hash): new function.
(rb_io_s_popen): use last hash as option to specify code conversion.
(rb_io_open): specify flags and convconfig arguments for
pipe_open_s.
(rb_f_backquote): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18741 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-20 18:14:07 +00:00
akr
e6c300e08a
* io.c (prep_io): local variable renamed.
...
(rb_io_fdopen): ditto.
(prep_stdio): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18740 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-20 17:31:53 +00:00
akr
19569c8f25
* io.c (open_key_args): simplified.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18738 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-20 17:03:27 +00:00
akr
4a2cd03fbd
* io.c (open_key_args): IO.foreach(path, rs, limit) didn't work.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18737 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-20 16:57:46 +00:00
akr
1bfaed8f8d
* io.c (rb_file_sysopen_internal): unused function removed.
...
(rb_file_sysopen): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18736 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-20 16:32:12 +00:00
akr
10e5d07681
* io.c: use mode_t for the 3rd argument, permission, of open(2).
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18735 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-20 16:10:36 +00:00
akr
578fc84000
* io.c (io_set_encoding): removed.
...
(rb_io_open): set up encoding using new argument opt.
(open_key_args): call rb_io_open with opt. don't call
io_set_encoding.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18730 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-20 14:56:23 +00:00
akr
4046ecde2f
* io.c (rb_file_open_internal): use rb_io_flags_modenum.
...
(rb_io_reopen): use rb_io_flags_modenum and rb_io_modenum_mode.
(rb_io_stdio_file): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18729 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-20 13:32:08 +00:00
akr
65370097cd
* io.c (rb_io_open_with_args): use rb_open_file instead of rb_io_open.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18726 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-20 11:33:36 +00:00
akr
9074da1b44
* io.c (rb_scan_open_args): extracted from rb_open_file.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18725 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-20 11:16:59 +00:00
akr
f684d04a66
* io.c (convconfig_t): new type.
...
(rb_io_extract_modeenc): new function.
(rb_file_open_generic): new function.
(rb_file_open_internal): use rb_file_open_generic.
(rb_file_sysopen_internal): use rb_file_open_generic.
(rb_open_file): use rb_io_extract_modeenc and rb_file_open_generic.
(rb_io_open): call rb_file_open_internal instead of rb_file_open.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18724 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-20 10:24:37 +00:00
akr
f58382aaf3
* io.c (Init_IO): new constants: File::DSYNC, File::RSYNC and
...
File::NOFOLLOW.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18723 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-20 10:16:20 +00:00
akr
76a3923c99
* io.c (rb_open_file): don't lookup :mode and :perm in opt. it is
...
useless because vmode and perm is overwritten by rb_scan_args
anyway.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18722 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-20 09:43:24 +00:00
akr
a5c0ee40b1
* io.c (open_key_args): meaningless MEMCPY removed.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18721 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-20 09:38:43 +00:00
akr
2901137a81
* io.c (prep_io) [cygwin]: use FMODE_BINMODE instead of O_BINARY.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18720 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-20 09:33:55 +00:00
akr
a0e0e30864
* io.c (parse_mode_enc): extracted from mode_enc.
...
(io_extract_encoding_option): extracted from io_set_encoding.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18715 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-19 20:20:31 +00:00
akr
608230bfa8
* io.c (rb_io_flags_modenum): make it static.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18714 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-19 19:17:46 +00:00
akr
b929da2a1e
* include/ruby/io.h (FMODE_TRUNC): new constant.
...
* io.c (rb_io_mode_flags): set FMODE_TRUNC for "w".
(rb_io_modenum_flags): set FMODE_TRUNC for O_TRUNC.
(rb_io_flags_modenum): new function.
(rb_io_mode_modenum): just use rb_io_mode_flags and
rb_io_flags_modenum.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18713 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-19 18:38:32 +00:00
akr
77ba9a5f56
* io.c (fopen): macro for vms removed. fopen is not used now.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18712 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-19 17:37:05 +00:00
akr
21ba5836e6
* include/ruby/io.h (rb_fopen): declaration removed.
...
* io.c (rb_fopen): unused function removed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18709 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-19 12:51:52 +00:00