115 */ |
115 */ |
116 #define GENERATE_CB_SETTER_AND_DEFAULT(cbName, cbParameterTypes) \ |
116 #define GENERATE_CB_SETTER_AND_DEFAULT(cbName, cbParameterTypes) \ |
117 static void _noop_callback_##cbName cbParameterTypes {} \ |
117 static void _noop_callback_##cbName cbParameterTypes {} \ |
118 GENERATE_CB_SETTER(cbName, cbParameterTypes, _noop_callback_##cbName) |
118 GENERATE_CB_SETTER(cbName, cbParameterTypes, _noop_callback_##cbName) |
119 |
119 |
120 // TODO Disallow transfer of ownership? |
|
121 GENERATE_CB_SETTER(onMessage, (void *context, int msgtype, const char *msg), defaultCallback_onMessage); |
120 GENERATE_CB_SETTER(onMessage, (void *context, int msgtype, const char *msg), defaultCallback_onMessage); |
122 GENERATE_CB_SETTER_AND_DEFAULT(onConnected, (void *context)); |
121 GENERATE_CB_SETTER_AND_DEFAULT(onConnected, (void *context)); |
123 GENERATE_CB_SETTER_AND_DEFAULT(onDisconnected, (void *context, int reason, const char *message)); |
122 GENERATE_CB_SETTER_AND_DEFAULT(onDisconnected, (void *context, int reason, const char *message)); |
124 GENERATE_CB_SETTER_AND_DEFAULT(onRoomlist, (void *context, const flib_room **rooms, int roomCount)); |
123 GENERATE_CB_SETTER_AND_DEFAULT(onRoomlist, (void *context, const flib_room **rooms, int roomCount)); |
125 GENERATE_CB_SETTER_AND_DEFAULT(onRoomAdd, (void *context, const flib_room *room)); |
124 GENERATE_CB_SETTER_AND_DEFAULT(onRoomAdd, (void *context, const flib_room *room)); |