diff options
author | thegeorg <thegeorg@yandex-team.ru> | 2022-02-10 16:45:08 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:08 +0300 |
commit | 4e839db24a3bbc9f1c610c43d6faaaa99824dcca (patch) | |
tree | 506dac10f5df94fab310584ee51b24fc5a081c22 /contrib/libs/hyperscan/src/rose/match.c | |
parent | 2d37894b1b037cf24231090eda8589bbb44fb6fc (diff) | |
download | ydb-4e839db24a3bbc9f1c610c43d6faaaa99824dcca.tar.gz |
Restoring authorship annotation for <thegeorg@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/libs/hyperscan/src/rose/match.c')
-rw-r--r-- | contrib/libs/hyperscan/src/rose/match.c | 90 |
1 files changed, 45 insertions, 45 deletions
diff --git a/contrib/libs/hyperscan/src/rose/match.c b/contrib/libs/hyperscan/src/rose/match.c index 84d3b1fdc2..00183e64fa 100644 --- a/contrib/libs/hyperscan/src/rose/match.c +++ b/contrib/libs/hyperscan/src/rose/match.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2015-2019, Intel Corporation + * Copyright (c) 2015-2019, Intel Corporation * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: @@ -238,11 +238,11 @@ hwlmcb_rv_t roseProcessMatchInline(const struct RoseEngine *t, assert(id && id < t->size); // id is an offset into bytecode const u64a som = 0; const u8 flags = 0; - if (t->pureLiteral) { - return roseRunProgram_l(t, scratch, id, som, end, flags); - } else { - return roseRunProgram(t, scratch, id, som, end, flags); - } + if (t->pureLiteral) { + return roseRunProgram_l(t, scratch, id, som, end, flags); + } else { + return roseRunProgram(t, scratch, id, som, end, flags); + } } static rose_inline @@ -575,39 +575,39 @@ int roseRunBoundaryProgram(const struct RoseEngine *rose, u32 program, return MO_CONTINUE_MATCHING; } -/** - * \brief Execute a flush combination program. - * - * Returns MO_HALT_MATCHING if the stream is exhausted or the user has - * instructed us to halt, or MO_CONTINUE_MATCHING otherwise. - */ -int roseRunFlushCombProgram(const struct RoseEngine *rose, - struct hs_scratch *scratch, u64a end) { - hwlmcb_rv_t rv = roseRunProgram(rose, scratch, rose->flushCombProgramOffset, - 0, end, 0); - if (rv == HWLM_TERMINATE_MATCHING) { - return MO_HALT_MATCHING; - } - return MO_CONTINUE_MATCHING; -} - -/** - * \brief Execute last flush combination program. - * - * Returns MO_HALT_MATCHING if the stream is exhausted or the user has - * instructed us to halt, or MO_CONTINUE_MATCHING otherwise. - */ -int roseRunLastFlushCombProgram(const struct RoseEngine *rose, - struct hs_scratch *scratch, u64a end) { - hwlmcb_rv_t rv = roseRunProgram(rose, scratch, - rose->lastFlushCombProgramOffset, - 0, end, 0); - if (rv == HWLM_TERMINATE_MATCHING) { - return MO_HALT_MATCHING; - } - return MO_CONTINUE_MATCHING; -} - +/** + * \brief Execute a flush combination program. + * + * Returns MO_HALT_MATCHING if the stream is exhausted or the user has + * instructed us to halt, or MO_CONTINUE_MATCHING otherwise. + */ +int roseRunFlushCombProgram(const struct RoseEngine *rose, + struct hs_scratch *scratch, u64a end) { + hwlmcb_rv_t rv = roseRunProgram(rose, scratch, rose->flushCombProgramOffset, + 0, end, 0); + if (rv == HWLM_TERMINATE_MATCHING) { + return MO_HALT_MATCHING; + } + return MO_CONTINUE_MATCHING; +} + +/** + * \brief Execute last flush combination program. + * + * Returns MO_HALT_MATCHING if the stream is exhausted or the user has + * instructed us to halt, or MO_CONTINUE_MATCHING otherwise. + */ +int roseRunLastFlushCombProgram(const struct RoseEngine *rose, + struct hs_scratch *scratch, u64a end) { + hwlmcb_rv_t rv = roseRunProgram(rose, scratch, + rose->lastFlushCombProgramOffset, + 0, end, 0); + if (rv == HWLM_TERMINATE_MATCHING) { + return MO_HALT_MATCHING; + } + return MO_CONTINUE_MATCHING; +} + int roseReportAdaptor(u64a start, u64a end, ReportID id, void *context) { struct hs_scratch *scratch = context; assert(scratch && scratch->magic == SCRATCH_MAGIC); @@ -619,12 +619,12 @@ int roseReportAdaptor(u64a start, u64a end, ReportID id, void *context) { // Our match ID is the program offset. const u32 program = id; const u8 flags = ROSE_PROG_FLAG_SKIP_MPV_CATCHUP; - hwlmcb_rv_t rv; - if (rose->pureLiteral) { - rv = roseRunProgram_l(rose, scratch, program, start, end, flags); - } else { - rv = roseRunProgram(rose, scratch, program, start, end, flags); - } + hwlmcb_rv_t rv; + if (rose->pureLiteral) { + rv = roseRunProgram_l(rose, scratch, program, start, end, flags); + } else { + rv = roseRunProgram(rose, scratch, program, start, end, flags); + } if (rv == HWLM_TERMINATE_MATCHING) { return MO_HALT_MATCHING; } |