Ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c52d4d35cc6a173c89eda98ceffa2dcf)
|
Public APIs related to rb_cIO. More...
Go to the source code of this file.
Macros | |
#define | rb_defout rb_stdout |
#define | RB_RESERVED_FD_P(fd) rb_reserved_fd_p(fd) |
Variables | |
VALUE | rb_fs |
VALUE | rb_output_fs |
VALUE | rb_rs |
VALUE | rb_default_rs |
VALUE | rb_output_rs |
Public APIs related to rb_cIO.
RBIMPL
or rbimpl
are implementation details. Don't take them as canon. They could rapidly appear then vanish. The name (path) of this header file is also an implementation detail. Do not expect it to persist at the place it is now. Developers are free to move it anywhere anytime at will. __VA_ARGS__
is always available. We assume C99 for ruby itself but we don't assume languages of extension libraries. They could be written in C++98. Definition in file io.h.
#define RB_RESERVED_FD_P | ( | fd | ) | rb_reserved_fd_p(fd) |
Definition at line 346 of file io.c.
References rb_cloexec_fcntl_dupfd().
Definition at line 353 of file io.c.
References dup2(), O_CLOEXEC, and rb_maygvl_fd_fix_cloexec().
Definition at line 440 of file io.c.
References F_DUPFD, F_DUPFD_CLOEXEC, fcntl(), rb_cloexec_fcntl_dupfd(), and rb_maygvl_fd_fix_cloexec().
Referenced by rb_cloexec_dup(), and rb_cloexec_fcntl_dupfd().
Definition at line 307 of file io.c.
References EWOULDBLOCK, O_CLOEXEC, and rb_maygvl_fd_fix_cloexec().
Referenced by rb_file_load_ok().
Definition at line 406 of file io.c.
References O_CLOEXEC, O_NONBLOCK, and rb_maygvl_fd_fix_cloexec().
Referenced by rb_pipe().
Referenced by rb_execarg_run_options().
void rb_fd_fix_cloexec | ( | int | fd | ) |
Definition at line 283 of file io.c.
References rb_maygvl_fd_fix_cloexec(), and rb_update_max_fd().
Definition at line 6389 of file io.c.
References sysopen_struct::fname, rb_cFile, and rb_str_new_cstr.
Definition at line 6382 of file io.c.
References FilePathValue, sysopen_struct::fname, and rb_cFile.
VALUE rb_gets | ( | void | ) |
Definition at line 9104 of file io.c.
References ARGF, next_argv, NIL_P, Qnil, rb_default_rs, rb_io_close(), rb_io_gets(), rb_lastline_set(), and rb_rs.
Definition at line 5449 of file io.c.
References rb_io_t::fd, FMODE_BINMODE, 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.
Definition at line 4935 of file io.c.
References Qnil.
Referenced by rb_gets(), and rb_io_make_open_file().
Definition at line 2298 of file io.c.
References rb_io_t::fd, GetOpenFile, 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 Init_IO().
Definition at line 8183 of file io.c.
References rb_cFile, rb_cIO, and rb_io_oflags_fmode().
Definition at line 2052 of file io.c.
References rb_io_flush_raw().
Referenced by Init_IO(), and rb_io_getbyte().
Definition at line 790 of file io.c.
References rb_convert_type_with_id(), and T_FILE.
Definition at line 4331 of file io.c.
References rb_io_t::fd, FMODE_TTY, GetOpenFile, INT2FIX, getline_arg::io, rb_io_t::mode, Qnil, rb_io_check_byte_readable(), rb_io_flush(), rb_ractor_stdout(), rb_io_t::rbuf, READ_CHECK, and T_FILE.
Referenced by Init_IO().
Definition at line 3738 of file io.c.
References FALSE, getline_arg::io, and rb_default_rs.
Referenced by rb_gets().
Definition at line 7720 of file io.c.
References argc, argv, NIL_P, out, Qnil, rb_category_warn, rb_io_write(), rb_lastline_get(), rb_output_fs, rb_output_rs, and RB_WARN_CATEGORY_DEPRECATED.
Referenced by Init_IO().
Definition at line 7649 of file io.c.
References argc, argv, out, Qnil, rb_f_sprintf(), and rb_io_write().
Referenced by Init_IO().
Definition at line 7895 of file io.c.
References argc, argv, out, Qnil, rb_default_rs, rb_exec_recursive(), rb_io_write(), rb_obj_as_string(), rb_str_end_with_asciichar(), RSTRING_LEN, and T_STRING.
Referenced by Init_IO(), and rb_f_abort().
Definition at line 4393 of file io.c.
References GetOpenFile, INT2FIX, getline_arg::io, NUM2INT, Qnil, rb_int_modulo(), rb_io_check_byte_readable(), rb_str_new, SafeStringValue, T_BIGNUM, T_FIXNUM, T_NIL, and TYPE.
Referenced by Init_IO().
Definition at line 4432 of file io.c.
References rb_io_t::cbuf, FIX2UINT, FIXNUM_P, GetOpenFile, int(), getline_arg::io, len, MEMMOVE, NEED_NEWLINE_DECORATOR_ON_READ_CHECK, NEED_READCONV, NUM2UINT, Qnil, rb_eIOError, rb_enc_uint_chr(), rb_io_check_char_readable(), rb_raise(), RSTRING_LEN, RSTRING_PTR, SafeStringValue, SET_BINARY_MODE, and T_BIGNUM.
Referenced by Init_IO().
Definition at line 1953 of file io.c.
References rb_funcallv, and str.
Referenced by rb_io_addstr(), rb_io_print(), rb_io_printf(), rb_io_puts(), rb_parser_printf(), rb_write_error2(), and rb_write_error_str().
Definition at line 6499 of file io.c.
References rb_cloexec_pipe(), rb_gc_for_fd(), and rb_update_max_fd().
Referenced by rsock_init_sock().
void rb_update_max_fd | ( | int | fd | ) |
Definition at line 233 of file io.c.
References ATOMIC_CAS, err, fcntl(), fstat, rb_bug(), and stat.
Referenced by rb_fd_fix_cloexec(), rb_file_load_ok(), rb_pipe(), rsock_init_sock(), rsock_s_accept(), rsock_s_accept_nonblock(), and rsock_socket().
void rb_write_error | ( | const char * | mesg | ) |
Definition at line 8077 of file io.c.
References rb_write_error2(), and strlen().
Definition at line 8058 of file io.c.
References fileno, len, rb_io_write(), rb_ractor_stderr(), rb_str_new, and rb_w32_write_console().
Referenced by rb_write_error().
|
extern |
Definition at line 202 of file io.c.
Referenced by Init_IO(), rb_gets(), rb_io_gets(), rb_io_gets_internal(), and rb_io_puts().
|
extern |
Definition at line 502 of file string.c.
Referenced by Init_String().
|
extern |
Definition at line 199 of file io.c.
Referenced by Init_IO(), and rb_io_print().
|
extern |
Definition at line 201 of file io.c.
Referenced by Init_IO(), and rb_io_print().