home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 15
/
CD_ASCQ_15_070894.iso
/
vrac
/
mikmod43.zip
/
WILDFILE.C
< prev
next >
Wrap
C/C++ Source or Header
|
1994-04-28
|
1KB
|
63 lines
/*
WILDFILE.C
Some routines to support wildcard filename handling.. Done by MikMak
*/
#include <stddef.h>
#include <dir.h>
#include "wildfile.h"
char path[MAXPATH];
char drive[MAXDRIVE];
char dir[MAXDIR];
char name[MAXFILE];
char ext[MAXEXT];
struct ffblk ffblk;
char *GetFirstName(char *wildname)
/*
Finds the first file in a directory that corresponds to the wildcard
name 'wildname'.
returns: ptr to full pathname
or
NULL if file couldn't be found
*/
{
int found;
fnsplit(wildname,drive,dir,name,ext);
if(!findfirst(wildname,&ffblk,0)){
fnmerge(path,drive,dir,ffblk.ff_name,NULL);
return path;
}
return NULL;
}
char *GetNextName(void)
/*
Finds another file in a directory that corresponds to the wildcard
name of the GetFirstName call.
returns: ptr to full pathname
or
NULL if file couldn't be found
*/
{
if(!findnext(&ffblk)){
fnmerge(path,drive,dir,ffblk.ff_name,NULL);
return path;
}
return NULL;
}