snprintf.h 912 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * snprintf.h
  3. * header file for snprintf.c
  4. *
  5. */
  6. #ifndef _EGG_COMPAT_SNPRINTF_H_
  7. #define _EGG_COMPAT_SNPRINTF_H_
  8. #include "src/main.h"
  9. #include <stdio.h>
  10. /* Check for broken snprintf versions */
  11. #ifdef BROKEN_SNPRINTF
  12. # ifdef HAVE_VSNPRINTF
  13. # undef HAVE_VSNPRINTF
  14. # endif
  15. # ifdef HAVE_SNPRINTF
  16. # undef HAVE_SNPRINTF
  17. # endif
  18. #endif
  19. /* Use the system libraries version of vsnprintf() if available. Otherwise
  20. * use our own.
  21. */
  22. #ifndef HAVE_VSNPRINTF
  23. int egg_vsnprintf(char *str, size_t count, const char *fmt, va_list ap);
  24. #else
  25. # define egg_vsnprintf vsnprintf
  26. #endif
  27. /* Use the system libraries version of snprintf() if available. Otherwise
  28. * use our own.
  29. */
  30. #ifndef HAVE_SNPRINTF
  31. # ifdef __STDC__
  32. int egg_snprintf(char *str, size_t count, const char *fmt, ...);
  33. # else
  34. int egg_snprintf();
  35. # endif
  36. #else
  37. # define egg_snprintf snprintf
  38. #endif
  39. #endif /* !_EGG_COMPAT_SNPRINTF_H_ */