summaryrefslogtreecommitdiff
path: root/include/ruby/io.h
AgeCommit message (Collapse)Author
2014-11-18* include/ruby/io.h (FMODE_WSPLIT): Removed. The write() system callakr
is not required to split. It was useful to avoid whole process blocking in Ruby 1.8 but not useful since write() is invoked without GVL. (FMODE_WSPLIT_INITIALIZED): Ditto. * io.c (wsplit_p): Removed. (io_writable_length): Removed. (rb_fcntl): Don't update the removed flags. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48476 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-10io.c: move RFile initializationnobu
* io.c (rb_io_make_open_file): move from include/ruby/io.h, and hide too detailed implementations. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47863 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-10-10ruby/io.h: deprecate old macrosnobu
* include/ruby/io.h (rb_io_mode_flags, rb_io_modenum_flags): deprecate old macros for compatibility for ruby 1.8 and older. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47861 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-24* include/ruby/io.h (struct rb_io_buffer_t): PACKED_STRUCT should notngoto
be used for platform-specific optimization. PACKED_STRUCT_UNALIGNED should be used. [ruby-core:63988] [Bug #10088] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46925 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-21rb_io_buffer_t: fix packing on gccnormal
* include/ruby/io.h (rb_io_buffer_t): fix packing on gcc r46892 caused packing to be a no-op on gcc (4.7.2-5, Debian) [Bug #10079][ruby-core:63912] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46894 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-21ruby/io.h: fix rb_io_buffer_tnobu
* include/ruby/io.h (rb_io_buffer_t): fix usage of PACKED_STRUCT(). it must surround the whole declaration on VC. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46892 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-20rb_io_buffer_t: pack structurenormal
* include/ruby/io.h (rb_io_buffer_t): pack structure Reduces rb_io_t from 200 to 192 bytes, allowing rb_io_t to occupy one less cache line. [Feature #10050] n.b. this leaves a 4-byte hole after the `cbuf' field which may be used for future expansion. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46884 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-07-20rb_io_t: shrink from 216 to 200 bytes on 64-bitnormal
* include/ruby/io.h (rb_io_t): shrink to 200 bytes from 216 on 64-bit This puts us within 8 bytes of being three cache lines instead of four lines on x86-64. This breaks the ABI. [Feature #10050] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46883 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-14* include/ruby/intern.h,akr
include/ruby/io.h, include/ruby/ruby.h, include/ruby/win32.h, include/ruby/backward/rubysig.h, bignum.c, gc.c, io.c, process.c, safe.c, struct.c, thread.c, ext/socket/rubysocket.h, ext/-test-/old_thread_select: Remove deprecated definitions [ruby-core:60581] [Feature #9502] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44955 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-01file.c: export rb_stat_newnobu
* file.c (stat_new_0): constify. * file.c (rb_stat_new): constify and export. based on a patch by Hanmac (Hans Mackowiak) at [ruby-core:53225]. [Feature #8050] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43107 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-05defines.h: RUBY_SYMBOL_EXPORT_{BEGIN,END}nobu
* include/ruby/defines.h (RUBY_SYMBOL_EXPORT_{BEGIN,END}): visibility control macros. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40122 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-03-29ruby/io.h: get rid of conflict on AIXnobu
* include/ruby/io.h: undef POSIX compliants names on AIX, which are no longer needed. patch suggested by edelsohn (David Edelsohn) in [ruby-core:53815]. [Bug #8174] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39993 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-03-28ruby/io.h: get rid of conflict on AIXnobu
* include/ruby/io.h: rename SVR3,4 member names as POSIX compliants, to get rid of conflict on AIX. [ruby-core:53765] [Bug #8174] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39987 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-07-27process.c: try conversion at redirectionnobu
* io.c (rb_io_check_io): make public. * process.c (check_exec_redirect): try conversion to IO on redirect parameters. [ruby-core:44181] [Bug #6269] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36551 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-04* thread.c (rb_wait_for_single_fd): new. poll(2) based backend for ↵kosaki
rb_wait_for_single_fd(). Now only Linux uses it. The patch was written by Eric Wong. [Ruby 1.9 - Feature #4531] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31420 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-04* thread.c (rb_wait_for_single_fd): new.kosaki
* thread.c (select_single): select(2) based backend for rb_wait_for_single_fd(). * io.c (make_writeconv): use rb_wait_for_single_fd() instaed of rb_thread_fd_select(). * io.c (rb_io_wait_readable): ditto. * thread.c (rb_thread_wait_fd_rw): ditto. * io.c (wait_readable): removed. * thread.c (init_set_fd): new helper function. * include/ruby/io.h (RB_WAITFD_IN, RB_WAITFD_PRI, RB_WAITFD_OUT): new constant for rb_single_wait_fd(). The patch was written by Eric Wong. [Ruby 1.9 - Feature #4531] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31419 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-04-07* include/ruby/io.h: parenthesize macro arguments.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31246 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-01-15* include/ruby/io.h: missing prototypes.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30546 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-11-18* include/ruby/io.h (rb_io_buffer_t): extract from rb_io_t.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29826 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-22* include/ruby/{intern,io}.h: add missing prototypes.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28710 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-21* configure.in (XCFLAGS): use -fvisibility=hidden if possible.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28709 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-27* include/ruby/io.h, io.c: reverted r21709.nobu
* ruby.c (load_file_internal): nothing to read if EOF reached while reading shebang. [ruby-core:30910] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28451 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-13* include/ruby/io.h (MakeOpenFile): finalize fptr get rid ofnobu
memory leak. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26905 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-10* ext/curses/curses.c: use rb_thread_blocking_region to avoidakr
rb_read_check. This makes other threads runnable in getstr and wgetstr. (getch_func): extracted from curses_getch. (curses_getch): use rb_thread_blocking_region with getch_func. (getstr_func): extracted from curses_getstr. (curses_getstr): use rb_thread_blocking_region with getstr_func. (wgetch_func): extracted from window_getch. (window_getch): use rb_thread_blocking_region with wgetch_func. (wgetstr_func): extracted from window_getstr. (window_getstr): use rb_thread_blocking_region with wgetstr_func. * include/ruby/io.h (rb_read_check): deprecated because it access internal of stdio. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25286 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-21Rename FMODE_STRIP_BOM to FMODE_SETENC_BY_BOM.naruse
* include/ruby/io.h, io.c (FMODE_SETENC_BY_BOM): renamed from FMODE_STRIP_BOM. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24606 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-09Set encoding and strip bom when modeenc string is "r:foo-bom" [ruby-dev:37236]naruse
* include/ruby/io.h (FMODE_STRIP_BOM): new constant. * io.c (io_encname_bom_p): judge whether the encoding name is *-bom or not. (parse_mode_enc): drop "-bom". (rb_io_modestr_fmode): set FMODE_STRIP_BOM if needed. (rb_io_extract_modeenc): ditto. (io_strip_bom): strip bom if exists. (io_set_encoding_by_bom): set encoding if there is bom. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24001 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-21* include/ruby/io.h (typedef struct rb_io_t):nobu
* io.c (flush_before_seek): * io.c (io_fillbuf): * io.c (io_fread): * io.c (io_getpartial): * ruby.c (load_file_internal): git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21709 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-11-07* include/ruby/io.h (rb_io_t): added write_lock to serialize.nobu
[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-10-16* io.c (rb_getc, rb_io_fread, rb_io_fwrite, rb_read_pending):mame
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-09-24comment changed.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19527 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-09* include/ruby/io.h (rb_io_t): rename field: writeconv_stateless toakr
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-05* include/ruby/io.h (rb_io_modestr_fmode): renamed fromakr
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* include/ruby/io.h (rb_io_mode_modenum): moved fromakr
include/ruby/intern.h. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19150 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-04* include/ruby/io.h (rb_io_enc_t): rename flags to ecflags.akr
(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-03* include/ruby/io.h (rb_io_t): new fields: encs.ecopts andakr
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* include/ruby/encoding.h (rb_econv_option_t): removed. Sinceakr
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-08-27* include/ruby/io.h (rb_io_t): refcnt field removed.akr
(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-26* include/ruby/io.h (rb_io_t): rename crbuf to cbuf.akr
* io.c: follow the renaming. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18874 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-25* include/ruby/io.h (rb_io_t): new field: writeconv_pre_opts.akr
* 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-24* include/ruby/io.h (rb_io_enc_t): add opts field.akr
(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* include/ruby/io.h (rb_io_t): make enc and enc2 as structakr
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-23* include/ruby/io.h (FMODE_INVALID_MASK): defined.akr
(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* include/ruby/io.h (rb_io_t): remove path field and add pathv field.akr
(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-22* include/ruby/io.h (FMODE_TEXTMODE): defined.akr
* 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-19* include/ruby/io.h (FMODE_TRUNC): value changed because 0x100 is usedakr
as FMODE_NOREVLOOKUP in socket.c git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18717 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-19* include/ruby/io.h (FMODE_TRUNC): new constant.akr
* 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* include/ruby/io.h (rb_fopen): declaration removed.akr
* 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* include/ruby/io.h (FMODE_READWRITE): define asakr
FMODE_READABLE|FMODE_WRITABLE. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18708 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-19* include/ruby/io.h (FMODE_*): sorted and describe the values inakr
hexadecimal. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18703 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-18* io.c (make_writeconv): if enc and enc2 is set, convertakr
string.encoding to enc2. * include/ruby/io.h: comment changed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18692 b2dd03c8-39d4-4d8f-98ff-823fe69b080e