literal matchers: change context passed to callback to scratch

This commit is contained in:
Wang, Xiang W
2017-07-04 12:24:11 -04:00
committed by Matthew Barr
parent bc232d272f
commit 67a8f43355
17 changed files with 203 additions and 188 deletions

View File

@@ -170,7 +170,7 @@ void do_accel_streaming(const union AccelAux *aux, const u8 *hbuf, size_t hlen,
}
hwlm_error_t hwlmExec(const struct HWLM *t, const u8 *buf, size_t len,
size_t start, HWLMCallback cb, void *ctxt,
size_t start, HWLMCallback cb, struct hs_scratch *scratch,
hwlm_group_t groups) {
assert(t);
@@ -184,7 +184,7 @@ hwlm_error_t hwlmExec(const struct HWLM *t, const u8 *buf, size_t len,
if (t->type == HWLM_ENGINE_NOOD) {
DEBUG_PRINTF("calling noodExec\n");
return noodExec(HWLM_C_DATA(t), buf, len, start, cb, ctxt);
return noodExec(HWLM_C_DATA(t), buf, len, start, cb, scratch);
}
assert(t->type == HWLM_ENGINE_FDR);
@@ -195,12 +195,12 @@ hwlm_error_t hwlmExec(const struct HWLM *t, const u8 *buf, size_t len,
}
do_accel_block(aa, buf, len, &start);
DEBUG_PRINTF("calling frankie (groups=%08llx, start=%zu)\n", groups, start);
return fdrExec(HWLM_C_DATA(t), buf, len, start, cb, ctxt, groups);
return fdrExec(HWLM_C_DATA(t), buf, len, start, cb, scratch, groups);
}
hwlm_error_t hwlmExecStreaming(const struct HWLM *t, struct hs_scratch *scratch,
size_t len, size_t start, HWLMCallback cb,
void *ctxt, hwlm_group_t groups) {
hwlm_error_t hwlmExecStreaming(const struct HWLM *t, size_t len, size_t start,
HWLMCallback cb, struct hs_scratch *scratch,
hwlm_group_t groups) {
assert(t);
assert(scratch);
@@ -222,10 +222,10 @@ hwlm_error_t hwlmExecStreaming(const struct HWLM *t, struct hs_scratch *scratch,
// If we've been handed a start offset, we can use a block mode scan at
// that offset.
if (start) {
return noodExec(HWLM_C_DATA(t), buf, len, start, cb, ctxt);
return noodExec(HWLM_C_DATA(t), buf, len, start, cb, scratch);
} else {
return noodExecStreaming(HWLM_C_DATA(t), hbuf, hlen, buf, len, cb,
ctxt);
scratch);
}
}
@@ -238,5 +238,5 @@ hwlm_error_t hwlmExecStreaming(const struct HWLM *t, struct hs_scratch *scratch,
do_accel_streaming(aa, hbuf, hlen, buf, len, &start);
DEBUG_PRINTF("calling frankie (groups=%08llx, start=%zu)\n", groups, start);
return fdrExecStreaming(HWLM_C_DATA(t), hbuf, hlen, buf, len, start, cb,
ctxt, groups);
scratch, groups);
}