forked from KolibriOS/kolibrios
ksys.h:
- Added to Newlib and should be in sync with the file from libc.obj; - Added new wrappers. git-svn-id: svn://kolibrios.org@9767 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
99922e4c2c
commit
56ff702799
1391
contrib/sdk/sources/newlib/libc/include/sys/ksys.h
Normal file
1391
contrib/sdk/sources/newlib/libc/include/sys/ksys.h
Normal file
File diff suppressed because it is too large
Load Diff
@ -224,6 +224,12 @@ enum KSYS_FILE_ENCODING {
|
|||||||
KSYS_FILE_UTF8 = 3
|
KSYS_FILE_UTF8 = 3
|
||||||
};
|
};
|
||||||
|
|
||||||
|
enum KSYS_TITLE_ENCODING {
|
||||||
|
KSYS_TITLE_CP866 = 1,
|
||||||
|
KSYS_TITLE_UTF16LE = 2,
|
||||||
|
KSYS_TITLE_UTF8 = 3
|
||||||
|
};
|
||||||
|
|
||||||
KOSAPI int __strcmp(const char* s1, const char* s2)
|
KOSAPI int __strcmp(const char* s1, const char* s2)
|
||||||
{
|
{
|
||||||
while ((*s1) && (*s1 == *s2)) {
|
while ((*s1) && (*s1 == *s2)) {
|
||||||
@ -256,7 +262,7 @@ KOSAPI void _ksys_create_window(uint32_t x, uint32_t y, uint32_t w, uint32_t h,
|
|||||||
"D"(name),
|
"D"(name),
|
||||||
"S"(0)
|
"S"(0)
|
||||||
: "memory");
|
: "memory");
|
||||||
};
|
}
|
||||||
|
|
||||||
/*================ Function 1 - put pixel in the window. ===============*/
|
/*================ Function 1 - put pixel in the window. ===============*/
|
||||||
|
|
||||||
@ -626,8 +632,14 @@ KOSAPI size_t _ksys_get_full_ram(void)
|
|||||||
|
|
||||||
KOSAPI void _ksys_kill_by_pid(uint32_t PID)
|
KOSAPI void _ksys_kill_by_pid(uint32_t PID)
|
||||||
{
|
{
|
||||||
asm_inline(
|
asm_inline("int $0x40" ::"a"(18), "b"(18), "c"(PID));
|
||||||
"int $0x40" ::"a"(18), "b"(18), "c"(PID));
|
}
|
||||||
|
|
||||||
|
/*========= Fuction 18, subfunction 19 - get/set mouse settings. ========*/
|
||||||
|
|
||||||
|
KOSAPI void _ksys_set_mouse_pos(int x, int y) // sub-subfunction 4 - set the position of the mouse cursor
|
||||||
|
{
|
||||||
|
asm_inline("int $0x40" ::"a"(18), "b"(19), "c"(4), "d"(x * 65536 + y));
|
||||||
}
|
}
|
||||||
|
|
||||||
/*===================== Function 18, subfunction 21 ====================*/
|
/*===================== Function 18, subfunction 21 ====================*/
|
||||||
@ -763,7 +775,13 @@ KOSAPI uint32_t _ksys_get_mouse_eventstate(void) // subfunction 3 - states and e
|
|||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
||||||
KOSAPI uint32_t _ksys_load_cursor(void* path, uint32_t flags) // subfunction 4 - load cursor
|
enum KSYS_CURSOR_SRC {
|
||||||
|
KSYS_CURSOR_FROM_FILE = 0,
|
||||||
|
KSYS_CURSOR_FROM_MEM = 1,
|
||||||
|
KSYS_CURSOR_INDIRECT = 2
|
||||||
|
};
|
||||||
|
|
||||||
|
KOSAPI void* _ksys_load_cursor(void* path, uint32_t flags) // subfunction 4 - load cursor
|
||||||
{
|
{
|
||||||
uint32_t val;
|
uint32_t val;
|
||||||
asm_inline(
|
asm_inline(
|
||||||
@ -774,7 +792,7 @@ KOSAPI uint32_t _ksys_load_cursor(void* path, uint32_t flags) // subfunction 4 -
|
|||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
||||||
KOSAPI uint32_t _ksys_set_cursor(uint32_t cursor) // subfunction 5 - set cursor
|
KOSAPI void* _ksys_set_cursor(void* cursor) // subfunction 5 - set cursor
|
||||||
{
|
{
|
||||||
uint32_t old;
|
uint32_t old;
|
||||||
asm_inline(
|
asm_inline(
|
||||||
@ -784,7 +802,7 @@ KOSAPI uint32_t _ksys_set_cursor(uint32_t cursor) // subfunction 5 - set cursor
|
|||||||
return old;
|
return old;
|
||||||
}
|
}
|
||||||
|
|
||||||
KOSAPI int _ksys_delete_cursor(uint32_t cursor) // subfunction 6 - delete cursor
|
KOSAPI int _ksys_delete_cursor(void* cursor) // subfunction 6 - delete cursor
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
asm_inline(
|
asm_inline(
|
||||||
@ -1306,6 +1324,16 @@ KOSAPI int _ksys_file_rename(const char* name, const char* new_name)
|
|||||||
|
|
||||||
#define _ksys_dir_rename _ksys_file_rename
|
#define _ksys_dir_rename _ksys_file_rename
|
||||||
|
|
||||||
|
/*============ Function 71, subfunction 1 - set window title ============= */
|
||||||
|
|
||||||
|
KOSAPI void _ksys_set_window_title(const char* title)
|
||||||
|
{
|
||||||
|
asm_inline("int $0x40" ::"a"(71), "b"(1), "c"(title)
|
||||||
|
: "memory");
|
||||||
|
}
|
||||||
|
|
||||||
|
#define _ksys_clear_window_title() _ksys_set_window_title(NULL)
|
||||||
|
|
||||||
/*============= Function 77 - implements the POSIX subsystem. =============*/
|
/*============= Function 77 - implements the POSIX subsystem. =============*/
|
||||||
|
|
||||||
KOSAPI int _ksys_posix_read(int pipefd, void* buff, int n)
|
KOSAPI int _ksys_posix_read(int pipefd, void* buff, int n)
|
||||||
|
Loading…
Reference in New Issue
Block a user