diff options
author | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2011-09-16 14:35:25 +0200 |
---|---|---|
committer | Benjamin Franzke <benjaminfranzke@googlemail.com> | 2011-09-16 14:40:49 +0200 |
commit | b396ee26febb003374f877af841814940fefd034 (patch) | |
tree | 094e3de7abb9eef478fbff3be0795df0c105218c /src/cmumble.h | |
parent | 35670247b159dd65c174988a3d4ce3e105356d3a (diff) | |
download | cmumble-b396ee26febb003374f877af841814940fefd034.tar.gz cmumble-b396ee26febb003374f877af841814940fefd034.tar.bz2 cmumble-b396ee26febb003374f877af841814940fefd034.zip |
Typesafe callback initialization
Diffstat (limited to 'src/cmumble.h')
-rw-r--r-- | src/cmumble.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/cmumble.h b/src/cmumble.h index f7db59c..a6cc7f2 100644 --- a/src/cmumble.h +++ b/src/cmumble.h @@ -61,12 +61,18 @@ enum mumble_message { #undef MUMBLE_MSG }; +struct mumble_callbacks { +#define MUMBLE_MSG(a,b) void (* a)(MumbleProto__##a *, struct context *); + MUMBLE_MSGS +#undef MUMBLE_MSG +}; + typedef void (*callback_t)(ProtobufCMessage *msg, struct context *); void send_msg(struct context *ctx, ProtobufCMessage *msg); void -recv_msg(struct context *ctx, const callback_t *callbacks, uint32_t callback_size); +recv_msg(struct context *ctx, const struct mumble_callbacks *callbacks); #endif |