You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

36 lines
750 B

  1. /*
  2. * Labjack Tools
  3. * Copyright (c) 2003-2007 Jim Paris <jim@jtan.com>
  4. *
  5. * This is free software; you can redistribute it and/or modify it and
  6. * it is provided under the terms of version 2 of the GNU General Public
  7. * License as published by the Free Software Foundation; see COPYING.
  8. */
  9. #ifndef DEBUG_H
  10. #define DEBUG_H
  11. extern int verb_count;
  12. #include <stdio.h>
  13. int func_fprintf(const char *func, FILE * stream, const char *format,
  14. ...) __attribute__ ((format(printf, 3, 4)));
  15. #define debug(x...) ({ \
  16. if(verb_count >= 2) \
  17. func_fprintf(__func__, stderr,x); \
  18. })
  19. #define verb(x...) ({ \
  20. if(verb_count >= 1) \
  21. func_fprintf(__func__, stderr,x); \
  22. })
  23. #define info(x...) ({ \
  24. if(verb_count >= 0) \
  25. fprintf(stderr,x); \
  26. })
  27. #endif