mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2026-01-01 22:25:42 +03:00
nfa: unify NfaCallback and SomNfaCallback
Use just one callback type, with both start and end offsets.
This commit is contained in:
committed by
Matthew Barr
parent
9087d59be5
commit
cf9e40ae1c
@@ -722,13 +722,13 @@ u64a roseGetHaigSom(const struct RoseEngine *t, struct hs_scratch *scratch,
|
||||
u64a start = ~0ULL;
|
||||
|
||||
/* switch the callback + context for a fun one */
|
||||
q->som_cb = roseNfaEarliestSom;
|
||||
q->cb = roseNfaEarliestSom;
|
||||
q->context = &start;
|
||||
|
||||
nfaReportCurrentMatches(q->nfa, q);
|
||||
|
||||
/* restore the old callback + context */
|
||||
q->som_cb = roseNfaSomAdaptor;
|
||||
q->cb = roseNfaAdaptor;
|
||||
q->context = NULL;
|
||||
DEBUG_PRINTF("earliest som is %llu\n", start);
|
||||
return start;
|
||||
@@ -779,7 +779,7 @@ hwlmcb_rv_t roseEnginesEod(const struct RoseEngine *rose,
|
||||
}
|
||||
|
||||
if (nfaCheckFinalState(q->nfa, q->state, q->streamState, offset,
|
||||
roseReportAdaptor, roseReportSomAdaptor,
|
||||
roseReportAdaptor,
|
||||
scratch) == MO_HALT_MATCHING) {
|
||||
DEBUG_PRINTF("user instructed us to stop\n");
|
||||
return HWLM_TERMINATE_MATCHING;
|
||||
@@ -815,7 +815,7 @@ hwlmcb_rv_t roseSuffixesEod(const struct RoseEngine *rose,
|
||||
continue;
|
||||
}
|
||||
if (nfaCheckFinalState(q->nfa, q->state, q->streamState, offset,
|
||||
roseReportAdaptor, roseReportSomAdaptor,
|
||||
roseReportAdaptor,
|
||||
scratch) == MO_HALT_MATCHING) {
|
||||
DEBUG_PRINTF("user instructed us to stop\n");
|
||||
return HWLM_TERMINATE_MATCHING;
|
||||
|
||||
Reference in New Issue
Block a user