summaryrefslogtreecommitdiff
path: root/ext/io/console/console.c
AgeCommit message (Collapse)Author
2017-11-08Fix typos in rdocknu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60715 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-11-07Add details on the min/time parameters to the rdocknu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60685 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-09-11console.c: set winsize on Windowsnobu
* ext/io/console/console.c (console_set_winsize): retry shrinking window and screen buffer. [ruby-core:82741] [Bug #13888] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59844 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-07console.c: unpaired sizenobu
* ext/io/console/console.c (console_set_winsize): reject unpaired pixel size. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57282 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-07console.c: OOB accessnobu
* ext/io/console/console.c (console_set_winsize): fix out-of-bounds access. [ruby-core:79004] [Bug #13112] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57280 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-15io/console: unknown key code for names with nulnobu
* ext/io/console/console.c (console_key_pressed_p): raise the same exception, "unknown virtual key code", for names with nul chars. though console_win32_vk() considers the length and can deal with nul chars, rb_sprintf() raised at PRIsVALUE previously, so quote it if it is unprintable. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54589 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-15io/console: rb_sym2strnobu
* ext/io/console/console.c (rb_sym2str): fallback definition for older ruby. [ruby-core:74953] [Bug #12284] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54587 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-15io/console: use rb_funcallvnobu
* ext/io/console/console.c: use rb_funcallv instead of rb_funcall2, and define rb_funcallv if unavailable. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54586 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-15io/console: fallback RARRAY_CONST_PTRnobu
* ext/io/console/console.c (RARRAY_CONST_PTR): fallback definition for older ruby. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54585 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-04-15io/console: reject symbols with nul charnobu
* ext/io/console/console.c (console_key_pressed_p): symbol names can contain nul chars, reject them. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@54584 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-23prefer rb_syserr_failnobu
* file.c, io.c, util.c: prefer rb_syserr_fail with saved errno over setting errno then call rb_sys_fail, not to be clobbered potentially and to reduce thread local errno accesses. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53264 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-08retry IO#getpassnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52948 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-08Revert r52902,r52903,r52910,r52911,r52937,r52939naruse
Reject IO::Console#getpass because it can't test portablly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52945 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-06console.c: prompt to stderrnobu
* ext/io/console/console.c (console_getpass): print prompt to stderr when reading from stdin. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52903 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-06console.c: console_getpassnobu
* ext/io/console/console.c (console_getpass): add IO#getpass method. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52902 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-07console.c: check unused argsnobu
* ext/io/console/console.c (console_set_winsize): unused arguments also should be nil or integers. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52475 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-11-04ext: use RARRAY_CONST_PTRnobu
* ext/bigdecimal/bigdecimal.c: use RARRAY_CONST_PTR just fore reference instead of RARRAY_PTR, to keep the array WB-protected. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52448 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-09-02win32_vk.inc: merge win32_vk.hnobu
* ext/io/console/win32_vk.inc: merge win32_vk.h not to be included in HDRS on other platforms than Windows. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51736 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-07-21console.c: undefined vknobu
* ext/io/console/console.c (console_key_pressed_p): raise undefined virtual key code. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51316 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-07win32_vk.inc: renamednobu
* ext/io/console/win32_vk.inc: renamed not to be included in HDRS by mkmf.rb and regenerated unexpectedly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50437 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-03console.c: pressed? on Windowsnobu
* ext/io/console/console.c (console_key_pressed_p): new method IO#pressed? on Windows. [EXPERIMENTAL] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50427 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-03console.c: cursor position on Windowsnobu
* ext/io/console/console.c (console_goto): new method IO#goto on Windows. [EXPERIMENTAL] * ext/io/console/console.c (console_cursor_pos): new method IO#cursor on Windows. [EXPERIMENTAL] * ext/io/console/console.c (console_cursor_set): new method IO#cursor= on Windows. [EXPERIMENTAL] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50425 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-03console.c: IO#beepnobu
* ext/io/console/console.c (console_beep): new method IO#beep. [EXPERIMENTAL] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50424 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-05-03console.c: remove old ifdefnobu
* ext/io/console/console.c (LAST_ERROR): remove old ifdef, should use rb_w32_map_errno always. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50419 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-03-21console.c: winsize on Windowsnobu
* ext/io/console/console.c (console_set_winsize): use handle for writing. GetConsoleScreenBufferInfo seems failing on a handle for reading. * io.c: [DOC] update the example of IO#winsize to use $stdout instead of $stdin, which does not work on Windows. a patch by Jan Lelis <mail AT janlelis.de> at [ruby-core:68574]. [Bug #10986] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50041 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-16console.c: use static IDsnobu
* ext/io/console/console.c (rawmode_opt): prepare static IDs. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49610 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-16console.c: avoid inadvertent pindownnobu
* ext/io/console/console.c (console_dev): call Kernel#__send__ method to avoid inadvertent pindown. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49609 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-02-16console.c: fix typonobu
* ext/io/console/console.c (console_dev): fix typo, should be rb_funcallv to call with an argument array. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49607 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-25console.c: IO.console arguments passingnobu
* ext/io/console/console.c (console_dev): send the given arguments to the opened console. as a special case, do nothing if :close is given. * test/lib/leakchecker.rb (LeakChecker#check_fd_leak): close if console. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48993 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-25console.c: get rid of NameErrornobu
* ext/io/console/console.c (console_dev): id_console is not a constant name, use rb_const_remove() to get rid of NameError. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48982 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-12-17console.c: dead codenobu
* ext/io/console/console.c: remove dead code for old versions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48877 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2014-02-22* ext/io/console/console.c (console_dev): need read access for conout$usa
because some functions need it. [Bug#9554] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45130 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-08-09* ext/io/console/console.c: delete redefinition of rb_cloexec_open.charliesome
This function is always defined by io.c and is declared as non-static in a header file, so this declaration causes a compilation error. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42466 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-24io/console: rdocnobu
* ext/io/console/console.c (io_getch): add rdoc. * ext/io/console/lib/console/size.rb (IO.console_size): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40911 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-24rename generic io modulesnobu
* ext/io/console/console.c, ext/stringio/stringio.c: rename internally used modules as generic_readable and generic_writable. [Fix GH-315] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40910 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-03-16console.c: supppress warningsnobu
* ext/io/console/console.c (console_iflush, console_oflush): supppress unused-but-set-variable warnings on no tcflush. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39778 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-16io/console: compatibility with 1.8nobu
* ext/io/console/console.c (console_dev): compatibility with ruby 1.8. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39269 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-16io/console: compatibility with 1.9nobu
* ext/io/console/console.c (rawmode_opt, console_dev): compatibility with ruby 1.9. [ruby-core:52220] [Bug #7847] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39268 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-05console.c: default by stty rawnobu
* ext/io/console/console.c (rawmode_opt): use default values by `stty raw`. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39060 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-04console.c: initializenobu
* ext/io/console/console.c (rawmode_opt): initialize options for the case all options are not given. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39039 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-03console.c: fix unit of minnobu
* ext/io/console/console.c (rawmode_opt): min is minimum characters, not tenths. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39029 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-23use RB_TYPE_P() instead of comparison of TYPE()nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35763 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-06* ext/io/console/console.c (set_rawmode): clear ECHOE and ECHOKnobu
bits too. * ext/io/console/console.c (echo_p): ignore ECHOE and ECHOK bits. [ruby-dev:45309] [Bug #6116] * ext/io/console/console.c (console_raw): fix rdoc. * ext/io/console/console.c (console_set_echo): mentioned about platform dependency. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34917 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-25* ext/io/console/console.c (io_getch): default delegating methodnobu
for StringIO. https://github.com/nobu/io-console/issues/4 * ext/stringio/stringio.c: moved some methods to hidden modules. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34376 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-12-07* io.c (Init_IO): Mention io/console methods. [Ruby 1.9 - Bug #5602]drbrain
* ext/io/console/console.c: Mention that io/console must be required similar to lib/time.rb git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33968 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-18* ext/io/console/console.c (console_raw, console_set_raw)nobu
(console_getch): optional parameters. [EXPERIMENTAL] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33786 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-18* ext/io/console/console.c (console_cooked, console_set_cooked):nobu
new methods to reset cooked mode. [EXPERIMENTAL] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33785 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-29* process.c (ruby_setsid): use rb_cloexec_open.akr
(rb_daemon): ditto. * ruby.c (load_file_internal): ditto. * file.c (rb_file_s_truncate): ditto. (file_load_ok): ditto. * random.c (fill_random_seed): ditto. * ext/pty/pty.c (chfunc): ditto. (get_device_once): ditto. * ext/io/console/console.c (console_dev): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33550 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-10-22* include/ruby/intern.h (rb_fd_set_cloexec): declared.akr
* io.c (rb_fd_set_cloexec): new function. (ruby_dup): call rb_fd_set_cloexec to set close-on-exec flag. (rb_sysopen_internal): ditto. (rb_pipe): ditto. (io_reopen): ditto. (io_cntl): ditto. * process.c (rb_f_exec): change the default :close_others option to true. (rb_f_system): ditto. (move_fds_to_avoid_crash): call rb_fd_set_cloexec to set close-on-exec flag. (ruby_setsid): ditto. (rb_daemon): ditto. * thread_pthread.c (rb_thread_create_timer_thread): call rb_fd_set_cloexec to set close-on-exec flag. * ruby.c (load_file_internal): ditto. * file.c (rb_file_s_truncate): ditto. (file_load_ok): ditto. * random.c (fill_random_seed): ditto. * ext/pty/pty.c (chfunc): ditto. (get_device_once): ditto. * ext/openssl/ossl_bio.c (ossl_obj2bio): ditto. * ext/socket/init.c (rsock_socket): ditto. (rsock_s_accept_nonblock): ditto. (rsock_s_accept): ditto. * ext/socket/socket.c (rsock_sock_s_socketpair): ditto. * ext/socket/ancdata.c (discard_cmsg): ditto. (make_io_for_unix_rights): ditto. * ext/socket/unixsocket.c (unix_recv_io): ditto. * ext/io/console/console.c (console_dev): ditto. [ruby-core:38140] [Feature #5041] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33507 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-03* ext/io/console/console.c (console_set_winsize): removenobu
unused variable. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33172 b2dd03c8-39d4-4d8f-98ff-823fe69b080e