xref: /titanic_44/usr/src/lib/libast/sparc/include/ast/ast_stdio.h (revision 3e14f97f673e8a630f076077de35afdd43dc1587)
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_sparc_32bit/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 
101 typedef 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 
163 typedef 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
179 typedef struct _sfio_s FILE;
180 
181 #undef	strerror
182 extern __MANGLE__ char*	strerror(int) __THROW;
183 
184 extern __MANGLE__ int	_doprnt __PROTO__((const char*, va_list, FILE*));
185 extern __MANGLE__ int	_doscan __PROTO__((FILE*, const char*, va_list));
186 extern __MANGLE__ int	asprintf __PROTO__((char**, const char*, ...));
187 extern __MANGLE__ int	clearerr __PROTO__((FILE*));
188 extern __MANGLE__ int	fclose __PROTO__((FILE*));
189 extern __MANGLE__ FILE*	fdopen __PROTO__((int, const char*));
190 extern __MANGLE__ int	feof __PROTO__((FILE*));
191 extern __MANGLE__ int	ferror __PROTO__((FILE*));
192 extern __MANGLE__ int	fflush __PROTO__((FILE*));
193 extern __MANGLE__ int	fgetc __PROTO__((FILE*));
194 extern __MANGLE__ int	fgetpos __PROTO__((FILE*, fpos_t*));
195 extern __MANGLE__ char*	fgets __PROTO__((char*, int, FILE*));
196 extern __MANGLE__ int	fileno __PROTO__((FILE*));
197 extern __MANGLE__ FILE*	fopen __PROTO__((const char*, const char*));
198 extern __MANGLE__ int	fprintf __PROTO__((FILE*, const char*, ...));
199 extern __MANGLE__ int	fpurge __PROTO__((FILE*));
200 extern __MANGLE__ int	fputc __PROTO__((int, FILE*));
201 extern __MANGLE__ int	fputs __PROTO__((const char*, FILE*));
202 extern __MANGLE__ size_t	fread __PROTO__((__V_*, size_t, size_t, FILE*));
203 extern __MANGLE__ FILE*	freopen __PROTO__((const char*, const char*, FILE*));
204 extern __MANGLE__ int	fscanf __PROTO__((FILE*, const char*, ...));
205 extern __MANGLE__ int	fseek __PROTO__((FILE*, long, int));
206 extern __MANGLE__ int	fseeko __PROTO__((FILE*, off_t, int));
207 extern __MANGLE__ int	fsetpos __PROTO__((FILE*, const fpos_t*));
208 extern __MANGLE__ long	ftell __PROTO__((FILE*));
209 extern __MANGLE__ off_t	ftello __PROTO__((FILE*));
210 extern __MANGLE__ size_t	fwrite __PROTO__((const __V_*, size_t, size_t, FILE*));
211 extern __MANGLE__ int	getc __PROTO__((FILE*));
212 extern __MANGLE__ int	getchar __PROTO__((void));
213 extern __MANGLE__ char*	gets __PROTO__((char*));
214 extern __MANGLE__ int	getw __PROTO__((FILE*));
215 extern __MANGLE__ int	pclose __PROTO__((FILE*));
216 extern __MANGLE__ FILE*	popen __PROTO__((const char*, const char*));
217 extern __MANGLE__ int	printf __PROTO__((const char*, ...));
218 extern __MANGLE__ int	putc __PROTO__((int, FILE*));
219 extern __MANGLE__ int	putchar __PROTO__((int));
220 extern __MANGLE__ int	puts __PROTO__((const char*));
221 extern __MANGLE__ int	putw __PROTO__((int, FILE*));
222 extern __MANGLE__ void	rewind __PROTO__((FILE*));
223 extern __MANGLE__ int	scanf __PROTO__((const char*, ...));
224 extern __MANGLE__ void	setbuf __PROTO__((FILE*, char*));
225 extern __MANGLE__ int	setbuffer __PROTO__((FILE*, char*, int));
226 extern __MANGLE__ int	setlinebuf __PROTO__((FILE*));
227 extern __MANGLE__ int	setvbuf __PROTO__((FILE*, char*, int, size_t));
228 extern __MANGLE__ int	snprintf __PROTO__((char*, int, const char*, ...));
229 extern __MANGLE__ int	sprintf __PROTO__((char*, const char*, ...));
230 extern __MANGLE__ int	sscanf __PROTO__((const char*, const char*, ...));
231 extern __MANGLE__ FILE*	tmpfile __PROTO__((void));
232 extern __MANGLE__ int	ungetc __PROTO__((int, FILE*));
233 extern __MANGLE__ int	vasprintf __PROTO__((char**, const char*, va_list));
234 extern __MANGLE__ int	vfprintf __PROTO__((FILE*, const char*, va_list));
235 extern __MANGLE__ int	vfscanf __PROTO__((FILE*, const char*, va_list));
236 extern __MANGLE__ int	vprintf __PROTO__((const char*, va_list));
237 extern __MANGLE__ int	vscanf __PROTO__((const char*, va_list));
238 extern __MANGLE__ int	vsnprintf __PROTO__((char*, int, const char*, va_list));
239 extern __MANGLE__ int	vsprintf __PROTO__((char*, const char*, va_list));
240 extern __MANGLE__ int	vsscanf __PROTO__((const char*, const char*, va_list));
241 
242 #if _typ_int64_t
243 
244 extern __MANGLE__ int		fgetpos64 __PROTO__((FILE*, fpos64_t*));
245 extern __MANGLE__ int		fsetpos64 __PROTO__((FILE*, const fpos64_t*));
246 extern __MANGLE__ int		fseek64 __PROTO__((FILE*, int64_t, int));
247 extern __MANGLE__ int		fseeko64 __PROTO__((FILE*, int64_t, int));
248 extern __MANGLE__ int64_t		ftell64 __PROTO__((FILE*));
249 extern __MANGLE__ int64_t		ftello64 __PROTO__((FILE*));
250 
251 #endif
252 
253 extern __MANGLE__ void	clearerr_unlocked __PROTO__((FILE*));
254 extern __MANGLE__ int	feof_unlocked __PROTO__((FILE*));
255 extern __MANGLE__ int	ferror_unlocked __PROTO__((FILE*));
256 extern __MANGLE__ int	fflush_unlocked __PROTO__((FILE*));
257 extern __MANGLE__ int	fgetc_unlocked __PROTO__((FILE*));
258 extern __MANGLE__ char*	fgets_unlocked __PROTO__((char*, int, FILE*));
259 extern __MANGLE__ int	fileno_unlocked __PROTO__((FILE*));
260 extern __MANGLE__ int	fputc_unlocked __PROTO__((int, FILE*));
261 extern __MANGLE__ int	fputs_unlocked __PROTO__((char*, FILE*));
262 extern __MANGLE__ size_t	fread_unlocked __PROTO__((__V_*, size_t, size_t, FILE*));
263 extern __MANGLE__ size_t	fwrite_unlocked __PROTO__((__V_*, size_t, size_t, FILE*));
264 extern __MANGLE__ int	getc_unlocked __PROTO__((FILE*));
265 extern __MANGLE__ int	getchar_unlocked __PROTO__((void));
266 extern __MANGLE__ int	putc_unlocked __PROTO__((int, FILE*));
267 extern __MANGLE__ int	putchar_unlocked __PROTO__((int));
268 
269 extern __MANGLE__ void	flockfile __PROTO__((FILE*));
270 extern __MANGLE__ int	ftrylockfile __PROTO__((FILE*));
271 extern __MANGLE__ void	funlockfile __PROTO__((FILE*));
272 
273 #ifdef _USE_GNU
274 
275 extern __MANGLE__ int	fcloseall __PROTO__((void));
276 extern __MANGLE__ FILE*	fmemopen __PROTO__((__V_*, size_t, const char*));
277 extern __MANGLE__ ssize_t	__getdelim __PROTO__((char**, size_t*, int, FILE*));
278 extern __MANGLE__ ssize_t	getdelim __PROTO__((char**, size_t*, int, FILE*));
279 extern __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)
392 extern __MANGLE__ char*	ctermid(char*) __THROW;
393 #else
394 extern __MANGLE__ char*	ctermid __PROTO__((char*));
395 #endif
396 extern __MANGLE__ char*	tmpnam __PROTO__((char*));
397 extern __MANGLE__ char*	tempnam __PROTO__((const char*, const char*));
398 extern __MANGLE__ void	perror __PROTO__((const char*));
399 #ifndef _AST_STD_H
400 #ifndef remove
401 extern __MANGLE__ int	remove __PROTO__((const char*));
402 #endif
403 #ifndef rename
404 extern __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 
416 extern __MANGLE__ int	_doprnt __PROTO__((const char*, va_list, FILE*));
417 extern __MANGLE__ int	_doscan __PROTO__((FILE*, const char*, va_list));
418 extern __MANGLE__ int	asprintf __PROTO__((char**, const char*, ...));
419 extern __MANGLE__ int	clearerr __PROTO__((FILE*));
420 extern __MANGLE__ int	fclose __PROTO__((FILE*));
421 extern __MANGLE__ FILE*	fdopen __PROTO__((int, const char*));
422 extern __MANGLE__ int	feof __PROTO__((FILE*));
423 extern __MANGLE__ int	ferror __PROTO__((FILE*));
424 extern __MANGLE__ int	fflush __PROTO__((FILE*));
425 extern __MANGLE__ int	fgetc __PROTO__((FILE*));
426 extern __MANGLE__ int	fgetpos __PROTO__((FILE*, fpos_t*));
427 extern __MANGLE__ char*	fgets __PROTO__((char*, int, FILE*));
428 extern __MANGLE__ int	fileno __PROTO__((FILE*));
429 extern __MANGLE__ FILE*	fopen __PROTO__((const char*, const char*));
430 extern __MANGLE__ int	fprintf __PROTO__((FILE*, const char*, ...));
431 extern __MANGLE__ int	fpurge __PROTO__((FILE*));
432 extern __MANGLE__ int	fputc __PROTO__((int, FILE*));
433 extern __MANGLE__ int	fputs __PROTO__((const char*, FILE*));
434 extern __MANGLE__ size_t	fread __PROTO__((__V_*, size_t, size_t, FILE*));
435 extern __MANGLE__ FILE*	freopen __PROTO__((const char*, const char*, FILE*));
436 extern __MANGLE__ int	fscanf __PROTO__((FILE*, const char*, ...));
437 extern __MANGLE__ int	fseek __PROTO__((FILE*, long, int));
438 extern __MANGLE__ int	fseeko __PROTO__((FILE*, off_t, int));
439 extern __MANGLE__ int	fsetpos __PROTO__((FILE*, const fpos_t*));
440 extern __MANGLE__ long	ftell __PROTO__((FILE*));
441 extern __MANGLE__ off_t	ftello __PROTO__((FILE*));
442 extern __MANGLE__ size_t	fwrite __PROTO__((const __V_*, size_t, size_t, FILE*));
443 extern __MANGLE__ int	getc __PROTO__((FILE*));
444 extern __MANGLE__ int	getchar __PROTO__((void));
445 extern __MANGLE__ char*	gets __PROTO__((char*));
446 extern __MANGLE__ int	getw __PROTO__((FILE*));
447 extern __MANGLE__ int	pclose __PROTO__((FILE*));
448 extern __MANGLE__ FILE*	popen __PROTO__((const char*, const char*));
449 extern __MANGLE__ int	printf __PROTO__((const char*, ...));
450 extern __MANGLE__ int	putc __PROTO__((int, FILE*));
451 extern __MANGLE__ int	putchar __PROTO__((int));
452 extern __MANGLE__ int	puts __PROTO__((const char*));
453 extern __MANGLE__ int	putw __PROTO__((int, FILE*));
454 extern __MANGLE__ void	rewind __PROTO__((FILE*));
455 extern __MANGLE__ int	scanf __PROTO__((const char*, ...));
456 extern __MANGLE__ void	setbuf __PROTO__((FILE*, char*));
457 extern __MANGLE__ int	setbuffer __PROTO__((FILE*, char*, int));
458 extern __MANGLE__ int	setlinebuf __PROTO__((FILE*));
459 extern __MANGLE__ int	setvbuf __PROTO__((FILE*, char*, int, size_t));
460 extern __MANGLE__ int	snprintf __PROTO__((char*, int, const char*, ...));
461 extern __MANGLE__ int	sprintf __PROTO__((char*, const char*, ...));
462 extern __MANGLE__ int	sscanf __PROTO__((const char*, const char*, ...));
463 extern __MANGLE__ FILE*	tmpfile __PROTO__((void));
464 extern __MANGLE__ int	ungetc __PROTO__((int, FILE*));
465 extern __MANGLE__ int	vasprintf __PROTO__((char**, const char*, va_list));
466 extern __MANGLE__ int	vfprintf __PROTO__((FILE*, const char*, va_list));
467 extern __MANGLE__ int	vfscanf __PROTO__((FILE*, const char*, va_list));
468 extern __MANGLE__ int	vprintf __PROTO__((const char*, va_list));
469 extern __MANGLE__ int	vscanf __PROTO__((const char*, va_list));
470 extern __MANGLE__ int	vsnprintf __PROTO__((char*, int, const char*, va_list));
471 extern __MANGLE__ int	vsprintf __PROTO__((char*, const char*, va_list));
472 extern __MANGLE__ int	vsscanf __PROTO__((const char*, const char*, va_list));
473 
474 #if _typ_int64_t
475 
476 extern __MANGLE__ int		fgetpos64 __PROTO__((FILE*, fpos64_t*));
477 extern __MANGLE__ int		fsetpos64 __PROTO__((FILE*, const fpos64_t*));
478 extern __MANGLE__ int		fseek64 __PROTO__((FILE*, int64_t, int));
479 extern __MANGLE__ int		fseeko64 __PROTO__((FILE*, int64_t, int));
480 extern __MANGLE__ int64_t		ftell64 __PROTO__((FILE*));
481 extern __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 
512 extern __MANGLE__ void	clearerr_unlocked __PROTO__((FILE*));
513 extern __MANGLE__ int	feof_unlocked __PROTO__((FILE*));
514 extern __MANGLE__ int	ferror_unlocked __PROTO__((FILE*));
515 extern __MANGLE__ int	fflush_unlocked __PROTO__((FILE*));
516 extern __MANGLE__ int	fgetc_unlocked __PROTO__((FILE*));
517 extern __MANGLE__ char*	fgets_unlocked __PROTO__((char*, int, FILE*));
518 extern __MANGLE__ int	fileno_unlocked __PROTO__((FILE*));
519 extern __MANGLE__ int	fputc_unlocked __PROTO__((int, FILE*));
520 extern __MANGLE__ int	fputs_unlocked __PROTO__((char*, FILE*));
521 extern __MANGLE__ size_t	fread_unlocked __PROTO__((__V_*, size_t, size_t, FILE*));
522 extern __MANGLE__ size_t	fwrite_unlocked __PROTO__((__V_*, size_t, size_t, FILE*));
523 extern __MANGLE__ int	getc_unlocked __PROTO__((FILE*));
524 extern __MANGLE__ int	getchar_unlocked __PROTO__((void));
525 extern __MANGLE__ int	putc_unlocked __PROTO__((int, FILE*));
526 extern __MANGLE__ int	putchar_unlocked __PROTO__((int));
527 
528 #ifdef _USE_GNU
529 
530 extern __MANGLE__ int	fcloseall __PROTO__((void));
531 extern __MANGLE__ FILE*	fmemopen __PROTO__((__V_*, size_t, const char*));
532 extern __MANGLE__ ssize_t	__getdelim __PROTO__((char**, size_t*, int, FILE*));
533 extern __MANGLE__ ssize_t	getdelim __PROTO__((char**, size_t*, int, FILE*));
534 extern __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 
579 extern __MANGLE__ FILE	_Sfstdin;
580 extern __MANGLE__ FILE	_Sfstdout;
581 extern __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 
600 extern __MANGLE__ int		_sffilbuf __PROTO__((FILE*, int));
601 extern __MANGLE__ int		_sfflsbuf __PROTO__((FILE*, int));
602 
603 #undef __MANGLE__
604 #define __MANGLE__ __LINKAGE__
605 
606 #endif
607 
608 #endif
609