Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1882 clevermous 1
/* Copyright (C) 1998 DJ Delorie, see COPYING.DJ for details */
2
/* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
3
 
4
#ifndef __dj_include_stdio_h_
5
#define __dj_include_stdio_h_
6
 
7
#ifdef __cplusplus
8
extern "C" {
9
#endif
10
 
11
#include
12
typedef struct __FILE FILE;
13
 
14
#ifndef __dj_ENFORCE_ANSI_FREESTANDING
15
 
16
 
17
#include 
18
#include 
19
#include 
20
 
21
#define _IOFBF    	00001
22
#define _IONBF    	00002
23
#define _IOLBF    	00004
24
 
25
/* Some programs think they know better... */
26
#undef NULL
27
 
28
#define BUFSIZ		16384
29
#define EOF		(-1)
30
#define FILENAME_MAX	260
31
#define FOPEN_MAX	20
32
#define L_tmpnam	260
33
#define NULL		0
34
#define TMP_MAX		999999
35
 
36
#define SEEK_SET	0
37
#define SEEK_CUR	1
38
#define SEEK_END	2
39
 
40
__DJ_va_list
41
#undef __DJ_va_list
42
#define __DJ_va_list
43
__DJ_size_t
44
#undef __DJ_size_t
45
#define __DJ_size_t
46
 
47
/* Note that the definitions of these fields are NOT guaranteed!  They
48
   may change with any release without notice!  The fact that they
49
   are here at all is to comply with ANSI specifictions. */
50
 
51
#include
52
 
53
struct __FILE {
54
  int   _cnt;
55
  char *_ptr;
56
  char *_base;
57
  int   _bufsiz;
58
  int   _flag;
59
  int   _file;
60
  char *_name_to_remove;
61
  int   _fillsize;
62
  struct file_stream_ops * std_ops;
63
};
64
 
65
typedef unsigned long		fpos_t;
66
 
67
extern FILE __dj_stdin, __dj_stdout, __dj_stderr;
68
#define stdin	(&__dj_stdin)
69
#define stdout	(&__dj_stdout)
70
#define stderr	(&__dj_stderr)
71
 
72
void	clearerr(FILE *_stream);
73
int	fclose(FILE *_stream);
74
int	feof(FILE *_stream);
75
int	ferror(FILE *_stream);
76
int	fflush(FILE *_stream);
77
int	fgetc(FILE *_stream);
78
int	fgetpos(FILE *_stream, fpos_t *_pos);
79
char *	fgets(char *_s, int _n, FILE *_stream);
80
FILE *	fopen(const char *_filename, const char *_mode);
81
int	fprintf(FILE *_stream, const char *_format, ...);
82
int	fputc(int _c, FILE *_stream);
83
int	fputs(const char *_s, FILE *_stream);
84
size_t	fread(void *_ptr, size_t _size, size_t _nelem, FILE *_stream);
85
FILE *	freopen(const char *_filename, const char *_mode, FILE *_stream);
86
int	fscanf(FILE *_stream, const char *_format, ...);
87
int	fseek(FILE *_stream, long _offset, int _mode);
88
int	fsetpos(FILE *_stream, const fpos_t *_pos);
89
long	ftell(FILE *_stream);
90
size_t	fwrite(const void *_ptr, size_t _size, size_t _nelem, FILE *_stream);
91
int	getc(FILE *_stream);
92
int	getchar(void);
93
char *	gets(char *_s);
94
void	perror(const char *_s);
95
int	printf(const char *_format, ...);
96
int	putc(int _c, FILE *_stream);
97
int	putchar(int _c);
98
int	puts(const char *_s);
99
int	remove(const char *_filename);
100
int	rename(const char *_old, const char *_new);
101
void	rewind(FILE *_stream);
102
int	scanf(const char *_format, ...);
103
void	setbuf(FILE *_stream, char *_buf);
104
int	setvbuf(FILE *_stream, char *_buf, int _mode, size_t _size);
105
int	sprintf(char *_s, const char *_format, ...);
106
int	sscanf(const char *_s, const char *_format, ...);
107
FILE *	tmpfile(void);
108
char *	tmpnam(char *_s);
109
int	ungetc(int _c, FILE *_stream);
110
int	vfprintf(FILE *_stream, const char *_format, va_list _ap);
111
int	vprintf(const char *_format, va_list _ap);
112
int	vsprintf(char *_s, const char *_format, va_list _ap);
113
 
114
#ifndef __STRICT_ANSI__
115
 
116
#define L_ctermid
117
#define L_cusrid
118
/* #define STREAM_MAX	20 - DOS can change this */
119
 
120
int	fileno(FILE *_stream);
121
FILE *	fdopen(int _fildes, const char *_type);
122
int	pclose(FILE *_pf);
123
FILE *	popen(const char *_command, const char *_mode);
124
 
125
#ifndef _POSIX_SOURCE
126
 
127
extern FILE __dj_stdprn, __dj_stdaux;
128
#define stdprn	(&__dj_stdprn)
129
#define stdaux	(&__dj_stdaux)
130
 
131
#define P_tmpdir "c:/"
132
 
133
void	_djstat_describe_lossage(FILE *_to_where);
134
int	_doprnt(const char *_fmt, va_list _args, FILE *_f);
135
int	_doscan(FILE *_f, const char *_fmt, va_list _argp);
136
int	_doscan_low(FILE *, int (*)(FILE *_get), int (*_unget)(int, FILE *), const char *_fmt, va_list _argp);
137
int	fpurge(FILE *_f);
138
int	getw(FILE *_f);
139
int	mkstemp(char *_template);
140
char *	mktemp(char *_template);
141
int	putw(int _v, FILE *_f);
142
void	setbuffer(FILE *_f, void *_buf, int _size);
143
void	setlinebuf(FILE *_f);
144
char *	tempnam(const char *_dir, const char *_prefix);
145
int	_rename(const char *_old, const char *_new);	/* Simple (no directory) */
146
int	vfscanf(FILE *_stream, const char *_format, va_list _ap);
147
int	vscanf(const char *_format, va_list _ap);
148
int	vsscanf(const char *_s, const char *_format, va_list _ap);
149
 
150
#endif /* !_POSIX_SOURCE */
151
#endif /* !__STRICT_ANSI__ */
152
#endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
153
 
154
#ifndef __dj_ENFORCE_FUNCTION_CALLS
155
#endif /* !__dj_ENFORCE_FUNCTION_CALLS */
156
 
157
#ifdef __cplusplus
158
}
159
#endif
160
 
161
#endif /* !__dj_include_stdio_h_ */