stdio.h 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /*-------------------------------------------------------------------------
  2. stdio.h - ANSI functions forward declarations
  3. Copyright (C) 1998, Sandeep Dutta . sandeep.dutta@usa.net
  4. This library is free software; you can redistribute it and/or modify it
  5. under the terms of the GNU General Public License as published by the
  6. Free Software Foundation; either version 2, or (at your option) any
  7. later version.
  8. This library is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this library; see the file COPYING. If not, write to the
  14. Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston,
  15. MA 02110-1301, USA.
  16. As a special exception, if you link this library with other files,
  17. some of which are compiled with SDCC, to produce an executable,
  18. this library does not by itself cause the resulting executable to
  19. be covered by the GNU General Public License. This exception does
  20. not however invalidate any other reasons why the executable file
  21. might be covered by the GNU General Public License.
  22. -------------------------------------------------------------------------*/
  23. #ifndef __SDC51_STDIO_H
  24. #define __SDC51_STDIO_H 1
  25. #include <stdarg.h>
  26. #ifdef __ds390
  27. #include <tinibios.h>
  28. #endif
  29. #include <sdcc-lib.h>
  30. #ifndef NULL
  31. #define NULL (void *)0
  32. #endif
  33. #ifndef __SIZE_T_DEFINED
  34. #define __SIZE_T_DEFINED
  35. typedef unsigned int size_t;
  36. #endif
  37. /* Bounds-checking interfaces from annex K of the C11 standard. */
  38. #if defined (__STDC_WANT_LIB_EXT1__) && __STDC_WANT_LIB_EXT1__
  39. #ifndef __RSIZE_T_DEFINED
  40. #define __RSIZE_T_DEFINED
  41. typedef size_t rsize_t;
  42. #endif
  43. #ifndef __ERRNO_T_DEFINED
  44. #define __ERRNO_T_DEFINED
  45. typedef int errno_t;
  46. #endif
  47. #endif
  48. typedef void (*pfn_outputchar)(char c, void* p) _REENTRANT;
  49. extern int _print_format (pfn_outputchar pfn, void* pvoid, const char *format, va_list ap);
  50. /*-----------------------------------------------------------------------*/
  51. extern void printf_small (char *,...) _REENTRANT;
  52. extern int printf (const char *,...);
  53. extern int vprintf (const char *, va_list);
  54. extern int sprintf (char *, const char *, ...);
  55. extern int vsprintf (char *, const char *, va_list);
  56. extern int puts(const char *);
  57. #if __STDC_VERSION__ < 201112L
  58. extern char *gets(char *);
  59. #endif
  60. extern char getchar(void);
  61. extern void putchar(char);
  62. #if defined(SDCC_mcs51) && !defined(SDCC_USE_XSTACK)
  63. extern void printf_fast(__code const char *fmt, ...) _REENTRANT;
  64. extern void printf_fast_f(__code const char *fmt, ...) _REENTRANT;
  65. extern void printf_tiny(__code const char *fmt, ...) _REENTRANT;
  66. #endif
  67. #endif /* __SDC51_STDIO_H */