if (nfa->type == MCCLELLAN_NFA_8) {
nfaExecMcClellan8_B(nfa, curr->anchoredMinDistance,
local_buffer, local_alen,
- roseAnchoredCallback, &scratch->tctxt);
+ roseAnchoredCallback, scratch);
} else {
nfaExecMcClellan16_B(nfa, curr->anchoredMinDistance,
local_buffer, local_alen,
- roseAnchoredCallback, &scratch->tctxt);
+ roseAnchoredCallback, scratch);
}
}
DEBUG_PRINTF("BEGIN SMALL BLOCK (over %zu/%zu)\n", sblen, length);
DEBUG_PRINTF("-- %016llx\n", tctxt->groups);
hwlmExec(sbtable, scratch->core_info.buf, sblen, 0, roseCallback,
- tctxt, tctxt->groups);
+ scratch, tctxt->groups);
goto exit;
}
DEBUG_PRINTF("BEGIN FLOATING (over %zu/%zu)\n", flen, length);
DEBUG_PRINTF("-- %016llx\n", tctxt->groups);
hwlmExec(ftable, buffer, flen, t->floatingMinDistance,
- roseCallback, tctxt, tctxt->groups);
+ roseCallback, scratch, tctxt->groups);
}
exit:;
struct RoseContext *tctxt = &scratch->tctxt;
const struct HWLM *etable = getELiteralMatcher(t);
- hwlmExec(etable, eod_data, eod_len, adj, roseCallback, tctxt, tctxt->groups);
+ hwlmExec(etable, eod_data, eod_len, adj, roseCallback, scratch,
+ tctxt->groups);
// We may need to fire delayed matches
return cleanUpDelayed(t, scratch, 0, offset);
}
int roseAnchoredCallback(u64a end, u32 id, void *ctx) {
- struct RoseContext *tctxt = ctx;
- struct hs_scratch *scratch = tctxtToScratch(tctxt);
+ struct hs_scratch *scratch = ctx;
+ struct RoseContext *tctxt = &scratch->tctxt;
struct core_info *ci = &scratch->core_info;
const struct RoseEngine *t = ci->rose;
}
hwlmcb_rv_t roseCallback(size_t start, size_t end, u32 id, void *ctxt) {
- struct RoseContext *tctx = ctxt;
- struct hs_scratch *scratch = tctxtToScratch(tctx);
+ struct hs_scratch *scratch = ctxt;
+ struct RoseContext *tctx = &scratch->tctxt;
const struct RoseEngine *t = scratch->core_info.rose;
u64a real_end = end + tctx->lit_offset_adjust;
if (nfa->type == MCCLELLAN_NFA_8) {
nfaExecMcClellan8_SimpStream(nfa, state, scratch->core_info.buf,
start, adj, alen, roseAnchoredCallback,
- &scratch->tctxt);
+ scratch);
} else {
nfaExecMcClellan16_SimpStream(nfa, state, scratch->core_info.buf,
- start, adj, alen, roseAnchoredCallback,
- &scratch->tctxt);
+ start, adj, alen,
+ roseAnchoredCallback, scratch);
}
next_nfa:
}
DEBUG_PRINTF("BEGIN FLOATING (over %zu/%zu)\n", flen, length);
- hwlmExecStreaming(ftable, scratch, flen, start, roseCallback, tctxt,
+ hwlmExecStreaming(ftable, scratch, flen, start, roseCallback, scratch,
tctxt->groups, stream_state);
}