From 57e9ef6e7d1223be10e51ca1c97880e72e58bdab Mon Sep 17 00:00:00 2001 From: turbocat Date: Tue, 25 May 2021 15:41:10 +0000 Subject: [PATCH] kolibri-libc - Added new headers git-svn-id: svn://kolibrios.org@8745 a494cfbc-eb01-0410-851d-a64ba20cac60 --- .../libraries/kolibri-libc/include/conio.h | 62 +++++++++++++++++++ .../kolibri-libc/include/libc_version.h | 2 +- .../libraries/kolibri-libc/include/sys/dir.h | 11 ++++ 3 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 programs/develop/libraries/kolibri-libc/include/conio.h create mode 100644 programs/develop/libraries/kolibri-libc/include/sys/dir.h diff --git a/programs/develop/libraries/kolibri-libc/include/conio.h b/programs/develop/libraries/kolibri-libc/include/conio.h new file mode 100644 index 0000000000..92c125d981 --- /dev/null +++ b/programs/develop/libraries/kolibri-libc/include/conio.h @@ -0,0 +1,62 @@ +/* + +This is adapded thunk for console.obj sys library +.h is equal to svn:\programs\develop\libraries\console\console_en.txt + +Adapted for tcc by Siemargl, 2016 + +*/ +#ifndef _CONIO_H_ +#define _CONIO_H_ + +#include + +#define cdecl __attribute__ ((cdecl)) +#define stdcall __attribute__ ((stdcall)) + +/* +console.obj exports the following functions +*/ + +typedef unsigned int dword; /* 32-bit unsigned integer */ +typedef unsigned short word; /* 16-bit unsigned integer */ + +#define CON_WINDOW_CLOSED 0x200 +#define CON_COLOR_BLUE 0x01 +#define CON_COLOR_GREEN 0x02 +#define CON_COLOR_RED 0x04 +#define CON_COLOR_BRIGHT 0x08 +/* background color */ + +#define CON_BGR_BLUE 0x10 +#define CON_BGR_GREEN 0x20 +#define CON_BGR_RED 0x40 +#define CON_BGR_BRIGHT 0x80 +/* output controls */ + +#define CON_IGNORE_SPECIALS 0x100 + +extern int _FUNC(con_init)(void); +extern int _FUNC(con_init_opt)(dword wnd_width, dword wnd_height, dword scr_width, dword scr_height, const char* title); +extern void stdcall _FUNC((*con_exit))(int bCloseWindow); +extern void stdcall _FUNC((*con_set_title))(const char* title); +extern void stdcall _FUNC((*con_write_asciiz))(const char* str); +extern void stdcall _FUNC((*con_write_string))(const char* str, dword length); +extern int cdecl _FUNC((*con_printf))(const char* format, ...); +extern dword stdcall _FUNC((*con_get_flags))(void); +extern dword stdcall _FUNC((*con_set_flags))(dword new_flags); +extern int stdcall _FUNC((*con_get_font_height))(void); +extern int stdcall _FUNC((*con_get_cursor_height))(void); +extern int stdcall _FUNC((*con_set_cursor_height))(int new_height); +extern int stdcall _FUNC((*con_getch))(void); +extern word stdcall _FUNC((*con_getch2))(void); +extern int stdcall _FUNC((*con_kbhit))(void); +extern char* stdcall _FUNC((*con_gets))(char* str, int n); +typedef int (stdcall _FUNC(* con_gets2_callback))(int keycode, char** pstr, int* pn, int* ppos); +extern char* stdcall _FUNC((*con_gets2))(con_gets2_callback callback, char* str, int n); +extern void stdcall _FUNC((*con_cls))(); +extern void stdcall _FUNC((*con_get_cursor_pos))(int* px, int* py); +extern void stdcall _FUNC((*con_set_cursor_pos))(int x, int y); +extern int _FUNC(__con_is_load); + +#endif diff --git a/programs/develop/libraries/kolibri-libc/include/libc_version.h b/programs/develop/libraries/kolibri-libc/include/libc_version.h index bc49a9f62d..2a836f57dd 100644 --- a/programs/develop/libraries/kolibri-libc/include/libc_version.h +++ b/programs/develop/libraries/kolibri-libc/include/libc_version.h @@ -3,7 +3,7 @@ #include -#define _LIBC_VERSION 8743 +#define _LIBC_VERSION 8745 extern unsigned _FUNC(_libc_get_version)(); diff --git a/programs/develop/libraries/kolibri-libc/include/sys/dir.h b/programs/develop/libraries/kolibri-libc/include/sys/dir.h new file mode 100644 index 0000000000..683f1f0bb2 --- /dev/null +++ b/programs/develop/libraries/kolibri-libc/include/sys/dir.h @@ -0,0 +1,11 @@ +#ifndef _DIR_H_ +#define _DIR_H_ + +#include + +extern char* _FUNC(getcwd)(char *buf, unsigned size); +extern void _FUNC(setcwd)(const char* cwd); +extern int _FUNC(rmdir)(const char* dir); +extern int _FUNC(mkdir)(const char* dir); + +#endif \ No newline at end of file