commit f321938e8a4475fce7924d7597075dcf9d7eab06 parent a0e7c78d7b5fb6a26042a8c2870a130b39ee0481 Author: Jacki <jacki@thejackimonster.de> Date: Thu, 26 Sep 2024 01:22:37 +0200 Adjust API to use non-const struct pointer in iterations and modifying functions Signed-off-by: Jacki <jacki@thejackimonster.de> Diffstat:
29 files changed, 124 insertions(+), 124 deletions(-)
diff --git a/include/gnunet/gnunet_chat_lib.h b/include/gnunet/gnunet_chat_lib.h @@ -251,27 +251,27 @@ struct GNUNET_CHAT_Discourse; * Iterator over chat accounts of a specific chat handle. * * @param[in,out] cls Closure from #GNUNET_CHAT_iterate_accounts - * @param[in] handle Chat handle + * @param[in,out] handle Chat handle * @param[in,out] account Chat account * @return #GNUNET_YES if we should continue to iterate, #GNUNET_NO otherwise. */ typedef enum GNUNET_GenericReturnValue (*GNUNET_CHAT_AccountCallback) (void *cls, - const struct GNUNET_CHAT_Handle *handle, + struct GNUNET_CHAT_Handle *handle, struct GNUNET_CHAT_Account *account); /** * Iterator over attributes of a specific chat account. * * @param[in,out] cls Closure from #GNUNET_CHAT_get_attributes - * @param[in] account Chat account + * @param[in,out] account Chat account * @param[in] name Attribute name * @param[in] value Attribute value * @return #GNUNET_YES if we should continue to iterate, #GNUNET_NO otherwise. */ typedef enum GNUNET_GenericReturnValue (*GNUNET_CHAT_AccountAttributeCallback) (void *cls, - const struct GNUNET_CHAT_Account *account, + struct GNUNET_CHAT_Account *account, const char *name, const char *value); @@ -330,13 +330,13 @@ typedef enum GNUNET_GenericReturnValue * Iterator over tags of a specific chat contact. * * @param[in,out] cls Closure - * @param[in] contact Chat contact + * @param[in,out] contact Chat contact * @param[in] tag Tag * @return #GNUNET_YES if we should continue to iterate, #GNUNET_NO otherwise. */ typedef enum GNUNET_GenericReturnValue (*GNUNET_CHAT_ContactTagCallback) (void *cls, - const struct GNUNET_CHAT_Contact *contact, + struct GNUNET_CHAT_Contact *contact, const char *tag); /** @@ -371,13 +371,13 @@ typedef enum GNUNET_GenericReturnValue * Iterator over chat contacts in a specific chat group. * * @param[in,out] cls Closure from #GNUNET_CHAT_group_iterate_contacts - * @param[in] group Chat group + * @param[in,out] group Chat group * @param[in,out] contact Chat contact * @return #GNUNET_YES if we should continue to iterate, #GNUNET_NO otherwise. */ typedef enum GNUNET_GenericReturnValue (*GNUNET_CHAT_GroupContactCallback) (void *cls, - const struct GNUNET_CHAT_Group *group, + struct GNUNET_CHAT_Group *group, struct GNUNET_CHAT_Contact *contact); /** @@ -385,13 +385,13 @@ typedef enum GNUNET_GenericReturnValue * * @param[in,out] cls Closure from #GNUNET_CHAT_context_iterate_messages * @param[in,out] context Chat context or NULL - * @param[in] message Chat message + * @param[in,out] message Chat message * @return #GNUNET_YES if we should continue to iterate, #GNUNET_NO otherwise. */ typedef enum GNUNET_GenericReturnValue (*GNUNET_CHAT_ContextMessageCallback) (void *cls, struct GNUNET_CHAT_Context *context, - const struct GNUNET_CHAT_Message *message); + struct GNUNET_CHAT_Message *message); /** * Iterator over chat files in a specific chat context. @@ -411,28 +411,28 @@ typedef enum GNUNET_GenericReturnValue * specific message or not. * * @param[in,out] cls Closure from #GNUNET_CHAT_message_get_read_receipt - * @param[in] message Chat message - * @param[in] contact Chat contact + * @param[in,out] message Chat message + * @param[in,out] contact Chat contact * @param[in] read_receipt #GNUNET_YES if the message was received by the contact, * #GNUNET_NO otherwise * @return #GNUNET_YES if we should continue to iterate, #GNUNET_NO otherwise. */ typedef enum GNUNET_GenericReturnValue (*GNUNET_CHAT_MessageReadReceiptCallback) (void *cls, - const struct GNUNET_CHAT_Message *message, - const struct GNUNET_CHAT_Contact *contact, + struct GNUNET_CHAT_Message *message, + struct GNUNET_CHAT_Contact *contact, int read_receipt); /** - * Iterator over chat messages. + * Iterator over chat tag messages with a specific target message. * - * @param[in,out] cls Closure from #GNUNET_CHAT_context_iterate_messages - * @param[in] message Chat message + * @param[in,out] cls Closure from #GNUNET_CHAT_message_iterate_tags + * @param[in,out] message Chat message * @return #GNUNET_YES if we should continue to iterate, #GNUNET_NO otherwise. */ typedef enum GNUNET_GenericReturnValue (*GNUNET_CHAT_MessageCallback) (void *cls, - const struct GNUNET_CHAT_Message *message); + struct GNUNET_CHAT_Message *message); /** * Method called during an upload of a specific file in a chat to share it. @@ -493,13 +493,13 @@ typedef enum GNUNET_GenericReturnValue * Iterator over chat contacts in a specific chat discourse. * * @param[in,out] cls Closure from #GNUNET_CHAT_discourse_iterate_contacts - * @param[in] discourse Chat discourse + * @param[in,out] discourse Chat discourse * @param[in,out] contact Chat contact * @return #GNUNET_YES if we should continue to iterate, #GNUNET_NO otherwise. */ typedef enum GNUNET_GenericReturnValue (*GNUNET_CHAT_DiscourseContactCallback) (void *cls, - const struct GNUNET_CHAT_Discourse *discourse, + struct GNUNET_CHAT_Discourse *discourse, struct GNUNET_CHAT_Contact *contact); /** @@ -558,17 +558,17 @@ GNUNET_CHAT_account_delete(struct GNUNET_CHAT_Handle *handle, * Iterates through the accounts of a given chat <i>handle</i> with a selected * callback and custom closure. * - * @param[in] handle Chat handle + * @param[in,out] handle Chat handle * @param[in] callback Callback for account iteration (optional) * @param[in,out] cls Closure for account iteration (optional) * @return Amount of accounts iterated or #GNUNET_SYSERR on failure */ int -GNUNET_CHAT_iterate_accounts (const struct GNUNET_CHAT_Handle *handle, +GNUNET_CHAT_iterate_accounts (struct GNUNET_CHAT_Handle *handle, GNUNET_CHAT_AccountCallback callback, void *cls); -/* +/** * Searches for an existing chat account of a given chat <i>handle</i> with * a unique <i>name</i>. * @@ -583,11 +583,12 @@ GNUNET_CHAT_find_account (const struct GNUNET_CHAT_Handle *handle, /** * Connects a chat <i>handle</i> to a selected chat <i>account</i>. * - * @param[in] account Chat account + * @param[in,out] handle Chat handle + * @param[in,out] account Chat account */ void GNUNET_CHAT_connect (struct GNUNET_CHAT_Handle *handle, - const struct GNUNET_CHAT_Account *account); + struct GNUNET_CHAT_Account *account); /** * Disconnects a chat <i>handle</i> from the current chat account. @@ -601,10 +602,10 @@ GNUNET_CHAT_disconnect (struct GNUNET_CHAT_Handle *handle); * Returns the connected account of a chat <i>handle</i> for related * communication or NULL if no account is set yet. * - * @param handle Chat handle + * @param[in] handle Chat handle * @return Account used by the handle or NULL */ -const struct GNUNET_CHAT_Account* +struct GNUNET_CHAT_Account* GNUNET_CHAT_get_connected (const struct GNUNET_CHAT_Handle *handle); /** @@ -898,7 +899,7 @@ GNUNET_CHAT_account_get_name (const struct GNUNET_CHAT_Account *account); */ void GNUNET_CHAT_account_get_attributes (struct GNUNET_CHAT_Handle *handle, - const struct GNUNET_CHAT_Account *account, + struct GNUNET_CHAT_Account *account, GNUNET_CHAT_AccountAttributeCallback callback, void *cls); @@ -1100,7 +1101,7 @@ GNUNET_CHAT_contact_is_tagged (const struct GNUNET_CHAT_Contact *contact, * @param[in,out] cls Closure for tag iteration (optional) */ void -GNUNET_CHAT_contact_get_tags (const struct GNUNET_CHAT_Contact *contact, +GNUNET_CHAT_contact_get_tags (struct GNUNET_CHAT_Contact *contact, GNUNET_CHAT_ContactTagCallback callback, void *cls); @@ -1176,7 +1177,7 @@ GNUNET_CHAT_group_get_user_pointer (const struct GNUNET_CHAT_Group *group); * @param[in,out] contact Contact */ void -GNUNET_CHAT_group_invite_contact (const struct GNUNET_CHAT_Group *group, +GNUNET_CHAT_group_invite_contact (struct GNUNET_CHAT_Group *group, struct GNUNET_CHAT_Contact *contact); /** @@ -1189,7 +1190,7 @@ GNUNET_CHAT_group_invite_contact (const struct GNUNET_CHAT_Group *group, * @return Amount of contacts iterated or #GNUNET_SYSERR on failure */ int -GNUNET_CHAT_group_iterate_contacts (const struct GNUNET_CHAT_Group *group, +GNUNET_CHAT_group_iterate_contacts (struct GNUNET_CHAT_Group *group, GNUNET_CHAT_GroupContactCallback callback, void *cls); @@ -1304,12 +1305,12 @@ GNUNET_CHAT_context_send_text (struct GNUNET_CHAT_Context *context, * chat <i>context</i>. * * @param[in,out] context Chat context - * @param[in] message Message (optional) + * @param[in,out] message Message (optional) * @return #GNUNET_OK on success, #GNUNET_SYSERR on failure */ enum GNUNET_GenericReturnValue GNUNET_CHAT_context_send_read_receipt (struct GNUNET_CHAT_Context *context, - const struct GNUNET_CHAT_Message *message); + struct GNUNET_CHAT_Message *message); /** * Uploads a local file specified via its <i>path</i> using symmetric encryption @@ -1333,25 +1334,25 @@ GNUNET_CHAT_context_send_file (struct GNUNET_CHAT_Context *context, * another chat in a given chat <i>context</i>. * * @param[in,out] context Chat context - * @param[in] file File handle + * @param[in,out] file File handle * @return #GNUNET_OK on success, #GNUNET_SYSERR on failure */ enum GNUNET_GenericReturnValue GNUNET_CHAT_context_share_file (struct GNUNET_CHAT_Context *context, - const struct GNUNET_CHAT_File *file); + struct GNUNET_CHAT_File *file); /** * Sends a tag message targeting a selected <i>message</i> into a given * chat <i>context</i> with a given <i>tag</i> value. * * @param[in,out] context Chat context - * @param[in] message Message + * @param[in,out] message Message * @param[in] tag Tag value * @return #GNUNET_OK on success, #GNUNET_SYSERR on failure */ enum GNUNET_GenericReturnValue GNUNET_CHAT_context_send_tag (struct GNUNET_CHAT_Context *context, - const struct GNUNET_CHAT_Message *message, + struct GNUNET_CHAT_Message *message, const char *tag); /** @@ -1516,13 +1517,13 @@ GNUNET_CHAT_message_is_tagged (const struct GNUNET_CHAT_Message *message, * Iterates through the contacts of the context related to a given chat * <i>message</i> to check whether it was received by each of the contacts. * - * @param[in] message Message + * @param[in,out] message Message * @param[in] callback Callback for contact iteration (optional) * @param[in,out] cls Closure for contact iteration (optional) * @return Amount of contacts iterated or #GNUNET_SYSERR on failure */ int -GNUNET_CHAT_message_get_read_receipt (const struct GNUNET_CHAT_Message *message, +GNUNET_CHAT_message_get_read_receipt (struct GNUNET_CHAT_Message *message, GNUNET_CHAT_MessageReadReceiptCallback callback, void *cls); @@ -1545,7 +1546,7 @@ GNUNET_CHAT_message_get_text (const struct GNUNET_CHAT_Message *message); * @param[in] message Message * @return The account of message or NULL */ -const struct GNUNET_CHAT_Account* +struct GNUNET_CHAT_Account* GNUNET_CHAT_message_get_account (const struct GNUNET_CHAT_Message *message); /** @@ -1587,31 +1588,31 @@ GNUNET_CHAT_message_get_discourse (const struct GNUNET_CHAT_Message *message); * @param[in] message Message * @return The target of message or NULL */ -const struct GNUNET_CHAT_Message* +struct GNUNET_CHAT_Message* GNUNET_CHAT_message_get_target (const struct GNUNET_CHAT_Message *message); /** * Deletes a given <i>message</i> with a specific relative <i>delay</i>. * - * @param[in] message Message + * @param[in,out] message Message * @param[in] delay Relative delay * @return #GNUNET_OK on success, #GNUNET_SYSERR on failure */ enum GNUNET_GenericReturnValue -GNUNET_CHAT_message_delete (const struct GNUNET_CHAT_Message *message, +GNUNET_CHAT_message_delete (struct GNUNET_CHAT_Message *message, struct GNUNET_TIME_Relative delay); /** * Iterates through the tag messages in the context of a given * <i>message</i>. * - * @param[in] message Message + * @param[in,out] message Message * @param[in] callback Callback for tag message iteration (optional) * @param[in,out] cls Closure for tag message iteration (optional) * @return Amount of tag messages iterated or #GNUNET_SYSERR on failure */ int -GNUNET_CHAT_message_iterate_tags (const struct GNUNET_CHAT_Message *message, +GNUNET_CHAT_message_iterate_tags (struct GNUNET_CHAT_Message *message, GNUNET_CHAT_MessageCallback callback, void *cls); @@ -1959,7 +1960,7 @@ GNUNET_CHAT_discourse_get_fd (const struct GNUNET_CHAT_Discourse *discourse); * @return Amount of contacts iterated or #GNUNET_SYSERR on failure */ int -GNUNET_CHAT_discourse_iterate_contacts (const struct GNUNET_CHAT_Discourse *discourse, +GNUNET_CHAT_discourse_iterate_contacts (struct GNUNET_CHAT_Discourse *discourse, GNUNET_CHAT_DiscourseContactCallback callback, void *cls); diff --git a/src/gnunet_chat_contact.c b/src/gnunet_chat_contact.c @@ -389,8 +389,8 @@ skip_tag_search: } void -contact_iterate_tags (const struct GNUNET_CHAT_Contact *contact, - const struct GNUNET_CHAT_Context *context, +contact_iterate_tags (struct GNUNET_CHAT_Contact *contact, + struct GNUNET_CHAT_Context *context, GNUNET_CHAT_ContactTagCallback callback, void *cls) { diff --git a/src/gnunet_chat_contact.h b/src/gnunet_chat_contact.h @@ -169,8 +169,8 @@ contact_tag (struct GNUNET_CHAT_Contact *contact, * @param[in,out] cls Closure for tag iteration or NULL */ void -contact_iterate_tags (const struct GNUNET_CHAT_Contact *contact, - const struct GNUNET_CHAT_Context *context, +contact_iterate_tags (struct GNUNET_CHAT_Contact *contact, + struct GNUNET_CHAT_Context *context, GNUNET_CHAT_ContactTagCallback callback, void *cls); diff --git a/src/gnunet_chat_contact_intern.c b/src/gnunet_chat_contact_intern.c @@ -66,7 +66,7 @@ struct GNUNET_CHAT_ContactFindTag enum GNUNET_GenericReturnValue it_contact_find_tag (void *cls, - const struct GNUNET_CHAT_Message *message) + struct GNUNET_CHAT_Message *message) { GNUNET_assert((cls) && (message)); @@ -94,7 +94,7 @@ struct GNUNET_CHAT_ContactIterateUniqueTag enum GNUNET_GenericReturnValue it_contact_iterate_unique_tag (void *cls, - const struct GNUNET_CHAT_Contact *contact, + struct GNUNET_CHAT_Contact *contact, const char *tag) { GNUNET_assert((cls) && (contact) && (tag)); @@ -119,14 +119,14 @@ it_contact_iterate_unique_tag (void *cls, struct GNUNET_CHAT_ContactIterateTag { - const struct GNUNET_CHAT_Contact *contact; + struct GNUNET_CHAT_Contact *contact; GNUNET_CHAT_ContactTagCallback callback; void *cls; }; enum GNUNET_GenericReturnValue it_contact_iterate_tag (void *cls, - const struct GNUNET_CHAT_Message *message) + struct GNUNET_CHAT_Message *message) { GNUNET_assert((cls) && (message)); diff --git a/src/gnunet_chat_handle.c b/src/gnunet_chat_handle.c @@ -326,7 +326,7 @@ handle_update_identity(struct GNUNET_CHAT_Handle *handle) void handle_connect (struct GNUNET_CHAT_Handle *handle, - const struct GNUNET_CHAT_Account *account) + struct GNUNET_CHAT_Account *account) { GNUNET_assert( (handle) && (account) && @@ -790,7 +790,7 @@ handle_get_key (const struct GNUNET_CHAT_Handle *handle) void handle_send_internal_message (struct GNUNET_CHAT_Handle *handle, - const struct GNUNET_CHAT_Account *account, + struct GNUNET_CHAT_Account *account, struct GNUNET_CHAT_Context *context, enum GNUNET_CHAT_MessageFlag flag, const char *warning, diff --git a/src/gnunet_chat_handle.h b/src/gnunet_chat_handle.h @@ -106,8 +106,8 @@ struct GNUNET_CHAT_Handle struct GNUNET_CHAT_InternalAccounts *accounts_head; struct GNUNET_CHAT_InternalAccounts *accounts_tail; - const struct GNUNET_CHAT_Account *next; - const struct GNUNET_CHAT_Account *current; + struct GNUNET_CHAT_Account *next; + struct GNUNET_CHAT_Account *current; struct GNUNET_NAMESTORE_ZoneMonitor *monitor; struct GNUNET_CHAT_InternalLobbies *lobbies_head; @@ -180,7 +180,7 @@ handle_destroy (struct GNUNET_CHAT_Handle *handle); */ void handle_connect (struct GNUNET_CHAT_Handle *handle, - const struct GNUNET_CHAT_Account *account); + struct GNUNET_CHAT_Account *account); /** * Disconnects a given chat <i>handle</i> from its current @@ -297,7 +297,7 @@ handle_get_key (const struct GNUNET_CHAT_Handle *handle); * as instant feedback. * * @param[in,out] handle Chat handle - * @param[in] account Chat account or NULL + * @param[in,out] account Chat account or NULL * @param[in,out] context Chat context or NULL * @param[in] flag Chat message flag * @param[in] warning Warning text @@ -305,7 +305,7 @@ handle_get_key (const struct GNUNET_CHAT_Handle *handle); */ void handle_send_internal_message (struct GNUNET_CHAT_Handle *handle, - const struct GNUNET_CHAT_Account *account, + struct GNUNET_CHAT_Account *account, struct GNUNET_CHAT_Context *context, enum GNUNET_CHAT_MessageFlag flag, const char *warning, diff --git a/src/gnunet_chat_lib.c b/src/gnunet_chat_lib.c @@ -132,7 +132,7 @@ GNUNET_CHAT_account_delete(struct GNUNET_CHAT_Handle *handle, int -GNUNET_CHAT_iterate_accounts (const struct GNUNET_CHAT_Handle *handle, +GNUNET_CHAT_iterate_accounts (struct GNUNET_CHAT_Handle *handle, GNUNET_CHAT_AccountCallback callback, void *cls) { @@ -190,7 +190,7 @@ GNUNET_CHAT_find_account (const struct GNUNET_CHAT_Handle *handle, void GNUNET_CHAT_connect (struct GNUNET_CHAT_Handle *handle, - const struct GNUNET_CHAT_Account *account) + struct GNUNET_CHAT_Account *account) { GNUNET_CHAT_VERSION_ASSERT(); @@ -248,7 +248,7 @@ GNUNET_CHAT_disconnect (struct GNUNET_CHAT_Handle *handle) } -const struct GNUNET_CHAT_Account* +struct GNUNET_CHAT_Account* GNUNET_CHAT_get_connected (const struct GNUNET_CHAT_Handle *handle) { GNUNET_CHAT_VERSION_ASSERT(); @@ -947,7 +947,7 @@ GNUNET_CHAT_account_get_name (const struct GNUNET_CHAT_Account *account) void GNUNET_CHAT_account_get_attributes (struct GNUNET_CHAT_Handle *handle, - const struct GNUNET_CHAT_Account *account, + struct GNUNET_CHAT_Account *account, GNUNET_CHAT_AccountAttributeCallback callback, void *cls) { @@ -1321,7 +1321,7 @@ GNUNET_CHAT_contact_is_tagged (const struct GNUNET_CHAT_Contact *contact, void -GNUNET_CHAT_contact_get_tags (const struct GNUNET_CHAT_Contact *contact, +GNUNET_CHAT_contact_get_tags (struct GNUNET_CHAT_Contact *contact, GNUNET_CHAT_ContactTagCallback callback, void *cls) { @@ -1440,7 +1440,7 @@ GNUNET_CHAT_group_get_user_pointer (const struct GNUNET_CHAT_Group *group) void -GNUNET_CHAT_group_invite_contact (const struct GNUNET_CHAT_Group *group, +GNUNET_CHAT_group_invite_contact (struct GNUNET_CHAT_Group *group, struct GNUNET_CHAT_Contact *contact) { GNUNET_CHAT_VERSION_ASSERT(); @@ -1476,7 +1476,7 @@ GNUNET_CHAT_group_invite_contact (const struct GNUNET_CHAT_Group *group, int -GNUNET_CHAT_group_iterate_contacts (const struct GNUNET_CHAT_Group *group, +GNUNET_CHAT_group_iterate_contacts (struct GNUNET_CHAT_Group *group, GNUNET_CHAT_GroupContactCallback callback, void *cls) { @@ -1730,7 +1730,7 @@ GNUNET_CHAT_context_send_text (struct GNUNET_CHAT_Context *context, enum GNUNET_GenericReturnValue GNUNET_CHAT_context_send_read_receipt (struct GNUNET_CHAT_Context *context, - const struct GNUNET_CHAT_Message *message) + struct GNUNET_CHAT_Message *message) { GNUNET_CHAT_VERSION_ASSERT(); @@ -1880,7 +1880,7 @@ file_binding: enum GNUNET_GenericReturnValue GNUNET_CHAT_context_share_file (struct GNUNET_CHAT_Context *context, - const struct GNUNET_CHAT_File *file) + struct GNUNET_CHAT_File *file) { GNUNET_CHAT_VERSION_ASSERT(); @@ -1913,7 +1913,7 @@ GNUNET_CHAT_context_share_file (struct GNUNET_CHAT_Context *context, enum GNUNET_GenericReturnValue GNUNET_CHAT_context_send_tag (struct GNUNET_CHAT_Context *context, - const struct GNUNET_CHAT_Message *message, + struct GNUNET_CHAT_Message *message, const char *tag) { GNUNET_CHAT_VERSION_ASSERT(); @@ -2225,7 +2225,7 @@ GNUNET_CHAT_message_is_tagged (const struct GNUNET_CHAT_Message *message, int -GNUNET_CHAT_message_get_read_receipt (const struct GNUNET_CHAT_Message *message, +GNUNET_CHAT_message_get_read_receipt (struct GNUNET_CHAT_Message *message, GNUNET_CHAT_MessageReadReceiptCallback callback, void *cls) { @@ -2273,7 +2273,7 @@ GNUNET_CHAT_message_get_text (const struct GNUNET_CHAT_Message *message) } -const struct GNUNET_CHAT_Account* +struct GNUNET_CHAT_Account* GNUNET_CHAT_message_get_account (const struct GNUNET_CHAT_Message *message) { GNUNET_CHAT_VERSION_ASSERT(); @@ -2352,7 +2352,7 @@ GNUNET_CHAT_message_get_discourse (const struct GNUNET_CHAT_Message *message) } -const struct GNUNET_CHAT_Message* +struct GNUNET_CHAT_Message* GNUNET_CHAT_message_get_target (const struct GNUNET_CHAT_Message *message) { GNUNET_CHAT_VERSION_ASSERT(); @@ -2377,7 +2377,7 @@ GNUNET_CHAT_message_get_target (const struct GNUNET_CHAT_Message *message) enum GNUNET_GenericReturnValue -GNUNET_CHAT_message_delete (const struct GNUNET_CHAT_Message *message, +GNUNET_CHAT_message_delete (struct GNUNET_CHAT_Message *message, struct GNUNET_TIME_Relative delay) { GNUNET_CHAT_VERSION_ASSERT(); @@ -2392,7 +2392,7 @@ GNUNET_CHAT_message_delete (const struct GNUNET_CHAT_Message *message, int -GNUNET_CHAT_message_iterate_tags (const struct GNUNET_CHAT_Message *message, +GNUNET_CHAT_message_iterate_tags (struct GNUNET_CHAT_Message *message, GNUNET_CHAT_MessageCallback callback, void *cls) { @@ -3097,7 +3097,7 @@ GNUNET_CHAT_discourse_get_fd (const struct GNUNET_CHAT_Discourse *discourse) int -GNUNET_CHAT_discourse_iterate_contacts (const struct GNUNET_CHAT_Discourse *discourse, +GNUNET_CHAT_discourse_iterate_contacts (struct GNUNET_CHAT_Discourse *discourse, GNUNET_CHAT_DiscourseContactCallback callback, void *cls) { diff --git a/src/gnunet_chat_lib_intern.c b/src/gnunet_chat_lib_intern.c @@ -79,7 +79,7 @@ task_handle_connection (void *cls) if (! handle->next) return; - const struct GNUNET_CHAT_Account *account = handle->next; + struct GNUNET_CHAT_Account *account = handle->next; handle->next = NULL; handle_connect(handle, account); @@ -98,7 +98,7 @@ task_handle_disconnection (void *cls) if (! handle->next) return; - const struct GNUNET_CHAT_Account *account = handle->next; + struct GNUNET_CHAT_Account *account = handle->next; handle->next = NULL; handle_connect(handle, account); @@ -364,7 +364,7 @@ task_group_destruction (void *cls) struct GNUNET_CHAT_GroupIterateContacts { - const struct GNUNET_CHAT_Group *group; + struct GNUNET_CHAT_Group *group; GNUNET_CHAT_GroupContactCallback cb; void *cls; }; @@ -471,7 +471,7 @@ it_context_iterate_discourses (void *cls, struct GNUNET_CHAT_MessageIterateReadReceipts { - const struct GNUNET_CHAT_Message *message; + struct GNUNET_CHAT_Message *message; GNUNET_CHAT_MessageReadReceiptCallback cb; void *cls; }; @@ -535,7 +535,7 @@ cont_update_attribute_with_status (void *cls, attributes->op = NULL; - const struct GNUNET_CHAT_Account *account = attributes->account; + struct GNUNET_CHAT_Account *account = attributes->account; struct GNUNET_CHAT_Handle *handle = attributes->handle; const char *attribute_name = NULL; diff --git a/src/gnunet_chat_message.c b/src/gnunet_chat_message.c @@ -51,7 +51,7 @@ message_create_from_msg (struct GNUNET_CHAT_Context *context, } struct GNUNET_CHAT_Message* -message_create_internally (const struct GNUNET_CHAT_Account *account, +message_create_internally (struct GNUNET_CHAT_Account *account, struct GNUNET_CHAT_Context *context, enum GNUNET_CHAT_MessageFlag flag, const char *warning) diff --git a/src/gnunet_chat_message.h b/src/gnunet_chat_message.h @@ -57,7 +57,7 @@ enum GNUNET_CHAT_MessageFlag struct GNUNET_CHAT_Message { - const struct GNUNET_CHAT_Account *account; + struct GNUNET_CHAT_Account *account; struct GNUNET_CHAT_Context *context; struct GNUNET_SCHEDULER_Task *task; @@ -95,14 +95,14 @@ message_create_from_msg (struct GNUNET_CHAT_Context *context, * <i>account</i> or <i>context</i>, a custom <i>flag</i> * and an optional <i>warning</i> text. * - * @param[in] account Chat account or NULL + * @param[in,out] account Chat account or NULL * @param[in,out] context Chat context or NULL * @param[in] flag Chat message flag * @param[in] warning Warning text * @return New internal chat message */ struct GNUNET_CHAT_Message* -message_create_internally (const struct GNUNET_CHAT_Account *account, +message_create_internally (struct GNUNET_CHAT_Account *account, struct GNUNET_CHAT_Context *context, enum GNUNET_CHAT_MessageFlag flag, const char *warning); diff --git a/src/internal/gnunet_chat_attribute_process.c b/src/internal/gnunet_chat_attribute_process.c @@ -120,7 +120,7 @@ internal_attributes_create_share(struct GNUNET_CHAT_Handle *handle, struct GNUNET_CHAT_AttributeProcess* internal_attributes_create_request(struct GNUNET_CHAT_Handle *handle, - const struct GNUNET_CHAT_Account *account) + struct GNUNET_CHAT_Account *account) { GNUNET_assert((handle) && (account)); diff --git a/src/internal/gnunet_chat_attribute_process.h b/src/internal/gnunet_chat_attribute_process.h @@ -37,7 +37,7 @@ struct GNUNET_CHAT_AttributeProcess { struct GNUNET_CHAT_Handle *handle; - const struct GNUNET_CHAT_Account *account; + struct GNUNET_CHAT_Account *account; struct GNUNET_CHAT_Contact *contact; struct GNUNET_RECLAIM_Attribute *attribute; @@ -118,12 +118,12 @@ internal_attributes_create_share(struct GNUNET_CHAT_Handle *handle, * @see internal_attributes_create() * * @param[in,out] handle Chat handle - * @param[in] account Chat account + * @param[in,out] account Chat account * @return New attribute request process */ struct GNUNET_CHAT_AttributeProcess* internal_attributes_create_request(struct GNUNET_CHAT_Handle *handle, - const struct GNUNET_CHAT_Account *account); + struct GNUNET_CHAT_Account *account); /** * Destroys and frees a given <i>attributes</i> diff --git a/src/internal/gnunet_chat_tagging.c b/src/internal/gnunet_chat_tagging.c @@ -118,7 +118,7 @@ internal_tagging_iterate_message (void *cls, void *value) { struct GNUNET_CHAT_InternalTaggingIterator *it = cls; - const struct GNUNET_CHAT_Message *message = value; + struct GNUNET_CHAT_Message *message = value; if (!(it->cb)) return GNUNET_YES; diff --git a/src/internal/gnunet_chat_tagging.h b/src/internal/gnunet_chat_tagging.h @@ -37,7 +37,7 @@ struct GNUNET_CHAT_InternalTagging typedef enum GNUNET_GenericReturnValue (*GNUNET_CHAT_TaggingCallback) (void *cls, - const struct GNUNET_CHAT_Message *message); + struct GNUNET_CHAT_Message *message); /** * Creates a tagging structure to manage different tag messages diff --git a/tests/attribute/test_gnunet_chat_attribute_check.c b/tests/attribute/test_gnunet_chat_attribute_check.c @@ -53,13 +53,13 @@ on_gnunet_chat_attribute_check_attr(void *cls, enum GNUNET_GenericReturnValue on_gnunet_chat_attribute_check_msg(void *cls, struct GNUNET_CHAT_Context *context, - const struct GNUNET_CHAT_Message *message) + struct GNUNET_CHAT_Message *message) { struct GNUNET_CHAT_Handle *handle = *( (struct GNUNET_CHAT_Handle**) cls ); - const struct GNUNET_CHAT_Account *account; + struct GNUNET_CHAT_Account *account; const char *text; ck_assert_ptr_nonnull(handle); diff --git a/tests/attribute/test_gnunet_chat_attribute_share.c b/tests/attribute/test_gnunet_chat_attribute_share.c @@ -64,7 +64,7 @@ on_gnunet_chat_attribute_share_attr(void *cls, enum GNUNET_GenericReturnValue on_gnunet_chat_attribute_share_msg(void *cls, struct GNUNET_CHAT_Context *context, - const struct GNUNET_CHAT_Message *message) + struct GNUNET_CHAT_Message *message) { static unsigned int share_stage = 0; @@ -72,7 +72,7 @@ on_gnunet_chat_attribute_share_msg(void *cls, (struct GNUNET_CHAT_Handle**) cls ); - const struct GNUNET_CHAT_Account *account; + struct GNUNET_CHAT_Account *account; struct GNUNET_CHAT_Contact *recipient; struct GNUNET_CHAT_Contact *sender; const char *name; diff --git a/tests/discourse/test_gnunet_chat_discourse_open.c b/tests/discourse/test_gnunet_chat_discourse_open.c @@ -31,7 +31,7 @@ enum GNUNET_GenericReturnValue on_gnunet_chat_discourse_open_msg(void *cls, struct GNUNET_CHAT_Context *context, - const struct GNUNET_CHAT_Message *message) + struct GNUNET_CHAT_Message *message) { struct GNUNET_CHAT_Handle *handle = *( (struct GNUNET_CHAT_Handle**) cls @@ -40,7 +40,7 @@ on_gnunet_chat_discourse_open_msg(void *cls, ck_assert_ptr_nonnull(handle); ck_assert_ptr_nonnull(message); - const struct GNUNET_CHAT_Account *account; + struct GNUNET_CHAT_Account *account; account = GNUNET_CHAT_message_get_account(message); const char *name = GNUNET_CHAT_get_name(handle); diff --git a/tests/discourse/test_gnunet_chat_discourse_write.c b/tests/discourse/test_gnunet_chat_discourse_write.c @@ -31,7 +31,7 @@ enum GNUNET_GenericReturnValue on_gnunet_chat_discourse_write_msg(void *cls, struct GNUNET_CHAT_Context *context, - const struct GNUNET_CHAT_Message *message) + struct GNUNET_CHAT_Message *message) { struct GNUNET_CHAT_Handle *handle = *( (struct GNUNET_CHAT_Handle**) cls @@ -40,7 +40,7 @@ on_gnunet_chat_discourse_write_msg(void *cls, ck_assert_ptr_nonnull(handle); ck_assert_ptr_nonnull(message); - const struct GNUNET_CHAT_Account *account; + struct GNUNET_CHAT_Account *account; account = GNUNET_CHAT_message_get_account(message); const char *name = GNUNET_CHAT_get_name(handle); diff --git a/tests/file/test_gnunet_chat_file_send.c b/tests/file/test_gnunet_chat_file_send.c @@ -74,7 +74,7 @@ on_gnunet_chat_file_send_unindex(void *cls, enum GNUNET_GenericReturnValue on_gnunet_chat_file_send_msg(void *cls, struct GNUNET_CHAT_Context *context, - const struct GNUNET_CHAT_Message *message) + struct GNUNET_CHAT_Message *message) { static char *filename = NULL; @@ -85,7 +85,7 @@ on_gnunet_chat_file_send_msg(void *cls, ck_assert_ptr_nonnull(handle); ck_assert_ptr_nonnull(message); - const struct GNUNET_CHAT_Account *account; + struct GNUNET_CHAT_Account *account; struct GNUNET_CHAT_Group *group; struct GNUNET_CHAT_File *file; diff --git a/tests/group/test_gnunet_chat_group_open.c b/tests/group/test_gnunet_chat_group_open.c @@ -30,7 +30,7 @@ enum GNUNET_GenericReturnValue on_gnunet_chat_group_open_msg(void *cls, struct GNUNET_CHAT_Context *context, - const struct GNUNET_CHAT_Message *message) + struct GNUNET_CHAT_Message *message) { struct GNUNET_CHAT_Handle *handle = *( (struct GNUNET_CHAT_Handle**) cls @@ -39,7 +39,7 @@ on_gnunet_chat_group_open_msg(void *cls, ck_assert_ptr_nonnull(handle); ck_assert_ptr_nonnull(message); - const struct GNUNET_CHAT_Account *account; + struct GNUNET_CHAT_Account *account; account = GNUNET_CHAT_message_get_account(message); const char *name = GNUNET_CHAT_get_name(handle); diff --git a/tests/handle/test_gnunet_chat_handle_accounts.c b/tests/handle/test_gnunet_chat_handle_accounts.c @@ -28,7 +28,7 @@ enum GNUNET_GenericReturnValue on_gnunet_chat_handle_accounts_it(void *cls, - const struct GNUNET_CHAT_Handle *handle, + struct GNUNET_CHAT_Handle *handle, struct GNUNET_CHAT_Account *account) { unsigned int *accounts_stage = cls; @@ -53,7 +53,7 @@ on_gnunet_chat_handle_accounts_it(void *cls, enum GNUNET_GenericReturnValue on_gnunet_chat_handle_accounts_msg(void *cls, struct GNUNET_CHAT_Context *context, - const struct GNUNET_CHAT_Message *message) + struct GNUNET_CHAT_Message *message) { static unsigned int accounts_stage = 0; diff --git a/tests/handle/test_gnunet_chat_handle_connection.c b/tests/handle/test_gnunet_chat_handle_connection.c @@ -29,7 +29,7 @@ enum GNUNET_GenericReturnValue on_gnunet_chat_handle_connection_msg(void *cls, struct GNUNET_CHAT_Context *context, - const struct GNUNET_CHAT_Message *message) + struct GNUNET_CHAT_Message *message) { struct GNUNET_CHAT_Handle *handle = *( (struct GNUNET_CHAT_Handle**) cls @@ -39,8 +39,8 @@ on_gnunet_chat_handle_connection_msg(void *cls, ck_assert_ptr_null(context); ck_assert_ptr_nonnull(message); - const struct GNUNET_CHAT_Account *connected; - const struct GNUNET_CHAT_Account *account; + struct GNUNET_CHAT_Account *connected; + struct GNUNET_CHAT_Account *account; const char *name; connected = GNUNET_CHAT_get_connected(handle); diff --git a/tests/handle/test_gnunet_chat_handle_rename.c b/tests/handle/test_gnunet_chat_handle_rename.c @@ -30,7 +30,7 @@ enum GNUNET_GenericReturnValue on_gnunet_chat_handle_rename_msg(void *cls, struct GNUNET_CHAT_Context *context, - const struct GNUNET_CHAT_Message *message) + struct GNUNET_CHAT_Message *message) { struct GNUNET_CHAT_Handle *handle = *( (struct GNUNET_CHAT_Handle**) cls @@ -40,7 +40,7 @@ on_gnunet_chat_handle_rename_msg(void *cls, ck_assert_ptr_null(context); ck_assert_ptr_nonnull(message); - const struct GNUNET_CHAT_Account *account; + struct GNUNET_CHAT_Account *account; account = GNUNET_CHAT_message_get_account(message); const char *name = GNUNET_CHAT_get_name(handle); diff --git a/tests/handle/test_gnunet_chat_handle_update.c b/tests/handle/test_gnunet_chat_handle_update.c @@ -29,7 +29,7 @@ enum GNUNET_GenericReturnValue on_gnunet_chat_handle_update_msg(void *cls, struct GNUNET_CHAT_Context *context, - const struct GNUNET_CHAT_Message *message) + struct GNUNET_CHAT_Message *message) { static unsigned int update_stage = 0; @@ -41,7 +41,7 @@ on_gnunet_chat_handle_update_msg(void *cls, ck_assert_ptr_null(context); ck_assert_ptr_nonnull(message); - const struct GNUNET_CHAT_Account *account; + struct GNUNET_CHAT_Account *account; account = GNUNET_CHAT_message_get_account(message); const char *key; diff --git a/tests/lobby/test_gnunet_chat_lobby_join.c b/tests/lobby/test_gnunet_chat_lobby_join.c @@ -41,7 +41,7 @@ on_gnunet_chat_lobby_join_open(void *cls, enum GNUNET_GenericReturnValue on_gnunet_chat_lobby_join_msg(void *cls, struct GNUNET_CHAT_Context *context, - const struct GNUNET_CHAT_Message *message) + struct GNUNET_CHAT_Message *message) { static struct GNUNET_CHAT_Lobby *lobby = NULL; @@ -52,8 +52,7 @@ on_gnunet_chat_lobby_join_msg(void *cls, ck_assert_ptr_nonnull(handle); ck_assert_ptr_nonnull(message); - const struct GNUNET_CHAT_Account *account; - + struct GNUNET_CHAT_Account *account; account = GNUNET_CHAT_message_get_account(message); switch (GNUNET_CHAT_message_get_kind(message)) diff --git a/tests/lobby/test_gnunet_chat_lobby_open.c b/tests/lobby/test_gnunet_chat_lobby_open.c @@ -29,7 +29,7 @@ enum GNUNET_GenericReturnValue on_gnunet_chat_lobby_open_msg(void *cls, struct GNUNET_CHAT_Context *context, - const struct GNUNET_CHAT_Message *message) + struct GNUNET_CHAT_Message *message) { struct GNUNET_CHAT_Handle *handle = *( (struct GNUNET_CHAT_Handle**) cls @@ -39,7 +39,7 @@ on_gnunet_chat_lobby_open_msg(void *cls, ck_assert_ptr_null(context); ck_assert_ptr_nonnull(message); - const struct GNUNET_CHAT_Account *account; + struct GNUNET_CHAT_Account *account; struct GNUNET_CHAT_Lobby *lobby; account = GNUNET_CHAT_message_get_account(message); diff --git a/tests/message/test_gnunet_chat_message_text.c b/tests/message/test_gnunet_chat_message_text.c @@ -31,13 +31,13 @@ enum GNUNET_GenericReturnValue on_gnunet_chat_message_text_msg(void *cls, struct GNUNET_CHAT_Context *context, - const struct GNUNET_CHAT_Message *message) + struct GNUNET_CHAT_Message *message) { struct GNUNET_CHAT_Handle *handle = *( (struct GNUNET_CHAT_Handle**) cls ); - const struct GNUNET_CHAT_Account *account; + struct GNUNET_CHAT_Account *account; struct GNUNET_CHAT_Group *group; const char *text; diff --git a/tests/test_gnunet_chat.h b/tests/test_gnunet_chat.h @@ -37,7 +37,7 @@ enum GNUNET_GenericReturnValue \ on_setup_##test_call (void *cls, \ struct GNUNET_CHAT_Context *context, \ - const struct GNUNET_CHAT_Message *message) \ + struct GNUNET_CHAT_Message *message) \ { \ static enum GNUNET_GenericReturnValue done = GNUNET_NO; \ static size_t counter = 0; \ @@ -98,7 +98,7 @@ setup_##test_call (const struct GNUNET_CONFIGURATION_Handle *cfg) \ enum GNUNET_GenericReturnValue \ on_cleanup_##test_call (void *cls, \ struct GNUNET_CHAT_Context *context, \ - const struct GNUNET_CHAT_Message *message) \ + struct GNUNET_CHAT_Message *message) \ { \ static enum GNUNET_GenericReturnValue done = GNUNET_NO; \ static size_t counter = 0; \ diff --git a/tools/gnunet_chat_lib_uml.c b/tools/gnunet_chat_lib_uml.c @@ -40,7 +40,7 @@ struct GNUNET_CHAT_Tool static enum GNUNET_GenericReturnValue accounts_iterate (void *cls, - const struct GNUNET_CHAT_Handle *handle, + struct GNUNET_CHAT_Handle *handle, struct GNUNET_CHAT_Account *account) { struct GNUNET_CHAT_Tool *tool = cls; @@ -70,7 +70,7 @@ idle (void *cls) static enum GNUNET_GenericReturnValue chat_message (void *cls, struct GNUNET_CHAT_Context *context, - const struct GNUNET_CHAT_Message *message) + struct GNUNET_CHAT_Message *message) { struct GNUNET_CHAT_Tool *tool = cls;