Ruby  2.0.0p648(2015-12-16revision53162)
Data Structures | Macros | Typedefs | Functions | Variables
io.c File Reference
#include "ruby/ruby.h"
#include "ruby/io.h"
#include "ruby/thread.h"
#include "dln.h"
#include "internal.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  finish_writeconv_arg
 
struct  sysopen_struct
 
struct  pipe_list
 
struct  rb_f_p_arg
 
struct  select_args
 
struct  ioctl_arg
 
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 numberof(array)   (int)(sizeof(array) / sizeof((array)[0]))
 
#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 argf_of(obj)   (*(struct argf *)DATA_PTR(obj))
 
#define ARGF   argf_of(argf)
 
#define STDIO_READ_DATA_PENDING(fp)   (!feof(fp))
 
#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 rb_sys_fail_path(path)   rb_sys_fail_str(path)
 
#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 SMALLBUF   100
 
#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_fcntl   rb_f_notimplement
 
#define rb_f_syscall   rb_f_notimplement
 
#define rb_intern(str)   rb_intern_const(str)
 

Typedefs

typedef struct rb_io_enc_t convconfig_t
 
typedef int ioctl_req_t
 

Functions

void rb_update_max_fd (int fd)
 
void rb_maygvl_fd_fix_cloexec (int fd)
 
void rb_fd_fix_cloexec (int fd)
 
int rb_cloexec_open (const char *pathname, int flags, mode_t mode)
 
int rb_cloexec_dup (int oldfd)
 
int rb_cloexec_dup2 (int oldfd, int newfd)
 
int rb_cloexec_pipe (int fildes[2])
 
int rb_cloexec_fcntl_dupfd (int fd, int minfd)
 
static int io_fflush (rb_io_t *)
 
static rb_io_tflush_before_seek (rb_io_t *fptr)
 
void rb_eof_error (void)
 
static VALUE taint_check (VALUE io)
 
VALUE rb_io_taint_check (VALUE io)
 
void rb_io_check_initialized (rb_io_t *fptr)
 
void rb_io_check_closed (rb_io_t *fptr)
 
VALUE rb_io_get_io (VALUE io)
 
VALUE rb_io_check_io (VALUE io)
 
VALUE rb_io_get_write_io (VALUE io)
 
VALUE rb_io_set_write_io (VALUE io, VALUE w)
 
static VALUE rb_io_s_try_convert (VALUE dummy, VALUE io)
 
static void io_unread (rb_io_t *fptr)
 
static rb_encodingio_input_encoding (rb_io_t *fptr)
 
static void io_ungetbyte (VALUE str, rb_io_t *fptr)
 
void rb_io_check_char_readable (rb_io_t *fptr)
 
void rb_io_check_byte_readable (rb_io_t *fptr)
 
void rb_io_check_readable (rb_io_t *fptr)
 
static rb_encodingio_read_encoding (rb_io_t *fptr)
 
void rb_io_check_writable (rb_io_t *fptr)
 
int rb_io_read_pending (rb_io_t *fptr)
 
void rb_read_check (FILE *fp)
 
void rb_io_read_check (rb_io_t *fptr)
 
static int ruby_dup (int orig)
 
static VALUE io_alloc (VALUE klass)
 
static int wsplit_p (rb_io_t *fptr)
 
static VALUE internal_read_func (void *ptr)
 
static VALUE internal_write_func (void *ptr)
 
static void * internal_write_func2 (void *ptr)
 
static ssize_t rb_read_internal (int fd, void *buf, size_t count)
 
static ssize_t rb_write_internal (int fd, const void *buf, size_t count)
 
static ssize_t rb_write_internal2 (int fd, const void *buf, size_t count)
 
static long io_writable_length (rb_io_t *fptr, long l)
 
static VALUE io_flush_buffer_sync (void *arg)
 
static void * io_flush_buffer_sync2 (void *arg)
 
static VALUE io_flush_buffer_async (VALUE arg)
 
static VALUE io_flush_buffer_async2 (VALUE arg)
 
static int io_flush_buffer (rb_io_t *fptr)
 
int rb_io_wait_readable (int f)
 
int rb_io_wait_writable (int f)
 
static void make_writeconv (rb_io_t *fptr)
 
static VALUE io_binwrite_string (VALUE arg)
 
static long io_binwrite (VALUE str, const char *ptr, long len, rb_io_t *fptr, int nosync)
 
static VALUE do_writeconv (VALUE str, rb_io_t *fptr)
 
static long io_fwrite (VALUE str, rb_io_t *fptr, int nosync)
 
ssize_t rb_io_bufwrite (VALUE io, const void *buf, size_t size)
 
static VALUE io_write (VALUE io, VALUE str, int nosync)
 
static VALUE io_write_m (VALUE io, VALUE str)
 
VALUE rb_io_write (VALUE io, VALUE str)
 
VALUE rb_io_addstr (VALUE io, VALUE str)
 
VALUE rb_io_flush (VALUE io)
 
static VALUE rb_io_tell (VALUE io)
 
static VALUE rb_io_seek (VALUE io, VALUE offset, int whence)
 
static VALUE rb_io_seek_m (int argc, VALUE *argv, VALUE io)
 
static VALUE rb_io_set_pos (VALUE io, VALUE offset)
 
static void clear_readconv (rb_io_t *fptr)
 
static VALUE rb_io_rewind (VALUE io)
 
static int io_fillbuf (rb_io_t *fptr)
 
VALUE rb_io_eof (VALUE io)
 
static VALUE rb_io_sync (VALUE io)
 
static VALUE rb_io_set_sync (VALUE io, VALUE sync)
 
static VALUE rb_io_fileno (VALUE io)
 
static VALUE rb_io_pid (VALUE io)
 
static VALUE rb_io_inspect (VALUE obj)
 
static VALUE rb_io_to_io (VALUE io)
 
static long read_buffered_data (char *ptr, long len, rb_io_t *fptr)
 
static long io_bufread (char *ptr, long len, rb_io_t *fptr)
 
static void io_setstrbuf (VALUE *str, long len)
 
static VALUE bufread_call (VALUE arg)
 
static long io_fread (VALUE str, long offset, long size, rb_io_t *fptr)
 
ssize_t rb_io_bufread (VALUE io, void *buf, size_t size)
 
static long remain_size (rb_io_t *fptr)
 
static VALUE io_enc_str (VALUE str, rb_io_t *fptr)
 
static void make_readconv (rb_io_t *fptr, int size)
 
static VALUE fill_cbuf (rb_io_t *fptr, int ec_flags)
 
static VALUE more_char (rb_io_t *fptr)
 
static VALUE io_shift_cbuf (rb_io_t *fptr, int len, VALUE *strp)
 
static void io_set_read_length (VALUE str, long n)
 
static VALUE read_all (rb_io_t *fptr, long siz, VALUE str)
 
void rb_io_set_nonblock (rb_io_t *fptr)
 
static VALUE read_internal_call (VALUE arg)
 
static VALUE io_getpartial (int argc, VALUE *argv, VALUE io, int nonblock)
 
static VALUE io_readpartial (int argc, VALUE *argv, VALUE io)
 
static VALUE io_read_nonblock (int argc, VALUE *argv, VALUE io)
 
static VALUE rb_io_write_nonblock (VALUE io, VALUE str)
 
static VALUE io_read (int argc, VALUE *argv, VALUE io)
 
static void rscheck (const char *rsptr, long rslen, VALUE rs)
 
static int appendline (rb_io_t *fptr, int delim, VALUE *strp, long *lp)
 
static int swallow (rb_io_t *fptr, int term)
 
static VALUE rb_io_getline_fast (rb_io_t *fptr, rb_encoding *enc, VALUE io)
 
static void prepare_getline_args (int argc, VALUE *argv, VALUE *rsp, long *limit, VALUE io)
 
static VALUE rb_io_getline_1 (VALUE rs, long limit, VALUE io)
 
static VALUE rb_io_getline (int argc, VALUE *argv, VALUE io)
 
VALUE rb_io_gets (VALUE io)
 
static VALUE rb_io_gets_m (int argc, VALUE *argv, VALUE io)
 
static VALUE rb_io_lineno (VALUE io)
 
static VALUE rb_io_set_lineno (VALUE io, VALUE lineno)
 
static VALUE rb_io_readline (int argc, VALUE *argv, VALUE io)
 
static VALUE rb_io_readlines (int argc, VALUE *argv, VALUE io)
 
static VALUE rb_io_each_line (int argc, VALUE *argv, VALUE io)
 
static VALUE rb_io_lines (int argc, VALUE *argv, VALUE io)
 
static VALUE rb_io_each_byte (VALUE io)
 
static VALUE rb_io_bytes (VALUE io)
 
static VALUE io_getc (rb_io_t *fptr, rb_encoding *enc)
 
static VALUE rb_io_each_char (VALUE io)
 
static VALUE rb_io_chars (VALUE io)
 
static VALUE rb_io_each_codepoint (VALUE io)
 
static VALUE rb_io_codepoints (VALUE io)
 
static VALUE rb_io_getc (VALUE io)
 
static VALUE rb_io_readchar (VALUE io)
 
VALUE rb_io_getbyte (VALUE io)
 
static VALUE rb_io_readbyte (VALUE io)
 
VALUE rb_io_ungetbyte (VALUE io, VALUE b)
 
VALUE rb_io_ungetc (VALUE io, VALUE c)
 
static VALUE rb_io_isatty (VALUE io)
 
static VALUE finish_writeconv (rb_io_t *fptr, int noalloc)
 
static VALUE finish_writeconv_sync (VALUE arg)
 
static void * nogvl_close (void *ptr)
 
static int maygvl_close (int fd, int keepgvl)
 
static void * nogvl_fclose (void *ptr)
 
static int maygvl_fclose (FILE *file, int keepgvl)
 
static void fptr_finalize (rb_io_t *fptr, int noraise)
 
static void rb_io_fptr_cleanup (rb_io_t *fptr, int noraise)
 
static void clear_writeconv (rb_io_t *fptr)
 
static void clear_codeconv (rb_io_t *fptr)
 
int rb_io_fptr_finalize (rb_io_t *fptr)
 
size_t rb_econv_memsize (rb_econv_t *)
 
RUBY_FUNC_EXPORTED size_t rb_io_memsize (const rb_io_t *fptr)
 
VALUE rb_io_close (VALUE io)
 
static VALUE rb_io_close_m (VALUE io)
 
static VALUE io_call_close (VALUE io)
 
static VALUE ignore_closed_stream (VALUE io, VALUE exc)
 
static VALUE io_close (VALUE io)
 
static VALUE rb_io_closed (VALUE io)
 
static VALUE rb_io_close_read (VALUE io)
 
static VALUE rb_io_close_write (VALUE io)
 
static VALUE rb_io_sysseek (int argc, VALUE *argv, VALUE io)
 
static VALUE rb_io_syswrite (VALUE io, VALUE str)
 
static VALUE rb_io_sysread (int argc, VALUE *argv, VALUE io)
 
VALUE rb_io_binmode (VALUE io)
 
VALUE rb_io_ascii8bit_binmode (VALUE io)
 
static VALUE rb_io_binmode_m (VALUE io)
 
static VALUE rb_io_binmode_p (VALUE io)
 
static const char * rb_io_fmode_modestr (int fmode)
 
static int io_encname_bom_p (const char *name, long len)
 
int rb_io_modestr_fmode (const char *modestr)
 
int rb_io_oflags_fmode (int oflags)
 
static int rb_io_fmode_oflags (int fmode)
 
int rb_io_modestr_oflags (const char *modestr)
 
static const char * rb_io_oflags_modestr (int oflags)
 
static void rb_io_ext_int_to_encs (rb_encoding *ext, rb_encoding *intern, rb_encoding **enc, rb_encoding **enc2, int fmode)
 
static void unsupported_encoding (const char *name)
 
static void parse_mode_enc (const char *estr, rb_encoding **enc_p, rb_encoding **enc2_p, int *fmode_p)
 
int rb_io_extract_encoding_option (VALUE opt, rb_encoding **enc_p, rb_encoding **enc2_p, int *fmode_p)
 
static void validate_enc_binmode (int *fmode_p, int ecflags, rb_encoding *enc, rb_encoding *enc2)
 
static void extract_binmode (VALUE opthash, int *fmode)
 
static void rb_io_extract_modeenc (VALUE *vmode_p, VALUE *vperm_p, VALUE opthash, int *oflags_p, int *fmode_p, convconfig_t *convconfig_p)
 
static void * sysopen_func (void *ptr)
 
static int rb_sysopen_internal (struct sysopen_struct *data)
 
static int rb_sysopen (VALUE fname, int oflags, mode_t perm)
 
FILErb_fdopen (int fd, const char *modestr)
 
static void io_check_tty (rb_io_t *fptr)
 
static VALUE rb_io_internal_encoding (VALUE)
 
static void io_encoding_set (rb_io_t *, VALUE, VALUE, VALUE)
 
static int io_strip_bom (VALUE io)
 
static void io_set_encoding_by_bom (VALUE io)
 
static VALUE rb_file_open_generic (VALUE io, VALUE filename, int oflags, int fmode, convconfig_t *convconfig, mode_t perm)
 
static VALUE rb_file_open_internal (VALUE io, VALUE filename, const char *modestr)
 
VALUE rb_file_open_str (VALUE fname, const char *modestr)
 
VALUE rb_file_open (const char *fname, const char *modestr)
 
static void pipe_add_fptr (rb_io_t *fptr)
 
static void pipe_del_fptr (rb_io_t *fptr)
 
static void pipe_atexit (void)
 
static void pipe_finalize (rb_io_t *fptr, int noraise)
 
void rb_io_synchronized (rb_io_t *fptr)
 
void rb_io_unbuffered (rb_io_t *fptr)
 
int rb_pipe (int *pipes)
 
static VALUE pipe_open (VALUE execarg_obj, const char *modestr, int fmode, convconfig_t *convconfig)
 
static int is_popen_fork (VALUE prog)
 
static VALUE pipe_open_s (VALUE prog, const char *modestr, int fmode, convconfig_t *convconfig)
 
static VALUE rb_io_s_popen (int argc, VALUE *argv, VALUE klass)
 
static void rb_scan_open_args (int argc, VALUE *argv, VALUE *fname_p, int *oflags_p, int *fmode_p, convconfig_t *convconfig_p, mode_t *perm_p)
 
static VALUE rb_open_file (int argc, VALUE *argv, VALUE io)
 
static VALUE rb_io_s_open (int argc, VALUE *argv, VALUE klass)
 
static VALUE rb_io_s_sysopen (int argc, VALUE *argv)
 
static VALUE check_pipe_command (VALUE filename_or_command)
 
static VALUE rb_f_open (int argc, VALUE *argv)
 
static VALUE rb_io_open (VALUE filename, VALUE vmode, VALUE vperm, VALUE opt)
 
static VALUE rb_io_open_with_args (int argc, VALUE *argv)
 
static VALUE io_reopen (VALUE io, VALUE nfile)
 
static VALUE rb_io_reopen (int argc, VALUE *argv, VALUE file)
 
static VALUE rb_io_init_copy (VALUE dest, VALUE io)
 
VALUE rb_io_printf (int argc, VALUE *argv, VALUE out)
 
static VALUE rb_f_printf (int argc, VALUE *argv)
 
VALUE rb_io_print (int argc, VALUE *argv, VALUE out)
 
static VALUE rb_f_print (int argc, VALUE *argv)
 
static VALUE rb_io_putc (VALUE io, VALUE ch)
 
static VALUE rb_f_putc (VALUE recv, VALUE ch)
 
static int str_end_with_asciichar (VALUE str, int c)
 
static VALUE io_puts_ary (VALUE ary, VALUE out, int recur)
 
VALUE rb_io_puts (int argc, VALUE *argv, VALUE out)
 
static VALUE rb_f_puts (int argc, VALUE *argv, VALUE recv)
 
void rb_p (VALUE obj)
 
static VALUE rb_f_p_internal (VALUE arg)
 
static VALUE rb_f_p (int argc, VALUE *argv, VALUE self)
 
static VALUE rb_obj_display (int argc, VALUE *argv, VALUE self)
 
void rb_write_error2 (const char *mesg, long len)
 
void rb_write_error (const char *mesg)
 
void rb_write_error_str (VALUE mesg)
 
static void must_respond_to (ID mid, VALUE val, ID id)
 
static void stdout_setter (VALUE val, ID id, VALUE *variable)
 
static VALUE prep_io (int fd, int fmode, VALUE klass, const char *path)
 
VALUE rb_io_fdopen (int fd, int oflags, const char *path)
 
static VALUE prep_stdio (FILE *f, int fmode, VALUE klass, const char *path)
 
FILErb_io_stdio_file (rb_io_t *fptr)
 
static VALUE rb_io_initialize (int argc, VALUE *argv, VALUE io)
 
static VALUE rb_file_initialize (int argc, VALUE *argv, VALUE io)
 
static VALUE rb_io_s_new (int argc, VALUE *argv, VALUE klass)
 
static VALUE rb_io_s_for_fd (int argc, VALUE *argv, VALUE klass)
 
static VALUE rb_io_autoclose_p (VALUE io)
 
static VALUE rb_io_set_autoclose (VALUE io, VALUE autoclose)
 
static void argf_mark (void *ptr)
 
static void argf_free (void *ptr)
 
static size_t argf_memsize (const void *ptr)
 
static void argf_init (struct argf *p, VALUE v)
 
static VALUE argf_alloc (VALUE klass)
 
static VALUE argf_initialize (VALUE argf, VALUE argv)
 
static VALUE argf_initialize_copy (VALUE argf, VALUE orig)
 
static VALUE argf_set_lineno (VALUE argf, VALUE val)
 
static VALUE argf_lineno (VALUE argf)
 
static VALUE argf_forward (int argc, VALUE *argv, VALUE argf)
 
static void argf_close (VALUE file)
 
static int argf_next_argv (VALUE argf)
 
static VALUE argf_getline (int argc, VALUE *argv, VALUE argf)
 
static VALUE argf_lineno_getter (ID id, VALUE *var)
 
static void argf_lineno_setter (VALUE val, ID id, VALUE *var)
 
static VALUE argf_gets (int, VALUE *, VALUE)
 
static VALUE rb_f_gets (int argc, VALUE *argv, VALUE recv)
 
VALUE rb_gets (void)
 
static VALUE argf_readline (int, VALUE *, VALUE)
 
static VALUE rb_f_readline (int argc, VALUE *argv, VALUE recv)
 
static VALUE argf_readlines (int, VALUE *, VALUE)
 
static VALUE rb_f_readlines (int argc, VALUE *argv, VALUE recv)
 
static VALUE rb_f_backquote (VALUE obj, VALUE str)
 
static VALUE select_internal (VALUE read, VALUE write, VALUE except, struct timeval *tp, rb_fdset_t *fds)
 
static VALUE select_call (VALUE arg)
 
static VALUE select_end (VALUE arg)
 
static void advice_arg_check (VALUE advice)
 
static VALUE rb_io_advise (int argc, VALUE *argv, VALUE io)
 
static VALUE rb_f_select (int argc, VALUE *argv, VALUE obj)
 
static VALUE nogvl_ioctl (void *ptr)
 
static int do_ioctl (int fd, ioctl_req_t cmd, long narg)
 
static long ioctl_narg_len (ioctl_req_t cmd)
 
static long fcntl_narg_len (int cmd)
 
static long setup_narg (ioctl_req_t cmd, VALUE *argp, int io_p)
 
static VALUE rb_ioctl (VALUE io, VALUE req, VALUE arg)
 
static VALUE rb_io_ioctl (int argc, VALUE *argv, VALUE io)
 
static VALUE io_new_instance (VALUE args)
 
static rb_encodingfind_encoding (VALUE v)
 
static VALUE pipe_pair_close (VALUE rw)
 
static VALUE rb_io_s_pipe (int argc, VALUE *argv, VALUE klass)
 
static void open_key_args (int argc, VALUE *argv, VALUE opt, struct foreach_arg *arg)
 
static VALUE io_s_foreach (struct foreach_arg *arg)
 
static VALUE rb_io_s_foreach (int argc, VALUE *argv, VALUE self)
 
static VALUE io_s_readlines (struct foreach_arg *arg)
 
static VALUE rb_io_s_readlines (int argc, VALUE *argv, VALUE io)
 
static VALUE io_s_read (struct foreach_arg *arg)
 
static VALUE seek_before_access (VALUE argp)
 
static VALUE rb_io_s_read (int argc, VALUE *argv, VALUE io)
 
static VALUE rb_io_s_binread (int argc, VALUE *argv, VALUE io)
 
static VALUE io_s_write0 (struct write_arg *arg)
 
static VALUE io_s_write (int argc, VALUE *argv, int binary)
 
static VALUE rb_io_s_write (int argc, VALUE *argv, VALUE io)
 
static VALUE rb_io_s_binwrite (int argc, VALUE *argv, VALUE io)
 
static void * exec_interrupts (void *arg)
 
static int maygvl_copy_stream_continue_p (int has_gvl, struct copy_stream_struct *stp)
 
static int maygvl_select (int has_gvl, int n, rb_fdset_t *rfds, rb_fdset_t *wfds, rb_fdset_t *efds, struct timeval *timeout)
 
static int maygvl_copy_stream_wait_read (int has_gvl, struct copy_stream_struct *stp)
 
static int nogvl_copy_stream_wait_write (struct copy_stream_struct *stp)
 
static ssize_t maygvl_read (int has_gvl, int fd, void *buf, size_t count)
 
static ssize_t maygvl_copy_stream_read (int has_gvl, struct copy_stream_struct *stp, char *buf, size_t len, off_t offset)
 
static int nogvl_copy_stream_write (struct copy_stream_struct *stp, char *buf, size_t len)
 
static void nogvl_copy_stream_read_write (struct copy_stream_struct *stp)
 
static void * nogvl_copy_stream_func (void *arg)
 
static VALUE copy_stream_fallback_body (VALUE arg)
 
static VALUE copy_stream_fallback (struct copy_stream_struct *stp)
 
static VALUE copy_stream_body (VALUE arg)
 
static VALUE copy_stream_finalize (VALUE arg)
 
static VALUE rb_io_s_copy_stream (int argc, VALUE *argv, VALUE io)
 
static VALUE rb_io_external_encoding (VALUE io)
 
static VALUE rb_io_set_encoding (int argc, VALUE *argv, VALUE io)
 
void rb_stdio_set_default_encoding (void)
 
static VALUE argf_external_encoding (VALUE argf)
 
static VALUE argf_internal_encoding (VALUE argf)
 
static VALUE argf_set_encoding (int argc, VALUE *argv, VALUE argf)
 
static VALUE argf_tell (VALUE argf)
 
static VALUE argf_seek_m (int argc, VALUE *argv, VALUE argf)
 
static VALUE argf_set_pos (VALUE argf, VALUE offset)
 
static VALUE argf_rewind (VALUE argf)
 
static VALUE argf_fileno (VALUE argf)
 
static VALUE argf_to_io (VALUE argf)
 
static VALUE argf_eof (VALUE argf)
 
static VALUE argf_read (int argc, VALUE *argv, VALUE argf)
 
static VALUE argf_forward_call (VALUE arg)
 
static VALUE argf_getpartial (int argc, VALUE *argv, VALUE argf, int nonblock)
 
static VALUE argf_readpartial (int argc, VALUE *argv, VALUE argf)
 
static VALUE argf_read_nonblock (int argc, VALUE *argv, VALUE argf)
 
static VALUE argf_getc (VALUE argf)
 
static VALUE argf_getbyte (VALUE argf)
 
static VALUE argf_readchar (VALUE argf)
 
static VALUE argf_readbyte (VALUE argf)
 
static VALUE argf_each_line (int argc, VALUE *argv, VALUE argf)
 
static VALUE argf_lines (int argc, VALUE *argv, VALUE argf)
 
static VALUE argf_each_byte (VALUE argf)
 
static VALUE argf_bytes (VALUE argf)
 
static VALUE argf_each_char (VALUE argf)
 
static VALUE argf_chars (VALUE argf)
 
static VALUE argf_each_codepoint (VALUE argf)
 
static VALUE argf_codepoints (VALUE argf)
 
static VALUE argf_filename (VALUE argf)
 
static VALUE argf_filename_getter (ID id, VALUE *var)
 
static VALUE argf_file (VALUE argf)
 
static VALUE argf_binmode_m (VALUE argf)
 
static VALUE argf_binmode_p (VALUE argf)
 
static VALUE argf_skip (VALUE argf)
 
static VALUE argf_close_m (VALUE argf)
 
static VALUE argf_closed (VALUE argf)
 
static VALUE argf_to_s (VALUE argf)
 
static VALUE argf_inplace_mode_get (VALUE argf)
 
static VALUE opt_i_get (ID id, VALUE *var)
 
static VALUE argf_inplace_mode_set (VALUE argf, VALUE val)
 
static void opt_i_set (VALUE val, ID id, VALUE *var)
 
const char * ruby_get_inplace_mode (void)
 
void ruby_set_inplace_mode (const char *suffix)
 
static VALUE argf_argv (VALUE argf)
 
static VALUE argf_argv_getter (ID id, VALUE *var)
 
VALUE rb_get_argv (void)
 
static VALUE argf_write_io (VALUE argf)
 
static VALUE argf_write (VALUE argf, VALUE str)
 
void Init_IO (void)
 

Variables

VALUE rb_cIO
 
VALUE rb_eEOFError
 
VALUE rb_eIOError
 
VALUE rb_mWaitReadable
 
VALUE rb_mWaitWritable
 
VALUE rb_stdin
 
VALUE rb_stdout
 
VALUE rb_stderr
 
VALUE rb_deferr
 
static VALUE orig_stdout
 
static VALUE orig_stderr
 
VALUE rb_output_fs
 
VALUE rb_rs
 
VALUE rb_output_rs
 
VALUE rb_default_rs
 
static VALUE argf
 
static ID id_write
 
static ID id_read
 
static ID id_getc
 
static ID id_flush
 
static ID id_readpartial
 
static ID id_set_encoding
 
static VALUE sym_mode
 
static VALUE sym_perm
 
static VALUE sym_extenc
 
static VALUE sym_intenc
 
static VALUE sym_encoding
 
static VALUE sym_open_args
 
static VALUE sym_textmode
 
static VALUE sym_binmode
 
static VALUE sym_autoclose
 
static rb_atomic_t max_file_descriptor = NOFILE
 
static const char closed_stream [] = "closed stream"
 
static struct pipe_listpipe_list
 
static const rb_data_type_t argf_type
 
static VALUE sym_normal
 
static VALUE sym_sequential
 
static VALUE sym_random
 
static VALUE sym_willneed
 
static VALUE sym_dontneed
 
static VALUE sym_noreuse
 

Macro Definition Documentation

◆ ARGF

#define ARGF   argf_of(argf)

◆ ARGF_FORWARD

#define ARGF_FORWARD (   argc,
  argv 
)
Value:
do {\
return argf_forward((argc), (argv), argf);\
} while (0)
Definition: io.c:152
#define ARGF_GENERIC_INPUT_P()
Definition: io.c:7652
int argc
Definition: ruby.c:130
static VALUE argf_forward(int argc, VALUE *argv, VALUE argf)
Definition: io.c:7646
char ** argv
Definition: ruby.c:131

Definition at line 7654 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().

◆ ARGF_GENERIC_INPUT_P

#define ARGF_GENERIC_INPUT_P ( )    (ARGF.current_file == rb_stdin && !RB_TYPE_P(ARGF.current_file, T_FILE))

Definition at line 7652 of file io.c.

Referenced by argf_getc(), argf_getline(), argf_getpartial(), argf_read(), and argf_readlines().

◆ argf_of

#define argf_of (   obj)    (*(struct argf *)DATA_PTR(obj))

Definition at line 350 of file io.c.

Referenced by argf_initialize_copy().

◆ DEFAULT_TEXTMODE

#define DEFAULT_TEXTMODE   0

◆ DEFULT_IOCTL_NARG_LEN

#define DEFULT_IOCTL_NARG_LEN   (256)

Definition at line 8562 of file io.c.

Referenced by ioctl_narg_len().

◆ fmode

#define fmode   (fptr->mode)

◆ FMODE_PREP

#define FMODE_PREP   (1<<16)

◆ free

#define free (   x)    xfree(x)

◆ GetWriteIO

#define GetWriteIO (   io)    rb_io_get_write_io(io)

◆ IO_CBUF_CAPA_MIN

#define IO_CBUF_CAPA_MIN   (128*1024)

Definition at line 121 of file io.c.

Referenced by make_readconv().

◆ IO_RBUF_CAPA_FOR

#define IO_RBUF_CAPA_FOR (   fptr)    (NEED_READCONV(fptr) ? IO_CBUF_CAPA_MIN : IO_RBUF_CAPA_MIN)

Definition at line 122 of file io.c.

Referenced by io_fillbuf(), and io_ungetbyte().

◆ IO_RBUF_CAPA_MIN

#define IO_RBUF_CAPA_MIN   8192

Definition at line 120 of file io.c.

◆ io_seek

#define io_seek (   fptr,
  ofs,
  whence 
)    (errno = 0, lseek(flush_before_seek(fptr)->fd, (ofs), (whence)))

Definition at line 751 of file io.c.

Referenced by io_reopen(), rb_io_init_copy(), rb_io_rewind(), rb_io_seek(), and rb_io_set_pos().

◆ io_tell

#define io_tell (   fptr)    lseek(flush_before_seek(fptr)->fd, 0, SEEK_CUR)

Definition at line 752 of file io.c.

Referenced by io_reopen(), rb_io_init_copy(), and rb_io_tell().

◆ IO_WBUF_CAPA_MIN

#define IO_WBUF_CAPA_MIN   8192

Definition at line 123 of file io.c.

Referenced by io_binwrite().

◆ IS_PREP_STDIO

#define IS_PREP_STDIO (   f)    ((f)->mode & FMODE_PREP)

Definition at line 3977 of file io.c.

Referenced by fptr_finalize(), io_reopen(), and rb_io_reopen().

◆ is_socket

#define is_socket (   fd,
  path 
)    0

Definition at line 568 of file io.c.

Referenced by rb_io_close_read(), and rb_io_close_write().

◆ MODE_BINARY

#define MODE_BINARY (   a,
 
)    (a)

Referenced by rb_io_oflags_modestr().

◆ MODE_BTMODE

#define MODE_BTMODE (   a,
  b,
 
)
Value:
((fmode & FMODE_BINMODE) ? (b) : \
(fmode & FMODE_TEXTMODE) ? (c) : (a))
#define FMODE_BINMODE
Definition: io.h:106
#define fmode
#define FMODE_TEXTMODE
Definition: io.h:116

Definition at line 1288 of file io.c.

Referenced by do_writeconv(), rb_io_extract_modeenc(), and rb_io_fmode_modestr().

◆ MORE_CHAR_FINISHED

#define MORE_CHAR_FINISHED   Qnil

Definition at line 2139 of file io.c.

Referenced by appendline(), fill_cbuf(), io_getc(), more_char(), rb_io_each_codepoint(), read_all(), and swallow().

◆ MORE_CHAR_SUSPENDED

#define MORE_CHAR_SUSPENDED   Qtrue

Definition at line 2138 of file io.c.

Referenced by fill_cbuf(), more_char(), and read_all().

◆ NEED_NEWLINE_DECORATOR_ON_READ

#define NEED_NEWLINE_DECORATOR_ON_READ (   fptr)    ((fptr)->mode & FMODE_TEXTMODE)

Definition at line 413 of file io.c.

Referenced by pipe_open(), and rb_io_eof().

◆ NEED_NEWLINE_DECORATOR_ON_READ_CHECK

#define NEED_NEWLINE_DECORATOR_ON_READ_CHECK (   fptr)    (void)(fptr)

◆ NEED_NEWLINE_DECORATOR_ON_WRITE

#define NEED_NEWLINE_DECORATOR_ON_WRITE (   fptr)    ((fptr)->mode & FMODE_TEXTMODE)

Definition at line 414 of file io.c.

Referenced by pipe_open().

◆ NEED_READCONV

#define NEED_READCONV (   fptr)    ((fptr)->encs.enc2 != NULL || NEED_NEWLINE_DECORATOR_ON_READ(fptr))

◆ NEED_WRITECONV

#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 554 of file io.c.

Referenced by do_writeconv().

◆ NEXT_ARGF_FORWARD

#define NEXT_ARGF_FORWARD (   argc,
  argv 
)
Value:
do {\
if (!next_argv()) return Qnil;\
} while (0)
#define ARGF_FORWARD(argc, argv)
Definition: io.c:7654
int argc
Definition: ruby.c:130
#define Qnil
Definition: ruby.h:435
#define next_argv()
Definition: io.c:7651
char ** argv
Definition: ruby.c:131

Definition at line 7658 of file io.c.

Referenced by argf_readbyte().

◆ next_argv

#define next_argv ( )    argf_next_argv(argf)

◆ NOFILE

#define NOFILE   64

Definition at line 76 of file io.c.

◆ NUM2IOCTLREQ

#define NUM2IOCTLREQ (   num)    NUM2INT(num)

Definition at line 8530 of file io.c.

Referenced by rb_ioctl().

◆ numberof

#define numberof (   array)    (int)(sizeof(array) / sizeof((array)[0]))

Definition at line 118 of file io.c.

Referenced by rb_f_select(), and select_end().

◆ O_ACCMODE

#define O_ACCMODE   (O_RDONLY | O_WRONLY | O_RDWR)

Definition at line 98 of file io.c.

Referenced by Init_fcntl().

◆ off_t

#define off_t   long

◆ PIPE_BUF

#define PIPE_BUF   512 /* is this ok? */

Definition at line 109 of file io.c.

Referenced by io_writable_length().

◆ PREP_STDIO_NAME

#define PREP_STDIO_NAME (   f)    (RSTRING_PTR((f)->pathv))

Definition at line 3978 of file io.c.

Referenced by io_reopen(), and rb_io_reopen().

◆ rb_f_syscall

#define rb_f_syscall   rb_f_notimplement

Definition at line 9084 of file io.c.

Referenced by Init_IO().

◆ rb_intern

#define rb_intern (   str)    rb_intern_const(str)

◆ rb_io_close_on_exec_p

#define rb_io_close_on_exec_p   rb_f_notimplement

Definition at line 3915 of file io.c.

Referenced by Init_IO().

◆ rb_io_fcntl

#define rb_io_fcntl   rb_f_notimplement

Definition at line 8924 of file io.c.

Referenced by Init_IO().

◆ rb_io_fdatasync

#define rb_io_fdatasync   rb_io_fsync

Definition at line 1870 of file io.c.

Referenced by Init_IO().

◆ rb_io_fsync

#define rb_io_fsync   rb_f_notimplement

Definition at line 1822 of file io.c.

Referenced by Init_IO().

◆ rb_io_set_close_on_exec

#define rb_io_set_close_on_exec   rb_f_notimplement

Definition at line 3973 of file io.c.

Referenced by Init_IO().

◆ rb_io_sync

#define rb_io_sync   rb_f_notimplement

Definition at line 1823 of file io.c.

Referenced by Init_IO().

◆ rb_sys_fail_path

#define rb_sys_fail_path (   path)    rb_sys_fail_str(path)

◆ READ_CHAR_PENDING

#define READ_CHAR_PENDING (   fptr)    ((fptr)->cbuf.len)

◆ READ_CHAR_PENDING_COUNT

#define READ_CHAR_PENDING_COUNT (   fptr)    ((fptr)->cbuf.len)

Definition at line 377 of file io.c.

Referenced by swallow().

◆ READ_CHAR_PENDING_PTR

#define READ_CHAR_PENDING_PTR (   fptr)    ((fptr)->cbuf.ptr+(fptr)->cbuf.off)

Definition at line 378 of file io.c.

Referenced by swallow().

◆ READ_CHECK

#define READ_CHECK (   fptr)
Value:
do {\
if (!READ_DATA_PENDING(fptr)) {\
WAIT_FD_IN_WIN32(fptr);\
rb_io_check_closed(fptr);\
}\
} while(0)
#define READ_DATA_PENDING(fptr)
Definition: io.c:371

Definition at line 387 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().

◆ READ_DATA_BUFFERED

#define READ_DATA_BUFFERED (   fptr)    READ_DATA_PENDING(fptr)

Definition at line 374 of file io.c.

Referenced by rb_io_sysread(), and rb_io_sysseek().

◆ READ_DATA_PENDING

#define READ_DATA_PENDING (   fptr)    ((fptr)->rbuf.len)

Definition at line 371 of file io.c.

Referenced by io_bufread(), rb_io_eof(), rb_io_read_check(), rb_io_read_pending(), and select_internal().

◆ READ_DATA_PENDING_COUNT

#define READ_DATA_PENDING_COUNT (   fptr)    ((fptr)->rbuf.len)

Definition at line 372 of file io.c.

Referenced by appendline(), rb_io_getline_fast(), read_buffered_data(), remain_size(), and swallow().

◆ READ_DATA_PENDING_PTR

#define READ_DATA_PENDING_PTR (   fptr)    ((fptr)->rbuf.ptr+(fptr)->rbuf.off)

Definition at line 373 of file io.c.

Referenced by appendline(), rb_io_getline_fast(), and swallow().

◆ S_ISREG

#define S_ISREG (   m)    (((m) & S_IFMT) == S_IFREG)

Definition at line 880 of file io.c.

Referenced by remain_size(), and wsplit_p().

◆ SEEK_CUR

#define SEEK_CUR   1

Definition at line 756 of file io.c.

Referenced by fseeko(), Init_IO(), io_unread(), rb_chsize(), and remain_size().

◆ SEEK_END

#define SEEK_END   2

Definition at line 757 of file io.c.

Referenced by fseeko(), Init_IO(), and makroom().

◆ SEEK_SET

#define SEEK_SET   0

◆ SET_BINARY_MODE

#define SET_BINARY_MODE (   fptr)    (void)(fptr)

◆ SET_BINARY_MODE_WITH_SEEK_CUR

#define SET_BINARY_MODE_WITH_SEEK_CUR (   fptr)    (void)(fptr)

Definition at line 558 of file io.c.

Referenced by copy_stream_body(), rb_io_ascii8bit_binmode(), and rb_io_binmode().

◆ SET_UNIVERSAL_NEWLINE_DECORATOR_IF_ENC2

#define SET_UNIVERSAL_NEWLINE_DECORATOR_IF_ENC2 (   enc2,
  ecflags 
)    ((void)(enc2), (void)(ecflags))

Definition at line 557 of file io.c.

Referenced by io_encoding_set(), and rb_io_extract_modeenc().

◆ SHUT_RD

#define SHUT_RD   0

Referenced by bsock_shutdown(), and rb_io_close_read().

◆ SHUT_WR

#define SHUT_WR   1

◆ shutdown

#define shutdown (   a,
 
)    0

◆ SMALLBUF

#define SMALLBUF   100

Definition at line 2072 of file io.c.

◆ STDIO_READ_DATA_PENDING

#define STDIO_READ_DATA_PENDING (   fp)    (!feof(fp))

Definition at line 366 of file io.c.

Referenced by rb_read_check().

◆ WAIT_FD_IN_WIN32

#define WAIT_FD_IN_WIN32 (   fptr)

Definition at line 384 of file io.c.

Typedef Documentation

◆ convconfig_t

typedef struct rb_io_enc_t convconfig_t

Definition at line 5084 of file io.c.

◆ ioctl_req_t

typedef int ioctl_req_t

Definition at line 8529 of file io.c.

Function Documentation

◆ advice_arg_check()

static void advice_arg_check ( VALUE  advice)
static

◆ appendline()

static int appendline ( rb_io_t fptr,
int  delim,
VALUE strp,
long *  lp 
)
static

◆ argf_alloc()

static VALUE argf_alloc ( VALUE  klass)
static

Definition at line 7564 of file io.c.

References argf, argf_init(), argf_type, p, Qnil, and TypedData_Make_Struct.

Referenced by Init_IO().

◆ argf_argv()

static VALUE argf_argv ( VALUE  argf)
static

Definition at line 11475 of file io.c.

References ARGF.

Referenced by argf_argv_getter(), and Init_IO().

◆ argf_argv_getter()

static VALUE argf_argv_getter ( ID  id,
VALUE var 
)
static

Definition at line 11481 of file io.c.

References argf_argv().

Referenced by Init_IO().

◆ argf_binmode_m()

static VALUE argf_binmode_m ( VALUE  argf)
static

Definition at line 11271 of file io.c.

References argf, ARGF, ARGF_FORWARD, next_argv, and rb_io_ascii8bit_binmode().

Referenced by Init_IO().

◆ argf_binmode_p()

static VALUE argf_binmode_p ( VALUE  argf)
static

Definition at line 11294 of file io.c.

References ARGF, Qfalse, and Qtrue.

Referenced by Init_IO().

◆ argf_bytes()

static VALUE argf_bytes ( VALUE  argf)
static

Definition at line 11111 of file io.c.

References argf_each_byte(), ID2SYM, rb_block_given_p(), rb_enumeratorize(), rb_intern, and rb_warn().

Referenced by Init_IO().

◆ argf_chars()

static VALUE argf_chars ( VALUE  argf)
static

Definition at line 11151 of file io.c.

References argf_each_char(), ID2SYM, rb_block_given_p(), rb_enumeratorize(), rb_intern, and rb_warn().

Referenced by Init_IO().

◆ argf_close()

static void argf_close ( VALUE  file)
static

◆ argf_close_m()

static VALUE argf_close_m ( VALUE  argf)
static

Definition at line 11342 of file io.c.

References argf, ARGF, argf_close(), and next_argv.

Referenced by Init_IO().

◆ argf_closed()

static VALUE argf_closed ( VALUE  argf)
static

Definition at line 11361 of file io.c.

References ARGF, ARGF_FORWARD, next_argv, and rb_io_closed().

Referenced by Init_IO().

◆ argf_codepoints()

static VALUE argf_codepoints ( VALUE  argf)
static

Definition at line 11191 of file io.c.

References argf_each_codepoint(), ID2SYM, rb_block_given_p(), rb_enumeratorize(), rb_intern, and rb_warn().

Referenced by Init_IO().

◆ argf_each_byte()

static VALUE argf_each_byte ( VALUE  argf)
static

Definition at line 11096 of file io.c.

References argf, ARGF, next_argv, rb_block_call(), rb_intern, and RETURN_ENUMERATOR.

Referenced by argf_bytes(), and Init_IO().

◆ argf_each_char()

static VALUE argf_each_char ( VALUE  argf)
static

Definition at line 11136 of file io.c.

References argf, ARGF, next_argv, rb_block_call(), rb_intern, and RETURN_ENUMERATOR.

Referenced by argf_chars(), and Init_IO().

◆ argf_each_codepoint()

static VALUE argf_each_codepoint ( VALUE  argf)
static

Definition at line 11176 of file io.c.

References argf, ARGF, next_argv, rb_block_call(), rb_intern, and RETURN_ENUMERATOR.

Referenced by argf_codepoints(), and Init_IO().

◆ argf_each_line()

static VALUE argf_each_line ( int  argc,
VALUE argv,
VALUE  argf 
)
static

Definition at line 11048 of file io.c.

References argc, argf, ARGF, argv, next_argv, rb_block_call(), rb_intern, and RETURN_ENUMERATOR.

Referenced by argf_lines(), and Init_IO().

◆ argf_eof()

static VALUE argf_eof ( VALUE  argf)
static

Definition at line 10653 of file io.c.

References ARGF, ARGF_FORWARD, next_argv, Qfalse, Qtrue, rb_io_eof(), and RTEST.

Referenced by Init_IO().

◆ argf_external_encoding()

static VALUE argf_external_encoding ( VALUE  argf)
static

◆ argf_file()

static VALUE argf_file ( VALUE  argf)
static

Definition at line 11253 of file io.c.

References ARGF, and next_argv.

Referenced by Init_IO().

◆ argf_filename()

static VALUE argf_filename ( VALUE  argf)
static

Definition at line 11222 of file io.c.

References ARGF, and next_argv.

Referenced by argf_filename_getter(), and Init_IO().

◆ argf_filename_getter()

static VALUE argf_filename_getter ( ID  id,
VALUE var 
)
static

Definition at line 11229 of file io.c.

References argf_filename().

Referenced by Init_IO().

◆ argf_fileno()

static VALUE argf_fileno ( VALUE  argf)
static

Definition at line 10605 of file io.c.

References ARGF, ARGF_FORWARD, next_argv, rb_eArgError, rb_io_fileno(), and rb_raise().

Referenced by Init_IO().

◆ argf_forward()

static VALUE argf_forward ( int  argc,
VALUE argv,
VALUE  argf 
)
static

Definition at line 7646 of file io.c.

References argc, ARGF, argv, rb_frame_this_func(), and rb_funcall3().

Referenced by argf_forward_call(), and argf_read().

◆ argf_forward_call()

static VALUE argf_forward_call ( VALUE  arg)
static

Definition at line 10758 of file io.c.

References argf_forward(), p, and Qnil.

Referenced by argf_getpartial().

◆ argf_free()

static void argf_free ( void *  ptr)
static

Definition at line 7532 of file io.c.

References p, and xfree().

◆ argf_getbyte()

static VALUE argf_getbyte ( VALUE  argf)
static

Definition at line 10923 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().

◆ argf_getc()

static VALUE argf_getc ( VALUE  argf)
static

Definition at line 10883 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().

◆ argf_getline()

static VALUE argf_getline ( int  argc,
VALUE argv,
VALUE  argf 
)
static

◆ argf_getpartial()

static VALUE argf_getpartial ( int  argc,
VALUE argv,
VALUE  argf,
int  nonblock 
)
static

◆ argf_gets()

static VALUE argf_gets ( int  argc,
VALUE argv,
VALUE  argf 
)
static

Definition at line 7944 of file io.c.

References argc, argf_getline(), argv, and rb_lastline_set().

Referenced by argf_readline(), Init_IO(), and rb_f_gets().

◆ argf_init()

static void argf_init ( struct argf p,
VALUE  v 
)
inlinestatic

Definition at line 7555 of file io.c.

References p, Qnil, and v.

Referenced by argf_alloc(), and argf_initialize().

◆ argf_initialize()

static VALUE argf_initialize ( VALUE  argf,
VALUE  argv 
)
static

Definition at line 7577 of file io.c.

References argf, ARGF, argf_init(), and argv.

Referenced by Init_IO().

◆ argf_initialize_copy()

static VALUE argf_initialize_copy ( VALUE  argf,
VALUE  orig 
)
static

Definition at line 7587 of file io.c.

References argf, ARGF, argf_of, argf::inplace, OBJ_INIT_COPY, rb_obj_dup(), and ruby_strdup().

Referenced by Init_IO().

◆ argf_inplace_mode_get()

static VALUE argf_inplace_mode_get ( VALUE  argf)
static

Definition at line 11389 of file io.c.

References ARGF, Qnil, and rb_str_new2().

Referenced by Init_IO(), and opt_i_get().

◆ argf_inplace_mode_set()

static VALUE argf_inplace_mode_set ( VALUE  argf,
VALUE  val 
)
static

Definition at line 11422 of file io.c.

References argf, ARGF, free, OBJ_TAINTED, rb_insecure_operation(), rb_safe_level, RSTRING_PTR, RTEST, strdup, StringValue, and val.

Referenced by Init_IO(), and opt_i_set().

◆ argf_internal_encoding()

static VALUE argf_internal_encoding ( VALUE  argf)
static

◆ argf_lineno()

static VALUE argf_lineno ( VALUE  argf)
static

Definition at line 7640 of file io.c.

References ARGF, and INT2FIX.

Referenced by Init_IO().

◆ argf_lineno_getter()

static VALUE argf_lineno_getter ( ID  id,
VALUE var 
)
static

Definition at line 7870 of file io.c.

References ARGF, and INT2FIX.

Referenced by Init_IO().

◆ argf_lineno_setter()

static void argf_lineno_setter ( VALUE  val,
ID  id,
VALUE var 
)
static

Definition at line 7877 of file io.c.

References ARGF, NUM2INT, and val.

Referenced by Init_IO().

◆ argf_lines()

static VALUE argf_lines ( int  argc,
VALUE argv,
VALUE  argf 
)
static

Definition at line 11063 of file io.c.

References argc, argf_each_line(), argv, ID2SYM, rb_block_given_p(), rb_enumeratorize(), rb_intern, and rb_warn().

Referenced by Init_IO().

◆ argf_mark()

static void argf_mark ( void *  ptr)
static

Definition at line 7522 of file io.c.

References p, and rb_gc_mark().

◆ argf_memsize()

static size_t argf_memsize ( const void *  ptr)
static

Definition at line 7540 of file io.c.

References p, size, and strlen().

◆ argf_next_argv()

static int argf_next_argv ( VALUE  argf)
static

◆ argf_read()

static VALUE argf_read ( int  argc,
VALUE argv,
VALUE  argf 
)
static

◆ argf_read_nonblock()

static VALUE argf_read_nonblock ( int  argc,
VALUE argv,
VALUE  argf 
)
static

Definition at line 10813 of file io.c.

References argc, argf_getpartial(), and argv.

Referenced by Init_IO().

◆ argf_readbyte()

static VALUE argf_readbyte ( VALUE  argf)
static

Definition at line 11003 of file io.c.

References argf_getbyte(), NEXT_ARGF_FORWARD, NIL_P, and rb_eof_error().

Referenced by Init_IO().

◆ argf_readchar()

static VALUE argf_readchar ( VALUE  argf)
static

Definition at line 10963 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().

◆ argf_readline()

static VALUE argf_readline ( int  argc,
VALUE argv,
VALUE  argf 
)
static

Definition at line 8019 of file io.c.

References argc, ARGF_FORWARD, argf_gets(), argv, next_argv, NIL_P, and rb_eof_error().

Referenced by Init_IO(), and rb_f_readline().

◆ argf_readlines()

static VALUE argf_readlines ( int  argc,
VALUE argv,
VALUE  argf 
)
static

◆ argf_readpartial()

static VALUE argf_readpartial ( int  argc,
VALUE argv,
VALUE  argf 
)
static

Definition at line 10799 of file io.c.

References argc, argf_getpartial(), and argv.

Referenced by Init_IO().

◆ argf_rewind()

static VALUE argf_rewind ( VALUE  argf)
static

Definition at line 10585 of file io.c.

References ARGF, ARGF_FORWARD, next_argv, rb_eArgError, rb_io_rewind(), and rb_raise().

Referenced by Init_IO().

◆ argf_seek_m()

static VALUE argf_seek_m ( int  argc,
VALUE argv,
VALUE  argf 
)
static

Definition at line 10542 of file io.c.

References argc, ARGF, ARGF_FORWARD, argv, next_argv, rb_eArgError, rb_io_seek_m(), and rb_raise().

Referenced by Init_IO().

◆ argf_set_encoding()

static VALUE argf_set_encoding ( int  argc,
VALUE argv,
VALUE  argf 
)
static

Definition at line 10499 of file io.c.

References argc, argf, ARGF, argv, rb_io_t::encs, GetOpenFile, next_argv, rb_eArgError, rb_io_set_encoding(), and rb_raise().

Referenced by Init_IO().

◆ argf_set_lineno()

static VALUE argf_set_lineno ( VALUE  argf,
VALUE  val 
)
static

Definition at line 7619 of file io.c.

References ARGF, NUM2INT, Qnil, and val.

Referenced by Init_IO().

◆ argf_set_pos()

static VALUE argf_set_pos ( VALUE  argf,
VALUE  offset 
)
static

Definition at line 10563 of file io.c.

References ARGF, ARGF_FORWARD, next_argv, rb_eArgError, rb_io_set_pos(), and rb_raise().

Referenced by Init_IO().

◆ argf_skip()

static VALUE argf_skip ( VALUE  argf)
static

Definition at line 11314 of file io.c.

References argf, ARGF, and argf_close().

Referenced by Init_IO().

◆ argf_tell()

static VALUE argf_tell ( VALUE  argf)
static

Definition at line 10525 of file io.c.

References ARGF, ARGF_FORWARD, next_argv, rb_eArgError, rb_io_tell(), and rb_raise().

Referenced by Init_IO().

◆ argf_to_io()

static VALUE argf_to_io ( VALUE  argf)
static

Definition at line 10627 of file io.c.

References ARGF, ARGF_FORWARD, and next_argv.

Referenced by Init_IO().

◆ argf_to_s()

static VALUE argf_to_s ( VALUE  argf)
static

Definition at line 11375 of file io.c.

References rb_str_new2().

Referenced by Init_IO().

◆ argf_write()

static VALUE argf_write ( VALUE  argf,
VALUE  str 
)
static

Definition at line 11515 of file io.c.

References argf_write_io(), and rb_io_write().

Referenced by Init_IO().

◆ argf_write_io()

static VALUE argf_write_io ( VALUE  argf)
static

Definition at line 11500 of file io.c.

References ARGF, GetWriteIO, rb_eIOError, rb_raise(), and RTEST.

Referenced by argf_write(), and Init_IO().

◆ bufread_call()

static VALUE bufread_call ( VALUE  arg)
static

Definition at line 2039 of file io.c.

References io_bufread(), p, and Qundef.

Referenced by io_fread().

◆ check_pipe_command()

static VALUE check_pipe_command ( VALUE  filename_or_command)
static

Definition at line 6269 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().

◆ clear_codeconv()

static void clear_codeconv ( rb_io_t fptr)
static

◆ clear_readconv()

static void clear_readconv ( rb_io_t fptr)
static

◆ clear_writeconv()

static void clear_writeconv ( rb_io_t fptr)
static

◆ copy_stream_body()

static VALUE copy_stream_body ( VALUE  arg)
static

◆ copy_stream_fallback()

static VALUE copy_stream_fallback ( struct copy_stream_struct stp)
static

◆ copy_stream_fallback_body()

static VALUE copy_stream_fallback_body ( VALUE  arg)
static

◆ copy_stream_finalize()

static VALUE copy_stream_finalize ( VALUE  arg)
static

◆ do_ioctl()

static int do_ioctl ( int  fd,
ioctl_req_t  cmd,
long  narg 
)
static

Definition at line 8548 of file io.c.

References ioctl_arg::cmd, ioctl_arg::fd, ioctl_arg::narg, nogvl_ioctl(), and rb_thread_io_blocking_region().

Referenced by rb_ioctl().

◆ do_writeconv()

static VALUE do_writeconv ( VALUE  str,
rb_io_t fptr 
)
static

◆ exec_interrupts()

static void* exec_interrupts ( void *  arg)
static

Definition at line 9675 of file io.c.

References NULL, and rb_thread_execute_interrupts().

Referenced by maygvl_copy_stream_continue_p().

◆ extract_binmode()

static void extract_binmode ( VALUE  opthash,
int *  fmode 
)
static

◆ fcntl_narg_len()

static long fcntl_narg_len ( int  cmd)
static

Definition at line 8736 of file io.c.

Referenced by setup_narg().

◆ fill_cbuf()

static VALUE fill_cbuf ( rb_io_t fptr,
int  ec_flags 
)
static

◆ find_encoding()

static rb_encoding* find_encoding ( VALUE  v)
static

Definition at line 9094 of file io.c.

References rb_find_encoding(), StringValueCStr, unsupported_encoding(), and v.

Referenced by io_encoding_set().

◆ finish_writeconv()

static VALUE finish_writeconv ( rb_io_t fptr,
int  noalloc 
)
static

◆ finish_writeconv_sync()

static VALUE finish_writeconv_sync ( VALUE  arg)
static

Definition at line 4049 of file io.c.

References finish_writeconv(), and p.

Referenced by fptr_finalize().

◆ flush_before_seek()

static rb_io_t * flush_before_seek ( rb_io_t fptr)
static

Definition at line 742 of file io.c.

References errno, io_fflush(), io_unread(), and rb_sys_fail().

◆ fptr_finalize()

static void fptr_finalize ( rb_io_t fptr,
int  noraise 
)
static

◆ ignore_closed_stream()

static VALUE ignore_closed_stream ( VALUE  io,
VALUE  exc 
)
static

Definition at line 4298 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().

◆ Init_IO()

void Init_IO ( void  )

Definition at line 11676 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(), NULL, O_BINARY, OBJ_FREEZE, opt_i_get(), opt_i_set(), orig_stderr, orig_stdout, pipe_atexit(), prep_stdio(), Qnil, rb_cFile, rb_cIO, rb_class_new(), rb_class_new_instance(), rb_cObject, rb_default_rs, rb_deferr, rb_define_alias(), rb_define_alloc_func(), rb_define_class(), rb_define_const(), rb_define_global_const(), rb_define_global_function(), rb_define_hooked_variable(), rb_define_method(), rb_define_module_under(), rb_define_readonly_variable(), rb_define_singleton_method(), rb_define_variable(), rb_define_virtual_variable(), rb_eEOFError, 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_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_io_write_nonblock(), 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_dontneed, sym_encoding, sym_extenc, sym_intenc, sym_mode, sym_noreuse, sym_normal, sym_open_args, sym_perm, sym_random, sym_sequential, sym_textmode, and sym_willneed.

◆ internal_read_func()

static VALUE internal_read_func ( void *  ptr)
static

◆ internal_write_func()

static VALUE internal_write_func ( void *  ptr)
static

◆ internal_write_func2()

static void* internal_write_func2 ( void *  ptr)
static

◆ io_alloc()

static VALUE io_alloc ( VALUE  klass)
static

Definition at line 870 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(), and rb_io_open_with_args().

◆ io_binwrite()

static long io_binwrite ( VALUE  str,
const char *  ptr,
long  len,
rb_io_t fptr,
int  nosync 
)
static

◆ io_binwrite_string()

static VALUE io_binwrite_string ( VALUE  arg)
static

Definition at line 1202 of file io.c.

References io_writable_length(), p, and rb_write_internal2().

Referenced by io_binwrite().

◆ io_bufread()

static long io_bufread ( char *  ptr,
long  len,
rb_io_t fptr 
)
static

◆ io_call_close()

static VALUE io_call_close ( VALUE  io)
static

Definition at line 4291 of file io.c.

References rb_check_funcall(), and rb_intern.

Referenced by io_close().

◆ io_check_tty()

static void io_check_tty ( rb_io_t fptr)
static

Definition at line 5349 of file io.c.

References rb_io_t::fd, FMODE_DUPLEX, FMODE_TTY, and rb_io_t::mode.

Referenced by prep_io(), rb_file_open_generic(), and rb_io_initialize().

◆ io_close()

static VALUE io_close ( VALUE  io)
static

◆ io_enc_str()

static VALUE io_enc_str ( VALUE  str,
rb_io_t fptr 
)
static

Definition at line 2104 of file io.c.

References io_read_encoding(), OBJ_TAINT, and rb_enc_associate().

Referenced by io_getc(), rb_io_getline_1(), rb_io_getline_fast(), and read_all().

◆ io_encname_bom_p()

static int io_encname_bom_p ( const char *  name,
long  len 
)
static

Definition at line 4745 of file io.c.

References read_internal_arg::len, name, p, strchr(), strlen(), and STRNCASECMP.

Referenced by parse_mode_enc(), and rb_io_modestr_fmode().

◆ io_encoding_set()

static void io_encoding_set ( rb_io_t fptr,
VALUE  v1,
VALUE  v2,
VALUE  opt 
)
static

◆ io_fflush()

static int io_fflush ( rb_io_t fptr)
static

◆ io_fillbuf()

static int io_fillbuf ( rb_io_t fptr)
static

◆ io_flush_buffer()

static int io_flush_buffer ( rb_io_t fptr)
inlinestatic

◆ io_flush_buffer_async()

static VALUE io_flush_buffer_async ( VALUE  arg)
static

Definition at line 1017 of file io.c.

References rb_io_t::fd, io_flush_buffer_sync(), and rb_thread_io_blocking_region().

Referenced by io_flush_buffer().

◆ io_flush_buffer_async2()

static VALUE io_flush_buffer_async2 ( VALUE  arg)
static

Definition at line 1024 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().

◆ io_flush_buffer_sync()

static VALUE io_flush_buffer_sync ( void *  arg)
static

◆ io_flush_buffer_sync2()

static void* io_flush_buffer_sync2 ( void *  arg)
static

Definition at line 1005 of file io.c.

References io_flush_buffer_sync(), and result.

Referenced by io_flush_buffer_async2().

◆ io_fread()

static long io_fread ( VALUE  str,
long  offset,
long  size,
rb_io_t fptr 
)
static

◆ io_fwrite()

static long io_fwrite ( VALUE  str,
rb_io_t fptr,
int  nosync 
)
static

◆ io_getc()

static VALUE io_getc ( rb_io_t fptr,
rb_encoding enc 
)
static

◆ io_getpartial()

static VALUE io_getpartial ( int  argc,
VALUE argv,
VALUE  io,
int  nonblock 
)
static

◆ io_input_encoding()

static rb_encoding * io_input_encoding ( rb_io_t fptr)
static

◆ io_new_instance()

static VALUE io_new_instance ( VALUE  args)
static

Definition at line 9088 of file io.c.

References args, and rb_class_new_instance().

Referenced by rb_io_s_pipe().

◆ io_puts_ary()

static VALUE io_puts_ary ( VALUE  ary,
VALUE  out,
int  recur 
)
static

Definition at line 6885 of file io.c.

References i, NIL_P, Qfalse, Qtrue, RARRAY_LEN, RARRAY_PTR, rb_check_array_type(), rb_io_puts(), rb_str_new2(), and recur.

Referenced by rb_io_puts().

◆ io_read()

static VALUE io_read ( int  argc,
VALUE argv,
VALUE  io 
)
static

◆ io_read_encoding()

static rb_encoding* io_read_encoding ( rb_io_t fptr)
static

◆ io_read_nonblock()

static VALUE io_read_nonblock ( int  argc,
VALUE argv,
VALUE  io 
)
static

Definition at line 2555 of file io.c.

References argc, argv, io_getpartial(), NIL_P, and rb_eof_error().

Referenced by Init_IO().

◆ io_readpartial()

static VALUE io_readpartial ( int  argc,
VALUE argv,
VALUE  io 
)
static

Definition at line 2493 of file io.c.

References argc, argv, io_getpartial(), NIL_P, and rb_eof_error().

Referenced by Init_IO().

◆ io_reopen()

static VALUE io_reopen ( VALUE  io,
VALUE  nfile 
)
static

◆ io_s_foreach()

static VALUE io_s_foreach ( struct foreach_arg arg)
static

Definition at line 9342 of file io.c.

References foreach_arg::argc, foreach_arg::argv, foreach_arg::io, NIL_P, Qnil, rb_io_gets_m(), and rb_yield().

Referenced by rb_io_s_foreach().

◆ io_s_read()

static VALUE io_s_read ( struct foreach_arg arg)
static

Definition at line 9429 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().

◆ io_s_readlines()

static VALUE io_s_readlines ( struct foreach_arg arg)
static

Definition at line 9393 of file io.c.

References foreach_arg::argc, foreach_arg::argv, foreach_arg::io, and rb_io_readlines().

Referenced by rb_io_s_readlines().

◆ io_s_write()

static VALUE io_s_write ( int  argc,
VALUE argv,
int  binary 
)
static

◆ io_s_write0()

static VALUE io_s_write0 ( struct write_arg arg)
static

Definition at line 9542 of file io.c.

References write_arg::io, io_write(), write_arg::nosync, and write_arg::str.

Referenced by io_s_write().

◆ io_set_encoding_by_bom()

static void io_set_encoding_by_bom ( VALUE  io)
static

◆ io_set_read_length()

static void io_set_read_length ( VALUE  str,
long  n 
)
static

Definition at line 2273 of file io.c.

References rb_str_modify(), rb_str_set_len(), and RSTRING_LEN.

Referenced by io_getpartial(), io_read(), and rb_io_sysread().

◆ io_setstrbuf()

static void io_setstrbuf ( VALUE str,
long  len 
)
static

◆ io_shift_cbuf()

static VALUE io_shift_cbuf ( rb_io_t fptr,
int  len,
VALUE strp 
)
static

◆ io_strip_bom()

static int io_strip_bom ( VALUE  io)
static

◆ io_ungetbyte()

static void io_ungetbyte ( VALUE  str,
rb_io_t fptr 
)
static

◆ io_unread()

static void io_unread ( rb_io_t fptr)
static

◆ io_writable_length()

static long io_writable_length ( rb_io_t fptr,
long  l 
)
static

Definition at line 974 of file io.c.

References PIPE_BUF, rb_thread_alone(), and wsplit_p().

Referenced by io_binwrite(), io_binwrite_string(), and io_flush_buffer_sync().

◆ io_write()

static VALUE io_write ( VALUE  io,
VALUE  str,
int  nosync 
)
static

◆ io_write_m()

static VALUE io_write_m ( VALUE  io,
VALUE  str 
)
static

Definition at line 1417 of file io.c.

References io_write(), and binwrite_arg::str.

Referenced by Init_IO().

◆ ioctl_narg_len()

static long ioctl_narg_len ( ioctl_req_t  cmd)
static

Definition at line 8586 of file io.c.

References ioctl_arg::cmd, and DEFULT_IOCTL_NARG_LEN.

Referenced by setup_narg().

◆ is_popen_fork()

static int is_popen_fork ( VALUE  prog)
static

Definition at line 5964 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().

◆ make_readconv()

static void make_readconv ( rb_io_t fptr,
int  size 
)
static

◆ make_writeconv()

static void make_writeconv ( rb_io_t fptr)
static

◆ maygvl_close()

static int maygvl_close ( int  fd,
int  keepgvl 
)
static

Definition at line 4064 of file io.c.

References nogvl_close(), rb_thread_call_without_gvl(), and RUBY_UBF_IO.

Referenced by fptr_finalize().

◆ maygvl_copy_stream_continue_p()

static int maygvl_copy_stream_continue_p ( int  has_gvl,
struct copy_stream_struct stp 
)
static

◆ maygvl_copy_stream_read()

static ssize_t maygvl_copy_stream_read ( int  has_gvl,
struct copy_stream_struct stp,
char *  buf,
size_t  len,
off_t  offset 
)
static

◆ maygvl_copy_stream_wait_read()

static int maygvl_copy_stream_wait_read ( int  has_gvl,
struct copy_stream_struct stp 
)
static

◆ maygvl_fclose()

static int maygvl_fclose ( FILE file,
int  keepgvl 
)
static

Definition at line 4085 of file io.c.

References nogvl_fclose(), rb_thread_call_without_gvl(), and RUBY_UBF_IO.

Referenced by fptr_finalize().

◆ maygvl_read()

static ssize_t maygvl_read ( int  has_gvl,
int  fd,
void *  buf,
size_t  count 
)
static

Definition at line 9911 of file io.c.

References buf, count, and rb_read_internal().

Referenced by maygvl_copy_stream_read().

◆ maygvl_select()

static int maygvl_select ( int  has_gvl,
int  n,
rb_fdset_t rfds,
rb_fdset_t wfds,
rb_fdset_t efds,
struct timeval timeout 
)
static

Definition at line 9707 of file io.c.

References rb_fd_select, and rb_thread_fd_select().

Referenced by maygvl_copy_stream_wait_read().

◆ more_char()

static VALUE more_char ( rb_io_t fptr)
static

◆ must_respond_to()

static void must_respond_to ( ID  mid,
VALUE  val,
ID  id 
)
static

Definition at line 7122 of file io.c.

References rb_eTypeError, rb_id2name(), rb_obj_classname(), rb_raise(), rb_respond_to(), and val.

Referenced by stdout_setter().

◆ nogvl_close()

static void* nogvl_close ( void *  ptr)
static

Definition at line 4056 of file io.c.

Referenced by maygvl_close().

◆ nogvl_copy_stream_func()

static void* nogvl_copy_stream_func ( void *  arg)
static

Definition at line 10046 of file io.c.

References nogvl_copy_stream_read_write().

Referenced by copy_stream_body().

◆ nogvl_copy_stream_read_write()

static void nogvl_copy_stream_read_write ( struct copy_stream_struct stp)
static

◆ nogvl_copy_stream_wait_write()

static int nogvl_copy_stream_wait_write ( struct copy_stream_struct stp)
static

◆ nogvl_copy_stream_write()

static int nogvl_copy_stream_write ( struct copy_stream_struct stp,
char *  buf,
size_t  len 
)
static

◆ nogvl_fclose()

static void* nogvl_fclose ( void *  ptr)
static

Definition at line 4077 of file io.c.

Referenced by maygvl_fclose().

◆ nogvl_ioctl()

static VALUE nogvl_ioctl ( void *  ptr)
static

Definition at line 8540 of file io.c.

References ioctl_arg::cmd, ioctl_arg::fd, ioctl(), and ioctl_arg::narg.

Referenced by do_ioctl().

◆ open_key_args()

static void open_key_args ( int  argc,
VALUE argv,
VALUE  opt,
struct foreach_arg arg 
)
static

◆ opt_i_get()

static VALUE opt_i_get ( ID  id,
VALUE var 
)
static

Definition at line 11396 of file io.c.

References argf_inplace_mode_get().

Referenced by Init_IO().

◆ opt_i_set()

static void opt_i_set ( VALUE  val,
ID  id,
VALUE var 
)
static

Definition at line 11441 of file io.c.

References argf_inplace_mode_set(), and val.

Referenced by Init_IO().

◆ parse_mode_enc()

static void parse_mode_enc ( const char *  estr,
rb_encoding **  enc_p,
rb_encoding **  enc2_p,
int *  fmode_p 
)
static

◆ pipe_add_fptr()

static void pipe_add_fptr ( rb_io_t fptr)
static

Definition at line 5510 of file io.c.

References ALLOC, pipe_list::fptr, list, and pipe_list.

Referenced by io_reopen(), pipe_open(), and rb_io_init_copy().

◆ pipe_atexit()

static void pipe_atexit ( void  )
static

Definition at line 5544 of file io.c.

References list, pipe_list, and rb_io_fptr_finalize().

Referenced by Init_IO().

◆ pipe_del_fptr()

static void pipe_del_fptr ( rb_io_t fptr)
static

Definition at line 5521 of file io.c.

References pipe_list::fptr, free, list, and pipe_list.

Referenced by pipe_finalize().

◆ pipe_finalize()

static void pipe_finalize ( rb_io_t fptr,
int  noraise 
)
static

◆ pipe_open()

static VALUE pipe_open ( VALUE  execarg_obj,
const char *  modestr,
int  fmode,
convconfig_t convconfig 
)
static

◆ pipe_open_s()

static VALUE pipe_open_s ( VALUE  prog,
const char *  modestr,
int  fmode,
convconfig_t convconfig 
)
static

Definition at line 5978 of file io.c.

References argc, argv, fmode, is_popen_fork(), pipe_open(), Qnil, rb_execarg_new(), and TRUE.

Referenced by rb_f_backquote(), and rb_io_open().

◆ pipe_pair_close()

static VALUE pipe_pair_close ( VALUE  rw)
static

Definition at line 9165 of file io.c.

References io_close(), and rb_ensure().

Referenced by rb_io_s_pipe().

◆ prep_io()

static VALUE prep_io ( int  fd,
int  fmode,
VALUE  klass,
const char *  path 
)
static

◆ prep_stdio()

static VALUE prep_stdio ( FILE f,
int  fmode,
VALUE  klass,
const char *  path 
)
static

◆ prepare_getline_args()

static void prepare_getline_args ( int  argc,
VALUE argv,
VALUE rsp,
long *  limit,
VALUE  io 
)
static

◆ rb_cloexec_dup()

int rb_cloexec_dup ( int  oldfd)

Definition at line 225 of file io.c.

References rb_cloexec_fcntl_dupfd().

Referenced by ossl_obj2bio(), pty_getpty(), and ruby_dup().

◆ rb_cloexec_dup2()

int rb_cloexec_dup2 ( int  oldfd,
int  newfd 
)

Definition at line 232 of file io.c.

References dup2(), errno, O_CLOEXEC, rb_maygvl_fd_fix_cloexec(), and rb_w32_get_osfhandle().

Referenced by io_reopen(), and rb_io_reopen().

◆ rb_cloexec_fcntl_dupfd()

int rb_cloexec_fcntl_dupfd ( int  fd,
int  minfd 
)

Definition at line 308 of file io.c.

References errno, F_DUPFD, fcntl(), and rb_maygvl_fd_fix_cloexec().

Referenced by rb_cloexec_dup().

◆ rb_cloexec_open()

int rb_cloexec_open ( const char *  pathname,
int  flags,
mode_t  mode 
)

◆ rb_cloexec_pipe()

int rb_cloexec_pipe ( int  fildes[2])

Definition at line 271 of file io.c.

References errno, O_CLOEXEC, and rb_maygvl_fd_fix_cloexec().

Referenced by rb_pipe().

◆ rb_econv_memsize()

size_t rb_econv_memsize ( rb_econv_t )

◆ rb_eof_error()

void rb_eof_error ( void  )

◆ rb_f_backquote()

static VALUE rb_f_backquote ( VALUE  obj,
VALUE  str 
)
static

◆ rb_f_gets()

static VALUE rb_f_gets ( int  argc,
VALUE argv,
VALUE  recv 
)
static

Definition at line 7920 of file io.c.

References argc, argf_gets(), argv, and rb_funcall2().

Referenced by Init_IO(), and rb_gets().

◆ rb_f_open()

static VALUE rb_f_open ( int  argc,
VALUE argv 
)
static

◆ rb_f_p()

static VALUE rb_f_p ( int  argc,
VALUE argv,
VALUE  self 
)
static

Definition at line 7036 of file io.c.

References argc, rb_f_p_arg::argc, argv, rb_f_p_arg::argv, rb_f_p_internal(), and rb_uninterruptible().

Referenced by Init_IO().

◆ rb_f_p_internal()

static VALUE rb_f_p_internal ( VALUE  arg)
static

Definition at line 6994 of file io.c.

References argc, rb_f_p_arg::argc, argv, rb_f_p_arg::argv, i, Qnil, rb_ary_new4(), rb_io_flush(), rb_p(), rb_stdout, RB_TYPE_P, and T_FILE.

Referenced by rb_f_p().

◆ rb_f_print()

static VALUE rb_f_print ( int  argc,
VALUE argv 
)
static

Definition at line 6808 of file io.c.

References argc, argv, Qnil, rb_io_print(), and rb_stdout.

Referenced by Init_IO().

◆ rb_f_printf()

static VALUE rb_f_printf ( int  argc,
VALUE argv 
)
static

Definition at line 6719 of file io.c.

References argc, argv, Qnil, rb_f_sprintf(), rb_io_write(), rb_stdout, RB_TYPE_P, and T_STRING.

Referenced by Init_IO().

◆ rb_f_putc()

static VALUE rb_f_putc ( VALUE  recv,
VALUE  ch 
)
static

Definition at line 6860 of file io.c.

References rb_funcall2(), rb_intern, rb_io_putc(), and rb_stdout.

Referenced by Init_IO().

◆ rb_f_puts()

static VALUE rb_f_puts ( int  argc,
VALUE argv,
VALUE  recv 
)
static

Definition at line 6965 of file io.c.

References argc, argv, rb_funcall2(), rb_intern, rb_io_puts(), and rb_stdout.

Referenced by Init_IO().

◆ rb_f_readline()

static VALUE rb_f_readline ( int  argc,
VALUE argv,
VALUE  recv 
)
static

Definition at line 7993 of file io.c.

References argc, argf_readline(), argv, rb_funcall2(), and rb_intern.

Referenced by Init_IO().

◆ rb_f_readlines()

static VALUE rb_f_readlines ( int  argc,
VALUE argv,
VALUE  recv 
)
static

Definition at line 8046 of file io.c.

References argc, argf_readlines(), argv, rb_funcall2(), and rb_intern.

Referenced by Init_IO().

◆ rb_f_select()

static VALUE rb_f_select ( int  argc,
VALUE argv,
VALUE  obj 
)
static

Definition at line 8503 of file io.c.

References argc, args, argv, i, NIL_P, numberof, rb_ensure(), rb_fd_init, rb_scan_args(), rb_time_interval(), select_call(), and select_end().

Referenced by Init_IO().

◆ rb_fd_fix_cloexec()

void rb_fd_fix_cloexec ( int  fd)

◆ rb_fdopen()

FILE* rb_fdopen ( int  fd,
const char *  modestr 
)

Definition at line 5310 of file io.c.

References errno, NULL, rb_gc(), rb_sys_fail(), and rb_warn().

Referenced by rb_io_stdio_file().

◆ rb_file_initialize()

static VALUE rb_file_initialize ( int  argc,
VALUE argv,
VALUE  io 
)
static

◆ rb_file_open()

VALUE rb_file_open ( const char *  fname,
const char *  modestr 
)

◆ rb_file_open_generic()

static VALUE rb_file_open_generic ( VALUE  io,
VALUE  filename,
int  oflags,
int  fmode,
convconfig_t convconfig,
mode_t  perm 
)
static

◆ rb_file_open_internal()

static VALUE rb_file_open_internal ( VALUE  io,
VALUE  filename,
const char *  modestr 
)
static

◆ rb_file_open_str()

VALUE rb_file_open_str ( VALUE  fname,
const char *  modestr 
)

◆ rb_get_argv()

VALUE rb_get_argv ( void  )

Definition at line 11487 of file io.c.

References ARGF.

◆ rb_gets()

VALUE rb_gets ( void  )

◆ rb_io_addstr()

VALUE rb_io_addstr ( VALUE  io,
VALUE  str 
)

Definition at line 1445 of file io.c.

References rb_io_write(), and binwrite_arg::str.

Referenced by Init_IO().

◆ rb_io_advise()

static VALUE rb_io_advise ( int  argc,
VALUE argv,
VALUE  io 
)
static

Definition at line 8428 of file io.c.

References advice_arg_check(), argc, argv, GetOpenFile, GetWriteIO, NIL_P, NUM2OFFT, off_t, Qnil, and rb_scan_args().

Referenced by Init_IO().

◆ rb_io_ascii8bit_binmode()

VALUE rb_io_ascii8bit_binmode ( VALUE  io)

◆ rb_io_autoclose_p()

static VALUE rb_io_autoclose_p ( VALUE  io)
static

Definition at line 7483 of file io.c.

References FMODE_PREP, rb_io_t::mode, Qfalse, Qtrue, rb_io_check_closed(), rb_secure(), and RFILE.

Referenced by Init_IO().

◆ rb_io_binmode()

VALUE rb_io_binmode ( VALUE  io)

◆ rb_io_binmode_m()

static VALUE rb_io_binmode_m ( VALUE  io)
static

Definition at line 4694 of file io.c.

References GetWriteIO, and rb_io_ascii8bit_binmode().

Referenced by Init_IO(), and io_s_write().

◆ rb_io_binmode_p()

static VALUE rb_io_binmode_p ( VALUE  io)
static

Definition at line 4713 of file io.c.

References FMODE_BINMODE, GetOpenFile, rb_io_t::mode, Qfalse, and Qtrue.

Referenced by Init_IO().

◆ rb_io_bufread()

ssize_t rb_io_bufread ( VALUE  io,
void *  buf,
size_t  size 
)

Definition at line 2063 of file io.c.

References buf, bufread_arg::fptr, GetOpenFile, io_bufread(), rb_io_check_readable(), and size.

◆ rb_io_bufwrite()

ssize_t rb_io_bufwrite ( VALUE  io,
const void *  buf,
size_t  size 
)

Definition at line 1360 of file io.c.

References buf, binwrite_arg::fptr, GetOpenFile, io_binwrite(), rb_io_check_writable(), and size.

◆ rb_io_bytes()

static VALUE rb_io_bytes ( VALUE  io)
static

Definition at line 3378 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().

◆ rb_io_chars()

static VALUE rb_io_chars ( VALUE  io)
static

Definition at line 3532 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().

◆ rb_io_check_byte_readable()

void rb_io_check_byte_readable ( rb_io_t fptr)

◆ rb_io_check_char_readable()

void rb_io_check_char_readable ( rb_io_t fptr)

◆ rb_io_check_closed()

void rb_io_check_closed ( rb_io_t fptr)

◆ rb_io_check_initialized()

void rb_io_check_initialized ( rb_io_t fptr)

◆ rb_io_check_io()

VALUE rb_io_check_io ( VALUE  io)

◆ rb_io_check_readable()

void rb_io_check_readable ( rb_io_t fptr)

◆ rb_io_check_writable()

void rb_io_check_writable ( rb_io_t fptr)

◆ rb_io_close()

VALUE rb_io_close ( VALUE  io)

◆ rb_io_close_m()

static VALUE rb_io_close_m ( VALUE  io)
static

◆ rb_io_close_read()

static VALUE rb_io_close_read ( VALUE  io)
static

◆ rb_io_close_write()

static VALUE rb_io_close_write ( VALUE  io)
static

◆ rb_io_closed()

static VALUE rb_io_closed ( VALUE  io)
static

Definition at line 4340 of file io.c.

References rb_io_t::fd, finish_writeconv_arg::fptr, GetWriteIO, Qfalse, Qtrue, rb_io_check_initialized(), and RFILE.

Referenced by argf_closed(), and Init_IO().

◆ rb_io_codepoints()

static VALUE rb_io_codepoints ( VALUE  io)
static

Definition at line 3642 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().

◆ rb_io_each_byte()

static VALUE rb_io_each_byte ( VALUE  io)
static

◆ rb_io_each_char()

static VALUE rb_io_each_char ( VALUE  io)
static

◆ rb_io_each_codepoint()

static VALUE rb_io_each_codepoint ( VALUE  io)
static

◆ rb_io_each_line()

static VALUE rb_io_each_line ( int  argc,
VALUE argv,
VALUE  io 
)
static

◆ rb_io_eof()

VALUE rb_io_eof ( VALUE  io)

◆ rb_io_ext_int_to_encs()

static void rb_io_ext_int_to_encs ( rb_encoding ext,
rb_encoding intern,
rb_encoding **  enc,
rb_encoding **  enc2,
int  fmode 
)
static

◆ rb_io_external_encoding()

static VALUE rb_io_external_encoding ( VALUE  io)
static

◆ rb_io_extract_encoding_option()

int rb_io_extract_encoding_option ( VALUE  opt,
rb_encoding **  enc_p,
rb_encoding **  enc2_p,
int *  fmode_p 
)

◆ rb_io_extract_modeenc()

static void rb_io_extract_modeenc ( VALUE vmode_p,
VALUE vperm_p,
VALUE  opthash,
int *  oflags_p,
int *  fmode_p,
convconfig_t convconfig_p 
)
static

◆ rb_io_fdopen()

VALUE rb_io_fdopen ( int  fd,
int  oflags,
const char *  path 
)

Definition at line 7161 of file io.c.

References prep_io(), rb_cFile, rb_cIO, and rb_io_oflags_fmode().

Referenced by load_file_internal().

◆ rb_io_fileno()

static VALUE rb_io_fileno ( VALUE  io)
static

Definition at line 1886 of file io.c.

References rb_io_t::fd, binwrite_arg::fptr, INT2FIX, rb_io_check_closed(), and RFILE.

Referenced by argf_fileno(), and Init_IO().

◆ rb_io_flush()

VALUE rb_io_flush ( VALUE  io)

◆ rb_io_fmode_modestr()

static const char* rb_io_fmode_modestr ( int  fmode)
static

◆ rb_io_fmode_oflags()

static int rb_io_fmode_oflags ( int  fmode)
static

◆ rb_io_fptr_cleanup()

static void rb_io_fptr_cleanup ( rb_io_t fptr,
int  noraise 
)
static

◆ rb_io_fptr_finalize()

int rb_io_fptr_finalize ( rb_io_t fptr)

◆ rb_io_get_io()

VALUE rb_io_get_io ( VALUE  io)

Definition at line 622 of file io.c.

References rb_convert_type(), and T_FILE.

Referenced by io_reopen(), rb_io_init_copy(), and select_internal().

◆ rb_io_get_write_io()

VALUE rb_io_get_write_io ( VALUE  io)

Definition at line 634 of file io.c.

References rb_io_check_initialized(), and RFILE.

◆ rb_io_getbyte()

VALUE rb_io_getbyte ( VALUE  io)

◆ rb_io_getc()

static VALUE rb_io_getc ( VALUE  io)
static

◆ rb_io_getline()

static VALUE rb_io_getline ( int  argc,
VALUE argv,
VALUE  io 
)
static

Definition at line 3112 of file io.c.

References argc, argv, prepare_getline_args(), and rb_io_getline_1().

Referenced by argf_getline(), and rb_io_gets_m().

◆ rb_io_getline_1()

static VALUE rb_io_getline_1 ( VALUE  rs,
long  limit,
VALUE  io 
)
static

◆ rb_io_getline_fast()

static VALUE rb_io_getline_fast ( rb_io_t fptr,
rb_encoding enc,
VALUE  io 
)
static

◆ rb_io_gets()

VALUE rb_io_gets ( VALUE  io)

Definition at line 3122 of file io.c.

References rb_default_rs, and rb_io_getline_1().

Referenced by argf_getline(), lex_io_gets(), load_file_internal(), and rb_gets().

◆ rb_io_gets_m()

static VALUE rb_io_gets_m ( int  argc,
VALUE argv,
VALUE  io 
)
static

Definition at line 3149 of file io.c.

References argc, argv, rb_io_getline(), and rb_lastline_set().

Referenced by Init_IO(), io_s_foreach(), and rb_io_readline().

◆ rb_io_init_copy()

static VALUE rb_io_init_copy ( VALUE  dest,
VALUE  io 
)
static

◆ rb_io_initialize()

static VALUE rb_io_initialize ( int  argc,
VALUE argv,
VALUE  io 
)
static

◆ rb_io_inspect()

static VALUE rb_io_inspect ( VALUE  obj)
static

◆ rb_io_internal_encoding()

static VALUE rb_io_internal_encoding ( VALUE  io)
static

◆ rb_io_ioctl()

static VALUE rb_io_ioctl ( int  argc,
VALUE argv,
VALUE  io 
)
static

Definition at line 8822 of file io.c.

References argc, argv, rb_ioctl(), and rb_scan_args().

Referenced by Init_IO().

◆ rb_io_isatty()

static VALUE rb_io_isatty ( VALUE  io)
static

Definition at line 3866 of file io.c.

References rb_io_t::fd, GetOpenFile, Qfalse, and Qtrue.

Referenced by Init_IO().

◆ rb_io_lineno()

static VALUE rb_io_lineno ( VALUE  io)
static

Definition at line 3182 of file io.c.

References GetOpenFile, INT2NUM, rb_io_t::lineno, and rb_io_check_char_readable().

Referenced by Init_IO().

◆ rb_io_lines()

static VALUE rb_io_lines ( int  argc,
VALUE argv,
VALUE  io 
)
static

Definition at line 3324 of file io.c.

References argc, argv, ID2SYM, rb_block_given_p(), rb_enumeratorize(), rb_intern, rb_io_each_line(), and rb_warn().

Referenced by Init_IO().

◆ rb_io_memsize()

RUBY_FUNC_EXPORTED size_t rb_io_memsize ( const rb_io_t fptr)

◆ rb_io_modestr_fmode()

int rb_io_modestr_fmode ( const char *  modestr)

◆ rb_io_modestr_oflags()

int rb_io_modestr_oflags ( const char *  modestr)

Definition at line 4876 of file io.c.

References rb_io_fmode_oflags(), and rb_io_modestr_fmode().

Referenced by check_exec_redirect(), and rb_io_s_sysopen().

◆ rb_io_oflags_fmode()

int rb_io_oflags_fmode ( int  oflags)

◆ rb_io_oflags_modestr()

static const char* rb_io_oflags_modestr ( int  oflags)
static

Definition at line 4882 of file io.c.

References MODE_BINARY, rb_eArgError, and rb_raise().

Referenced by rb_io_open(), rb_io_reopen(), rb_io_s_popen(), and rb_io_stdio_file().

◆ rb_io_open()

static VALUE rb_io_open ( VALUE  filename,
VALUE  vmode,
VALUE  vperm,
VALUE  opt 
)
static

◆ rb_io_open_with_args()

static VALUE rb_io_open_with_args ( int  argc,
VALUE argv 
)
static

Definition at line 6440 of file io.c.

References argc, argv, io_alloc(), rb_cFile, and rb_open_file().

Referenced by open_key_args().

◆ rb_io_pid()

static VALUE rb_io_pid ( VALUE  io)
static

Definition at line 1918 of file io.c.

References binwrite_arg::fptr, GetOpenFile, rb_io_t::pid, PIDT2NUM, and Qnil.

Referenced by Init_IO().

◆ rb_io_print()

VALUE rb_io_print ( int  argc,
VALUE argv,
VALUE  out 
)

Definition at line 6760 of file io.c.

References argc, argv, i, NIL_P, Qnil, rb_io_write(), rb_lastline_get(), rb_output_fs, and rb_output_rs.

Referenced by Init_IO(), and rb_f_print().

◆ rb_io_printf()

VALUE rb_io_printf ( int  argc,
VALUE argv,
VALUE  out 
)

Definition at line 6701 of file io.c.

References argc, argv, Qnil, rb_f_sprintf(), and rb_io_write().

Referenced by Init_IO().

◆ rb_io_putc()

static VALUE rb_io_putc ( VALUE  io,
VALUE  ch 
)
static

Definition at line 6833 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().

◆ rb_io_puts()

VALUE rb_io_puts ( int  argc,
VALUE argv,
VALUE  out 
)

◆ rb_io_read_check()

void rb_io_read_check ( rb_io_t fptr)

Definition at line 842 of file io.c.

References rb_io_t::fd, rb_thread_wait_fd(), and READ_DATA_PENDING.

◆ rb_io_read_pending()

int rb_io_read_pending ( rb_io_t fptr)

◆ rb_io_readbyte()

static VALUE rb_io_readbyte ( VALUE  io)
static

Definition at line 3746 of file io.c.

References NIL_P, rb_eof_error(), and rb_io_getbyte().

Referenced by Init_IO().

◆ rb_io_readchar()

static VALUE rb_io_readchar ( VALUE  io)
static

Definition at line 3690 of file io.c.

References NIL_P, rb_eof_error(), and rb_io_getc().

Referenced by Init_IO().

◆ rb_io_readline()

static VALUE rb_io_readline ( int  argc,
VALUE argv,
VALUE  io 
)
static

Definition at line 3230 of file io.c.

References argc, argv, NIL_P, rb_eof_error(), and rb_io_gets_m().

Referenced by Init_IO().

◆ rb_io_readlines()

static VALUE rb_io_readlines ( int  argc,
VALUE argv,
VALUE  io 
)
static

◆ rb_io_reopen()

static VALUE rb_io_reopen ( int  argc,
VALUE argv,
VALUE  file 
)
static

◆ rb_io_rewind()

static VALUE rb_io_rewind ( VALUE  io)
static

◆ rb_io_s_binread()

static VALUE rb_io_s_binread ( int  argc,
VALUE argv,
VALUE  io 
)
static

◆ rb_io_s_binwrite()

static VALUE rb_io_s_binwrite ( int  argc,
VALUE argv,
VALUE  io 
)
static

Definition at line 9651 of file io.c.

References argc, argv, and io_s_write().

Referenced by Init_IO().

◆ rb_io_s_copy_stream()

static VALUE rb_io_s_copy_stream ( int  argc,
VALUE argv,
VALUE  io 
)
static

◆ rb_io_s_for_fd()

static VALUE rb_io_s_for_fd ( int  argc,
VALUE argv,
VALUE  klass 
)
static

Definition at line 7467 of file io.c.

References argc, argv, rb_io_initialize(), and rb_obj_alloc().

Referenced by Init_IO().

◆ rb_io_s_foreach()

static VALUE rb_io_s_foreach ( int  argc,
VALUE argv,
VALUE  self 
)
static

◆ rb_io_s_new()

static VALUE rb_io_s_new ( int  argc,
VALUE argv,
VALUE  klass 
)
static

Definition at line 7446 of file io.c.

References argc, argv, rb_block_given_p(), rb_class2name(), rb_class_new_instance(), and rb_warn().

Referenced by Init_IO().

◆ rb_io_s_open()

static VALUE rb_io_s_open ( int  argc,
VALUE argv,
VALUE  klass 
)
static

Definition at line 6220 of file io.c.

References argc, argv, io_close(), rb_block_given_p(), rb_class_new_instance(), rb_ensure(), and rb_yield().

Referenced by Init_IO(), and rb_f_open().

◆ rb_io_s_pipe()

static VALUE rb_io_s_pipe ( int  argc,
VALUE argv,
VALUE  klass 
)
static

◆ rb_io_s_popen()

static VALUE rb_io_s_popen ( int  argc,
VALUE argv,
VALUE  klass 
)
static

◆ rb_io_s_read()

static VALUE rb_io_s_read ( int  argc,
VALUE argv,
VALUE  io 
)
static

◆ rb_io_s_readlines()

static VALUE rb_io_s_readlines ( int  argc,
VALUE argv,
VALUE  io 
)
static

Definition at line 9417 of file io.c.

References argc, argv, foreach_arg::io, io_s_readlines(), NIL_P, NULL, open_key_args(), Qnil, rb_ensure(), rb_io_close(), and rb_scan_args().

Referenced by Init_IO().

◆ rb_io_s_sysopen()

static VALUE rb_io_s_sysopen ( int  argc,
VALUE argv 
)
static

◆ rb_io_s_try_convert()

static VALUE rb_io_s_try_convert ( VALUE  dummy,
VALUE  io 
)
static

Definition at line 679 of file io.c.

References rb_io_check_io().

Referenced by Init_IO().

◆ rb_io_s_write()

static VALUE rb_io_s_write ( int  argc,
VALUE argv,
VALUE  io 
)
static

Definition at line 9635 of file io.c.

References argc, argv, and io_s_write().

Referenced by Init_IO().

◆ rb_io_seek()

static VALUE rb_io_seek ( VALUE  io,
VALUE  offset,
int  whence 
)
static

◆ rb_io_seek_m()

static VALUE rb_io_seek_m ( int  argc,
VALUE argv,
VALUE  io 
)
static

Definition at line 1567 of file io.c.

References argc, argv, NUM2INT, rb_io_seek(), rb_scan_args(), and SEEK_SET.

Referenced by argf_seek_m(), and Init_IO().

◆ rb_io_set_autoclose()

static VALUE rb_io_set_autoclose ( VALUE  io,
VALUE  autoclose 
)
static

Definition at line 7509 of file io.c.

References FMODE_PREP, GetOpenFile, rb_io_t::mode, rb_secure(), and RTEST.

Referenced by Init_IO().

◆ rb_io_set_encoding()

static VALUE rb_io_set_encoding ( int  argc,
VALUE argv,
VALUE  io 
)
static

◆ rb_io_set_lineno()

static VALUE rb_io_set_lineno ( VALUE  io,
VALUE  lineno 
)
static

Definition at line 3209 of file io.c.

References GetOpenFile, rb_io_t::lineno, NUM2INT, and rb_io_check_char_readable().

Referenced by Init_IO().

◆ rb_io_set_nonblock()

void rb_io_set_nonblock ( rb_io_t fptr)

◆ rb_io_set_pos()

static VALUE rb_io_set_pos ( VALUE  io,
VALUE  offset 
)
static

Definition at line 1593 of file io.c.

References 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().

◆ rb_io_set_sync()

static VALUE rb_io_set_sync ( VALUE  io,
VALUE  sync 
)
static

Definition at line 1825 of file io.c.

References rb_notimplement(), and UNREACHABLE.

Referenced by Init_IO().

◆ rb_io_set_write_io()

VALUE rb_io_set_write_io ( VALUE  io,
VALUE  w 
)

Definition at line 646 of file io.c.

References GetWriteIO, Qnil, rb_io_check_initialized(), RFILE, and RTEST.

Referenced by argf_close(), and argf_next_argv().

◆ rb_io_stdio_file()

FILE* rb_io_stdio_file ( rb_io_t fptr)

◆ rb_io_sync()

static VALUE rb_io_sync ( VALUE  io)
static

Definition at line 1749 of file io.c.

References FMODE_SYNC, binwrite_arg::fptr, GetOpenFile, GetWriteIO, rb_io_t::mode, Qfalse, and Qtrue.

◆ rb_io_synchronized()

void rb_io_synchronized ( rb_io_t fptr)

◆ rb_io_sysread()

static VALUE rb_io_sysread ( int  argc,
VALUE argv,
VALUE  io 
)
static

◆ rb_io_sysseek()

static VALUE rb_io_sysseek ( int  argc,
VALUE argv,
VALUE  io 
)
static

◆ rb_io_syswrite()

static VALUE rb_io_syswrite ( VALUE  io,
VALUE  str 
)
static

◆ rb_io_taint_check()

VALUE rb_io_taint_check ( VALUE  io)

Definition at line 597 of file io.c.

References rb_check_frozen, and taint_check().

Referenced by get_strio(), rb_file_path(), rb_io_reopen(), strio_reopen(), and strio_set_string().

◆ rb_io_tell()

static VALUE rb_io_tell ( VALUE  io)
static

◆ rb_io_to_io()

static VALUE rb_io_to_io ( VALUE  io)
static

Definition at line 1973 of file io.c.

Referenced by Init_IO().

◆ rb_io_unbuffered()

void rb_io_unbuffered ( rb_io_t fptr)

Definition at line 5582 of file io.c.

References pipe_list::fptr, and rb_io_synchronized().

◆ rb_io_ungetbyte()

VALUE rb_io_ungetbyte ( VALUE  io,
VALUE  b 
)

◆ rb_io_ungetc()

VALUE rb_io_ungetc ( VALUE  io,
VALUE  c 
)

◆ rb_io_wait_readable()

int rb_io_wait_readable ( int  f)

◆ rb_io_wait_writable()

int rb_io_wait_writable ( int  f)

◆ rb_io_write()

VALUE rb_io_write ( VALUE  io,
VALUE  str 
)

◆ rb_io_write_nonblock()

static VALUE rb_io_write_nonblock ( VALUE  io,
VALUE  str 
)
static

◆ rb_ioctl()

static VALUE rb_ioctl ( VALUE  io,
VALUE  req,
VALUE  arg 
)
static

◆ rb_maygvl_fd_fix_cloexec()

void rb_maygvl_fd_fix_cloexec ( int  fd)

◆ rb_obj_display()

static VALUE rb_obj_display ( int  argc,
VALUE argv,
VALUE  self 
)
static

Definition at line 7069 of file io.c.

References argc, argv, Qnil, rb_io_write(), rb_scan_args(), and rb_stdout.

Referenced by Init_IO().

◆ rb_open_file()

static VALUE rb_open_file ( int  argc,
VALUE argv,
VALUE  io 
)
static

Definition at line 6169 of file io.c.

References argc, argv, fmode, mode_t, rb_file_open_generic(), and rb_scan_open_args().

Referenced by rb_file_initialize(), and rb_io_open_with_args().

◆ rb_p()

void rb_p ( VALUE  obj)

◆ rb_pipe()

int rb_pipe ( int *  pipes)

Definition at line 5588 of file io.c.

References errno, rb_cloexec_pipe(), rb_gc(), and rb_update_max_fd().

Referenced by pipe_open(), and rb_io_s_pipe().

◆ rb_read_check()

void rb_read_check ( FILE fp)

Definition at line 834 of file io.c.

References fileno, rb_thread_wait_fd(), and STDIO_READ_DATA_PENDING.

◆ rb_read_internal()

static ssize_t rb_read_internal ( int  fd,
void *  buf,
size_t  count 
)
static

◆ rb_scan_open_args()

static void rb_scan_open_args ( int  argc,
VALUE argv,
VALUE fname_p,
int *  oflags_p,
int *  fmode_p,
convconfig_t convconfig_p,
mode_t perm_p 
)
static

Definition at line 6147 of file io.c.

References argc, argv, FilePathValue, fmode, mode_t, NIL_P, NUM2MODET, rb_io_extract_modeenc(), and rb_scan_args().

Referenced by rb_open_file().

◆ rb_stdio_set_default_encoding()

void rb_stdio_set_default_encoding ( void  )

Definition at line 10410 of file io.c.

References Qnil, rb_io_set_encoding(), rb_stderr, rb_stdin, rb_stdout, and val.

Referenced by process_options().

◆ rb_sysopen()

static int rb_sysopen ( VALUE  fname,
int  oflags,
mode_t  perm 
)
static

◆ rb_sysopen_internal()

static int rb_sysopen_internal ( struct sysopen_struct data)
inlinestatic

Definition at line 5277 of file io.c.

References rb_thread_call_without_gvl(), rb_update_max_fd(), RUBY_UBF_IO, and sysopen_func().

Referenced by rb_sysopen().

◆ rb_update_max_fd()

void rb_update_max_fd ( int  fd)

◆ rb_write_error()

void rb_write_error ( const char *  mesg)

Definition at line 7099 of file io.c.

References rb_write_error2(), and strlen().

Referenced by rescue_callback().

◆ rb_write_error2()

void rb_write_error2 ( const char *  mesg,
long  len 
)

Definition at line 7085 of file io.c.

References rb_io_t::fd, orig_stderr, rb_io_write(), rb_stderr, rb_str_new(), and RFILE.

Referenced by rb_write_error().

◆ rb_write_error_str()

void rb_write_error_str ( VALUE  mesg)

◆ rb_write_internal()

static ssize_t rb_write_internal ( int  fd,
const void *  buf,
size_t  count 
)
static

◆ rb_write_internal2()

static ssize_t rb_write_internal2 ( int  fd,
const void *  buf,
size_t  count 
)
static

◆ read_all()

static VALUE read_all ( rb_io_t fptr,
long  siz,
VALUE  str 
)
static

◆ read_buffered_data()

static long read_buffered_data ( char *  ptr,
long  len,
rb_io_t fptr 
)
static

◆ read_internal_call()

static VALUE read_internal_call ( VALUE  arg)
static

Definition at line 2373 of file io.c.

References p, Qundef, and rb_read_internal().

Referenced by io_getpartial(), and rb_io_sysread().

◆ remain_size()

static long remain_size ( rb_io_t fptr)
static

◆ rscheck()

static void rscheck ( const char *  rsptr,
long  rslen,
VALUE  rs 
)
static

Definition at line 2762 of file io.c.

References rb_eRuntimeError, rb_raise(), RSTRING_LEN, and RSTRING_PTR.

Referenced by rb_io_getline_1().

◆ ruby_dup()

static int ruby_dup ( int  orig)
static

Definition at line 851 of file io.c.

References errno, rb_cloexec_dup(), rb_gc(), rb_sys_fail(), and rb_update_max_fd().

Referenced by rb_io_init_copy().

◆ ruby_get_inplace_mode()

const char* ruby_get_inplace_mode ( void  )

Definition at line 11447 of file io.c.

References ARGF.

◆ ruby_set_inplace_mode()

void ruby_set_inplace_mode ( const char *  suffix)

Definition at line 11453 of file io.c.

References ARGF, free, and strdup.

Referenced by proc_options().

◆ seek_before_access()

static VALUE seek_before_access ( VALUE  argp)
static

Definition at line 9441 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(), and rb_io_s_read().

◆ select_call()

static VALUE select_call ( VALUE  arg)
static

Definition at line 8263 of file io.c.

References p, and select_internal().

Referenced by rb_f_select().

◆ select_end()

static VALUE select_end ( VALUE  arg)
static

Definition at line 8271 of file io.c.

References i, numberof, p, Qnil, and rb_fd_term.

Referenced by rb_f_select().

◆ select_internal()

static VALUE select_internal ( VALUE  read,
VALUE  write,
VALUE  except,
struct timeval tp,
rb_fdset_t fds 
)
static

◆ setup_narg()

static long setup_narg ( ioctl_req_t  cmd,
VALUE argp,
int  io_p 
)
static

◆ stdout_setter()

static void stdout_setter ( VALUE  val,
ID  id,
VALUE variable 
)
static

Definition at line 7132 of file io.c.

References id_write, must_respond_to(), and val.

Referenced by Init_IO().

◆ str_end_with_asciichar()

static int str_end_with_asciichar ( VALUE  str,
int  c 
)
static

Definition at line 6870 of file io.c.

References ENCODING_GET, rb_enc_ascget(), rb_enc_from_index(), rb_enc_mbminlen, RSTRING_LEN, and RSTRING_PTR.

Referenced by rb_io_puts().

◆ swallow()

static int swallow ( rb_io_t fptr,
int  term 
)
inlinestatic

◆ sysopen_func()

static void* sysopen_func ( void *  ptr)
static

◆ taint_check()

static VALUE taint_check ( VALUE  io)
static

Definition at line 589 of file io.c.

References OBJ_UNTRUSTED, rb_eSecurityError, rb_raise(), and rb_safe_level.

Referenced by rb_io_inspect(), and rb_io_taint_check().

◆ unsupported_encoding()

static void unsupported_encoding ( const char *  name)
static

Definition at line 4940 of file io.c.

References name, and rb_warn().

Referenced by find_encoding(), and parse_mode_enc().

◆ validate_enc_binmode()

static void validate_enc_binmode ( int *  fmode_p,
int  ecflags,
rb_encoding enc,
rb_encoding enc2 
)
static

◆ wsplit_p()

static int wsplit_p ( rb_io_t fptr)
static

Definition at line 884 of file io.c.

References buf, fcntl(), rb_io_t::fd, FMODE_WSPLIT, FMODE_WSPLIT_INITIALIZED, fstat, rb_io_t::mode, O_NONBLOCK, S_ISREG, and stat.

Referenced by io_writable_length().

Variable Documentation

◆ argf

VALUE argf
static

◆ argf_type

const rb_data_type_t argf_type
static
Initial value:
= {
"ARGF",
}
static void argf_mark(void *ptr)
Definition: io.c:7522
static size_t argf_memsize(const void *ptr)
Definition: io.c:7540
static void argf_free(void *ptr)
Definition: io.c:7532

Definition at line 7549 of file io.c.

Referenced by argf_alloc().

◆ closed_stream

const char closed_stream[] = "closed stream"
static

◆ id_flush

ID id_flush
static

Definition at line 148 of file io.c.

Referenced by Init_IO(), and rb_io_flush().

◆ id_getc

ID id_getc
static

Definition at line 148 of file io.c.

Referenced by Init_IO().

◆ id_read

ID id_read
static

Definition at line 148 of file io.c.

Referenced by copy_stream_fallback_body(), and Init_IO().

◆ id_readpartial

ID id_readpartial
static

Definition at line 148 of file io.c.

Referenced by copy_stream_fallback_body(), and Init_IO().

◆ id_set_encoding

ID id_set_encoding
static

Definition at line 148 of file io.c.

Referenced by Init_IO(), and rb_io_set_encoding().

◆ id_write

ID id_write
static

Definition at line 148 of file io.c.

Referenced by Init_IO(), io_write(), rb_io_write(), rb_p(), and stdout_setter().

◆ max_file_descriptor

rb_atomic_t max_file_descriptor = NOFILE
static

Definition at line 162 of file io.c.

Referenced by rb_update_max_fd().

◆ orig_stderr

VALUE orig_stderr
static

Definition at line 139 of file io.c.

Referenced by Init_IO(), pipe_open(), rb_write_error2(), and rb_write_error_str().

◆ orig_stdout

VALUE orig_stdout
static

Definition at line 139 of file io.c.

Referenced by argf_next_argv(), Init_IO(), and pipe_open().

◆ pipe_list

struct pipe_list * pipe_list
static

◆ rb_cIO

VALUE rb_cIO

Definition at line 131 of file io.c.

Referenced by Init_IO(), pipe_open(), rb_f_open(), and rb_io_fdopen().

◆ rb_default_rs

VALUE rb_default_rs

◆ rb_deferr

VALUE rb_deferr

Definition at line 138 of file io.c.

Referenced by Init_IO().

◆ rb_eEOFError

VALUE rb_eEOFError

Definition at line 132 of file io.c.

Referenced by argf_getpartial(), copy_stream_fallback(), Init_IO(), and rb_eof_error().

◆ rb_eIOError

VALUE rb_eIOError

◆ rb_mWaitReadable

VALUE rb_mWaitReadable

Definition at line 134 of file io.c.

Referenced by Init_IO(), and io_getpartial().

◆ rb_mWaitWritable

VALUE rb_mWaitWritable

Definition at line 135 of file io.c.

Referenced by Init_IO(), and rb_io_write_nonblock().

◆ rb_output_fs

VALUE rb_output_fs

Definition at line 141 of file io.c.

Referenced by Init_IO(), rb_ary_join_m(), and rb_io_print().

◆ rb_output_rs

VALUE rb_output_rs

Definition at line 143 of file io.c.

Referenced by Init_IO(), and rb_io_print().

◆ rb_rs

VALUE rb_rs

Definition at line 142 of file io.c.

Referenced by argf_getline(), Init_IO(), prepare_getline_args(), and rb_gets().

◆ rb_stderr

VALUE rb_stderr

◆ rb_stdin

VALUE rb_stdin

Definition at line 137 of file io.c.

Referenced by argf_close(), argf_next_argv(), Init_IO(), and rb_stdio_set_default_encoding().

◆ rb_stdout

VALUE rb_stdout

◆ sym_autoclose

VALUE sym_autoclose
static

Definition at line 150 of file io.c.

Referenced by Init_IO(), and rb_io_initialize().

◆ sym_binmode

VALUE sym_binmode
static

Definition at line 150 of file io.c.

Referenced by extract_binmode(), and Init_IO().

◆ sym_dontneed

VALUE sym_dontneed
static

Definition at line 8281 of file io.c.

Referenced by advice_arg_check(), and Init_IO().

◆ sym_encoding

VALUE sym_encoding
static

Definition at line 149 of file io.c.

Referenced by Init_IO(), and rb_io_extract_encoding_option().

◆ sym_extenc

VALUE sym_extenc
static

Definition at line 149 of file io.c.

Referenced by Init_IO(), and rb_io_extract_encoding_option().

◆ sym_intenc

VALUE sym_intenc
static

Definition at line 149 of file io.c.

Referenced by Init_IO(), and rb_io_extract_encoding_option().

◆ sym_mode

VALUE sym_mode
static

Definition at line 149 of file io.c.

Referenced by Init_IO(), io_s_write(), and rb_io_extract_modeenc().

◆ sym_noreuse

VALUE sym_noreuse
static

Definition at line 8281 of file io.c.

Referenced by advice_arg_check(), and Init_IO().

◆ sym_normal

VALUE sym_normal
static

Definition at line 8281 of file io.c.

Referenced by advice_arg_check(), and Init_IO().

◆ sym_open_args

VALUE sym_open_args
static

Definition at line 149 of file io.c.

Referenced by Init_IO(), and open_key_args().

◆ sym_perm

VALUE sym_perm
static

Definition at line 149 of file io.c.

Referenced by Init_IO(), and rb_io_extract_modeenc().

◆ sym_random

VALUE sym_random
static

Definition at line 8281 of file io.c.

Referenced by advice_arg_check(), and Init_IO().

◆ sym_sequential

VALUE sym_sequential
static

Definition at line 8281 of file io.c.

Referenced by advice_arg_check(), and Init_IO().

◆ sym_textmode

VALUE sym_textmode
static

Definition at line 150 of file io.c.

Referenced by extract_binmode(), and Init_IO().

◆ sym_willneed

VALUE sym_willneed
static

Definition at line 8281 of file io.c.

Referenced by advice_arg_check(), and Init_IO().