Lines Matching refs:pglob

184     int), glob_t * __restrict pglob)  in glob()  argument
195 pglob->gl_pathc = 0; in glob()
196 pglob->gl_pathv = NULL; in glob()
198 pglob->gl_offs = 0; in glob()
200 pglob->gl_flags = flags & ~GLOB_MAGCHAR; in glob()
201 pglob->gl_errfunc = errfunc; in glob()
202 pglob->gl_matchc = 0; in glob()
225 return globexp1(patbuf, pglob, &limit); in glob()
227 return glob0(patbuf, pglob, &limit); in glob()
236 globexp1(const Char *pattern, glob_t *pglob, struct glob_limit *limit) in globexp1() argument
242 _DIAGASSERT(pglob != NULL); in globexp1()
244 if ((pglob->gl_flags & GLOB_LIMIT) && in globexp1()
252 return glob0(pattern, pglob, limit); in globexp1()
255 if (!globexp2(ptr, pattern, pglob, &rv, limit)) in globexp1()
258 return glob0(pattern, pglob, limit); in globexp1()
268 globexp2(const Char *ptr, const Char *pattern, glob_t *pglob, int *rv, in globexp2() argument
278 _DIAGASSERT(pglob != NULL); in globexp2()
314 *rv = glob0(pattern, pglob, limit); in globexp2()
361 *rv = globexp1(patbuf, pglob, limit); in globexp2()
382 globtilde(const Char *pattern, Char *patbuf, size_t patsize, glob_t *pglob) in globtilde() argument
399 _DIAGASSERT(pglob != NULL); in globtilde()
401 if (*pattern != TILDE || !(pglob->gl_flags & GLOB_TILDE)) in globtilde()
474 glob0(const Char *pattern, glob_t *pglob, struct glob_limit *limit) in glob0() argument
482 _DIAGASSERT(pglob != NULL); in glob0()
485 pglob)) == NULL) in glob0()
487 oldpathc = pglob->gl_pathc; in glob0()
517 pglob->gl_flags |= GLOB_MAGCHAR; in glob0()
521 pglob->gl_flags |= GLOB_MAGCHAR; in glob0()
525 pglob->gl_flags |= GLOB_MAGCHAR; in glob0()
530 ((pglob->gl_flags & GLOB_STAR) != 0 && in glob0()
545 if ((error = glob1(patbuf, pglob, limit)) != 0) in glob0()
548 if (pglob->gl_pathc == oldpathc) { in glob0()
556 if ((pglob->gl_flags & GLOB_NOCHECK) || in glob0()
557 ((pglob->gl_flags & (GLOB_NOMAGIC|GLOB_MAGCHAR)) in glob0()
559 return globextend(pattern, pglob, limit); in glob0()
563 } else if (!(pglob->gl_flags & GLOB_NOSORT)) { in glob0()
564 qsort(pglob->gl_pathv + pglob->gl_offs + oldpathc, in glob0()
565 (size_t)pglob->gl_pathc - oldpathc, sizeof(char *), in glob0()
583 glob1(Char *pattern, glob_t *pglob, struct glob_limit *limit) in glob1() argument
588 _DIAGASSERT(pglob != NULL); in glob1()
599 pglob, limit); in glob1()
609 glob_t *pglob, struct glob_limit *limit) in glob2() argument
619 _DIAGASSERT(pglob != NULL); in glob2()
631 if (g_lstat(pathbuf, &sb, pglob)) in glob2()
634 if ((pglob->gl_flags & GLOB_LIMIT) && in glob2()
641 if (((pglob->gl_flags & GLOB_MARK) && in glob2()
644 (g_stat(pathbuf, &sb, pglob) == 0) && in glob2()
651 ++pglob->gl_matchc; in glob2()
652 return globextend(pathbuf, pglob, limit); in glob2()
676 pattern, pglob, limit); in glob2()
683 const Char *restpattern, const Char *pglobstar, glob_t *pglob, in glob3() argument
707 _DIAGASSERT(pglob != NULL); in glob3()
726 glob2(pathbuf, pathend, pathlim, restpattern - 1, pglob, in glob3()
728 glob2(pathbuf, pathend, pathlim, restpattern + 1, pglob, in glob3()
731 termstar, pglob, limit); in glob3()
737 if (*pathbuf && (g_lstat(pathbuf, &sbuf, pglob) || in glob3()
745 if ((dirp = g_opendir(pathbuf, pglob)) == NULL) { in glob3()
746 if (pglob->gl_errfunc) { in glob3()
749 if (pglob->gl_errfunc(buf, errno) || in glob3()
750 pglob->gl_flags & GLOB_ERR) in glob3()
759 if (pglob->gl_flags & GLOB_ERR) in glob3()
768 if (pglob->gl_flags & GLOB_ALTDIRFUNC) in glob3()
769 readdirfunc = pglob->gl_readdir; in glob3()
776 if ((pglob->gl_flags & GLOB_LIMIT) && in glob3()
789 if ((pglob->gl_flags & GLOB_PERIOD) == 0) in glob3()
795 if ((pglob->gl_flags & GLOB_NO_DOTDIRS) && in glob3()
817 if (pglob->gl_flags & GLOB_ERR) { in glob3()
830 (g_lstat(pathbuf, &sbuf, pglob) || in glob3()
842 pglob, limit); in glob3()
852 pglob, limit); in glob3()
857 if (pglob->gl_flags & GLOB_ALTDIRFUNC) in glob3()
858 (*pglob->gl_closedir)(dirp); in glob3()
865 if ((error || errno) && (pglob->gl_flags & GLOB_ERR)) in glob3()
887 globextend(const Char *path, glob_t *pglob, struct glob_limit *limit) in globextend() argument
895 _DIAGASSERT(pglob != NULL); in globextend()
897 newsize = sizeof(*pathv) * (2 + pglob->gl_pathc + pglob->gl_offs); in globextend()
898 if ((pglob->gl_flags & GLOB_LIMIT) && in globextend()
901 pathv = pglob->gl_pathv ? realloc(pglob->gl_pathv, newsize) : in globextend()
906 if (pglob->gl_pathv == NULL && pglob->gl_offs > 0) { in globextend()
908 pathv += pglob->gl_offs; in globextend()
909 for (i = pglob->gl_offs + 1; --i > 0; ) in globextend()
912 pglob->gl_pathv = pathv; in globextend()
923 pathv[pglob->gl_offs + pglob->gl_pathc++] = copy; in globextend()
925 pathv[pglob->gl_offs + pglob->gl_pathc] = NULL; in globextend()
927 if ((pglob->gl_flags & GLOB_LIMIT) && in globextend()
995 globfree(glob_t *pglob) in globfree() argument
1000 _DIAGASSERT(pglob != NULL); in globfree()
1002 if (pglob->gl_pathv != NULL) { in globfree()
1003 pp = pglob->gl_pathv + pglob->gl_offs; in globfree()
1004 for (i = pglob->gl_pathc; i--; ++pp) in globfree()
1007 free(pglob->gl_pathv); in globfree()
1008 pglob->gl_pathv = NULL; in globfree()
1009 pglob->gl_pathc = 0; in globfree()
1047 g_opendir(Char *str, glob_t *pglob) in g_opendir() argument
1052 _DIAGASSERT(pglob != NULL); in g_opendir()
1061 if (pglob->gl_flags & GLOB_ALTDIRFUNC) in g_opendir()
1062 return (*pglob->gl_opendir)(buf); in g_opendir()
1068 g_lstat(Char *fn, __gl_stat_t *sb, glob_t *pglob) in g_lstat() argument
1074 _DIAGASSERT(pglob != NULL); in g_lstat()
1078 if (pglob->gl_flags & GLOB_ALTDIRFUNC) in g_lstat()
1079 return (*pglob->gl_lstat)(buf, sb); in g_lstat()
1084 g_stat(Char *fn, __gl_stat_t *sb, glob_t *pglob) in g_stat() argument
1090 _DIAGASSERT(pglob != NULL); in g_stat()
1094 if (pglob->gl_flags & GLOB_ALTDIRFUNC) in g_stat()
1095 return (*pglob->gl_stat)(buf, sb); in g_stat()