iolibio.h 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. #ifndef _IOLIBIO_H
  2. #define _IOLIBIO_H 1
  3. #include <stdio.h>
  4. #include <libio/libio.h>
  5. /* Alternative names for many of the stdio.h functions, used
  6. internally and exposed for backward compatibility's sake. */
  7. extern int _IO_fclose (FILE*);
  8. extern int _IO_new_fclose (FILE*);
  9. extern int _IO_old_fclose (FILE*);
  10. extern FILE *_IO_fdopen (int, const char*) __THROW;
  11. libc_hidden_proto (_IO_fdopen)
  12. extern FILE *_IO_old_fdopen (int, const char*) __THROW;
  13. extern FILE *_IO_new_fdopen (int, const char*) __THROW;
  14. extern int _IO_fflush (FILE*);
  15. libc_hidden_proto (_IO_fflush)
  16. extern int _IO_fgetpos (FILE*, __fpos_t*);
  17. extern int _IO_fgetpos64 (FILE*, __fpos64_t*);
  18. extern char* _IO_fgets (char*, int, FILE*);
  19. extern FILE *_IO_fopen (const char*, const char*);
  20. extern FILE *_IO_old_fopen (const char*, const char*);
  21. extern FILE *_IO_new_fopen (const char*, const char*);
  22. extern FILE *_IO_fopen64 (const char*, const char*);
  23. extern FILE *__fopen_internal (const char*, const char*, int)
  24. attribute_hidden;
  25. extern FILE *__fopen_maybe_mmap (FILE *) __THROW attribute_hidden;
  26. extern int _IO_fprintf (FILE*, const char*, ...);
  27. extern int _IO_fputs (const char*, FILE*);
  28. libc_hidden_proto (_IO_fputs)
  29. extern int _IO_fsetpos (FILE*, const __fpos_t *);
  30. extern int _IO_fsetpos64 (FILE*, const __fpos64_t *);
  31. extern long int _IO_ftell (FILE*);
  32. libc_hidden_proto (_IO_ftell)
  33. extern size_t _IO_fread (void*, size_t, size_t, FILE*);
  34. libc_hidden_proto (_IO_fread)
  35. extern size_t _IO_fwrite (const void*, size_t, size_t, FILE*);
  36. libc_hidden_proto (_IO_fwrite)
  37. extern char* _IO_gets (char*);
  38. extern void _IO_perror (const char*) __THROW;
  39. extern int _IO_printf (const char*, ...);
  40. extern int _IO_puts (const char*);
  41. libc_hidden_proto (_IO_puts)
  42. extern int _IO_scanf (const char*, ...);
  43. extern void _IO_setbuffer (FILE *, char*, size_t) __THROW;
  44. libc_hidden_proto (_IO_setbuffer)
  45. extern int _IO_setvbuf (FILE*, char*, int, size_t) __THROW;
  46. libc_hidden_proto (_IO_setvbuf)
  47. extern int _IO_sscanf (const char*, const char*, ...) __THROW;
  48. extern int _IO_sprintf (char *, const char*, ...) __THROW;
  49. extern int _IO_ungetc (int, FILE*) __THROW;
  50. extern int _IO_vsscanf (const char *, const char *, __gnuc_va_list) __THROW;
  51. #define _IO_clearerr(FP) ((FP)->_flags &= ~(_IO_ERR_SEEN|_IO_EOF_SEEN))
  52. #define _IO_fseek(__fp, __offset, __whence) \
  53. (_IO_seekoff_unlocked (__fp, __offset, __whence, _IOS_INPUT|_IOS_OUTPUT) \
  54. == _IO_pos_BAD ? EOF : 0)
  55. #define _IO_rewind(FILE) \
  56. (void) _IO_seekoff_unlocked (FILE, 0, 0, _IOS_INPUT|_IOS_OUTPUT)
  57. #define _IO_freopen(FILENAME, MODE, FP) \
  58. (_IO_file_close_it (FP), \
  59. _IO_file_fopen (FP, FILENAME, MODE, 1))
  60. #define _IO_old_freopen(FILENAME, MODE, FP) \
  61. (_IO_old_file_close_it (FP), _IO_old_file_fopen(FP, FILENAME, MODE))
  62. #define _IO_freopen64(FILENAME, MODE, FP) \
  63. (_IO_file_close_it (FP), \
  64. _IO_file_fopen (FP, FILENAME, MODE, 0))
  65. #define _IO_fileno(FP) ((FP)->_fileno)
  66. extern FILE* _IO_popen (const char*, const char*) __THROW;
  67. extern FILE* _IO_new_popen (const char*, const char*) __THROW;
  68. extern FILE* _IO_old_popen (const char*, const char*) __THROW;
  69. extern int __new_pclose (FILE *) __THROW;
  70. extern int __old_pclose (FILE *) __THROW;
  71. #define _IO_pclose _IO_fclose
  72. #define _IO_setbuf(_FP, _BUF) _IO_setbuffer (_FP, _BUF, BUFSIZ)
  73. #define _IO_setlinebuf(_FP) _IO_setvbuf (_FP, NULL, 1, 0)
  74. FILE *__new_freopen (const char *, const char *, FILE *) __THROW;
  75. FILE *__old_freopen (const char *, const char *, FILE *) __THROW;
  76. #endif /* iolibio.h. */