9 /* KLUDGE ALERT: evil globals */
11 static int glob_whichfile;
13 int FileFindFirst(char *search_str, FILEFINDSTRUCT *ffstruct)
18 Assert(search_str != NULL);
19 Assert(ffstruct != NULL);
21 r = glob(search_str, 0, NULL, &glob_a);
22 if (r == GLOB_NOMATCH) return -1;
26 t = strrchr(glob_a.gl_pathv[glob_whichfile], '/');
27 if (t == NULL) t = glob_a.gl_pathv[glob_whichfile]; else t++;
28 strncpy(ffstruct->name, t, 255);
29 ffstruct->size = strlen(ffstruct->name);
34 int FileFindNext(FILEFINDSTRUCT *ffstruct)
40 if (glob_whichfile >= glob_a.gl_pathc) return -1;
42 t = strrchr(glob_a.gl_pathv[glob_whichfile], '/');
43 if (t == NULL) t = glob_a.gl_pathv[glob_whichfile]; else t++;
44 strncpy(ffstruct->name, t, 255);
45 ffstruct->size = strlen(ffstruct->name);
49 int FileFindClose(void)