Added include files for libC.

git-svn-id: svn://kolibrios.org@611 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
andrew_programmer 2007-08-24 19:52:54 +00:00
parent e5c041df96
commit c38424c343
3 changed files with 35 additions and 20 deletions

View File

@ -1,24 +1,37 @@
#ifndef mesys_h
#define mesys_h
/*
#ifdef GNUC
#define stdcall __stdcall
#define cdecl __cdecl
#else
#define stdcall __attribute__ ((__stdcall))
#define cdecl __attribute__ ((__cdecl))
#define stdcall ((__stdcall))
#define cdecl ((__cdecl))
#endif
*/
//#ifdef GNUC
//#define stdcall __stdcall
//#else
#define stdcall __attribute__ (( ))
//#endif
typedef unsigned long dword;
typedef unsigned int dword;
typedef unsigned char byte;
typedef unsigned short word;
extern void stdcall _msys_draw_window(int xcoord,int ycoord, int xsize,
int ysize,int workcolor,int type,
int captioncolor,int windowtype,int bordercolor);
extern int stdcall _msys_read_file(char* filename,int fileoffset,int size,void* data,
int* filesize);
extern int stdcall _msys_write_file(char* filename,int fileoffset, int size, void* data);
extern int stdcall _msys_create_file(char* filename);
//-----------------------------------------------------------------------------------
//------------------------KolibriOS system acces to files----------------------------
//-----------------------------------------------------------------------------------
extern dword stdcall _ksys_get_filesize(char *filename);
extern dword stdcall _ksys_readfile(char *filename,dword pos,dword blocksize,void *data);
extern dword stdcall _ksys_rewritefile(char *filename,dword blocksize,void *data);
extern dword stdcall _ksys_appendtofile(char *filename,dword pos,dword blocksize,void *data);
//-----------------------------------------------------------------------------------
extern void stdcall _msys_run_program(char* filename,char* parameters);
extern void stdcall _msys_debug_out(int c);
extern void debug_out_str(char* str);
@ -100,9 +113,6 @@ extern void stdcall _msys_sound_speaker_play(void* data);
extern void stdcall _msys_write_text(int x,int y,int color,char* text,int len);
extern void* stdcall _msys_start_thread(void (* func_ptr)(void),int stack_size,int* pid);
extern void stdcall _msys_window_redraw(int status);
extern void* malloc(int);
extern void free(void*);
extern void* realloc(void*,int);
extern dword* stdcall _msys_cofflib_load(char* name);
extern char* stdcall _msys_cofflib_getproc(void* exp,char* sz_name);

View File

@ -4,9 +4,9 @@
#define NULL ((void*)0)
typedef struct {
char* buffer;
int buffersize;
int filesize;
int filepos;
dword buffersize;
dword filesize;
dword filepos;
char* filename;
int mode;
} FILE;
@ -17,7 +17,7 @@ typedef struct {
#define FILE_OPEN_PLUS 8
#define EOF -1
extern FILE* fopen(const char* filename, const char *mode);
extern int fclose(FILE* file);
extern void fclose(FILE* file);
extern int feof(FILE* file);
extern int fflush(FILE* file);
extern int fgetc(FILE* file);
@ -26,7 +26,7 @@ extern int fgetpos(FILE* file,fpos_t* pos);
extern int fsetpos(FILE* file,const fpos_t* pos);
extern int fputc(int c,FILE* file);
extern int fread(void* buffer,int size,int count,FILE* file);
extern int fwrite(const void* buffer,int size,int count,FILE* file);
extern int fwrite(void *buffer,int size,int count,FILE* file);
extern long ftell(FILE* file);
#define SEEK_CUR 0
#define SEEK_END 1

View File

@ -1,3 +1,4 @@
#include <mesys.h>
//#define isspace(c) ((c)==' ')
#define abs(i) (((i)<0)?(-(i)):(i))
@ -7,3 +8,7 @@ extern char tolower(char c);
extern char toupper(char c);
extern void itoab(int n,char* s,int b);
extern void itoa(int n,char* s);
extern void* malloc(dword size);
extern void free(void *pointer);
extern void* realloc(void* pointer,dword size);