libite 2.6.1
|
#include <stdio.h>
Go to the source code of this file.
Macros | |
#define | LIBITE_CONIO_H_ |
#define | RESETATTR 0 |
#define | BRIGHT 1 |
#define | DIM 2 |
#define | UNDERSCORE 4 |
#define | BLINK 5 /* May not work on all displays. */ |
#define | REVERSE 7 |
#define | HIDDEN 8 |
#define | BLACK 0x0 |
#define | RED 0x1 |
#define | GREEN 0x2 |
#define | BROWN 0x3 |
#define | BLUE 0x4 |
#define | MAGENTA 0x5 |
#define | CYAN 0x6 |
#define | LIGHTGREY 0x7 |
#define | DARKGREY 0x10 |
#define | LIGHTRED 0x11 |
#define | LIGHTGREEN 0x12 |
#define | YELLOW 0x13 |
#define | LIGHTBLUE 0x14 |
#define | LIGHTMAGENTA 0x15 |
#define | LIGHTCYAN 0x16 |
#define | WHITE 0x17 |
#define | SCREEN_WIDTH 80 |
#define | clrscr() |
#define | clreol() |
#define | delline() |
#define | gotoxy(x, y) |
#define | hidecursor() |
#define | showcursor() |
#define | __set_gm(a, c, v) |
#define | textattr(attr) |
#define | textcolor(color) |
#define | textbackground(color) |
Functions | |
void | initscr (int *row, int *col) |
Helper macros and functions for interacting with TTY terminals.
Definition in file conio.h.
#define __set_gm | ( | a, | |
c, | |||
v ) |
#define clreol | ( | ) |
#define clrscr | ( | ) |
#define delline | ( | ) |
#define gotoxy | ( | x, | |
y ) |
#define hidecursor | ( | ) |
#define SCREEN_WIDTH 80 |
#define showcursor | ( | ) |
#define textattr | ( | attr | ) |
Set text attribute
#define textbackground | ( | color | ) |
#define textcolor | ( | color | ) |
void initscr | ( | int * | row, |
int * | col ) |
Probe terminal size
row | pointer to integer to store number of rows |
col | pointer to integer to store number of columns |
This function checks if stdin and stdout isatty() and then sets the TTY in raw mode to silently ask the size using ANSI escape sequences. This is achieved by trying to go to corner 999,999 followed by querying the cursor position. Afterwards the TTY is returned to the state if was before, e.g. cooked. The number of rows and columns is returned in the input arguments to this function.
If stdio is not a TTY, then a default 24x80 is returned.