xsum_output.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. * xxhsum - Command line interface for xxhash algorithms
  3. * Copyright (C) 2013-2020 Yann Collet
  4. *
  5. * GPL v2 License
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License along
  18. * with this program; if not, write to the Free Software Foundation, Inc.,
  19. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  20. *
  21. * You can contact the author at:
  22. * - xxHash homepage: https://www.xxhash.com
  23. * - xxHash source repository: https://github.com/Cyan4973/xxHash
  24. */
  25. #ifndef XSUM_OUTPUT_H
  26. #define XSUM_OUTPUT_H
  27. #include "xsum_config.h"
  28. #ifdef __cplusplus
  29. extern "C" {
  30. #endif
  31. /*
  32. * How verbose the output is.
  33. */
  34. extern int XSUM_logLevel;
  35. /*
  36. * Same as fprintf(stderr, format, ...)
  37. */
  38. XSUM_ATTRIBUTE((__format__(__printf__, 1, 2)))
  39. XSUM_API int XSUM_log(const char *format, ...);
  40. /*
  41. * Like XSUM_log, but only outputs if XSUM_logLevel >= minLevel.
  42. */
  43. XSUM_ATTRIBUTE((__format__(__printf__, 2, 3)))
  44. XSUM_API int XSUM_logVerbose(int minLevel, const char *format, ...);
  45. /*
  46. * Same as printf(format, ...)
  47. */
  48. XSUM_ATTRIBUTE((__format__(__printf__, 1, 2)))
  49. XSUM_API int XSUM_output(const char *format, ...);
  50. #ifdef __cplusplus
  51. }
  52. #endif
  53. #endif /* XSUM_OUTPUT_H */