bzr branch
http://gegoxaren.bato24.eu/bzr/%2Bjunk/c_sdl_joypad_ducktape
26
by Gustav Hartvigsson
* Fixed the DynamicArray |
1 |
#ifndef __H_DEFS__
|
2 |
#define __H_DEFS__
|
|
3 |
||
4 |
/**@file
|
|
5 |
* Definitions of different function primaries and other things that may be of
|
|
6 |
* use.
|
|
7 |
*/
|
|
8 |
||
28
by Gustav Hartvigsson
* Starded working on making GameObject compile with the new "base class". |
9 |
|
26
by Gustav Hartvigsson
* Fixed the DynamicArray |
10 |
/**
|
27
by Gustav Hartvigsson
* Started working on the an object baseclass to make things |
11 |
* <tt>BEGIN_DECLS</tt> and <tt>END_DECLS</tt> is are utility macros
|
12 |
* wrapping <tt>extern "C"</tt> for using C headers with C++ code.
|
|
13 |
*
|
|
14 |
* @code {.c}
|
|
15 |
// Foo.h
|
|
16 |
#ifndef H_FOO
|
|
17 |
#define H_FOO
|
|
18 |
||
19 |
BEGIN_DECLS
|
|
20 |
||
21 |
// Code does here
|
|
22 |
||
23 |
END_DECLS
|
|
24 |
||
25 |
#endif
|
|
26 |
@endcode
|
|
27 |
*/
|
|
28
by Gustav Hartvigsson
* Starded working on making GameObject compile with the new "base class". |
28 |
#ifdef __cplusplus
|
29 |
#define BEGIN_DECLS extern "C" {
|
|
30 |
#else
|
|
31 |
#define BEGIN_DECLS
|
|
32 |
#endif /*__cplusplus*/ |
|
27
by Gustav Hartvigsson
* Started working on the an object baseclass to make things |
33 |
|
34 |
/**
|
|
35 |
* See <tt> BEGIN_DECLS </tt>.
|
|
36 |
*/
|
|
28
by Gustav Hartvigsson
* Starded working on making GameObject compile with the new "base class". |
37 |
#ifdef __cplusplus
|
38 |
#define END_DECLS }
|
|
39 |
#else
|
|
40 |
#define END_DECLS
|
|
41 |
#endif /* __cplusplus */ |
|
27
by Gustav Hartvigsson
* Started working on the an object baseclass to make things |
42 |
|
43 |
BEGIN_DECLS
|
|
44 |
||
45 |
/**
|
|
26
by Gustav Hartvigsson
* Fixed the DynamicArray |
46 |
* Represents a pointer. Nothing special with it, just a pointer...
|
47 |
*/
|
|
48 |
typedef void * _pointer; |
|
49 |
||
50 |
/**
|
|
51 |
* Represents a constant pointer, again nothing special about it.
|
|
52 |
*/
|
|
53 |
typedef const void * const_pointer; |
|
54 |
||
55 |
/**
|
|
56 |
* Represents a for each function.
|
|
57 |
*
|
|
58 |
* @param self The data structure that is responsible for "holding" the data,
|
|
59 |
* this may be a \c DynamicArray or a \c LinkedList.
|
|
60 |
* @param item the data to be passed to the each iteration.
|
|
61 |
* @returns data to be put in a new instance of the data structure, if used with
|
|
62 |
a function that does this, like
|
|
63 |
<tt>dynamic_array_for_each_with_return</tt>
|
|
64 |
or some other data structure like a \c DynamicArray.
|
|
65 |
*/
|
|
66 |
typedef void * (* ForEachFunc)(_pointer self, _pointer item, _pointer data); |
|
67 |
||
68 |
/**
|
|
69 |
* Represents a function to be used when freeing some item in a dynamic array.
|
|
70 |
*
|
|
71 |
* @param obj The object to be freed.
|
|
72 |
*/
|
|
73 |
typedef void * (* FreeFunc)(_pointer obj); |
|
74 |
||
27
by Gustav Hartvigsson
* Started working on the an object baseclass to make things |
75 |
END_DECLS
|
76 |
||
26
by Gustav Hartvigsson
* Fixed the DynamicArray |
77 |
#endif /* __H_DEFS__ */ |