changeset 541:23656d874524

libgsmefr: add const words with struct sizes
author Mychaela Falconia <falcon@freecalypso.org>
date Sat, 28 Sep 2024 06:00:34 +0000
parents 5595293e4f29
children f2d0f2f15d5f
files libgsmefr/dec_create.c libgsmefr/enc_create.c libgsmefr/gsm_efr.h
diffstat 3 files changed, 9 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libgsmefr/dec_create.c	Sun Sep 22 00:36:35 2024 +0000
+++ b/libgsmefr/dec_create.c	Sat Sep 28 06:00:34 2024 +0000
@@ -9,6 +9,8 @@
 #include "cnst.h"
 #include "dec_state.h"
 
+const unsigned EFR_decoder_state_size = sizeof(struct EFR_decoder_state);
+
 struct EFR_decoder_state *EFR_decoder_create(void)
 {
 	struct EFR_decoder_state *st;
--- a/libgsmefr/enc_create.c	Sun Sep 22 00:36:35 2024 +0000
+++ b/libgsmefr/enc_create.c	Sat Sep 28 06:00:34 2024 +0000
@@ -9,6 +9,8 @@
 #include "cnst.h"
 #include "enc_state.h"
 
+const unsigned EFR_encoder_state_size = sizeof(struct EFR_encoder_state);
+
 struct EFR_encoder_state *EFR_encoder_create(int dtx)
 {
 	struct EFR_encoder_state *st;
--- a/libgsmefr/gsm_efr.h	Sun Sep 22 00:36:35 2024 +0000
+++ b/libgsmefr/gsm_efr.h	Sat Sep 28 06:00:34 2024 +0000
@@ -55,4 +55,9 @@
 
 extern const uint8_t EFR_decoder_homing_frame[EFR_RTP_FRAME_LEN];
 
+/* sizes of state structures, to support alternative malloc schemes */
+
+extern const unsigned EFR_encoder_state_size;
+extern const unsigned EFR_decoder_state_size;
+
 #endif	/* include guard */