Ruby
2.4.2p198(2017-09-14revision59899)
|
#include "internal.h"
#include "ruby/io.h"
#include "ruby/thread.h"
#include "dln.h"
#include "encindex.h"
#include "id.h"
#include <ctype.h>
#include <errno.h>
#include "ruby_atomic.h"
#include <sys/types.h>
#include <sys/stat.h>
#include "ruby/util.h"
Go to the source code of this file.
Data Structures | |
struct | argf |
struct | io_internal_read_struct |
struct | io_internal_write_struct |
struct | binwrite_arg |
struct | write_arg |
struct | bufread_arg |
struct | read_internal_arg |
struct | getline_arg |
struct | finish_writeconv_arg |
struct | sysopen_struct |
struct | pipe_list |
struct | rb_f_p_arg |
struct | select_args |
struct | io_encoding_set_args |
struct | foreach_arg |
struct | seek_arg |
struct | copy_stream_struct |
struct | argf_call_arg |
Macros | |
#define | free(x) xfree(x) |
#define | off_t long |
#define | NOFILE 64 |
#define | O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR) |
#define | PIPE_BUF 512 /* is this ok? */ |
#define | EWOULDBLOCK EAGAIN |
#define | IO_RBUF_CAPA_MIN 8192 |
#define | IO_CBUF_CAPA_MIN (128*1024) |
#define | IO_RBUF_CAPA_FOR(fptr) (NEED_READCONV(fptr) ? IO_CBUF_CAPA_MIN : IO_RBUF_CAPA_MIN) |
#define | IO_WBUF_CAPA_MIN 8192 |
#define | id_exception idException |
#define | argf_of(obj) (*(struct argf *)DATA_PTR(obj)) |
#define | ARGF argf_of(argf) |
#define | GetWriteIO(io) rb_io_get_write_io(io) |
#define | READ_DATA_PENDING(fptr) ((fptr)->rbuf.len) |
#define | READ_DATA_PENDING_COUNT(fptr) ((fptr)->rbuf.len) |
#define | READ_DATA_PENDING_PTR(fptr) ((fptr)->rbuf.ptr+(fptr)->rbuf.off) |
#define | READ_DATA_BUFFERED(fptr) READ_DATA_PENDING(fptr) |
#define | READ_CHAR_PENDING(fptr) ((fptr)->cbuf.len) |
#define | READ_CHAR_PENDING_COUNT(fptr) ((fptr)->cbuf.len) |
#define | READ_CHAR_PENDING_PTR(fptr) ((fptr)->cbuf.ptr+(fptr)->cbuf.off) |
#define | WAIT_FD_IN_WIN32(fptr) |
#define | READ_CHECK(fptr) |
#define | NEED_NEWLINE_DECORATOR_ON_READ(fptr) ((fptr)->mode & FMODE_TEXTMODE) |
#define | NEED_NEWLINE_DECORATOR_ON_WRITE(fptr) ((fptr)->mode & FMODE_TEXTMODE) |
#define | DEFAULT_TEXTMODE 0 |
#define | NEED_READCONV(fptr) ((fptr)->encs.enc2 != NULL || NEED_NEWLINE_DECORATOR_ON_READ(fptr)) |
#define | NEED_WRITECONV(fptr) (((fptr)->encs.enc != NULL && (fptr)->encs.enc != rb_ascii8bit_encoding()) || NEED_NEWLINE_DECORATOR_ON_WRITE(fptr) || ((fptr)->encs.ecflags & (ECONV_DECORATOR_MASK|ECONV_STATEFUL_DECORATOR_MASK))) |
#define | SET_BINARY_MODE(fptr) (void)(fptr) |
#define | NEED_NEWLINE_DECORATOR_ON_READ_CHECK(fptr) (void)(fptr) |
#define | SET_UNIVERSAL_NEWLINE_DECORATOR_IF_ENC2(enc2, ecflags) ((void)(enc2), (void)(ecflags)) |
#define | SET_BINARY_MODE_WITH_SEEK_CUR(fptr) (void)(fptr) |
#define | shutdown(a, b) 0 |
#define | is_socket(fd, path) 0 |
#define | io_seek(fptr, ofs, whence) (errno = 0, lseek(flush_before_seek(fptr)->fd, (ofs), (whence))) |
#define | io_tell(fptr) lseek(flush_before_seek(fptr)->fd, 0, SEEK_CUR) |
#define | SEEK_SET 0 |
#define | SEEK_CUR 1 |
#define | SEEK_END 2 |
#define | S_ISREG(m) (((m) & S_IFMT) == S_IFREG) |
#define | MODE_BTMODE(a, b, c) |
#define | fmode (fptr->mode) |
#define | rb_io_fsync rb_f_notimplement |
#define | rb_io_sync rb_f_notimplement |
#define | rb_io_fdatasync rb_io_fsync |
#define | MORE_CHAR_SUSPENDED Qtrue |
#define | MORE_CHAR_FINISHED Qnil |
#define | rb_io_close_on_exec_p rb_f_notimplement |
#define | rb_io_set_close_on_exec rb_f_notimplement |
#define | FMODE_PREP (1<<16) |
#define | IS_PREP_STDIO(f) ((f)->mode & FMODE_PREP) |
#define | PREP_STDIO_NAME(f) (RSTRING_PTR((f)->pathv)) |
#define | SHUT_RD 0 |
#define | SHUT_WR 1 |
#define | MODE_BINARY(a, b) (a) |
#define | next_argv() argf_next_argv(argf) |
#define | ARGF_GENERIC_INPUT_P() (ARGF.current_file == rb_stdin && !RB_TYPE_P(ARGF.current_file, T_FILE)) |
#define | ARGF_FORWARD(argc, argv) |
#define | NEXT_ARGF_FORWARD(argc, argv) |
#define | NUM2IOCTLREQ(num) NUM2INT(num) |
#define | DEFULT_IOCTL_NARG_LEN (256) |
#define | rb_io_ioctl rb_f_notimplement |
#define | rb_io_fcntl rb_f_notimplement |
#define | rb_f_syscall rb_f_notimplement |
#define | IOWAIT_SYSCALL "select" |
#define | USE_POLL 0 |
#define | FOREACH_ARGF() while (next_argv()) |
#define | rb_intern(str) rb_intern_const(str) |
Typedefs | |
typedef struct rb_io_enc_t | convconfig_t |
typedef int | ioctl_req_t |
Enumerations | |
enum | { bom_prefix_len = (int)sizeof(bom_prefix) - 1 } |
enum | { utf_prefix_len = (int)sizeof(utf_prefix) - 1 } |
Definition at line 403 of file io.c.
Referenced by argf_argv(), argf_binmode_m(), argf_binmode_p(), argf_block_call(), argf_block_call_i(), argf_block_call_line(), argf_block_call_line_i(), argf_close(), argf_close_m(), argf_closed(), argf_eof(), argf_external_encoding(), argf_file(), argf_filename(), argf_fileno(), argf_forward(), argf_getbyte(), argf_getc(), argf_getline(), argf_getpartial(), argf_initialize(), argf_initialize_copy(), argf_inplace_mode_get(), argf_inplace_mode_set(), argf_internal_encoding(), argf_lineno(), argf_lineno_getter(), argf_lineno_setter(), argf_next_argv(), argf_read(), argf_readchar(), argf_readlines(), argf_rewind(), argf_seek_m(), argf_set_encoding(), argf_set_lineno(), argf_set_pos(), argf_skip(), argf_tell(), argf_to_io(), argf_write_io(), Init_IO(), rb_get_argv(), rb_gets(), rb_io_getline_1(), rb_io_rewind(), ruby_get_inplace_mode(), and ruby_set_inplace_mode().
Definition at line 8001 of file io.c.
Referenced by argf_binmode_m(), argf_closed(), argf_eof(), argf_fileno(), argf_readline(), argf_rewind(), argf_seek_m(), argf_set_pos(), argf_tell(), and argf_to_io().
#define ARGF_GENERIC_INPUT_P | ( | ) | (ARGF.current_file == rb_stdin && !RB_TYPE_P(ARGF.current_file, T_FILE)) |
Definition at line 7999 of file io.c.
Referenced by argf_getc(), argf_getline(), argf_getpartial(), argf_read(), and argf_readlines().
Definition at line 402 of file io.c.
Referenced by argf_initialize_copy().
#define DEFAULT_TEXTMODE 0 |
Definition at line 587 of file io.c.
Referenced by argf_next_argv(), do_writeconv(), prep_stdio(), rb_f_backquote(), rb_io_extract_modeenc(), and validate_enc_binmode().
#define DEFULT_IOCTL_NARG_LEN (256) |
Definition at line 9017 of file io.c.
Referenced by ioctl_narg_len().
#define EWOULDBLOCK EAGAIN |
Definition at line 115 of file io.c.
Referenced by io_getpartial(), io_read_nonblock(), io_write_nonblock(), maygvl_copy_stream_read(), nogvl_copy_stream_wait_write(), nogvl_copy_stream_write(), pipe_open(), rb_io_wait_readable(), rb_io_wait_writable(), and rb_readwrite_syserr_fail().
#define fmode (fptr->mode) |
Referenced by argf_next_argv(), parse_mode_enc(), pipe_open(), prep_io(), rb_file_open_generic(), rb_file_open_internal(), rb_io_extract_modeenc(), rb_io_initialize(), rb_io_modestr_fmode(), rb_io_oflags_fmode(), rb_io_open(), rb_io_reopen(), rb_io_s_binread(), rb_io_s_pipe(), rb_io_s_popen(), rb_open_file(), rb_scan_open_args(), and validate_enc_binmode().
#define FMODE_PREP (1<<16) |
Definition at line 4159 of file io.c.
Referenced by io_reopen(), prep_stdio(), rb_io_autoclose_p(), rb_io_init_copy(), rb_io_initialize(), and rb_io_set_autoclose().
#define FOREACH_ARGF | ( | ) | while (next_argv()) |
Definition at line 11585 of file io.c.
Referenced by argf_each_byte(), argf_each_char(), argf_each_codepoint(), and argf_each_line().
#define free | ( | x | ) | xfree(x) |
Definition at line 25 of file io.c.
Referenced by argf_inplace_mode_set(), pipe_del_fptr(), rb_io_fptr_finalize(), and ruby_set_inplace_mode().
#define GetWriteIO | ( | io | ) | rb_io_get_write_io(io) |
Definition at line 405 of file io.c.
Referenced by argf_write_io(), copy_stream_body(), io_close_fptr(), io_write(), io_write_nonblock(), rb_io_advise(), rb_io_binmode_m(), rb_io_close_read(), rb_io_close_write(), rb_io_closed(), rb_io_flush_raw(), rb_io_init_copy(), rb_io_isatty(), rb_io_set_sync(), rb_io_set_write_io(), rb_io_sync(), rb_io_syswrite(), and select_internal().
#define id_exception idException |
Definition at line 164 of file io.c.
Referenced by no_exception_p().
#define IO_CBUF_CAPA_MIN (128*1024) |
Definition at line 131 of file io.c.
Referenced by make_readconv().
#define IO_RBUF_CAPA_FOR | ( | fptr | ) | (NEED_READCONV(fptr) ? IO_CBUF_CAPA_MIN : IO_RBUF_CAPA_MIN) |
Definition at line 132 of file io.c.
Referenced by io_fillbuf(), and io_ungetbyte().
#define io_seek | ( | fptr, | |
ofs, | |||
whence | |||
) | (errno = 0, lseek(flush_before_seek(fptr)->fd, (ofs), (whence))) |
Definition at line 784 of file io.c.
Referenced by io_reopen(), rb_io_init_copy(), rb_io_rewind(), rb_io_seek(), and rb_io_set_pos().
#define io_tell | ( | fptr | ) | lseek(flush_before_seek(fptr)->fd, 0, SEEK_CUR) |
Definition at line 785 of file io.c.
Referenced by io_reopen(), rb_io_init_copy(), and rb_io_tell().
#define IO_WBUF_CAPA_MIN 8192 |
Definition at line 133 of file io.c.
Referenced by io_binwrite().
#define IOWAIT_SYSCALL "select" |
Definition at line 10210 of file io.c.
Referenced by nogvl_copy_stream_wait_write().
#define IS_PREP_STDIO | ( | f | ) | ((f)->mode & FMODE_PREP) |
Definition at line 4160 of file io.c.
Referenced by fptr_finalize_flush(), io_reopen(), and rb_io_reopen().
#define is_socket | ( | fd, | |
path | |||
) | 0 |
Definition at line 603 of file io.c.
Referenced by rb_io_close_read(), and rb_io_close_write().
#define MODE_BINARY | ( | a, | |
b | |||
) | (a) |
Referenced by rb_io_oflags_modestr().
#define MODE_BTMODE | ( | a, | |
b, | |||
c | |||
) |
Definition at line 1363 of file io.c.
Referenced by do_writeconv(), rb_io_extract_modeenc(), and rb_io_fmode_modestr().
#define MORE_CHAR_FINISHED Qnil |
Definition at line 2250 of file io.c.
Referenced by appendline(), fill_cbuf(), io_getc(), more_char(), rb_io_each_codepoint(), read_all(), and swallow().
#define MORE_CHAR_SUSPENDED Qtrue |
Definition at line 2249 of file io.c.
Referenced by fill_cbuf(), more_char(), and read_all().
#define NEED_NEWLINE_DECORATOR_ON_READ | ( | fptr | ) | ((fptr)->mode & FMODE_TEXTMODE) |
Definition at line 447 of file io.c.
Referenced by pipe_open(), and rb_io_eof().
#define NEED_NEWLINE_DECORATOR_ON_READ_CHECK | ( | fptr | ) | (void)(fptr) |
Definition at line 591 of file io.c.
Referenced by appendline(), io_getc(), rb_io_each_codepoint(), rb_io_getline_0(), rb_io_ungetc(), read_all(), and swallow().
#define NEED_NEWLINE_DECORATOR_ON_WRITE | ( | fptr | ) | ((fptr)->mode & FMODE_TEXTMODE) |
Definition at line 448 of file io.c.
Referenced by pipe_open().
#define NEED_READCONV | ( | fptr | ) | ((fptr)->encs.enc2 != NULL || NEED_NEWLINE_DECORATOR_ON_READ(fptr)) |
Definition at line 588 of file io.c.
Referenced by appendline(), io_getc(), rb_io_each_codepoint(), rb_io_eof(), rb_io_getline_0(), rb_io_ungetc(), read_all(), and swallow().
#define NEED_WRITECONV | ( | fptr | ) | (((fptr)->encs.enc != NULL && (fptr)->encs.enc != rb_ascii8bit_encoding()) || NEED_NEWLINE_DECORATOR_ON_WRITE(fptr) || ((fptr)->encs.ecflags & (ECONV_DECORATOR_MASK|ECONV_STATEFUL_DECORATOR_MASK))) |
Definition at line 589 of file io.c.
Referenced by do_writeconv().
#define next_argv | ( | ) | argf_next_argv(argf) |
Definition at line 7998 of file io.c.
Referenced by argf_binmode_m(), argf_close_m(), argf_closed(), argf_eof(), argf_file(), argf_filename(), argf_fileno(), argf_getbyte(), argf_getc(), argf_getline(), argf_getpartial(), argf_read(), argf_readchar(), argf_readline(), argf_readlines(), argf_rewind(), argf_seek_m(), argf_set_encoding(), argf_set_pos(), argf_tell(), argf_to_io(), and rb_gets().
#define NUM2IOCTLREQ | ( | num | ) | NUM2INT(num) |
Definition at line 8983 of file io.c.
Referenced by setup_narg().
#define O_ACCMODE (O_RDONLY | O_WRONLY | O_RDWR) |
Definition at line 99 of file io.c.
Referenced by Init_fcntl(), and rb_io_oflags_fmode().
#define off_t long |
Definition at line 61 of file io.c.
Referenced by copy_stream_body(), copy_stream_fallback(), copy_stream_fallback_body(), Init_sizeof(), io_reopen(), io_unread(), maygvl_copy_stream_read(), nogvl_copy_stream_read_write(), nogvl_copy_stream_wait_write(), rb_file_s_join(), rb_io_advise(), rb_io_init_copy(), rb_io_s_copy_stream(), rb_io_seek(), rb_io_set_pos(), rb_io_sysseek(), rb_io_tell(), rb_stat_s(), and remain_size().
#define PREP_STDIO_NAME | ( | f | ) | (RSTRING_PTR((f)->pathv)) |
Definition at line 4161 of file io.c.
Referenced by io_reopen(), and rb_io_reopen().
#define rb_f_syscall rb_f_notimplement |
#define rb_intern | ( | str | ) | rb_intern_const(str) |
Referenced by argf_bytes(), argf_chars(), argf_codepoints(), argf_each_byte(), argf_each_char(), argf_each_codepoint(), argf_each_line(), argf_getbyte(), argf_getc(), argf_lines(), argf_readchar(), argf_readlines(), copy_stream_body(), ignore_closed_stream(), Init_IO(), io_call_close(), io_close(), pipe_open(), rb_f_putc(), rb_f_puts(), rb_f_readline(), rb_f_readlines(), rb_io_bytes(), rb_io_chars(), rb_io_codepoints(), rb_io_init_copy(), and rb_io_lines().
#define rb_io_close_on_exec_p rb_f_notimplement |
Definition at line 4098 of file io.c.
Referenced by Init_IO(), and rb_io_isatty().
#define rb_io_fcntl rb_f_notimplement |
#define rb_io_fdatasync rb_io_fsync |
Definition at line 1983 of file io.c.
Referenced by Init_IO(), and rb_io_set_sync().
#define rb_io_fsync rb_f_notimplement |
Definition at line 1931 of file io.c.
Referenced by Init_IO(), rb_io_set_sync(), and rb_io_sync().
#define rb_io_ioctl rb_f_notimplement |
Definition at line 9300 of file io.c.
Referenced by Init_IO(), and setup_narg().
#define rb_io_set_close_on_exec rb_f_notimplement |
#define rb_io_sync rb_f_notimplement |
#define READ_CHAR_PENDING | ( | fptr | ) | ((fptr)->cbuf.len) |
Definition at line 412 of file io.c.
Referenced by rb_io_check_byte_readable(), rb_io_eof(), rb_io_read_pending(), rb_io_sysseek(), and select_internal().
#define READ_CHAR_PENDING_COUNT | ( | fptr | ) | ((fptr)->cbuf.len) |
Definition at line 413 of file io.c.
Referenced by appendline(), and swallow().
#define READ_CHAR_PENDING_PTR | ( | fptr | ) | ((fptr)->cbuf.ptr+(fptr)->cbuf.off) |
Definition at line 414 of file io.c.
Referenced by appendline(), and swallow().
#define READ_CHECK | ( | fptr | ) |
Definition at line 423 of file io.c.
Referenced by appendline(), fill_cbuf(), io_getpartial(), io_read(), rb_io_each_byte(), rb_io_each_char(), rb_io_each_codepoint(), rb_io_eof(), rb_io_getbyte(), rb_io_getc(), rb_io_getline_fast(), read_all(), and swallow().
#define READ_DATA_BUFFERED | ( | fptr | ) | READ_DATA_PENDING(fptr) |
Definition at line 410 of file io.c.
Referenced by rb_io_sysread(), and rb_io_sysseek().
#define READ_DATA_PENDING | ( | fptr | ) | ((fptr)->rbuf.len) |
Definition at line 407 of file io.c.
Referenced by io_bufread(), rb_io_eof(), rb_io_read_check(), rb_io_read_pending(), and select_internal().
#define READ_DATA_PENDING_COUNT | ( | fptr | ) | ((fptr)->rbuf.len) |
Definition at line 408 of file io.c.
Referenced by appendline(), rb_io_getline_fast(), read_buffered_data(), remain_size(), and swallow().
#define READ_DATA_PENDING_PTR | ( | fptr | ) | ((fptr)->rbuf.ptr+(fptr)->rbuf.off) |
Definition at line 409 of file io.c.
Referenced by appendline(), rb_io_getline_fast(), and swallow().
#define S_ISREG | ( | m | ) | (((m) & S_IFMT) == S_IFREG) |
Definition at line 915 of file io.c.
Referenced by nogvl_copy_stream_wait_write(), and remain_size().
#define SEEK_CUR 1 |
Definition at line 789 of file io.c.
Referenced by Init_IO(), interpret_seek_whence(), io_unread(), nogvl_copy_stream_wait_write(), rb_chsize(), and remain_size().
#define SEEK_END 2 |
Definition at line 790 of file io.c.
Referenced by Init_IO(), interpret_seek_whence(), and makroom().
#define SEEK_SET 0 |
Definition at line 788 of file io.c.
Referenced by getdbit(), getnext(), getpage(), Init_IO(), interpret_seek_whence(), io_reopen(), io_s_write(), makroom(), nogvl_copy_stream_read_write(), rb_chsize(), rb_io_init_copy(), rb_io_s_binread(), rb_io_s_read(), rb_io_seek_m(), rb_io_set_pos(), rb_io_sysseek(), sdbm_delete(), sdbm_firstkey(), sdbm_store(), and setdbit().
#define SET_BINARY_MODE | ( | fptr | ) | (void)(fptr) |
Definition at line 590 of file io.c.
Referenced by appendline(), do_writeconv(), io_getc(), rb_io_each_codepoint(), rb_io_getline_0(), rb_io_ungetc(), read_all(), and swallow().
#define SET_BINARY_MODE_WITH_SEEK_CUR | ( | fptr | ) | (void)(fptr) |
Definition at line 593 of file io.c.
Referenced by copy_stream_body(), io_ascii8bit_binmode(), and rb_io_binmode().
#define SET_UNIVERSAL_NEWLINE_DECORATOR_IF_ENC2 | ( | enc2, | |
ecflags | |||
) | ((void)(enc2), (void)(ecflags)) |
Definition at line 592 of file io.c.
Referenced by io_encoding_set(), and rb_io_extract_modeenc().
#define SHUT_RD 0 |
Referenced by rb_io_close_read().
#define SHUT_WR 1 |
Referenced by rb_io_close_write().
#define shutdown | ( | a, | |
b | |||
) | 0 |
Definition at line 597 of file io.c.
Referenced by bsock_close_read(), bsock_close_write(), bsock_shutdown(), rb_io_close_read(), rb_io_close_write(), rb_w32_shutdown(), and ruby_shutdown().
typedef struct rb_io_enc_t convconfig_t |
typedef int ioctl_req_t |
|
static |
Definition at line 8733 of file io.c.
References PRIsVALUE, rb_eNotImpError, rb_eTypeError, rb_raise(), sym_dontneed, sym_noreuse, sym_normal, sym_random, sym_sequential, sym_willneed, and SYMBOL_P.
Referenced by rb_io_advise().
Definition at line 2856 of file io.c.
References rb_io_t::cbuf, clear_readconv(), EOF, io_fillbuf(), last, len, make_readconv(), more_char(), MORE_CHAR_FINISHED, NEED_NEWLINE_DECORATOR_ON_READ_CHECK, NEED_READCONV, NIL_P, rb_str_buf_cat(), rb_str_buf_new(), rb_str_new(), rb_str_resize(), rb_str_set_len(), read_buffered_data(), READ_CHAR_PENDING_COUNT, READ_CHAR_PENDING_PTR, READ_CHECK, READ_DATA_PENDING_COUNT, READ_DATA_PENDING_PTR, RSTRING_LEN, RSTRING_PTR, and SET_BINARY_MODE.
Referenced by rb_io_getline_0().
Definition at line 7911 of file io.c.
References argf, argf_init(), Qnil, and TypedData_Make_Struct.
Referenced by Init_IO().
Definition at line 12076 of file io.c.
References ARGF.
Referenced by argf_argv_getter(), and Init_IO().
Definition at line 11873 of file io.c.
References argf, ARGF, ARGF_FORWARD, next_argv, and rb_io_ascii8bit_binmode().
Referenced by Init_IO().
Definition at line 11599 of file io.c.
References ARGF, argf_block_call_i(), Qundef, and rb_block_call().
Referenced by argf_each_byte(), argf_each_char(), and argf_each_codepoint().
|
static |
Definition at line 11588 of file io.c.
References argc, ARGF, argf::argv, Qnil, Qundef, rb_iter_break_value(), and rb_yield_values2().
Referenced by argf_block_call(), and argf_block_call_line_i().
Definition at line 11615 of file io.c.
References ARGF, argf_block_call_line_i(), Qundef, and rb_block_call().
Referenced by argf_each_line().
|
static |
Definition at line 11606 of file io.c.
References argc, ARGF, argf_block_call_i(), argf::argv, and global_argf_p().
Referenced by argf_block_call_line().
Definition at line 11715 of file io.c.
References argf_each_byte(), ID2SYM, rb_block_given_p(), rb_enumeratorize(), rb_intern, and rb_warn().
Referenced by Init_IO().
Definition at line 11754 of file io.c.
References argf_each_char(), ID2SYM, rb_block_given_p(), rb_enumeratorize(), rb_intern, and rb_warn().
Referenced by Init_IO().
|
static |
Definition at line 8011 of file io.c.
References ARGF, io_close(), Qnil, rb_io_set_write_io(), rb_stdin, RB_TYPE_P, and T_FILE.
Referenced by argf_close_m(), argf_getbyte(), argf_getc(), argf_getline(), argf_getpartial(), argf_next_argv(), argf_read(), argf_readchar(), argf_readlines(), and argf_skip().
Definition at line 11962 of file io.c.
References ARGF, ARGF_FORWARD, next_argv, and rb_io_closed().
Referenced by Init_IO().
Definition at line 11793 of file io.c.
References argf_each_codepoint(), ID2SYM, rb_block_given_p(), rb_enumeratorize(), rb_intern, and rb_warn().
Referenced by Init_IO().
Definition at line 11701 of file io.c.
References argf, argf_block_call(), FOREACH_ARGF, rb_intern, and RETURN_ENUMERATOR.
Referenced by argf_bytes(), and Init_IO().
Definition at line 11740 of file io.c.
References argf, argf_block_call(), FOREACH_ARGF, rb_intern, and RETURN_ENUMERATOR.
Referenced by argf_chars(), and Init_IO().
Definition at line 11779 of file io.c.
References argf, argf_block_call(), FOREACH_ARGF, rb_intern, and RETURN_ENUMERATOR.
Referenced by argf_codepoints(), and Init_IO().
Definition at line 11654 of file io.c.
References argf, argf_block_call_line(), FOREACH_ARGF, rb_intern, and RETURN_ENUMERATOR.
Referenced by argf_lines(), and Init_IO().
Definition at line 11213 of file io.c.
References ARGF, ARGF_FORWARD, next_argv, Qfalse, Qtrue, rb_io_eof(), and RTEST.
Referenced by Init_IO().
Definition at line 10989 of file io.c.
References ARGF, rb_default_external_encoding(), rb_enc_from_encoding(), rb_io_check_io(), rb_io_external_encoding(), and RTEST.
Referenced by Init_IO().
Definition at line 11165 of file io.c.
References ARGF, ARGF_FORWARD, next_argv, rb_eArgError, rb_io_fileno(), and rb_raise().
Referenced by Init_IO().
Definition at line 7993 of file io.c.
References ARGF, rb_frame_this_func(), and rb_funcall3.
Referenced by argf_forward_call(), and argf_read().
Definition at line 11328 of file io.c.
References argc, argf_call_arg::argc, argf_call_arg::argf, argf_forward(), argf_getpartial(), argf::argv, argf_call_arg::argv, and Qnil.
Referenced by argf_getpartial().
|
static |
Definition at line 7879 of file io.c.
References argf::inplace, and xfree().
Definition at line 11493 of file io.c.
References ARGF, argf_close(), next_argv, NIL_P, Qnil, rb_funcall3, rb_intern, rb_io_getbyte(), RB_TYPE_P, and T_FILE.
Referenced by argf_readbyte(), and Init_IO().
Definition at line 11453 of file io.c.
References ARGF, argf_close(), ARGF_GENERIC_INPUT_P, next_argv, NIL_P, Qnil, rb_funcall3, rb_intern, and rb_io_getc().
Referenced by Init_IO().
Definition at line 8194 of file io.c.
References ARGF, argf_close(), ARGF_GENERIC_INPUT_P, argf::lineno, next_argv, NIL_P, Qnil, rb_default_rs, rb_funcall3, rb_io_getline(), rb_io_gets(), and rb_rs.
Referenced by argf_gets().
|
static |
Definition at line 11386 of file io.c.
References argc, argf_call_arg::argc, argf, ARGF, argf_call_arg::argf, argf_close(), argf_forward_call(), ARGF_GENERIC_INPUT_P, argf::argv, argf_call_arg::argv, io_getpartial(), io_nonblock_eof(), next_argv, NIL_P, NULL, Qnil, RARRAY_LEN, rb_eEOFError, rb_eof_error(), rb_rescue2(), rb_scan_args(), rb_str_new(), rb_str_resize(), RUBY_METHOD_FUNC, and StringValue.
Referenced by argf_forward_call(), argf_read_nonblock(), and argf_readpartial().
Definition at line 8300 of file io.c.
References argf_getline(), and rb_lastline_set().
Referenced by argf_lineno_setter(), argf_readline(), Init_IO(), and rb_f_gets().
Definition at line 7902 of file io.c.
References argf::argv, argf::current_file, argf::filename, argf::lineno, and Qnil.
Referenced by argf_alloc(), and argf_initialize().
Definition at line 7934 of file io.c.
References argf, ARGF, argf_of, argf::inplace, OBJ_INIT_COPY, rb_obj_dup(), and ruby_strdup().
Referenced by Init_IO().
Definition at line 11990 of file io.c.
References ARGF, Qnil, and rb_str_new2.
Referenced by Init_IO(), and opt_i_get().
Definition at line 12023 of file io.c.
References argf, ARGF, free, OBJ_TAINTED, rb_insecure_operation(), rb_safe_level(), RSTRING_PTR, RTEST, strdup, and StringValue.
Referenced by Init_IO(), and opt_i_set().
Definition at line 11011 of file io.c.
References ARGF, rb_default_external_encoding(), rb_enc_from_encoding(), rb_io_check_io(), rb_io_internal_encoding(), and RTEST.
Referenced by Init_IO().
Definition at line 11668 of file io.c.
References argf_each_line(), ID2SYM, rb_block_given_p(), rb_enumeratorize(), rb_intern, and rb_warn().
Referenced by Init_IO().
|
static |
Definition at line 7869 of file io.c.
References argf::argv, argf::current_file, argf::encs, argf::filename, and rb_gc_mark().
|
static |
Definition at line 7887 of file io.c.
References argf::inplace, size, and strlen().
|
static |
Definition at line 8023 of file io.c.
References ARGF, argf_close(), chown(), clear_codeconv(), DEFAULT_TEXTMODE, rb_io_t::rb_io_enc_t::ecflags, ECONV_DEFAULT_NEWLINE_DECORATOR, ECONV_NEWLINE_DECORATOR_MASK, rb_io_t::encs, err, errno, FALSE, fchmod(), argf::filename, fmode, FMODE_BINMODE, FMODE_READABLE, FMODE_WRITABLE, fstat, GetOpenFile, getuid(), rb_io_t::mode, NIL_P, orig_stdout, prep_io(), PRIsVALUE, Qnil, RARRAY_LEN, rb_ary_shift(), rb_cFile, rb_fatal(), rb_io_ascii8bit_binmode(), rb_io_binmode(), rb_io_close(), rb_io_set_write_io(), rb_stdin, rb_stdout, rb_str_cat2(), rb_str_dup(), rb_str_encode_ospath(), rb_str_new2, rb_sysopen(), RB_TYPE_P, rb_warn(), RSTRING_LEN, RSTRING_PTR, stat, strerror(), StringValueCStr, T_FILE, and TRUE.
Definition at line 11276 of file io.c.
References ARGF, argf_close(), argf_forward(), ARGF_GENERIC_INPUT_P, INT2NUM, io_read(), len, next_argv, NIL_P, NUM2LONG, Qnil, rb_scan_args(), rb_str_append(), rb_str_resize(), RSTRING_LEN, and StringValue.
Referenced by Init_IO().
Definition at line 11373 of file io.c.
References argf_getpartial(), NIL_P, NULL, and rb_scan_args().
Referenced by Init_IO().
Definition at line 11573 of file io.c.
References argf_getbyte(), NEXT_ARGF_FORWARD, NIL_P, and rb_eof_error().
Referenced by Init_IO().
Definition at line 11533 of file io.c.
References ARGF, argf_close(), next_argv, NIL_P, rb_eof_error(), rb_funcall3, rb_intern, rb_io_getc(), RB_TYPE_P, and T_FILE.
Referenced by Init_IO().
Definition at line 8376 of file io.c.
References ARGF_FORWARD, argf_gets(), argf_readlines(), next_argv, NIL_P, and rb_eof_error().
Referenced by Init_IO(), rb_f_readline(), and rb_gets().
Definition at line 8428 of file io.c.
References ARGF, argf_close(), ARGF_GENERIC_INPUT_P, argf::lineno, next_argv, RARRAY_LEN, rb_ary_concat(), rb_ary_new(), rb_funcall3, rb_intern, and rb_io_readlines().
Referenced by argf_readline(), Init_IO(), and rb_f_readlines().
Definition at line 11359 of file io.c.
References argf_getpartial(), and Qnil.
Referenced by Init_IO().
Definition at line 11137 of file io.c.
References ARGF, ARGF_FORWARD, global_argf_p(), next_argv, rb_eArgError, rb_io_rewind(), rb_raise(), and RFILE.
Referenced by Init_IO().
Definition at line 11094 of file io.c.
References ARGF, ARGF_FORWARD, next_argv, rb_eArgError, rb_io_seek_m(), and rb_raise().
Referenced by Init_IO().
Definition at line 11051 of file io.c.
References argf, ARGF, rb_io_t::encs, GetOpenFile, next_argv, rb_eArgError, rb_io_set_encoding(), and rb_raise().
Referenced by Init_IO().
Definition at line 11115 of file io.c.
References ARGF, ARGF_FORWARD, next_argv, rb_eArgError, rb_io_set_pos(), and rb_raise().
Referenced by Init_IO().
Definition at line 11077 of file io.c.
References ARGF, ARGF_FORWARD, next_argv, rb_eArgError, rb_io_tell(), and rb_raise().
Referenced by Init_IO().
Definition at line 12116 of file io.c.
References argf_write_io(), and rb_io_write().
Referenced by Init_IO().
Definition at line 12101 of file io.c.
References ARGF, GetWriteIO, rb_eIOError, rb_raise(), and RTEST.
Referenced by argf_write(), and Init_IO().
Definition at line 2152 of file io.c.
References bufread_arg::fptr, io_bufread(), bufread_arg::len, Qundef, and bufread_arg::str_ptr.
Referenced by io_fread().
Definition at line 3084 of file io.c.
References ENC_CODERANGE_7BIT, GetOpenFile, io_read_encoding(), NIL_P, rb_default_rs, rb_eArgError, rb_enc_asciicompat, rb_enc_get(), rb_enc_name, rb_enc_str_coderange(), rb_enc_str_new(), rb_raise(), rb_str_buf_cat_ascii(), and RSTRING_LEN.
Referenced by prepare_getline_args(), rb_io_s_foreach(), and rb_io_s_readlines().
Definition at line 6530 of file io.c.
References rb_execarg::cmd, OBJ_INFECT, Qnil, rb_enc_ascget(), rb_enc_get(), rb_str_new(), RSTRING_LEN, and RSTRING_PTR.
Referenced by rb_f_open(), and rb_io_open_generic().
|
static |
Definition at line 4392 of file io.c.
References clear_readconv(), and clear_writeconv().
Referenced by argf_next_argv(), fptr_finalize(), io_ascii8bit_binmode(), io_encoding_set(), maygvl_fclose(), rb_io_fptr_finalize(), and rb_io_initialize().
|
static |
Definition at line 4372 of file io.c.
References rb_io_t::cbuf, free_io_buffer(), NULL, rb_econv_close(), and rb_io_t::readconv.
Referenced by appendline(), clear_codeconv(), io_getc(), rb_io_each_codepoint(), rb_io_rewind(), rb_io_set_pos(), and read_all().
|
static |
Definition at line 4382 of file io.c.
References NULL, rb_econv_close(), rb_io_t::writeconv, and rb_io_t::writeconv_initialized.
Referenced by clear_codeconv().
Definition at line 10683 of file io.c.
References copy_stream_struct::close_dst, copy_stream_struct::close_src, copy_stream_struct::copy_length, copy_stream_fallback(), copy_stream_struct::dst, copy_stream_struct::dst_fd, rb_io_t::fd, copy_stream_struct::fds, FilePathValue, GetOpenFile, GetWriteIO, INT2FIX, INT2NUM, io_ascii8bit_binmode(), io_binwrite(), io_fflush(), len, NIL_P, nogvl_copy_stream_func(), off_t, Qnil, rb_cFile, rb_class_new_instance(), rb_eIOError, rb_fd_set, rb_intern, rb_io_check_byte_readable(), rb_io_check_io(), rb_io_check_writable(), rb_io_write(), rb_raise(), rb_respond_to(), rb_str_buf_new(), rb_str_resize(), rb_sys_fail(), rb_thread_call_without_gvl(), rb_thread_current(), RB_TYPE_P, rb_io_t::rbuf, read_buffered_data(), RSTRING_LEN, RSTRING_PTR, RUBY_UBF_IO, SET_BINARY_MODE_WITH_SEEK_CUR, copy_stream_struct::src, copy_stream_struct::src_fd, copy_stream_struct::src_offset, T_FILE, T_STRING, copy_stream_struct::th, and copy_stream_struct::total.
Referenced by rb_io_s_copy_stream().
|
static |
Definition at line 10671 of file io.c.
References ANYARGS, copy_stream_fallback_body(), off_t, Qnil, rb_eArgError, rb_eEOFError, rb_raise(), rb_rescue2(), copy_stream_struct::src_fd, and copy_stream_struct::src_offset.
Referenced by copy_stream_body().
Definition at line 10613 of file io.c.
References buf, copy_stream_struct::copy_length, copy_stream_struct::dst, id_read, id_readpartial, INT2FIX, maygvl_copy_stream_read(), NIL_P, NUM2LONG, off_t, Qnil, rb_eof_error(), rb_funcall(), rb_io_write(), rb_respond_to(), rb_str_buf_new(), rb_str_resize(), RSTRING_LEN, RSTRING_PTR, copy_stream_struct::src, copy_stream_struct::src_fd, copy_stream_struct::src_offset, and copy_stream_struct::total.
Referenced by copy_stream_fallback().
Definition at line 10802 of file io.c.
References copy_stream_struct::close_dst, copy_stream_struct::close_src, copy_stream_struct::dst, copy_stream_struct::error_no, copy_stream_struct::fds, copy_stream_struct::notimp, Qnil, rb_eNotImpError, rb_fd_term, rb_io_close_m(), rb_raise(), rb_syserr_fail(), copy_stream_struct::src, and copy_stream_struct::syserr.
Referenced by rb_io_s_copy_stream().
Definition at line 1366 of file io.c.
References DEFAULT_TEXTMODE, rb_io_t::rb_io_enc_t::ecflags, ECONV_NEWLINE_DECORATOR_MASK, ECONV_PARTIAL_INPUT, rb_io_t::rb_io_enc_t::enc, rb_io_t::rb_io_enc_t::enc2, rb_io_t::encs, rb_io_t::fd, FMODE_READABLE, make_writeconv(), rb_io_t::mode, MODE_BTMODE, NEED_WRITECONV, NIL_P, O_BINARY, Qnil, rb_ascii8bit_encoding(), rb_eArgError, rb_econv_str_convert(), rb_enc_asciicompat, rb_enc_from_encoding(), rb_enc_get(), rb_enc_name, rb_raise(), rb_str_encode(), SET_BINARY_MODE, binwrite_arg::str, rb_io_t::writeconv, rb_io_t::writeconv_asciicompat, rb_io_t::writeconv_pre_ecflags, and rb_io_t::writeconv_pre_ecopts.
Referenced by io_fwrite().
|
static |
Definition at line 10174 of file io.c.
References NULL, and rb_thread_execute_interrupts().
Referenced by maygvl_copy_stream_continue_p().
|
static |
Definition at line 5326 of file io.c.
References FMODE_BINMODE, FMODE_TEXTMODE, NIL_P, rb_eArgError, rb_hash_aref(), rb_raise(), RTEST, sym_binmode, and sym_textmode.
Referenced by rb_io_extract_modeenc(), and rb_io_s_pipe().
|
static |
Definition at line 3060 of file io.c.
References L, getline_arg::limit, NIL_P, NUM2LONG, Qnil, rb_check_string_type(), rb_rs, getline_arg::rs, and StringValue.
Referenced by prepare_getline_args(), rb_io_s_foreach(), and rb_io_s_readlines().
|
static |
Definition at line 3044 of file io.c.
References getline_arg::chomp, FALSE, NIL_P, Qundef, rb_get_kwargs(), rb_intern_const, and RTEST.
Referenced by prepare_getline_args(), rb_io_s_foreach(), and rb_io_s_readlines().
|
static |
Definition at line 9199 of file io.c.
Referenced by ioctl_narg_len(), and setup_narg().
Definition at line 2252 of file io.c.
References rb_io_t::cbuf, dp, econv_finished, ECONV_PARTIAL_INPUT, econv_source_buffer_empty, io_fillbuf(), memmove(), MORE_CHAR_FINISHED, MORE_CHAR_SUSPENDED, NIL_P, NULL, rb_econv_check_error(), rb_econv_convert(), rb_econv_make_exception(), rb_econv_putback(), rb_econv_putbackable(), rb_io_t::rbuf, READ_CHECK, and rb_io_t::readconv.
Referenced by more_char(), and read_all().
|
static |
Definition at line 9528 of file io.c.
References PRIsVALUE, rb_find_encoding(), and rb_warn().
Referenced by io_encoding_set().
Definition at line 4164 of file io.c.
References buf, closed_stream, dp, econv_destination_buffer_full, econv_incomplete_input, econv_invalid_byte_sequence, econv_undefined_conversion, errno, rb_io_t::fd, INT2NUM, io_fflush(), NULL, Qnil, Qtrue, rb_econv_convert(), rb_econv_make_exception(), rb_eIOError, rb_exc_new3, rb_io_wait_writable(), rb_mutex_owned_p(), rb_str_new_cstr(), rb_write_internal(), rb_write_internal2(), rb_io_t::wbuf, rb_io_t::write_lock, and rb_io_t::writeconv.
Referenced by finish_writeconv_sync(), and fptr_finalize_flush().
Definition at line 4232 of file io.c.
References finish_writeconv(), finish_writeconv_arg::fptr, and finish_writeconv_arg::noalloc.
Referenced by fptr_finalize_flush().
Definition at line 775 of file io.c.
References errno, io_fflush(), io_unread(), and rb_sys_fail().
|
static |
Definition at line 4343 of file io.c.
References clear_codeconv(), fptr_finalize_flush(), free_io_buffer(), rb_io_t::rbuf, and rb_io_t::wbuf.
Referenced by pipe_finalize(), and rb_io_fptr_cleanup().
|
static |
Definition at line 4280 of file io.c.
References err, errno, rb_io_t::fd, finish_writeconv(), finish_writeconv_sync(), FMODE_READABLE, FMODE_WRITABLE, finish_writeconv_arg::fptr, INT2NUM, io_fflush(), io_flush_buffer_sync(), IS_PREP_STDIO, maygvl_close(), maygvl_fclose(), rb_io_t::mode, NIL_P, finish_writeconv_arg::noalloc, NUM2INT, rb_io_t::pathv, Qnil, Qtrue, rb_exc_raise(), RB_INTEGER_TYPE_P, rb_mutex_synchronize(), rb_syserr_fail_path, rb_io_t::stdio_file, rb_io_t::wbuf, rb_io_t::write_lock, and rb_io_t::writeconv.
Referenced by fptr_finalize(), and io_close_fptr().
|
static |
Definition at line 4458 of file io.c.
References rb_io_t::pid, rb_last_status_clear(), rb_waitpid(), and WNOHANG.
Referenced by pipe_close(), and rb_io_close().
|
static |
Definition at line 4363 of file io.c.
References NULL, and ruby_sized_xfree().
Referenced by clear_readconv(), fptr_finalize(), maygvl_fclose(), and rb_io_fptr_finalize().
|
inlinestatic |
Definition at line 10967 of file io.c.
References argf.
Referenced by argf_block_call_line_i(), and argf_rewind().
Definition at line 4511 of file io.c.
References closed_stream, memcmp(), rb_attr_get(), rb_exc_raise(), rb_intern, RB_TYPE_P, RSTRING_LEN, RSTRING_PTR, and T_STRING.
Referenced by io_close().
void Init_IO | ( | void | ) |
Definition at line 12327 of file io.c.
References ARGF, argf_alloc(), argf_argv(), argf_argv_getter(), argf_binmode_m(), argf_binmode_p(), argf_bytes(), argf_chars(), argf_close_m(), argf_closed(), argf_codepoints(), argf_each_byte(), argf_each_char(), argf_each_codepoint(), argf_each_line(), argf_eof(), argf_external_encoding(), argf_file(), argf_filename(), argf_filename_getter(), argf_fileno(), argf_getbyte(), argf_getc(), argf_gets(), argf_initialize(), argf_initialize_copy(), argf_inplace_mode_get(), argf_inplace_mode_set(), argf_internal_encoding(), argf_lineno(), argf_lineno_getter(), argf_lineno_setter(), argf_lines(), argf_read(), argf_read_nonblock(), argf_readbyte(), argf_readchar(), argf_readline(), argf_readlines(), argf_readpartial(), argf_rewind(), argf_seek_m(), argf_set_encoding(), argf_set_lineno(), argf_set_pos(), argf_skip(), argf_tell(), argf_to_io(), argf_to_s(), argf_write(), argf_write_io(), FMODE_READABLE, FMODE_SYNC, FMODE_WRITABLE, ID2SYM, id_flush, id_getc, id_read, id_readpartial, id_set_encoding, id_write, Init_File(), INT2FIX, io_alloc(), io_read(), io_read_nonblock(), io_readpartial(), io_write_m(), io_write_nonblock(), NULL, O_BINARY, OBJ_FREEZE, opt_i_get(), opt_i_set(), orig_stderr, orig_stdout, prep_stdio(), Qnil, rb_cFile, rb_cIO, rb_class_new(), rb_class_new_instance(), rb_cObject, rb_default_rs, rb_define_alias(), rb_define_alloc_func(), rb_define_class(), rb_define_class_under(), rb_define_const(), rb_define_global_const(), rb_define_global_function(), rb_define_hooked_variable(), rb_define_method(), rb_define_module_under(), rb_define_private_method(), rb_define_readonly_variable(), rb_define_singleton_method(), rb_define_variable(), rb_define_virtual_variable(), rb_eEAGAIN, rb_eEAGAINWaitReadable, rb_eEAGAINWaitWritable, rb_eEINPROGRESS, rb_eEINPROGRESSWaitReadable, rb_eEINPROGRESSWaitWritable, rb_eEOFError, rb_eEWOULDBLOCK, rb_eEWOULDBLOCKWaitReadable, rb_eEWOULDBLOCKWaitWritable, rb_eIOError, rb_eStandardError, rb_f_backquote(), rb_f_gets(), rb_f_open(), rb_f_p(), rb_f_print(), rb_f_printf(), rb_f_putc(), rb_f_puts(), rb_f_readline(), rb_f_readlines(), rb_f_select(), rb_f_syscall, rb_file_initialize(), rb_gc_register_mark_object(), rb_gvar_readonly_setter(), rb_id_encoding(), rb_include_module(), rb_intern, rb_io_addstr(), rb_io_advise(), rb_io_autoclose_p(), rb_io_binmode_m(), rb_io_binmode_p(), rb_io_bytes(), rb_io_chars(), rb_io_close_m(), rb_io_close_on_exec_p, rb_io_close_read(), rb_io_close_write(), rb_io_closed(), rb_io_codepoints(), rb_io_each_byte(), rb_io_each_char(), rb_io_each_codepoint(), rb_io_each_line(), rb_io_eof(), rb_io_external_encoding(), rb_io_fcntl, rb_io_fdatasync, rb_io_fileno(), rb_io_flush(), rb_io_fsync, rb_io_getbyte(), rb_io_getc(), rb_io_gets_m(), rb_io_init_copy(), rb_io_initialize(), rb_io_inspect(), rb_io_internal_encoding(), rb_io_ioctl, rb_io_isatty(), rb_io_lineno(), rb_io_lines(), rb_io_pid(), rb_io_print(), rb_io_printf(), rb_io_putc(), rb_io_puts(), rb_io_readbyte(), rb_io_readchar(), rb_io_readline(), rb_io_readlines(), rb_io_reopen(), rb_io_rewind(), rb_io_s_binread(), rb_io_s_binwrite(), rb_io_s_copy_stream(), rb_io_s_for_fd(), rb_io_s_foreach(), rb_io_s_new(), rb_io_s_open(), rb_io_s_pipe(), rb_io_s_popen(), rb_io_s_read(), rb_io_s_readlines(), rb_io_s_sysopen(), rb_io_s_try_convert(), rb_io_s_write(), rb_io_seek_m(), rb_io_set_autoclose(), rb_io_set_close_on_exec, rb_io_set_encoding(), rb_io_set_lineno(), rb_io_set_pos(), rb_io_set_sync(), rb_io_sync, rb_io_sysread(), rb_io_sysseek(), rb_io_syswrite(), rb_io_tell(), rb_io_to_io(), rb_io_ungetbyte(), rb_io_ungetc(), rb_lastline_get(), rb_lastline_set(), rb_mEnumerable, rb_mKernel, rb_mWaitReadable, rb_mWaitWritable, rb_obj_display(), rb_output_fs, rb_output_rs, rb_rs, rb_set_class_path(), rb_stderr, rb_stdin, rb_stdout, rb_str_new2, rb_str_setter(), rb_usascii_str_new2, SEEK_CUR, SEEK_END, SEEK_SET, stdout_setter(), sym_autoclose, sym_binmode, sym_CUR, sym_dontneed, sym_encoding, sym_END, sym_extenc, sym_flags, sym_intenc, sym_mode, sym_noreuse, sym_normal, sym_open_args, sym_perm, sym_random, sym_sequential, sym_SET, sym_textmode, sym_wait_readable, sym_wait_writable, and sym_willneed.
|
static |
Definition at line 939 of file io.c.
References io_internal_read_struct::buf, io_internal_read_struct::capa, and io_internal_read_struct::fd.
Referenced by rb_read_internal().
|
static |
Definition at line 946 of file io.c.
References io_internal_write_struct::buf, io_internal_write_struct::capa, and io_internal_write_struct::fd.
Referenced by rb_write_internal().
|
static |
Definition at line 953 of file io.c.
References io_internal_write_struct::buf, io_internal_write_struct::capa, and io_internal_write_struct::fd.
Referenced by rb_write_internal2().
|
static |
Definition at line 905 of file io.c.
References NEWOBJ_OF, and T_FILE.
Referenced by Init_IO(), pipe_open(), prep_io(), rb_file_open(), rb_file_open_str(), rb_io_open_generic(), and rb_io_open_with_args().
|
static |
Definition at line 4860 of file io.c.
References clear_codeconv(), rb_io_t::rb_io_enc_t::ecflags, rb_io_t::rb_io_enc_t::ecopts, rb_io_t::rb_io_enc_t::enc, rb_io_t::rb_io_enc_t::enc2, rb_io_t::encs, FMODE_BINMODE, FMODE_TEXTMODE, rb_io_t::mode, NULL, Qnil, rb_ascii8bit_encoding(), rb_econv_close(), rb_io_t::readconv, SET_BINARY_MODE_WITH_SEEK_CUR, and rb_io_t::writeconv.
Referenced by copy_stream_body(), and rb_io_ascii8bit_binmode().
|
static |
Definition at line 1305 of file io.c.
References ALLOC_N, errno, rb_io_t::fd, FMODE_SYNC, FMODE_TTY, binwrite_arg::fptr, io_binwrite_string(), IO_WBUF_CAPA_MIN, L, len, binwrite_arg::length, MEMMOVE, rb_io_t::mode, NULL, binwrite_arg::ptr, rb_io_check_closed(), rb_io_wait_writable(), rb_mutex_allow_trap(), rb_mutex_new(), rb_mutex_synchronize(), rb_thread_check_ints(), binwrite_arg::str, rb_io_t::wbuf, and rb_io_t::write_lock.
Referenced by copy_stream_body(), io_fwrite(), and rb_io_bufwrite().
Definition at line 1273 of file io.c.
References rb_io_t::fd, binwrite_arg::fptr, io_fflush(), L, len, binwrite_arg::length, MEMMOVE, binwrite_arg::ptr, rb_io_check_closed(), rb_thread_fd_writable(), rb_write_internal(), rb_io_t::stdio_file, and rb_io_t::wbuf.
Referenced by io_binwrite().
|
static |
Definition at line 2107 of file io.c.
References rb_io_t::fd, io_fillbuf(), io_setstrbuf(), len, rb_io_check_closed(), rb_io_wait_readable(), rb_read_internal(), read_buffered_data(), READ_DATA_PENDING, and binwrite_arg::str.
Referenced by bufread_call(), and rb_io_bufread().
Definition at line 4504 of file io.c.
References rb_check_funcall(), and rb_intern.
Referenced by io_close(), and sock_initialize().
|
static |
Definition at line 5577 of file io.c.
References rb_io_t::fd, FMODE_DUPLEX, FMODE_TTY, io_encoding_set(), rb_io_t::mode, and rb_io_internal_encoding().
Referenced by prep_io(), rb_file_open_generic(), and rb_io_initialize().
Definition at line 4524 of file io.c.
References ignore_closed_stream(), io_call_close(), Qundef, rb_check_funcall(), rb_eIOError, rb_intern, rb_rescue2(), and RTEST.
Referenced by argf_close(), pipe_pair_close(), rb_f_open(), rb_io_s_open(), rb_io_s_pipe(), and sock_initialize().
Definition at line 4427 of file io.c.
References FALSE, rb_io_t::fd, finish_writeconv_arg::fptr, fptr_finalize_flush(), GetWriteIO, rb_io_fptr_cleanup(), rb_notify_fd_close(), rb_thread_schedule(), RFILE, and TRUE.
Referenced by pipe_close(), and rb_io_close().
Definition at line 2215 of file io.c.
References io_read_encoding(), OBJ_TAINT, and rb_enc_associate().
Referenced by io_getc(), rb_io_getline_0(), rb_io_getline_fast(), and read_all().
|
static |
Definition at line 4961 of file io.c.
References bom_prefix, bom_prefix_len, and STRNCASECMP.
Referenced by parse_mode_enc(), and rb_io_modestr_fmode().
Definition at line 9536 of file io.c.
References clear_codeconv(), rb_io_t::rb_io_enc_t::ecflags, rb_io_t::rb_io_enc_t::ecopts, rb_io_t::rb_io_enc_t::enc, rb_io_t::rb_io_enc_t::enc2, rb_io_t::encs, find_encoding(), rb_io_t::mode, NIL_P, NULL, parse_mode_enc(), Qnil, rb_check_string_type(), rb_econv_prepare_options(), rb_enc_asciicompat, rb_enc_get(), rb_io_ext_int_to_encs(), RSTRING_LEN, RSTRING_PTR, SET_UNIVERSAL_NEWLINE_DECORATOR_IF_ENC2, and validate_enc_binmode().
Referenced by io_check_tty(), io_encoding_set_v(), io_set_encoding_by_bom(), and rb_io_set_encoding().
Definition at line 9606 of file io.c.
References io_encoding_set_args::fptr, io_encoding_set(), io_encoding_set_args::opt, Qnil, io_encoding_set_args::v1, and io_encoding_set_args::v2.
Referenced by rb_io_s_pipe().
|
static |
Definition at line 1089 of file io.c.
References rb_io_t::fd, io_flush_buffer(), rb_io_check_closed(), rb_io_wait_writable(), and rb_io_t::wbuf.
Referenced by copy_stream_body(), finish_writeconv(), flush_before_seek(), fptr_finalize_flush(), io_binwrite_string(), io_reopen(), io_write_nonblock(), rb_io_check_char_readable(), rb_io_flush_raw(), rb_io_reopen(), rb_io_set_sync(), rb_io_sync(), and remain_size().
|
static |
Definition at line 1753 of file io.c.
References ALLOC_N, errno, rb_io_t::fd, IO_RBUF_CAPA_FOR, NIL_P, NULL, rb_io_t::pathv, rb_io_check_closed(), rb_io_wait_readable(), rb_read_internal(), rb_sprintf(), rb_str_append(), rb_syserr_fail_path, and rb_io_t::rbuf.
Referenced by appendline(), fill_cbuf(), io_bufread(), io_getc(), rb_io_each_byte(), rb_io_each_codepoint(), rb_io_eof(), rb_io_getbyte(), rb_io_getline_fast(), and swallow().
|
inlinestatic |
Definition at line 1075 of file io.c.
References io_flush_buffer_async(), io_flush_buffer_async2(), rb_mutex_owned_p(), rb_mutex_synchronize(), and rb_io_t::write_lock.
Referenced by io_fflush().
Definition at line 1048 of file io.c.
References rb_io_t::fd, io_flush_buffer_sync(), and rb_thread_io_blocking_region().
Referenced by io_flush_buffer().
Definition at line 1055 of file io.c.
References errno, io_flush_buffer_sync2(), NULL, rb_thread_call_without_gvl2(), and RUBY_UBF_IO.
Referenced by io_flush_buffer().
|
static |
Definition at line 1016 of file io.c.
References errno, rb_io_t::fd, and rb_io_t::wbuf.
Referenced by fptr_finalize_flush(), io_flush_buffer_async(), and io_flush_buffer_sync2().
|
static |
Definition at line 1036 of file io.c.
References io_flush_buffer_sync(), and result.
Referenced by io_flush_buffer_async2().
Definition at line 2160 of file io.c.
References bufread_call(), bufread_arg::fptr, io_setstrbuf(), len, bufread_arg::len, rb_io_t::pathv, rb_str_locktmp_ensure(), rb_sys_fail_path, RSTRING_PTR, size, and bufread_arg::str_ptr.
Referenced by io_read(), and read_all().
Definition at line 1423 of file io.c.
References do_writeconv(), rb_io_t::fd, FMODE_TTY, io_binwrite(), len, rb_io_t::mode, OBJ_FREEZE, binwrite_arg::ptr, rb_str_tmp_frozen_acquire(), rb_str_tmp_frozen_release(), rb_w32_write_console(), and RSTRING_GETMEM.
Referenced by io_write().
|
static |
Definition at line 3552 of file io.c.
References rb_io_t::cbuf, clear_readconv(), ENC_CODERANGE_7BIT, ENC_CODERANGE_BROKEN, ENC_CODERANGE_SET, ENC_CODERANGE_VALID, io_enc_str(), io_fillbuf(), io_read_encoding(), io_shift_cbuf(), ISASCII, make_readconv(), MBCLEN_CHARFOUND_LEN, MBCLEN_CHARFOUND_P, MBCLEN_INVALID_P, MBCLEN_NEEDMORE_P, more_char(), MORE_CHAR_FINISHED, NEED_NEWLINE_DECORATOR_ON_READ_CHECK, NEED_READCONV, Qnil, rb_eIOError, rb_enc_asciicompat, rb_enc_mbclen(), rb_enc_precise_mbclen(), rb_enc_str_new(), rb_raise(), rb_str_cat(), rb_str_new(), rb_io_t::rbuf, RSTRING_LEN, RSTRING_PTR, and SET_BINARY_MODE.
Referenced by rb_io_each_char(), and rb_io_getc().
Definition at line 2508 of file io.c.
References errno, EWOULDBLOCK, rb_io_t::fd, read_internal_arg::fd, GetOpenFile, io_set_read_length(), io_setstrbuf(), len, read_internal_arg::len, no_exception_p(), NUM2LONG, OBJ_TAINT, rb_io_t::pathv, Qnil, rb_eArgError, rb_io_check_byte_readable(), rb_io_set_nonblock(), rb_io_wait_readable(), RB_IO_WAIT_READABLE, rb_raise(), rb_readwrite_syserr_fail(), rb_scan_args(), rb_str_locktmp_ensure(), rb_syserr_fail_path, read_buffered_data(), READ_CHECK, read_internal_call(), RSTRING_PTR, read_internal_arg::str_ptr, and sym_wait_readable.
Referenced by argf_getpartial(), and io_readpartial().
|
static |
Definition at line 837 of file io.c.
References rb_io_t::rb_io_enc_t::enc2, rb_io_t::encs, and io_read_encoding().
Referenced by io_unread(), rb_io_each_char(), rb_io_each_codepoint(), and rb_io_getc().
Definition at line 9522 of file io.c.
References rb_class_new_instance().
Referenced by rb_io_s_pipe().
Definition at line 2639 of file io.c.
References no_exception_p(), Qnil, and rb_eof_error().
Referenced by argf_getpartial().
Definition at line 7165 of file io.c.
References NIL_P, Qfalse, Qtrue, RARRAY_AREF, RARRAY_LEN, rb_check_array_type(), rb_io_puts(), and rb_str_new2.
Referenced by rb_io_puts().
Definition at line 2800 of file io.c.
References rb_io_t::fd, GetOpenFile, io_fread(), io_set_read_length(), io_setstrbuf(), len, NIL_P, NUM2LONG, OBJ_TAINT, Qnil, rb_eArgError, rb_io_check_byte_readable(), rb_io_check_char_readable(), rb_raise(), rb_scan_args(), read_all(), READ_CHECK, and remain_size().
Referenced by argf_read(), Init_IO(), and io_s_read().
|
static |
Definition at line 828 of file io.c.
References rb_io_t::rb_io_enc_t::enc, rb_io_t::encs, and rb_default_external_encoding().
Referenced by check_getline_args(), io_enc_str(), io_getc(), io_input_encoding(), rb_io_external_encoding(), rb_io_getline_0(), rb_io_internal_encoding(), rb_io_ungetc(), read_all(), and swallow().
Definition at line 2649 of file io.c.
References errno, EWOULDBLOCK, rb_io_t::fd, read_internal_arg::fd, GetOpenFile, io_set_read_length(), io_setstrbuf(), len, read_internal_arg::len, NUM2LONG, OBJ_TAINT, rb_io_t::pathv, Qfalse, Qnil, rb_eArgError, rb_eof_error(), rb_io_check_byte_readable(), rb_io_set_nonblock(), RB_IO_WAIT_READABLE, rb_raise(), rb_readwrite_syserr_fail(), rb_str_locktmp_ensure(), rb_syserr_fail_path, read_buffered_data(), read_internal_call(), RSTRING_PTR, read_internal_arg::str_ptr, and sym_wait_readable.
Referenced by Init_IO().
|
static |
Definition at line 3429 of file io.c.
References getline_arg::chomp, getline_arg::limit, NIL_P, rb_ary_new(), rb_ary_push(), rb_eArgError, rb_io_getline_1(), rb_raise(), and getline_arg::rs.
Referenced by io_s_readlines(), rb_io_readline(), and rb_io_readlines().
Definition at line 2628 of file io.c.
References io_getpartial(), NIL_P, Qnil, and rb_eof_error().
Referenced by Init_IO().
Definition at line 6719 of file io.c.
References errno, rb_io_t::fd, rb_io_t::finalize, FMODE_BINMODE, FMODE_PREP, FMODE_READABLE, FMODE_WRITABLE, GetOpenFile, if(), io_fflush(), io_seek, io_tell, IS_PREP_STDIO, rb_io_t::lineno, rb_io_t::mode, off_t, rb_io_t::pathv, rb_io_t::pid, pipe_add_fptr(), pipe_finalize(), PREP_STDIO_NAME, Qnil, rb_cloexec_dup2(), rb_eArgError, rb_freopen(), rb_io_binmode(), rb_io_fmode_modestr(), rb_io_get_io(), rb_notify_fd_close(), rb_obj_class(), rb_raise(), rb_sys_fail(), rb_sys_fail_path, rb_update_max_fd(), RBASIC_SET_CLASS, RTEST, SEEK_SET, and rb_io_t::stdio_file.
Referenced by rb_io_reopen().
|
static |
Definition at line 9803 of file io.c.
References getline_arg::chomp, getline_arg::io, getline_arg::limit, NIL_P, Qnil, rb_io_getline_1(), rb_lastline_set(), rb_yield(), and getline_arg::rs.
Referenced by rb_io_s_foreach().
|
static |
Definition at line 9900 of file io.c.
References foreach_arg::argc, foreach_arg::argv, foreach_arg::io, and io_read().
Referenced by rb_io_s_binread(), and rb_io_s_read().
|
static |
Definition at line 9860 of file io.c.
References getline_arg::io, and io_readlines().
Referenced by rb_io_s_readlines().
Definition at line 10043 of file io.c.
References INT2NUM, write_arg::io, foreach_arg::io, seek_arg::io, io_s_write0(), seek_arg::mode, NIL_P, write_arg::nosync, NULL, O_BINARY, seek_arg::offset, open_key_args(), Qnil, rb_ensure(), rb_hash_aref(), rb_hash_aset(), rb_hash_dup(), rb_hash_new(), rb_io_binmode_m(), rb_io_close(), rb_jump_tag(), rb_protect(), rb_scan_args(), seek_before_access(), SEEK_SET, write_arg::str, and sym_mode.
Referenced by rb_io_s_binwrite(), and rb_io_s_write().
Definition at line 10037 of file io.c.
References write_arg::io, io_write(), write_arg::nosync, and write_arg::str.
Referenced by io_s_write().
|
static |
Definition at line 5652 of file io.c.
References rb_io_t::rb_io_enc_t::enc2, rb_io_t::encs, GetOpenFile, io_encoding_set(), io_strip_bom(), NULL, Qnil, rb_enc_from_encoding(), rb_enc_from_index(), and rb_io_internal_encoding().
Referenced by rb_file_open_generic(), and rb_io_initialize().
|
static |
Definition at line 2384 of file io.c.
References rb_str_modify(), rb_str_set_len(), and RSTRING_LEN.
Referenced by io_getpartial(), io_read(), io_read_nonblock(), and rb_io_sysread().
|
static |
Definition at line 2363 of file io.c.
References L, NIL_P, rb_str_modify(), rb_str_modify_expand(), rb_str_new(), RSTRING_LEN, and StringValue.
Referenced by io_bufread(), io_fread(), io_getpartial(), io_read(), io_read_nonblock(), rb_io_sysread(), and read_all().
Definition at line 2336 of file io.c.
References rb_io_t::cbuf, rb_io_t::rb_io_enc_t::enc, rb_io_t::encs, len, memmove(), NIL_P, OBJ_TAINT, Qnil, rb_enc_associate(), rb_str_cat(), and rb_str_new().
Referenced by io_getc(), read_all(), and swallow().
|
static |
Definition at line 5589 of file io.c.
References ENCINDEX_UTF_16BE, ENCINDEX_UTF_16LE, ENCINDEX_UTF_32BE, ENCINDEX_UTF_32LE, INT2FIX, NIL_P, rb_io_getbyte(), rb_io_ungetbyte(), and rb_utf8_encindex().
Referenced by io_set_encoding_by_bom().
Definition at line 742 of file io.c.
References ALLOC_N, IO_RBUF_CAPA_FOR, len, MEMMOVE, NULL, rb_eIOError, rb_raise(), rb_io_t::rbuf, RSTRING_LEN, and RSTRING_PTR.
Referenced by rb_io_ungetbyte(), and rb_io_ungetc().
|
static |
Definition at line 719 of file io.c.
References errno, rb_io_t::fd, FMODE_DUPLEX, io_input_encoding(), rb_io_t::mode, off_t, rb_io_check_closed(), rb_io_t::rbuf, and SEEK_CUR.
Referenced by flush_before_seek(), rb_io_check_writable(), and rb_io_flush_raw().
Definition at line 1458 of file io.c.
References binwrite_arg::fptr, GetOpenFile, GetWriteIO, id_write, INT2FIX, io_fwrite(), L, LONG2FIX, NIL_P, rb_io_t::pathv, rb_funcall(), rb_io_check_io(), rb_io_check_writable(), rb_obj_as_string(), rb_sys_fail_path, and RSTRING_LEN.
Referenced by io_s_write0(), io_write_m(), and rb_p().
Definition at line 2698 of file io.c.
References errno, EWOULDBLOCK, rb_io_t::fd, GetOpenFile, GetWriteIO, io_fflush(), LONG2FIX, rb_io_t::pathv, Qfalse, rb_io_check_writable(), rb_io_set_nonblock(), RB_IO_WAIT_WRITABLE, rb_obj_as_string(), rb_readwrite_syserr_fail(), rb_sys_fail(), rb_syserr_fail_path, RB_TYPE_P, RSTRING_LEN, RSTRING_PTR, sym_wait_writable, and T_STRING.
Referenced by Init_IO().
|
static |
Definition at line 9041 of file io.c.
References DEFULT_IOCTL_NARG_LEN, F_DUPFD, F_DUPFD_CLOEXEC, F_GETFD, F_SETFD, F_SETFL, fcntl_narg_len(), flock(), and len.
Referenced by setup_narg().
|
static |
Definition at line 6216 of file io.c.
References FALSE, rb_eNotImpError, rb_raise(), RSTRING_LEN, RSTRING_PTR, and TRUE.
Referenced by pipe_open_s(), and rb_io_s_popen().
|
static |
Definition at line 2223 of file io.c.
References ALLOC_N, rb_io_t::cbuf, rb_io_t::rb_io_enc_t::ecflags, ECONV_NEWLINE_DECORATOR_WRITE_MASK, rb_io_t::rb_io_enc_t::ecopts, rb_io_t::rb_io_enc_t::enc, rb_io_t::rb_io_enc_t::enc2, rb_io_t::encs, IO_CBUF_CAPA_MIN, rb_econv_open_exc(), rb_econv_open_opts(), rb_enc_name, rb_exc_raise(), rb_io_t::readconv, and size.
Referenced by appendline(), io_getc(), rb_io_each_codepoint(), rb_io_ungetc(), read_all(), and swallow().
|
static |
Definition at line 1165 of file io.c.
References rb_io_t::rb_io_enc_t::ecflags, ECONV_ERROR_HANDLER_MASK, ECONV_NEWLINE_DECORATOR_READ_MASK, ECONV_STATEFUL_DECORATOR_MASK, rb_io_t::rb_io_enc_t::ecopts, rb_io_t::rb_io_enc_t::enc, rb_io_t::rb_io_enc_t::enc2, rb_io_t::encs, NULL, Qnil, rb_ascii8bit_encoding(), rb_econv_asciicompat_encoding(), rb_econv_open_exc(), rb_econv_open_opts(), rb_enc_name, rb_exc_raise(), rb_str_new2, rb_io_t::writeconv, rb_io_t::writeconv_asciicompat, rb_io_t::writeconv_initialized, rb_io_t::writeconv_pre_ecflags, and rb_io_t::writeconv_pre_ecopts.
Referenced by do_writeconv().
|
static |
Definition at line 4247 of file io.c.
References nogvl_close(), rb_thread_call_without_gvl(), and RUBY_UBF_IO.
Referenced by fptr_finalize_flush().
|
static |
Definition at line 10187 of file io.c.
References errno, exec_interrupts(), FALSE, rb_thread_call_with_gvl(), rb_thread_execute_interrupts(), rb_thread_interrupted(), copy_stream_struct::th, and TRUE.
Referenced by maygvl_copy_stream_read(), maygvl_copy_stream_wait_read(), nogvl_copy_stream_wait_write(), and nogvl_copy_stream_write().
|
static |
Definition at line 10465 of file io.c.
References errno, copy_stream_struct::error_no, EWOULDBLOCK, maygvl_copy_stream_continue_p(), maygvl_copy_stream_wait_read(), maygvl_read(), copy_stream_struct::notimp, off_t, copy_stream_struct::src_fd, and copy_stream_struct::syserr.
Referenced by copy_stream_fallback_body(), and nogvl_copy_stream_read_write().
|
static |
Definition at line 10258 of file io.c.
References errno, copy_stream_struct::error_no, copy_stream_struct::fds, maygvl_copy_stream_continue_p(), maygvl_select(), NULL, rb_fd_max, rb_fd_set, rb_fd_zero, copy_stream_struct::src_fd, and copy_stream_struct::syserr.
Referenced by maygvl_copy_stream_read(), and nogvl_copy_stream_wait_write().
|
static |
Definition at line 4268 of file io.c.
References buf, clear_codeconv(), free_io_buffer(), nogvl_fclose(), rb_thread_call_without_gvl(), and RUBY_UBF_IO.
Referenced by fptr_finalize_flush().
|
static |
Definition at line 10456 of file io.c.
References rb_read_internal().
Referenced by maygvl_copy_stream_read().
|
static |
Definition at line 10249 of file io.c.
References rb_fd_select, and rb_thread_fd_select().
Referenced by maygvl_copy_stream_wait_read().
Definition at line 2326 of file io.c.
References ECONV_AFTER_OUTPUT, fill_cbuf(), MORE_CHAR_FINISHED, MORE_CHAR_SUSPENDED, and rb_exc_raise().
Referenced by appendline(), io_getc(), rb_io_each_codepoint(), and swallow().
Definition at line 7415 of file io.c.
References PRIsVALUE, rb_eTypeError, rb_id2str, rb_obj_class(), rb_raise(), and rb_respond_to().
Referenced by stdout_setter().
|
static |
Definition at line 2498 of file io.c.
References id_exception, Qfalse, and rb_get_kwargs().
Referenced by io_getpartial(), and io_nonblock_eof().
|
static |
Definition at line 4239 of file io.c.
Referenced by maygvl_close().
|
static |
Definition at line 10591 of file io.c.
References nogvl_copy_stream_read_write().
Referenced by copy_stream_body().
|
static |
Definition at line 10534 of file io.c.
References buf, copy_stream_struct::close_src, copy_stream_struct::copy_length, errno, copy_stream_struct::error_no, len, maygvl_copy_stream_read(), nogvl_copy_stream_write(), off_t, SEEK_SET, copy_stream_struct::src_fd, copy_stream_struct::src_offset, and copy_stream_struct::syserr.
Referenced by nogvl_copy_stream_func().
|
static |
Definition at line 10278 of file io.c.
References copy_stream_struct::copy_length, count, copy_stream_struct::dst_fd, errno, copy_stream_struct::error_no, EWOULDBLOCK, copy_stream_struct::fds, fstat, IOWAIT_SYSCALL, maygvl_copy_stream_continue_p(), maygvl_copy_stream_wait_read(), NULL, off_t, rb_fd_max, rb_fd_select, rb_fd_set, rb_fd_zero, S_ISREG, SEEK_CUR, copy_stream_struct::src_fd, copy_stream_struct::src_offset, SSIZE_MAX, stat, copy_stream_struct::syserr, and copy_stream_struct::total.
Referenced by nogvl_copy_stream_write().
|
static |
Definition at line 10508 of file io.c.
References copy_stream_struct::dst_fd, errno, copy_stream_struct::error_no, EWOULDBLOCK, maygvl_copy_stream_continue_p(), nogvl_copy_stream_wait_write(), copy_stream_struct::syserr, and copy_stream_struct::total.
Referenced by nogvl_copy_stream_read_write().
|
static |
Definition at line 4260 of file io.c.
Referenced by maygvl_fclose().
|
static |
Definition at line 9766 of file io.c.
References argc, foreach_arg::argc, argf::argv, foreach_arg::argv, FilePathValue, INT2FIX, INT2NUM, foreach_arg::io, NIL_P, Qnil, RARRAY_CONST_PTR, RARRAY_LEN, rb_ary_clear(), rb_ary_concat(), rb_ary_push(), rb_ary_tmp_new(), rb_convert_type(), rb_eArgError, rb_hash_aref(), rb_io_open(), rb_io_open_with_args(), rb_raise(), sym_open_args, and T_ARRAY.
Referenced by io_s_write(), rb_io_s_foreach(), rb_io_s_read(), and rb_io_s_readlines().
|
static |
Definition at line 5163 of file io.c.
References bom_prefix_len, ENCODING_MAXNAMELEN, fmode, FMODE_SETENC_BY_BOM, io_encname_bom_p(), len, memcpy, NULL, Qnil, rb_enc_find_index(), rb_enc_from_index(), rb_enc_warn(), rb_io_ext_int_to_encs(), strlen(), STRNCASECMP, strrchr(), unsupported_encoding(), utf_prefix, and utf_prefix_len.
Referenced by io_encoding_set(), rb_file_open_internal(), rb_io_extract_encoding_option(), and rb_io_extract_modeenc().
|
static |
Definition at line 5742 of file io.c.
References ALLOC, pipe_list::fptr, list, pipe_list::next, and pipe_list.
Referenced by io_reopen(), pipe_open(), and rb_io_init_copy().
Definition at line 6243 of file io.c.
References fptr_waitpid(), io_close_fptr(), Qnil, rb_thread_current(), and rb_thread_to_be_killed().
Referenced by rb_io_s_popen().
|
static |
Definition at line 5753 of file io.c.
References pipe_list::fptr, free, list, pipe_list::next, pipe_list, and rb_io_fptr_finalize().
Referenced by pipe_finalize().
|
static |
Definition at line 5791 of file io.c.
References rb_io_t::fd, fptr_finalize(), rb_io_t::pid, pipe_del_fptr(), rb_last_status_set(), and rb_io_t::stdio_file.
Referenced by io_reopen(), pipe_open(), and rb_io_init_copy().
|
static |
Definition at line 5986 of file io.c.
References ARGVSTR2ARGV, rb_execarg::cmd, rb_io_t::rb_io_enc_t::ecflags, ECONV_DEFAULT_NEWLINE_DECORATOR, ECONV_UNIVERSAL_NEWLINE_DECORATOR, rb_io_t::encs, rb_execarg::envp_str, errno, EWOULDBLOCK, rb_io_t::fd, fileno, rb_io_t::finalize, fmode, FMODE_DUPLEX, FMODE_READABLE, FMODE_SYNC, FMODE_WRITABLE, INT2FIX, rb_execarg::invoke, io_alloc(), MakeOpenFile, rb_io_t::mode, NEED_NEWLINE_DECORATOR_ON_READ, NEED_NEWLINE_DECORATOR_ON_WRITE, NIL_P, NULL, orig_stderr, orig_stdout, rb_io_t::pid, pipe_add_fptr(), pipe_finalize(), Qfalse, Qnil, rb_cIO, rb_execarg_addopt(), rb_execarg_commandline(), rb_execarg_get(), rb_execarg_parent_end(), rb_execarg_parent_start(), rb_execarg_run_options(), rb_fork_async_signal_safe(), rb_fork_ruby(), rb_intern, rb_io_synchronized(), rb_ivar_set(), rb_jump_tag(), rb_notimplement(), rb_pipe(), rb_protect(), rb_sys_fail_str(), rb_syserr_fail(), rb_syserr_fail_path, rb_syserr_fail_str(), rb_thread_atfork(), rb_thread_sleep(), RFILE, RSTRING_PTR, rb_execarg::sh, rb_io_t::stdio_file, StringValueCStr, rb_io_t::tied_io_for_writing, and rb_execarg::use_shell.
Referenced by pipe_open_s(), and rb_io_s_popen().
|
static |
Definition at line 6230 of file io.c.
References argc, argf::argv, is_popen_fork(), pipe_open(), Qnil, rb_execarg_new(), and TRUE.
Referenced by rb_f_backquote(), and rb_io_open_generic().
Definition at line 9614 of file io.c.
References io_close(), and rb_ensure().
Referenced by rb_io_s_pipe().
Definition at line 7432 of file io.c.
References rb_io_t::fd, fmode, FMODE_BINMODE, io_alloc(), io_check_tty(), MakeOpenFile, rb_io_t::mode, O_BINARY, rb_io_t::pathv, rb_obj_freeze(), rb_str_new_cstr(), and rb_update_max_fd().
Referenced by argf_next_argv(), prep_stdio(), and rb_io_fdopen().
Definition at line 7462 of file io.c.
References DEFAULT_TEXTMODE, rb_io_t::rb_io_enc_t::ecflags, ECONV_DEFAULT_NEWLINE_DECORATOR, ECONV_UNIVERSAL_NEWLINE_DECORATOR, rb_io_t::encs, f, fileno, FMODE_PREP, FMODE_READABLE, GetOpenFile, prep_io(), and rb_io_t::stdio_file.
Referenced by Init_IO().
|
static |
Definition at line 3113 of file io.c.
References check_getline_args(), extract_getline_args(), extract_getline_opts(), getline_arg::limit, NULL, rb_scan_args(), and getline_arg::rs.
Referenced by rb_io_each_line(), rb_io_getline(), and rb_io_readlines().
int rb_cloexec_dup | ( | int | oldfd | ) |
Definition at line 281 of file io.c.
References rb_cloexec_fcntl_dupfd().
Referenced by close_unless_reserved(), pty_getpty(), readline_s_set_input(), readline_s_set_output(), and ruby_dup().
int rb_cloexec_dup2 | ( | int | oldfd, |
int | newfd | ||
) |
Definition at line 288 of file io.c.
References dup2(), errno, O_CLOEXEC, and rb_maygvl_fd_fix_cloexec().
Referenced by close_unless_reserved(), io_reopen(), and rb_io_reopen().
int rb_cloexec_fcntl_dupfd | ( | int | fd, |
int | minfd | ||
) |
Definition at line 360 of file io.c.
References errno, F_DUPFD, F_DUPFD_CLOEXEC, fcntl(), and rb_maygvl_fd_fix_cloexec().
Referenced by rb_cloexec_dup(), and rb_exec_async_signal_safe().
Definition at line 255 of file io.c.
References O_CLOEXEC, rb_fix_detect_o_cloexec(), and rb_maygvl_fd_fix_cloexec().
Referenced by chfunc(), close_unless_reserved(), console_dev(), get_device_once(), open_load_file(), rb_file_load_ok(), rb_file_s_join(), rb_pipe(), and sysopen_func().
int rb_cloexec_pipe | ( | int | fildes[2] | ) |
void rb_eof_error | ( | void | ) |
Definition at line 618 of file io.c.
References rb_eEOFError, and rb_raise().
Referenced by argf_getpartial(), argf_readbyte(), argf_readchar(), argf_readline(), copy_stream_fallback_body(), io_nonblock_eof(), io_read_nonblock(), io_readpartial(), ossl_ssl_read_internal(), r_byte(), rb_io_readbyte(), rb_io_readchar(), rb_io_readline(), rb_io_sysread(), strio_read_nonblock(), strio_readbyte(), strio_readchar(), strio_readline(), and strio_sysread().
char* rb_execarg_commandline | ( | const struct rb_execarg * | eargp, |
VALUE * | prog | ||
) |
Definition at line 3894 of file process.c.
References argc, argv, ARGVSTR2ARGC, ARGVSTR2ARGV, rb_execarg::cmd, rb_execarg::invoke, rb_str_new(), RSTRING_LEN, RSTRING_PTR, StringValueCStr, and rb_execarg::use_shell.
Referenced by pipe_open(), rb_pipe(), and rb_spawn_process().
Definition at line 8466 of file io.c.
References DEFAULT_TEXTMODE, FMODE_READABLE, GetOpenFile, NIL_P, NULL, pipe_open_s(), Qnil, rb_gc_force_recycle(), rb_io_close(), rb_io_fptr_finalize(), rb_last_status_clear(), rb_str_new(), read_all(), remain_size(), result, and SafeStringValue.
Referenced by Init_IO().
Definition at line 8275 of file io.c.
References argf_gets(), and rb_funcallv.
Definition at line 6644 of file io.c.
References check_pipe_command(), rb_execarg::cmd, CONST_ID, FALSE, FilePathValue, io_close(), mode_t, NIL_P, rb_block_given_p(), rb_cFile, rb_cIO, rb_ensure(), rb_funcallv, rb_io_open_generic(), rb_io_s_open(), rb_io_s_popen(), rb_respond_to(), rb_yield(), and TRUE.
Referenced by Init_IO().
Definition at line 7323 of file io.c.
References argc, rb_f_p_arg::argc, argf::argv, rb_f_p_arg::argv, rb_f_p_internal(), and rb_uninterruptible().
Referenced by Init_IO().
Definition at line 7281 of file io.c.
References argc, rb_f_p_arg::argc, argf::argv, rb_f_p_arg::argv, Qnil, rb_ary_new4, rb_io_flush(), rb_p(), rb_stdout, RB_TYPE_P, and T_FILE.
Referenced by rb_f_p().
Definition at line 6997 of file io.c.
References Qnil, rb_f_sprintf(), rb_io_write(), rb_stdout, RB_TYPE_P, and T_STRING.
Referenced by Init_IO().
Definition at line 7140 of file io.c.
References rb_funcallv, rb_intern, rb_io_putc(), and rb_stdout.
Referenced by Init_IO().
Definition at line 7252 of file io.c.
References rb_funcallv, rb_intern, rb_io_puts(), and rb_stdout.
Referenced by Init_IO().
Definition at line 8349 of file io.c.
References argf_readline(), rb_funcallv, and rb_intern.
Referenced by Init_IO().
Definition at line 8403 of file io.c.
References argf_readlines(), rb_funcallv, and rb_intern.
Referenced by Init_IO().
Definition at line 8956 of file io.c.
References select_args::except, select_args::fdsets, NIL_P, numberof, rb_ensure(), rb_fd_init, rb_scan_args(), rb_time_interval(), select_args::read, select_call(), select_end(), select_args::timeout, and select_args::write.
Referenced by Init_IO().
void rb_fd_fix_cloexec | ( | int | fd | ) |
Definition at line 231 of file io.c.
References rb_maygvl_fd_fix_cloexec(), and rb_update_max_fd().
Referenced by fdbm_initialize(), fgdbm_initialize(), fgdbm_reorganize(), get_device_once(), ossl_x509_new_from_file(), rb_io_reopen(), rsock_socket0(), and sock_initialize().
Definition at line 5537 of file io.c.
References errno, NULL, rb_gc(), rb_gc_for_fd(), rb_syserr_fail(), and rb_warn().
Referenced by rb_io_stdio_file().
Definition at line 7775 of file io.c.
References NIL_P, rb_check_to_int(), rb_eRuntimeError, rb_io_initialize(), rb_open_file(), rb_raise(), and RFILE.
Referenced by Init_IO().
Definition at line 5730 of file io.c.
References io_alloc(), rb_cFile, rb_file_open_internal(), and rb_str_new_cstr().
|
static |
Definition at line 5668 of file io.c.
References rb_io_t::encs, rb_io_t::fd, fmode, FMODE_SETENC_BY_BOM, io_check_tty(), io_set_encoding_by_bom(), MakeOpenFile, rb_io_t::mode, NULL, rb_io_t::pathv, Qnil, rb_io_ext_int_to_encs(), rb_str_new_frozen(), rb_sysopen(), and validate_enc_binmode().
Referenced by rb_file_open_internal(), rb_io_open_generic(), and rb_open_file().
Definition at line 5695 of file io.c.
References fmode, FMODE_BINMODE, NULL, parse_mode_enc(), Qnil, rb_ascii8bit_encoding(), rb_file_open_generic(), rb_io_ext_int_to_encs(), rb_io_fmode_oflags(), rb_io_modestr_fmode(), rb_usascii_encoding(), and strchr().
Referenced by rb_file_open(), and rb_file_open_str().
Definition at line 5723 of file io.c.
References FilePathValue, io_alloc(), rb_cFile, and rb_file_open_internal().
Referenced by gzfile_s_open(), and iseqw_s_compile_file().
|
static |
Definition at line 239 of file io.c.
References errno, F_GETFD, fcntl(), FD_CLOEXEC, rb_bug(), rb_maygvl_fd_fix_cloexec(), and strerror().
Referenced by rb_cloexec_open().
Definition at line 6808 of file io.c.
References errno, RB_GC_GUARD, and RSTRING_PTR.
Referenced by io_reopen(), and rb_io_reopen().
int rb_gc_for_fd | ( | int | err | ) |
Definition at line 876 of file io.c.
References rb_gc().
Referenced by dir_initialize(), do_opendir(), open_load_file(), rb_dir_s_empty_p(), rb_fdopen(), rb_pipe(), rb_sysopen(), rsock_socket(), ruby_dup(), and sock_initialize().
VALUE rb_gets | ( | void | ) |
Definition at line 8311 of file io.c.
References ARGF, argf_readline(), next_argv, NIL_P, Qnil, rb_default_rs, rb_f_gets(), rb_io_close(), rb_io_gets(), rb_lastline_set(), and rb_rs.
Definition at line 1530 of file io.c.
References rb_io_t::fd, fsync, binwrite_arg::ptr, rb_io_write(), and rb_w32_get_osfhandle().
Referenced by Init_IO().
Definition at line 8791 of file io.c.
References advice_arg_check(), GetOpenFile, GetWriteIO, len, NIL_P, NUM2OFFT, off_t, Qnil, and rb_scan_args().
Referenced by Init_IO().
Definition at line 4882 of file io.c.
References GetOpenFile, and io_ascii8bit_binmode().
Referenced by argf_binmode_m(), argf_next_argv(), rb_io_binmode_m(), and rsock_init_sock().
Definition at line 7832 of file io.c.
References FMODE_PREP, rb_io_t::mode, Qfalse, Qtrue, rb_io_check_closed(), and RFILE.
Referenced by Init_IO().
Definition at line 4836 of file io.c.
References ECONV_NEWLINE_DECORATOR_MASK, rb_io_t::fd, FMODE_BINMODE, FMODE_TEXTMODE, GetOpenFile, rb_io_t::mode, O_BINARY, rb_econv_binmode(), rb_io_t::readconv, SET_BINARY_MODE_WITH_SEEK_CUR, rb_io_t::writeconv, and rb_io_t::writeconv_pre_ecflags.
Referenced by argf_next_argv(), io_reopen(), rb_io_init_copy(), and seek_before_access().
Definition at line 4905 of file io.c.
References GetWriteIO, and rb_io_ascii8bit_binmode().
Referenced by Init_IO(), and io_s_write().
Definition at line 4924 of file io.c.
References FMODE_BINMODE, GetOpenFile, rb_io_t::mode, Qfalse, and Qtrue.
Referenced by Init_IO().
|
inlinestatic |
ssize_t rb_io_bufread | ( | VALUE | io, |
void * | buf, | ||
size_t | size | ||
) |
Definition at line 2176 of file io.c.
References bufread_arg::fptr, GetOpenFile, io_bufread(), and rb_io_check_readable().
Definition at line 1448 of file io.c.
References binwrite_arg::fptr, GetOpenFile, io_binwrite(), and rb_io_check_writable().
Definition at line 3543 of file io.c.
References ID2SYM, rb_block_given_p(), rb_enumeratorize(), rb_intern, rb_io_each_byte(), and rb_warn().
Referenced by Init_IO().
Definition at line 3697 of file io.c.
References ID2SYM, rb_block_given_p(), rb_enumeratorize(), rb_intern, rb_io_each_char(), and rb_warn().
Referenced by Init_IO().
void rb_io_check_byte_readable | ( | rb_io_t * | fptr | ) |
Definition at line 813 of file io.c.
References rb_eIOError, rb_io_check_char_readable(), rb_raise(), and READ_CHAR_PENDING.
Referenced by copy_stream_body(), io_getpartial(), io_read(), io_read_nonblock(), rb_io_check_readable(), rb_io_each_byte(), rb_io_getbyte(), rb_io_sysread(), and rb_io_ungetbyte().
void rb_io_check_char_readable | ( | rb_io_t * | fptr | ) |
Definition at line 794 of file io.c.
References FMODE_READABLE, GetOpenFile, io_fflush(), rb_io_t::mode, rb_eIOError, rb_io_check_closed(), rb_raise(), rb_sys_fail(), rb_io_t::tied_io_for_writing, and rb_io_t::wbuf.
Referenced by io_read(), rb_io_check_byte_readable(), rb_io_each_char(), rb_io_each_codepoint(), rb_io_eof(), rb_io_getc(), rb_io_getline_0(), rb_io_lineno(), rb_io_set_lineno(), and rb_io_ungetc().
void rb_io_check_closed | ( | rb_io_t * | fptr | ) |
Definition at line 639 of file io.c.
References closed_stream, rb_io_t::fd, rb_eIOError, rb_io_check_initialized(), and rb_raise().
Referenced by bsock_getsockopt(), bsock_setsockopt(), io_binwrite(), io_binwrite_string(), io_bufread(), io_fflush(), io_fillbuf(), io_unread(), io_wait_readwrite(), rb_file_flock(), rb_io_autoclose_p(), rb_io_check_char_readable(), rb_io_check_writable(), rb_io_fileno(), rb_io_sysread(), rsock_s_recvfrom(), rsock_s_recvfrom_nonblock(), udp_bind_internal(), udp_connect_internal(), udp_send_internal(), and wait_for_single_fd().
void rb_io_check_initialized | ( | rb_io_t * | fptr | ) |
Definition at line 631 of file io.c.
References rb_eIOError, and rb_raise().
Referenced by prepare_readline(), rb_file_path(), rb_io_check_closed(), rb_io_get_fptr(), and rb_io_synchronized().
Definition at line 662 of file io.c.
References rb_check_convert_type(), and T_FILE.
Referenced by argf_external_encoding(), argf_internal_encoding(), check_exec_redirect(), copy_stream_body(), dump_output(), io_write(), rb_io_reopen(), and rb_io_s_try_convert().
void rb_io_check_readable | ( | rb_io_t * | fptr | ) |
Definition at line 822 of file io.c.
References rb_io_check_byte_readable().
Referenced by io_nread(), io_ready_p(), io_wait_readable(), ossl_ssl_setup(), and rb_io_bufread().
void rb_io_check_writable | ( | rb_io_t * | fptr | ) |
Definition at line 846 of file io.c.
References FMODE_WRITABLE, io_unread(), rb_io_t::mode, rb_eIOError, rb_io_check_closed(), rb_raise(), and rb_io_t::rbuf.
Referenced by copy_stream_body(), io_wait_writable(), io_write(), io_write_nonblock(), ossl_ssl_setup(), rb_io_bufwrite(), and rb_io_syswrite().
Definition at line 4469 of file io.c.
References fptr_waitpid(), io_close_fptr(), and Qnil.
Referenced by argf_next_argv(), bsock_close_read(), bsock_close_write(), console_dev(), gzfile_wrap(), io_s_write(), iseqw_s_compile_file(), load_file_internal(), pty_close_pty(), rb_f_backquote(), rb_gets(), rb_io_close_m(), rb_io_close_read(), rb_io_close_write(), rb_io_make_open_file(), rb_io_s_binread(), rb_io_s_foreach(), rb_io_s_pipe(), rb_io_s_read(), rb_io_s_readlines(), and restore_load_file().
Definition at line 4493 of file io.c.
References rb_io_t::fd, Qnil, rb_io_close(), and rb_io_get_fptr().
Referenced by copy_stream_finalize(), and Init_IO().
Definition at line 4590 of file io.c.
References FALSE, rb_io_t::fd, FMODE_DUPLEX, FMODE_READABLE, FMODE_WRITABLE, finish_writeconv_arg::fptr, GetWriteIO, is_socket, rb_io_t::mode, rb_io_t::pathv, rb_io_t::pid, Qnil, rb_eIOError, rb_io_close(), rb_io_fptr_cleanup(), rb_io_get_fptr(), rb_io_taint_check(), rb_raise(), rb_sys_fail_path, RFILE, SHUT_RD, shutdown, and rb_io_t::tied_io_for_writing.
Referenced by Init_IO().
Definition at line 4650 of file io.c.
References rb_io_t::fd, FMODE_DUPLEX, FMODE_READABLE, FMODE_WRITABLE, finish_writeconv_arg::fptr, GetWriteIO, is_socket, rb_io_t::mode, rb_io_t::pathv, Qnil, rb_eIOError, rb_io_close(), rb_io_get_fptr(), rb_io_taint_check(), rb_raise(), rb_sys_fail_path, SHUT_WR, shutdown, and rb_io_t::tied_io_for_writing.
Referenced by Init_IO().
Definition at line 4553 of file io.c.
References rb_io_t::fd, finish_writeconv_arg::fptr, GetWriteIO, Qfalse, Qtrue, rb_io_get_fptr(), and RFILE.
Referenced by argf_closed(), and Init_IO().
Definition at line 3825 of file io.c.
References ID2SYM, rb_block_given_p(), rb_enumeratorize(), rb_intern, rb_io_each_codepoint(), and rb_warn().
Referenced by Init_IO().
Definition at line 3518 of file io.c.
References errno, GetOpenFile, INT2FIX, getline_arg::io, io_fillbuf(), rb_io_check_byte_readable(), rb_yield(), rb_io_t::rbuf, READ_CHECK, and RETURN_ENUMERATOR.
Referenced by Init_IO(), and rb_io_bytes().
Definition at line 3674 of file io.c.
References GetOpenFile, getline_arg::io, io_getc(), io_input_encoding(), NIL_P, rb_io_check_char_readable(), rb_yield(), READ_CHECK, and RETURN_ENUMERATOR.
Referenced by Init_IO(), and rb_io_chars().
Definition at line 3722 of file io.c.
References rb_io_t::cbuf, clear_readconv(), rb_io_t::rb_io_enc_t::enc, rb_io_t::encs, GetOpenFile, getline_arg::io, io_fillbuf(), io_input_encoding(), make_readconv(), MBCLEN_CHARFOUND_LEN, MBCLEN_CHARFOUND_P, MBCLEN_INVALID_P, MBCLEN_NEEDMORE_LEN, MBCLEN_NEEDMORE_P, more_char(), MORE_CHAR_FINISHED, NEED_NEWLINE_DECORATOR_ON_READ_CHECK, NEED_READCONV, numberof, ONIGENC_CONSTRUCT_MBCLEN_CHARFOUND, rb_eArgError, rb_eIOError, rb_enc_codepoint, rb_enc_name, rb_enc_precise_mbclen(), rb_io_check_char_readable(), rb_raise(), rb_yield(), rb_io_t::rbuf, read_buffered_data(), READ_CHECK, RETURN_ENUMERATOR, SET_BINARY_MODE, and UINT2NUM.
Referenced by Init_IO(), and rb_io_codepoints().
Definition at line 3472 of file io.c.
References getline_arg::chomp, getline_arg::io, getline_arg::limit, NIL_P, prepare_getline_args(), rb_eArgError, rb_io_getline_1(), rb_raise(), rb_yield(), RETURN_ENUMERATOR, and getline_arg::rs.
Referenced by Init_IO(), and rb_io_lines().
Definition at line 1827 of file io.c.
References rb_io_t::fd, binwrite_arg::fptr, GetOpenFile, io_fillbuf(), NEED_NEWLINE_DECORATOR_ON_READ, NEED_READCONV, Qfalse, Qtrue, rb_io_check_char_readable(), READ_CHAR_PENDING, READ_CHECK, and READ_DATA_PENDING.
Referenced by argf_eof(), and Init_IO().
|
static |
Definition at line 5129 of file io.c.
References FMODE_SETENC_BY_BOM, NULL, Qnil, rb_ascii8bit_encoding(), rb_default_external_encoding(), and rb_default_internal_encoding().
Referenced by io_encoding_set(), parse_mode_enc(), rb_file_open_generic(), rb_file_open_internal(), rb_io_extract_encoding_option(), and rb_io_extract_modeenc().
Definition at line 10887 of file io.c.
References rb_io_t::rb_io_enc_t::enc, rb_io_t::rb_io_enc_t::enc2, rb_io_t::encs, FMODE_WRITABLE, GetOpenFile, io_read_encoding(), rb_io_t::mode, Qnil, and rb_enc_from_encoding().
Referenced by argf_external_encoding(), and Init_IO().
int rb_io_extract_encoding_option | ( | VALUE | opt, |
rb_encoding ** | enc_p, | ||
rb_encoding ** | enc2_p, | ||
int * | fmode_p | ||
) |
Definition at line 5231 of file io.c.
References NIL_P, NULL, parse_mode_enc(), PRIsVALUE, Qnil, Qundef, rb_check_string_type(), rb_enc_from_encoding(), rb_enc_from_index(), rb_enc_get(), rb_hash_lookup2(), rb_io_ext_int_to_encs(), rb_to_encoding(), rb_to_encoding_index(), rb_warn(), ruby_verbose, StringValueCStr, sym_encoding, sym_extenc, and sym_intenc.
Referenced by rb_gzfile_ecopts(), and rb_io_extract_modeenc().
|
static |
Definition at line 5355 of file io.c.
References DEFAULT_TEXTMODE, ECONV_DEFAULT_NEWLINE_DECORATOR, ECONV_UNIVERSAL_NEWLINE_DECORATOR, extract_binmode(), fmode, FMODE_BINMODE, FMODE_READABLE, FMODE_WRITABLE, INT2NUM, MODE_BTMODE, NIL_P, NULL, NUM2INT, O_BINARY, parse_mode_enc(), Qnil, rb_ascii8bit_encoding(), rb_check_to_integer(), rb_eArgError, rb_econv_prepare_options(), rb_enc_get(), rb_hash_aref(), rb_io_ext_int_to_encs(), rb_io_extract_encoding_option(), rb_io_fmode_oflags(), rb_io_modestr_fmode(), rb_io_oflags_fmode(), rb_raise(), rb_to_int(), SafeStringValue, SET_UNIVERSAL_NEWLINE_DECORATOR_IF_ENC2, strchr(), StringValueCStr, sym_flags, sym_mode, sym_perm, and validate_enc_binmode().
Referenced by rb_io_initialize(), rb_io_open(), rb_io_reopen(), rb_io_s_popen(), and rb_scan_open_args().
Definition at line 7453 of file io.c.
References prep_io(), rb_cFile, rb_cIO, and rb_io_oflags_fmode().
Referenced by open_load_file().
Definition at line 1999 of file io.c.
References rb_io_t::fd, INT2FIX, rb_io_check_closed(), and RFILE.
Referenced by argf_fileno(), and Init_IO().
Definition at line 1590 of file io.c.
References rb_io_flush_raw().
Referenced by dump_output(), dump_result(), Init_IO(), process_options(), rb_f_p_internal(), rb_io_getbyte(), rb_io_init_copy(), and rb_io_s_popen().
Definition at line 1551 of file io.c.
References FMODE_READABLE, FMODE_WRITABLE, binwrite_arg::fptr, GetOpenFile, GetWriteIO, id_flush, io_fflush(), io_unread(), rb_io_t::mode, rb_funcall(), rb_sys_fail(), RB_TYPE_P, and T_FILE.
Referenced by rb_file_flock(), rb_file_size(), and rb_io_flush().
|
static |
Definition at line 4932 of file io.c.
References FMODE_APPEND, FMODE_CREATE, FMODE_READABLE, FMODE_READWRITE, FMODE_WRITABLE, MODE_BTMODE, rb_eArgError, and rb_raise().
Referenced by io_reopen(), and rb_io_reopen().
|
static |
Definition at line 5051 of file io.c.
References FMODE_APPEND, FMODE_BINMODE, FMODE_CREATE, FMODE_READABLE, FMODE_READWRITE, FMODE_TRUNC, FMODE_WRITABLE, and O_BINARY.
Referenced by rb_file_open_internal(), rb_io_extract_modeenc(), rb_io_modestr_oflags(), rb_io_reopen(), and rb_io_stdio_file().
|
static |
Definition at line 4352 of file io.c.
References rb_io_t::finalize, and fptr_finalize().
Referenced by io_close_fptr(), rb_io_close_read(), and rb_io_fptr_finalize().
int rb_io_fptr_finalize | ( | rb_io_t * | fptr | ) |
Definition at line 4399 of file io.c.
References clear_codeconv(), rb_io_t::fd, free, free_io_buffer(), rb_io_t::pathv, Qnil, rb_io_fptr_cleanup(), rb_io_t::rbuf, RUBY_FUNC_EXPORTED, TRUE, rb_io_t::wbuf, and rb_io_t::write_lock.
Referenced by make_io_zombie(), pipe_del_fptr(), rb_f_backquote(), and rb_io_make_open_file().
|
inlinestatic |
Definition at line 7500 of file io.c.
References ALLOC, rb_io_t::cbuf, rb_io_t::rb_io_enc_t::ecflags, rb_io_t::rb_io_enc_t::ecopts, rb_io_t::rb_io_enc_t::enc, rb_io_t::rb_io_enc_t::enc2, rb_io_t::encs, rb_io_t::fd, rb_io_t::finalize, rb_io_t::lineno, rb_io_t::mode, NULL, rb_io_t::pathv, rb_io_t::pid, Qnil, rb_io_buffer_init(), rb_io_t::rbuf, rb_io_t::readconv, rb_io_t::stdio_file, rb_io_t::tied_io_for_writing, rb_io_t::wbuf, rb_io_t::write_lock, rb_io_t::writeconv, rb_io_t::writeconv_asciicompat, rb_io_t::writeconv_initialized, rb_io_t::writeconv_pre_ecflags, and rb_io_t::writeconv_pre_ecopts.
Referenced by rb_io_make_open_file().
Definition at line 648 of file io.c.
References rb_io_check_initialized(), and RFILE.
Referenced by rb_io_close_m(), rb_io_close_read(), rb_io_close_write(), rb_io_closed(), rb_io_get_write_io(), and rb_io_set_write_io().
Definition at line 656 of file io.c.
References rb_convert_type(), and T_FILE.
Referenced by io_reopen(), rb_io_init_copy(), and select_internal().
Definition at line 668 of file io.c.
References rb_io_get_fptr(), and rb_io_t::tied_io_for_writing.
Referenced by dump_output(), and io_getch().
Definition at line 3896 of file io.c.
References rb_io_t::fd, FMODE_TTY, GetOpenFile, INT2FIX, io_fillbuf(), rb_io_t::mode, Qnil, rb_io_check_byte_readable(), rb_io_flush(), rb_stdout, RB_TYPE_P, rb_io_t::rbuf, READ_CHECK, and T_FILE.
Referenced by argf_getbyte(), Init_IO(), io_strip_bom(), load_file_internal(), and rb_io_readbyte().
Definition at line 3847 of file io.c.
References GetOpenFile, io_getc(), io_input_encoding(), rb_io_check_char_readable(), and READ_CHECK.
Referenced by argf_getc(), argf_readchar(), Init_IO(), and rb_io_readchar().
Definition at line 3252 of file io.c.
References getline_arg::chomp, getline_arg::limit, prepare_getline_args(), rb_io_getline_1(), and getline_arg::rs.
Referenced by argf_getline(), and rb_io_gets_m().
Definition at line 3123 of file io.c.
References appendline(), EOF, io_enc_str(), io_read_encoding(), rb_io_t::lineno, MBCLEN_NEEDMORE_P, memcmp(), NEED_NEWLINE_DECORATOR_ON_READ_CHECK, NEED_READCONV, NIL_P, OBJ_FREEZE, Qnil, rb_default_rs, rb_enc_asciicompat, rb_enc_from_encoding(), rb_enc_left_char_head, rb_enc_precise_mbclen(), rb_enc_str_new(), rb_io_check_char_readable(), rb_io_getline_fast(), rb_str_chomp_string(), rb_str_encode(), rb_str_set_len(), rb_usascii_str_new(), read_all(), rscheck(), RSTRING_END, RSTRING_LEN, RSTRING_PTR, SET_BINARY_MODE, and swallow().
Referenced by rb_io_getline_1(), and rb_io_gets_internal().
Definition at line 3229 of file io.c.
References ARGF, GetOpenFile, rb_io_t::lineno, NIL_P, and rb_io_getline_0().
Referenced by io_readlines(), io_s_foreach(), rb_io_each_line(), rb_io_getline(), and rb_io_gets().
|
static |
Definition at line 2987 of file io.c.
References ENC_CODERANGE_BROKEN, ENC_CODERANGE_SET, io_enc_str(), io_fillbuf(), len, rb_io_t::lineno, NIL_P, Qnil, rb_str_coderange_scan_restartable(), rb_str_new(), rb_str_resize(), rb_io_t::rbuf, read_buffered_data(), READ_CHECK, READ_DATA_PENDING_COUNT, READ_DATA_PENDING_PTR, and RSTRING_PTR.
Referenced by rb_io_getline_0().
Definition at line 3261 of file io.c.
References FALSE, rb_default_rs, and rb_io_getline_1().
Referenced by argf_getline(), io_getch(), load_file_internal(), parser_compile_error(), and rb_gets().
Definition at line 3267 of file io.c.
References FALSE, GetOpenFile, rb_default_rs, and rb_io_getline_0().
Referenced by lex_io_gets(), and rb_parser_compile_cstr().
Definition at line 3308 of file io.c.
References rb_io_getline(), and rb_lastline_set().
Referenced by Init_IO(), and rb_io_readline().
Definition at line 6924 of file io.c.
References rb_io_t::encs, rb_io_t::fd, rb_io_t::finalize, FMODE_BINMODE, FMODE_PREP, GetOpenFile, GetWriteIO, io_seek, io_tell, rb_io_t::lineno, MakeOpenFile, rb_io_t::mode, NIL_P, OBJ_INIT_COPY, off_t, rb_io_t::pathv, rb_io_t::pid, pipe_add_fptr(), pipe_finalize(), rb_intern, rb_io_binmode(), rb_io_flush(), rb_io_get_io(), rb_ivar_set(), rb_obj_dup(), ruby_dup(), SEEK_SET, and rb_io_t::tied_io_for_writing.
Referenced by Init_IO().
Definition at line 7695 of file io.c.
References clear_codeconv(), rb_io_t::encs, fcntl(), rb_io_t::fd, fileno, fmode, FMODE_PREP, FMODE_READWRITE, FMODE_SETENC_BY_BOM, fstat, INT2FIX, io_check_tty(), io_set_encoding_by_bom(), MakeOpenFile, rb_io_t::mode, NIL_P, NUM2INT, Qfalse, rb_class_new_instance(), rb_eArgError, rb_eSystemCallError, rb_exc_raise(), rb_hash_aref(), rb_io_extract_modeenc(), rb_io_oflags_fmode(), rb_raise(), rb_reserved_fd_p(), rb_scan_args(), rb_sys_fail(), rb_update_max_fd(), stat, rb_io_t::stdio_file, and sym_autoclose.
Referenced by Init_IO(), rb_file_initialize(), and rb_io_s_for_fd().
Definition at line 2050 of file io.c.
References CLASS_OF, rb_io_t::fd, binwrite_arg::fptr, NIL_P, rb_io_t::pathv, rb_any_to_s(), rb_class_name(), rb_str_append(), rb_str_cat(), rb_str_cat2(), rb_str_catf(), rb_str_new_cstr(), result, RFILE, and strlen().
Referenced by Init_IO().
Definition at line 10912 of file io.c.
References rb_io_t::rb_io_enc_t::enc2, rb_io_t::encs, GetOpenFile, io_read_encoding(), Qnil, and rb_enc_from_encoding().
Referenced by argf_internal_encoding(), Init_IO(), io_check_tty(), and io_set_encoding_by_bom().
Definition at line 4049 of file io.c.
References F_GETFD, fcntl(), rb_io_t::fd, FD_CLOEXEC, GetOpenFile, GetWriteIO, getline_arg::io, rb_io_t::pathv, Qfalse, Qtrue, rb_io_close_on_exec_p, and rb_sys_fail_path.
Referenced by Init_IO().
Definition at line 3341 of file io.c.
References GetOpenFile, INT2NUM, rb_io_t::lineno, and rb_io_check_char_readable().
Referenced by Init_IO().
Definition at line 3492 of file io.c.
References ID2SYM, rb_block_given_p(), rb_enumeratorize(), rb_intern, rb_io_each_line(), and rb_warn().
Referenced by Init_IO().
Definition at line 7529 of file io.c.
References Check_Type, rb_io_close(), rb_io_fptr_finalize(), rb_io_fptr_new(), RFILE, and T_FILE.
RUBY_FUNC_EXPORTED size_t rb_io_memsize | ( | const rb_io_t * | fptr | ) |
Definition at line 4414 of file io.c.
References rb_io_t::cbuf, rb_econv_memsize(), rb_notify_fd_close(), rb_io_t::rbuf, rb_io_t::readconv, size, rb_io_t::wbuf, and rb_io_t::writeconv.
Referenced by obj_memsize_of().
int rb_io_modestr_fmode | ( | const char * | modestr | ) |
Definition at line 4967 of file io.c.
References fmode, FMODE_APPEND, FMODE_BINMODE, FMODE_CREATE, FMODE_READABLE, FMODE_READWRITE, FMODE_SETENC_BY_BOM, FMODE_TEXTMODE, FMODE_TRUNC, FMODE_WRITABLE, io_encname_bom_p(), NULL, rb_eArgError, rb_raise(), strchr(), and strlen().
Referenced by pty_getpty(), rb_file_open_internal(), rb_io_extract_modeenc(), rb_io_modestr_oflags(), and strio_init().
int rb_io_modestr_oflags | ( | const char * | modestr | ) |
Definition at line 5086 of file io.c.
References rb_io_fmode_oflags(), and rb_io_modestr_fmode().
Referenced by check_exec_redirect(), and rb_io_s_sysopen().
int rb_io_oflags_fmode | ( | int | oflags | ) |
Definition at line 5016 of file io.c.
References fmode, FMODE_APPEND, FMODE_BINMODE, FMODE_CREATE, FMODE_READABLE, FMODE_READWRITE, FMODE_TRUNC, FMODE_WRITABLE, O_ACCMODE, and O_BINARY.
Referenced by rb_io_extract_modeenc(), rb_io_fdopen(), rb_io_initialize(), and strio_init().
|
static |
Definition at line 5092 of file io.c.
References MODE_BINARY, rb_eArgError, and rb_raise().
Referenced by rb_io_open_generic(), rb_io_reopen(), rb_io_s_popen(), and rb_io_stdio_file().
Definition at line 6683 of file io.c.
References fmode, mode_t, NIL_P, NUM2MODET, rb_io_extract_modeenc(), and rb_io_open_generic().
Referenced by open_key_args().
|
static |
Definition at line 6695 of file io.c.
References check_pipe_command(), rb_execarg::cmd, io_alloc(), NIL_P, pipe_open_s(), rb_cFile, rb_file_open_generic(), and rb_io_oflags_modestr().
Referenced by rb_f_open(), rb_io_open(), and rb_io_s_binread().
Definition at line 6709 of file io.c.
References io_alloc(), rb_cFile, and rb_open_file().
Referenced by open_key_args().
Definition at line 2031 of file io.c.
References binwrite_arg::fptr, GetOpenFile, rb_io_t::pid, PIDT2NUM, and Qnil.
Referenced by Init_IO().
Definition at line 7040 of file io.c.
References argc, NIL_P, Qnil, rb_io_write(), rb_lastline_get(), rb_output_fs, and rb_output_rs.
Referenced by Init_IO(), and rb_f_print().
Definition at line 6979 of file io.c.
References Qnil, rb_f_sprintf(), and rb_io_write().
Referenced by Init_IO().
Definition at line 7113 of file io.c.
References NUM2CHR, rb_io_write(), rb_str_new(), rb_str_substr(), RB_TYPE_P, and T_STRING.
Referenced by Init_IO(), and rb_f_putc().
Definition at line 7212 of file io.c.
References argc, io_puts_ary(), Qnil, rb_default_rs, rb_exec_recursive(), rb_io_write(), rb_obj_as_string(), RB_TYPE_P, RSTRING_LEN, str_end_with_asciichar(), and T_STRING.
Referenced by Init_IO(), io_puts_ary(), rb_f_abort(), rb_f_puts(), and rb_warn_m().
void rb_io_read_check | ( | rb_io_t * | fptr | ) |
Definition at line 867 of file io.c.
References rb_io_t::fd, rb_thread_wait_fd(), and READ_DATA_PENDING.
int rb_io_read_pending | ( | rb_io_t * | fptr | ) |
Definition at line 858 of file io.c.
References READ_CHAR_PENDING, and READ_DATA_PENDING.
Referenced by io_nread(), io_ready_p(), io_wait_readable(), io_wait_readwrite(), rsock_s_recvfrom(), and rsock_s_recvfrom_nonblock().
Definition at line 3929 of file io.c.
References NIL_P, rb_eof_error(), and rb_io_getbyte().
Referenced by Init_IO().
Definition at line 3873 of file io.c.
References NIL_P, rb_eof_error(), and rb_io_getc().
Referenced by Init_IO().
Definition at line 3389 of file io.c.
References getline_arg::io, io_readlines(), NIL_P, rb_eof_error(), and rb_io_gets_m().
Referenced by Init_IO().
Definition at line 3420 of file io.c.
References io_readlines(), and prepare_getline_args().
Referenced by argf_readlines(), and Init_IO().
Definition at line 6835 of file io.c.
References rb_io_t::encs, err, errno, rb_io_t::fd, fileno, FilePathValue, fmode, FMODE_READWRITE, FMODE_WRITABLE, io_fflush(), io_reopen(), IS_PREP_STDIO, rb_io_t::mode, NIL_P, NULL, rb_io_t::pathv, PREP_STDIO_NAME, PRIsVALUE, rb_cloexec_dup2(), rb_eArgError, rb_fd_fix_cloexec(), rb_freopen(), rb_io_check_io(), rb_io_extract_modeenc(), rb_io_fmode_modestr(), rb_io_fmode_oflags(), rb_io_oflags_modestr(), rb_io_taint_check(), rb_raise(), rb_scan_args(), rb_str_encode_ospath(), rb_sys_fail(), rb_syserr_fail_path, rb_sysopen(), rb_warn(), rb_io_t::rbuf, RFILE, rb_io_t::stdio_file, and ZALLOC.
Referenced by Init_IO().
Definition at line 1735 of file io.c.
References ARGF, clear_readconv(), errno, binwrite_arg::fptr, GetOpenFile, INT2FIX, io_seek, L, rb_io_t::lineno, rb_io_t::pathv, rb_sys_fail_path, and rb_io_t::readconv.
Referenced by argf_rewind(), and Init_IO().
Definition at line 10001 of file io.c.
References foreach_arg::argc, foreach_arg::argv, FilePathValue, fmode, FMODE_BINMODE, FMODE_READABLE, foreach_arg::io, seek_arg::io, io_s_read(), seek_arg::mode, NIL_P, NULL, O_BINARY, seek_arg::offset, Qnil, rb_ascii8bit_encoding(), rb_ensure(), rb_io_close(), rb_io_open_generic(), rb_jump_tag(), rb_protect(), rb_scan_args(), seek_before_access(), and SEEK_SET.
Referenced by Init_IO().
Definition at line 10850 of file io.c.
References copy_stream_struct::copy_length, copy_stream_body(), copy_stream_finalize(), copy_stream_struct::dst, copy_stream_struct::fds, MEMZERO, NIL_P, NUM2OFFT, off_t, OFFT2NUM, rb_ensure(), rb_fd_init, rb_scan_args(), copy_stream_struct::src, and copy_stream_struct::src_offset.
Referenced by Init_IO().
Definition at line 7816 of file io.c.
References rb_io_initialize(), and rb_obj_alloc().
Referenced by Init_IO().
Definition at line 9842 of file io.c.
References argc, check_getline_args(), extract_getline_args(), extract_getline_opts(), getline_arg::io, foreach_arg::io, io_s_foreach(), getline_arg::limit, NIL_P, NULL, open_key_args(), Qnil, rb_ensure(), rb_io_close(), rb_scan_args(), RETURN_ENUMERATOR, and getline_arg::rs.
Referenced by Init_IO().
Definition at line 7795 of file io.c.
References PRIsVALUE, rb_block_given_p(), rb_class_new_instance(), rb_obj_as_string(), and rb_warn().
Referenced by Init_IO().
Definition at line 6481 of file io.c.
References io_close(), rb_block_given_p(), rb_class_new_instance(), rb_ensure(), and rb_yield().
Referenced by Init_IO(), and rb_f_open().
Definition at line 9681 of file io.c.
References rb_io_t::rb_io_enc_t::ecflags, ECONV_DEFAULT_NEWLINE_DECORATOR, ECONV_UNIVERSAL_NEWLINE_DECORATOR, rb_io_t::encs, extract_binmode(), rb_io_t::fd, fmode, FMODE_BINMODE, FMODE_TEXTMODE, io_encoding_set_args::fptr, GetOpenFile, INT2FIX, INT2NUM, io_close(), io_encoding_set_v(), io_new_instance(), rb_io_t::mode, NIL_P, O_BINARY, io_encoding_set_args::opt, pipe_pair_close(), rb_assoc_new(), rb_block_given_p(), rb_ensure(), rb_io_close(), rb_io_synchronized(), rb_jump_tag(), rb_pipe(), rb_protect(), rb_scan_args(), rb_sys_fail(), rb_yield(), io_encoding_set_args::v1, and io_encoding_set_args::v2.
Referenced by Init_IO().
Definition at line 6341 of file io.c.
References argc, argf::argv, env, FALSE, fmode, is_popen_fork(), len, NIL_P, pipe_close(), pipe_open(), Qnil, RARRAY_CONST_PTR, RARRAY_LEN, rb_block_given_p(), rb_check_array_type(), rb_check_hash_type(), rb_eArgError, rb_ensure(), rb_error_arity(), rb_execarg_extract_options(), rb_execarg_new(), rb_execarg_setenv(), RB_GC_GUARD, rb_io_extract_modeenc(), rb_io_flush(), rb_io_oflags_modestr(), rb_raise(), rb_stderr, rb_stdout, rb_yield(), RBASIC_SET_CLASS, SafeStringValue, and TRUE.
Referenced by Init_IO(), and rb_f_open().
Definition at line 9962 of file io.c.
References foreach_arg::argc, foreach_arg::io, seek_arg::io, io_s_read(), seek_arg::mode, NIL_P, NULL, seek_arg::offset, open_key_args(), Qnil, rb_ensure(), rb_io_close(), rb_jump_tag(), rb_protect(), rb_scan_args(), seek_before_access(), and SEEK_SET.
Referenced by Init_IO().
Definition at line 9884 of file io.c.
References check_getline_args(), extract_getline_args(), extract_getline_opts(), getline_arg::io, foreach_arg::io, io_s_readlines(), getline_arg::limit, NIL_P, NULL, open_key_args(), Qnil, rb_ensure(), rb_io_close(), rb_scan_args(), and getline_arg::rs.
Referenced by Init_IO().
Definition at line 6503 of file io.c.
References FilePathValue, INT2NUM, mode_t, NIL_P, NUM2INT, NUM2MODET, rb_check_to_integer(), RB_GC_GUARD, rb_io_modestr_oflags(), rb_scan_args(), rb_str_new4, rb_sysopen(), SafeStringValue, and StringValueCStr.
Referenced by Init_IO().
Definition at line 1622 of file io.c.
References errno, binwrite_arg::fptr, GetOpenFile, INT2FIX, io_seek, NUM2OFFT, off_t, rb_io_t::pathv, and rb_sys_fail_path.
Referenced by rb_io_seek_m(), and seek_before_access().
Definition at line 1677 of file io.c.
References interpret_seek_whence(), rb_io_seek(), rb_scan_args(), and SEEK_SET.
Referenced by argf_seek_m(), and Init_IO().
Definition at line 7857 of file io.c.
References FMODE_PREP, GetOpenFile, rb_io_t::mode, and RTEST.
Referenced by Init_IO().
Definition at line 10941 of file io.c.
References GetOpenFile, id_set_encoding, io_encoding_set(), rb_funcallv, rb_scan_args(), RB_TYPE_P, and T_FILE.
Referenced by argf_set_encoding(), Init_IO(), and rb_stdio_set_default_encoding().
Definition at line 3368 of file io.c.
References GetOpenFile, rb_io_t::lineno, argf::lineno, NUM2INT, and rb_io_check_char_readable().
Referenced by Init_IO().
void rb_io_set_nonblock | ( | rb_io_t * | fptr | ) |
Definition at line 2458 of file io.c.
References F_SETFL, fcntl(), rb_io_t::fd, O_NONBLOCK, rb_io_t::pathv, rb_sys_fail_path, and rb_w32_set_nonblock().
Referenced by io_getpartial(), io_read_nonblock(), io_write_nonblock(), rsock_s_accept_nonblock(), rsock_s_recvfrom_nonblock(), and sock_connect_nonblock().
Definition at line 1703 of file io.c.
References clear_readconv(), errno, binwrite_arg::fptr, GetOpenFile, io_seek, NUM2OFFT, off_t, OFFT2NUM, rb_io_t::pathv, rb_sys_fail_path, and SEEK_SET.
Referenced by argf_set_pos(), and Init_IO().
Definition at line 1934 of file io.c.
References rb_io_t::fd, binwrite_arg::fptr, GetOpenFile, GetWriteIO, INT2FIX, io_fflush(), binwrite_arg::ptr, rb_io_fdatasync, rb_io_fsync, rb_notimplement(), rb_sys_fail(), rb_thread_io_blocking_region(), rb_w32_get_osfhandle(), and UNREACHABLE.
Referenced by Init_IO(), and rb_io_sync().
Definition at line 679 of file io.c.
References GetWriteIO, Qnil, rb_io_get_fptr(), RTEST, and rb_io_t::tied_io_for_writing.
Referenced by argf_close(), and argf_next_argv().
Definition at line 7481 of file io.c.
References rb_io_t::fd, rb_io_t::mode, rb_fdopen(), rb_io_fmode_oflags(), rb_io_oflags_modestr(), and rb_io_t::stdio_file.
Referenced by dump_output(), and rb_fiddle_ptr_s_to_ptr().
Definition at line 1862 of file io.c.
References rb_io_t::fd, FMODE_SYNC, binwrite_arg::fptr, GetOpenFile, GetWriteIO, INT2FIX, io_fflush(), rb_io_t::mode, rb_io_t::pathv, Qfalse, Qtrue, rb_io_fsync, rb_io_set_sync(), rb_sys_fail(), rb_sys_fail_path, rb_thread_io_blocking_region(), and RTEST.
void rb_io_synchronized | ( | rb_io_t * | fptr | ) |
Definition at line 5809 of file io.c.
References FMODE_SYNC, rb_io_t::mode, and rb_io_check_initialized().
Referenced by pipe_open(), rb_io_s_pipe(), rb_io_unbuffered(), and rsock_init_sock().
Definition at line 4784 of file io.c.
References rb_io_t::fd, read_internal_arg::fd, finish_writeconv_arg::fptr, GetOpenFile, io_set_read_length(), io_setstrbuf(), len, read_internal_arg::len, NUM2LONG, OBJ_TAINT, rb_io_t::pathv, rb_eIOError, rb_ensure(), rb_eof_error(), rb_io_check_byte_readable(), rb_io_check_closed(), rb_raise(), rb_scan_args(), rb_str_locktmp(), rb_str_unlocktmp(), rb_sys_fail_path, rb_thread_wait_fd(), READ_DATA_BUFFERED, read_internal_call(), RSTRING_PTR, and read_internal_arg::str_ptr.
Referenced by Init_IO().
Definition at line 4696 of file io.c.
References errno, rb_io_t::fd, FMODE_READABLE, FMODE_WRITABLE, finish_writeconv_arg::fptr, GetOpenFile, interpret_seek_whence(), rb_io_t::mode, NUM2OFFT, off_t, OFFT2NUM, rb_io_t::pathv, rb_eIOError, rb_raise(), rb_scan_args(), rb_sys_fail_path, rb_warn(), READ_CHAR_PENDING, READ_DATA_BUFFERED, SEEK_SET, and rb_io_t::wbuf.
Referenced by Init_IO().
Definition at line 4736 of file io.c.
References rb_io_t::fd, finish_writeconv_arg::fptr, GetOpenFile, GetWriteIO, len, LONG2FIX, rb_io_t::pathv, rb_io_check_writable(), rb_obj_as_string(), rb_str_tmp_frozen_acquire(), rb_str_tmp_frozen_release(), rb_sys_fail_path, RB_TYPE_P, rb_warn(), rb_write_internal(), RSTRING_GETMEM, T_STRING, and rb_io_t::wbuf.
Referenced by Init_IO().
Definition at line 624 of file io.c.
References rb_check_frozen.
Referenced by get_strio(), prepare_readline(), rb_file_path(), rb_io_close_read(), rb_io_close_write(), rb_io_reopen(), strio_reopen(), and strio_set_string().
Definition at line 1609 of file io.c.
References errno, binwrite_arg::fptr, GetOpenFile, io_tell, off_t, OFFT2NUM, rb_io_t::pathv, rb_sys_fail_path, and rb_io_t::rbuf.
Referenced by argf_tell(), and Init_IO().
void rb_io_unbuffered | ( | rb_io_t * | fptr | ) |
Definition at line 5816 of file io.c.
References rb_io_synchronized().
Definition at line 3957 of file io.c.
References FIX2INT, FIXNUM_P, GetOpenFile, io_ungetbyte(), NIL_P, Qnil, rb_io_check_byte_readable(), rb_str_new(), and SafeStringValue.
Referenced by Init_IO(), io_strip_bom(), and load_file_internal().
Definition at line 3992 of file io.c.
References rb_io_t::cbuf, FIX2UINT, FIXNUM_P, GetOpenFile, io_read_encoding(), io_ungetbyte(), len, make_readconv(), MEMMOVE, NEED_NEWLINE_DECORATOR_ON_READ_CHECK, NEED_READCONV, NIL_P, NUM2UINT, Qnil, rb_eIOError, rb_enc_uint_chr(), rb_io_check_char_readable(), rb_raise(), RB_TYPE_P, RSTRING_LEN, RSTRING_PTR, SafeStringValue, SET_BINARY_MODE, and T_BIGNUM.
Referenced by Init_IO().
int rb_io_wait_readable | ( | int | f | ) |
Definition at line 1104 of file io.c.
References closed_stream, errno, EWOULDBLOCK, FALSE, rb_eIOError, rb_raise(), rb_thread_check_ints(), rb_thread_wait_fd(), and TRUE.
Referenced by io_bufread(), io_fillbuf(), io_getpartial(), ossl_ssl_read_internal(), ossl_ssl_write_internal(), ossl_start_ssl(), rsock_s_accept(), and rsock_s_recvfrom().
int rb_io_wait_writable | ( | int | f | ) |
Definition at line 1130 of file io.c.
References closed_stream, errno, EWOULDBLOCK, FALSE, rb_eIOError, rb_raise(), rb_thread_check_ints(), rb_thread_fd_writable(), and TRUE.
Referenced by finish_writeconv(), io_binwrite(), io_fflush(), ossl_ssl_read_internal(), ossl_ssl_write_internal(), ossl_start_ssl(), rsock_bsock_send(), and udp_send_internal().
Definition at line 1508 of file io.c.
References id_write, and rb_funcallv.
Referenced by argf_write(), copy_stream_body(), copy_stream_fallback_body(), gc_profile_report(), io_getch(), oldbt_print_to(), process_options(), rb_f_printf(), rb_io_addstr(), rb_io_print(), rb_io_printf(), rb_io_putc(), rb_io_puts(), rb_marshal_dump_limited(), rb_obj_display(), rb_p(), rb_parser_printf(), rb_write_error2(), rb_write_error_str(), show_bitstack(), trace_lex_state(), and w_nbyte().
void rb_maygvl_fd_fix_cloexec | ( | int | fd | ) |
Definition at line 208 of file io.c.
References errno, F_GETFD, F_SETFD, fcntl(), FD_CLOEXEC, rb_bug(), and strerror().
Referenced by cloexec_accept(), rb_cloexec_dup2(), rb_cloexec_fcntl_dupfd(), rb_cloexec_open(), rb_cloexec_pipe(), rb_fd_fix_cloexec(), rb_fix_detect_o_cloexec(), rsock_detect_cloexec(), and sock_initialize().
int rb_notify_fd_close | ( | int | fd | ) |
Definition at line 2200 of file thread.c.
References err, waiting_fd::fd, GET_THREAD, rb_threadptr_interrupt(), rb_threadptr_pending_interrupt_enque(), ruby_error_stream_closed, rb_vm_struct::special_exceptions, waiting_fd::th, rb_thread_struct::vm, rb_vm_struct::waiting_fds, and waiting_fd::wfd_node.
Referenced by io_close_fptr(), io_reopen(), rb_io_memsize(), and rb_thread_fd_close().
Definition at line 7357 of file io.c.
References Qnil, rb_io_write(), rb_scan_args(), and rb_stdout.
Referenced by Init_IO().
Definition at line 6430 of file io.c.
References fmode, mode_t, rb_file_open_generic(), and rb_scan_open_args().
Referenced by rb_file_initialize(), and rb_io_open_with_args().
void rb_p | ( | VALUE | obj | ) |
Definition at line 7261 of file io.c.
References CLASS_OF, id_write, io_write(), rb_default_rs, rb_inspect(), rb_io_write(), rb_method_basic_definition_p(), rb_obj_as_string(), rb_stdout, RB_TYPE_P, and T_FILE.
Referenced by ibf_dump_object_class(), and rb_f_p_internal().
int rb_pipe | ( | int * | pipes | ) |
Definition at line 5822 of file io.c.
References buf, dup2(), err, errno, F_GETFD, F_SETFD, fcntl(), FD_CLOEXEC, FMODE_READABLE, FMODE_WRITABLE, INT2FIX, max(), max_file_descriptor, memcmp(), NIL_P, NULL, Qnil, rb_cloexec_open(), rb_cloexec_pipe(), rb_close_before_exec(), rb_exec_async_signal_safe(), rb_execarg_commandline(), rb_execarg_parent_start(), rb_gc_for_fd(), rb_hash_lookup(), rb_update_max_fd(), RTEST, and ruby_strtoul().
Referenced by pipe_open(), rb_exec_async_signal_safe(), and rb_io_s_pipe().
|
static |
Definition at line 969 of file io.c.
References io_internal_read_struct::buf, buf, io_internal_read_struct::capa, count, io_internal_read_struct::fd, internal_read_func(), and rb_thread_io_blocking_region().
Referenced by io_bufread(), io_fillbuf(), maygvl_read(), and read_internal_call().
void rb_readwrite_sys_fail | ( | enum rb_io_wait_readwrite | writable, |
const char * | mesg | ||
) |
Definition at line 12122 of file io.c.
References errno, and rb_readwrite_syserr_fail().
void rb_readwrite_syserr_fail | ( | enum rb_io_wait_readwrite | writable, |
int | n, | ||
const char * | mesg | ||
) |
Definition at line 12128 of file io.c.
References EINPROGRESS, EWOULDBLOCK, Qnil, rb_bug(), rb_class_new_instance(), rb_eEAGAINWaitReadable, rb_eEAGAINWaitWritable, rb_eEINPROGRESSWaitReadable, rb_eEINPROGRESSWaitWritable, rb_eEWOULDBLOCKWaitReadable, rb_eEWOULDBLOCKWaitWritable, rb_exc_raise(), RB_IO_WAIT_READABLE, RB_IO_WAIT_WRITABLE, rb_mod_sys_fail_str(), rb_mWaitReadable, rb_mWaitWritable, and rb_str_new2.
Referenced by io_getpartial(), io_read_nonblock(), io_write_nonblock(), rb_readwrite_sys_fail(), rsock_s_accept_nonblock(), rsock_s_recvfrom_nonblock(), and sock_connect_nonblock().
|
static |
Definition at line 6408 of file io.c.
References FilePathValue, fmode, mode_t, NIL_P, NUM2MODET, rb_io_extract_modeenc(), and rb_scan_args().
Referenced by rb_open_file().
void rb_stdio_set_default_encoding | ( | void | ) |
Definition at line 10957 of file io.c.
References Qnil, rb_io_set_encoding(), rb_stderr, rb_stdin, rb_stdout, and val.
Referenced by process_options().
Definition at line 5513 of file io.c.
References errno, sysopen_struct::fname, sysopen_struct::oflags, sysopen_struct::perm, rb_gc_for_fd(), rb_str_encode_ospath(), rb_syserr_fail_path, rb_sysopen_internal(), and StringValueCStr.
Referenced by argf_next_argv(), rb_file_open_generic(), rb_io_reopen(), and rb_io_s_sysopen().
|
inlinestatic |
Definition at line 5503 of file io.c.
References rb_thread_call_without_gvl(), rb_update_max_fd(), RUBY_UBF_IO, and sysopen_func().
Referenced by rb_sysopen().
void rb_update_max_fd | ( | int | fd | ) |
Definition at line 189 of file io.c.
References ATOMIC_CAS, errno, fstat, max_file_descriptor, rb_bug(), and stat.
Referenced by chfunc(), console_dev(), get_device_once(), io_reopen(), open_load_file(), prep_io(), pty_getpty(), rb_exec_async_signal_safe(), rb_execarg_parent_start1(), rb_fd_fix_cloexec(), rb_file_load_ok(), rb_file_s_join(), rb_io_initialize(), rb_pipe(), rb_sysopen_internal(), rsock_detect_cloexec(), rsock_init_sock(), rsock_s_accept(), rsock_s_accept_nonblock(), rsock_socket(), ruby_dup(), run_exec_dup2(), run_exec_dup2_child(), save_redirect_fd(), and sock_initialize().
void rb_write_error | ( | const char * | mesg | ) |
Definition at line 7387 of file io.c.
References rb_write_error2(), and strlen().
void rb_write_error2 | ( | const char * | mesg, |
long | len | ||
) |
Definition at line 7373 of file io.c.
References rb_io_t::fd, orig_stderr, rb_io_write(), rb_stderr, rb_str_new(), and RFILE.
Referenced by init_env(), and rb_write_error().
void rb_write_error_str | ( | VALUE | mesg | ) |
Definition at line 7393 of file io.c.
References rb_io_t::fd, fileno, len, orig_stderr, RB_GC_GUARD, rb_io_write(), rb_stderr, rb_w32_write_console(), RFILE, RSTRING_LEN, and RSTRING_PTR.
Referenced by rb_syntax_error_append(), rb_warning_s_warn(), rescue_callback(), and thread_start_func_2().
|
static |
Definition at line 980 of file io.c.
References io_internal_write_struct::buf, buf, io_internal_write_struct::capa, count, io_internal_write_struct::fd, internal_write_func(), and rb_thread_io_blocking_region().
Referenced by finish_writeconv(), io_binwrite_string(), and rb_io_syswrite().
|
static |
Definition at line 991 of file io.c.
References io_internal_write_struct::buf, buf, io_internal_write_struct::capa, count, io_internal_write_struct::fd, internal_write_func2(), NULL, rb_thread_call_without_gvl2(), rb_thread_io_blocking_region(), and RUBY_UBF_IO.
Referenced by finish_writeconv().
Definition at line 2393 of file io.c.
References rb_io_t::cbuf, clear_readconv(), ENC_CODERANGE_BROKEN, ENC_CODERANGE_SET, fill_cbuf(), io_enc_str(), io_fread(), io_read_encoding(), io_setstrbuf(), io_shift_cbuf(), make_readconv(), MORE_CHAR_FINISHED, MORE_CHAR_SUSPENDED, NEED_NEWLINE_DECORATOR_ON_READ_CHECK, NEED_READCONV, NIL_P, rb_exc_raise(), rb_str_coderange_scan_restartable(), rb_str_modify_expand(), rb_str_set_len(), READ_CHECK, RSTRING_PTR, and SET_BINARY_MODE.
Referenced by io_read(), rb_f_backquote(), and rb_io_getline_0().
|
static |
Definition at line 2093 of file io.c.
References MEMMOVE, rb_io_t::rbuf, and READ_DATA_PENDING_COUNT.
Referenced by appendline(), copy_stream_body(), io_bufread(), io_getpartial(), io_read_nonblock(), rb_io_each_codepoint(), rb_io_getline_fast(), and swallow().
Definition at line 2490 of file io.c.
References read_internal_arg::fd, read_internal_arg::len, Qundef, rb_read_internal(), and read_internal_arg::str_ptr.
Referenced by io_getpartial(), io_read_nonblock(), and rb_io_sysread().
|
static |
Definition at line 2186 of file io.c.
References rb_io_t::fd, fstat, io_fflush(), LONG_MAX, off_t, rb_eIOError, rb_raise(), rb_sys_fail(), READ_DATA_PENDING_COUNT, S_ISREG, SEEK_CUR, and stat.
Referenced by io_read(), and rb_f_backquote().
Definition at line 2848 of file io.c.
References rb_eRuntimeError, rb_raise(), RSTRING_LEN, and RSTRING_PTR.
Referenced by rb_io_getline_0().
|
static |
Definition at line 886 of file io.c.
References errno, rb_cloexec_dup(), rb_gc_for_fd(), rb_syserr_fail(), and rb_update_max_fd().
Referenced by rb_io_init_copy().
void ruby_set_inplace_mode | ( | const char * | suffix | ) |
Definition at line 9912 of file io.c.
References seek_arg::io, seek_arg::mode, seek_arg::offset, rb_io_binmode(), and rb_io_seek().
Referenced by io_s_write(), rb_io_s_binread(), and rb_io_s_read().
Definition at line 8622 of file io.c.
References select_args::except, select_args::fdsets, select_args::read, select_internal(), select_args::timeout, and select_args::write.
Referenced by rb_f_select().
Definition at line 8630 of file io.c.
References select_args::fdsets, numberof, Qnil, and rb_fd_term.
Referenced by rb_f_select().
|
static |
Definition at line 8491 of file io.c.
References Check_Type, rb_io_t::fd, GetOpenFile, GetWriteIO, list, max(), NIL_P, Qnil, RARRAY_AREF, RARRAY_LEN, rb_ary_entry(), rb_ary_new(), rb_ary_new2, rb_ary_push(), rb_fd_isset, rb_fd_set, rb_io_get_io(), rb_sys_fail(), rb_thread_fd_select(), READ_CHAR_PENDING, READ_DATA_PENDING, T_ARRAY, timeval::tv_sec, and timeval::tv_usec.
Referenced by select_call().
|
static |
Definition at line 9206 of file io.c.
References argc, argf::argv, fcntl_narg_len(), rb_io_t::fd, FIX2LONG, FIXNUM_P, GetOpenFile, INT2NUM, ioctl_narg_len(), len, MEMZERO, NIL_P, NUM2IOCTLREQ, NUM2LONG, rb_io_t::pathv, Qfalse, Qtrue, rb_check_string_type(), rb_eArgError, rb_io_ioctl, rb_raise(), rb_scan_args(), rb_str_modify(), rb_str_resize(), rb_sys_fail_path, RB_TYPE_P, RSTRING_GETMEM, RSTRING_LEN, RSTRING_PTR, SIGNED_VALUE, and T_STRING.
|
static |
Definition at line 7150 of file io.c.
References ENCODING_GET, len, rb_enc_ascget(), rb_enc_from_index(), rb_enc_mbminlen, RSTRING_LEN, and RSTRING_PTR.
Referenced by rb_io_puts().
|
inlinestatic |
Definition at line 2938 of file io.c.
References buf, cnt, FALSE, io_fillbuf(), io_read_encoding(), io_shift_cbuf(), make_readconv(), more_char(), MORE_CHAR_FINISHED, NEED_NEWLINE_DECORATOR_ON_READ_CHECK, NEED_READCONV, NULL, rb_io_t::pathv, rb_enc_ascget(), rb_enc_mbminlen, rb_sys_fail_path, read_buffered_data(), READ_CHAR_PENDING_COUNT, READ_CHAR_PENDING_PTR, READ_CHECK, READ_DATA_PENDING_COUNT, READ_DATA_PENDING_PTR, SET_BINARY_MODE, term, and TRUE.
Referenced by rb_io_getline_0().
|
static |
Definition at line 5495 of file io.c.
References sysopen_struct::fname, sysopen_struct::oflags, sysopen_struct::perm, rb_cloexec_open(), and RSTRING_PTR.
Referenced by rb_sysopen_internal().
|
static |
|
static |
Definition at line 5302 of file io.c.
References DEFAULT_TEXTMODE, ECONV_NEWLINE_DECORATOR_MASK, fmode, FMODE_BINMODE, FMODE_READABLE, FMODE_TEXTMODE, rb_default_external_encoding(), rb_eArgError, rb_enc_asciicompat, and rb_raise().
Referenced by io_encoding_set(), rb_file_open_generic(), and rb_io_extract_modeenc().
Definition at line 162 of file io.c.
Referenced by argf_alloc(), argf_binmode_m(), argf_close_m(), argf_each_byte(), argf_each_char(), argf_each_codepoint(), argf_each_line(), argf_getpartial(), argf_initialize(), argf_initialize_copy(), argf_inplace_mode_set(), argf_set_encoding(), argf_skip(), and global_argf_p().
|
static |
|
static |
Definition at line 4955 of file io.c.
Referenced by io_encname_bom_p().
|
static |
Definition at line 615 of file io.c.
Referenced by finish_writeconv(), ignore_closed_stream(), rb_io_check_closed(), rb_io_wait_readable(), and rb_io_wait_writable().
|
static |
Definition at line 165 of file io.c.
Referenced by Init_IO(), and rb_io_flush_raw().
|
static |
Definition at line 165 of file io.c.
Referenced by copy_stream_fallback_body(), and Init_IO().
|
static |
Definition at line 165 of file io.c.
Referenced by copy_stream_fallback_body(), and Init_IO().
|
static |
Definition at line 165 of file io.c.
Referenced by Init_IO(), and rb_io_set_encoding().
|
static |
Definition at line 165 of file io.c.
Referenced by Init_IO(), io_write(), rb_io_write(), rb_p(), and stdout_setter().
|
static |
Definition at line 187 of file io.c.
Referenced by rb_pipe(), and rb_update_max_fd().
|
static |
Definition at line 155 of file io.c.
Referenced by Init_IO(), pipe_open(), rb_write_error2(), and rb_write_error_str().
|
static |
Definition at line 155 of file io.c.
Referenced by argf_next_argv(), Init_IO(), and pipe_open().
Referenced by pipe_add_fptr(), and pipe_del_fptr().
VALUE rb_cIO |
Definition at line 141 of file io.c.
Referenced by Init_IO(), pipe_open(), rb_f_open(), and rb_io_fdopen().
VALUE rb_default_rs |
Definition at line 160 of file io.c.
Referenced by argf_getline(), check_getline_args(), Init_IO(), rb_gets(), rb_io_getline_0(), rb_io_gets(), rb_io_gets_internal(), rb_io_puts(), and rb_p().
|
static |
Definition at line 147 of file io.c.
Referenced by Init_IO(), and rb_readwrite_syserr_fail().
|
static |
Definition at line 148 of file io.c.
Referenced by Init_IO(), and rb_readwrite_syserr_fail().
|
static |
Definition at line 152 of file io.c.
Referenced by Init_IO(), and rb_readwrite_syserr_fail().
|
static |
Definition at line 151 of file io.c.
Referenced by Init_IO(), and rb_readwrite_syserr_fail().
VALUE rb_eEOFError |
Definition at line 142 of file io.c.
Referenced by argf_getpartial(), copy_stream_fallback(), Init_IO(), and rb_eof_error().
|
static |
Definition at line 149 of file io.c.
Referenced by Init_IO(), and rb_readwrite_syserr_fail().
|
static |
Definition at line 150 of file io.c.
Referenced by Init_IO(), and rb_readwrite_syserr_fail().
VALUE rb_eIOError |
Definition at line 143 of file io.c.
Referenced by argf_write_io(), copy_stream_body(), finish_writeconv(), Init_IO(), io_close(), io_getc(), io_ungetbyte(), rb_io_check_byte_readable(), rb_io_check_char_readable(), rb_io_check_closed(), rb_io_check_initialized(), rb_io_check_writable(), rb_io_close_read(), rb_io_close_write(), rb_io_each_codepoint(), rb_io_sysread(), rb_io_sysseek(), rb_io_ungetc(), rb_io_wait_readable(), rb_io_wait_writable(), and remain_size().
VALUE rb_mWaitReadable |
Definition at line 144 of file io.c.
Referenced by Init_IO(), and rb_readwrite_syserr_fail().
VALUE rb_mWaitWritable |
Definition at line 145 of file io.c.
Referenced by Init_IO(), and rb_readwrite_syserr_fail().
VALUE rb_output_fs |
Definition at line 157 of file io.c.
Referenced by Init_IO(), rb_ary_join_m(), rb_ary_resurrect(), and rb_io_print().
VALUE rb_output_rs |
Definition at line 159 of file io.c.
Referenced by Init_IO(), and rb_io_print().
VALUE rb_rs |
Definition at line 158 of file io.c.
Referenced by argf_getline(), extract_getline_args(), Init_IO(), and rb_gets().
VALUE rb_stderr |
Definition at line 154 of file io.c.
Referenced by Init_IO(), rb_io_s_popen(), rb_stdio_set_default_encoding(), rb_write_error2(), and rb_write_error_str().
VALUE rb_stdin |
Definition at line 154 of file io.c.
Referenced by argf_close(), argf_next_argv(), Init_IO(), and rb_stdio_set_default_encoding().
VALUE rb_stdout |
Definition at line 154 of file io.c.
Referenced by argf_next_argv(), Init_IO(), rb_f_p_internal(), rb_f_print(), rb_f_printf(), rb_f_putc(), rb_f_puts(), rb_io_getbyte(), rb_io_s_popen(), rb_obj_display(), rb_p(), and rb_stdio_set_default_encoding().
|
static |
Definition at line 167 of file io.c.
Referenced by Init_IO(), and rb_io_initialize().
|
static |
Definition at line 167 of file io.c.
Referenced by extract_binmode(), and Init_IO().
|
static |
Definition at line 168 of file io.c.
Referenced by Init_IO(), and interpret_seek_whence().
|
static |
Definition at line 8640 of file io.c.
Referenced by advice_arg_check(), and Init_IO().
|
static |
Definition at line 166 of file io.c.
Referenced by Init_IO(), and rb_io_extract_encoding_option().
|
static |
Definition at line 168 of file io.c.
Referenced by Init_IO(), and interpret_seek_whence().
|
static |
Definition at line 166 of file io.c.
Referenced by Init_IO(), and rb_io_extract_encoding_option().
|
static |
Definition at line 166 of file io.c.
Referenced by Init_IO(), and rb_io_extract_modeenc().
|
static |
Definition at line 166 of file io.c.
Referenced by Init_IO(), and rb_io_extract_encoding_option().
|
static |
Definition at line 166 of file io.c.
Referenced by Init_IO(), io_s_write(), and rb_io_extract_modeenc().
|
static |
Definition at line 8640 of file io.c.
Referenced by advice_arg_check(), and Init_IO().
|
static |
Definition at line 8640 of file io.c.
Referenced by advice_arg_check(), and Init_IO().
|
static |
Definition at line 166 of file io.c.
Referenced by Init_IO(), and open_key_args().
|
static |
Definition at line 166 of file io.c.
Referenced by Init_IO(), and rb_io_extract_modeenc().
|
static |
Definition at line 8640 of file io.c.
Referenced by advice_arg_check(), and Init_IO().
|
static |
Definition at line 8640 of file io.c.
Referenced by advice_arg_check(), and Init_IO().
|
static |
Definition at line 168 of file io.c.
Referenced by Init_IO(), and interpret_seek_whence().
|
static |
Definition at line 167 of file io.c.
Referenced by extract_binmode(), and Init_IO().
|
static |
Definition at line 169 of file io.c.
Referenced by Init_IO(), io_getpartial(), and io_read_nonblock().
|
static |
Definition at line 169 of file io.c.
Referenced by Init_IO(), and io_write_nonblock().
|
static |
Definition at line 8640 of file io.c.
Referenced by advice_arg_check(), and Init_IO().
|
static |
Definition at line 4956 of file io.c.
Referenced by parse_mode_enc().