aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/hyperscan/src/nfa/gough.c
diff options
context:
space:
mode:
authorIvan Blinkov <ivan@blinkov.ru>2022-02-10 16:47:10 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:47:10 +0300
commit1aeb9a455974457866f78722ad98114bafc84e8a (patch)
treee4340eaf1668684d83a0a58c36947c5def5350ad /contrib/libs/hyperscan/src/nfa/gough.c
parentbd5ef432f5cfb1e18851381329d94665a4c22470 (diff)
downloadydb-1aeb9a455974457866f78722ad98114bafc84e8a.tar.gz
Restoring authorship annotation for Ivan Blinkov <ivan@blinkov.ru>. Commit 1 of 2.
Diffstat (limited to 'contrib/libs/hyperscan/src/nfa/gough.c')
-rw-r--r--contrib/libs/hyperscan/src/nfa/gough.c78
1 files changed, 39 insertions, 39 deletions
diff --git a/contrib/libs/hyperscan/src/nfa/gough.c b/contrib/libs/hyperscan/src/nfa/gough.c
index 44acd4c286..1dde71e9ba 100644
--- a/contrib/libs/hyperscan/src/nfa/gough.c
+++ b/contrib/libs/hyperscan/src/nfa/gough.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2015-2016, Intel Corporation
+ * Copyright (c) 2015-2016, Intel Corporation
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
@@ -110,7 +110,7 @@ u64a expandSomValue(u32 comp_slot_width, u64a curr_offset,
}
static really_inline
-char doReports(NfaCallback cb, void *ctxt, const struct mcclellan *m,
+char doReports(NfaCallback cb, void *ctxt, const struct mcclellan *m,
const struct gough_som_info *som, u16 s, u64a loc,
char eod, u16 * const cached_accept_state,
u32 * const cached_accept_id, u32 * const cached_accept_som) {
@@ -307,7 +307,7 @@ u16 goughEnableStarts(const struct mcclellan *m, u16 s, u64a som_offset,
static really_inline
char goughExec16_i(const struct mcclellan *m, struct gough_som_info *som,
u16 *state, const u8 *buf, size_t len, u64a offAdj,
- NfaCallback cb, void *ctxt, const u8 **c_final,
+ NfaCallback cb, void *ctxt, const u8 **c_final,
enum MatchMode mode) {
assert(ISALIGNED_N(state, 2));
@@ -461,7 +461,7 @@ with_accel:
static really_inline
char goughExec8_i(const struct mcclellan *m, struct gough_som_info *som,
u8 *state, const u8 *buf, size_t len, u64a offAdj,
- NfaCallback cb, void *ctxt, const u8 **c_final,
+ NfaCallback cb, void *ctxt, const u8 **c_final,
enum MatchMode mode) {
u8 s = *state;
const u8 *c = buf, *c_end = buf + len;
@@ -595,7 +595,7 @@ with_accel:
static never_inline
char goughExec8_i_ni(const struct mcclellan *m, struct gough_som_info *som,
u8 *state, const u8 *buf, size_t len, u64a offAdj,
- NfaCallback cb, void *ctxt, const u8 **final_point,
+ NfaCallback cb, void *ctxt, const u8 **final_point,
enum MatchMode mode) {
return goughExec8_i(m, som, state, buf, len, offAdj, cb, ctxt, final_point,
mode);
@@ -604,7 +604,7 @@ char goughExec8_i_ni(const struct mcclellan *m, struct gough_som_info *som,
static never_inline
char goughExec16_i_ni(const struct mcclellan *m, struct gough_som_info *som,
u16 *state, const u8 *buf, size_t len, u64a offAdj,
- NfaCallback cb, void *ctxt, const u8 **final_point,
+ NfaCallback cb, void *ctxt, const u8 **final_point,
enum MatchMode mode) {
return goughExec16_i(m, som, state, buf, len, offAdj, cb, ctxt, final_point,
mode);
@@ -622,7 +622,7 @@ const struct gough_som_info *getSomInfoConst(const char *state_base) {
static really_inline
char nfaExecGough8_Q2i(const struct NFA *n, u64a offset, const u8 *buffer,
- const u8 *hend, NfaCallback cb, void *context,
+ const u8 *hend, NfaCallback cb, void *context,
struct mq *q, s64a end, enum MatchMode mode) {
DEBUG_PRINTF("enter\n");
struct gough_som_info *som = getSomInfo(q->state);
@@ -685,7 +685,7 @@ char nfaExecGough8_Q2i(const struct NFA *n, u64a offset, const u8 *buffer,
const u8 *final_look;
if (goughExec8_i_ni(m, som, &s, cur_buf + sp, local_ep - sp,
- offset + sp, cb, context, &final_look, mode)
+ offset + sp, cb, context, &final_look, mode)
== MO_HALT_MATCHING) {
*(u8 *)q->state = 0;
return 0;
@@ -747,7 +747,7 @@ char nfaExecGough8_Q2i(const struct NFA *n, u64a offset, const u8 *buffer,
static really_inline
char nfaExecGough16_Q2i(const struct NFA *n, u64a offset, const u8 *buffer,
- const u8 *hend, NfaCallback cb, void *context,
+ const u8 *hend, NfaCallback cb, void *context,
struct mq *q, s64a end, enum MatchMode mode) {
struct gough_som_info *som = getSomInfo(q->state);
assert(n->type == GOUGH_NFA_16);
@@ -808,7 +808,7 @@ char nfaExecGough16_Q2i(const struct NFA *n, u64a offset, const u8 *buffer,
/* do main buffer region */
const u8 *final_look;
if (goughExec16_i_ni(m, som, &s, cur_buf + sp, local_ep - sp,
- offset + sp, cb, context, &final_look, mode)
+ offset + sp, cb, context, &final_look, mode)
== MO_HALT_MATCHING) {
*(u16 *)q->state = 0;
return 0;
@@ -870,7 +870,7 @@ char nfaExecGough16_Q2i(const struct NFA *n, u64a offset, const u8 *buffer,
char nfaExecGough8_Q(const struct NFA *n, struct mq *q, s64a end) {
u64a offset = q->offset;
const u8 *buffer = q->buffer;
- NfaCallback cb = q->cb;
+ NfaCallback cb = q->cb;
void *context = q->context;
assert(n->type == GOUGH_NFA_8);
const u8 *hend = q->history + q->hlength;
@@ -882,7 +882,7 @@ char nfaExecGough8_Q(const struct NFA *n, struct mq *q, s64a end) {
char nfaExecGough16_Q(const struct NFA *n, struct mq *q, s64a end) {
u64a offset = q->offset;
const u8 *buffer = q->buffer;
- NfaCallback cb = q->cb;
+ NfaCallback cb = q->cb;
void *context = q->context;
assert(n->type == GOUGH_NFA_16);
const u8 *hend = q->history + q->hlength;
@@ -894,7 +894,7 @@ char nfaExecGough16_Q(const struct NFA *n, struct mq *q, s64a end) {
char nfaExecGough8_Q2(const struct NFA *n, struct mq *q, s64a end) {
u64a offset = q->offset;
const u8 *buffer = q->buffer;
- NfaCallback cb = q->cb;
+ NfaCallback cb = q->cb;
void *context = q->context;
assert(n->type == GOUGH_NFA_8);
const u8 *hend = q->history + q->hlength;
@@ -906,7 +906,7 @@ char nfaExecGough8_Q2(const struct NFA *n, struct mq *q, s64a end) {
char nfaExecGough16_Q2(const struct NFA *n, struct mq *q, s64a end) {
u64a offset = q->offset;
const u8 *buffer = q->buffer;
- NfaCallback cb = q->cb;
+ NfaCallback cb = q->cb;
void *context = q->context;
assert(n->type == GOUGH_NFA_16);
const u8 *hend = q->history + q->hlength;
@@ -918,7 +918,7 @@ char nfaExecGough16_Q2(const struct NFA *n, struct mq *q, s64a end) {
char nfaExecGough8_QR(const struct NFA *n, struct mq *q, ReportID report) {
u64a offset = q->offset;
const u8 *buffer = q->buffer;
- NfaCallback cb = q->cb;
+ NfaCallback cb = q->cb;
void *context = q->context;
assert(n->type == GOUGH_NFA_8);
const u8 *hend = q->history + q->hlength;
@@ -935,7 +935,7 @@ char nfaExecGough8_QR(const struct NFA *n, struct mq *q, ReportID report) {
char nfaExecGough16_QR(const struct NFA *n, struct mq *q, ReportID report) {
u64a offset = q->offset;
const u8 *buffer = q->buffer;
- NfaCallback cb = q->cb;
+ NfaCallback cb = q->cb;
void *context = q->context;
assert(n->type == GOUGH_NFA_16);
const u8 *hend = q->history + q->hlength;
@@ -977,7 +977,7 @@ char nfaExecGough16_initCompressedState(const struct NFA *nfa, u64a offset,
char nfaExecGough8_reportCurrent(const struct NFA *n, struct mq *q) {
const struct mcclellan *m = (const struct mcclellan *)getImplNfa(n);
- NfaCallback cb = q->cb;
+ NfaCallback cb = q->cb;
void *ctxt = q->context;
u8 s = *(u8 *)q->state;
u64a offset = q_cur_offset(q);
@@ -999,7 +999,7 @@ char nfaExecGough8_reportCurrent(const struct NFA *n, struct mq *q) {
char nfaExecGough16_reportCurrent(const struct NFA *n, struct mq *q) {
const struct mcclellan *m = (const struct mcclellan *)getImplNfa(n);
- NfaCallback cb = q->cb;
+ NfaCallback cb = q->cb;
void *ctxt = q->context;
u16 s = *(u16 *)q->state;
const struct mstate_aux *aux = get_aux(m, s);
@@ -1031,42 +1031,42 @@ char nfaExecGough16_inAccept(const struct NFA *n, ReportID report,
return nfaExecMcClellan16_inAccept(n, report, q);
}
-char nfaExecGough8_inAnyAccept(const struct NFA *n, struct mq *q) {
- return nfaExecMcClellan8_inAnyAccept(n, q);
-}
-
-char nfaExecGough16_inAnyAccept(const struct NFA *n, struct mq *q) {
- return nfaExecMcClellan16_inAnyAccept(n, q);
-}
-
+char nfaExecGough8_inAnyAccept(const struct NFA *n, struct mq *q) {
+ return nfaExecMcClellan8_inAnyAccept(n, q);
+}
+
+char nfaExecGough16_inAnyAccept(const struct NFA *n, struct mq *q) {
+ return nfaExecMcClellan16_inAnyAccept(n, q);
+}
+
static
-char goughCheckEOD(const struct NFA *nfa, u16 s,
+char goughCheckEOD(const struct NFA *nfa, u16 s,
const struct gough_som_info *som,
- u64a offset, NfaCallback cb, void *ctxt) {
+ u64a offset, NfaCallback cb, void *ctxt) {
const struct mcclellan *m = (const struct mcclellan *)getImplNfa(nfa);
const struct mstate_aux *aux = get_aux(m, s);
- if (!aux->accept_eod) {
- return MO_CONTINUE_MATCHING;
+ if (!aux->accept_eod) {
+ return MO_CONTINUE_MATCHING;
}
- return doReports(cb, ctxt, m, som, s, offset, 1, NULL, NULL, NULL);
+ return doReports(cb, ctxt, m, som, s, offset, 1, NULL, NULL, NULL);
}
char nfaExecGough8_testEOD(const struct NFA *nfa, const char *state,
- UNUSED const char *streamState, u64a offset,
- NfaCallback callback, void *context) {
+ UNUSED const char *streamState, u64a offset,
+ NfaCallback callback, void *context) {
const struct gough_som_info *som = getSomInfoConst(state);
- return goughCheckEOD(nfa, *(const u8 *)state, som, offset, callback,
- context);
+ return goughCheckEOD(nfa, *(const u8 *)state, som, offset, callback,
+ context);
}
char nfaExecGough16_testEOD(const struct NFA *nfa, const char *state,
- UNUSED const char *streamState, u64a offset,
- NfaCallback callback, void *context) {
+ UNUSED const char *streamState, u64a offset,
+ NfaCallback callback, void *context) {
assert(ISALIGNED_N(state, 8));
const struct gough_som_info *som = getSomInfoConst(state);
- return goughCheckEOD(nfa, *(const u16 *)state, som, offset, callback,
- context);
+ return goughCheckEOD(nfa, *(const u16 *)state, som, offset, callback,
+ context);
}
char nfaExecGough8_queueInitState(UNUSED const struct NFA *nfa, struct mq *q) {