Rizin
unix-like reverse engineering framework and cli tools
|
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#include <ctype.h>
#include <rz_regex.h>
#include "utils.h"
#include "regex2.h"
#include "engine.c"
Go to the source code of this file.
Macros | |
#define | states1 long long /* for later use in regexec() decision */ |
#define | states states1 |
#define | CLEAR(v) ((v) = 0) |
#define | SET0(v, n) ((v) &= ~((unsigned states)1 << (n))) |
#define | SET1(v, n) ((v) |= (unsigned states)1 << (n)) |
#define | ISSET(v, n) (((v) & ((unsigned states)1 << (n))) != 0) |
#define | ASSIGN(d, s) ((d) = (s)) |
#define | EQ(a, b) ((a) == (b)) |
#define | STATEVARS states dummy /* dummy version */ |
#define | STATESETUP(m, n) /* nothing */ |
#define | STATETEARDOWN(m) /* nothing */ |
#define | SETUP(v) ((v) = 0) |
#define | onestate states |
#define | INIT(o, n) ((o) = (unsigned states)1 << (n)) |
#define | INC(o) ((o) <<= 1) |
#define | ISSTATEIN(v, o) (((v) & (o)) != 0) |
#define | FWD(dst, src, n) ((dst) |= ((unsigned states)(src) & (here)) << (n)) |
#define | BACK(dst, src, n) ((dst) |= ((unsigned states)(src) & (here)) >> (n)) |
#define | ISSETBACK(v, n) (((v) & ((unsigned states)here >> (n))) != 0) |
#define | SNAMES /* engine.c looks after details */ |
#define | states char * |
#define | CLEAR(v) memset(v, 0, m->g->nstates) |
#define | SET0(v, n) ((v)[n] = 0) |
#define | SET1(v, n) ((v)[n] = 1) |
#define | ISSET(v, n) ((v)[n]) |
#define | ASSIGN(d, s) memcpy(d, s, m->g->nstates) |
#define | EQ(a, b) (memcmp(a, b, m->g->nstates) == 0) |
#define | STATEVARS |
#define | STATESETUP(m, nv) |
#define | STATETEARDOWN(m) { free((m)->space); } |
#define | SETUP(v) ((v) = &m->space[m->vn++ * m->g->nstates]) |
#define | onestate states1 |
#define | INIT(o, n) ((o) = (n)) |
#define | INC(o) ((o)++) |
#define | ISSTATEIN(v, o) ((v)[o]) |
#define | FWD(dst, src, n) ((dst)[here + (n)] |= (src)[here]) |
#define | BACK(dst, src, n) ((dst)[here - (n)] |= (src)[here]) |
#define | ISSETBACK(v, n) ((v)[here - (n)]) |
#define | LNAMES /* flag */ |
#define | GOODFLAGS(f) ((f) & (RZ_REGEX_NOTBOL | RZ_REGEX_NOTEOL | RZ_REGEX_STARTEND | RZ_REGEX_LARGE)) |
Functions | |
RZ_API bool | rz_regex_check (const RzRegex *rr, const char *str) |
RZ_API int | rz_regex_exec (const RzRegex *preg, const char *string, size_t nmatch, RzRegexMatch pmatch[], int eflags) |
#define GOODFLAGS | ( | f | ) | ((f) & (RZ_REGEX_NOTBOL | RZ_REGEX_NOTEOL | RZ_REGEX_STARTEND | RZ_REGEX_LARGE)) |
#define STATESETUP | ( | m, | |
nv | |||
) |
#define STATEVARS |
Definition at line 138 of file regexec.c.
References NULL, rz_regex_t::re_flags, rz_regex_exec(), and cmd_descs_generate::str.
Referenced by test_or().
RZ_API int rz_regex_exec | ( | const RzRegex * | preg, |
const char * | string, | ||
size_t | nmatch, | ||
RzRegexMatch | pmatch[], | ||
int | eflags | ||
) |
Definition at line 149 of file regexec.c.
References BAD, CHAR_BIT, g, GOODFLAGS, MAGIC1, MAGIC2, rz_regex_t::re_g, rz_regex_t::re_magic, RZ_REGEX_ASSERT, RZ_REGEX_BADPAT, RZ_REGEX_LARGE, and states1.
Referenced by _main(), check_fmt(), find_e_opts(), magiccheck(), main(), pager_all_matches(), rz_asm_tokenize_asm_regex(), rz_core_asm_strsearch(), rz_regex_check(), rz_regex_get_match_list(), rz_regex_match(), rz_search_regexp_update(), str_split_list_common_regex(), and test_or().