/simpletypesystem/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/simpletypesystem/trunk
5.2.4 by Gustav Hartvigsson
Finished documenting the SMap and SMapItem interfaces.
1
/*
2
    (C) Gustav Hartvigsson, 2013.
3
    
4
    This program is free software: you can redistribute it and/or modify
5
    it under the terms of the GNU Lesser General Public License as
6
    published by the Free Software Foundation, either version 3 of the
7
    License.
8
9
    This program is distributed in the hope that it will be useful,
10
    but WITHOUT ANY WARRANTY; without even the implied warranty of
11
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
    GNU General Public License for more details.
13
14
    You should have received a copy of the GNU General Public License
15
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
16
*/
17
18
5.2.1 by Gustav Hartvigsson
Started work on the Map (SMap) data structure.
19
#ifndef __H_FUNC__
20
#define __H_FUNC__
21
22
#include <stdbool.h>
23
5.2.4 by Gustav Hartvigsson
Finished documenting the SMap and SMapItem interfaces.
24
/** @file
25
 * Generic function pointer definitions and data stuctures to do with
26
 * functions.
27
 * 
28
 * @todo create an object type that can hold functions and be able to run them.
29
 */
30
31
32
/*
5.2.1 by Gustav Hartvigsson
Started work on the Map (SMap) data structure.
33
 * This data structure holds a pointer to a function.
34
 *
35
 * A Func object must hold a pointer to a function and can hold a string,
36
 * representing its name.
37
 */
38
39
5.2.4 by Gustav Hartvigsson
Finished documenting the SMap and SMapItem interfaces.
40
/*
5.2.1 by Gustav Hartvigsson
Started work on the Map (SMap) data structure.
41
 * Common types of function pointers:
42
 */
43
44
5.2.4 by Gustav Hartvigsson
Finished documenting the SMap and SMapItem interfaces.
45
/**
46
 * Generic function.
47
 * 
48
 * @param 1 a void pointer to some data
49
 * @param 2...n a list of other parameters
50
 */
5.2.1 by Gustav Hartvigsson
Started work on the Map (SMap) data structure.
51
typedef void * (* SFuncPointer)(void *, ...);
52
53
typedef void (* VoidFunc)();
54
55
typedef void (* MethodFunc)(void *);
56
5.2.4 by Gustav Hartvigsson
Finished documenting the SMap and SMapItem interfaces.
57
/**
58
 * A CompFunc represents a standard comparison function.
59
 * 
60
 * @param 1 object to compare
61
 * @param 2 object to compare
62
 * 
63
 * compare parameter 1 with parameter 2.
64
 */
5.2.1 by Gustav Hartvigsson
Started work on the Map (SMap) data structure.
65
typedef bool (* CompFunc)(void*, void*);
66
67
typedef char * (* CharFunc)();
68
69
#endif