Module: Bug::Win32
- Defined in:
- ext/-test-/win32/console/init.c
Constant Summary collapse
- FOREGROUND_MASK =
INT2FIX(FOREGROUND_MASK)
- FOREGROUND_BLUE =
INT2FIX(FOREGROUND_BLUE)
- FOREGROUND_GREEN =
INT2FIX(FOREGROUND_GREEN)
- FOREGROUND_RED =
INT2FIX(FOREGROUND_RED)
- FOREGROUND_INTENSITY =
INT2FIX(FOREGROUND_INTENSITY)
- BACKGROUND_MASK =
INT2FIX(BACKGROUND_MASK)
- BACKGROUND_BLUE =
INT2FIX(BACKGROUND_BLUE)
- BACKGROUND_GREEN =
INT2FIX(BACKGROUND_GREEN)
- BACKGROUND_RED =
INT2FIX(BACKGROUND_RED)
- BACKGROUND_INTENSITY =
INT2FIX(BACKGROUND_INTENSITY)
- REVERSE_VIDEO =
INT2FIX(COMMON_LVB_REVERSE_VIDEO)
Class Method Summary collapse
- .console_attribute(io, attr) ⇒ Object
- .console_info(io) ⇒ Object
- .test_fdset ⇒ Object
- .test_select ⇒ Object
Instance Method Summary collapse
Class Method Details
.console_attribute(io, attr) ⇒ Object
31 32 33 34 35 36 37 38 |
# File 'ext/-test-/win32/console/attribute.c', line 31
static VALUE
console_set_attribute(VALUE klass, VALUE io, VALUE attr)
{
HANDLE h = io_handle(io);
SetConsoleTextAttribute(h, (WORD)NUM2INT(attr));
return Qnil;
}
|
.console_info(io) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'ext/-test-/win32/console/attribute.c', line 15
static VALUE
console_info(VALUE klass, VALUE io)
{
HANDLE h = io_handle(io);
CONSOLE_SCREEN_BUFFER_INFO csbi;
if (!GetConsoleScreenBufferInfo(h, &csbi))
rb_syserr_fail(rb_w32_map_errno(GetLastError()), "not console");
return rb_struct_new(rb_cConsoleScreenBufferInfo,
INT2FIX(csbi.dwSize.X),
INT2FIX(csbi.dwSize.Y),
INT2FIX(csbi.dwCursorPosition.X),
INT2FIX(csbi.dwCursorPosition.Y),
INT2FIX(csbi.wAttributes));
}
|
.test_fdset ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'ext/-test-/win32/fd_setsize/fd_setsize.c', line 31
static VALUE
test_fdset(VALUE self)
{
int i;
fd_set set;
FD_ZERO(&set);
for (i = 0; i < FD_SETSIZE * 2; i++) {
int sd = socket(AF_INET, SOCK_DGRAM, 0);
FD_SET(sd, &set);
if (set.fd_count > FD_SETSIZE) {
return Qfalse;
}
}
return Qtrue;
}
|
.test_select ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'ext/-test-/win32/fd_setsize/fd_setsize.c', line 6
static VALUE
test_select(VALUE self)
{
int sd = socket(AF_INET, SOCK_DGRAM, 0);
struct timeval zero;
fd_set read;
fd_set write;
fd_set error;
zero.tv_sec = 0;
zero.tv_usec = 0;
FD_ZERO(&read);
FD_ZERO(&write);
FD_ZERO(&error);
FD_SET(sd, &read);
FD_SET(sd, &write);
FD_SET(sd, &error);
select(sd+1, &read, &write, &error, &zero);
return Qtrue;
}
|
Instance Method Details
#exec_recursive(mid) ⇒ Object
10 11 12 13 14 |
# File 'ext/-test-/recursion/recursion.c', line 10
static VALUE
exec_recursive(VALUE self, VALUE mid)
{
return rb_exec_recursive(recursive_i, self, mid);
}
|
#exec_recursive_outer(mid) ⇒ Object
16 17 18 19 20 |
# File 'ext/-test-/recursion/recursion.c', line 16
static VALUE
exec_recursive_outer(VALUE self, VALUE mid)
{
return rb_exec_recursive_outer(recursive_i, self, mid);
}
|