Char
#define CHAR(c) ((Char)((c)&M_CHAR))
#define META(c) ((Char)((c)|M_QUOTE))
static int g_Ctoc(const Char *, char *, size_t);
static int g_lstat(Char *, struct stat *, glob_t *);
static DIR *g_opendir(Char *, glob_t *);
static const Char *g_strchr(const Char *, wchar_t);
static Char *g_strcat(Char *, const Char *);
static int g_stat(Char *, struct stat *, glob_t *);
static int glob0(const Char *, glob_t *, struct glob_limit *);
static int glob1(Char *, glob_t *, struct glob_limit *);
static int glob2(Char *, Char *, Char *, Char *, glob_t *,
static int glob3(Char *, Char *, Char *, Char *, Char *, glob_t *,
static int globextend(const Char *, glob_t *, struct glob_limit *);
static const Char *
globtilde(const Char *, Char *, size_t, glob_t *);
static int globexp1(const Char *, glob_t *, struct glob_limit *);
static int globexp2(const Char *, const Char *, glob_t *, int *,
static int match(Char *, Char *, Char *);
static void qprintf(const char *, Char *);
Char *bufnext, *bufend, patbuf[MAXPATHLEN], prot;
globexp1(const Char *pattern, glob_t *pglob, struct glob_limit *limit)
const Char* ptr = pattern;
globexp2(const Char *ptr, const Char *pattern, glob_t *pglob, int *rv,
Char *lm, *ls;
const Char *pe, *pm, *pm1, *pl;
Char patbuf[MAXPATHLEN];
static const Char *
globtilde(const Char *pattern, Char *patbuf, size_t patbuf_len, glob_t *pglob)
const Char *p;
Char *b, *eb;
glob0(const Char *pattern, glob_t *pglob, struct glob_limit *limit)
const Char *qpatnext;
Char *bufnext, c, patbuf[MAXPATHLEN];
glob1(Char *pattern, glob_t *pglob, struct glob_limit *limit)
Char pathbuf[MAXPATHLEN];
glob2(Char *pathbuf, Char *pathend, Char *pathend_last, Char *pattern,
Char *p, *q;
glob3(Char *pathbuf, Char *pathend, Char *pathend_last,
Char *pattern, Char *restpattern,
Char *dc;
globextend(const Char *path, glob_t *pglob, struct glob_limit *limit)
const Char *p;
match(Char *name, Char *pat, Char *patend)
Char c, k;
g_opendir(Char *str, glob_t *pglob)
g_lstat(Char *fn, struct stat *sb, glob_t *pglob)
g_stat(Char *fn, struct stat *sb, glob_t *pglob)
static const Char *
g_strchr(const Char *str, wchar_t ch)
g_Ctoc(const Char *str, char *buf, size_t len)
qprintf(const char *str, Char *s)
Char *p;
g_lstat(Char *fn, struct stat *sb, glob_t *pglob)
g_stat(Char *fn, struct stat *sb, glob_t *pglob)
static Char *
g_strchr(const Char *str, int ch)
return ((Char *)str);
g_Ctoc(const Char *str, char *buf, size_t len)
qprintf(const char *str, Char *s)
Char *p;
#define CHAR(c) ((Char)((c)&M_ASCII))
#define META(c) ((Char)((c)|M_QUOTE))
static int g_Ctoc(const Char *, char *, size_t);
static int g_lstat(Char *, struct stat *, glob_t *);
static DIR *g_opendir(Char *, glob_t *);
static Char *g_strchr(const Char *, int);
static int g_strncmp(const Char *, const char *, size_t);
static int g_stat(Char *, struct stat *, glob_t *);
static int glob0(const Char *, glob_t *, struct glob_lim *);
static int glob1(Char *, Char *, glob_t *, struct glob_lim *);
static int glob2(Char *, Char *, Char *, Char *, Char *, Char *,
static int glob3(Char *, Char *, Char *, Char *, Char *,
Char *, Char *, glob_t *, struct glob_lim *);
static int globextend(const Char *, glob_t *, struct glob_lim *,
static const Char *
globtilde(const Char *, Char *, size_t, glob_t *);
static int globexp1(const Char *, glob_t *, struct glob_lim *);
static int globexp2(const Char *, const Char *, glob_t *,
static int match(Char *, Char *, Char *);
static void qprintf(const char *, Char *);
Char *bufnext, *bufend, patbuf[PATH_MAX];
globexp1(const Char *pattern, glob_t *pglob, struct glob_lim *limitp)
const Char* ptr = pattern;
if ((ptr = (const Char *) g_strchr(ptr, LBRACE)) != NULL)
globexp2(const Char *ptr, const Char *pattern, glob_t *pglob,
Char *lm, *ls;
const Char *pe, *pm, *pl;
Char patbuf[PATH_MAX];
static const Char *
globtilde(const Char *pattern, Char *patbuf, size_t patbuf_len, glob_t *pglob)
const Char *p;
Char *b, *eb;
g_strncmp(const Char *s1, const char *s2, size_t n)
rv = *(Char *)s1 - *(const unsigned char *)s2++;
g_charclass(const Char **patternp, Char **bufnextp)
const Char *pattern = *patternp + 1;
Char *bufnext = *bufnextp;
const Char *colon;
*bufnext++ = (Char)(cc - &cclasses[0]);
glob0(const Char *pattern, glob_t *pglob, struct glob_lim *limitp)
const Char *qpatnext;
Char *bufnext, patbuf[PATH_MAX];
glob1(Char *pattern, Char *pattern_last, glob_t *pglob, struct glob_lim *limitp)
Char pathbuf[PATH_MAX];
glob2(Char *pathbuf, Char *pathbuf_last, Char *pathend, Char *pathend_last,
Char *pattern, Char *pattern_last, glob_t *pglob, struct glob_lim *limitp)
Char *p, *q;
glob3(Char *pathbuf, Char *pathbuf_last, Char *pathend, Char *pathend_last,
Char *pattern, Char *restpattern, Char *restpattern_last, glob_t *pglob,
Char *dc;
globextend(const Char *path, glob_t *pglob, struct glob_lim *limitp,
const Char *p;
match(Char *name, Char *pat, Char *patend)
Char c, k;
Char *nextp = NULL;
Char *nextn = NULL;
Char idx = *pat & M_MASK;
g_opendir(Char *str, glob_t *pglob)