25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.

caca_debug.h 1000 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * libcaca Colour ASCII-Art library
  3. * Copyright (c) 2006-2009 Sam Hocevar <sam@hocevar.net>
  4. * All Rights Reserved
  5. *
  6. * $Id$
  7. *
  8. * This library is free software; you can redistribute it and/or
  9. * modify it under the terms of the Do What The Fuck You Want To
  10. * Public License, Version 2, as published by Sam Hocevar. See
  11. * http://sam.zoy.org/wtfpl/COPYING for more details.
  12. */
  13. /*
  14. * This file contains debugging functions.
  15. */
  16. #ifndef __CACA_DEBUG_H__
  17. #define __CACA_DEBUG_H__
  18. /* debug messages */
  19. #if defined DEBUG && !defined __KERNEL__
  20. # include <stdio.h>
  21. # include <stdarg.h>
  22. static inline void debug(const char *format, ...)
  23. {
  24. int saved_errno = geterrno();
  25. va_list args;
  26. va_start(args, format);
  27. fprintf(stderr, "** libcaca debug ** ");
  28. vfprintf(stderr, format, args);
  29. fprintf(stderr, "\n");
  30. va_end(args);
  31. seterrno(saved_errno);
  32. }
  33. #else
  34. # define debug(format, ...) do {} while(0)
  35. #endif
  36. #endif /* __CACA_DEBUG_H__ */