/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/Callback.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:
35
35
/**
36
36
 * A list containing the names of the callback types.
37
37
 */
38
 
static char * SCallbackTypeNames[] __attribute__((unused)) = {
 
38
UNUSED
 
39
static char *
 
40
SCallbackTypeNames[] = {
39
41
  "NULL",
40
42
  "CALLBACK",
41
43
  "NOTIFY",
56
58
};
57
59
s_object_install_callbacks (S_OBJECT(Foo), &foo_callback_entries);
58
60
 * @endcode
59
 
 * 
 
61
 *
60
62
 * The callback must have the following signature:
61
63
 * @code{.c}
62
64
spointer
67
69
 @endcode
68
70
 */
69
71
typedef struct SCallbackEntry {
70
 
  char * name; /**< The name that is used to invoke the callback. */
 
72
  schar * name; /**< The name that is used to invoke the callback. */
71
73
  Callback callback; /**< The callback that will be invoked.*/
72
74
  SCallbackType type; /**< The type of the callback, is it a standard callback
73
75
                       * or a notify? */
74
76
} SCallbackEntry;
75
77
 
 
78
#define s_callback_entry_new(n, c, t)\
 
79
 s_callback_entry_new_real (n, CALLBACK (c), t)
 
80
 
 
81
SCallbackEntry *
 
82
s_callback_entry_new_real (const schar * name,
 
83
                           Callback callback,
 
84
                           SCallbackType type);
 
85
 
 
86
void
 
87
s_callback_entry_free (SCallbackEntry * entry);
 
88
 
76
89
/**
77
90
 * @}
78
91
 * @addtogroup SObject
81
94
 
82
95
/**
83
96
 * Installs an array of callbackentries into an SObject.
84
 
 * 
 
97
 *
85
98
 * @param obj The object to install the callback entries into.
86
99
 * @param callbackentries an array containing the callback entries.
87
100
 */
88
101
void
89
 
s_object_install_callbacks (SObject * obj, SCallbackEntry ** callcackentries);
 
102
s_object_install_callbacks (SObject * obj,
 
103
                            size_t n_callbacks,
 
104
                            SCallbackEntry ** callback_entries);
90
105
 
91
106
/**
92
107
 * Installs a singel callback into an SObject.
95
110
 * @param callbackentry The callback entry to install.
96
111
 */
97
112
void
98
 
s_object_install_callback (SObject * obj, SCallbackEntry * callbackentry);
 
113
s_object_install_callback (SObject * obj, SCallbackEntry * callback_entry);
99
114
 
100
115
/**
101
116
 * @breif Do a callback.