diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2018-05-14 19:40:07 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2018-05-14 19:40:07 (GMT) |
commit | 0286b53bad21abf91cbe17c4772ca9cde6a89cbc (patch) | |
tree | 3bec9dc7e118c00ce9c748576b01606a71880ad7 /src/common | |
parent | 267b1ae8608ed4bf52de743798e8647c903ee1b4 (diff) |
Created an instruction database for Chrysalide.
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/packed.c | 19 | ||||
-rw-r--r-- | src/common/packed.h | 3 |
2 files changed, 22 insertions, 0 deletions
diff --git a/src/common/packed.c b/src/common/packed.c index 1abfa98..ca6e816 100644 --- a/src/common/packed.c +++ b/src/common/packed.c @@ -53,6 +53,25 @@ void init_packed_buffer(packed_buffer *pbuf) pbuf->allocated = PACKET_BLOCK_SIZE; pbuf->data = malloc(pbuf->allocated * sizeof(uint8_t)); + reset_packed_buffer(pbuf); + +} + + +/****************************************************************************** +* * +* Paramètres : pbuf = paquet de données à réinitialiser. [OUT] * +* * +* Description : Réinitialise un paquet réseau pour une constitution. * +* * +* Retour : - * +* * +* Remarques : - * +* * +******************************************************************************/ + +void reset_packed_buffer(packed_buffer *pbuf) +{ pbuf->used = 0; pbuf->pos = sizeof(uint32_t); diff --git a/src/common/packed.h b/src/common/packed.h index 64d5d20..d25c947 100644 --- a/src/common/packed.h +++ b/src/common/packed.h @@ -49,6 +49,9 @@ typedef struct _packed_buffer /* Initialise un paquet réseau pour une constitution. */ void init_packed_buffer(packed_buffer *); +/* Réinitialise un paquet réseau pour une constitution. */ +void reset_packed_buffer(packed_buffer *); + /* Efface les données contenues par un paquet réseau. */ void exit_packed_buffer(packed_buffer *); |