# Заголовки Все `#include` живут в `libc/include/`. ## Стандартный C | Заголовок | Источник | Что предоставляет | |---|---|---| | `` | наша libc + SDCC | `printf`, `puts`, `putchar`, `getchar`, `sprintf`, `FILE *`, `fopen`/`fread`/.../`fclose`, плюс `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`, вся семья `strXxx` | | `` | SDCC z80.lib | `tolower`, `toupper`, `isalnum`, `isdigit`, ... | | `` | SDCC z80.lib | `sinf`, `cosf`, `sqrtf`, ... | | `` | наша libc | `errno` + константы ошибок + `strerror` | | `` | наша libc | `setjmp` / `longjmp` | | `` | SDCC | макрос `assert` | | `` | наша libc | `read`, `write`, `close`, `lseek`, `unlink`, `SEEK_SET`/`CUR`/`END` | | `` | наша libc | `open`, `creat`, `O_RDONLY`/`O_WRONLY`/`O_CREAT`/... | | `` | наша libc | `stat`, `fstat`, `struct stat` | | `` | наша libc | `getdatetime`, `setdatetime` + POSIX `time`/`localtime`/`gmtime`/`mktime`/`asctime`/`ctime` | ## Sprinter-специфичные | Заголовок | Что предоставляет | |---|---| | `` | `putch`, `cputs`, `cprintf`, `kbhit`, `getch`, `getche`, `clrscr`, `gotoxy`, `wherex/y`, `wrchar`, `rdchar`, `textcolor`, `textbackground`, `textattr`, `get_videomode`, `set_videomode`, `COLOR_*` enum, `KEEP_EXIST_ATTR` | | `` | Графика для 320×256×256 и 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`, все варианты `*16` для 16-color режима, управление шрифтом через `gfx_load_default_font`/`gfx_set_font` | | `` | Полная обёртка из 14 функций драйвера: `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`, плюс структуры `mouse_cursor_t` и `mouse_state_t` | | `` | `chdir`, `getcwd`, `mkdir`, `rmdir`, `ffirst`, `fnext`, структура `ffblk` | | `` | Сырые номера портов, константы ESTEX/BIOS function numbers, `__sfr` intrinsics для 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 — подтягивает стандартные заголовки и добавляет типы `BOOL`/`uint`/`WORD`/`f_point`, алиасы `setmem`/`movmem`, `inp`/`outp`, `enable`/`disable`, `min`/`max`, `home()`, `seek`/`tell`/`remove`, `_ffirst`, mouse-алиасы `ms_*` и т.д. | ## Быстрая навигация: я хочу... * **Вывести текст** → `` (`printf` / `puts` — быстро, без цвета) или `` (`cprintf` / `cputs` — применяет `textcolor`). * **Прочитать клавишу** → ``: `getch()` (blocking, без эхо), `getche()` (с эхо), `kbhit()` (non-blocking poll). * **Открыть / прочитать / записать файл** → `` + `` (POSIX) или `` (семья `fopen`). * **Прочитать каталог** → ``: `ffirst` / `fnext`. * **Нарисовать пиксели** → ``. * **Выделить память** → ``: `malloc` / `free` / `calloc` / `realloc`. * **Получить текущее время** → ``: `getdatetime` или POSIX `time`/`localtime`. * **Прочитать мышь** → ``. * **Прочитать env var** → ``: `getenv` / `putenv`. * **Задать цвет текста** → ``: `textcolor(COLOR_YELLOW)`, `textbackground(COLOR_BLUE)`, или `textattr(COLOR(fg, bg))`.