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