4 * Linux findfile functions
20 /* KLUDGE ALERT: evil globals */
22 static int glob_whichfile;
24 int FileFindFirst(char *search_str, FILEFINDSTRUCT *ffstruct)
29 Assert(search_str != NULL);
30 Assert(ffstruct != NULL);
32 r = glob(search_str, 0, NULL, &glob_a);
37 t = strrchr(glob_a.gl_pathv[glob_whichfile], '/');
38 if (t == NULL) t = glob_a.gl_pathv[glob_whichfile]; else t++;
39 strncpy(ffstruct->name, t, 255);
40 ffstruct->size = strlen(ffstruct->name);
45 int FileFindNext(FILEFINDSTRUCT *ffstruct)
51 if (glob_whichfile >= glob_a.gl_pathc) return -1;
53 t = strrchr(glob_a.gl_pathv[glob_whichfile], '/');
54 if (t == NULL) t = glob_a.gl_pathv[glob_whichfile]; else t++;
55 strncpy(ffstruct->name, t, 255);
56 ffstruct->size = strlen(ffstruct->name);
60 int FileFindClose(void)