From 2a06a491b17b2eaa39d0a10ca43cc946b679f837 Mon Sep 17 00:00:00 2001 From: Philipp Maier Date: Tue, 16 Jan 2018 18:45:56 +0100 Subject: fsm: add functions for unlinking and changing parents At the moment it is not possible to unlink a child from from its parent, nor is it possible to assign a new parent to a child FSM. - osmo_fsm_inst_unlink_parent(): Make it possible to unlink childs from a parent. - osmo_fsm_inst_change_parent(): Make it possible to change the parent of a child. Change-Id: I6d18cbd4ada903cf3720b3ad2a89fc643085beef --- include/osmocom/core/fsm.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include') diff --git a/include/osmocom/core/fsm.h b/include/osmocom/core/fsm.h index 2fbb2501..8f550d14 100644 --- a/include/osmocom/core/fsm.h +++ b/include/osmocom/core/fsm.h @@ -150,6 +150,10 @@ struct osmo_fsm_inst *osmo_fsm_inst_alloc(struct osmo_fsm *fsm, void *ctx, void struct osmo_fsm_inst *osmo_fsm_inst_alloc_child(struct osmo_fsm *fsm, struct osmo_fsm_inst *parent, uint32_t parent_term_event); +void osmo_fsm_inst_unlink_parent(struct osmo_fsm_inst *fi, void *ctx); +void osmo_fsm_inst_change_parent(struct osmo_fsm_inst *fi, + struct osmo_fsm_inst *new_parent, + uint32_t new_parent_term_event); void osmo_fsm_inst_free(struct osmo_fsm_inst *fi); const char *osmo_fsm_event_name(struct osmo_fsm *fsm, uint32_t event); -- cgit v1.2.3