1#include <stdio.h>
2
3/* These emulate stdio functionality, but with a different name
4 (_IO_ungetc instead of ungetc), and using _IO_FILE instead of FILE. */
5
6#ifdef __cplusplus
7extern "C" {
8#endif
9
10extern int _IO_fclose (_IO_FILE*);
11extern int _IO_new_fclose (_IO_FILE*);
12extern int _IO_old_fclose (_IO_FILE*);
13extern _IO_FILE *_IO_fdopen (int, const char*) __THROW;
14libc_hidden_proto (_IO_fdopen)
15extern _IO_FILE *_IO_old_fdopen (int, const char*) __THROW;
16extern _IO_FILE *_IO_new_fdopen (int, const char*) __THROW;
17extern int _IO_fflush (_IO_FILE*);
18libc_hidden_proto (_IO_fflush)
19extern int _IO_fgetpos (_IO_FILE*, _IO_fpos_t*);
20extern int _IO_fgetpos64 (_IO_FILE*, _IO_fpos64_t*);
21extern char* _IO_fgets (char*, int, _IO_FILE*);
22extern _IO_FILE *_IO_fopen (const char*, const char*);
23extern _IO_FILE *_IO_old_fopen (const char*, const char*);
24extern _IO_FILE *_IO_new_fopen (const char*, const char*);
25extern _IO_FILE *_IO_fopen64 (const char*, const char*);
26extern _IO_FILE *__fopen_internal (const char*, const char*, int)
27 attribute_hidden;
28extern _IO_FILE *__fopen_maybe_mmap (_IO_FILE *) __THROW attribute_hidden;
29extern int _IO_fprintf (_IO_FILE*, const char*, ...);
30extern int _IO_fputs (const char*, _IO_FILE*);
31libc_hidden_proto (_IO_fputs)
32extern int _IO_fsetpos (_IO_FILE*, const _IO_fpos_t *);
33extern int _IO_fsetpos64 (_IO_FILE*, const _IO_fpos64_t *);
34extern long int _IO_ftell (_IO_FILE*);
35libc_hidden_proto (_IO_ftell)
36extern _IO_size_t _IO_fread (void*, _IO_size_t, _IO_size_t, _IO_FILE*);
37libc_hidden_proto (_IO_fread)
38extern _IO_size_t _IO_fwrite (const void*, _IO_size_t, _IO_size_t, _IO_FILE*);
39libc_hidden_proto (_IO_fwrite)
40extern char* _IO_gets (char*);
41extern void _IO_perror (const char*) __THROW;
42extern int _IO_printf (const char*, ...);
43extern int _IO_puts (const char*);
44extern int _IO_scanf (const char*, ...);
45extern void _IO_setbuffer (_IO_FILE *, char*, _IO_size_t) __THROW;
46libc_hidden_proto (_IO_setbuffer)
47extern int _IO_setvbuf (_IO_FILE*, char*, int, _IO_size_t) __THROW;
48libc_hidden_proto (_IO_setvbuf)
49extern int _IO_sscanf (const char*, const char*, ...) __THROW;
50extern int _IO_sprintf (char *, const char*, ...) __THROW;
51extern int _IO_ungetc (int, _IO_FILE*) __THROW;
52extern int _IO_vsscanf (const char *, const char *, _IO_va_list) __THROW;
53extern int _IO_vsprintf (char*, const char*, _IO_va_list) __THROW;
54libc_hidden_proto (_IO_vsprintf)
55extern int _IO_vswprintf (wchar_t*, _IO_size_t, const wchar_t*, _IO_va_list)
56 __THROW;
57
58struct obstack;
59extern int _IO_obstack_vprintf (struct obstack *, const char *, _IO_va_list)
60 __THROW;
61extern int _IO_obstack_printf (struct obstack *, const char *, ...) __THROW;
62#ifndef _IO_pos_BAD
63#define _IO_pos_BAD ((_IO_off64_t)(-1))
64#endif
65#define _IO_clearerr(FP) ((FP)->_flags &= ~(_IO_ERR_SEEN|_IO_EOF_SEEN))
66#define _IO_fseek(__fp, __offset, __whence) \
67 (_IO_seekoff_unlocked (__fp, __offset, __whence, _IOS_INPUT|_IOS_OUTPUT) \
68 == _IO_pos_BAD ? EOF : 0)
69#define _IO_rewind(FILE) \
70 (void) _IO_seekoff_unlocked (FILE, 0, 0, _IOS_INPUT|_IOS_OUTPUT)
71#define _IO_vprintf(FORMAT, ARGS) \
72 _IO_vfprintf (_IO_stdout, FORMAT, ARGS)
73#define _IO_freopen(FILENAME, MODE, FP) \
74 (_IO_file_close_it (FP), \
75 _IO_file_fopen (FP, FILENAME, MODE, 1))
76#define _IO_old_freopen(FILENAME, MODE, FP) \
77 (_IO_old_file_close_it (FP), _IO_old_file_fopen(FP, FILENAME, MODE))
78#define _IO_freopen64(FILENAME, MODE, FP) \
79 (_IO_file_close_it (FP), \
80 _IO_file_fopen (FP, FILENAME, MODE, 0))
81#define _IO_fileno(FP) ((FP)->_fileno)
82extern _IO_FILE* _IO_popen (const char*, const char*) __THROW;
83extern _IO_FILE* _IO_new_popen (const char*, const char*) __THROW;
84extern _IO_FILE* _IO_old_popen (const char*, const char*) __THROW;
85extern int __new_pclose (_IO_FILE *) __THROW;
86extern int __old_pclose (_IO_FILE *) __THROW;
87#define _IO_pclose _IO_fclose
88#define _IO_setbuf(_FP, _BUF) _IO_setbuffer (_FP, _BUF, _IO_BUFSIZ)
89#define _IO_setlinebuf(_FP) _IO_setvbuf (_FP, NULL, 1, 0)
90
91_IO_FILE *__new_freopen (const char *, const char *, _IO_FILE *) __THROW;
92_IO_FILE *__old_freopen (const char *, const char *, _IO_FILE *) __THROW;
93
94#ifdef __cplusplus
95}
96#endif
97