From a64c45a03e3b318b5fdc93c960670d89a5745271 Mon Sep 17 00:00:00 2001 From: Neels Hofmeyr Date: Sat, 31 Mar 2018 16:34:49 +0200 Subject: add osmo_fsm_inst_update_id_f() In the osmo-msc, I would like to set the subscr conn FSM identifier by a string format, to include the type of Complete Layer 3 that is taking place. I could each time talloc a string and free it again. This API is more convenient. From osmo_fsm_inst_update_id(), call osmo_fsm_inst_update_id_f() with "%s" (or pass NULL). Put the name updating into separate static update_name() function to clarify. Adjust the error message for erratic ID: don't say "allocate", it might be from an update. Adjust test expectation. Change-Id: I76743a7642f2449fd33350691ac8ebbf4400371d --- include/osmocom/core/fsm.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include') diff --git a/include/osmocom/core/fsm.h b/include/osmocom/core/fsm.h index 2c2a9961..174396a7 100644 --- a/include/osmocom/core/fsm.h +++ b/include/osmocom/core/fsm.h @@ -159,6 +159,7 @@ void osmo_fsm_inst_change_parent(struct osmo_fsm_inst *fi, void osmo_fsm_inst_free(struct osmo_fsm_inst *fi); int osmo_fsm_inst_update_id(struct osmo_fsm_inst *fi, const char *id); +int osmo_fsm_inst_update_id_f(struct osmo_fsm_inst *fi, const char *fmt, ...); const char *osmo_fsm_event_name(struct osmo_fsm *fsm, uint32_t event); const char *osmo_fsm_inst_name(struct osmo_fsm_inst *fi); -- cgit v1.2.3