Module: Libconio

Defined in:
ext/libconio.c

Instance Method Summary collapse

Instance Method Details

#clreolnil

Clears all characters from the cursor position to the end of the line within the string length, in the location string.

Returns:

  • (nil)


42
43
44
45
46
47
48
49
# File 'ext/libconio.c', line 42

VALUE method_clreol(VALUE self)
{
	// Native function clreol()
	clreol();

	// Return NULL value
	return Qnil;
}

#clrscrnil

Clears the current text window and places the cursor in the upper left hand corner at position 1, 1.

Returns:

  • (nil)


58
59
60
61
62
63
64
65
# File 'ext/libconio.c', line 58

VALUE method_clrscr(VALUE self)
{
	// Native function clrscr()
	clrscr();

	// Return NULL value
	return Qnil;
}

#cputs(text) ⇒ String

Writes the null-terminated string text to the current text window.

Returns:

  • (String)


73
74
75
76
77
78
79
80
81
82
83
# File 'ext/libconio.c', line 73

VALUE method_cputs(VALUE self, VALUE string_text)
{
	// Ruby conversion string
	const char * text = StringValuePtr(string_text);

	// Native function cputs()
	cputs(text);

	// Return value text
	return rb_str_new2(text);
}

#cropnil

Crop the window console buffer size.

Returns:

  • (nil)


91
92
93
94
95
96
97
98
# File 'ext/libconio.c', line 91

VALUE method_crop(VALUE self)
{
	// Native function crop()
	con_crop();

	// Return NULL value
	return Qnil;
}

#delay(milliseconds) ⇒ nil

The time interval for which execution is to be suspended, in milliseconds.

Returns:

  • (nil)


106
107
108
109
110
111
112
113
114
115
116
# File 'ext/libconio.c', line 106

VALUE method_delay(VALUE self, VALUE int_milliseconds)
{
	// Ruby conversion long
	int milliseconds = NUM2LONG(int_milliseconds);

	// Native function delay()
	delay(milliseconds);

	// Return NULL value
	return Qnil;
}

#dellinenil

Deletes the line containing the cursor and moves all lines below it a line up.

Returns:

  • (nil)


124
125
126
127
128
129
130
131
# File 'ext/libconio.c', line 124

VALUE method_delline(VALUE self)
{
	// Native function delline()
	delline();

	// Return NULL value
	return Qnil;
}

#fill(character, forecolor, backcolor, number, x, y) ⇒ nil

Write the specified number of consecutive characters, beginning at X and Y coordinates, with the value specified attribute.

Returns:

  • (nil)


140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
# File 'ext/libconio.c', line 140

VALUE method_fill(VALUE self, VALUE int_character, VALUE int_forecolor, VALUE int_backcolor, VALUE int_number, VALUE int_x, VALUE int_y)
{
	// Ruby conversion integer
	int character = NUM2INT(int_character);
	int forecolor = NUM2INT(int_forecolor);
	int backcolor = NUM2INT(int_backcolor);
	int number = NUM2INT(int_number);
	int x = NUM2INT(int_x);
	int y = NUM2INT(int_y);

	// Native function fill()
	con_fill(character, forecolor, backcolor, number, x, y);

	// Return NULL value
	return Qnil;
}

#fillattr(forecolor, backcolor, number, x, y) ⇒ nil

Fills the specified number of consecutive attributes, beginning at X and Y coordinates, with the value specified attribute.

Returns:

  • (nil)


164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
# File 'ext/libconio.c', line 164

VALUE method_fillattr(VALUE self, VALUE int_forecolor, VALUE int_backcolor, VALUE int_number, VALUE int_x, VALUE int_y)
{
	// Ruby conversion integer
	int forecolor = NUM2INT(int_forecolor);
	int backcolor = NUM2INT(int_backcolor);
	int number = NUM2INT(int_number);
	int x = NUM2INT(int_x);
	int y = NUM2INT(int_y);

	// Native function fillattr()
	con_fillattr(forecolor, backcolor, number, x, y);

	// Return NULL value
	return Qnil;
}

#fillchar(character, number, x, y) ⇒ nil

Write the specified number of consecutive characters, beginning at X and Y coordinates.

Returns:

  • (nil)


186
187
188
189
190
191
192
193
194
195
196
197
198
199
# File 'ext/libconio.c', line 186

VALUE method_fillchar(VALUE self, VALUE int_character, VALUE int_number, VALUE int_x, VALUE int_y)
{
	// Ruby conversion integer
	int character = NUM2INT(int_character);
	int number = NUM2INT(int_number);
	int x = NUM2INT(int_x);
	int y = NUM2INT(int_y);

	// Native function fillchar()
	con_fillchar(character, number, x, y);

	// Return NULL value
	return Qnil;
}

#fillcr(character, number, x, y) ⇒ nil

Write the specified number of consecutive characters, beginning at X and Y coordinates.

Returns:

  • (nil)


207
208
209
210
211
212
213
214
215
216
217
218
219
220
# File 'ext/libconio.c', line 207

VALUE method_fillcr(VALUE self, VALUE int_character, VALUE int_number, VALUE int_x, VALUE int_y)
{
	// Ruby conversion integer
	int character = NUM2INT(int_character);
	int number = NUM2INT(int_number);
	int x = NUM2INT(int_x);
	int y = NUM2INT(int_y);

	// Native function fillcr()
	con_fillcr(character, number, x, y);

	// Return NULL value
	return Qnil;
}

#get(left, top, right, bottom, buffer) ⇒ nil

Get the contents with attributes of the memory area source out to the onscreen rectangle defined by left, top, right and bottom.

Returns:

  • (nil)


229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
# File 'ext/libconio.c', line 229

VALUE method_get(VALUE self, VALUE int_left, VALUE int_top, VALUE int_right, VALUE int_bottom, VALUE int_buffer)
{
	// Ruby conversion integer
	int left = NUM2INT(int_left);
	int top = NUM2INT(int_top);
	int right = NUM2INT(int_right);
	int bottom = NUM2INT(int_bottom);
	int buffer = NUM2INT(int_buffer);

	// Declare variable dimension
	int dimension[buffer];

	// Native function get()
	con_get(left, top, right, bottom, dimension);

	// Return NULL value
	return Qnil;
}

#getattrs(left, top, right, bottom, buffer) ⇒ nil

Get the attributes of the memory area source out to the onscreen rectangle defined by left, top, right and bottom.

Returns:

  • (nil)


255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
# File 'ext/libconio.c', line 255

VALUE method_getattrs(VALUE self, VALUE int_left, VALUE int_top, VALUE int_right, VALUE int_bottom, VALUE int_buffer)
{
	// Ruby conversion integer
	int left = NUM2INT(int_left);
	int top = NUM2INT(int_top);
	int right = NUM2INT(int_right);
	int bottom = NUM2INT(int_bottom);
	int buffer = NUM2INT(int_buffer);

	// Declare variable dimension
	int dimension[buffer];

	// Native function getattrs()
	con_getattrs(left, top, right, bottom, dimension);

	// Return NULL value
	return Qnil;
}

#getchNumeric

Reads a single character directly from the keyboard, without echoing to the screen.

Returns:

  • (Numeric)


280
281
282
283
284
285
286
287
# File 'ext/libconio.c', line 280

VALUE method_getch(VALUE self)
{
	// Native function getch()
	int character = getch();

	// Return value character
	return INT2NUM(character);
}

#getchars(left, top, right, bottom, buffer) ⇒ nil

Get the contents of the memory area source out to the onscreen rectangle defined by left, top, right and bottom.

Returns:

  • (nil)


295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
# File 'ext/libconio.c', line 295

VALUE method_getchars(VALUE self, VALUE int_left, VALUE int_top, VALUE int_right, VALUE int_bottom, VALUE int_buffer)
{
	// Ruby conversion integer
	int left = NUM2INT(int_left);
	int top = NUM2INT(int_top);
	int right = NUM2INT(int_right);
	int bottom = NUM2INT(int_bottom);
	int buffer = NUM2INT(int_buffer);

	// Declare variable dimension
	char dimension[buffer];

	// Native function getchars()
	con_getchars(left, top, right, bottom, dimension);

	// Return NULL value
	return Qnil;
}

#getcheNumeric

Reads a single character from the keyboard and echoes it to the current text windows.

Returns:

  • (Numeric)


320
321
322
323
324
325
326
327
# File 'ext/libconio.c', line 320

VALUE method_getche(VALUE self)
{
	// Native function getche()
	int character = getche();

	// Return value character
	return INT2NUM(character);
}

#getinfoArray

Gets console information.

Returns:

  • (Array)


335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
# File 'ext/libconio.c', line 335

VALUE method_getinfo(VALUE self)
{
	// Declare struct info
	con_info info;

	// Native function getinfo()
	con_getinfo(& info);

	// Set value info
	int attr = info.attr;
	int cx = info.cx;
	int cy = info.cy;
	int top = info.top;
	int left = info.left;
	int right = info.right;
	int bottom = info.bottom;
	int width = info.width;
	int height = info.height;
	int maxwidth = info.maxwidth;
	int maxheight = info.maxheight;
	int totalwidth = info.totalwidth;
	int totalheight = info.totalheight;

	// Create new Ruby hash
	VALUE array = rb_ary_new();

	// Populate Ruby hash
	rb_ary_push(array, INT2NUM(attr));
	rb_ary_push(array, INT2NUM(cx));
	rb_ary_push(array, INT2NUM(cy));
	rb_ary_push(array, INT2NUM(top));
	rb_ary_push(array, INT2NUM(left));
	rb_ary_push(array, INT2NUM(right));
	rb_ary_push(array, INT2NUM(bottom));
	rb_ary_push(array, INT2NUM(width));
	rb_ary_push(array, INT2NUM(height));
	rb_ary_push(array, INT2NUM(maxwidth));
	rb_ary_push(array, INT2NUM(maxheight));
	rb_ary_push(array, INT2NUM(totalwidth));
	rb_ary_push(array, INT2NUM(totalheight));

	// Return value hash
	return array;
}

#gettext(left, top, right, bottom, buffer) ⇒ nil

Get the text of the memory area source out to the onscreen rectangle defined by left, top, right and bottom.

Returns:

  • (nil)


387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
# File 'ext/libconio.c', line 387

VALUE method_gettext(VALUE self, VALUE int_left, VALUE int_top, VALUE int_right, VALUE int_bottom, VALUE int_buffer)
{
	// Ruby conversion integer
	int left = NUM2INT(int_left);
	int top = NUM2INT(int_top);
	int right = NUM2INT(int_right);
	int bottom = NUM2INT(int_bottom);
	int buffer = NUM2INT(int_buffer);

	// Declare variable dimension
	char dimension[buffer];

	// Native function gettext()
	gettext(left, top, right, bottom, dimension);

	// Return NULL value
	return Qnil;
}

#gettextinfoArray

Gets text mode video information.

Returns:

  • (Array)


412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
# File 'ext/libconio.c', line 412

VALUE method_gettextinfo(VALUE self)
{
	// Declare struct info
	text_info info;

	// Native function gettextinfo()
	gettextinfo(& info);

	// Set value info
	int attribute = info.attribute;
	int normattr = info.normattr;
	int currmode = info.currmode;
	int curx = info.curx;
	int cury = info.cury;
	int screenwidth = info.screenwidth;
	int screenheight = info.screenheight;
	int winleft = info.winleft;
	int wintop = info.wintop;
	int winright = info.winright;
	int winbottom = info.winbottom;

	// Create new Ruby hash
	VALUE array = rb_ary_new();

	// Populate Ruby hash
	rb_ary_push(array, INT2NUM(attribute));
	rb_ary_push(array, INT2NUM(normattr));
	rb_ary_push(array, INT2NUM(currmode));
	rb_ary_push(array, INT2NUM(curx));
	rb_ary_push(array, INT2NUM(cury));
	rb_ary_push(array, INT2NUM(screenwidth));
	rb_ary_push(array, INT2NUM(screenheight));
	rb_ary_push(array, INT2NUM(winleft));
	rb_ary_push(array, INT2NUM(wintop));
	rb_ary_push(array, INT2NUM(winright));
	rb_ary_push(array, INT2NUM(winbottom));

	// Return value hash
	return array;
}

#gotoxy(x, y) ⇒ nil

Moves the cursor to the given position in the current text window.

Returns:

  • (nil)


459
460
461
462
463
464
465
466
467
468
469
470
# File 'ext/libconio.c', line 459

VALUE method_gotoxy(VALUE self, VALUE int_x, VALUE int_y)
{
	// Ruby conversion integer
	int x = NUM2INT(int_x);
	int y = NUM2INT(int_y);

	// Native function gotoxy()
	gotoxy(x + 1, y + 1);

	// Return NULL value
	return Qnil;
}

#inslinenil

Inserts an empty line in the text window at the cursor position using the current text background color.

Returns:

  • (nil)


479
480
481
482
483
484
485
486
# File 'ext/libconio.c', line 479

VALUE method_insline(VALUE self)
{
	// Native function insline()
	insline();

	// Return NULL value
	return Qnil;
}

#movetext(left, top, right, bottom, newleft, newtop) ⇒ nil

Copies the contents of the onscreen rectangle defined by left, top, right, and bottom to a new rectangle of the same dimensions.

Returns:

  • (nil)


510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
# File 'ext/libconio.c', line 510

VALUE method_movetext(VALUE self, VALUE int_left, VALUE int_top, VALUE int_right, VALUE int_bottom, VALUE int_newleft, VALUE int_newtop)
{
	// Ruby conversion integer
	int left = NUM2INT(int_left);
	int top = NUM2INT(int_top);
	int right = NUM2INT(int_right);
	int bottom = NUM2INT(int_bottom);
	int newleft = NUM2INT(int_newleft);
	int newtop = NUM2INT(int_newtop);

	// Native function movetext()
	movetext(left, top, right, bottom, newleft, newtop);

	// Return NULL value
	return Qnil;
}

#put(left, top, right, bottom, buffer) ⇒ nil

Put the contents with attributes of the memory area source out to the onscreen rectangle defined by left, top, right and bottom.

Returns:

  • (nil)


534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
# File 'ext/libconio.c', line 534

VALUE method_put(VALUE self, VALUE int_left, VALUE int_top, VALUE int_right, VALUE int_bottom, VALUE int_buffer)
{
	// Ruby conversion integer
	int left = NUM2INT(int_left);
	int top = NUM2INT(int_top);
	int right = NUM2INT(int_right);
	int bottom = NUM2INT(int_bottom);
	int buffer = NUM2INT(int_buffer);

	// Declare variable dimension
	int dimension[buffer];

	// Native function put()
	con_put(left, top, right, bottom, dimension);

	// Return NULL value
	return Qnil;
}

#putattrs(left, top, right, bottom, buffer) ⇒ nil

Put the attributes of the memory area source out to the onscreen rectangle defined by left, top, right and bottom.

Returns:

  • (nil)


560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
# File 'ext/libconio.c', line 560

VALUE method_putattrs(VALUE self, VALUE int_left, VALUE int_top, VALUE int_right, VALUE int_bottom, VALUE int_buffer)
{
	// Ruby conversion integer
	int left = NUM2INT(int_left);
	int top = NUM2INT(int_top);
	int right = NUM2INT(int_right);
	int bottom = NUM2INT(int_bottom);
	int buffer = NUM2INT(int_buffer);

	// Declare variable dimension
	int dimension[buffer];

	// Native function putattrs()
	con_putattrs(left, top, right, bottom, dimension);

	// Return NULL value
	return Qnil;
}

#putch(character) ⇒ Numeric

Outputs the character c to the current text window. It is a text-mode function that performs direct video output to the console.

Returns:

  • (Numeric)


586
587
588
589
590
591
592
593
594
595
596
# File 'ext/libconio.c', line 586

VALUE method_putch(VALUE self, VALUE int_character)
{
	// Ruby conversion integer
	int character = NUM2INT(int_character);

	// Native function putch()
	int value = putchar(character);

	// Return value character
	return INT2NUM(value);
}

#putchars(left, top, right, bottom, buffer) ⇒ nil

Put the contents of the memory area source out to the onscreen rectangle defined by left, top, right and bottom.

Returns:

  • (nil)


605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
# File 'ext/libconio.c', line 605

VALUE method_putchars(VALUE self, VALUE int_left, VALUE int_top, VALUE int_right, VALUE int_bottom, VALUE int_buffer)
{
	// Ruby conversion integer
	int left = NUM2INT(int_left);
	int top = NUM2INT(int_top);
	int right = NUM2INT(int_right);
	int bottom = NUM2INT(int_bottom);
	int buffer = NUM2INT(int_buffer);

	// Declare variable dimension
	char dimension[buffer];

	// Native function getattrs()
	con_putchars(left, top, right, bottom, dimension);

	// Return NULL value
	return Qnil;
}

#puttext(left, top, right, bottom, buffer) ⇒ nil

Put the text of the memory area source out to the onscreen rectangle defined by left, top, right and bottom.

Returns:

  • (nil)


631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
# File 'ext/libconio.c', line 631

VALUE method_puttext(VALUE self, VALUE int_left, VALUE int_top, VALUE int_right, VALUE int_bottom, VALUE int_buffer)
{
	// Ruby conversion integer
	int left = NUM2INT(int_left);
	int top = NUM2INT(int_top);
	int right = NUM2INT(int_right);
	int bottom = NUM2INT(int_bottom);
	int buffer = NUM2INT(int_buffer);

	// Declare variable dimension
	char dimension[buffer];

	// Native function puttext()
	puttext(left, top, right, bottom, dimension);

	// Return NULL value
	return Qnil;
}

#resize(width, height) ⇒ nil

Resize buffer and window size.

Returns:

  • (nil)


656
657
658
659
660
661
662
663
664
665
666
667
# File 'ext/libconio.c', line 656

VALUE method_resize(VALUE self, VALUE int_width, VALUE int_height)
{
	// Ruby conversion integer
	int width = NUM2INT(int_width);
	int height = NUM2INT(int_height);

	// Native function resize()
	con_resize(width, height);

	// Return NULL value
	return Qnil;
}

#scroll(left, top, right, bottom, newleft, newtop) ⇒ nil

The console window displays a portion of the active screen buffer.

Returns:

  • (nil)


675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
# File 'ext/libconio.c', line 675

VALUE method_scroll(VALUE self, VALUE int_left, VALUE int_top, VALUE int_right, VALUE int_bottom, VALUE int_newleft, VALUE int_newtop)
{
	// Ruby conversion integer
	int left = NUM2INT(int_left);
	int top = NUM2INT(int_top);
	int right = NUM2INT(int_right);
	int bottom = NUM2INT(int_bottom);
	int newleft = NUM2INT(int_newleft);
	int newtop = NUM2INT(int_newtop);

	// Native function scroll()
	con_scroll(left, top, right, bottom, newleft, newtop);

	// Return NULL value
	return Qnil;
}

#scrolldown(left, top, right, bottom) ⇒ nil

Scroll down the text in current window text.

Returns:

  • (nil)


719
720
721
722
723
724
725
726
727
728
729
730
731
732
# File 'ext/libconio.c', line 719

VALUE method_scrolldown(VALUE self, VALUE int_left, VALUE int_top, VALUE int_right, VALUE int_bottom)
{
	// Ruby conversion integer
	int left = NUM2INT(int_left);
	int top = NUM2INT(int_top);
	int right = NUM2INT(int_right);
	int bottom = NUM2INT(int_bottom);

	// Native function scrolldown()
	con_scrolldown(left, top, right, bottom);

	// Return NULL value
	return Qnil;
}

#scrollleft(left, top, right, bottom) ⇒ nil

Scroll left the text in current window text.

Returns:

  • (nil)


740
741
742
743
744
745
746
747
748
749
750
751
752
753
# File 'ext/libconio.c', line 740

VALUE method_scrollleft(VALUE self, VALUE int_left, VALUE int_top, VALUE int_right, VALUE int_bottom)
{
	// Ruby conversion integer
	int left = NUM2INT(int_left);
	int top = NUM2INT(int_top);
	int right = NUM2INT(int_right);
	int bottom = NUM2INT(int_bottom);

	// Native function scrollleft()
	con_scrollleft(left, top, right, bottom);

	// Return NULL value
	return Qnil;
}

#scrollright(left, top, right, bottom) ⇒ nil

Scroll right the text in current window text.

Returns:

  • (nil)


761
762
763
764
765
766
767
768
769
770
771
772
773
774
# File 'ext/libconio.c', line 761

VALUE method_scrollright(VALUE self, VALUE int_left, VALUE int_top, VALUE int_right, VALUE int_bottom)
{
	// Ruby conversion integer
	int left = NUM2INT(int_left);
	int top = NUM2INT(int_top);
	int right = NUM2INT(int_right);
	int bottom = NUM2INT(int_bottom);

	// Native function scrollright()
	con_scrollright(left, top, right, bottom);

	// Return NULL value
	return Qnil;
}

#scrollup(left, top, right, bottom) ⇒ nil

Scroll up the text in current window text.

Returns:

  • (nil)


698
699
700
701
702
703
704
705
706
707
708
709
710
711
# File 'ext/libconio.c', line 698

VALUE method_scrollup(VALUE self, VALUE int_left, VALUE int_top, VALUE int_right, VALUE int_bottom)
{
	// Ruby conversion integer
	int left = NUM2INT(int_left);
	int top = NUM2INT(int_top);
	int right = NUM2INT(int_right);
	int bottom = NUM2INT(int_bottom);

	// Native function scrollup()
	con_scrollup(left, top, right, bottom);

	// Return NULL value
	return Qnil;
}

#setbuffer(width, height) ⇒ nil

Define a window buffer size.

Returns:

  • (nil)


782
783
784
785
786
787
788
789
790
791
792
793
# File 'ext/libconio.c', line 782

VALUE method_setbuffer(VALUE self, VALUE int_width, VALUE int_height)
{
	// Ruby conversion integer
	int width = NUM2INT(int_width);
	int height = NUM2INT(int_height);

	// Native function setbuffer()
	con_setbuffer(width, height);

	// Return NULL value
	return Qnil;
}

#setcursortype(cursor) ⇒ nil

Sets the cursor type in range 0 (hide cursor) to 100 (solid block cursor).

Returns:

  • (nil)


801
802
803
804
805
806
807
808
809
810
811
# File 'ext/libconio.c', line 801

VALUE method_setcursortype(VALUE self, VALUE int_cursor)
{
	// Ruby conversion integer
	int cursor = NUM2INT(int_cursor);

	// Native function setcursortype()
	_setcursortype(cursor);

	// Return NULL value
	return Qnil;
}

#settitle(title) ⇒ nil

Change the console window title.

Returns:

  • (nil)


819
820
821
822
823
824
825
826
827
828
829
# File 'ext/libconio.c', line 819

VALUE method_settitle(VALUE self, VALUE string_title)
{
	// Ruby conversion string
	const char * title = StringValuePtr(string_title);

	// Native function settitle()
	con_settitle(title);

	// Return NULL value
	return Qnil;
}

#setwindow(left, top, right, bottom) ⇒ nil

Defines a text window onscreen. If the coordinates are in any way invalid, the call to window is ignored.

Returns:

  • (nil)


838
839
840
841
842
843
844
845
846
847
848
849
850
851
# File 'ext/libconio.c', line 838

VALUE method_setwindow(VALUE self, VALUE int_left, VALUE int_top, VALUE int_right, VALUE int_bottom)
{
	// Ruby conversion integer
	int left = NUM2INT(int_left);
	int top = NUM2INT(int_top);
	int right = NUM2INT(int_right);
	int bottom = NUM2INT(int_bottom);

	// Native function setwindow()
	con_setwindow(left, top, right, bottom);

	// Return NULL value
	return Qnil;
}

#sleep(seconds) ⇒ nil

The time interval for which execution is to be suspended, in seconds.

Returns:

  • (nil)


859
860
861
862
863
864
865
866
867
868
869
# File 'ext/libconio.c', line 859

VALUE method_sleep(VALUE self, VALUE int_seconds)
{
	// Ruby conversion integer
	int seconds = NUM2INT(int_seconds);

	// Native function sleep()
	sleep(seconds);

	// Return NULL value
	return Qnil;
}

#textbackground(color) ⇒ nil

Selects the background character color.

Returns:

  • (nil)


877
878
879
880
881
882
883
884
885
886
887
# File 'ext/libconio.c', line 877

VALUE method_textbackground(VALUE self, VALUE int_color)
{
	// Ruby conversion integer
	int color = NUM2INT(int_color);

	// Native function textbackground()
	textbackground(color);

	// Return NULL value
	return Qnil;
}

#textcolor(color) ⇒ nil

Selects the foreground character color.

Returns:

  • (nil)


895
896
897
898
899
900
901
902
903
904
905
# File 'ext/libconio.c', line 895

VALUE method_textcolor(VALUE self, VALUE int_color)
{
	// Ruby conversion integer
	int color = NUM2INT(int_color);

	// Native function textcolor()
	textcolor(color);

	// Return NULL value
	return Qnil;
}

#ungetch(character) ⇒ Numeric

Pushes the character ch back to the console, causing ch to be the next character read.

Returns:

  • (Numeric)


913
914
915
916
917
918
919
920
921
922
923
# File 'ext/libconio.c', line 913

VALUE method_ungetch(VALUE self, VALUE int_character)
{
	// Ruby conversion integer
	int character = NUM2INT(int_character);

	// Native function ungetch()
	int value = ungetch(character);

	// Return value character
	return INT2NUM(value);
}

#wherexNumeric

Gets the X coordinate of the current cursor position (within the current text window).

Returns:

  • (Numeric)


931
932
933
934
935
936
937
938
939
# File 'ext/libconio.c', line 931

VALUE method_wherex(VALUE self)
{

	// Native function wherex()
	int position = wherex() - 1;

	// Return NULL value
	return INT2NUM(position);
}

#whereyNumeric

Gets the Y coordinate of the current cursor position (within the current text window).

Returns:

  • (Numeric)


947
948
949
950
951
952
953
954
955
# File 'ext/libconio.c', line 947

VALUE method_wherey(VALUE self)
{

	// Native function wherex()
	int position = wherey() - 1;

	// Return NULL value
	return INT2NUM(position);
}