io-console 0.5.0 → 0.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/io/console/console.c +9 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f87daa288fc605a3bf48b70558316f9427552fcf895e3a40363f71ba095d3e1b
|
4
|
+
data.tar.gz: bddde3f65430cad405fdd4ef576f9d18b85368001f5ea27dc16fb941e0065a04
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bd7bb0e4285b7a3de96006386f262cc74fde97fc34a157ad8b834661e52a1aefe210d683c8264e6a98cf8ce80610b7fa8917e79d2b80f87ea4ae052e60c98839
|
7
|
+
data.tar.gz: 23a0ac10ecd3f77ca899f5c00a9cc0689bc1c593540b116a6656eaef7d50aad887a3cfbcd66e6f954ebcac3e93f7f9eddbcda0f620d7804a196d541359e230bc
|
data/ext/io/console/console.c
CHANGED
@@ -4,6 +4,7 @@
|
|
4
4
|
*/
|
5
5
|
#include "ruby.h"
|
6
6
|
#include "ruby/io.h"
|
7
|
+
#include "ruby/thread.h"
|
7
8
|
|
8
9
|
#ifdef HAVE_UNISTD_H
|
9
10
|
#include <unistd.h>
|
@@ -186,9 +187,10 @@ set_rawmode(conmode *t, void *arg)
|
|
186
187
|
#ifdef ISIG
|
187
188
|
if (r->intr) {
|
188
189
|
t->c_iflag |= BRKINT|IXON;
|
189
|
-
t->c_lflag |= ISIG
|
190
|
+
t->c_lflag |= ISIG;
|
190
191
|
}
|
191
192
|
#endif
|
193
|
+
(void)r;
|
192
194
|
}
|
193
195
|
}
|
194
196
|
|
@@ -454,7 +456,7 @@ getc_call(VALUE io)
|
|
454
456
|
return rb_funcallv(io, id_getc, 0, 0);
|
455
457
|
}
|
456
458
|
#else
|
457
|
-
static
|
459
|
+
static void *
|
458
460
|
nogvl_getch(void *p)
|
459
461
|
{
|
460
462
|
int len = 0;
|
@@ -463,7 +465,6 @@ nogvl_getch(void *p)
|
|
463
465
|
switch (c) {
|
464
466
|
case WEOF:
|
465
467
|
break;
|
466
|
-
return (VALUE)0;
|
467
468
|
case 0x00:
|
468
469
|
case 0xe0:
|
469
470
|
buf[len++] = c;
|
@@ -473,7 +474,7 @@ nogvl_getch(void *p)
|
|
473
474
|
buf[len++] = c;
|
474
475
|
break;
|
475
476
|
}
|
476
|
-
return (VALUE)len;
|
477
|
+
return (void *)(VALUE)len;
|
477
478
|
}
|
478
479
|
#endif
|
479
480
|
|
@@ -517,8 +518,11 @@ console_getch(int argc, VALUE *argv, VALUE io)
|
|
517
518
|
if (w < 0) rb_eof_error();
|
518
519
|
if (!(w & RB_WAITFD_IN)) return Qnil;
|
519
520
|
}
|
521
|
+
else {
|
522
|
+
rb_warning("vtime option ignored if intr flag is unset");
|
523
|
+
}
|
520
524
|
}
|
521
|
-
len = (int)
|
525
|
+
len = (int)(VALUE)rb_thread_call_without_gvl(nogvl_getch, wbuf, RUBY_UBF_IO, 0);
|
522
526
|
switch (len) {
|
523
527
|
case 0:
|
524
528
|
return Qnil;
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: io-console
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nobu Nakada
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-12-10 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: add console capabilities to IO instances.
|
14
14
|
email: nobu@ruby-lang.org
|