mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-11-16 09:21:52 +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
@@ -72,7 +72,7 @@ char JOIN(ENGINE_EXEC_NAME, _reportCurrent)(const struct NFA *nfa,
|
||||
const struct lbr_common *l = getImplNfa(nfa);
|
||||
u64a offset = q_cur_offset(q);
|
||||
DEBUG_PRINTF("firing match %u at %llu\n", l->report, offset);
|
||||
q->cb(offset, l->report, q->context);
|
||||
q->cb(0, offset, l->report, q->context);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -215,7 +215,7 @@ char JOIN(ENGINE_EXEC_NAME, _Q_i)(const struct NFA *nfa, struct mq *q,
|
||||
|
||||
if (q->report_current) {
|
||||
DEBUG_PRINTF("report_current: fire match at %llu\n", q_cur_offset(q));
|
||||
int rv = q->cb(q_cur_offset(q), l->report, q->context);
|
||||
int rv = q->cb(0, q_cur_offset(q), l->report, q->context);
|
||||
q->report_current = 0;
|
||||
if (rv == MO_HALT_MATCHING) {
|
||||
return MO_HALT_MATCHING;
|
||||
|
||||
Reference in New Issue
Block a user