/** * Builds links between states (the AC failure function) * It also link outputs of subpatterns found between branches, * and removes unuseful transitions. It MUST be called after patterns * are added * * @param ac_tree pointer to store the matcher * * @returns Status code */ ib_status_t ib_ac_build_links(ib_ac_t *ac_tree) { ib_status_t st; st = ib_ac_link_fail_states(ac_tree); if (st != IB_OK) { return st; } ac_tree->flags |= IB_AC_FLAG_PARSER_READY; return IB_OK; }
/** * Builds links between states (the AC failure function) * It also link outputs of subpatterns found between branches, * and removes unuseful transitions. It MUST be called after patterns * are added * * @param ac_tree pointer to store the matcher * * @returns Status code */ ib_status_t ib_ac_build_links(ib_ac_t *ac_tree) { IB_FTRACE_INIT(); ib_status_t st; st = ib_ac_link_fail_states(ac_tree); if (st != IB_OK) { IB_FTRACE_RET_STATUS(st); } ac_tree->flags |= IB_AC_FLAG_PARSER_READY; IB_FTRACE_RET_STATUS(IB_OK); }