Lines Matching refs:pglob

295      glob_t *pglob)
306 pglob->gl_pathc = 0;
307 pglob->gl_pathv = NULL;
309 pglob->gl_offs = 0;
311 pglob->gl_flags = flags & ~GLOB_MAGCHAR;
312 pglob->gl_errfunc = errfunc;
313 oldpathc = pglob->gl_pathc;
314 pglob->gl_matchc = 0;
316 if (pglob->gl_flags & GLOB_ALTNOT) {
378 pglob->gl_flags |= GLOB_MAGCHAR;
395 pglob->gl_flags |= GLOB_MAGCHAR;
399 pglob->gl_flags |= GLOB_MAGCHAR;
419 if ((err = glob1(patbuf, pglob, no_match)) != 0) {
430 if (pglob->gl_pathc == oldpathc &&
432 ((flags & GLOB_NOMAGIC) && !(pglob->gl_flags & GLOB_MAGCHAR)))) {
434 globextend(pattern, pglob);
452 globextend(copy, pglob);
458 else if (!(flags & GLOB_NOSORT) && (pglob->gl_pathc != oldpathc))
459 qsort(pglob->gl_pathv + pglob->gl_offs + oldpathc,
460 pglob->gl_pathc - oldpathc, sizeof(char *), compare);
466 glob1(Char *pattern, glob_t *pglob, int no_match)
476 err = glob2(&pathbuf, pattern, pglob, no_match);
487 glob2(struct strbuf *pathbuf, const Char *pattern, glob_t *pglob, int no_match)
506 if (((pglob->gl_flags & GLOB_MARK) &&
518 ++pglob->gl_matchc;
519 globextend(pathbuf->s, pglob);
539 return (glob3(pathbuf, pattern, p, pattern, pglob, no_match));
565 const Char *pglobstar, glob_t *pglob, int no_match)
571 Char m_not = (pglob->gl_flags & GLOB_ALTNOT) ? M_ALTNOT : M_NOT;
597 glob2(pathbuf, restpattern - 1, pglob, no_match) :
598 glob2(pathbuf, restpattern + 1, pglob, no_match) :
599 glob3(pathbuf, pattern, restpattern, termstar, pglob, no_match);
615 if ((pglob->gl_errfunc && (*pglob->gl_errfunc) (pathbuf->s, errno)) ||
616 (pglob->gl_flags & GLOB_ERR))
626 if (!(pglob->gl_flags & GLOB_DOT) || !dp->d_name[1] ||
644 if ((err = glob2(pathbuf, pglobstar, pglob, no_match)) != 0)
650 if ((err = glob2(pathbuf, restpattern, pglob, no_match)) != 0)
675 globextend(const char *path, glob_t *pglob)
681 newsize = sizeof(*pathv) * (2 + pglob->gl_pathc + pglob->gl_offs);
682 pathv = xrealloc(pglob->gl_pathv, newsize);
684 if (pglob->gl_pathv == NULL && pglob->gl_offs > 0) {
686 pathv += pglob->gl_offs;
687 for (i = pglob->gl_offs; --i >= 0;)
690 pglob->gl_pathv = pathv;
692 pathv[pglob->gl_offs + pglob->gl_pathc++] = strsave(path);
693 pathv[pglob->gl_offs + pglob->gl_pathc] = NULL;
789 globfree(glob_t *pglob)
794 if (pglob->gl_pathv != NULL) {
795 pp = pglob->gl_pathv + pglob->gl_offs;
796 for (i = pglob->gl_pathc; i--; ++pp)
799 xfree(pglob->gl_pathv), pglob->gl_pathv = NULL;