I believe libsae had two problems with callback symbols:
event-loop (service.h) symbols had to be defined by the main app, but the implementation of those functions in service.c was included in libsae. Depending on how the app was linked, this could result in service.c functions being called, instead of the main-app defined overrides. Resolved this by moving service.c outside of libsae
several callbacks invoked by libsae were hard-named. Resolved this by using function pointers.
Before:
nm libsae.a | grep -w -e fin -e 'meshd.*' -e 'srv.*
U fin
U meshd_write_mgmt
0000000000000000 t srv_add_timeout
U srv_add_timeout_with_jitter
U srvctx
U srv_rem_timeout
0000000000000cfd T srv_add_exceptor
00000000000006ea T srv_add_input
0000000000000a3b T srv_add_output
0000000000000262 T srv_add_timeout_with_jitter
0000000000001691 T srv_cancel_main_loop
0000000000001520 T srv_create_context
0000000000000ee8 T srv_main_loop
00000000000008a6 T srv_rem_input
0000000000000bb0 T srv_rem_output
0000000000000586 T srv_rem_timeout
U srv_add_input
0000000000000000 t srv_add_timeout
U srv_add_timeout_with_jitter
U srv_rem_input
U srv_rem_timeout
U meshd_set_mesh_conf
U meshd_write_mgmt
0000000000000000 t srv_add_timeout
U srv_add_timeout_with_jitter
U srvctx
Cleanup hard-named symbols in
libsae
.I believe
libsae
had two problems with callback symbols:service.h
) symbols had to be defined by the main app, but the implementation of those functions inservice.c
was included inlibsae
. Depending on how the app was linked, this could result inservice.c
functions being called, instead of the main-app defined overrides. Resolved this by movingservice.c
outside oflibsae
libsae
were hard-named. Resolved this by using function pointers.Before:
After:
Tested by running tests under
/tests