1da2e3ebchin/***********************************************************************
2da2e3ebchin*                                                                      *
3da2e3ebchin*               This software is part of the ast package               *
43e14f97Roger A. Faulkner*          Copyright (c) 1985-2010 AT&T Intellectual Property          *
5da2e3ebchin*                      and is licensed under the                       *
6da2e3ebchin*                  Common Public License, Version 1.0                  *
77c2fbfbApril Chin*                    by AT&T Intellectual Property                     *
8da2e3ebchin*                                                                      *
9da2e3ebchin*                A copy of the License is available at                 *
10da2e3ebchin*            http://www.opensource.org/licenses/cpl1.0.txt             *
11da2e3ebchin*         (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9)         *
12da2e3ebchin*                                                                      *
13da2e3ebchin*              Information and Software Systems Research               *
14da2e3ebchin*                            AT&T Research                             *
15da2e3ebchin*                           Florham Park NJ                            *
16da2e3ebchin*                                                                      *
17da2e3ebchin*                 Glenn Fowler <gsf@research.att.com>                  *
18da2e3ebchin*                  David Korn <dgk@research.att.com>                   *
19da2e3ebchin*                   Phong Vo <kpv@research.att.com>                    *
20da2e3ebchin*                                                                      *
21da2e3ebchin***********************************************************************/
22da2e3ebchin
23da2e3ebchin/* : : generated by proto : : */
243e14f97Roger A. Faulkner/* : : generated from /home/gisburn/ksh93/ast_ksh_20100309/build_sparc_32bit/src/lib/libast/features/stdio by iffe version 2009-12-04 : : */
25da2e3ebchin
26da2e3ebchin#ifndef _SFSTDIO_H
27da2e3ebchin#if !defined(__PROTO__)
28da2e3ebchin#  if defined(__STDC__) || defined(__cplusplus) || defined(_proto) || defined(c_plusplus)
29da2e3ebchin#    if defined(__cplusplus)
30da2e3ebchin#      define __LINKAGE__	"C"
31da2e3ebchin#    else
32da2e3ebchin#      define __LINKAGE__
33da2e3ebchin#    endif
34da2e3ebchin#    define __STDARG__
35da2e3ebchin#    define __PROTO__(x)	x
36da2e3ebchin#    define __OTORP__(x)
37da2e3ebchin#    define __PARAM__(n,o)	n
38da2e3ebchin#    if !defined(__STDC__) && !defined(__cplusplus)
39da2e3ebchin#      if !defined(c_plusplus)
40da2e3ebchin#      	define const
41da2e3ebchin#      endif
42da2e3ebchin#      define signed
43da2e3ebchin#      define void		int
44da2e3ebchin#      define volatile
45da2e3ebchin#      define __V_		char
46da2e3ebchin#    else
47da2e3ebchin#      define __V_		void
48da2e3ebchin#    endif
49da2e3ebchin#  else
50da2e3ebchin#    define __PROTO__(x)	()
51da2e3ebchin#    define __OTORP__(x)	x
52da2e3ebchin#    define __PARAM__(n,o)	o
53da2e3ebchin#    define __LINKAGE__
54da2e3ebchin#    define __V_		char
55da2e3ebchin#    define const
56da2e3ebchin#    define signed
57da2e3ebchin#    define void		int
58da2e3ebchin#    define volatile
59da2e3ebchin#  endif
60da2e3ebchin#  define __MANGLE__	__LINKAGE__
61da2e3ebchin#  if defined(__cplusplus) || defined(c_plusplus)
62da2e3ebchin#    define __VARARG__	...
63da2e3ebchin#  else
64da2e3ebchin#    define __VARARG__
65da2e3ebchin#  endif
66da2e3ebchin#  if defined(__STDARG__)
67da2e3ebchin#    define __VA_START__(p,a)	va_start(p,a)
68da2e3ebchin#  else
69da2e3ebchin#    define __VA_START__(p,a)	va_start(p)
70da2e3ebchin#  endif
71da2e3ebchin#  if !defined(__INLINE__)
72da2e3ebchin#    if defined(__cplusplus)
73da2e3ebchin#      define __INLINE__	extern __MANGLE__ inline
74da2e3ebchin#    else
75da2e3ebchin#      if defined(_WIN32) && !defined(__GNUC__)
76da2e3ebchin#      	define __INLINE__	__inline
77da2e3ebchin#      endif
78da2e3ebchin#    endif
79da2e3ebchin#  endif
80da2e3ebchin#endif
81da2e3ebchin#if !defined(__LINKAGE__)
82da2e3ebchin#define __LINKAGE__		/* 2004-08-11 transition */
83da2e3ebchin#endif
84da2e3ebchin
85da2e3ebchin#define _SFSTDIO_H	1
86da2e3ebchin#define _sys_types	1	/* #include <sys/types.h> ok */
87da2e3ebchin#define __FILE_typedef	1
88da2e3ebchin#define _FILE_DEFINED	1
89da2e3ebchin#define _FILE_defined	1
90da2e3ebchin#define _FILEDEFED	1
91da2e3ebchin
92da2e3ebchin#ifndef __FILE_TAG
93da2e3ebchin#define __FILE_TAG	_sfio_s
94da2e3ebchin#endif
95da2e3ebchin
96da2e3ebchin#undef	FILE
97da2e3ebchin#undef	_FILE
98da2e3ebchin#undef	fpos_t
99da2e3ebchin#undef	fpos64_t
100da2e3ebchin
101da2e3ebchintypedef struct _sfio_s _sfio_FILE;
102da2e3ebchin
103da2e3ebchin#define FILE		_sfio_FILE
104da2e3ebchin#define _FILE		FILE
105da2e3ebchin
106da2e3ebchin#if !defined(__FILE) && !__CYGWIN__
107da2e3ebchin#undef	__FILE
108da2e3ebchin#define __FILE		FILE
109da2e3ebchin#endif
110da2e3ebchin
111da2e3ebchin#if defined(_AST_H) || defined(_SFIO_H)
112da2e3ebchin
113da2e3ebchin#define BUFSIZ		SF_BUFSIZE
114da2e3ebchin
115da2e3ebchin#else
116da2e3ebchin
117da2e3ebchin#ifndef BUFSIZ
118da2e3ebchin#define BUFSIZ		8192
119da2e3ebchin#endif
120da2e3ebchin
121da2e3ebchin#ifndef EOF
122da2e3ebchin#define EOF		(-1)
123da2e3ebchin#endif
124da2e3ebchin
125da2e3ebchin#ifndef NULL
126da2e3ebchin#define NULL		0
127da2e3ebchin#endif
128da2e3ebchin
129da2e3ebchin#ifndef SEEK_SET
130da2e3ebchin#define SEEK_SET	0
131da2e3ebchin#define SEEK_CUR	1
132da2e3ebchin#define SEEK_END	2
133da2e3ebchin#endif
134da2e3ebchin
135da2e3ebchin#include <ast_std.h>
136da2e3ebchin
137da2e3ebchin#include <sfio_s.h>
138da2e3ebchin
139da2e3ebchin#if __cplusplus
140da2e3ebchin#define _sf_(f)		(f)
141da2e3ebchin#else
142da2e3ebchin#define _sf_(f)		((struct _sfio_s*)(f))
143da2e3ebchin#endif
144da2e3ebchin
145da2e3ebchin#define _SF_EOF		0000200
146da2e3ebchin#define _SF_ERROR	0000400
147da2e3ebchin
148da2e3ebchin#endif
149da2e3ebchin
150da2e3ebchin#ifdef _NO_LARGEFILE64_SOURCE
151da2e3ebchin#undef _LARGEFILE64_SOURCE
152da2e3ebchin#endif
153da2e3ebchin
154da2e3ebchin#ifdef _LARGEFILE64_SOURCE
155da2e3ebchin#undef	off_t
156da2e3ebchin#endif
157da2e3ebchin
158da2e3ebchin#define fpos_t		_ast_fpos_t
159da2e3ebchin#if _typ_int64_t
160da2e3ebchin#define fpos64_t	_ast_fpos_t
161da2e3ebchin#endif
162da2e3ebchin
163da2e3ebchintypedef struct _ast_fpos_s
164da2e3ebchin{
165da2e3ebchin	intmax_t	_sf_offset;
166da2e3ebchin	unsigned char	_sf_state[64 - sizeof(intmax_t)];
167da2e3ebchin} _ast_fpos_t;
168da2e3ebchin
169da2e3ebchin#define _base		_data
170da2e3ebchin#define _ptr		_next
171da2e3ebchin#define _IOFBF		0
172da2e3ebchin#define _IONBF		1
173da2e3ebchin#define _IOLBF		2
174da2e3ebchin
175da2e3ebchin#if defined(__cplusplus) && defined(__THROW) && !defined(_UWIN)
176da2e3ebchin
177da2e3ebchin#undef	FILE
178da2e3ebchin#define FILE            FILE
179da2e3ebchintypedef struct _sfio_s FILE;
180da2e3ebchin
181da2e3ebchin#undef	strerror
182da2e3ebchinextern __MANGLE__ char*	strerror(int) __THROW;
183da2e3ebchin
184da2e3ebchinextern __MANGLE__ int	_doprnt __PROTO__((const char*, va_list, FILE*));
185da2e3ebchinextern __MANGLE__ int	_doscan __PROTO__((FILE*, const char*, va_list));
186da2e3ebchinextern __MANGLE__ int	asprintf __PROTO__((char**, const char*, ...));
187da2e3ebchinextern __MANGLE__ int	clearerr __PROTO__((FILE*));
188da2e3ebchinextern __MANGLE__ int	fclose __PROTO__((FILE*));
189da2e3ebchinextern __MANGLE__ FILE*	fdopen __PROTO__((int, const char*));
190da2e3ebchinextern __MANGLE__ int	feof __PROTO__((FILE*));
191da2e3ebchinextern __MANGLE__ int	ferror __PROTO__((FILE*));
192da2e3ebchinextern __MANGLE__ int	fflush __PROTO__((FILE*));
193da2e3ebchinextern __MANGLE__ int	fgetc __PROTO__((FILE*));
194da2e3ebchinextern __MANGLE__ int	fgetpos __PROTO__((FILE*, fpos_t*));
195da2e3ebchinextern __MANGLE__ char*	fgets __PROTO__((char*, int, FILE*));
196da2e3ebchinextern __MANGLE__ int	fileno __PROTO__((FILE*));
197da2e3ebchinextern __MANGLE__ FILE*	fopen __PROTO__((const char*, const char*));
198da2e3ebchinextern __MANGLE__ int	fprintf __PROTO__((FILE*, const char*, ...));
199da2e3ebchinextern __MANGLE__ int	fpurge __PROTO__((FILE*));
200da2e3ebchinextern __MANGLE__ int	fputc __PROTO__((int, FILE*));
201da2e3ebchinextern __MANGLE__ int	fputs __PROTO__((const char*, FILE*));
2027c2fbfbApril Chinextern __MANGLE__ size_t	fread __PROTO__((__V_*, size_t, size_t, FILE*));
203da2e3ebchinextern __MANGLE__ FILE*	freopen __PROTO__((const char*, const char*, FILE*));
204da2e3ebchinextern __MANGLE__ int	fscanf __PROTO__((FILE*, const char*, ...));
205da2e3ebchinextern __MANGLE__ int	fseek __PROTO__((FILE*, long, int));
206da2e3ebchinextern __MANGLE__ int	fseeko __PROTO__((FILE*, off_t, int));
207da2e3ebchinextern __MANGLE__ int	fsetpos __PROTO__((FILE*, const fpos_t*));
208da2e3ebchinextern __MANGLE__ long	ftell __PROTO__((FILE*));
209da2e3ebchinextern __MANGLE__ off_t	ftello __PROTO__((FILE*));
2107c2fbfbApril Chinextern __MANGLE__ size_t	fwrite __PROTO__((const __V_*, size_t, size_t, FILE*));
211da2e3ebchinextern __MANGLE__ int	getc __PROTO__((FILE*));
212da2e3ebchinextern __MANGLE__ int	getchar __PROTO__((void));
213da2e3ebchinextern __MANGLE__ char*	gets __PROTO__((char*));
214da2e3ebchinextern __MANGLE__ int	getw __PROTO__((FILE*));
215da2e3ebchinextern __MANGLE__ int	pclose __PROTO__((FILE*));
216da2e3ebchinextern __MANGLE__ FILE*	popen __PROTO__((const char*, const char*));
217da2e3ebchinextern __MANGLE__ int	printf __PROTO__((const char*, ...));
218da2e3ebchinextern __MANGLE__ int	putc __PROTO__((int, FILE*));
219da2e3ebchinextern __MANGLE__ int	putchar __PROTO__((int));
220da2e3ebchinextern __MANGLE__ int	puts __PROTO__((const char*));
221da2e3ebchinextern __MANGLE__ int	putw __PROTO__((int, FILE*));
222da2e3ebchinextern __MANGLE__ void	rewind __PROTO__((FILE*));
223da2e3ebchinextern __MANGLE__ int	scanf __PROTO__((const char*, ...));
224da2e3ebchinextern __MANGLE__ void	setbuf __PROTO__((FILE*, char*));
225da2e3ebchinextern __MANGLE__ int	setbuffer __PROTO__((FILE*, char*, int));
226da2e3ebchinextern __MANGLE__ int	setlinebuf __PROTO__((FILE*));
227da2e3ebchinextern __MANGLE__ int	setvbuf __PROTO__((FILE*, char*, int, size_t));
228da2e3ebchinextern __MANGLE__ int	snprintf __PROTO__((char*, int, const char*, ...));
229da2e3ebchinextern __MANGLE__ int	sprintf __PROTO__((char*, const char*, ...));
230da2e3ebchinextern __MANGLE__ int	sscanf __PROTO__((const char*, const char*, ...));
231da2e3ebchinextern __MANGLE__ FILE*	tmpfile __PROTO__((void));
232da2e3ebchinextern __MANGLE__ int	ungetc __PROTO__((int, FILE*));
233da2e3ebchinextern __MANGLE__ int	vasprintf __PROTO__((char**, const char*, va_list));
234da2e3ebchinextern __MANGLE__ int	vfprintf __PROTO__((FILE*, const char*, va_list));
235da2e3ebchinextern __MANGLE__ int	vfscanf __PROTO__((FILE*, const char*, va_list));
236da2e3ebchinextern __MANGLE__ int	vprintf __PROTO__((const char*, va_list));
237da2e3ebchinextern __MANGLE__ int	vscanf __PROTO__((const char*, va_list));
238da2e3ebchinextern __MANGLE__ int	vsnprintf __PROTO__((char*, int, const char*, va_list));
239da2e3ebchinextern __MANGLE__ int	vsprintf __PROTO__((char*, const char*, va_list));
240da2e3ebchinextern __MANGLE__ int	vsscanf __PROTO__((const char*, const char*, va_list));
241da2e3ebchin
242da2e3ebchin#if _typ_int64_t
243da2e3ebchin
244da2e3ebchinextern __MANGLE__ int		fgetpos64 __PROTO__((FILE*, fpos64_t*));
245da2e3ebchinextern __MANGLE__ int		fsetpos64 __PROTO__((FILE*, const fpos64_t*));
246da2e3ebchinextern __MANGLE__ int		fseek64 __PROTO__((FILE*, int64_t, int));
247da2e3ebchinextern __MANGLE__ int		fseeko64 __PROTO__((FILE*, int64_t, int));
248da2e3ebchinextern __MANGLE__ int64_t		ftell64 __PROTO__((FILE*));
249da2e3ebchinextern __MANGLE__ int64_t		ftello64 __PROTO__((FILE*));
250da2e3ebchin
251da2e3ebchin#endif
252da2e3ebchin
253da2e3ebchinextern __MANGLE__ void	clearerr_unlocked __PROTO__((FILE*));
254da2e3ebchinextern __MANGLE__ int	feof_unlocked __PROTO__((FILE*));
255da2e3ebchinextern __MANGLE__ int	ferror_unlocked __PROTO__((FILE*));
256da2e3ebchinextern __MANGLE__ int	fflush_unlocked __PROTO__((FILE*));
257da2e3ebchinextern __MANGLE__ int	fgetc_unlocked __PROTO__((FILE*));
258da2e3ebchinextern __MANGLE__ char*	fgets_unlocked __PROTO__((char*, int, FILE*));
259da2e3ebchinextern __MANGLE__ int	fileno_unlocked __PROTO__((FILE*));
260da2e3ebchinextern __MANGLE__ int	fputc_unlocked __PROTO__((int, FILE*));
261da2e3ebchinextern __MANGLE__ int	fputs_unlocked __PROTO__((char*, FILE*));
262da2e3ebchinextern __MANGLE__ size_t	fread_unlocked __PROTO__((__V_*, size_t, size_t, FILE*));
263da2e3ebchinextern __MANGLE__ size_t	fwrite_unlocked __PROTO__((__V_*, size_t, size_t, FILE*));
264da2e3ebchinextern __MANGLE__ int	getc_unlocked __PROTO__((FILE*));
265da2e3ebchinextern __MANGLE__ int	getchar_unlocked __PROTO__((void));
266da2e3ebchinextern __MANGLE__ int	putc_unlocked __PROTO__((int, FILE*));
267da2e3ebchinextern __MANGLE__ int	putchar_unlocked __PROTO__((int));
268da2e3ebchin
2697c2fbfbApril Chinextern __MANGLE__ void	flockfile __PROTO__((FILE*));
2707c2fbfbApril Chinextern __MANGLE__ int	ftrylockfile __PROTO__((FILE*));
2717c2fbfbApril Chinextern __MANGLE__ void	funlockfile __PROTO__((FILE*));
2727c2fbfbApril Chin
273da2e3ebchin#ifdef _USE_GNU
274da2e3ebchin
275da2e3ebchinextern __MANGLE__ int	fcloseall __PROTO__((void));
276da2e3ebchinextern __MANGLE__ FILE*	fmemopen __PROTO__((__V_*, size_t, const char*));
277da2e3ebchinextern __MANGLE__ ssize_t	__getdelim __PROTO__((char**, size_t*, int, FILE*));
278da2e3ebchinextern __MANGLE__ ssize_t	getdelim __PROTO__((char**, size_t*, int, FILE*));
279da2e3ebchinextern __MANGLE__ ssize_t	getline __PROTO__((char**, size_t*, FILE*));
280da2e3ebchin
281da2e3ebchin#endif
282da2e3ebchin
283da2e3ebchin#endif
284da2e3ebchin
285da2e3ebchin#ifndef FILENAME_MAX
286da2e3ebchin#define FILENAME_MAX	1024
287da2e3ebchin#endif
288da2e3ebchin#ifndef FOPEN_MAX
289da2e3ebchin#define FOPEN_MAX	20
290da2e3ebchin#endif
291da2e3ebchin#ifndef TMP_MAX
292da2e3ebchin#define TMP_MAX		17576
293da2e3ebchin#endif
294da2e3ebchin
295da2e3ebchin#define _doprnt		_ast_doprnt
296da2e3ebchin#define _doscan		_ast_doscan
297da2e3ebchin#define asprintf	_ast_asprintf
298da2e3ebchin#define clearerr	_ast_clearerr
299da2e3ebchin#define fclose		_ast_fclose
300da2e3ebchin#define fdopen		_ast_fdopen
301da2e3ebchin#define fflush		_ast_fflush
302da2e3ebchin#define fgetc		_ast_fgetc
303da2e3ebchin#define fgetpos		_ast_fgetpos
304da2e3ebchin#define fgetpos64	_ast_fgetpos64
305da2e3ebchin#define fgets		_ast_fgets
306da2e3ebchin#define fopen		_ast_fopen
307da2e3ebchin#define fprintf		_ast_fprintf
308da2e3ebchin#define fpurge		_ast_fpurge
309da2e3ebchin#define fputs		_ast_fputs
310da2e3ebchin#define fread		_ast_fread
311da2e3ebchin#define freopen		_ast_freopen
312da2e3ebchin#define fscanf		_ast_fscanf
313da2e3ebchin#define fseek		_ast_fseek
314da2e3ebchin#define fseek64		_ast_fseek64
315da2e3ebchin#define fseeko		_ast_fseeko
316da2e3ebchin#define fseeko64	_ast_fseeko64
317da2e3ebchin#define fsetpos		_ast_fsetpos
318da2e3ebchin#define fsetpos64	_ast_fsetpos64
319da2e3ebchin#define ftell		_ast_ftell
320da2e3ebchin#define ftell64		_ast_ftell64
321da2e3ebchin#define ftello		_ast_ftello
322da2e3ebchin#define ftello64	_ast_ftello64
323da2e3ebchin#define fwrite		_ast_fwrite
324da2e3ebchin#define gets		_ast_gets
325da2e3ebchin#define getw		_ast_getw
326da2e3ebchin#define pclose		_ast_pclose
327da2e3ebchin#define popen		_ast_popen
328da2e3ebchin#define printf		_ast_printf
329da2e3ebchin#define puts		_ast_puts
330da2e3ebchin#define putw		_ast_putw
331da2e3ebchin#define rewind		_ast_rewind
332da2e3ebchin#define scanf		_ast_scanf
333da2e3ebchin#define setbuf		_ast_setbuf
334da2e3ebchin#undef	setbuffer
335da2e3ebchin#define setbuffer	_ast_setbuffer
336da2e3ebchin#define setlinebuf	_ast_setlinebuf
337da2e3ebchin#define setvbuf		_ast_setvbuf
338da2e3ebchin#define snprintf	_ast_snprintf
339da2e3ebchin#define sprintf		_ast_sprintf
340da2e3ebchin#define sscanf		_ast_sscanf
341da2e3ebchin#define tmpfile		_ast_tmpfile
342da2e3ebchin#define ungetc		_ast_ungetc
343da2e3ebchin#define vasprintf	_ast_vasprintf
344da2e3ebchin#define vfprintf	_ast_vfprintf
345da2e3ebchin#define vfscanf		_ast_vfscanf
346da2e3ebchin#define vprintf		_ast_vprintf
347da2e3ebchin#define vscanf		_ast_vscanf
348da2e3ebchin#define vsnprintf	_ast_vsnprintf
349da2e3ebchin#define vsprintf	_ast_vsprintf
350da2e3ebchin#define vsscanf		_ast_vsscanf
351da2e3ebchin#define fcloseall	_ast_fcloseall
3527c2fbfbApril Chin#define _filbuf		_ast__filbuf
353da2e3ebchin#define fmemopen	_ast_fmemopen
354da2e3ebchin#define __getdelim	_ast___getdelim
355da2e3ebchin#define getdelim	_ast_getdelim
356da2e3ebchin#define getline		_ast_getline
357da2e3ebchin#define clearerr_unlocked _ast_clearerr_unlocked
358da2e3ebchin#define feof_unlocked	_ast_feof_unlocked
359da2e3ebchin#define ferror_unlocked	_ast_ferror_unlocked
360da2e3ebchin#define fflush_unlocked	_ast_fflush_unlocked
361da2e3ebchin#define fgetc_unlocked	_ast_fgetc_unlocked
362da2e3ebchin#define fgets_unlocked	_ast_fgets_unlocked
363da2e3ebchin#define fileno_unlocked	_ast_fileno_unlocked
364da2e3ebchin#define fputc_unlocked	_ast_fputc_unlocked
365da2e3ebchin#define fputs_unlocked	_ast_fputs_unlocked
366da2e3ebchin#define fread_unlocked	_ast_fread_unlocked
367da2e3ebchin#define fwrite_unlocked	_ast_fwrite_unlocked
368da2e3ebchin#define getc_unlocked	_ast_getc_unlocked
369da2e3ebchin#define getchar_unlocked _ast_getchar_unlocked
370da2e3ebchin#define putc_unlocked	_ast_putc_unlocked
371da2e3ebchin#define putchar_unlocked _ast_putchar_unlocked
3727c2fbfbApril Chin#define flockfile	_ast_flockfile
3737c2fbfbApril Chin#define ftrylockfile	_ast_ftrylockfile
3747c2fbfbApril Chin#define funlockfile	_ast_funlockfile
375da2e3ebchin
376da2e3ebchin#if defined(__STDPP__directive) && defined(__STDPP__initial)
377da2e3ebchin__STDPP__directive pragma pp:initial
378da2e3ebchin#endif
379da2e3ebchin#ifndef P_tmpdir
380da2e3ebchin#define P_tmpdir  "/var/tmp/" /*NOCATLITERAL*/
381da2e3ebchin#endif
382da2e3ebchin#ifndef L_ctermid
383da2e3ebchin#define L_ctermid  9
384da2e3ebchin#endif
385da2e3ebchin#ifndef L_tmpnam
386da2e3ebchin#define L_tmpnam  25
387da2e3ebchin#endif
388da2e3ebchin#if defined(__STDPP__directive) && defined(__STDPP__initial)
389da2e3ebchin__STDPP__directive pragma pp:noinitial
390da2e3ebchin#endif
391da2e3ebchin#if defined(__cplusplus) && defined(__THROW)
392da2e3ebchinextern __MANGLE__ char*	ctermid(char*) __THROW;
393da2e3ebchin#else
394da2e3ebchinextern __MANGLE__ char*	ctermid __PROTO__((char*));
395da2e3ebchin#endif
396da2e3ebchinextern __MANGLE__ char*	tmpnam __PROTO__((char*));
397da2e3ebchinextern __MANGLE__ char*	tempnam __PROTO__((const char*, const char*));
398da2e3ebchinextern __MANGLE__ void	perror __PROTO__((const char*));
399da2e3ebchin#ifndef _AST_STD_H
400da2e3ebchin#ifndef remove
401da2e3ebchinextern __MANGLE__ int	remove __PROTO__((const char*));
402da2e3ebchin#endif
403da2e3ebchin#ifndef rename
404da2e3ebchinextern __MANGLE__ int	rename __PROTO__((const char*, const char*));
405da2e3ebchin#endif
406da2e3ebchin#endif
407da2e3ebchin
408da2e3ebchin#undef __MANGLE__
409da2e3ebchin#define __MANGLE__ __LINKAGE__
410da2e3ebchin
411da2e3ebchin#if _BLD_ast && defined(__EXPORT__)
412da2e3ebchin#undef __MANGLE__
413da2e3ebchin#define __MANGLE__ __LINKAGE__		__EXPORT__
414da2e3ebchin#endif
415da2e3ebchin
416da2e3ebchinextern __MANGLE__ int	_doprnt __PROTO__((const char*, va_list, FILE*));
417da2e3ebchinextern __MANGLE__ int	_doscan __PROTO__((FILE*, const char*, va_list));
418da2e3ebchinextern __MANGLE__ int	asprintf __PROTO__((char**, const char*, ...));
419da2e3ebchinextern __MANGLE__ int	clearerr __PROTO__((FILE*));
420da2e3ebchinextern __MANGLE__ int	fclose __PROTO__((FILE*));
421da2e3ebchinextern __MANGLE__ FILE*	fdopen __PROTO__((int, const char*));
422da2e3ebchinextern __MANGLE__ int	feof __PROTO__((FILE*));
423da2e3ebchinextern __MANGLE__ int	ferror __PROTO__((FILE*));
424da2e3ebchinextern __MANGLE__ int	fflush __PROTO__((FILE*));
425da2e3ebchinextern __MANGLE__ int	fgetc __PROTO__((FILE*));
426da2e3ebchinextern __MANGLE__ int	fgetpos __PROTO__((FILE*, fpos_t*));
427da2e3ebchinextern __MANGLE__ char*	fgets __PROTO__((char*, int, FILE*));
428da2e3ebchinextern __MANGLE__ int	fileno __PROTO__((FILE*));
429da2e3ebchinextern __MANGLE__ FILE*	fopen __PROTO__((const char*, const char*));
430da2e3ebchinextern __MANGLE__ int	fprintf __PROTO__((FILE*, const char*, ...));
431da2e3ebchinextern __MANGLE__ int	fpurge __PROTO__((FILE*));
432da2e3ebchinextern __MANGLE__ int	fputc __PROTO__((int, FILE*));
433da2e3ebchinextern __MANGLE__ int	fputs __PROTO__((const char*, FILE*));
4347c2fbfbApril Chinextern __MANGLE__ size_t	fread __PROTO__((__V_*, size_t, size_t, FILE*));
435da2e3ebchinextern __MANGLE__ FILE*	freopen __PROTO__((const char*, const char*, FILE*));
436da2e3ebchinextern __MANGLE__ int	fscanf __PROTO__((FILE*, const char*, ...));
437da2e3ebchinextern __MANGLE__ int	fseek __PROTO__((FILE*, long, int));
438da2e3ebchinextern __MANGLE__ int	fseeko __PROTO__((FILE*, off_t, int));
439da2e3ebchinextern __MANGLE__ int	fsetpos __PROTO__((FILE*, const fpos_t*));
440da2e3ebchinextern __MANGLE__ long	ftell __PROTO__((FILE*));
441da2e3ebchinextern __MANGLE__ off_t	ftello __PROTO__((FILE*));
4427c2fbfbApril Chinextern __MANGLE__ size_t	fwrite __PROTO__((const __V_*, size_t, size_t, FILE*));
443da2e3ebchinextern __MANGLE__ int	getc __PROTO__((FILE*));
444da2e3ebchinextern __MANGLE__ int	getchar __PROTO__((void));
445da2e3ebchinextern __MANGLE__ char*	gets __PROTO__((char*));
446da2e3ebchinextern __MANGLE__ int	getw __PROTO__((FILE*));
447da2e3ebchinextern __MANGLE__ int	pclose __PROTO__((FILE*));
448da2e3ebchinextern __MANGLE__ FILE*	popen __PROTO__((const char*, const char*));
449da2e3ebchinextern __MANGLE__ int	printf __PROTO__((const char*, ...));
450da2e3ebchinextern __MANGLE__ int	putc __PROTO__((int, FILE*));
451da2e3ebchinextern __MANGLE__ int	putchar __PROTO__((int));
452da2e3ebchinextern __MANGLE__ int	puts __PROTO__((const char*));
453da2e3ebchinextern __MANGLE__ int	putw __PROTO__((int, FILE*));
454da2e3ebchinextern __MANGLE__ void	rewind __PROTO__((FILE*));
455da2e3ebchinextern __MANGLE__ int	scanf __PROTO__((const char*, ...));
456da2e3ebchinextern __MANGLE__ void	setbuf __PROTO__((FILE*, char*));
457da2e3ebchinextern __MANGLE__ int	setbuffer __PROTO__((FILE*, char*, int));
458da2e3ebchinextern __MANGLE__ int	setlinebuf __PROTO__((FILE*));
459da2e3ebchinextern __MANGLE__ int	setvbuf __PROTO__((FILE*, char*, int, size_t));
460da2e3ebchinextern __MANGLE__ int	snprintf __PROTO__((char*, int, const char*, ...));
461da2e3ebchinextern __MANGLE__ int	sprintf __PROTO__((char*, const char*, ...));
462da2e3ebchinextern __MANGLE__ int	sscanf __PROTO__((const char*, const char*, ...));
463da2e3ebchinextern __MANGLE__ FILE*	tmpfile __PROTO__((void));
464da2e3ebchinextern __MANGLE__ int	ungetc __PROTO__((int, FILE*));
465da2e3ebchinextern __MANGLE__ int	vasprintf __PROTO__((char**, const char*, va_list));
466da2e3ebchinextern __MANGLE__ int	vfprintf __PROTO__((FILE*, const char*, va_list));
467da2e3ebchinextern __MANGLE__ int	vfscanf __PROTO__((FILE*, const char*, va_list));
468da2e3ebchinextern __MANGLE__ int	vprintf __PROTO__((const char*, va_list));
469da2e3ebchinextern __MANGLE__ int	vscanf __PROTO__((const char*, va_list));
470da2e3ebchinextern __MANGLE__ int	vsnprintf __PROTO__((char*, int, const char*, va_list));
471da2e3ebchinextern __MANGLE__ int	vsprintf __PROTO__((char*, const char*, va_list));
472da2e3ebchinextern __MANGLE__ int	vsscanf __PROTO__((const char*, const char*, va_list));
473da2e3ebchin
474da2e3ebchin#if _typ_int64_t
475da2e3ebchin
476da2e3ebchinextern __MANGLE__ int		fgetpos64 __PROTO__((FILE*, fpos64_t*));
477da2e3ebchinextern __MANGLE__ int		fsetpos64 __PROTO__((FILE*, const fpos64_t*));
478da2e3ebchinextern __MANGLE__ int		fseek64 __PROTO__((FILE*, int64_t, int));
479da2e3ebchinextern __MANGLE__ int		fseeko64 __PROTO__((FILE*, int64_t, int));
480da2e3ebchinextern __MANGLE__ int64_t		ftell64 __PROTO__((FILE*));
481da2e3ebchinextern __MANGLE__ int64_t		ftello64 __PROTO__((FILE*));
482da2e3ebchin
483da2e3ebchin#ifdef _LARGEFILE64_SOURCE
484da2e3ebchin
485da2e3ebchin#undef	fpos_t
486da2e3ebchin#undef	off_t
487da2e3ebchin#undef	fgetpos
488da2e3ebchin#undef	fsetpos
489da2e3ebchin#undef	fseek
490da2e3ebchin#undef	fseeko
491da2e3ebchin#undef	ftell
492da2e3ebchin#undef	ftello
493da2e3ebchin
494da2e3ebchin#define	fpos_t		fpos64_t
495da2e3ebchin#if _typ_off64_t
496da2e3ebchin#define	off_t		off64_t
497da2e3ebchin#else
498da2e3ebchin#define	off_t		int64_t
499da2e3ebchin#endif
500da2e3ebchin
501da2e3ebchin#define fgetpos		fgetpos64
502da2e3ebchin#define fsetpos		fsetpos64
503da2e3ebchin#define	fseek		fseek64
504da2e3ebchin#define	fseeko		fseeko64
505da2e3ebchin#define ftell		ftell64
506da2e3ebchin#define ftello		ftello64
507da2e3ebchin
508da2e3ebchin#endif
509da2e3ebchin
510da2e3ebchin#endif
511da2e3ebchin
512da2e3ebchinextern __MANGLE__ void	clearerr_unlocked __PROTO__((FILE*));
513da2e3ebchinextern __MANGLE__ int	feof_unlocked __PROTO__((FILE*));
514da2e3ebchinextern __MANGLE__ int	ferror_unlocked __PROTO__((FILE*));
515da2e3ebchinextern __MANGLE__ int	fflush_unlocked __PROTO__((FILE*));
516da2e3ebchinextern __MANGLE__ int	fgetc_unlocked __PROTO__((FILE*));
517da2e3ebchinextern __MANGLE__ char*	fgets_unlocked __PROTO__((char*, int, FILE*));
518da2e3ebchinextern __MANGLE__ int	fileno_unlocked __PROTO__((FILE*));
519da2e3ebchinextern __MANGLE__ int	fputc_unlocked __PROTO__((int, FILE*));
520da2e3ebchinextern __MANGLE__ int	fputs_unlocked __PROTO__((char*, FILE*));
521da2e3ebchinextern __MANGLE__ size_t	fread_unlocked __PROTO__((__V_*, size_t, size_t, FILE*));
522da2e3ebchinextern __MANGLE__ size_t	fwrite_unlocked __PROTO__((__V_*, size_t, size_t, FILE*));
523da2e3ebchinextern __MANGLE__ int	getc_unlocked __PROTO__((FILE*));
524da2e3ebchinextern __MANGLE__ int	getchar_unlocked __PROTO__((void));
525da2e3ebchinextern __MANGLE__ int	putc_unlocked __PROTO__((int, FILE*));
526da2e3ebchinextern __MANGLE__ int	putchar_unlocked __PROTO__((int));
527da2e3ebchin
528da2e3ebchin#ifdef _USE_GNU
529da2e3ebchin
530da2e3ebchinextern __MANGLE__ int	fcloseall __PROTO__((void));
531da2e3ebchinextern __MANGLE__ FILE*	fmemopen __PROTO__((__V_*, size_t, const char*));
532da2e3ebchinextern __MANGLE__ ssize_t	__getdelim __PROTO__((char**, size_t*, int, FILE*));
533da2e3ebchinextern __MANGLE__ ssize_t	getdelim __PROTO__((char**, size_t*, int, FILE*));
534da2e3ebchinextern __MANGLE__ ssize_t	getline __PROTO__((char**, size_t*, FILE*));
535da2e3ebchin
536da2e3ebchin#endif
537da2e3ebchin
538da2e3ebchin#undef __MANGLE__
539da2e3ebchin#define __MANGLE__ __LINKAGE__
540da2e3ebchin
541da2e3ebchin#if _BLD_DLL && _DLL_INDIRECT_DATA
542da2e3ebchin
543da2e3ebchin#define stdin		((FILE*)_ast_dll->_ast_stdin)
544da2e3ebchin#define stdout		((FILE*)_ast_dll->_ast_stdout)
545da2e3ebchin#define stderr		((FILE*)_ast_dll->_ast_stderr)
546da2e3ebchin
547da2e3ebchin#else
548da2e3ebchin
549da2e3ebchin#define	stdin		(&_Sfstdin)
550da2e3ebchin#define	stdout		(&_Sfstdout)
551da2e3ebchin#define	stderr		(&_Sfstderr)
552da2e3ebchin
553da2e3ebchin#endif
554da2e3ebchin
555da2e3ebchin#if defined(_AST_H) || defined(_SFIO_H)
556da2e3ebchin
557da2e3ebchin#define feof(f)		sfeof(f)
558da2e3ebchin#define ferror(f)	sferror(f)
559da2e3ebchin#define fileno(f)	sffileno(f)
560da2e3ebchin#define fputc(c,f)	sfputc(f,c)
561da2e3ebchin#define getc(f)		sfgetc(f)
562da2e3ebchin#define getchar()	sfgetc(sfstdin)
563da2e3ebchin#define putc(c,f)	sfputc(f,c)
564da2e3ebchin#define putchar(c)	sfputc(sfstdout,c)
565da2e3ebchin
566da2e3ebchin#else
567da2e3ebchin
568da2e3ebchin#if !_UWIN
569da2e3ebchin#if _BLD_ast && defined(__EXPORT__)
570da2e3ebchin#undef __MANGLE__
571da2e3ebchin#define __MANGLE__ __LINKAGE__ __EXPORT__
572da2e3ebchin#endif
573da2e3ebchin#if !_BLD_ast && defined(__IMPORT__)
574da2e3ebchin#undef __MANGLE__
575da2e3ebchin#define __MANGLE__ __LINKAGE__ __IMPORT__
576da2e3ebchin#endif
577da2e3ebchin#endif
578da2e3ebchin
579da2e3ebchinextern __MANGLE__ FILE	_Sfstdin;
580da2e3ebchinextern __MANGLE__ FILE	_Sfstdout;
581da2e3ebchinextern __MANGLE__ FILE	_Sfstderr;
582da2e3ebchin
583da2e3ebchin#undef __MANGLE__
584da2e3ebchin#define __MANGLE__ __LINKAGE__
585da2e3ebchin
586da2e3ebchin#define feof(f)		(_sf_(f)->_flags&_SF_EOF)
587da2e3ebchin#define ferror(f)	(_sf_(f)->_flags&_SF_ERROR)
588