home *** CD-ROM | disk | FTP | other *** search
/ ftp.wwiv.com / ftp.wwiv.com.zip / ftp.wwiv.com / pub / MISC / MN321SRC.ZIP / osdosfnd.c < prev    next >
C/C++ Source or Header  |  2004-07-18  |  695b  |  37 lines

  1. /* $Id: osdosfnd.c,v 1.3 2004/07/17 03:05:06 ozzmosis Exp $ */
  2.  
  3. #include <dos.h>
  4. #include "unused.h"
  5.  
  6. char *os_findfirst(struct _filefind *pff, const char *path,
  7.                    const char *mask)
  8. {
  9.     int rc;
  10.     char tmp[MAXPATH];
  11.  
  12.     strcpy(tmp, path);
  13.     os_append_slash(tmp);
  14.     strcat(tmp, mask);
  15.     rc = findfirst(tmp, &pff->fileinfo,
  16.                    FA_RDONLY | FA_HIDDEN | FA_SYSTEM | FA_ARCH);
  17.     if (rc == 0)
  18.         return pff->fileinfo.ff_name;
  19.  
  20.     return NULL;
  21. }
  22.  
  23.  
  24. char *os_findnext(struct _filefind *pff)
  25. {
  26.     if (findnext(&pff->fileinfo) == 0)
  27.         return pff->fileinfo.ff_name;
  28.  
  29.     return NULL;
  30. }
  31.  
  32.  
  33. void os_findclose(struct _filefind *pff)
  34. {
  35.     unused(pff);
  36. }
  37.