Advertisement
bueddl

Untitled

Apr 8th, 2016
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.90 KB | None | 0 0
  1. #ifndef _CPRINTF_H
  2. #define _CPRINTF_H
  3.  
  4. #include <stdio.h>
  5. #include <stdarg.h>
  6.  
  7. #if __STDC_VERSION__ < 199901L
  8. /* Prior C99 */
  9. int cprintf(const char *format, ...);
  10. int cfprintf(FILE *stream, const char *format, ...);
  11. int csprintf(char *buffer, const char *format, ...);
  12. int cvprintf(const char *format, va_list vlist);
  13. int cvfprintf(FILE *stream, const char *format, va_list vlist);
  14. int cvsprintf(char *buffer, const char *format, va_list vlist);
  15. #else
  16.  
  17. /* Since C99 */
  18. int cprintf(const char *restrict format, ...);
  19. int cfprintf(FILE *restrict stream, const char *restrict format, ...);
  20. int csprintf(char *restrict buffer, const char *restrict format, ...);
  21. int csnprintf(char *restrict buffer, int bufsz, const char *restrict format, ...);
  22. int cvprintf(const char *restrict format, va_list vlist);
  23. int cvfprintf(FILE *restrict stream, const char *restrict format, va_list vlist);
  24. int cvsprintf(char *restrict buffer, const char *restrict format, va_list vlist);
  25. int cvsnprintf(char *restrict buffer, int bufsz, const char *restrict format, va_list vlist);
  26. #endif
  27.  
  28. #if __STDC_VERSION__ >= 201112L
  29. /* Since C11 */
  30.     #if defined __STDC_LIB_EXT1__ && __STDC_WANT_LIB_EXT1__ == 1
  31.     /* But only if Library Extension 1 available and desired */
  32. int cprintf_s(const char *restrict format, ...);
  33. int cfprintf_s(FILE *restrict stream, const char *restrict format, ...);
  34. int csprintf_s(char *restrict buffer, rsize_t bufsz, const char *restrict format, ...);
  35. int csnprintf_s(char *restrict buffer, rsize_t bufsz, const char *restrict format, ...);
  36. int cvprintf_s(const char *restrict format, va_list vlist);
  37. int cvfprintf_s(FILE *restrict stream, const char *restrict format, va_list vlist);
  38. int cvsprintf_s(char *restrict buffer, rsize_t bufsz, const char *restrict format, va_list vlist);
  39. int cvsnprintf_s(char *restrict buffer, rsize_t bufsz, const char *restrict format, va_list vlist);
  40.     #endif
  41. #endif
  42.  
  43. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement