debug.c 314 B

12345678910111213141516171819202122
  1. /* For general debugging purposes */
  2. #include "../perf.h"
  3. #include <string.h>
  4. #include <stdarg.h>
  5. #include <stdio.h>
  6. int verbose = 0;
  7. int eprintf(const char *fmt, ...)
  8. {
  9. va_list args;
  10. int ret = 0;
  11. if (verbose) {
  12. va_start(args, fmt);
  13. ret = vfprintf(stderr, fmt, args);
  14. va_end(args);
  15. }
  16. return ret;
  17. }