Subversion Repositories Kolibri OS

Rev

Rev 611 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 611 Rev 647
Line 1... Line 1...
1
#ifndef stdio_h
1
#ifndef stdio_h
2
#define stdio_h
2
#define stdio_h
-
 
3
 
3
#include "mesys.h"
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
 
4
#define NULL ((void*)0)
12
#define NULL ((void*)0)
-
 
13
//extern int stdcall format_print(char *dest, size_t maxlen, const char *fmt0, va_list argp);
-
 
14
 
5
typedef struct {
15
typedef struct {
6
  char*   buffer;
16
  char*   buffer;
7
  dword   buffersize;
17
  dword   buffersize;
8
  dword   filesize;
18
  dword   filesize;
9
  dword   filepos;
19
  dword   filepos;
10
  char*   filename;
20
  char*   filename;
11
  int     mode;
21
  int     mode;
12
} FILE;
22
} FILE;
-
 
23
 
13
#define FILE_OPEN_READ 0
24
#define FILE_OPEN_READ 0
14
#define FILE_OPEN_WRITE 1
25
#define FILE_OPEN_WRITE 1
15
#define FILE_OPEN_APPEND 2
26
#define FILE_OPEN_APPEND 2
16
#define FILE_OPEN_TEXT 4
27
#define FILE_OPEN_TEXT 4
17
#define FILE_OPEN_PLUS 8
28
#define FILE_OPEN_PLUS 8
18
#define EOF -1
29
#define EOF -1
-
 
30
 
19
extern FILE* fopen(const char* filename, const char *mode);
31
extern FILE* fopen(const char* filename, const char *mode);
20
extern void fclose(FILE* file);
32
extern void fclose(FILE* file);
21
extern int feof(FILE* file);
33
extern int feof(FILE* file);
22
extern int fflush(FILE* file);
34
extern int fflush(FILE* file);
23
extern int fgetc(FILE* file);
35
extern int fgetc(FILE* file);
24
typedef int fpos_t;
-
 
25
extern int fgetpos(FILE* file,fpos_t* pos);
36
extern int fgetpos(FILE* file,fpos_t* pos);
26
extern int fsetpos(FILE* file,const fpos_t* pos);
37
extern int fsetpos(FILE* file,const fpos_t* pos);
27
extern int fputc(int c,FILE* file);
38
extern int fputc(int c,FILE* file);
28
extern int fread(void* buffer,int size,int count,FILE* file);
39
extern int fread(void* buffer,int size,int count,FILE* file);
29
extern int fwrite(void *buffer,int size,int count,FILE* file);
40
extern int fwrite(void *buffer,int size,int count,FILE* file);
Line 31... Line 42...
31
#define SEEK_CUR 0
42
#define SEEK_CUR 0
32
#define SEEK_END 1
43
#define SEEK_END 1
33
#define SEEK_SET 2
44
#define SEEK_SET 2
34
extern int fseek(FILE* file,long offset,int origin);
45
extern int fseek(FILE* file,long offset,int origin);
35
extern void rewind(FILE* file);
46
extern void rewind(FILE* file);
36
extern int fprintf(FILE* file, const char* format, ...);
47
extern int cdecl fprintf(FILE* file, const char* format,...);
37
extern int fscanf(FILE* file,const char* format, ...);
48
extern int fscanf(FILE* file,const char* format,...);
38
extern int ungetc(int c,FILE* file);
49
extern int ungetc(int c,FILE* file);
-
 
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
 
39
#endif
57
#endif