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