# HG changeset patch # User Mychaela Falconia # Date 1726783090 0 # Node ID 3a617e4e9b270e08a9e83492b5f1144909497f3a # Parent 5a3535470c9522bfdc7aad4c52f5f4bafc3efc14 libgsmfr2: add const words with struct sizes diff -r 5a3535470c95 -r 3a617e4e9b27 libgsmfr2/ed_state.c --- a/libgsmfr2/ed_state.c Thu Sep 19 21:00:18 2024 +0000 +++ b/libgsmfr2/ed_state.c Thu Sep 19 21:58:10 2024 +0000 @@ -11,6 +11,8 @@ #include "typedef.h" #include "ed_state.h" +const unsigned gsmfr_0610_state_size = sizeof(struct gsmfr_0610_state); + struct gsmfr_0610_state *gsmfr_0610_create(void) { struct gsmfr_0610_state *st; diff -r 5a3535470c95 -r 3a617e4e9b27 libgsmfr2/full_dec.c --- a/libgsmfr2/full_dec.c Thu Sep 19 21:00:18 2024 +0000 +++ b/libgsmfr2/full_dec.c Thu Sep 19 21:58:10 2024 +0000 @@ -19,6 +19,8 @@ int is_homed; }; +const unsigned gsmfr_fulldec_state_size = sizeof(struct gsmfr_fulldec_state); + struct gsmfr_fulldec_state *gsmfr_fulldec_create(void) { struct gsmfr_fulldec_state *st; diff -r 5a3535470c95 -r 3a617e4e9b27 libgsmfr2/pp_state.c --- a/libgsmfr2/pp_state.c Thu Sep 19 21:00:18 2024 +0000 +++ b/libgsmfr2/pp_state.c Thu Sep 19 21:58:10 2024 +0000 @@ -9,6 +9,8 @@ #include "tw_gsmfr.h" #include "pp_state.h" +const unsigned gsmfr_preproc_state_size = sizeof(struct gsmfr_preproc_state); + struct gsmfr_preproc_state *gsmfr_preproc_create(void) { struct gsmfr_preproc_state *st; diff -r 5a3535470c95 -r 3a617e4e9b27 libgsmfr2/tw_gsmfr.h --- a/libgsmfr2/tw_gsmfr.h Thu Sep 19 21:00:18 2024 +0000 +++ b/libgsmfr2/tw_gsmfr.h Thu Sep 19 21:58:10 2024 +0000 @@ -134,4 +134,10 @@ uint8_t *frame_out); int gsmfr_tfo_xfrm_dtxd(struct gsmfr_preproc_state *state, uint8_t *frame_out); +/* sizes of state structures, to support alternative malloc schemes */ + +extern const unsigned gsmfr_0610_state_size; +extern const unsigned gsmfr_preproc_state_size; +extern const unsigned gsmfr_fulldec_state_size; + #endif /* include guard */