State storage that is tied to a specific MSU mesasge. More...
#include "msu_message.h"
Go to the source code of this file.
Functions | |
int | msu_num_states (struct local_msu *msu) |
void * | msu_init_state (struct local_msu *msu, struct msu_msg_key *key, size_t size) |
Initializes a new MSU state of the given size with the provided key. More... | |
void * | msu_get_state (struct local_msu *msu, struct msu_msg_key *key, size_t *size) |
Gets the state allocated with the given key. More... | |
int | msu_free_state (struct local_msu *msu, struct msu_msg_key *key) |
Frees the state assocated with the given MSU and key. More... | |
int | msu_free_all_state (struct local_msu *msu) |
Frees all state structures associated with the given MSU. More... | |
State storage that is tied to a specific MSU mesasge.
States can be stored or retrieved by passing an msu_msg_key.
Definition in file msu_state.h.
int msu_free_all_state | ( | struct local_msu * | msu | ) |
Frees all state structures associated with the given MSU.
Definition at line 117 of file msu_state.c.
int msu_free_state | ( | struct local_msu * | msu, |
struct msu_msg_key * | key | ||
) |
Frees the state assocated with the given MSU and key.
Definition at line 97 of file msu_state.c.
void* msu_get_state | ( | struct local_msu * | msu, |
struct msu_msg_key * | key, | ||
size_t * | size | ||
) |
Gets the state allocated with the given key.
msu | The MSU storing the state |
key | The key with which the state was allocated |
size | An output argument, set to the size of the retrieved state if non-NULL |
Definition at line 82 of file msu_state.c.
void* msu_init_state | ( | struct local_msu * | msu, |
struct msu_msg_key * | key, | ||
size_t | size | ||
) |
Initializes a new MSU state of the given size with the provided key.
The returned pointer should later be freed with msu_free_state
Definition at line 55 of file msu_state.c.
int msu_num_states | ( | struct local_msu * | msu | ) |
Definition at line 51 of file msu_state.c.