Functions | |
void | nio_grid_puts (const int offset_x, const int offset_y, const int x, const int y, const char *str, const char bgColor, const char textColor) |
void | nio_grid_putc (const int offset_x, const int offset_y, const int x, const int y, const char ch, const char bgColor, const char textColor) |
void | nio_use_stdio (void) |
void | nio_free_stdio (void) |
void | nio_load (const char *path, nio_console *c) |
void | nio_save (const char *path, const nio_console *c) |
void | nio_set_default (nio_console *c) |
char | nio_getch (nio_console *c) |
void | nio_init (nio_console *c, const int size_x, const int size_y, const int offset_x, const int offset_y, const char background_color, const char foreground_color, const BOOL drawing_enabled) |
int | nio_fflush (nio_console *c) |
void | nio_clear (nio_console *c) |
void | nio_scroll (nio_console *c) |
void | nio_csl_drawchar (nio_console *c, const int pos_x, const int pos_y) |
void | nio_csl_savechar (nio_console *c, const char ch, const int pos_x, const int pos_y) |
char | nio_fputc (char ch, nio_console *c) |
char | nio_putchar (const char ch) |
int | nio_fputs (const char *str, nio_console *c) |
int | nio_puts (const char *str) |
int | nio_fprintf (nio_console *c, const char *format,...) |
int | nio_printf (const char *format,...) |
void | nio_perror (const char *str) |
void | nio_color (nio_console *c, const char background_color, const char foreground_color) |
void | nio_drawing_enabled (nio_console *c, const BOOL enable_drawing) |
char | nio_fgetc (nio_console *c) |
char | nio_getchar (void) |
char * | nio_fgets (char *str, int num, nio_console *c) |
char * | nio_gets (char *str) |
void | nio_free (nio_console *c) |
Variables | |
nio_console * | nio_default = NULL |
BOOL | shift = FALSE |
BOOL | caps = FALSE |
BOOL | ctrl = FALSE |
This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Console functions
void nio_clear | ( | nio_console * | c | ) |
Clears a console.
c | Console |
void nio_color | ( | nio_console * | c, |
const char | background_color, | ||
const char | foreground_color | ||
) |
Sets the background- and text color of a console. Possible values are 0-15.
c | Console |
background_color | Background color |
foreground_color | Text color |
void nio_csl_drawchar | ( | nio_console * | c, |
const int | pos_x, | ||
const int | pos_y | ||
) |
Draws a char from the console to the screen. For internal use.
c | Console |
pos_x | x position |
pos_y | y position |
void nio_csl_savechar | ( | nio_console * | c, |
const char | ch, | ||
const int | pos_x, | ||
const int | pos_y | ||
) |
Saves a char in a console without drawing it. For internal use.
c | Console |
ch | Char |
pos_x | x position |
pos_y | y position |
void nio_drawing_enabled | ( | nio_console * | c, |
const BOOL | enable_drawing | ||
) |
Changes the drawing behavior of a console.
c | Console |
enable_drawing | If this is true, a console will automatically be updated if text is written to it. |
int nio_fflush | ( | nio_console * | c | ) |
See fflush
char nio_fgetc | ( | nio_console * | c | ) |
See fgetc
char* nio_fgets | ( | char * | str, |
int | num, | ||
nio_console * | c | ||
) |
int nio_fprintf | ( | nio_console * | c, |
const char * | format, | ||
... | |||
) |
See fprintf
char nio_fputc | ( | char | ch, |
nio_console * | c | ||
) |
See fputc
int nio_fputs | ( | const char * | str, |
nio_console * | c | ||
) |
See fputs
void nio_free | ( | nio_console * | c | ) |
Uninitializes a console. This should always be called before the program ends.
c | Console |
void nio_free_stdio | ( | void | ) |
For use with NIO_REPLACE_STDIO. Use at the end of your program.
char nio_getch | ( | nio_console * | c | ) |
Immediately gets a char from the keyboard. For internal use.
c | Console |
char nio_getchar | ( | void | ) |
See getchar
char* nio_gets | ( | char * | str | ) |
See gets
void nio_grid_putc | ( | const int | offset_x, |
const int | offset_y, | ||
const int | x, | ||
const int | y, | ||
const char | ch, | ||
const char | bgColor, | ||
const char | textColor | ||
) |
Draws a char to the screen on the given position. For internal use.
offset_x | x offset in px |
offset_y | y offset in px |
x | x position in columns (px*6) |
y | y position in rows (px*8) |
c | Char |
bgColor | Background color |
textColor | text color |
void nio_grid_puts | ( | const int | offset_x, |
const int | offset_y, | ||
const int | x, | ||
const int | y, | ||
const char * | str, | ||
const char | bgColor, | ||
const char | textColor | ||
) |
Draws a string to the screen on the given position. For internal use.
offset_x | x offset in px |
offset_y | y offset in px |
x | x position in columns (px*6) |
y | y position in rows (px*8) |
str | String |
bgColor | Background color |
textColor | text color |
void nio_init | ( | nio_console * | c, |
const int | size_x, | ||
const int | size_y, | ||
const int | offset_x, | ||
const int | offset_y, | ||
const char | background_color, | ||
const char | foreground_color, | ||
const BOOL | drawing_enabled | ||
) |
Initializes a console.
c | Console |
size_x | console width |
size_y | console height |
offset_x | x position |
offset_y | y position |
background_color | Background color |
foreground_color | Text color |
drawing_enabled | See nio_enable_drawing() |
void nio_load | ( | const char * | path, |
nio_console * | c | ||
) |
Loads a console from a file on flash storage.
path | File path |
c | Console |
void nio_perror | ( | const char * | str | ) |
See perror
int nio_printf | ( | const char * | format, |
... | |||
) |
See printf
char nio_putchar | ( | const char | ch | ) |
See putchar
int nio_puts | ( | const char * | str | ) |
See puts
void nio_save | ( | const char * | path, |
const nio_console * | c | ||
) |
Saves a console to a file in flash storage.
path | File path |
c | Console |
void nio_scroll | ( | nio_console * | c | ) |
Scrolls a console one line down.
c | Console |
void nio_set_default | ( | nio_console * | c | ) |
Sets a default console that will be used for all functions without console argument, e.g. nio_puts()
c | Console |
void nio_use_stdio | ( | void | ) |
For use with NIO_REPLACE_STDIO. Use at the beginning of your program.