/+junk/c_sdl_joypad_ducktape

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/%2Bjunk/c_sdl_joypad_ducktape
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#ifndef __H_DEFS__
#define __H_DEFS__

/**@file
 * Definitions of different function primaries and other things that may be of
 * use.
 */


/**
 * <tt>BEGIN_DECLS</tt> and <tt>END_DECLS</tt> is are utility macros
 * wrapping <tt>extern "C"</tt> for using C headers with C++ code.
 *
 * @code {.c}
// Foo.h
#ifndef H_FOO
#define H_FOO

BEGIN_DECLS

// Code does here

END_DECLS

#endif
  @endcode
 */
#ifdef __cplusplus
#define BEGIN_DECLS extern "C" {
#else
#define BEGIN_DECLS
#endif /*__cplusplus*/

/**
 * See <tt> BEGIN_DECLS </tt>.
 */
#ifdef __cplusplus
#define END_DECLS }
#else
#define END_DECLS
#endif /* __cplusplus */

BEGIN_DECLS

/**
 * Represents a pointer. Nothing special with it, just a pointer...
 */
typedef void * _pointer;

/**
 * Represents a constant pointer, again nothing special about it.
 */
typedef const void * const_pointer;

/**
 * Represents a for each function.
 * 
 * @param self The data structure that is responsible for "holding" the data,
 *             this may be a \c DynamicArray or a \c LinkedList.
 * @param item the data to be passed to the each iteration.
 * @returns data to be put in a new instance of the data structure, if used with
            a function that does this, like
            <tt>dynamic_array_for_each_with_return</tt>
            or some other data structure like a \c DynamicArray.
 */
typedef void * (* ForEachFunc)(_pointer self, _pointer item, _pointer data);

/**
 * Represents a function to be used when freeing some item in a dynamic array.
 *
 * @param obj The object to be freed.
 */
typedef void * (* FreeFunc)(_pointer obj);

END_DECLS

#endif /* __H_DEFS__ */