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);
35 if (! glob_a.gl_pathc) return 1;
39 t = strrchr(glob_a.gl_pathv[glob_whichfile], '/');
40 if (t == NULL) t = glob_a.gl_pathv[glob_whichfile]; else t++;
41 strncpy(ffstruct->name, t, 255);
42 ffstruct->size = strlen(ffstruct->name);
47 int FileFindNext(FILEFINDSTRUCT *ffstruct)
53 if (glob_whichfile >= glob_a.gl_pathc) return -1;
55 t = strrchr(glob_a.gl_pathv[glob_whichfile], '/');
56 if (t == NULL) t = glob_a.gl_pathv[glob_whichfile]; else t++;
57 strncpy(ffstruct->name, t, 255);
58 ffstruct->size = strlen(ffstruct->name);
62 int FileFindClose(void)