#include "gnunet_common.h"
Go to the source code of this file.
Data Structures | |
struct | GNUNET_MESSENGER_ListMessage |
struct | GNUNET_MESSENGER_ListMessages |
Functions | |
void | init_list_messages (struct GNUNET_MESSENGER_ListMessages *messages) |
Initializes list of message hashes as empty list. More... | |
void | clear_list_messages (struct GNUNET_MESSENGER_ListMessages *messages) |
Clears the list of message hashes. More... | |
void | add_to_list_messages (struct GNUNET_MESSENGER_ListMessages *messages, const struct GNUNET_HashCode *hash) |
Adds a specific hash from a message to the end of the list. More... | |
void | copy_list_messages (struct GNUNET_MESSENGER_ListMessages *messages, const struct GNUNET_MESSENGER_ListMessages *origin) |
Copies all message hashes from an origin to another list. More... | |
void | remove_from_list_messages (struct GNUNET_MESSENGER_ListMessages *messages, const struct GNUNET_HashCode *hash) |
Removes the first entry with a matching hash from the list. More... | |
void | load_list_messages (struct GNUNET_MESSENGER_ListMessages *messages, const char *path) |
Loads the list of message hashes from a file under a given path. More... | |
void | save_list_messages (const struct GNUNET_MESSENGER_ListMessages *messages, const char *path) |
Saves the list of message hashes to a file under a given path. More... | |
void init_list_messages | ( | struct GNUNET_MESSENGER_ListMessages * | messages | ) |
Initializes list of message hashes as empty list.
[out] | messages | List of hashes |
Definition at line 31 of file gnunet-service-messenger_list_messages.c.
References GNUNET_assert, GNUNET_MESSENGER_ListMessages::head, and GNUNET_MESSENGER_ListMessages::tail.
Referenced by check_member_session_completion(), cleanup_store_discourse_messages_before(), create_member_session(), create_srv_room(), init_message_state(), and switch_member_session().
void clear_list_messages | ( | struct GNUNET_MESSENGER_ListMessages * | messages | ) |
Clears the list of message hashes.
[in,out] | messages | List of hashes |
Definition at line 41 of file gnunet-service-messenger_list_messages.c.
References GNUNET_assert, GNUNET_CONTAINER_DLL_remove, GNUNET_free, GNUNET_MESSENGER_ListMessages::head, and GNUNET_MESSENGER_ListMessages::tail.
Referenced by check_member_session_completion(), cleanup_store_discourse_messages_before(), clear_message_state(), destroy_member_session(), and reset_member_session().
void add_to_list_messages | ( | struct GNUNET_MESSENGER_ListMessages * | messages, |
const struct GNUNET_HashCode * | hash | ||
) |
Adds a specific hash from a message to the end of the list.
[in,out] | messages | List of hashes |
[in] | hash | Hash of message |
Definition at line 59 of file gnunet-service-messenger_list_messages.c.
References GNUNET_assert, GNUNET_CONTAINER_DLL_insert_tail, GNUNET_memcpy, GNUNET_new, GNUNET_MESSENGER_ListMessage::hash, GNUNET_MESSENGER_ListMessages::head, and GNUNET_MESSENGER_ListMessages::tail.
Referenced by callback_room_handle_message(), check_member_session_completion(), copy_list_messages(), iterate_flag_for_cleanup_discourse_message(), load_list_messages(), reset_member_session(), update_member_session_history(), and update_message_state().
void copy_list_messages | ( | struct GNUNET_MESSENGER_ListMessages * | messages, |
const struct GNUNET_MESSENGER_ListMessages * | origin | ||
) |
Copies all message hashes from an origin to another list.
[in,out] | messages | Destination list of hashes |
[in] | origin | Source list of hashes |
Definition at line 75 of file gnunet-service-messenger_list_messages.c.
References add_to_list_messages(), GNUNET_assert, GNUNET_MESSENGER_ListMessage::hash, GNUNET_MESSENGER_ListMessage::next, and origin.
Referenced by check_member_session_completion(), and switch_member_session().
void remove_from_list_messages | ( | struct GNUNET_MESSENGER_ListMessages * | messages, |
const struct GNUNET_HashCode * | hash | ||
) |
Removes the first entry with a matching hash from the list.
[in,out] | messages | List of hashes |
[in] | hash | Hash of message |
Definition at line 88 of file gnunet-service-messenger_list_messages.c.
References GNUNET_assert, GNUNET_CONTAINER_DLL_remove, GNUNET_CRYPTO_hash_cmp(), GNUNET_free, GNUNET_MESSENGER_ListMessage::hash, GNUNET_MESSENGER_ListMessages::head, GNUNET_MESSENGER_ListMessage::next, and GNUNET_MESSENGER_ListMessages::tail.
Referenced by update_message_state().
void load_list_messages | ( | struct GNUNET_MESSENGER_ListMessages * | messages, |
const char * | path | ||
) |
Loads the list of message hashes from a file under a given path.
[out] | messages | List of hashes |
[in] | path | Path of file |
Definition at line 106 of file gnunet-service-messenger_list_messages.c.
References add_to_list_messages(), GNUNET_assert, GNUNET_DISK_file_close(), GNUNET_DISK_file_open(), GNUNET_DISK_file_read(), GNUNET_DISK_file_seek(), GNUNET_DISK_file_test(), GNUNET_DISK_OPEN_READ, GNUNET_DISK_PERM_USER_READ, GNUNET_DISK_PERM_USER_WRITE, GNUNET_DISK_SEEK_SET, GNUNET_YES, and handle.
Referenced by load_member_session(), and load_message_state().
void save_list_messages | ( | const struct GNUNET_MESSENGER_ListMessages * | messages, |
const char * | path | ||
) |
Saves the list of message hashes to a file under a given path.
[in] | messages | List of hashes |
[in] | path | Path of file |
Definition at line 145 of file gnunet-service-messenger_list_messages.c.
References GNUNET_assert, GNUNET_DISK_file_close(), GNUNET_DISK_file_open(), GNUNET_DISK_file_seek(), GNUNET_DISK_file_sync(), GNUNET_DISK_file_write(), GNUNET_DISK_OPEN_CREATE, GNUNET_DISK_OPEN_WRITE, GNUNET_DISK_PERM_USER_READ, GNUNET_DISK_PERM_USER_WRITE, GNUNET_DISK_SEEK_SET, handle, GNUNET_MESSENGER_ListMessage::hash, GNUNET_MESSENGER_ListMessages::head, and GNUNET_MESSENGER_ListMessage::next.
Referenced by save_member_session(), and save_message_state().