home *** CD-ROM | disk | FTP | other *** search
/ PC Extra Super CD 1998 January / PCPLUS131.iso / DJGPP / V2 / DJDEV201.ZIP / include / stdio.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-08-27  |  4.1 KB  |  143 lines

  1. /* Copyright (C) 1995 DJ Delorie, see COPYING.DJ for details */
  2.  
  3. #ifndef __dj_include_stdio_h_
  4. #define __dj_include_stdio_h_
  5.  
  6. #ifdef __cplusplus
  7. extern "C" {
  8. #endif
  9.  
  10. #ifndef __dj_ENFORCE_ANSI_FREESTANDING
  11.  
  12. #include <sys/djtypes.h>
  13.   
  14. #define _IOFBF        00001
  15. #define _IONBF        00002
  16. #define _IOLBF        00004
  17.  
  18. #define BUFSIZ        16384
  19. #define EOF        (-1)
  20. #define FILENAME_MAX    260
  21. #define FOPEN_MAX    20
  22. #define L_tmpnam    260
  23. #define NULL        0
  24. #define TMP_MAX        999999
  25.  
  26. #define SEEK_SET    0
  27. #define SEEK_CUR    1
  28. #define SEEK_END    2
  29.  
  30. __DJ_va_list
  31. #undef __DJ_va_list
  32. #define __DJ_va_list
  33. __DJ_size_t
  34. #undef __DJ_size_t
  35. #define __DJ_size_t
  36.  
  37. /* Note that the definitions of these fields are NOT guaranteed!  They
  38.    may change with any release without notice!  The fact that they
  39.    are here at all is to comply with ANSI specifictions. */
  40.    
  41. typedef struct {
  42.   int   _cnt;
  43.   char *_ptr;
  44.   char *_base;
  45.   int   _bufsiz;
  46.   int   _flag;
  47.   int   _file;
  48.   char *_name_to_remove;
  49. } FILE;
  50.  
  51. typedef unsigned long        fpos_t;
  52.  
  53. extern FILE __dj_stdin, __dj_stdout, __dj_stderr;
  54. #define stdin    (&__dj_stdin)
  55. #define stdout    (&__dj_stdout)
  56. #define stderr    (&__dj_stderr)
  57.  
  58. void    clearerr(FILE *_stream);
  59. int    fclose(FILE *_stream);
  60. int    feof(FILE *_stream);
  61. int    ferror(FILE *_stream);
  62. int    fflush(FILE *_stream);
  63. int    fgetc(FILE *_stream);
  64. int    fgetpos(FILE *_stream, fpos_t *_pos);
  65. char *    fgets(char *_s, int _n, FILE *_stream);
  66. FILE *    fopen(const char *_filename, const char *_mode);
  67. int    fprintf(FILE *_stream, const char *_format, ...);
  68. int    fputc(int _c, FILE *_stream);
  69. int    fputs(const char *_s, FILE *_stream);
  70. size_t    fread(void *_ptr, size_t _size, size_t _nelem, FILE *_stream);
  71. FILE *    freopen(const char *_filename, const char *_mode, FILE *_stream);
  72. int    fscanf(FILE *_stream, const char *_format, ...);
  73. int    fseek(FILE *_stream, long _offset, int _mode);
  74. int    fsetpos(FILE *_stream, const fpos_t *_pos);
  75. long    ftell(FILE *_stream);
  76. size_t    fwrite(const void *_ptr, size_t _size, size_t _nelem, FILE *_stream);
  77. int    getc(FILE *_stream);
  78. int    getchar(void);
  79. char *    gets(char *_s);
  80. void    perror(const char *_s);
  81. int    printf(const char *_format, ...);
  82. int    putc(int _c, FILE *_stream);
  83. int    putchar(int _c);
  84. int    puts(const char *_s);
  85. int    remove(const char *_filename);
  86. int    rename(const char *_old, const char *_new);
  87. void    rewind(FILE *_stream);
  88. int    scanf(const char *_format, ...);
  89. void    setbuf(FILE *_stream, char *_buf);
  90. int    setvbuf(FILE *_stream, char *_buf, int _mode, size_t _size);
  91. int    sprintf(char *_s, const char *_format, ...);
  92. int    sscanf(const char *_s, const char *_format, ...);
  93. FILE *    tmpfile(void);
  94. char *    tmpnam(char *_s);
  95. int    ungetc(int _c, FILE *_stream);
  96. int    vfprintf(FILE *_stream, const char *_format, va_list _ap);
  97. int    vprintf(const char *_format, va_list _ap);
  98. int    vsprintf(char *_s, const char *_format, va_list _ap);
  99.  
  100. #ifndef __STRICT_ANSI__
  101.  
  102. #define L_ctermid
  103. #define L_cusrid
  104. /* #define STREAM_MAX    20 - DOS can change this */
  105.  
  106. int    fileno(FILE *_stream);
  107. FILE *    fdopen(int _fildes, const char *_type);
  108. int    pclose(FILE *_pf);
  109. FILE *    popen(const char *_command, const char *_mode);
  110.  
  111. #ifndef _POSIX_SOURCE
  112.  
  113. extern FILE __dj_stdprn, __dj_stdaux;
  114. #define stdprn    (&__dj_stdprn)
  115. #define stdaux    (&__dj_stdaux)
  116.  
  117. void    _djstat_describe_lossage(FILE *_to_where);
  118. int    _doprnt(const char *_fmt, va_list _args, FILE *_f);
  119. int    _doscan(FILE *_f, const char *_fmt, void **_argp);
  120. int    _doscan_low(FILE *, int (*)(FILE *_get), int (*_unget)(int, FILE *), const char *_fmt, void **_argp);
  121. int    fpurge(FILE *_f);
  122. int    getw(FILE *_f);
  123. int    mkstemp(char *_template);
  124. char *    mktemp(char *_template);
  125. int    putw(int _v, FILE *_f);
  126. void    setbuffer(FILE *_f, void *_buf, int _size);
  127. void    setlinebuf(FILE *_f);
  128. char *    tempnam(const char *_dir, const char *_prefix);
  129. int    _rename(const char *_old, const char *_new);    /* Simple (no directory) */
  130.  
  131. #endif /* !_POSIX_SOURCE */
  132. #endif /* !__STRICT_ANSI__ */
  133. #endif /* !__dj_ENFORCE_ANSI_FREESTANDING */
  134.  
  135. #ifndef __dj_ENFORCE_FUNCTION_CALLS
  136. #endif /* !__dj_ENFORCE_FUNCTION_CALLS */
  137.  
  138. #ifdef __cplusplus
  139. }
  140. #endif
  141.  
  142. #endif /* !__dj_include_stdio_h_ */
  143.