# Headers Everything you `#include` lives under `libc/include/`. ## Standard C | Header | Source | Provides | |---|---|---| | `` | our libc + SDCC | `printf`, `puts`, `putchar`, `getchar`, `sprintf`, `FILE *`, `fopen`/`fread`/.../`fclose`, plus `hex8/16/32`, `dec8/16/32`, `gets` | | `` | SDCC z80.lib | `malloc`, `free`, `calloc`, `realloc`, `atoi`, `atof`, `atol`, `strtol`, `qsort`, `bsearch`, `rand`, `srand`, `abs`, `div`, `exit`, ... | | `` | SDCC z80.lib | `memcpy`, `memcmp`, `memset`, `memchr`, `memmove`, full `strXxx` family | | `` | SDCC z80.lib | `tolower`, `toupper`, `isalnum`, `isdigit`, ... | | `` | SDCC z80.lib | `sinf`, `cosf`, `sqrtf`, ... | | `` | our libc | `errno` + error constants + `strerror` | | `` | our libc | `setjmp` / `longjmp` | | `` | SDCC | `assert` macro | | `` | our libc | `read`, `write`, `close`, `lseek`, `unlink`, `SEEK_SET`/`CUR`/`END` | | `` | our libc | `open`, `creat`, `O_RDONLY`/`O_WRONLY`/`O_CREAT`/etc. | | `` | our libc | `stat`, `fstat`, `struct stat` | | `` | our libc | `getdatetime`, `setdatetime` + POSIX `time`/`localtime`/`gmtime`/`mktime`/`asctime`/`ctime` | ## Sprinter-specific | Header | Provides | |---|---| | `` | `putch`, `cputs`, `cprintf`, `kbhit`, `getch`, `getche`, `clrscr`, `gotoxy`, `wherex/y`, `wrchar`, `rdchar`, `textcolor`, `textbackground`, `textattr`, `get_videomode`, `set_videomode`, `COLOR_*` enum, `KEEP_EXIST_ATTR` | | `` | Graphics for 320×256×256 and 640×256×16: `gfx_init`/`gfx_done`, `gfx_pal_load`/`gfx_pal_set`, `gfx_clear`, `gfx_putpixel`, `gfx_hline`/`gfx_vline`, `gfx_rect`/`gfx_fill_rect`, `gfx_line`, `gfx_text`/`gfx_putchar`, plus all `*16` variants for 16-color mode, font management via `gfx_load_default_font`/`gfx_set_font` | | `` | Full 14-function driver wrapper: `mouse_init`/`mouse_show`/`mouse_hide`/`mouse_read`/`mouse_goto`/`mouse_bounds_*`/`mouse_text_cursor`/`mouse_load_cursor`/`mouse_get_cursor`/`mouse_set_sensitivity`/`mouse_get_sensitivity_*`/`mouse_video_mode_changed`/`mouse_refresh`, plus `mouse_cursor_t` and `mouse_state_t` structs | | `` | `chdir`, `getcwd`, `mkdir`, `rmdir`, `ffirst`, `fnext`, `ffblk` struct | | `` | Raw port numbers, ESTEX/BIOS function-number constants, `__sfr` intrinsics for paging, `print_hex`, `getenv`, `putenv` | | `` | `exit`, `_exit`, `atexit` | | `` | `mem_alloc_pages`, `mem_free_block`, `mem_get_page`, `mem_info`, `bank_read`, `bank_write`, `bank_load_byte`, `bank_store_byte` | | `` | Solid-C compatibility shims — pulls in standard headers and adds `BOOL`/`uint`/`WORD`/`f_point` types, `setmem`/`movmem` aliases, `inp`/`outp`, `enable`/`disable`, `min`/`max`, `home()`, `seek`/`tell`/`remove`, `_ffirst`, `ms_*` mouse aliases, etc. | ## Quick lookup: I want to ... * **Print text** → `` (`printf` / `puts` — fast, no colour) or `` (`cprintf` / `cputs` — applies `textcolor`). * **Read a key** → ``: `getch()` (blocking, no echo), `getche()` (echo), `kbhit()` (non-blocking poll). * **Open / read / write files** → `` + `` (POSIX) or `` (`fopen` family). * **List a directory** → ``: `ffirst` / `fnext`. * **Draw pixels** → ``. * **Allocate memory** → ``: `malloc` / `free` / `calloc` / `realloc`. * **Get current time** → ``: `getdatetime` or POSIX `time`/`localtime`. * **Read mouse** → ``. * **Read an env var** → ``: `getenv` / `putenv`. * **Set text colour** → ``: `textcolor(COLOR_YELLOW)`, `textbackground(COLOR_BLUE)`, or `textattr(COLOR(fg, bg))`.