@c ---------------------------------------------------------------------- @node clreol, conio @subheading Syntax @example #include void clreol(void); @end example @subheading Description Clear to end of line. @subheading Return Value None. @subheading Portability @portability !ansi, !posix @c ---------------------------------------------------------------------- @node clrscr, conio @subheading Syntax @example #include void clrscr(void); @end example @subheading Description Clear the entire screen. @subheading Portability @portability !ansi, !posix @c ---------------------------------------------------------------------- @node gotoxy, conio @subheading Syntax @example #include void gotoxy(int x, int y); @end example @subheading Description Move the cursor to row y, column x. The upper left corner of the current window is (1,1). @subheading Portability @portability !ansi, !posix @c ---------------------------------------------------------------------- @node wherex, conio @subheading Syntax @example #include int wherex(void); @end example @subheading Return Value The column the cursor is on. The leftmost column is 1. @subheading Portability @portability !ansi, !posix @c ---------------------------------------------------------------------- @node wherey, conio @subheading Syntax @example #include int wherey(void); @end example @subheading Return Value The row the cursor is on. The topmost row is 1. @subheading Portability @portability !ansi, !posix @c ---------------------------------------------------------------------- @node putch, conio @subheading Syntax @example #include int putch(int _c); @end example @subheading Description Put the character @var{_c} on the screen at the current cursor position. The special characters return, linefeed, bell, and backspace are handled properly, as is line wrap and scrolling. The cursor position is updated. @subheading Return Value The character is returned. @subheading Portability @portability !ansi, !posix @c ---------------------------------------------------------------------- @node getch, conio @subheading Syntax @example #include int getch(void); @end example @subheading Description A single character from the predefined standard input handle is read and returned. The input is not buffered. If there is a character pending from @code{ungetch} (@pxref{ungetch}), it is returned instead. The character is not echoed to the screen. This function doesn't check for special characters like @kbd{Ctrl-@key{C}}. If the standard input handle is connected to the console, any pending output in the @code{stdout} and @code{stderr} streams is flushed before reading the input, if these streams are connected to the console. @subheading Return Value The character. @subheading Portability @portability !ansi, !posix @c ---------------------------------------------------------------------- @node getche, conio @subheading Syntax @example #include int getche(void); @end example @subheading Description A single character from the predefined standard input handle is read and returned. The input is not buffered. If there is a character pending from @code{ungetch} (@pxref{ungetch}), it is returned instead. The character is echoed to the screen. This function doesn't check for special characters like @kbd{Ctrl-@key{C}}. If the standard input handle is connected to the console, any pending output in the @code{stdout} and @code{stderr} streams is flushed before reading the input, if these streams are connected to the console. @subheading Return Value The character. @subheading Portability @portability !ansi, !posix @c ---------------------------------------------------------------------- @node ungetch, conio @subheading Syntax @example #include int ungetch(int); @end example @subheading Description Puts a character back, so that @ref{getch} will return it instead of actually reading the console. @subheading Return Value The charater is returned. @subheading Portability @portability !ansi, !posix @c ---------------------------------------------------------------------- @node _conio_kbhit, conio @subheading Syntax @example #include int _conio_kbhit(void); @end example @subheading Description Determines whether or not a character is waiting at the keyboard. If there is an ungetch'd character, this function returns true. Note that if you include @code{conio.h}, the @ref{kbhit} function is redefined to be this function instead. @subheading Return Value Nonzero if a key is waiting, else zero. @subheading Portability @portability !ansi, !posix @c ---------------------------------------------------------------------- @node delline, conio @subheading Syntax @example #include void delline(void); @end example @subheading Description The line the cursor is on is deleted; lines below it scroll up. @subheading Portability @portability !ansi, !posix @c ---------------------------------------------------------------------- @node gettext, conio @subheading Syntax @example #include int gettext(int _left, int _top, int _right, int _bottom, void *_destin); @end example @subheading Description Retrieve a block of screen characters into a buffer. @subheading Return Value 1 @subheading Portability @portability !ansi, !posix @c ---------------------------------------------------------------------- @node gettextinfo, conio @subheading Syntax @example #include void gettextinfo(struct text_info *_r); @end example @subheading Description This function returns the parameters of the current window on the screen. The return structure is this: @example struct text_info @{ unsigned char winleft; unsigned char wintop; unsigned char winright; unsigned char winbottom; unsigned char attribute; unsigned char normattr; unsigned char currmode; unsigned char screenheight; unsigned char screenwidth; unsigned char curx; unsigned char cury; @}; @end example The @code{normattr} field is the text attribute which was in effect before the program started. @subheading Portability @portability !ansi, !posix @c ---------------------------------------------------------------------- @node highvideo, conio @subheading Syntax @example #include void highvideo(void); @end example @subheading Description Causes any new characters put on the screen to be bright. @subheading Portability @portability !ansi, !posix @c ---------------------------------------------------------------------- @node insline, conio @subheading Syntax @example #include void insline(void); @end example @subheading Description A blank line is inserted at the current cursor position. The previous line and lines below it scroll down. @subheading Portability @portability !ansi, !posix @c ---------------------------------------------------------------------- @node lowvideo, conio @subheading Syntax @example #include void lowvideo(void); @end example @subheading Description Causes any new characters put on the screen to be dim. @subheading Portability @portability !ansi, !posix @c ---------------------------------------------------------------------- @node movetext, conio @subheading Syntax @example #include int movetext(int _left, int _top, int _right, int _bottom, int _destleft, int _desttop); @end example @subheading Description Moves a block of text on the screen. @subheading Return Value 1 on success, zero on error. @subheading Portability @portability !ansi, !posix @c ---------------------------------------------------------------------- @node normvideo, conio @subheading Syntax @example #include void normvideo(void); @end example @subheading Description Resets the text attribute to what it was before the program started. @subheading Portability @portability !ansi, !posix @c ---------------------------------------------------------------------- @node puttext, conio @subheading Syntax @example #include int puttext(int _left, int _top, int _right, int _bottom, void *_source); @end example @subheading Description The opposite of @ref{gettext}. @subheading Return Value 1 on success, zero on error. @subheading Portability @portability !ansi, !posix @c ---------------------------------------------------------------------- @node textattr, conio @subheading Syntax @example #include void textattr(int _attr); @end example @subheading Description Sets the attribute used for future writes to the screen: @example ---- XXXX = foreground color -XXX ---- = background color X--- ---- = 1=blink 0=steady @end example The include file contains an enum COLORS that define the various values that can be used for these bitfields; light colors can only be used for the foreground. @subheading Portability @portability !ansi, !posix @subheading Example @example /* blinking white on blue */ textattr(BLINK | (BLUE << 4) | WHITE); @end example @c ---------------------------------------------------------------------- @node textbackground, conio @subheading Syntax @example #include void textbackground(int _color); @end example @subheading Description Sets just the background of the text attribute. @xref{textattr}. @subheading Portability @portability !ansi, !posix @c ---------------------------------------------------------------------- @node textcolor, conio @subheading Syntax @example #include void textcolor(int _color); @end example @subheading Description Sets just the foreground of the text attribute. @xref{textattr}. @subheading Portability @portability !ansi, !posix @c ---------------------------------------------------------------------- @node textmode, conio @subheading Syntax @example #include void textmode(int _mode); @end example @subheading Description Sets the text mode of the screen. @var{_mode} is one of the following: @table @code @item LASTMODE The text mode which was in effect @emph{before} the last call to @code{textmode()}. @item BW40 40-column black and white (on a color screen) @item C40 40-color color. @item BW80 80-column black and white (on a color screen) @item C80 80-column color @item MONO The monochrome monitor @item C4350 80-column, 43- (on EGAs) or 50-row (on VGAs) color @end table @xref{_set_screen_lines}, for a more versatile method of setting text screen dimensions. @subheading Portability @portability !ansi, !posix @c ---------------------------------------------------------------------- @node window, conio @subheading Syntax @example #include void window(int _left, int _top, int _right, int _bottom); @end example @subheading Description Specifies the window on the screen to be used for future output requests. The upper left corner of the physical screen is (1,1). @subheading Portability @portability !ansi, !posix @c ---------------------------------------------------------------------- @node _setcursortype, conio @subheading Syntax @example #include void _setcursortype(int _type); @end example @subheading Description Sets the cursor type. @var{_type} is one of the following: @table @code @item _NOCURSOR No cursor is displayed. @item _SOLIDCURSOR A solid block is displayed. @item _NORMALCURSOR An underline cursor is displayed. @end table @subheading Portability @portability !ansi, !posix @c ---------------------------------------------------------------------- @node cgets, conio @subheading Syntax @example #include char *cgets(char *_str); @end example @subheading Description Get a string from the console. This will take advantage of any command-line editing TSRs. To use, you must pre-fill the first character of the buffer. The first character is the size of the buffer. On return, the second character is the number of characters read. The third character is the first character read. @subheading Return Value A pointer to the first character read. @subheading Portability @portability !ansi, !posix @c ---------------------------------------------------------------------- @node cprintf, conio @subheading Syntax @example #include int cprintf(const char *_format, ...); @end example @subheading Description Like @code{printf} (@pxref{printf}), but prints through the console, taking into consideration window borders and text attributes. There is currently a 2048-byte limit on the size of each individual cprintf call. @subheading Return Value The number of characters written. @subheading Portability @portability !ansi, !posix @c ---------------------------------------------------------------------- @node cputs, conio @subheading Syntax @example #include int cputs(const char *_str); @end example @subheading Description Puts the string onto the console. The cursor position is updated. @subheading Return Value Zero on success. @subheading Portability @portability !ansi, !posix @c ---------------------------------------------------------------------- @node cscanf, conio @subheading Syntax @example #include int cscanf(const char *_format, ...); @end example @subheading Description Like @code{scanf} (@pxref{scanf}), but it reads from the standard input device directly, avoiding buffering both by DOS and by the library. Each character is read by @code{getche} (@pxref{getche}). @subheading Return Value The number of fields stored. @subheading Portability @portability !ansi, !posix @c ---------------------------------------------------------------------- @node gppconio_init, conio @subheading Syntax @example #include void gppconio_init(void); @end example @subheading Description Initialize the screen. This is called automatically at program start-up if you use any of the @code{conio} functions, but there may be times when you need to call it again, typically after calling some video BIOS function which affects screen parameters. @subheading Portability @portability !ansi, !posix @c ---------------------------------------------------------------------- @node _set_screen_lines, conio @subheading Syntax @example #include void _set_screen_lines(int nlines); @end example @subheading Description This function sets the text screen width to 80 and its height to the value given by @var{nlines}, which can be one of the following: 25, 28, 35, 40, 43 or 50. On a CGA, only 25-line screen is supported. On an EGA, you can use 25, 35 and 43. VGA, PGA and MCGA support all of the possible dimensions. The number of columns (i.e., screen width) is 80 for all of the above resolutions, because the standard EGA/VGA has no way of changing it. After this function returns, calls to @code{gettextinfo()} will return the actual screen dimensions as set by @code{_set_screen_lines()}. That is, you can e.g. test whether @code{_set_screen_lines()} succeeded by checking the screen height returned by @code{gettextinfo()} against the desired height. This function has a side effect of erasing the screen contents, so application programs which use it should make their own arrangements to redisplay it. @subheading Portability @portability !ansi, !posix @c ---------------------------------------------------------------------- @node blinkvideo, conio @subheading Syntax @example #include void blinkvideo(void); @end example @subheading Description Bit 7 (@samp{MSB}) of the character attribute byte has two possible effects on EGA and VGA displays: it can either make the character blink or change the background color to bright (thus allowing for 16 background colors as opposed to the usual 8). This function sets that bit to display blinking characters. After a call to this function, every character written to the screen with bit 7 of the attribute byte set, will blink. The companion function @code{intensevideo} (@pxref{intensevideo}) has the opposite effect. Note that there is no BIOS function to get the current status of this bit, but bit 5 of the byte at @code{0040h:0065h} in the BIOS area indicates the current state: if it's 1 (the default), blinking characters will be displayed. @subheading Portability @portability !ansi, !posix @c ---------------------------------------------------------------------- @node intensevideo, conio @subheading Syntax @example #include void intensevideo(void); @end example @subheading Description Bit 7 (@samp{MSB}) of the character attribute byte has two possible effects on EGA and VGA displays: it can either make the character blink or change the background color to bright (thus allowing for 16 background colors as opposed to the usual 8). This function sets that bit to display bright background colors. After a call to this function, every character written to the screen with bit 7 of the attribute byte set, will have a bright background color. The companion function @code{blinkvideo} (@pxref{blinkvideo}) has the opposite effect. Note that there is no BIOS function to get the current status of this bit, but bit 5 of the byte at @code{0040h:0065h} in the BIOS area indicates the current state: if it's 1 (the default), blinking characters will be displayed. @subheading Portability @portability !ansi, !posix