/contrib/ntp/include/isc/print.h

https://bitbucket.org/freebsd/freebsd-head/ · C++ Header · 69 lines · 24 code · 13 blank · 32 comment · 1 complexity · dd5921709fd6792fb8579480d5f1ab8e MD5 · raw file

  1. /*
  2. * Copyright (C) 1999-2001 Internet Software Consortium.
  3. *
  4. * Permission to use, copy, modify, and distribute this software for any
  5. * purpose with or without fee is hereby granted, provided that the above
  6. * copyright notice and this permission notice appear in all copies.
  7. *
  8. * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM
  9. * DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
  10. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL
  11. * INTERNET SOFTWARE CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT,
  12. * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING
  13. * FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
  14. * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
  15. * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  16. */
  17. /* $Id: print.h,v 1.17 2001/02/27 02:19:33 gson Exp $ */
  18. #ifndef ISC_PRINT_H
  19. #define ISC_PRINT_H 1
  20. /***
  21. *** Imports
  22. ***/
  23. #include <isc/formatcheck.h> /* Required for ISC_FORMAT_PRINTF() macro. */
  24. #include <isc/lang.h>
  25. #include <isc/platform.h>
  26. /*
  27. * This block allows lib/isc/print.c to be cleanly compiled even if
  28. * the platform does not need it. The standard Makefile will still
  29. * not compile print.c or archive print.o, so this is just to make test
  30. * compilation ("make print.o") easier.
  31. */
  32. #if !defined(ISC_PLATFORM_NEEDVSNPRINTF) && defined(ISC__PRINT_SOURCE)
  33. #define ISC_PLATFORM_NEEDVSNPRINTF
  34. #endif
  35. /***
  36. *** Macros
  37. ***/
  38. #define ISC_PRINT_QUADFORMAT ISC_PLATFORM_QUADFORMAT
  39. /***
  40. *** Functions
  41. ***/
  42. #ifdef ISC_PLATFORM_NEEDVSNPRINTF
  43. #include <stdarg.h>
  44. #include <stddef.h>
  45. ISC_LANG_BEGINDECLS
  46. int
  47. isc_print_vsnprintf(char *str, size_t size, const char *format, va_list ap)
  48. ISC_FORMAT_PRINTF(3, 0);
  49. #define vsnprintf isc_print_vsnprintf
  50. int
  51. isc_print_snprintf(char *str, size_t size, const char *format, ...)
  52. ISC_FORMAT_PRINTF(3, 4);
  53. #define snprintf isc_print_snprintf
  54. ISC_LANG_ENDDECLS
  55. #endif /* ISC_PLATFORM_NEEDVSNPRINTF */
  56. #endif /* ISC_PRINT_H */