NewLib:
- Duplicate functionality files removed; - Refactoring of file handling functions; - Removed broken impliments. Gears (C + TinyGL): - Removed because it duplicates an existing example on Fasm and uses unsupported wrappers on the KOS API. KosJS: - Removed. The MuJS port is too old and not used anywhere. Support is not profitable. Backy: - Removed useless GCC version. Support is not profitable. DGen-SDL and SQLite3 - Fix after removing broken "dirent.h". Fridge: - Moving the KOS API wrapper to avoid compilation errors. Udis86, uARM and 8086tiny: - Fix after removing redundant "kos_LoadConsole.h". git-svn-id: svn://kolibrios.org@9952 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
@@ -1,16 +0,0 @@
|
||||
#ifndef _DIRENT_H_
|
||||
#define _DIRENT_H_
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#include <sys/cdefs.h>
|
||||
#include <sys/dirent.h>
|
||||
|
||||
#if !defined(MAXNAMLEN) && __BSD_VISIBLE
|
||||
#define MAXNAMLEN 1024
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif /*_DIRENT_H_*/
|
@@ -1,679 +0,0 @@
|
||||
#ifndef __KOS_32_SYS_H__
|
||||
#define __KOS_32_SYS_H__
|
||||
|
||||
#include <newlib.h>
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include <string.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
//#ifdef CONFIG_DEBUF
|
||||
// #define DBG(format,...) printf(format,##__VA_ARGS__)
|
||||
//#else
|
||||
// #define DBG(format,...)
|
||||
//#endif
|
||||
|
||||
#define TYPE_3_BORDER_WIDTH 5
|
||||
#define WIN_STATE_MINIMIZED 0x02
|
||||
#define WIN_STATE_ROLLED 0x04
|
||||
|
||||
typedef unsigned int color_t;
|
||||
|
||||
typedef union __attribute__((packed))
|
||||
{
|
||||
uint32_t val;
|
||||
struct
|
||||
{
|
||||
short x;
|
||||
short y;
|
||||
};
|
||||
}pos_t;
|
||||
|
||||
typedef union __attribute__((packed))
|
||||
{
|
||||
uint32_t val;
|
||||
struct
|
||||
{
|
||||
uint8_t state;
|
||||
uint8_t code;
|
||||
uint16_t ctrl_key;
|
||||
};
|
||||
}oskey_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned handle;
|
||||
unsigned io_code;
|
||||
void *input;
|
||||
int inp_size;
|
||||
void *output;
|
||||
int out_size;
|
||||
}ioctl_t;
|
||||
|
||||
#pragma pack(push, 1)
|
||||
struct proc_info
|
||||
{
|
||||
unsigned long cpu_usage;
|
||||
unsigned short pos_in_stack;
|
||||
unsigned short slot;
|
||||
unsigned short reserved2;
|
||||
char name[12];
|
||||
unsigned long address;
|
||||
unsigned long memory_usage;
|
||||
unsigned long ID;
|
||||
unsigned long left,top;
|
||||
unsigned long width,height;
|
||||
unsigned short thread_state;
|
||||
unsigned short reserved3;
|
||||
unsigned long cleft, ctop, cwidth, cheight;
|
||||
unsigned char window_state;
|
||||
unsigned char reserved4[1024-71];
|
||||
};
|
||||
#pragma pack(pop)
|
||||
|
||||
struct kolibri_system_colors {
|
||||
color_t frame_area;
|
||||
color_t grab_bar;
|
||||
color_t grab_bar_button;
|
||||
color_t grab_button_text;
|
||||
color_t grab_text;
|
||||
color_t work_area;
|
||||
color_t work_button;
|
||||
color_t work_button_text;
|
||||
color_t work_text;
|
||||
color_t work_graph;
|
||||
};
|
||||
|
||||
static inline void begin_draw(void)
|
||||
{
|
||||
__asm__ __volatile__(
|
||||
"int $0x40" ::"a"(12),"b"(1));
|
||||
};
|
||||
|
||||
static inline
|
||||
void end_draw(void)
|
||||
{
|
||||
__asm__ __volatile__(
|
||||
"int $0x40" ::"a"(12),"b"(2));
|
||||
};
|
||||
|
||||
static inline void
|
||||
put_image(uint16_t x_coord, uint16_t y_coord,
|
||||
uint16_t size_x, uint16_t size_y, void *img)
|
||||
{
|
||||
__asm__ __volatile__("int $0x40"
|
||||
::"a"(25),
|
||||
"b"(img),
|
||||
"c"(size_x<<16 | size_y),
|
||||
"d"(x_coord<<16 | y_coord));
|
||||
};
|
||||
|
||||
|
||||
static inline
|
||||
void sys_create_window(int x, int y, int w, int h, const char *name,
|
||||
color_t workcolor, uint32_t style)
|
||||
{
|
||||
__asm__ __volatile__(
|
||||
"int $0x40"
|
||||
::"a"(0),
|
||||
"b"((x << 16) | ((w-1) & 0xFFFF)),
|
||||
"c"((y << 16) | ((h-1) & 0xFFFF)),
|
||||
"d"((style << 24) | (workcolor & 0xFFFFFF)),
|
||||
"D"(name),
|
||||
"S"(0) : "memory");
|
||||
};
|
||||
|
||||
#define OLD -1
|
||||
static inline
|
||||
void sys_change_window(int new_x, int new_y, int new_w, int new_h)
|
||||
{
|
||||
__asm__ __volatile__(
|
||||
"int $0x40"
|
||||
::"a"(67), "b"(new_x), "c"(new_y), "d"(new_w),"S"(new_h)
|
||||
);
|
||||
}
|
||||
|
||||
static inline
|
||||
void define_button(uint32_t x_w, uint32_t y_h, uint32_t id, uint32_t color)
|
||||
{
|
||||
__asm__ __volatile__(
|
||||
"int $0x40"
|
||||
::"a"(8),
|
||||
"b"(x_w),
|
||||
"c"(y_h),
|
||||
"d"(id),
|
||||
"S"(color));
|
||||
};
|
||||
|
||||
static inline
|
||||
void draw_line(int xs, int ys, int xe, int ye, color_t color)
|
||||
{
|
||||
__asm__ __volatile__(
|
||||
"int $0x40"
|
||||
::"a"(38), "d"(color),
|
||||
"b"((xs << 16) | xe),
|
||||
"c"((ys << 16) | ye));
|
||||
}
|
||||
|
||||
static inline
|
||||
void draw_bar(int x, int y, int w, int h, color_t color)
|
||||
{
|
||||
__asm__ __volatile__(
|
||||
"int $0x40"
|
||||
::"a"(13), "d"(color),
|
||||
"b"((x << 16) | w),
|
||||
"c"((y << 16) | h));
|
||||
}
|
||||
|
||||
static inline
|
||||
void draw_bitmap(void *bitmap, int x, int y, int w, int h)
|
||||
{
|
||||
__asm__ __volatile__(
|
||||
"int $0x40"
|
||||
::"a"(7), "b"(bitmap),
|
||||
"c"((w << 16) | h),
|
||||
"d"((x << 16) | y));
|
||||
}
|
||||
|
||||
static inline
|
||||
void draw_text_sys(const char *text, int x, int y, int len, color_t color)
|
||||
{
|
||||
__asm__ __volatile__(
|
||||
"int $0x40"
|
||||
::"a"(4),"d"(text),
|
||||
"b"((x << 16) | y),
|
||||
"S"(len),"c"(color)
|
||||
:"memory");
|
||||
}
|
||||
|
||||
/*
|
||||
void define_button_text(int x, int y, int w, int h, uint32_t id, uint32_t color, char* text)
|
||||
{
|
||||
define_button(x * 65536 + w, y * 65536 + h, id, color);
|
||||
|
||||
int tx = ((((-strlen(text))*8)+w)/2)+x;
|
||||
int ty = h/2-7+y;
|
||||
|
||||
draw_text_sys(text, tx, ty, strlen(text), 0x90000000);
|
||||
};
|
||||
*/
|
||||
|
||||
static inline
|
||||
uint32_t get_skin_height(void)
|
||||
{
|
||||
uint32_t height;
|
||||
|
||||
__asm__ __volatile__(
|
||||
"int $0x40 \n\t"
|
||||
:"=a"(height)
|
||||
:"a"(48),"b"(4));
|
||||
return height;
|
||||
};
|
||||
|
||||
static inline void BeginDraw(void) __attribute__ ((alias ("begin_draw")));
|
||||
static inline void EndDraw(void) __attribute__ ((alias ("end_draw")));
|
||||
static inline void DrawWindow(int x, int y, int w, int h, const char *name,
|
||||
color_t workcolor, uint32_t style)
|
||||
__attribute__ ((alias ("sys_create_window")));
|
||||
static inline void DefineButton(void) __attribute__ ((alias ("define_button")));
|
||||
static inline void DrawLine(int xs, int ys, int xe, int ye, color_t color)
|
||||
__attribute__ ((alias ("draw_line")));
|
||||
static inline void DrawBar(int x, int y, int w, int h, color_t color)
|
||||
__attribute__ ((alias ("draw_bar")));
|
||||
static inline void DrawBitmap(void *bitmap, int x, int y, int w, int h)
|
||||
__attribute__ ((alias ("draw_bitmap")));
|
||||
static inline uint32_t GetSkinHeight(void) __attribute__ ((alias ("get_skin_height")));
|
||||
|
||||
|
||||
#define POS_SCREEN 0
|
||||
#define POS_WINDOW 1
|
||||
|
||||
static inline
|
||||
pos_t get_mouse_pos(int origin)
|
||||
{
|
||||
pos_t val;
|
||||
|
||||
__asm__ __volatile__(
|
||||
"int $0x40 \n\t"
|
||||
"rol $16, %%eax"
|
||||
:"=a"(val)
|
||||
:"a"(37),"b"(origin));
|
||||
return val;
|
||||
}
|
||||
|
||||
static inline
|
||||
uint32_t get_mouse_buttons(void)
|
||||
{
|
||||
uint32_t val;
|
||||
|
||||
__asm__ __volatile__(
|
||||
"int $0x40"
|
||||
:"=a"(val)
|
||||
:"a"(37),"b"(2));
|
||||
return val;
|
||||
};
|
||||
|
||||
static inline
|
||||
uint32_t get_mouse_wheels(void)
|
||||
{
|
||||
uint32_t val;
|
||||
|
||||
__asm__ __volatile__(
|
||||
"int $0x40 \n\t"
|
||||
:"=a"(val)
|
||||
:"a"(37),"b"(7));
|
||||
return val;
|
||||
};
|
||||
|
||||
static inline uint32_t load_cursor(void *path, uint32_t flags)
|
||||
{
|
||||
uint32_t val;
|
||||
__asm__ __volatile__(
|
||||
"int $0x40"
|
||||
:"=a"(val)
|
||||
:"a"(37), "b"(4), "c"(path), "d"(flags));
|
||||
return val;
|
||||
}
|
||||
|
||||
static inline uint32_t set_cursor(uint32_t cursor)
|
||||
{
|
||||
uint32_t old;
|
||||
__asm__ __volatile__(
|
||||
"int $0x40"
|
||||
:"=a"(old)
|
||||
:"a"(37), "b"(5), "c"(cursor));
|
||||
return old;
|
||||
};
|
||||
|
||||
|
||||
#define EVM_REDRAW 1
|
||||
#define EVM_KEY 2
|
||||
#define EVM_BUTTON 4
|
||||
#define EVM_EXIT 8
|
||||
#define EVM_BACKGROUND 16
|
||||
#define EVM_MOUSE 32
|
||||
#define EVM_IPC 64
|
||||
#define EVM_STACK 128
|
||||
#define EVM_DEBUG 256
|
||||
#define EVM_STACK2 512
|
||||
#define EVM_MOUSE_FILTER 0x80000000
|
||||
#define EVM_CURSOR_FILTER 0x40000000
|
||||
|
||||
static inline uint32_t set_wanted_events_mask(uint32_t event_mask)
|
||||
{
|
||||
uint32_t old_event_mask;
|
||||
__asm__ __volatile__(
|
||||
"int $0x40"
|
||||
:"=a"(old_event_mask)
|
||||
:"a"(40),"b"(event_mask));
|
||||
|
||||
return old_event_mask;
|
||||
};
|
||||
|
||||
static inline int destroy_cursor(uint32_t cursor)
|
||||
{
|
||||
int ret;
|
||||
__asm__ __volatile__(
|
||||
"int $0x40"
|
||||
:"=a"(ret)
|
||||
:"a"(37), "b"(6), "c"(cursor)
|
||||
:"memory");
|
||||
return ret;
|
||||
};
|
||||
|
||||
static inline pos_t GetMousePos(int origin) __attribute__ ((alias ("get_mouse_pos")));
|
||||
static inline uint32_t GetMouseButtons(void) __attribute__ ((alias ("get_mouse_buttons")));
|
||||
static inline uint32_t GetMouseWheels(void) __attribute__ ((alias ("get_mouse_wheels")));
|
||||
|
||||
static inline uint32_t LoadCursor(void *path, uint32_t flags) __attribute__ ((alias ("load_cursor")));
|
||||
static inline uint32_t SetCursor(uint32_t cursor) __attribute__ ((alias ("set_cursor")));
|
||||
static inline int DestroyCursor(uint32_t cursor) __attribute__ ((alias ("destroy_cursor")));
|
||||
|
||||
|
||||
static inline
|
||||
uint32_t wait_for_event(uint32_t time)
|
||||
{
|
||||
uint32_t val;
|
||||
__asm__ __volatile__(
|
||||
"int $0x40"
|
||||
:"=a"(val)
|
||||
:"a"(23), "b"(time));
|
||||
return val;
|
||||
};
|
||||
|
||||
static inline uint32_t check_os_event(void)
|
||||
{
|
||||
uint32_t val;
|
||||
__asm__ __volatile__(
|
||||
"int $0x40"
|
||||
:"=a"(val)
|
||||
:"a"(11));
|
||||
return val;
|
||||
};
|
||||
|
||||
static inline uint32_t get_os_event(void)
|
||||
{
|
||||
uint32_t val;
|
||||
__asm__ __volatile__(
|
||||
"int $0x40"
|
||||
:"=a"(val)
|
||||
:"a"(10));
|
||||
return val;
|
||||
};
|
||||
static inline uint32_t GetOsEvent(void) __attribute__ ((alias ("get_os_event")));
|
||||
|
||||
static inline
|
||||
uint32_t get_tick_count(void)
|
||||
{
|
||||
uint32_t val;
|
||||
__asm__ __volatile__(
|
||||
"int $0x40"
|
||||
:"=a"(val)
|
||||
:"a"(26),"b"(9));
|
||||
return val;
|
||||
};
|
||||
|
||||
static inline
|
||||
uint64_t get_ns_count(void)
|
||||
{
|
||||
uint64_t val;
|
||||
__asm__ __volatile__(
|
||||
"int $0x40"
|
||||
:"=A"(val)
|
||||
:"a"(26), "b"(10));
|
||||
return val;
|
||||
};
|
||||
|
||||
static inline
|
||||
oskey_t get_key(void)
|
||||
{
|
||||
oskey_t val;
|
||||
__asm__ __volatile__(
|
||||
"int $0x40"
|
||||
:"=a"(val)
|
||||
:"a"(2));
|
||||
return val;
|
||||
}
|
||||
|
||||
static inline
|
||||
uint32_t get_os_button(void)
|
||||
{
|
||||
uint32_t val;
|
||||
__asm__ __volatile__(
|
||||
"int $0x40"
|
||||
:"=a"(val)
|
||||
:"a"(17));
|
||||
return val>>8;
|
||||
};
|
||||
|
||||
static inline uint32_t
|
||||
heap_init(void)
|
||||
{
|
||||
uint32_t heapsize;
|
||||
|
||||
__asm__ __volatile__(
|
||||
"int $0x40"
|
||||
:"=a"(heapsize)
|
||||
:"a"(68),"b"(11)
|
||||
);
|
||||
|
||||
return heapsize;
|
||||
}
|
||||
|
||||
static inline uint32_t get_service(char *name)
|
||||
{
|
||||
uint32_t retval = 0;
|
||||
__asm__ __volatile__(
|
||||
"int $0x40"
|
||||
:"=a"(retval)
|
||||
:"a"(68),"b"(16),"c"(name)
|
||||
:"memory");
|
||||
|
||||
return retval;
|
||||
};
|
||||
|
||||
static inline int call_service(ioctl_t *io)
|
||||
{
|
||||
int retval;
|
||||
|
||||
__asm__ __volatile__(
|
||||
"int $0x40"
|
||||
:"=a"(retval)
|
||||
:"a"(68),"b"(17),"c"(io)
|
||||
:"memory","cc");
|
||||
|
||||
return retval;
|
||||
};
|
||||
|
||||
|
||||
static inline void yield(void)
|
||||
{
|
||||
__asm__ __volatile__(
|
||||
"int $0x40"
|
||||
::"a"(68), "b"(1));
|
||||
};
|
||||
|
||||
static inline void delay(uint32_t time)
|
||||
{
|
||||
__asm__ __volatile__(
|
||||
"int $0x40"
|
||||
::"a"(5), "b"(time)
|
||||
:"memory");
|
||||
};
|
||||
|
||||
static inline
|
||||
void *user_alloc(size_t size)
|
||||
{
|
||||
void *val;
|
||||
__asm__ __volatile__(
|
||||
"int $0x40"
|
||||
:"=a"(val)
|
||||
:"a"(68),"b"(12),"c"(size));
|
||||
return val;
|
||||
}
|
||||
|
||||
static inline
|
||||
int user_free(void *mem)
|
||||
{
|
||||
int val;
|
||||
__asm__ __volatile__(
|
||||
"int $0x40"
|
||||
:"=a"(val)
|
||||
:"a"(68),"b"(13),"c"(mem));
|
||||
return val;
|
||||
}
|
||||
|
||||
static inline
|
||||
void* user_realloc(void *mem, size_t size)
|
||||
{
|
||||
void *val;
|
||||
__asm__ __volatile__(
|
||||
"int $0x40"
|
||||
:"=a"(val)
|
||||
:"a"(68),"b"(20),"c"(size),"d"(mem)
|
||||
:"memory");
|
||||
|
||||
return val;
|
||||
};
|
||||
|
||||
static inline
|
||||
int *user_unmap(void *base, size_t offset, size_t size)
|
||||
{
|
||||
int *val;
|
||||
__asm__ __volatile__(
|
||||
"int $0x40"
|
||||
:"=a"(val)
|
||||
:"a"(68),"b"(26),"c"(base),"d"(offset),"S"(size));
|
||||
return val;
|
||||
};
|
||||
|
||||
static inline void *UserAlloc(size_t size) __attribute__ ((alias ("user_alloc")));
|
||||
static inline int UserFree(void *mem) __attribute__ ((alias ("user_free")));
|
||||
static inline void* UserRealloc(void *mem, size_t size) __attribute__ ((alias ("user_realloc")));
|
||||
static inline int *UserUnmap(void *base, size_t offset, size_t size) __attribute__ ((alias ("user_unmap")));
|
||||
|
||||
typedef union
|
||||
{
|
||||
struct
|
||||
{
|
||||
void *data;
|
||||
size_t size;
|
||||
};
|
||||
unsigned long long raw;
|
||||
}ufile_t;
|
||||
|
||||
static inline ufile_t load_file(const char *path)
|
||||
{
|
||||
ufile_t uf;
|
||||
|
||||
__asm__ __volatile__ (
|
||||
"int $0x40"
|
||||
:"=A"(uf.raw)
|
||||
:"a" (68), "b"(27),"c"(path));
|
||||
|
||||
return uf;
|
||||
};
|
||||
static inline ufile_t LoadFile(const char *path) __attribute__ ((alias ("load_file")));
|
||||
|
||||
static inline int GetScreenSize(void)
|
||||
{
|
||||
int retval;
|
||||
|
||||
__asm__ __volatile__(
|
||||
"int $0x40"
|
||||
:"=a"(retval)
|
||||
:"a"(61), "b"(1));
|
||||
return retval;
|
||||
}
|
||||
|
||||
static inline
|
||||
pos_t max_screen_size()
|
||||
{
|
||||
pos_t size;
|
||||
pos_t size_tmp;
|
||||
__asm__ __volatile__(
|
||||
"int $0x40"
|
||||
:"=a"(size_tmp)
|
||||
:"a"(14));
|
||||
size.x = size_tmp.y;
|
||||
size.y = size_tmp.x;
|
||||
return size;
|
||||
};
|
||||
|
||||
static inline void get_system_colors(struct kolibri_system_colors *color_table)
|
||||
{
|
||||
__asm__ volatile ("int $0x40"
|
||||
:
|
||||
:"a"(48),"b"(3),"c"(color_table),"d"(40)
|
||||
);
|
||||
}
|
||||
|
||||
static inline void get_proc_info(char *info)
|
||||
{
|
||||
__asm__ __volatile__(
|
||||
"int $0x40"
|
||||
:
|
||||
:"a"(9), "b"(info), "c"(-1)
|
||||
:"memory");
|
||||
};
|
||||
static inline void GetProcInfo(char *info) __attribute__ ((alias ("get_proc_info")));
|
||||
|
||||
|
||||
struct blit_call
|
||||
{
|
||||
int dstx;
|
||||
int dsty;
|
||||
int w;
|
||||
int h;
|
||||
|
||||
int srcx;
|
||||
int srcy;
|
||||
int srcw;
|
||||
int srch;
|
||||
|
||||
void *bitmap;
|
||||
int stride;
|
||||
};
|
||||
|
||||
static inline void Blit(void *bitmap, int dst_x, int dst_y,
|
||||
int src_x, int src_y, int w, int h,
|
||||
int src_w, int src_h, int stride)
|
||||
{
|
||||
volatile struct blit_call bc;
|
||||
|
||||
bc.dstx = dst_x;
|
||||
bc.dsty = dst_y;
|
||||
bc.w = w;
|
||||
bc.h = h;
|
||||
bc.srcx = src_x;
|
||||
bc.srcy = src_y;
|
||||
bc.srcw = src_w;
|
||||
bc.srch = src_h;
|
||||
bc.stride = stride;
|
||||
bc.bitmap = bitmap;
|
||||
|
||||
__asm__ __volatile__(
|
||||
"int $0x40"
|
||||
::"a"(73),"b"(0),"c"(&bc.dstx));
|
||||
};
|
||||
|
||||
#define TLS_KEY_PID 0
|
||||
#define TLS_KEY_TID 4
|
||||
#define TLS_KEY_LOW_STACK 8
|
||||
#define TLS_KEY_HIGH_STACK 12
|
||||
#define TLS_KEY_LIBC 16
|
||||
|
||||
unsigned int tls_alloc(void);
|
||||
int tls_free(unsigned int key);
|
||||
|
||||
static inline int tls_set(unsigned int key, void *val)
|
||||
{
|
||||
int ret = -1;
|
||||
if(key < 4096)
|
||||
{
|
||||
__asm__ __volatile__(
|
||||
"movl %0, %%fs:(%1)"
|
||||
::"r"(val),"r"(key));
|
||||
ret = 0;
|
||||
}
|
||||
return ret;
|
||||
};
|
||||
|
||||
static inline void *tls_get(unsigned int key)
|
||||
{
|
||||
void *val = (void*)-1;
|
||||
if(key < 4096)
|
||||
{
|
||||
__asm__ __volatile__(
|
||||
"movl %%fs:(%1), %0"
|
||||
:"=r"(val)
|
||||
:"r"(key));
|
||||
};
|
||||
return val;
|
||||
}
|
||||
|
||||
|
||||
int create_thread(int (*proc)(void *param), void *param, int stack_size);
|
||||
|
||||
void* load_library(const char *name);
|
||||
|
||||
void* get_proc_address(void *handle, const char *proc_name);
|
||||
|
||||
void enumerate_libraries(int (*callback)(void *handle, const char* name,
|
||||
uint32_t base, uint32_t size, void *user_data),
|
||||
void *user_data);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
@@ -1,14 +0,0 @@
|
||||
/* BSD predecessor of POSIX.1 <dirent.h> and struct dirent */
|
||||
|
||||
#ifndef _SYS_DIR_H_
|
||||
#define _SYS_DIR_H_
|
||||
|
||||
#include <dirent.h>
|
||||
|
||||
#define direct dirent
|
||||
|
||||
extern int chdir(char* dir);
|
||||
extern int rmdir(const char* dir);
|
||||
extern int mkdir(const char* dir, unsigned fake_mode);
|
||||
|
||||
#endif /*_SYS_DIR_H_*/
|
@@ -1,41 +0,0 @@
|
||||
/* <dirent.h> includes <sys/dirent.h>, which is this file. On a
|
||||
system which supports <dirent.h>, this file is overridden by
|
||||
dirent.h in the libc/sys/.../sys directory. On a system which does
|
||||
not support <dirent.h>, we will get this file which uses #error to force
|
||||
an error. */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define DT_DIR 16
|
||||
#define DT_REG 0
|
||||
|
||||
#include <limits.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
struct dirent{
|
||||
ino_t d_ino;
|
||||
unsigned d_type;
|
||||
char d_name[256];
|
||||
};
|
||||
|
||||
typedef struct{
|
||||
struct dirent* objs;
|
||||
ino_t pos;
|
||||
ino_t num_objs;
|
||||
}DIR;
|
||||
|
||||
extern int closedir(DIR *dir);
|
||||
extern DIR* opendir(const char *path);
|
||||
extern struct dirent* readdir(DIR *);
|
||||
extern void rewinddir(DIR *dir);
|
||||
extern void seekdir(DIR *dir, unsigned pos);
|
||||
extern unsigned telldir(DIR *dir);
|
||||
|
||||
extern int scandir(const char *path, struct dirent ***res, int (*sel)(const struct dirent *), int (*cmp)(const struct dirent **, const struct dirent **));
|
||||
extern int alphasort(const struct dirent **a, const struct dirent **b);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
@@ -1,417 +0,0 @@
|
||||
/*
|
||||
sys/kos.h
|
||||
An attempt to create new C/C++ wrapper for syscalls
|
||||
Based on kos32sys.h
|
||||
KolibriOS Team
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
|
||||
/*********************** Types *************************/
|
||||
typedef unsigned int color_t;
|
||||
|
||||
// struct for sysfn 70
|
||||
#pragma pack(push,1)
|
||||
typedef struct {
|
||||
unsigned p00;
|
||||
unsigned p04;
|
||||
char *p08;
|
||||
unsigned p12;
|
||||
unsigned p16;
|
||||
char p20;
|
||||
char *p21;
|
||||
} kos_Struct70;
|
||||
#pragma pack(pop)
|
||||
|
||||
// struct for blitter
|
||||
struct blit_call {
|
||||
int dstx;
|
||||
int dsty;
|
||||
int w;
|
||||
int h;
|
||||
int srcx;
|
||||
int srcy;
|
||||
int srcw;
|
||||
int srch;
|
||||
void *bitmap;
|
||||
int stride;
|
||||
};
|
||||
|
||||
// struct for sysfn 9
|
||||
#pragma pack(push, 1)
|
||||
struct proc_info {
|
||||
unsigned long cpu_usage;
|
||||
unsigned short pos_in_stack;
|
||||
unsigned short slot;
|
||||
unsigned short reserved;
|
||||
char name[12];
|
||||
unsigned long address;
|
||||
unsigned long memory_usage;
|
||||
unsigned long ID;
|
||||
unsigned long left,top;
|
||||
unsigned long width,height;
|
||||
unsigned short thread_state;
|
||||
unsigned short reserved2;
|
||||
unsigned long cleft, ctop, cwidth, cheight;
|
||||
unsigned char window_state;
|
||||
unsigned char reserved3[1024 - 71];
|
||||
};
|
||||
#pragma pack(pop)
|
||||
|
||||
// struct for sysfn 48
|
||||
struct kolibri_system_colors {
|
||||
color_t frame_area;
|
||||
color_t grab_bar;
|
||||
color_t grab_bar_button;
|
||||
color_t grab_button_text;
|
||||
color_t grab_text;
|
||||
color_t work_area;
|
||||
color_t work_button;
|
||||
color_t work_button_text;
|
||||
color_t work_text;
|
||||
color_t work_graph;
|
||||
};
|
||||
|
||||
typedef union __attribute__((packed)) {
|
||||
uint32_t val;
|
||||
struct {
|
||||
short x;
|
||||
short y;
|
||||
};
|
||||
} pos_t;
|
||||
|
||||
|
||||
/*********************** Window Syscalls *************************/
|
||||
static inline void kos_BeginDraw(void) {
|
||||
__asm__ __volatile__(
|
||||
"int $0x40" ::"a"(12),"b"(1));
|
||||
};
|
||||
|
||||
static inline void kos_EndDraw(void) {
|
||||
__asm__ __volatile__(
|
||||
"int $0x40" ::"a"(12),"b"(2));
|
||||
};
|
||||
|
||||
static inline void kos_DrawWindow(int x, int y, int w, int h, const char *title, color_t bgcolor, uint32_t style) {
|
||||
__asm__ __volatile__(
|
||||
"int $0x40"
|
||||
::"a"(0),
|
||||
"b"((x << 16) | ((w-1) & 0xFFFF)),
|
||||
"c"((y << 16) | ((h-1) & 0xFFFF)),
|
||||
"d"((style << 24) | (bgcolor & 0xFFFFFF)),
|
||||
"D"(title),
|
||||
"S"(0) : "memory");
|
||||
};
|
||||
|
||||
#define ZPOS_DESKTOP -2
|
||||
#define ZPOS_ALWAYS_BACK -1
|
||||
#define ZPOS_NORMAL 0
|
||||
#define ZPOS_ALWAYS_TOP 1
|
||||
static inline void kos_SetWindowLayerBehaviour(int zpos) {
|
||||
__asm__ __volatile__(
|
||||
"int $0x40"
|
||||
::"a"(18),
|
||||
"b"(25),
|
||||
"c"(2),
|
||||
"d"(-1),
|
||||
"S"(zpos) : "memory");
|
||||
};
|
||||
|
||||
#define OLD -1
|
||||
static inline void kos_ChangeWindow(int new_x, int new_y, int new_w, int new_h) {
|
||||
__asm__ __volatile__(
|
||||
"int $0x40"
|
||||
::"a"(67), "b"(new_x), "c"(new_y), "d"(new_w),"S"(new_h)
|
||||
);
|
||||
}
|
||||
|
||||
/*********************** Other GUI functions *************************/
|
||||
static inline void kos_DrawText(int x, int y, const char *text, color_t color) {
|
||||
__asm__ __volatile__(
|
||||
"int $0x40"
|
||||
::"a"(4),"d"(text),
|
||||
"b"((x << 16) | y),
|
||||
"S"(strlen(text)),"c"(color)
|
||||
:"memory");
|
||||
}
|
||||
|
||||
static inline void kos_DrawButton(int x, int y, int w, int h, int id, color_t color) {
|
||||
__asm__ __volatile__(
|
||||
"int $0x40"
|
||||
::"a"(8),
|
||||
"b"(x * 65536 + w),
|
||||
"c"(y * 65536 + h),
|
||||
"d"(id),
|
||||
"S"(color));
|
||||
};
|
||||
|
||||
static inline void kos_DrawButtonWithText(int x, int y, int w, int h, int id, color_t color, const char* text) {
|
||||
kos_DrawButton(x, y, w, h, id, color);
|
||||
|
||||
int tx = ((((-strlen(text))*8)+w)/2)+x;
|
||||
int ty = h/2-7+y;
|
||||
|
||||
kos_DrawText(tx, ty, text, 0x90000000);
|
||||
};
|
||||
|
||||
static inline void kos_DrawLine(int x_start, int y_start, int x_end, int y_end, color_t color) {
|
||||
__asm__ __volatile__(
|
||||
"int $0x40"
|
||||
::"a"(38), "d"(color),
|
||||
"b"((x_start << 16) | x_end),
|
||||
"c"((y_start << 16) | y_end));
|
||||
}
|
||||
|
||||
static inline void kos_DrawBar(int x, int y, int w, int h, color_t color) {
|
||||
__asm__ __volatile__(
|
||||
"int $0x40"
|
||||
::"a"(13), "d"(color),
|
||||
"b"((x << 16) | w),
|
||||
"c"((y << 16) | h));
|
||||
}
|
||||
|
||||
static inline void kos_PutPixel(int x, int y, color_t color) {
|
||||
__asm__ __volatile__("int $0x40"
|
||||
::"a"(1),
|
||||
"b"(x),
|
||||
"c"(y),
|
||||
"d"(color));
|
||||
}
|
||||
|
||||
static inline void kos_DrawBitmap(void *bitmap, int x, int y, int w, int h) {
|
||||
__asm__ __volatile__(
|
||||
"int $0x40"
|
||||
::"a"(7), "b"(bitmap),
|
||||
"c"((w << 16) | h),
|
||||
"d"((x << 16) | y));
|
||||
}
|
||||
|
||||
static inline void Blit(void *bitmap, int dst_x, int dst_y,
|
||||
int src_x, int src_y, int w, int h,
|
||||
int src_w, int src_h, int stride)
|
||||
{
|
||||
volatile struct blit_call bc;
|
||||
|
||||
bc.dstx = dst_x;
|
||||
bc.dsty = dst_y;
|
||||
bc.w = w;
|
||||
bc.h = h;
|
||||
bc.srcx = src_x;
|
||||
bc.srcy = src_y;
|
||||
bc.srcw = src_w;
|
||||
bc.srch = src_h;
|
||||
bc.stride = stride;
|
||||
bc.bitmap = bitmap;
|
||||
|
||||
__asm__ __volatile__(
|
||||
"int $0x40"
|
||||
::"a"(73),"b"(0),"c"(&bc.dstx));
|
||||
};
|
||||
|
||||
// Get screen part as image
|
||||
static inline void kos_ScreenShot(char* image, int x, int y, int w, int h) {
|
||||
__asm__ __volatile__(
|
||||
"int $0x40"
|
||||
::"a"(36),
|
||||
"b"(image),
|
||||
"c"(w*65536+h),
|
||||
"d"(x*65536+y) : "memory");
|
||||
};
|
||||
|
||||
/*********************** Skin *************************/
|
||||
// Get skin height
|
||||
static inline uint32_t kos_SkinHeight(void) {
|
||||
uint32_t height;
|
||||
|
||||
__asm__ __volatile__(
|
||||
"int $0x40 \n\t"
|
||||
:"=a"(height)
|
||||
:"a"(48),"b"(4));
|
||||
return height;
|
||||
};
|
||||
|
||||
/*********************** Mouse *************************/
|
||||
#define POS_SCREEN 0
|
||||
#define POS_WINDOW 1
|
||||
|
||||
static inline pos_t kos_GetMousePos(int origin) {
|
||||
pos_t val;
|
||||
__asm__ __volatile__(
|
||||
"int $0x40 \n\t"
|
||||
"rol $16, %%eax"
|
||||
:"=a"(val)
|
||||
:"a"(37),"b"(origin));
|
||||
return val;
|
||||
}
|
||||
|
||||
static inline uint32_t kos_GetMouseButtons(void) {
|
||||
uint32_t val;
|
||||
|
||||
__asm__ __volatile__(
|
||||
"int $0x40"
|
||||
:"=a"(val)
|
||||
:"a"(37),"b"(2));
|
||||
return val;
|
||||
};
|
||||
|
||||
static inline uint32_t kos_GetMouseWheels(void) {
|
||||
uint32_t val;
|
||||
|
||||
__asm__ __volatile__(
|
||||
"int $0x40 \n\t"
|
||||
:"=a"(val)
|
||||
:"a"(37),"b"(7));
|
||||
return val;
|
||||
};
|
||||
|
||||
static inline uint32_t kos_LoadCursor(void *path, uint32_t flags) {
|
||||
uint32_t val;
|
||||
__asm__ __volatile__(
|
||||
"int $0x40"
|
||||
:"=a"(val)
|
||||
:"a"(37), "b"(4), "c"(path), "d"(flags));
|
||||
return val;
|
||||
}
|
||||
|
||||
static inline uint32_t kos_SetCursor(uint32_t cursor) {
|
||||
uint32_t old;
|
||||
__asm__ __volatile__(
|
||||
"int $0x40"
|
||||
:"=a"(old)
|
||||
:"a"(37), "b"(5), "c"(cursor));
|
||||
return old;
|
||||
};
|
||||
|
||||
static inline int kos_DestroyCursor(uint32_t cursor) {
|
||||
int ret;
|
||||
__asm__ __volatile__(
|
||||
"int $0x40"
|
||||
:"=a"(ret)
|
||||
:"a"(37), "b"(6), "c"(cursor)
|
||||
:"memory");
|
||||
return ret;
|
||||
};
|
||||
|
||||
/*********************** OS Events *************************/
|
||||
#define evReDraw 1
|
||||
#define evKey 2
|
||||
#define evButton 3
|
||||
#define evExit 4
|
||||
#define evDesktop 5
|
||||
#define evMouse 6
|
||||
#define evIPC 7
|
||||
#define evNetwork 8
|
||||
#define evDebug 9
|
||||
|
||||
static inline uint32_t kos_WaitForEventTimeout(uint32_t time) {
|
||||
uint32_t val;
|
||||
__asm__ __volatile__(
|
||||
"int $0x40"
|
||||
:"=a"(val)
|
||||
:"a"(23), "b"(time));
|
||||
return val;
|
||||
};
|
||||
|
||||
static inline uint32_t kos_CheckForEvent(void) {
|
||||
uint32_t val;
|
||||
__asm__ __volatile__(
|
||||
"int $0x40"
|
||||
:"=a"(val)
|
||||
:"a"(11));
|
||||
return val;
|
||||
};
|
||||
|
||||
static inline uint32_t kos_WaitForEvent(void) {
|
||||
uint32_t val;
|
||||
__asm__ __volatile__(
|
||||
"int $0x40"
|
||||
:"=a"(val)
|
||||
:"a"(10));
|
||||
return val;
|
||||
};
|
||||
|
||||
/*********************** Eventmask *************************/
|
||||
#define EVM_REDRAW 1
|
||||
#define EVM_KEY 2
|
||||
#define EVM_BUTTON 4
|
||||
#define EVM_EXIT 8
|
||||
#define EVM_BACKGROUND 16
|
||||
#define EVM_MOUSE 32
|
||||
#define EVM_IPC 64
|
||||
#define EVM_STACK 128
|
||||
#define EVM_DEBUG 256
|
||||
#define EVM_STACK2 512
|
||||
#define EVM_MOUSE_FILTER 0x80000000
|
||||
#define EVM_CURSOR_FILTER 0x40000000
|
||||
|
||||
static inline uint32_t kos_SetMaskForEvents(uint32_t event_mask) {
|
||||
uint32_t old_event_mask;
|
||||
__asm__ __volatile__(
|
||||
"int $0x40"
|
||||
:"=a"(old_event_mask)
|
||||
:"a"(40),"b"(event_mask));
|
||||
|
||||
return old_event_mask;
|
||||
};
|
||||
|
||||
/*********************** Other *************************/
|
||||
static inline int kos_GetKey() {
|
||||
unsigned short key;
|
||||
__asm__ __volatile__("int $0x40":"=a"(key):"0"(2));
|
||||
if(!(key & 0xFF)) return (key>>8)&0xFF; else return 0;
|
||||
}
|
||||
|
||||
static inline uint32_t kos_GetButtonID(void) {
|
||||
uint32_t val;
|
||||
__asm__ __volatile__(
|
||||
"int $0x40"
|
||||
:"=a"(val)
|
||||
:"a"(17));
|
||||
return val>>8;
|
||||
};
|
||||
|
||||
static inline void kos_Delay(uint32_t time) {
|
||||
__asm__ __volatile__(
|
||||
"int $0x40"
|
||||
::"a"(5), "b"(time)
|
||||
:"memory");
|
||||
};
|
||||
|
||||
static inline pos_t kos_ScreenSize() {
|
||||
pos_t size;
|
||||
__asm__ __volatile__(
|
||||
"int $0x40"
|
||||
:"=a"(size)
|
||||
:"a"(14));
|
||||
|
||||
return size;
|
||||
};
|
||||
|
||||
static inline void kos_GetSystemColors(struct kolibri_system_colors *color_table) {
|
||||
__asm__ __volatile__ ("int $0x40"
|
||||
:
|
||||
:"a"(48),"b"(3),"c"(color_table),"d"(40)
|
||||
);
|
||||
}
|
||||
|
||||
// sysfn 9
|
||||
static inline void kos_ProcessInfo(char *info) {
|
||||
__asm__ __volatile__(
|
||||
"int $0x40"
|
||||
:
|
||||
:"a"(9), "b"(info), "c"(-1)
|
||||
:"memory");
|
||||
};
|
||||
|
||||
static inline void kos_RunApp(char* app, char* param) {
|
||||
kos_Struct70 r;
|
||||
r.p00 = 7;
|
||||
r.p04 = 0;
|
||||
r.p08 = param;
|
||||
r.p12 = 0;
|
||||
r.p16 = 0;
|
||||
r.p20 = 0;
|
||||
r.p21 = app;
|
||||
__asm__ __volatile__ ("int $0x40"::"a"(70), "b"(&r));
|
||||
}
|
@@ -1,147 +0,0 @@
|
||||
// Console.obj loading for kos32-gcc
|
||||
// Writed by rgimad and maxcodehack
|
||||
//
|
||||
// Usage:
|
||||
// #include <sys/kos_LoadConsole.h>
|
||||
// load_console();
|
||||
//
|
||||
|
||||
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#ifndef CONSOLE_OBJ_H
|
||||
#define CONSOLE_OBJ_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifndef NULL
|
||||
#define NULL 0
|
||||
#endif
|
||||
|
||||
#ifndef cdecl
|
||||
#define cdecl __attribute__ ((cdecl))
|
||||
#endif
|
||||
|
||||
#ifndef stdcall
|
||||
#define stdcall __attribute__ ((stdcall))
|
||||
#endif
|
||||
|
||||
typedef unsigned int dword;
|
||||
typedef unsigned short word;
|
||||
|
||||
const char* imports[] = {
|
||||
"START", "version", "con_init", "con_write_asciiz", "con_write_string",
|
||||
"con_printf", "con_exit", "con_get_flags", "con_set_flags", "con_kbhit",
|
||||
"con_getch", "con_getch2", "con_gets", "con_gets2", "con_get_font_height",
|
||||
"con_get_cursor_height", "con_set_cursor_height", "con_cls",
|
||||
"con_get_cursor_pos", "con_set_cursor_pos", "con_set_title",
|
||||
(char*)0
|
||||
};
|
||||
|
||||
dword *version;
|
||||
|
||||
typedef int (stdcall * con_gets2_callback)(int keycode, char** pstr, int* pn,
|
||||
int* ppos);
|
||||
|
||||
void stdcall (*con_init)(dword wnd_width, dword wnd_height, dword scr_width, dword scr_height, const char* title) = 0;
|
||||
void stdcall (*con_exit)(int bCloseWindow) = 0;
|
||||
void stdcall (*con_set_title)(const char* title) = 0;
|
||||
void stdcall (*con_write_asciiz)(const char* str) = 0;
|
||||
void stdcall (*con_write_string)(const char* str, dword length) = 0;
|
||||
int cdecl (*con_printf)(const char* format, ...) = 0;
|
||||
dword stdcall (*con_get_flags)(void) = 0;
|
||||
dword stdcall (*con_set_flags)(dword new_flags) = 0;
|
||||
int stdcall (*con_get_font_height)(void) = 0;
|
||||
int stdcall (*con_get_cursor_height)(void) = 0;
|
||||
int stdcall (*con_set_cursor_height)(int new_height) = 0;
|
||||
int stdcall (*con_getch)(void) = 0;
|
||||
word stdcall (*con_getch2)(void) = 0;
|
||||
int stdcall (*con_kbhit)(void) = 0;
|
||||
char* stdcall (*con_gets)(char* str, int n) = 0;
|
||||
char* stdcall (*con_gets2)(con_gets2_callback callback, char* str, int n) = 0;
|
||||
void stdcall (*con_cls)() = 0;
|
||||
void stdcall (*con_get_cursor_pos)(int* px, int* py) = 0;
|
||||
void stdcall (*con_set_cursor_pos)(int x, int y) = 0;
|
||||
|
||||
const char lib_path[] = "/sys/lib/console.obj";
|
||||
|
||||
void* load_library(const char *name)
|
||||
{
|
||||
void *table;
|
||||
__asm__ __volatile__(
|
||||
"int $0x40"
|
||||
:"=a"(table)
|
||||
:"a"(68), "b"(19), "c"(name));
|
||||
return table;
|
||||
}
|
||||
|
||||
void *load_library_procedure(void *exports, const char *name)
|
||||
{
|
||||
if (exports == NULL) { return 0; }
|
||||
while (*(dword*)exports != 0)
|
||||
{
|
||||
char *str1 = (char*)(*(dword*)exports);
|
||||
if (strcmp(str1, name) == 0)
|
||||
{
|
||||
void *ptr = (void*)*(dword*)(exports + 4);
|
||||
return ptr;
|
||||
}
|
||||
exports += 8;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
void output_debug_string(const char *s)
|
||||
{
|
||||
unsigned int i = 0;
|
||||
while(*(s + i))
|
||||
{
|
||||
__asm__ __volatile__ ("int $0x40"::"a"(63), "b"(1), "c"(*(s + i)));
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
void load_console()
|
||||
{
|
||||
void *lib = load_library(lib_path);
|
||||
|
||||
if (!lib)
|
||||
{
|
||||
output_debug_string("Console.obj loading error\r\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
dword (*start_lib)(dword) = (dword(*)(dword))load_library_procedure(lib, imports[0]);
|
||||
|
||||
version = (dword*)load_library_procedure(lib, imports[1]);
|
||||
|
||||
con_init = (void stdcall(*)(dword,dword,dword,dword,const char*))load_library_procedure(lib, imports[2]);
|
||||
con_write_asciiz = (void stdcall(*)(const char*))load_library_procedure(lib, imports[3]);
|
||||
con_write_string = (void stdcall(*)(const char*,dword))load_library_procedure(lib, imports[4]);
|
||||
con_printf = (int cdecl(*)(const char*,...))load_library_procedure(lib, imports[5]);
|
||||
con_exit = (void stdcall(*)(int))load_library_procedure(lib, imports[6]);
|
||||
con_get_flags = (dword stdcall(*)(void))load_library_procedure(lib, imports[7]);
|
||||
con_set_flags = (dword stdcall(*)(dword))load_library_procedure(lib, imports[8]);
|
||||
con_kbhit = (int stdcall(*)(void))load_library_procedure(lib, imports[9]);
|
||||
con_getch = (int stdcall(*)(void))load_library_procedure(lib, imports[10]);
|
||||
con_getch2 = (word stdcall(*)(void))load_library_procedure(lib, imports[11]);
|
||||
con_gets = (char* stdcall(*)(char*,int))load_library_procedure(lib, imports[12]);
|
||||
con_gets2 = (char* stdcall(*)(con_gets2_callback,char*,int))load_library_procedure(lib, imports[13]);
|
||||
con_get_font_height = (int stdcall(*)(void))load_library_procedure(lib, imports[14]);
|
||||
con_get_cursor_height = (int stdcall(*)(void))load_library_procedure(lib, imports[15]);
|
||||
con_set_cursor_height = (int stdcall(*)(int))load_library_procedure(lib, imports[16]);
|
||||
con_cls = (void stdcall(*)(void))load_library_procedure(lib, imports[17]);
|
||||
con_get_cursor_pos = (void stdcall(*)(int*,int*))load_library_procedure(lib, imports[18]);
|
||||
con_set_cursor_pos = (void stdcall(*)(int,int))load_library_procedure(lib, imports[19]);
|
||||
con_set_title = (void stdcall(*)(const char*))load_library_procedure(lib, imports[20]);
|
||||
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
@@ -1,85 +0,0 @@
|
||||
|
||||
#ifndef __KOS_IO_H__
|
||||
#define __KOS_IO_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#pragma pack(push, 1)
|
||||
typedef struct
|
||||
{
|
||||
char sec;
|
||||
char min;
|
||||
char hour;
|
||||
char rsv;
|
||||
}detime_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
char day;
|
||||
char month;
|
||||
short year;
|
||||
}dedate_t;
|
||||
|
||||
typedef struct
|
||||
{
|
||||
unsigned attr;
|
||||
unsigned flags;
|
||||
union
|
||||
{
|
||||
detime_t ctime;
|
||||
unsigned cr_time;
|
||||
};
|
||||
union
|
||||
{
|
||||
dedate_t cdate;
|
||||
unsigned cr_date;
|
||||
};
|
||||
union
|
||||
{
|
||||
detime_t atime;
|
||||
unsigned acc_time;
|
||||
};
|
||||
union
|
||||
{
|
||||
dedate_t adate;
|
||||
unsigned acc_date;
|
||||
};
|
||||
union
|
||||
{
|
||||
detime_t mtime;
|
||||
unsigned mod_time;
|
||||
};
|
||||
union
|
||||
{
|
||||
dedate_t mdate;
|
||||
unsigned mod_date;
|
||||
};
|
||||
unsigned size;
|
||||
unsigned size_high;
|
||||
} fileinfo_t;
|
||||
|
||||
#pragma pack(pop)
|
||||
|
||||
int create_file(const char *path);
|
||||
int get_fileinfo(const char *path, fileinfo_t *info);
|
||||
int set_fileinfo(const char *path, fileinfo_t *info);
|
||||
int read_file(const char *path, void *buff,
|
||||
size_t offset, size_t count, size_t *reads);
|
||||
int write_file(const char *path,const void *buff,
|
||||
size_t offset, size_t count, size_t *writes);
|
||||
int set_file_size(const char *path, unsigned size);
|
||||
void unpack(void* packed_data, void* unpacked_data) __attribute__((stdcall)) ;
|
||||
|
||||
static inline void set_cwd(const char* cwd)
|
||||
{
|
||||
__asm__ __volatile__(
|
||||
"int $0x40"
|
||||
::"a"(30),"b"(1),"c"(cwd));
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
#endif
|
@@ -21,6 +21,7 @@
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
@@ -82,43 +83,48 @@ typedef struct {
|
||||
} ksys_ufile_t;
|
||||
|
||||
typedef struct {
|
||||
uint32_t p00;
|
||||
uint32_t func_num;
|
||||
union {
|
||||
uint64_t p04;
|
||||
uint64_t offset64;
|
||||
struct {
|
||||
uint32_t p04dw;
|
||||
uint32_t p08dw;
|
||||
union {
|
||||
uint32_t debug;
|
||||
uint32_t offset;
|
||||
};
|
||||
union {
|
||||
uint32_t flags;
|
||||
char* args;
|
||||
};
|
||||
};
|
||||
};
|
||||
uint32_t p12;
|
||||
uint32_t data_size;
|
||||
void* data;
|
||||
union {
|
||||
uint32_t p16;
|
||||
const char* new_name;
|
||||
void* bdfe;
|
||||
void* buf16;
|
||||
const void* cbuf16;
|
||||
struct {
|
||||
uint8_t zero;
|
||||
char* path_ptr;
|
||||
};
|
||||
char path[0];
|
||||
};
|
||||
char p20;
|
||||
const char* p21;
|
||||
} ksys70_t;
|
||||
} ksys_file_t;
|
||||
|
||||
typedef struct {
|
||||
uint32_t status;
|
||||
uint32_t rw_bytes;
|
||||
} ksys70_status_t;
|
||||
} ksys_file_status_t;
|
||||
|
||||
typedef struct {
|
||||
uint32_t attributes;
|
||||
uint32_t name_cp;
|
||||
ksys_time_t creation_time;
|
||||
ksys_date_t creation_date;
|
||||
ksys_time_t last_access_time;
|
||||
ksys_date_t last_access_date;
|
||||
ksys_time_t last_modification_time;
|
||||
ksys_date_t last_modification_date;
|
||||
uint32_t attr;
|
||||
uint32_t name_enc;
|
||||
ksys_time_t ctime;
|
||||
ksys_date_t cdate;
|
||||
ksys_time_t atime;
|
||||
ksys_date_t adate;
|
||||
ksys_time_t mtime;
|
||||
ksys_date_t mdate;
|
||||
uint64_t size;
|
||||
char name[0];
|
||||
} ksys_bdfe_t;
|
||||
} ksys_file_info_t;
|
||||
|
||||
#define KSYS_THREAD_INFO_SIZE 1024
|
||||
|
||||
@@ -1483,125 +1489,166 @@ KOSAPI ksys_ufile_t _ksys_load_file_enc(const char* path, unsigned file_encoding
|
||||
|
||||
/*==== Function 70 - work with file system with long names support. ====*/
|
||||
|
||||
KOSAPI ksys70_status_t _ksys70(const ksys70_t* k)
|
||||
enum KSYS_FILE_FUNC {
|
||||
KSYS_FILE_READ = 0,
|
||||
KSYS_FILE_READ_DIR,
|
||||
KSYS_FILE_CREATE,
|
||||
KSYS_FILE_WRITE,
|
||||
KSYS_FILE_SET_SIZE,
|
||||
KSYS_FILE_GET_INFO,
|
||||
KSYS_FILE_SET_ATTR,
|
||||
KSYS_FILE_EXEC,
|
||||
KSYS_FILE_REMOVE,
|
||||
KSYS_FILE_CREATE_DIR,
|
||||
KSYS_FILE_RENAME,
|
||||
};
|
||||
|
||||
KOSAPI ksys_file_status_t _ksys_file(const ksys_file_t* info)
|
||||
{
|
||||
ksys70_status_t status;
|
||||
ksys_file_status_t st;
|
||||
asm_inline(
|
||||
"int $0x40"
|
||||
: "=a"(status.status), "=b"(status.rw_bytes)
|
||||
: "a"(70), "b"(k)
|
||||
: "=a"(st.status), "=b"(st.rw_bytes)
|
||||
: "a"(70), "b"(info)
|
||||
: "memory");
|
||||
return status;
|
||||
return st;
|
||||
}
|
||||
|
||||
/*====== Function 70, subfunction 0 - read file with long names support. ======*/
|
||||
|
||||
KOSAPI ksys70_status_t _ksys_file_read(const char* name, uint64_t offset, uint32_t size, void* buf)
|
||||
KOSAPI ksys_file_status_t _ksys_file_read(const char* name, uint64_t offset, uint32_t size, void* buf)
|
||||
{
|
||||
ksys70_t k;
|
||||
k.p00 = 0;
|
||||
k.p04 = offset;
|
||||
k.p12 = size;
|
||||
k.buf16 = buf;
|
||||
k.p20 = 0;
|
||||
k.p21 = name;
|
||||
return _ksys70(&k);
|
||||
ksys_file_t f;
|
||||
f.func_num = KSYS_FILE_READ;
|
||||
f.offset64 = offset;
|
||||
f.data_size = size;
|
||||
f.data = buf;
|
||||
f.zero = 0;
|
||||
f.path_ptr = (char*)name;
|
||||
return _ksys_file(&f);
|
||||
}
|
||||
|
||||
/*===================== Function 70, subfunction 2 =====================*/
|
||||
/*============ Create/rewrite file with long names support. ============*/
|
||||
|
||||
KOSAPI int _ksys_file_create(const char* name)
|
||||
KOSAPI ksys_file_status_t _ksys_file_create(const char* name)
|
||||
{
|
||||
ksys70_t k;
|
||||
k.p00 = 2;
|
||||
k.p04dw = 0;
|
||||
k.p08dw = 0;
|
||||
k.p12 = 0;
|
||||
k.p21 = name;
|
||||
return _ksys70(&k).status;
|
||||
ksys_file_t f;
|
||||
f.func_num = KSYS_FILE_CREATE;
|
||||
f.offset64 = 0;
|
||||
f.data_size = 0;
|
||||
f.data = NULL;
|
||||
f.zero = 0;
|
||||
f.path_ptr = (char*)name;
|
||||
return _ksys_file(&f);
|
||||
}
|
||||
|
||||
/*===================== Function 70, subfunction 3 =====================*/
|
||||
/*=========== Write to existing file with long names support. ==========*/
|
||||
|
||||
KOSAPI ksys70_status_t _ksys_file_write(const char* name, uint64_t offset, uint32_t size, const void* buf)
|
||||
KOSAPI ksys_file_status_t _ksys_file_write(const char* name, uint64_t offset, uint32_t size, const void* buf)
|
||||
{
|
||||
ksys70_t k;
|
||||
k.p00 = 3;
|
||||
k.p04 = offset;
|
||||
k.p12 = size;
|
||||
k.cbuf16 = buf;
|
||||
k.p20 = 0;
|
||||
k.p21 = name;
|
||||
return _ksys70(&k);
|
||||
ksys_file_t f;
|
||||
f.func_num = KSYS_FILE_WRITE;
|
||||
f.offset64 = offset;
|
||||
f.data_size = size;
|
||||
f.data = (void*)buf;
|
||||
f.zero = 0;
|
||||
f.path_ptr = (char*)name;
|
||||
return _ksys_file(&f);
|
||||
}
|
||||
|
||||
/*========== Function 70, subfunction 4 - set file size. =====*/
|
||||
|
||||
KOSAPI int _ksys_file_set_size(const char* name, uint64_t size)
|
||||
{
|
||||
ksys_file_t f;
|
||||
f.func_num = KSYS_FILE_SET_SIZE;
|
||||
f.offset64 = size;
|
||||
f.data_size = 0;
|
||||
f.data = NULL;
|
||||
f.zero = 0;
|
||||
f.path_ptr = (char*)name;
|
||||
return _ksys_file(&f).status;
|
||||
}
|
||||
|
||||
/*========== Function 70, subfunction 5 - get information on file/folder. =====*/
|
||||
|
||||
KOSAPI int _ksys_file_info(const char* name, ksys_bdfe_t* bdfe)
|
||||
KOSAPI int _ksys_file_info(const char* name, ksys_file_info_t* info)
|
||||
{
|
||||
ksys70_t k;
|
||||
k.p00 = 5;
|
||||
k.p04dw = 0;
|
||||
k.p08dw = 0;
|
||||
k.p12 = 0;
|
||||
k.bdfe = bdfe;
|
||||
k.p20 = 0;
|
||||
k.p21 = name;
|
||||
return _ksys70(&k).status;
|
||||
ksys_file_t f;
|
||||
f.func_num = KSYS_FILE_GET_INFO;
|
||||
f.offset64 = 0;
|
||||
f.data_size = 0;
|
||||
f.data = (void*)info;
|
||||
f.zero = 0;
|
||||
f.path_ptr = (char*)name;
|
||||
return _ksys_file(&f).status;
|
||||
}
|
||||
|
||||
#define _ksys_dir_info _ksys_file_info
|
||||
|
||||
KOSAPI uint64_t _ksys_file_get_size(const char* name, int* err)
|
||||
{
|
||||
ksys_file_info_t info;
|
||||
*err = _ksys_file_info(name, &info);
|
||||
return info.size;
|
||||
}
|
||||
|
||||
#define _ksys_dir_info _ksys_file_info
|
||||
|
||||
/*=========== Function 70, subfunction 7 - start application. ===========*/
|
||||
|
||||
KOSAPI int _ksys_exec(const char* app_name, char* args)
|
||||
KOSAPI int _ksys_exec(const char* path, char* args, bool debug)
|
||||
{
|
||||
ksys70_t file_opt;
|
||||
file_opt.p00 = 7;
|
||||
file_opt.p04dw = 0;
|
||||
file_opt.p08dw = (uint32_t)args;
|
||||
|
||||
file_opt.p12 = 0;
|
||||
file_opt.p16 = 0;
|
||||
file_opt.p20 = 0;
|
||||
|
||||
file_opt.p21 = app_name;
|
||||
return _ksys70(&file_opt).status;
|
||||
ksys_file_t f;
|
||||
f.func_num = KSYS_FILE_EXEC;
|
||||
f.debug = debug;
|
||||
f.args = args;
|
||||
f.zero = 0;
|
||||
f.path_ptr = (char*)path;
|
||||
return _ksys_file(&f).status;
|
||||
}
|
||||
|
||||
/*========== Function 70, subfunction 8 - delete file/folder. ==========*/
|
||||
|
||||
KOSAPI int _ksys_file_delete(const char* name)
|
||||
KOSAPI int _ksys_file_delete(const char* path)
|
||||
{
|
||||
ksys70_t k;
|
||||
k.p00 = 8;
|
||||
k.p20 = 0;
|
||||
k.p21 = name;
|
||||
return _ksys70(&k).status;
|
||||
ksys_file_t f;
|
||||
f.func_num = KSYS_FILE_REMOVE;
|
||||
f.offset64 = 0;
|
||||
f.data_size = 0;
|
||||
f.data = NULL;
|
||||
f.zero = 0;
|
||||
f.path_ptr = (char*)path;
|
||||
return _ksys_file(&f).status;
|
||||
}
|
||||
|
||||
/*============= Function 70, subfunction 9 - create folder. =============*/
|
||||
|
||||
KOSAPI int _ksys_mkdir(const char* path)
|
||||
{
|
||||
ksys70_t dir_opt;
|
||||
dir_opt.p00 = 9;
|
||||
dir_opt.p21 = path;
|
||||
return _ksys70(&dir_opt).status;
|
||||
ksys_file_t f;
|
||||
f.func_num = KSYS_FILE_CREATE_DIR;
|
||||
f.offset64 = 0;
|
||||
f.data_size = 0;
|
||||
f.data = NULL;
|
||||
f.zero = 0;
|
||||
f.path_ptr = (char*)path;
|
||||
return _ksys_file(&f).status;
|
||||
}
|
||||
|
||||
/*============= Function 70, subfunction 10 - rename/move. =============*/
|
||||
|
||||
KOSAPI int _ksys_file_rename(const char* name, const char* new_name)
|
||||
{
|
||||
ksys70_t k;
|
||||
k.p00 = 10;
|
||||
k.new_name = new_name;
|
||||
k.p20 = 0;
|
||||
k.p21 = name;
|
||||
return _ksys70(&k).status;
|
||||
ksys_file_t f;
|
||||
f.func_num = KSYS_FILE_REMOVE;
|
||||
f.data = (void*)new_name;
|
||||
f.data_size = 0;
|
||||
f.zero = 0;
|
||||
f.path_ptr = (char*)name;
|
||||
return _ksys_file(&f).status;
|
||||
}
|
||||
|
||||
#define _ksys_dir_rename _ksys_file_rename
|
||||
@@ -1707,25 +1754,6 @@ KOSAPI int _ksys_posix_pipe2(int pipefd[2], int flags)
|
||||
return err;
|
||||
}
|
||||
|
||||
/* ######### Old names of functions and structures. Do not use again! ##########*/
|
||||
|
||||
#define _ksys_get_event _ksys_wait_event
|
||||
#define _ksys_file_get_info _ksys_file_info
|
||||
|
||||
static inline int _ksys_file_read_file(const char* name, unsigned long long offset, unsigned size, void* buff, unsigned* bytes_read)
|
||||
{
|
||||
ksys70_status_t res = _ksys_file_read(name, offset, size, buff);
|
||||
*bytes_read = res.rw_bytes;
|
||||
return res.status;
|
||||
}
|
||||
|
||||
static inline int _ksys_file_write_file(const char* name, unsigned long long offset, unsigned size, const void* buff, unsigned* bytes_write)
|
||||
{
|
||||
ksys70_status_t res = _ksys_file_write(name, offset, size, buff);
|
||||
*bytes_write = res.rw_bytes;
|
||||
return res.status;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
@@ -1,216 +0,0 @@
|
||||
#ifndef __SOCKET_H__
|
||||
#define __SOCKET_H__
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
// Socket Types
|
||||
#define SOCK_STREAM 1
|
||||
#define SOCK_DGRAM 2
|
||||
#define SOCK_RAW 3
|
||||
|
||||
// IP protocols
|
||||
#define IPPROTO_IP 0
|
||||
#define IPPROTO_ICMP 1
|
||||
#define IPPROTO_TCP 6
|
||||
#define IPPROTO_UDP 17
|
||||
#define IPPROTO_RAW 255
|
||||
|
||||
// IP options
|
||||
#define IP_TTL 2
|
||||
|
||||
// Address families
|
||||
#define AF_UNSPEC 0
|
||||
#define AF_LOCAL 1
|
||||
#define AF_INET 2 // Default INET=IPv4
|
||||
#define AF_INET4 2 // IPv4
|
||||
#define AF_INET6 10 // IPv6
|
||||
|
||||
#define PF_UNSPEC AF_UNSPEC
|
||||
#define PF_LOCAL AF_LOCAL
|
||||
#define PF_INET4 AF_INET4
|
||||
#define PF_INET6 AF_INET6
|
||||
|
||||
// internal definition
|
||||
#define AI_SUPPORTED 0x40F
|
||||
|
||||
// for system function 76
|
||||
#define API_ETH (0<<16)
|
||||
#define API_IPv4 (1<<16)
|
||||
#define API_ICMP (2<<16)
|
||||
#define API_UDP (3<<16)
|
||||
#define API_TCP (4<<16)
|
||||
#define API_ARP (5<<16)
|
||||
#define API_PPPOE (6<<16)
|
||||
|
||||
// Socket flags for user calls
|
||||
#define MSG_NOFLAG 0
|
||||
#define MSG_PEEK 0x02
|
||||
#define MSG_DONTWAIT 0x40
|
||||
|
||||
// Socket levels
|
||||
#define SOL_SOCKET 0xffff
|
||||
|
||||
//Socket options
|
||||
#define SO_BINDTODEVICE (1<<9)
|
||||
#define SO_NONBLOCK (1<<31)
|
||||
|
||||
// Error Codes
|
||||
#define ENOBUFS 1
|
||||
#define EINPROGRESS 2
|
||||
#define EOPNOTSUPP 4
|
||||
#define EWOULDBLOCK 6
|
||||
#define ENOTCONN 9
|
||||
#define EALREADY 10
|
||||
#define EINVALUE 11
|
||||
#define EMSGSIZE 12
|
||||
#define ENOMEM 18
|
||||
#define EADDRINUSE 20
|
||||
#define ECONNREFUSED 61
|
||||
#define ECONNRESET 52
|
||||
#define EISCONN 56
|
||||
#define ETIMEDOUT 60
|
||||
#define ECONNABORTED 53
|
||||
|
||||
|
||||
#define PORT(X) (X<<8)
|
||||
int err_code;
|
||||
|
||||
#pragma pack(push,1)
|
||||
struct sockaddr{
|
||||
unsigned short sin_family;
|
||||
unsigned short sin_port;
|
||||
unsigned int sin_addr;
|
||||
unsigned long long sin_zero;
|
||||
};
|
||||
#pragma pack(pop)
|
||||
|
||||
#pragma pack(push,1)
|
||||
typedef struct{
|
||||
unsigned int level;
|
||||
unsigned int optionname;
|
||||
unsigned int optlenght;
|
||||
unsigned char options;
|
||||
}optstruct;
|
||||
#pragma pack(pop)
|
||||
|
||||
static inline int socket(int domain, int type, int protocol)
|
||||
{
|
||||
int socket;
|
||||
asm volatile(
|
||||
"int $0x40"
|
||||
:"=b"(err_code), "=a"(socket)
|
||||
:"a"(75), "b"(0), "c"(domain), "d"(type), "S"(protocol)
|
||||
);
|
||||
return socket;
|
||||
}
|
||||
|
||||
static inline int close(int socket)
|
||||
{
|
||||
int status;
|
||||
asm volatile(
|
||||
"int $0x40"
|
||||
:"=b"(err_code), "=a"(status)
|
||||
:"a"(75), "b"(1), "c"(socket)
|
||||
);
|
||||
return status;
|
||||
}
|
||||
|
||||
static inline int bind(int socket, const struct sockaddr *addres, int addres_len)
|
||||
{
|
||||
int status;
|
||||
asm volatile(
|
||||
"int $0x40"
|
||||
:"=b"(err_code), "=a"(status)
|
||||
:"a"(75), "b"(2), "c"(socket), "d"(addres), "S"(addres_len)
|
||||
);
|
||||
return status;
|
||||
}
|
||||
|
||||
static inline int listen(int socket, int backlog)
|
||||
{
|
||||
int status;
|
||||
asm volatile(
|
||||
"int $0x40"
|
||||
:"=b"(err_code), "=a"(status)
|
||||
:"a"(75), "b"(3), "c"(socket), "d"(backlog)
|
||||
);
|
||||
return status;
|
||||
}
|
||||
|
||||
static inline int connect(int socket, const struct sockaddr* address, int socket_len)
|
||||
{
|
||||
int status;
|
||||
asm volatile(
|
||||
"int $0x40"
|
||||
:"=b"(err_code), "=a"(status)
|
||||
:"a"(75), "b"(4), "c"(socket), "d"(address), "S"(socket_len)
|
||||
);
|
||||
return status;
|
||||
}
|
||||
|
||||
static inline int accept(int socket, const struct sockaddr *address, int address_len)
|
||||
{
|
||||
int new_socket;
|
||||
asm volatile(
|
||||
"int $0x40"
|
||||
:"=b"(err_code), "=a"(new_socket)
|
||||
:"a"(75), "b"(5), "c"(socket), "d"(address), "S"(address_len)
|
||||
);
|
||||
return new_socket;
|
||||
}
|
||||
|
||||
static inline int send(int socket, const void *message, size_t msg_len, int flag)
|
||||
{
|
||||
int status;
|
||||
asm volatile(
|
||||
"int $0x40"
|
||||
:"=b"(err_code), "=a"(status)
|
||||
:"a"(75), "b"(6), "c"(socket), "d"(message), "S"(msg_len), "D"(flag)
|
||||
);
|
||||
return status;
|
||||
}
|
||||
|
||||
static inline int recv(int socket, void *buffer, size_t buff_len, int flag)
|
||||
{
|
||||
int status;
|
||||
asm volatile(
|
||||
"int $0x40"
|
||||
:"=b"(err_code), "=a"(status)
|
||||
:"a"(75), "b"(7), "c"(socket), "d"(buffer), "S"(buff_len), "D"(flag)
|
||||
);
|
||||
return status;
|
||||
}
|
||||
|
||||
static inline int setsockopt(int socket,const optstruct* opt)
|
||||
{
|
||||
int status;
|
||||
asm volatile(
|
||||
"int $0x40"
|
||||
:"=b"(err_code), "=a"(status)
|
||||
:"a"(75), "b"(8), "c"(socket),"d"(opt)
|
||||
);
|
||||
return status;
|
||||
}
|
||||
|
||||
static inline int getsockopt(int socket, optstruct* opt)
|
||||
{
|
||||
int status;
|
||||
asm volatile(
|
||||
"int $0x40"
|
||||
:"=b"(err_code), "=a"(status)
|
||||
:"a"(75), "b"(9), "c"(socket),"d"(opt)
|
||||
);
|
||||
return status;
|
||||
}
|
||||
|
||||
static inline int socketpair(int *socket1, int *socket2)
|
||||
{
|
||||
asm volatile(
|
||||
"int $0x40"
|
||||
:"=b"(*socket2), "=a"(*socket1)
|
||||
:"a"(75), "b"(10)
|
||||
);
|
||||
err_code=*socket2;
|
||||
return *socket1;
|
||||
}
|
||||
#endif
|
@@ -10,6 +10,7 @@ extern "C" {
|
||||
#include <sys/cdefs.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/_timespec.h>
|
||||
#include <sys/ksys.h>
|
||||
|
||||
/* dj's stat defines _STAT_H_ */
|
||||
#ifndef _STAT_H_
|
||||
@@ -147,11 +148,12 @@ struct stat
|
||||
int _EXFUN(chmod,( const char *__path, mode_t __mode ));
|
||||
int _EXFUN(fchmod,(int __fd, mode_t __mode));
|
||||
int _EXFUN(fstat,( int __fd, struct stat *__sbuf ));
|
||||
int _EXFUN(mkdir,( const char *_path, mode_t __mode ));
|
||||
int _EXFUN(mkfifo,( const char *__path, mode_t __mode ));
|
||||
int _EXFUN(stat,( const char *__restrict __path, struct stat *__restrict __sbuf ));
|
||||
mode_t _EXFUN(umask,( mode_t __mask ));
|
||||
|
||||
#define mkdir(path, mode) _ksys_mkdir(path)
|
||||
|
||||
#if defined (__SPU__) || defined(__rtems__) || defined(__CYGWIN__) && !defined(__INSIDE_CYGWIN__)
|
||||
int _EXFUN(lstat,( const char *__restrict __path, struct stat *__restrict __buf ));
|
||||
int _EXFUN(mknod,( const char *__path, mode_t __mode, dev_t __dev ));
|
||||
|
Reference in New Issue
Block a user