7 static int GLOB_ERROR = 0;
12 croak("%s not implemented on this architecture", s);
18 constant(char *name, int arg)
21 if (strlen(name) <= 5)
25 if (strEQ(name, "GLOB_ABEND"))
31 if (strEQ(name, "GLOB_ALTDIRFUNC"))
32 #ifdef GLOB_ALTDIRFUNC
33 return GLOB_ALTDIRFUNC;
39 if (strEQ(name, "GLOB_BRACE"))
51 if (strEQ(name, "GLOB_ERR"))
57 if (strEQ(name, "GLOB_ERROR"))
75 if (strEQ(name, "GLOB_MARK"))
83 if (strEQ(name, "GLOB_NOCASE"))
89 if (strEQ(name, "GLOB_NOCHECK"))
95 if (strEQ(name, "GLOB_NOMAGIC"))
101 if (strEQ(name, "GLOB_NOSORT"))
107 if (strEQ(name, "GLOB_NOSPACE"))
119 if (strEQ(name, "GLOB_QUOTE"))
131 if (strEQ(name, "GLOB_TILDE"))
163 errfunc(const char *foo, int bar) {
164 return !(bar == ENOENT || bar == ENOTDIR);
168 MODULE = File::Glob PACKAGE = File::Glob
182 /* allow for optional flags argument */
184 flags = (int) SvIV(ST(1));
188 retval = bsd_glob(pattern, flags, errfunc, &pglob);
191 /* return any matches found */
192 EXTEND(sp, pglob.gl_pathc);
193 for (i = 0; i < pglob.gl_pathc; i++) {
194 /* printf("# bsd_glob: %s\n", pglob.gl_pathv[i]); */
195 tmp = sv_2mortal(newSVpvn(pglob.gl_pathv[i],
196 strlen(pglob.gl_pathv[i])));
202 bsd_globfree(&pglob);