11 /* KLUDGE ALERT: evil globals */
13 static int glob_whichfile;
15 int FileFindFirst(char *search_str, FILEFINDSTRUCT *ffstruct)
20 Assert(search_str != NULL);
21 Assert(ffstruct != NULL);
23 r = glob(search_str, 0, NULL, &glob_a);
24 if (r == GLOB_NOMATCH) return -1;
28 t = strrchr(glob_a.gl_pathv[glob_whichfile], '/');
29 if (t == NULL) t = glob_a.gl_pathv[glob_whichfile]; else t++;
30 strncpy(ffstruct->name, t, 255);
31 ffstruct->size = strlen(ffstruct->name);
36 int FileFindNext(FILEFINDSTRUCT *ffstruct)
42 if (glob_whichfile >= glob_a.gl_pathc) return -1;
44 t = strrchr(glob_a.gl_pathv[glob_whichfile], '/');
45 if (t == NULL) t = glob_a.gl_pathv[glob_whichfile]; else t++;
46 strncpy(ffstruct->name, t, 255);
47 ffstruct->size = strlen(ffstruct->name);
51 int FileFindClose(void)
58 #endif // __ENV_LINUX__