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