Files
kolibrios/programs/develop/ktcc/trunk/libc.obj/samples/consoleio.c
Egor00f 15f27eb1c3 libc.obj: add call exit after main && add build for ctr0.o && use return instead exit in samples
нен работает
по стандартам после `main` должно быть закрыте всего, что закрывается в `exit`
ну терпите, crt увеличиласть на несколько байт
обертка для `exit` в crt нужна т.к. `exit` импортируется.

зачем вообще было держать бинарь `libc.obj/lib/crt0.o`, если абсолютно такой же лежит в `bin/lib/` всемсте `tcc`? Нет, зачем вообще тащить бинари в репку?
2026-01-15 21:19:10 +05:00

22 lines
521 B
C

// demonstration conio use, color text
// more info in conio.h
#include <conio.h>
int main()
{
if (con_init())
return 1; // init fail
(*con_set_title)("Console colors");
// con_write_asciiz("\033[0;31;42m test \n"); // red on green bk
for (int i = 30; i < 48; i++) {
(*con_printf)("\033[%dmColor 0x%02X: ", i, i);
(*con_write_asciiz)("Text sample.");
(*con_printf)(" printf %s test %d\n", "small", i);
}
(*con_exit)(0);
return 0;
}