7 static inline int haveSuffix(
const char *glob,
int glob_len,
const char *sfx) {
8 const int sfx_len = strlen(sfx);
9 return (glob_len > sfx_len && !strcmp(glob + glob_len - sfx_len, sfx));
12 static inline int havePrefix(
const char *glob,
int glob_len,
const char *pfx) {
13 const int pfx_len = strlen(pfx);
14 return (pfx_len < glob_len && !strncmp(glob, pfx, pfx_len));
25 static inline int mycmp(
const char *
a,
const char *
b,
int n,
int any) {
27 for (
i = j = 0;
a[
i] &&
b[j] && j <
n;
i++) {
37 return any ? j !=
n : 1;
40 static inline int strstr2(
const char *
a,
const char *
b,
int n) {
42 for (
i = j = 0;
a[
i] &&
b[j] && j <
n;
i++) {
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);
100 glob_len = strlen(glob);
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 bool compareString(const char *a, const char *b, int blen, int flags)
static int strstr2(const char *a, const char *b, int n)
static int havePrefix(const char *glob, int glob_len, const char *pfx)
RZ_API bool sdb_match(const char *str, const char *glob)
static int mycmp(const char *a, const char *b, int n, int any)
static int haveSuffix(const char *glob, int glob_len, const char *sfx)
static struct sockaddr static addrlen static backlog const void static flags void flags