source: libcaca/trunk/caca/caca_debug.h @ 4333

Last change on this file since 4333 was 4333, checked in by Sam Hocevar, 10 years ago

Large source code cleanup, getting rid of spaces, tabs, and svn keywords.

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