bzr branch
http://gegoxaren.bato24.eu/bzr/simpletypesystem/trunk
|
5.2.4
by Gustav Hartvigsson
Finished documenting the SMap and SMapItem interfaces. |
1 |
/*
|
|
5.2.7
by Gustav Hartvigsson
* Switched licence to a more permisive one. |
2 |
Copyright (c) 2013-2014 Gustav Hartvigsson
|
3 |
||
4 |
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5 |
of this software and associated documentation files (the "Software"), to deal
|
|
6 |
in the Software without restriction, including without limitation the rights
|
|
7 |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
8 |
copies of the Software, and to permit persons to whom the Software is
|
|
9 |
furnished to do so, subject to the following conditions:
|
|
10 |
||
11 |
The above copyright notice and this permission notice shall be included in
|
|
12 |
all copies or substantial portions of the Software.
|
|
13 |
||
14 |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
15 |
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
16 |
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
17 |
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
18 |
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
19 |
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
20 |
THE SOFTWARE.
|
|
|
5.2.4
by Gustav Hartvigsson
Finished documenting the SMap and SMapItem interfaces. |
21 |
*/
|
22 |
||
23 |
||
|
5.2.1
by Gustav Hartvigsson
Started work on the Map (SMap) data structure. |
24 |
#ifndef __H_FUNC__
|
25 |
#define __H_FUNC__
|
|
26 |
||
27 |
#include <stdbool.h> |
|
|
5.2.8
by Gustav Hartvigsson
* Copied over LinkedList and DynamicArray from c_sdl_js |
28 |
#include "defs.h" |
29 |
#include "utils" |
|
|
5.2.1
by Gustav Hartvigsson
Started work on the Map (SMap) data structure. |
30 |
|
|
5.2.4
by Gustav Hartvigsson
Finished documenting the SMap and SMapItem interfaces. |
31 |
/** @file
|
32 |
* Generic function pointer definitions and data stuctures to do with
|
|
33 |
* functions.
|
|
34 |
*
|
|
35 |
* @todo create an object type that can hold functions and be able to run them.
|
|
36 |
*/
|
|
37 |
||
38 |
||
39 |
/*
|
|
|
5.2.1
by Gustav Hartvigsson
Started work on the Map (SMap) data structure. |
40 |
* This data structure holds a pointer to a function.
|
41 |
*
|
|
42 |
* A Func object must hold a pointer to a function and can hold a string,
|
|
43 |
* representing its name.
|
|
44 |
*/
|
|
45 |
||
46 |
||
|
5.2.4
by Gustav Hartvigsson
Finished documenting the SMap and SMapItem interfaces. |
47 |
/*
|
|
5.2.1
by Gustav Hartvigsson
Started work on the Map (SMap) data structure. |
48 |
* Common types of function pointers:
|
49 |
*/
|
|
50 |
||
51 |
||
|
5.2.4
by Gustav Hartvigsson
Finished documenting the SMap and SMapItem interfaces. |
52 |
/**
|
53 |
* Generic function.
|
|
54 |
*
|
|
55 |
* @param 1 a void pointer to some data
|
|
56 |
* @param 2...n a list of other parameters
|
|
57 |
*/
|
|
|
5.2.1
by Gustav Hartvigsson
Started work on the Map (SMap) data structure. |
58 |
typedef void * (* SFuncPointer)(void *, ...); |
59 |
||
60 |
typedef void (* VoidFunc)(); |
|
61 |
||
62 |
typedef void (* MethodFunc)(void *); |
|
63 |
||
|
5.2.4
by Gustav Hartvigsson
Finished documenting the SMap and SMapItem interfaces. |
64 |
/**
|
65 |
* A CompFunc represents a standard comparison function.
|
|
66 |
*
|
|
67 |
* @param 1 object to compare
|
|
68 |
* @param 2 object to compare
|
|
69 |
*
|
|
70 |
* compare parameter 1 with parameter 2.
|
|
71 |
*/
|
|
|
5.2.1
by Gustav Hartvigsson
Started work on the Map (SMap) data structure. |
72 |
typedef bool (* CompFunc)(void*, void*); |
73 |
||
74 |
typedef char * (* CharFunc)(); |
|
75 |
||
76 |
#endif
|