1#ifndef _WDL_HASSTRINGS_H_
2#define _WDL_HASSTRINGS_H_
4#ifndef WDL_HASSTRINGS_EXPORT
5#define WDL_HASSTRINGS_EXPORT
28 int (*cmp_func)(
const char *
a,
int apos,
const char *
b,
int blen)
33 if (ntok<1)
return true;
39 const int strlen_name = (
int)strlen(
name);
40 char matched_local=-1;
41 for (
int x = 0;
x < ntok;
x ++)
47 if (!(matched_local&1))
49 stack[stacktop] |= matched_local | 0x10;
57 if (stacktop < (
int)
sizeof(stack) - 1) stack[++stacktop] = 0;
61 if (stack[--stacktop]&0x10)
64 matched_local = stack[stacktop]&2;
68 matched_local = (matched_local != 0 ? 1 : 0) ^ (stack[stacktop]&1);
72 else if (matched_local != 2 && !strcmp(
n,
"OR"))
74 matched_local = (matched_local > 0) ? 2 : -1;
77 else if (matched_local&1)
88 else if ((ln=(
int)strlen(
n))>0)
103 if (*++
n !=
' ') wc_left=2;
120 if (
n[--ln - 1] !=
' ') wc_right=2;
130 bool use_cmp_func = cmp_func !=
NULL && !(stack[stacktop]&1);
132 if (!wc_left && !wc_right && *
n)
140 while (*
p && *
p !=
' ' && *
p !=
'\t')
p++;
144 use_cmp_func =
false;
152 const int min_len = use_cmp_func ? 1 : ln;
161 if (wc_right == 0)
break;
162 const unsigned char nc=((
const unsigned char*)
t)[lln];
173 const int lln = use_cmp_func ? cmp_func(
t,
t-
name,
n,ln) :
strnicmp(
t,
n,ln) ? 0 : ln;
176 if (wc_right == 0)
break;
177 const unsigned char nc=((
const unsigned char*)
t)[lln];
185 matched_local = ((lt-min_len)>=0) ^ (stack[stacktop]&1);
192 if (stack[--stacktop] & 0x10) matched_local=stack[stacktop]&2;
193 else matched_local = (matched_local > 0 ? 1 : 0) ^ (stack[stacktop]&1);
196 return matched_local!=0;
210#ifdef WDL_LINEPARSER_HAS_LINEPARSERINT
211 if (lp->
parse_ex(flt,
true,
false,
true))
uint8_t a
Definition Spc_Cpu.h:141
WDL_LINEPARSE_IMPL_ONLY.
Definition lineparse.h:297
int WDL_LINEPARSE_PREFIX parse_ex(const char *line, bool ignore_commentchars WDL_LINEPARSE_DEFPARM(true), bool backtickquote WDL_LINEPARSE_DEFPARM(true), bool allowunterminatedquotes WDL_LINEPARSE_DEFPARM(false))
Definition lineparse.h:324
void WDL_LINEPARSE_PREFIX set_one_token(const char *line)
Definition lineparse.h:329
const char *WDL_LINEPARSE_PREFIX gettoken_str(int token) const
Definition lineparse.h:222
char WDL_LINEPARSE_PREFIX gettoken_quotingchar(int token) const
Definition lineparse.h:229
int getnumtokens() const
Definition lineparse.h:55
struct huft * t
Definition inflate.c:943
unsigned x[BMAX+1]
Definition inflate.c:1586
static const char * name
Definition pugl.h:1582
#define WDL_HASSTRINGS_EXPORT
Definition has_strings.h:5
WDL_HASSTRINGS_EXPORT bool WDL_hasStringsEx(const char *name, const LineParser *lp, int(*cmp_func)(const char *a, int apos, const char *b, int blen))
Definition has_strings.h:27
WDL_HASSTRINGS_EXPORT bool WDL_hasStrings(const char *name, const LineParser *lp)
Definition has_strings.h:199
WDL_HASSTRINGS_EXPORT bool hasStrings_isNonWordChar(int c)
Definition has_strings.h:8
WDL_HASSTRINGS_EXPORT bool WDL_makeSearchFilter(const char *flt, LineParser *lp)
Definition has_strings.h:204
#define strnicmp(x, y, z)
Definition swell-types.h:71
int n
Definition crypt.c:458
uch * p
Definition crypt.c:594
return c
Definition crypt.c:175
typedef int(UZ_EXP MsgFn)()
#define lastchar(ptr, len)
Definition unzpriv.h:1260
#define WDL_NOT_NORMALLY(x)
Definition wdltypes.h:166