Ruby
2.5.0dev(2017-10-22revision60238)
|
Go to the source code of this file.
Data Structures | |
struct | rb_io_t |
struct | rb_io_t::rb_io_enc_t |
Macros | |
#define | RB_WAITFD_IN 0x001 |
#define | RB_WAITFD_PRI 0x002 |
#define | RB_WAITFD_OUT 0x004 |
#define | HAVE_RB_IO_T 1 |
#define | FMODE_READABLE 0x00000001 |
#define | FMODE_WRITABLE 0x00000002 |
#define | FMODE_READWRITE (FMODE_READABLE|FMODE_WRITABLE) |
#define | FMODE_BINMODE 0x00000004 |
#define | FMODE_SYNC 0x00000008 |
#define | FMODE_TTY 0x00000010 |
#define | FMODE_DUPLEX 0x00000020 |
#define | FMODE_APPEND 0x00000040 |
#define | FMODE_CREATE 0x00000080 |
#define | FMODE_TRUNC 0x00000800 |
#define | FMODE_TEXTMODE 0x00001000 |
#define | FMODE_SETENC_BY_BOM 0x00100000 |
#define | GetOpenFile(obj, fp) rb_io_check_closed((fp) = RFILE(rb_io_taint_check(obj))->fptr) |
#define | MakeOpenFile(obj, fp) |
#define | rb_io_mode_flags(modestr) [<"rb_io_mode_flags() is obsolete; use rb_io_modestr_fmode()">] |
#define | rb_io_modenum_flags(oflags) [<"rb_io_modenum_flags() is obsolete; use rb_io_oflags_fmode()">] |
Typedefs | |
typedef struct rb_io_buffer_t | rb_io_buffer_t |
typedef struct rb_io_t | rb_io_t |
#define FMODE_APPEND 0x00000040 |
Definition at line 109 of file io.h.
Referenced by rb_io_modestr_fmode(), and rb_io_oflags_fmode().
#define FMODE_BINMODE 0x00000004 |
Definition at line 105 of file io.h.
Referenced by rb_io_binmode(), rb_io_modestr_fmode(), and rb_io_oflags_fmode().
#define FMODE_CREATE 0x00000080 |
Definition at line 110 of file io.h.
Referenced by rb_io_modestr_fmode(), and rb_io_oflags_fmode().
#define FMODE_DUPLEX 0x00000020 |
Definition at line 108 of file io.h.
Referenced by rsock_init_sock().
#define FMODE_READABLE 0x00000001 |
Definition at line 102 of file io.h.
Referenced by rb_io_check_char_readable(), rb_io_modestr_fmode(), and rb_io_oflags_fmode().
#define FMODE_READWRITE (FMODE_READABLE|FMODE_WRITABLE) |
Definition at line 104 of file io.h.
Referenced by rb_io_modestr_fmode(), rb_io_oflags_fmode(), and rsock_init_sock().
#define FMODE_SYNC 0x00000008 |
Definition at line 106 of file io.h.
Referenced by rb_io_synchronized().
#define FMODE_TEXTMODE 0x00001000 |
Definition at line 113 of file io.h.
Referenced by rb_io_binmode(), and rb_io_modestr_fmode().
#define FMODE_TRUNC 0x00000800 |
Definition at line 112 of file io.h.
Referenced by rb_io_modestr_fmode(), and rb_io_oflags_fmode().
#define FMODE_TTY 0x00000010 |
Definition at line 107 of file io.h.
Referenced by rb_io_getbyte().
#define FMODE_WRITABLE 0x00000002 |
Definition at line 103 of file io.h.
Referenced by rb_io_check_writable(), rb_io_modestr_fmode(), rb_io_oflags_fmode(), and rb_pipe().
#define GetOpenFile | ( | obj, | |
fp | |||
) | rb_io_check_closed((fp) = RFILE(rb_io_taint_check(obj))->fptr) |
Definition at line 120 of file io.h.
Referenced by rb_io_ascii8bit_binmode(), rb_io_binmode(), rb_io_bufread(), rb_io_bufwrite(), rb_io_eof(), rb_io_getbyte(), rb_io_gets_internal(), rb_io_ungetbyte(), rb_io_ungetc(), rsock_bsock_send(), rsock_io_socket_addrinfo(), and rsock_sock_listen().
#define MakeOpenFile | ( | obj, | |
fp | |||
) |
Definition at line 122 of file io.h.
Referenced by rsock_init_sock().
#define rb_io_mode_flags | ( | modestr | ) | [<"rb_io_mode_flags() is obsolete; use rb_io_modestr_fmode()">] |
#define rb_io_modenum_flags | ( | oflags | ) | [<"rb_io_modenum_flags() is obsolete; use rb_io_oflags_fmode()">] |
#define RB_WAITFD_IN 0x001 |
Definition at line 47 of file io.h.
Referenced by rb_wait_for_single_fd().
typedef struct rb_io_buffer_t rb_io_buffer_t |
CONSTFUNC | ( | int | rb_io_oflags_fmodeint oflags | ) |
NORETURN | ( | void | rb_eof_errorvoid | ) |
RUBY_SYMBOL_EXPORT_BEGIN PACKED_STRUCT_UNALIGNED | ( | struct rb_io_buffer_t { char *ptr;int off;int len;int capa;} | ) |
Definition at line 5716 of file io.c.
References errno, NULL, rb_gc(), rb_gc_for_fd(), rb_syserr_fail(), and rb_warn().
Definition at line 1450 of file io.c.
References binwrite_arg::fptr, GetOpenFile, and rb_io_check_writable().
void rb_io_check_byte_readable | ( | rb_io_t * | fptr | ) |
Definition at line 815 of file io.c.
References rb_eIOError, rb_io_check_char_readable(), rb_raise(), and READ_CHAR_PENDING.
Referenced by rb_io_check_readable(), rb_io_getbyte(), and rb_io_ungetbyte().
void rb_io_check_char_readable | ( | rb_io_t * | fptr | ) |
Definition at line 796 of file io.c.
References FMODE_READABLE, rb_io_t::mode, rb_eIOError, rb_io_check_closed(), rb_raise(), and rb_io_t::wbuf.
Referenced by rb_io_check_byte_readable(), rb_io_eof(), and rb_io_ungetc().
void rb_io_check_closed | ( | rb_io_t * | ) |
Definition at line 641 of file io.c.
References rb_io_t::fd, rb_eIOError, rb_io_check_initialized(), and rb_raise().
Referenced by rb_io_check_char_readable(), and rb_io_check_writable().
void rb_io_check_initialized | ( | rb_io_t * | ) |
Definition at line 633 of file io.c.
References rb_eIOError, and rb_raise().
Referenced by rb_io_check_closed(), and rb_io_synchronized().
Definition at line 664 of file io.c.
References rb_check_convert_type_with_id(), and T_FILE.
void rb_io_check_readable | ( | rb_io_t * | ) |
Definition at line 824 of file io.c.
References rb_io_check_byte_readable().
Referenced by rb_io_bufread().
void rb_io_check_writable | ( | rb_io_t * | ) |
Definition at line 848 of file io.c.
References FMODE_WRITABLE, rb_io_t::mode, rb_eIOError, rb_io_check_closed(), rb_raise(), and rb_io_t::rbuf.
Referenced by rb_io_bufwrite().
int rb_io_extract_encoding_option | ( | VALUE | opt, |
rb_encoding ** | enc_p, | ||
rb_encoding ** | enc2_p, | ||
int * | fmode_p | ||
) |
int rb_io_fptr_finalize | ( | rb_io_t * | ) |
Definition at line 4424 of file io.c.
References rb_io_t::fd, rb_io_t::pathv, and Qnil.
Referenced by rb_io_make_open_file().
Definition at line 658 of file io.c.
References rb_convert_type_with_id(), and T_FILE.
Definition at line 7724 of file io.c.
References Check_Type, rb_io_close(), rb_io_fptr_finalize(), RFILE, and T_FILE.
int rb_io_modestr_fmode | ( | const char * | modestr | ) |
Definition at line 5143 of file io.c.
References FMODE_APPEND, FMODE_BINMODE, FMODE_CREATE, FMODE_READABLE, FMODE_READWRITE, FMODE_TEXTMODE, FMODE_TRUNC, FMODE_WRITABLE, NULL, rb_eArgError, rb_raise(), and strchr().
void rb_io_read_check | ( | rb_io_t * | ) |
Definition at line 869 of file io.c.
References rb_io_t::fd, rb_thread_wait_fd(), and READ_DATA_PENDING.
int rb_io_read_pending | ( | rb_io_t * | ) |
Definition at line 860 of file io.c.
References READ_CHAR_PENDING, and READ_DATA_PENDING.
void rb_io_set_nonblock | ( | rb_io_t * | fptr | ) |
Definition at line 2475 of file io.c.
References F_SETFL, fcntl(), rb_io_t::fd, O_NONBLOCK, rb_io_t::pathv, rb_sys_fail_path, and rb_w32_set_nonblock().
Referenced by rsock_s_accept_nonblock().
Definition at line 7676 of file io.c.
References rb_io_t::stdio_file.
void rb_io_synchronized | ( | rb_io_t * | ) |
Definition at line 5996 of file io.c.
References FMODE_SYNC, rb_io_t::mode, and rb_io_check_initialized().
Referenced by rb_io_unbuffered(), and rsock_init_sock().
Definition at line 626 of file io.c.
References rb_check_frozen.
int rb_io_wait_readable | ( | int | ) |
Definition at line 1106 of file io.c.
References rb_eIOError, and rb_raise().
int rb_io_wait_writable | ( | int | ) |
Definition at line 1132 of file io.c.
References rb_eIOError, and rb_raise().
Referenced by rsock_bsock_send().
int rb_wait_for_single_fd | ( | int | fd, |
int | events, | ||
struct timeval * | tv | ||
) |
Definition at line 3989 of file thread.c.
References select_args::as, waiting_fd::fd, select_args::fd, RB_WAITFD_IN, and select_args::read.