/simpletypesystem/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/simpletypesystem/trunk

« back to all changes in this revision

Viewing changes to src/Func.h

  • Committer: Gustav Hartvigsson
  • Date: 2013-09-06 15:05:32 UTC
  • mfrom: (5.2.4 simple_type_system_SMap)
  • Revision ID: gustav.hartvigsson@gmail.com-20130906150532-tudew69vmiljy1t6
* Merged the still unfinished SMap impleementation,
* TODO:
       To build a working SMap the system must determin whether or not an
       object is a child to SBaseObjectInstance or not.

       This is a non-trivial thing to do, and req. a lot of base work:
         A lookup table for objects is needed, with appropriet functions
         and probobly a main-loop.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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
 
 
19
#ifndef __H_FUNC__
 
20
#define __H_FUNC__
 
21
 
 
22
#include <stdbool.h>
 
23
 
 
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
/*
 
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
 
 
40
/*
 
41
 * Common types of function pointers:
 
42
 */
 
43
 
 
44
 
 
45
/**
 
46
 * Generic function.
 
47
 * 
 
48
 * @param 1 a void pointer to some data
 
49
 * @param 2...n a list of other parameters
 
50
 */
 
51
typedef void * (* SFuncPointer)(void *, ...);
 
52
 
 
53
typedef void (* VoidFunc)();
 
54
 
 
55
typedef void (* MethodFunc)(void *);
 
56
 
 
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
 */
 
65
typedef bool (* CompFunc)(void*, void*);
 
66
 
 
67
typedef char * (* CharFunc)();
 
68
 
 
69
#endif