#include "sdb.h"
#include <ctype.h>
Go to the source code of this file.
|
static int | haveSuffix (const char *glob, int glob_len, const char *sfx) |
|
static int | havePrefix (const char *glob, int glob_len, const char *pfx) |
|
static int | mycmp (const char *a, const char *b, int n, int any) |
|
static int | strstr2 (const char *a, const char *b, int n) |
|
static bool | compareString (const char *a, const char *b, int blen, int flags) |
|
RZ_API bool | sdb_match (const char *str, const char *glob) |
|
◆ MatchFlag
Enumerator |
---|
SDB_LIKE_NONE | |
SDB_LIKE_ICASE | |
SDB_LIKE_START | |
SDB_LIKE_END | |
SDB_LIKE_BASE64 | |
Definition at line 17 of file match.c.
◆ compareString()
Definition at line 52 of file match.c.
58 if (!
a || !
b || blen < 0) {
73 ret = (alen == blen && !
mycmp(
a,
b, blen, 0));
77 ret = !
mycmp(
a + (alen - blen),
b, blen, 0);
82 ret = (alen == blen && !strncmp(
a,
b, blen));
84 ret = !strncmp(
a,
b, blen);
86 ret = !strncmp(
a + (alen - blen),
b, blen);
RZ_API ut8 * sdb_decode(const char *in, int *len)
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void static offset struct stat static buf void long static basep static whence static length const void static len static semflg const void static shmflg const struct timespec struct timespec static rem const char static group const void start
RZ_API void Ht_() free(HtName_(Ht) *ht)
static int strstr2(const char *a, const char *b, int n)
static int mycmp(const char *a, const char *b, int n, int any)
static struct sockaddr static addrlen static backlog const void static flags void flags
References a, b, test_evm::end, flags, free(), mycmp(), NULL, sdb_decode(), SDB_LIKE_BASE64, SDB_LIKE_END, SDB_LIKE_ICASE, SDB_LIKE_START, start, and strstr2().
Referenced by sdb_match().
◆ havePrefix()
Definition at line 12 of file match.c.
13 const int pfx_len = strlen(pfx);
14 return (pfx_len < glob_len && !strncmp(glob, pfx, pfx_len));
Referenced by sdb_match().
◆ haveSuffix()
Definition at line 7 of file match.c.
8 const int sfx_len = strlen(sfx);
9 return (glob_len > sfx_len && !strcmp(glob + glob_len - sfx_len, sfx));
Referenced by sdb_match().
◆ mycmp()
◆ sdb_match()
Definition at line 95 of file match.c.
100 glob_len = strlen(glob);
static bool compareString(const char *a, const char *b, int blen, int flags)
static int havePrefix(const char *glob, int glob_len, const char *pfx)
static int haveSuffix(const char *glob, int glob_len, const char *sfx)
References compareString(), flags, havePrefix(), haveSuffix(), SDB_LIKE_BASE64, SDB_LIKE_END, SDB_LIKE_ICASE, SDB_LIKE_NONE, SDB_LIKE_START, and cmd_descs_generate::str.
Referenced by like_cb(), and unset_cb().
◆ strstr2()