2 * $Source: /cvs/cvsroot/d2x/arch/linux_findfile.c,v $
5 * $Date: 2001-01-29 13:35:08 $
7 * Linux findfile functions
9 * $Log: not supported by cvs2svn $
23 /* KLUDGE ALERT: evil globals */
25 static int glob_whichfile;
27 int FileFindFirst(char *search_str, FILEFINDSTRUCT *ffstruct)
32 Assert(search_str != NULL);
33 Assert(ffstruct != NULL);
35 r = glob(search_str, 0, NULL, &glob_a);
36 if (r == GLOB_NOMATCH) return -1;
40 t = strrchr(glob_a.gl_pathv[glob_whichfile], '/');
41 if (t == NULL) t = glob_a.gl_pathv[glob_whichfile]; else t++;
42 strncpy(ffstruct->name, t, 255);
43 ffstruct->size = strlen(ffstruct->name);
48 int FileFindNext(FILEFINDSTRUCT *ffstruct)
54 if (glob_whichfile >= glob_a.gl_pathc) return -1;
56 t = strrchr(glob_a.gl_pathv[glob_whichfile], '/');
57 if (t == NULL) t = glob_a.gl_pathv[glob_whichfile]; else t++;
58 strncpy(ffstruct->name, t, 255);
59 ffstruct->size = strlen(ffstruct->name);
63 int FileFindClose(void)