snprintf.h 989 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. #ifdef HAVE_CONFIG_H
  9. # include "config.h"
  10. #endif
  11. #include <stdio.h>
  12. /* Check for broken snprintf versions */
  13. #ifdef BROKEN_SNPRINTF
  14. # ifdef HAVE_VSNPRINTF
  15. # undef HAVE_VSNPRINTF
  16. # endif
  17. # ifdef HAVE_SNPRINTF
  18. # undef HAVE_SNPRINTF
  19. # endif
  20. #endif
  21. /* Use the system libraries version of vsnprintf() if available. Otherwise
  22. * use our own.
  23. */
  24. #ifndef HAVE_VSNPRINTF
  25. int egg_vsnprintf(char *, size_t, const char *, va_list) __attribute__((format(printf, 3, 0)));
  26. #else
  27. # define egg_vsnprintf vsnprintf
  28. #endif
  29. /* Use the system libraries version of snprintf() if available. Otherwise
  30. * use our own.
  31. */
  32. #ifndef HAVE_SNPRINTF
  33. # ifdef __STDC__
  34. int egg_snprintf(char *, size_t, const char *, ...) __attribute__((format(printf, 3, 4)));
  35. # else
  36. int egg_snprintf();
  37. # endif
  38. #else
  39. # define egg_snprintf snprintf
  40. #endif
  41. #endif /* !_EGG_COMPAT_SNPRINTF_H_ */