From 4e40978b90b1056223a88a3489018fb1de8c4981 Mon Sep 17 00:00:00 2001 From: dubslow Date: Tue, 4 Nov 2014 20:54:21 -0600 Subject: [PATCH] fix type checking --- toxcore/group.c | 2 +- toxcore/group.h | 14 ++++++++++++++ toxcore/tox.c | 2 +- toxcore/tox.h | 2 +- 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/toxcore/group.c b/toxcore/group.c index c158a91b..54d24b98 100644 --- a/toxcore/group.c +++ b/toxcore/group.c @@ -996,7 +996,7 @@ void g_callback_group_namelistchange(Group_Chats *g_c, void (*function)(Messenge g_c->group_namelistchange_userdata = userdata; } -/* Set callback funciton for title changes. +/* Set callback function for title changes. * * Function(Group_Chats *g_c, int groupnumber, int friendgroupnumber, uint8_t * title, uint8_t length, void *userdata) * if friendgroupnumber == -1, then author is unknown (e.g. initial joining the group) diff --git a/toxcore/group.h b/toxcore/group.h index 8a82a5ab..0962a443 100644 --- a/toxcore/group.h +++ b/toxcore/group.h @@ -155,6 +155,14 @@ void g_callback_group_message(Group_Chats *g_c, void (*function)(Messenger *m, i void g_callback_group_action(Group_Chats *g_c, void (*function)(Messenger *m, int, int, const uint8_t *, uint16_t, void *), void *userdata); +/* Set callback function for title changes. + * + * Function(Group_Chats *g_c, int groupnumber, int friendgroupnumber, uint8_t * title, uint8_t length, void *userdata) + * if friendgroupnumber == -1, then author is unknown (e.g. initial joining the group) + */ +void g_callback_group_title(Group_Chats *g_c, void (*function)(Messenger *m, int, int, const uint8_t *, uint8_t, + void *), void *userdata); + /* Set callback function for peer name list changes. * * It gets called every time the name list changes(new peer/name, deleted peer) @@ -219,6 +227,12 @@ int group_message_send(const Group_Chats *g_c, int groupnumber, const uint8_t *m */ int group_action_send(const Group_Chats *g_c, int groupnumber, const uint8_t *action, uint16_t length); +/* set the group's title, limited to MAX_NAME_LENGTH + * return 0 on success + * return -1 on failure + */ +int group_title_send(const Group_Chats *g_c, int groupnumber, const uint8_t *title, uint8_t title_len); + /* Return the number of peers in the group chat on success. * return -1 on failure */ diff --git a/toxcore/tox.c b/toxcore/tox.c index 2f578971..0cdcca8c 100644 --- a/toxcore/tox.c +++ b/toxcore/tox.c @@ -589,7 +589,7 @@ void tox_callback_group_action(Tox *tox, void (*function)(Messenger *tox, int, i * Function(Tox *tox, int groupnumber, int peernumber, uint8_t * title, uint8_t length, void *userdata) * if peernumber == -1, then author is unknown (e.g. initial joining the group) */ -void tox_callback_group_title(Tox *tox, void (*function)(Tox *tox, int, int, const uint8_t *, uint16_t, +void tox_callback_group_title(Tox *tox, void (*function)(Messenger *tox, int, int, const uint8_t *, uint8_t, void *), void *userdata) { Messenger *m = tox; diff --git a/toxcore/tox.h b/toxcore/tox.h index 40ab6c72..8de0250e 100644 --- a/toxcore/tox.h +++ b/toxcore/tox.h @@ -457,7 +457,7 @@ void tox_callback_group_action(Tox *tox, void (*function)(Tox *tox, int, int, co * Function(Tox *tox, int groupnumber, int peernumber, uint8_t * title, uint8_t length, void *userdata) * if peernumber == -1, then author is unknown (e.g. initial joining the group) */ -void tox_callback_group_title(Tox *tox, void (*function)(Tox *tox, int, int, const uint8_t *, uint16_t, +void tox_callback_group_title(Tox *tox, void (*function)(Tox *tox, int, int, const uint8_t *, uint8_t, void *), void *userdata); /* Set callback function for peer name list changes.