54 if (
state->last_messages.head)
57 memset (hash, 0,
sizeof(*hash));
66 if (
state->last_messages.head ==
state->last_messages.tail)
69 return &(
state->last_messages.tail->hash);
101 char *last_messages_file;
105 GNUNET_asprintf (&last_messages_file,
"%s%s", path,
"last_messages.list");
116 char *last_messages_file;
120 GNUNET_asprintf (&last_messages_file,
"%s%s", path,
"last_messages.list");
enum State state
current state of profiling
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.
void clear_list_messages(struct GNUNET_MESSENGER_ListMessages *messages)
Clears the list of message hashes.
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.
void init_list_messages(struct GNUNET_MESSENGER_ListMessages *messages)
Initializes list of message hashes as empty list.
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.
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.
const struct GNUNET_HashCode * get_message_state_merge_hash(const struct GNUNET_MESSENGER_MessageState *state)
void save_message_state(const struct GNUNET_MESSENGER_MessageState *state, const char *path)
void clear_message_state(struct GNUNET_MESSENGER_MessageState *state)
void get_message_state_chain_hash(const struct GNUNET_MESSENGER_MessageState *state, struct GNUNET_HashCode *hash)
void init_message_state(struct GNUNET_MESSENGER_MessageState *state)
void update_message_state(struct GNUNET_MESSENGER_MessageState *state, enum GNUNET_GenericReturnValue requested, const struct GNUNET_MESSENGER_Message *message, const struct GNUNET_HashCode *hash)
void load_message_state(struct GNUNET_MESSENGER_MessageState *state, const char *path)
#define GNUNET_memcpy(dst, src, n)
Call memcpy() but check for n being 0 first.
GNUNET_GenericReturnValue
Named constants for return values.
#define GNUNET_assert(cond)
Use this for fatal errors that cannot be handled.
int int GNUNET_asprintf(char **buf, const char *format,...) __attribute__((format(printf
Like asprintf, just portable.
#define GNUNET_free(ptr)
Wrapper around free.
@ GNUNET_MESSENGER_KIND_INFO
The info kind.
@ GNUNET_MESSENGER_KIND_REQUEST
The request kind.
@ GNUNET_MESSENGER_KIND_MERGE
The merge kind.
const struct GNUNET_ShortHashCode * get_message_discourse(const struct GNUNET_MESSENGER_Message *message)
Returns the discourse hash of a message depending on its kind.
struct GNUNET_MESSENGER_MessageMerge merge
struct GNUNET_HashCode previous
The hash of a second previous message.
struct GNUNET_MESSENGER_MessageHeader header
Header.
struct GNUNET_MESSENGER_MessageBody body
Body.