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 #ifndef mesys_h
#define mesys_h #define mesys_h
/*
#ifdef GNUC #ifdef GNUC
#define stdcall __stdcall #define stdcall __stdcall
#define cdecl __cdecl #define cdecl __cdecl
#else #else
#define stdcall __attribute__ ((__stdcall)) #define stdcall ((__stdcall))
#define cdecl __attribute__ ((__cdecl)) #define cdecl ((__cdecl))
#endif #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 char byte;
typedef unsigned short word; typedef unsigned short word;
extern void stdcall _msys_draw_window(int xcoord,int ycoord, int xsize, extern void stdcall _msys_draw_window(int xcoord,int ycoord, int xsize,
int ysize,int workcolor,int type, int ysize,int workcolor,int type,
int captioncolor,int windowtype,int bordercolor); 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); //------------------------KolibriOS system acces to files----------------------------
extern int stdcall _msys_create_file(char* filename); //-----------------------------------------------------------------------------------
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_run_program(char* filename,char* parameters);
extern void stdcall _msys_debug_out(int c); extern void stdcall _msys_debug_out(int c);
extern void debug_out_str(char* str); 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_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_start_thread(void (* func_ptr)(void),int stack_size,int* pid);
extern void stdcall _msys_window_redraw(int status); 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 dword* stdcall _msys_cofflib_load(char* name);
extern char* stdcall _msys_cofflib_getproc(void* exp,char* sz_name); extern char* stdcall _msys_cofflib_getproc(void* exp,char* sz_name);

View File

@ -3,12 +3,12 @@
#include "mesys.h" #include "mesys.h"
#define NULL ((void*)0) #define NULL ((void*)0)
typedef struct { typedef struct {
char* buffer; char* buffer;
int buffersize; dword buffersize;
int filesize; dword filesize;
int filepos; dword filepos;
char* filename; char* filename;
int mode; int mode;
} FILE; } FILE;
#define FILE_OPEN_READ 0 #define FILE_OPEN_READ 0
#define FILE_OPEN_WRITE 1 #define FILE_OPEN_WRITE 1
@ -17,7 +17,7 @@ typedef struct {
#define FILE_OPEN_PLUS 8 #define FILE_OPEN_PLUS 8
#define EOF -1 #define EOF -1
extern FILE* fopen(const char* filename, const char *mode); 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 feof(FILE* file);
extern int fflush(FILE* file); extern int fflush(FILE* file);
extern int fgetc(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 fsetpos(FILE* file,const fpos_t* pos);
extern int fputc(int c,FILE* file); extern int fputc(int c,FILE* file);
extern int fread(void* buffer,int size,int count,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); extern long ftell(FILE* file);
#define SEEK_CUR 0 #define SEEK_CUR 0
#define SEEK_END 1 #define SEEK_END 1

View File

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