/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 libssts/Func.h

  • Committer: Gustav Hartvigsson
  • Date: 2015-10-28 14:45:22 UTC
  • mto: This revision was merged to the branch mainline in revision 111.
  • Revision ID: gustav.hartvigsson@gmail.com-20151028144522-fo54z73ssjex0emw
* SMap seems to be broken... Or could it be SObject's Callback stuff? Or SLinkedList?

Show diffs side-by-side

added added

removed removed

Lines of Context:
34
34
/** @file
35
35
 * Generic function pointer definitions and data stuctures to do with
36
36
 * functions.
37
 
 * 
 
37
 *
38
38
 * @todo create an object type that can hold functions and be able to run them.
39
39
 */
40
40
 
51
51
#define FREEFUNC(k) ((FreeFunc) k)
52
52
#define CALLBACK(k) ((Callback) k)
53
53
#define FOREACHFUNC(k) ((ForEachFunc) k)
 
54
#define COMPFUNC(k) ((CompFunc) k)
 
55
 
54
56
 
55
57
/*
56
58
 * Common types of function pointers:
67
69
/**
68
70
 * A generic callback function.
69
71
 *
70
 
 * A callback function can have any signature.
 
72
 * @param obj The object to perform the callback on.
 
73
 * @param user_data The user data to be passed to the function.
71
74
 */
72
 
typedef void (* Callback)(void);
 
75
typedef spointer (* Callback)(spointer obj, spointer user_data);
73
76
 
74
77
/**
75
78
 *
92
95
 
93
96
/**
94
97
 * A CompFunc represents a standard comparison function.
95
 
 * 
 
98
 *
96
99
 * @param 1 object to compare
97
100
 * @param 2 object to compare
98
 
 * 
 
101
 *
99
102
 * compare parameter 1 with parameter 2.
100
103
 */
101
104
typedef sboolean (* CompFunc)(void*, void*);