summaryrefslogtreecommitdiffstats
path: root/include/osmocom/core/fsm.h
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-02-28 03:38:38 +0100
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-03-01 23:52:55 +0000
commitfca04bba5a4acda663ed275247c8fff3909f532a (patch)
tree4903b156d58609e1166f58492fc0efe8760c6de9 /include/osmocom/core/fsm.h
parent2ed3659cac62d240b9c7afc0f03ee08ee9ef8bed (diff)
fsm: convenience: add inline osmo_fsm_inst_state_name()
Change-Id: If9a6ecc4d6e2beaf716569e9a6053d73488e860b
Diffstat (limited to 'include/osmocom/core/fsm.h')
-rw-r--r--include/osmocom/core/fsm.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/osmocom/core/fsm.h b/include/osmocom/core/fsm.h
index 952f82fa..3a1f2338 100644
--- a/include/osmocom/core/fsm.h
+++ b/include/osmocom/core/fsm.h
@@ -152,6 +152,10 @@ const char *osmo_fsm_event_name(struct osmo_fsm *fsm, uint32_t event);
const char *osmo_fsm_inst_name(struct osmo_fsm_inst *fi);
const char *osmo_fsm_state_name(struct osmo_fsm *fsm, uint32_t state);
+/*! \brief return the name of the state the FSM instance is currently in. */
+static inline const char *osmo_fsm_inst_state_name(struct osmo_fsm_inst *fi)
+{ return osmo_fsm_state_name(fi->fsm, fi->state); }
+
/*! \brief perform a state change of the given FSM instance
*
* This is a macro that calls _osmo_fsm_inst_state_chg() with the given