|
Ruby 3.5.0dev (2025-10-23 revision 3b190855ba965c179693a5baf25f365d9d445c09)
|
Ruby's IO, metadata and buffers. More...
#include <io.h>
Data Fields | |
| VALUE | self |
| The IO's Ruby level counterpart. | |
| FILE * | stdio_file |
| stdio ptr for read/write, if available. | |
| int | fd |
| file descriptor. | |
| enum rb_io_mode | mode |
| mode flags: FMODE_XXXs | |
| rb_pid_t | pid |
| child's pid (for pipes) | |
| int | lineno |
| number of lines read | |
| VALUE | pathv |
| pathname for file | |
| void(* | finalize )(struct rb_io *, int) |
| finalize proc | |
| rb_io_buffer_t | wbuf |
| Write buffer. | |
| rb_io_buffer_t | rbuf |
| (Byte) read buffer. | |
| VALUE | tied_io_for_writing |
| Duplex IO object, if set. | |
| struct rb_io_encoding | encs |
| Decomposed encoding flags. | |
| rb_econv_t * | readconv |
| Encoding converter used when reading from this IO. | |
| rb_io_buffer_t | cbuf |
| rb_io_ungetc() destination. | |
| rb_econv_t * | writeconv |
| Encoding converter used when writing to this IO. | |
| VALUE | writeconv_asciicompat |
| This is, when set, an instance of rb_cString which holds the "common" encoding. | |
| int | writeconv_initialized |
| Whether rb_io_t::writeconv is already set up. | |
| int | writeconv_pre_ecflags |
| Value of ::rb_io_t::rb_io_enc_t::ecflags stored right before initialising rb_io_t::writeconv. | |
| VALUE | writeconv_pre_ecopts |
| Value of ::rb_io_t::rb_io_enc_t::ecopts stored right before initialising rb_io_t::writeconv. | |
| VALUE | write_lock |
| This is a Ruby level mutex. | |
| VALUE | timeout |
| The timeout associated with this IO when performing blocking operations. | |
| struct ccan_list_head | blocking_operations |
| Threads that are performing a blocking operation without the GVL using this IO. | |
| struct rb_execution_context_struct * | closing_ec |
| VALUE | wakeup_mutex |
| rb_serial_t | fork_generation |
| struct ccan_list_head rb_io::blocking_operations |
Threads that are performing a blocking operation without the GVL using this IO.
On calling IO::close, these threads will be interrupted so that the operation can be cancelled.
Definition at line 131 of file io.h.
Referenced by rb_io_open_descriptor().
| rb_io_buffer_t rb_io::cbuf |
rb_io_ungetc() destination.
This buffer is read before checking rb_io_t::rbuf
Definition at line 359 of file io.h.
Referenced by rb_io_ungetc().
| struct rb_execution_context_struct* rb_io::closing_ec |
| struct rb_io_encoding rb_io::encs |
Decomposed encoding flags.
Definition at line 348 of file io.h.
Referenced by rb_io_open_descriptor().
| int rb_io::fd |
file descriptor.
Definition at line 306 of file io.h.
Referenced by rb_file_size(), rb_io_binmode(), rb_io_check_closed(), rb_io_closed_p(), rb_io_descriptor(), rb_io_eof(), rb_io_getbyte(), rb_io_open_descriptor(), rb_io_set_nonblock(), and rb_io_stdio_file().
| enum rb_io_mode rb_io::mode |
mode flags: FMODE_XXXs
Definition at line 310 of file io.h.
Referenced by rb_file_size(), rb_io_binmode(), rb_io_check_char_readable(), rb_io_check_writable(), rb_io_getbyte(), rb_io_mode(), rb_io_open_descriptor(), rb_io_stdio_file(), and rb_io_synchronized().
| VALUE rb_io::pathv |
pathname for file
Definition at line 322 of file io.h.
Referenced by rb_file_size(), rb_io_open_descriptor(), rb_io_path(), and rb_io_set_nonblock().
| rb_io_buffer_t rb_io::rbuf |
(Byte) read buffer.
Note also that there is a field called rb_io_t::cbuf, which also concerns read IO.
Definition at line 337 of file io.h.
Referenced by rb_io_check_writable(), and rb_io_getbyte().
| rb_econv_t * rb_io::readconv |
Encoding converter used when reading from this IO.
Definition at line 352 of file io.h.
Referenced by rb_io_binmode().
| VALUE rb_io::self |
The IO's Ruby level counterpart.
Definition at line 298 of file io.h.
Referenced by rb_io_open_descriptor(), and rb_io_read_check().
| FILE * rb_io::stdio_file |
stdio ptr for read/write, if available.
Definition at line 302 of file io.h.
Referenced by rb_io_stdio_file().
| VALUE rb_io::tied_io_for_writing |
Duplex IO object, if set.
Definition at line 345 of file io.h.
Referenced by rb_io_check_char_readable(), rb_io_get_write_io(), and rb_io_set_write_io().
| VALUE rb_io::timeout |
The timeout associated with this IO when performing blocking operations.
Definition at line 406 of file io.h.
Referenced by rb_io_open_descriptor(), rb_io_set_timeout(), rb_io_timeout(), and rb_io_wait().
| rb_io_buffer_t rb_io::wbuf |
| VALUE rb_io::write_lock |
| rb_econv_t * rb_io::writeconv |
Encoding converter used when writing to this IO.
Definition at line 363 of file io.h.
Referenced by rb_io_binmode().
| VALUE rb_io::writeconv_asciicompat |
This is, when set, an instance of rb_cString which holds the "common" encoding.
Write conversion can convert strings twice... In case conversion from encoding X to encoding Y does not exist, Ruby finds an encoding Z that bridges the two, so that X to Z to Y conversion happens.
| int rb_io::writeconv_initialized |
Whether rb_io_t::writeconv is already set up.
| int rb_io::writeconv_pre_ecflags |
Value of ::rb_io_t::rb_io_enc_t::ecflags stored right before initialising rb_io_t::writeconv.
Definition at line 383 of file io.h.
Referenced by rb_io_binmode().
| VALUE rb_io::writeconv_pre_ecopts |
Value of ::rb_io_t::rb_io_enc_t::ecopts stored right before initialising rb_io_t::writeconv.