Rev 611 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
145 | halyavin | 1 | #ifndef stdio_h |
2 | #define stdio_h |
||
647 | andrew_pro | 3 | |
4 | #include "kolibrisys.h" |
||
5 | |||
6 | typedef char *va_list; |
||
7 | #define _roundsize(n) ( (sizeof(n) + 3) & ~3 ) |
||
8 | #define va_start(ap,v) (ap = (va_list)&v+_roundsize(v)) |
||
9 | #define va_arg(ap,t) ( *(t *)((ap += _roundsize(t)) - _roundsize(t)) ) |
||
10 | #define va_end(ap) (ap = (va_list)0) |
||
11 | |||
560 | victor | 12 | #define NULL ((void*)0) |
647 | andrew_pro | 13 | //extern int stdcall format_print(char *dest, size_t maxlen, const char *fmt0, va_list argp); |
14 | |||
145 | halyavin | 15 | typedef struct { |
611 | andrew_pro | 16 | char* buffer; |
17 | dword buffersize; |
||
18 | dword filesize; |
||
19 | dword filepos; |
||
20 | char* filename; |
||
21 | int mode; |
||
145 | halyavin | 22 | } FILE; |
647 | andrew_pro | 23 | |
145 | halyavin | 24 | #define FILE_OPEN_READ 0 |
25 | #define FILE_OPEN_WRITE 1 |
||
26 | #define FILE_OPEN_APPEND 2 |
||
27 | #define FILE_OPEN_TEXT 4 |
||
28 | #define FILE_OPEN_PLUS 8 |
||
29 | #define EOF -1 |
||
647 | andrew_pro | 30 | |
145 | halyavin | 31 | extern FILE* fopen(const char* filename, const char *mode); |
611 | andrew_pro | 32 | extern void fclose(FILE* file); |
145 | halyavin | 33 | extern int feof(FILE* file); |
34 | extern int fflush(FILE* file); |
||
35 | extern int fgetc(FILE* file); |
||
36 | extern int fgetpos(FILE* file,fpos_t* pos); |
||
37 | extern int fsetpos(FILE* file,const fpos_t* pos); |
||
38 | extern int fputc(int c,FILE* file); |
||
39 | extern int fread(void* buffer,int size,int count,FILE* file); |
||
611 | andrew_pro | 40 | extern int fwrite(void *buffer,int size,int count,FILE* file); |
145 | halyavin | 41 | extern long ftell(FILE* file); |
42 | #define SEEK_CUR 0 |
||
43 | #define SEEK_END 1 |
||
44 | #define SEEK_SET 2 |
||
45 | extern int fseek(FILE* file,long offset,int origin); |
||
46 | extern void rewind(FILE* file); |
||
647 | andrew_pro | 47 | extern int cdecl fprintf(FILE* file, const char* format,...); |
48 | extern int fscanf(FILE* file,const char* format,...); |
||
145 | halyavin | 49 | extern int ungetc(int c,FILE* file); |
647 | andrew_pro | 50 | |
51 | extern int cdecl printf(const char *format,...); |
||
52 | |||
53 | extern int vsnprintf(char *dest, size_t size,const char *format,va_list ap); |
||
54 | extern int cdecl snprintf(char *dest, size_t size, const char *format,...); |
||
55 | extern int cdecl sprintf(char *dest,const char *format,...); |
||
56 | |||
145 | halyavin | 57 | #endif |