~ubuntu-branches/ubuntu/raring/libcaca/raring

« back to all changes in this revision

Viewing changes to caca/caca_stubs.h

  • Committer: Bazaar Package Importer
  • Author(s): Sam Hocevar
  • Date: 2010-02-08 01:40:59 UTC
  • mfrom: (1.1.8 upstream) (4.1.6 sid)
  • Revision ID: james.westby@ubuntu.com-20100208014059-9q4av8pze8p7uw3i
Tags: 0.99.beta17-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 *  libcaca       Colour ASCII-Art library
3
 
 *  Copyright (c) 2006 Sam Hocevar <sam@zoy.org>
 
3
 *  Copyright (c) 2006 Sam Hocevar <sam@hocevar.net>
4
4
 *                All Rights Reserved
5
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
 
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
11
10
 *  http://sam.zoy.org/wtfpl/COPYING for more details.
12
11
 */
13
12
 
16
15
 *  function prototypes that are sometimes missing.
17
16
 */
18
17
 
19
 
#ifndef __STUBS_H__
20
 
#define __STUBS_H__
 
18
#ifndef __CACA_STUBS_H__
 
19
#define __CACA_STUBS_H__
21
20
 
22
21
/* errno handling */
23
22
#if defined HAVE_ERRNO_H && !defined __KERNEL__
29
28
#   define geterrno(x) 0
30
29
#endif
31
30
 
32
 
/* debug messages */
33
 
#if defined DEBUG && !defined __KERNEL__
34
 
#   include <stdio.h>
35
 
#   include <stdarg.h>
36
 
static inline void debug(const char *format, ...)
37
 
{
38
 
    int saved_errno = geterrno();
39
 
    va_list args;
40
 
    va_start(args, format);
41
 
    fprintf(stderr, "** libcaca debug ** ");
42
 
    vfprintf(stderr, format, args);
43
 
    fprintf(stderr, "\n");
44
 
    va_end(args);
45
 
    seterrno(saved_errno);
46
 
}
47
 
#else
48
 
#   define debug(format, ...) do {} while(0)
49
 
#endif
50
 
 
51
31
/* hton16() and hton32() */
52
32
#if defined HAVE_HTONS && !defined __KERNEL__
53
33
#   if defined HAVE_ARPA_INET_H
93
73
}
94
74
#endif
95
75
 
96
 
#endif /* __STUBS_H__ */
 
76
#endif /* __CACA_STUBS_H__ */
97
77