Ruby
2.4.2p198(2017-09-14revision59899)
|
Go to the source code of this file.
Data Structures | |
struct | rawmode_arg_t |
Macros | |
#define | rb_funcallv rb_funcall2 |
#define | SET_LAST_ERROR (0) |
#define | rb_sym2str(sym) rb_id2str(SYM2ID(sym)) |
#define | GetReadFD(fptr) ((fptr)->fd) |
#define | GetWriteFD(fptr) get_write_fd(fptr) |
#define | FD_PER_IO 2 |
#define | console_goto rb_f_notimplement |
#define | console_cursor_pos rb_f_notimplement |
#define | console_cursor_set rb_f_notimplement |
#define | console_key_pressed_p rb_f_notimplement |
#define | CONSOLE_DEVICE_FOR_READING CONSOLE_DEVICE |
Functions | |
static VALUE | rb_f_send (int argc, VALUE *argv, VALUE recv) |
static rawmode_arg_t * | rawmode_opt (int argc, VALUE *argv, rawmode_arg_t *opts) |
static void | set_rawmode (conmode *t, void *arg) |
static void | set_cookedmode (conmode *t, void *arg) |
static void | set_noecho (conmode *t, void *arg) |
static void | set_echo (conmode *t, void *arg) |
static int | echo_p (conmode *t) |
static int | set_ttymode (int fd, conmode *t, void(*setter)(conmode *, void *), void *arg) |
static int | get_write_fd (const rb_io_t *fptr) |
static VALUE | ttymode (VALUE io, VALUE(*func)(VALUE), void(*setter)(conmode *, void *), void *arg) |
static VALUE | console_raw (int argc, VALUE *argv, VALUE io) |
static VALUE | console_set_raw (int argc, VALUE *argv, VALUE io) |
static VALUE | console_cooked (VALUE io) |
static VALUE | console_set_cooked (VALUE io) |
static VALUE | getc_call (VALUE io) |
static VALUE | console_getch (int argc, VALUE *argv, VALUE io) |
static VALUE | console_noecho (VALUE io) |
static VALUE | console_set_echo (VALUE io, VALUE f) |
static VALUE | console_echo_p (VALUE io) |
static VALUE | console_iflush (VALUE io) |
static VALUE | console_oflush (VALUE io) |
static VALUE | console_ioflush (VALUE io) |
static VALUE | console_beep (VALUE io) |
static VALUE | console_dev (int argc, VALUE *argv, VALUE klass) |
static VALUE | io_getch (int argc, VALUE *argv, VALUE io) |
void | Init_console (void) |
void | InitVM_console (void) |
Variables | |
static ID | id_getc |
static ID | id_console |
static ID | id_close |
static ID | id_min |
static ID | id_time |
static ID | id___send__ |
#define console_cursor_pos rb_f_notimplement |
Definition at line 754 of file console.c.
Referenced by console_beep(), and InitVM_console().
#define console_cursor_set rb_f_notimplement |
Definition at line 755 of file console.c.
Referenced by console_beep(), and InitVM_console().
#define CONSOLE_DEVICE_FOR_READING CONSOLE_DEVICE |
Referenced by console_dev().
#define console_goto rb_f_notimplement |
Definition at line 753 of file console.c.
Referenced by console_beep(), and InitVM_console().
#define console_key_pressed_p rb_f_notimplement |
Definition at line 756 of file console.c.
Referenced by console_beep(), and InitVM_console().
#define GetReadFD | ( | fptr | ) | ((fptr)->fd) |
Definition at line 229 of file console.c.
Referenced by console_dev(), console_echo_p(), console_iflush(), console_ioflush(), console_set_cooked(), console_set_echo(), console_set_raw(), and ttymode().
#define GetWriteFD | ( | fptr | ) | get_write_fd(fptr) |
Definition at line 240 of file console.c.
Referenced by console_beep(), console_echo_p(), console_ioflush(), console_oflush(), and ttymode().
#define rb_funcallv rb_funcall2 |
Definition at line 21 of file console.c.
Referenced by binomial_coefficient(), call_next(), check_match(), check_step_domain(), check_userdump_arg(), cleanup_iseq_build(), descending_factorial(), dir_inspect(), dir_open_dir(), do_sleep(), dump_output(), enum_find(), exc_message(), getc_call(), GetPrivPKeyPtr(), hash_recursive(), if(), io_getch(), lazy_flat_map_i(), lazy_uniq_i(), mlambda(), mproc(), nucomp_rationalize(), ossl_obj2bio(), path_binread(), path_binwrite(), path_each_line(), path_open(), path_read(), path_readlines(), path_s_glob(), path_sub(), path_sysopen(), path_write(), process_options(), rand_range(), range_each_func(), range_values(), rb_ary_bsearch_index(), rb_ary_cycle_size(), rb_ary_repeated_permutation_size(), rb_cmp(), rb_const_missing(), rb_digest_class_s_bubblebabble(), rb_digest_class_s_hexdigest(), rb_enc_get_index(), rb_f_gets(), rb_f_open(), rb_f_putc(), rb_f_puts(), rb_f_readline(), rb_f_readlines(), rb_f_send(), rb_hash_default(), rb_hash_flatten(), rb_inspect(), rb_io_set_encoding(), rb_io_write(), rb_obj_call_init(), rb_random_real(), rb_str_match_m(), recursive_cmp(), require_libraries(), sock_initialize(), sort_2(), str_upto_each(), syserr_eqq(), and unknown_keyword_error().
Definition at line 107 of file console.c.
Referenced by add_option_i(), append_method(), check_rounding_mode_option(), chunk_ii(), console_beep(), constant_arg(), control_frame_dump(), dump_append_symbol_value(), dump_object(), econv_opts(), esignal_init(), ev_on_event(), fev_off_event(), fole_missing(), fole_respond_to(), folerecord_initialize(), folerecord_method_missing(), folerecord_ole_instance_variable_get(), folerecord_ole_instance_variable_set(), gc_info_decode(), gc_stat_internal(), hash2named_arg(), ibf_dump_object_symbol(), iow_inspect(), iseq_load(), match_backref_number(), method_for_self(), namev_to_backref_number(), object_allocations_reporter_i(), ole_invoke(), ossl_pkcs7_sym2typeid(), ossl_sslctx_set_ssl_version(), r_object0(), range_each(), range_step(), rb_enc_get_index(), rb_f_kill(), rb_num_get_rounding_option(), rb_reg_match_p(), rb_str_format(), rb_sym_to_s(), reg_operand(), sockopt_inspect(), strscan_aref(), sym_aref(), sym_capitalize(), sym_casecmp(), sym_casecmp_p(), sym_cmp(), sym_downcase(), sym_empty(), sym_encoding(), sym_inspect(), sym_length(), sym_match(), sym_match_m(), sym_succ(), sym_swapcase(), sym_upcase(), symbol2event_flag(), trap_handler(), trap_signm(), vm_stat(), and w_symbol().
Definition at line 667 of file console.c.
References console_cursor_pos, console_cursor_set, console_goto, console_key_pressed_p, FIXNUM_P, GetOpenFile, GetWriteFD, NUM2UINT, PRIsVALUE, Qfalse, Qtrue, RARRAY_AREF, RARRAY_LEN, rb_assoc_new(), rb_convert_type(), rb_eArgError, rb_raise(), rb_sym2str, rb_sys_fail(), rb_syserr_fail(), rb_w32_get_osfhandle(), RSTRING_LEN, RSTRING_PTR, StringValuePtr, SYMBOL_P, T_ARRAY, and UINT2NUM.
Referenced by InitVM_console().
Definition at line 358 of file console.c.
References NULL, rb_yield(), set_cookedmode(), and ttymode().
Referenced by InitVM_console().
Definition at line 773 of file console.c.
References Check_Type, CONSOLE_DEVICE_FOR_READING, FMODE_SYNC, GetOpenFile, GetReadFD, ID2SYM, INT2FIX, INT2NUM, rb_io_t::mode, rb_io_t::pathv, Qnil, rb_cFile, rb_check_arity, rb_cIO, rb_class_new_instance(), rb_cloexec_open(), rb_const_defined(), rb_const_get(), rb_const_remove(), rb_const_set(), rb_f_send(), rb_io_close(), rb_obj_freeze(), rb_str_new2, RB_TYPE_P, rb_update_max_fd(), RFILE, sym, T_FILE, T_SYMBOL, rb_io_t::tied_io_for_writing, and UNLIMITED_ARGUMENTS.
Referenced by InitVM_console().
Definition at line 464 of file console.c.
References echo_p(), FALSE, GetOpenFile, GetReadFD, GetWriteFD, INT2NUM, NIL_P, NUM2UINT, Qfalse, Qnil, Qtrue, RARRAY_CONST_PTR, RARRAY_LEN, rb_Array(), rb_assoc_new(), rb_eArgError, rb_raise(), rb_sys_fail(), rb_syserr_fail(), rb_w32_get_osfhandle(), SET, and size.
Referenced by InitVM_console().
Definition at line 403 of file console.c.
References getc_call(), rawmode_opt(), set_rawmode(), and ttymode().
Referenced by InitVM_console().
Definition at line 598 of file console.c.
References GetOpenFile, GetReadFD, and rb_sys_fail().
Referenced by InitVM_console().
Definition at line 644 of file console.c.
References GetOpenFile, GetReadFD, GetWriteFD, and rb_sys_fail().
Referenced by InitVM_console().
Definition at line 422 of file console.c.
References NULL, rb_yield(), set_noecho(), and ttymode().
Referenced by InitVM_console().
Definition at line 621 of file console.c.
References GetOpenFile, GetWriteFD, and rb_sys_fail().
Referenced by InitVM_console().
Definition at line 313 of file console.c.
References rawmode_opt(), rb_yield(), set_rawmode(), and ttymode().
Referenced by InitVM_console().
Definition at line 374 of file console.c.
References GetOpenFile, GetReadFD, NULL, rb_sys_fail(), and set_cookedmode().
Referenced by InitVM_console().
Definition at line 438 of file console.c.
References GetOpenFile, GetReadFD, NULL, rb_sys_fail(), RTEST, set_echo(), and set_noecho().
Referenced by InitVM_console().
Definition at line 330 of file console.c.
References GetOpenFile, GetReadFD, rawmode_opt(), rb_sys_fail(), and set_rawmode().
Referenced by InitVM_console().
|
static |
Definition at line 208 of file console.c.
Referenced by console_echo_p().
Definition at line 232 of file console.c.
References rb_io_t::fd, GetOpenFile, and rb_io_t::tied_io_for_writing.
void Init_console | ( | void | ) |
void InitVM_console | ( | void | ) |
Definition at line 964 of file console.c.
References console_beep(), console_cooked(), console_cursor_pos, console_cursor_set, console_dev(), console_echo_p(), console_getch(), console_goto, console_iflush(), console_ioflush(), console_key_pressed_p, console_noecho(), console_oflush(), console_raw(), console_set_cooked(), console_set_echo(), console_set_raw(), io_getch(), rb_cIO, rb_define_method(), rb_define_module_under(), and rb_define_singleton_method().
Definition at line 863 of file console.c.
References argc, argv, NIL_P, NULL, rb_check_arity, rb_check_safe_obj(), rb_default_rs, rb_ensure(), rb_funcallv, rb_intern, rb_io_get_write_io(), rb_io_gets(), rb_io_write(), rb_stderr, rb_stdin, set_noecho(), StringValueCStr, and ttymode().
Referenced by InitVM_console().
|
static |
Definition at line 116 of file console.c.
References ID2SYM, INT2FIX, NIL_P, NULL, NUM2INT, rb_funcall3, rb_hash_aref(), rb_scan_args(), rawmode_arg_t::vmin, and rawmode_arg_t::vtime.
Referenced by console_getch(), console_raw(), and console_set_raw().
Definition at line 91 of file console.c.
References argc, argv, id___send__, rb_check_id(), rb_funcallv, and sym.
Referenced by console_dev(), and inject_op_i().
|
static |
Definition at line 169 of file console.c.
Referenced by console_cooked(), and console_set_cooked().
|
static |
Definition at line 196 of file console.c.
Referenced by console_set_echo().
|
static |
Definition at line 184 of file console.c.
Referenced by console_noecho(), console_set_echo(), and io_getch().
|
static |
Definition at line 142 of file console.c.
References rawmode_arg_t::vmin, and rawmode_arg_t::vtime.
Referenced by console_getch(), console_raw(), and console_set_raw().
|
static |
|
static |
Definition at line 245 of file console.c.
References errno, FD_PER_IO, func, GetOpenFile, GetReadFD, GetWriteFD, Qnil, rb_jump_tag(), rb_protect(), rb_syserr_fail(), result, and set_ttymode().
Referenced by console_cooked(), console_getch(), console_noecho(), console_raw(), and io_getch().
|
static |
Definition at line 88 of file console.c.
Referenced by rb_f_send().