home *** CD-ROM | disk | FTP | other *** search
/ ftp.wwiv.com / ftp.wwiv.com.zip / ftp.wwiv.com / pub / MISC / MN325SRC.ZIP / makenl-3.2.5 / src / oswatfnd.c < prev    next >
C/C++ Source or Header  |  2005-02-06  |  807b  |  38 lines

  1. /* $Id: oswatfnd.c,v 1.2 2004/07/11 09:29:15 ozzmosis Exp $ */
  2.  
  3. #define HAVE_OS_FIND
  4. #include <string.h>
  5.  
  6. char *os_findfirst(struct _filefind *pff, const char *path,
  7.                    const char *mask)
  8. {
  9.     unsigned rc;
  10.     char tmp[MYMAXPATH];
  11.  
  12.     strcpy(tmp, path);
  13.     os_append_slash(tmp);
  14.     strcat(tmp, mask);
  15.     rc = _dos_findfirst(tmp,
  16.                         _A_NORMAL | _A_RDONLY | _A_HIDDEN | _A_SYSTEM |
  17.                         _A_ARCH, &pff->fileinfo);
  18.     if (rc == 0)
  19.         return pff->fileinfo.name;
  20.  
  21.     return NULL;
  22. }
  23.  
  24.  
  25. char *os_findnext(struct _filefind *pff)
  26. {
  27.     if (_dos_findnext(&pff->fileinfo) == 0)
  28.         return pff->fileinfo.name;
  29.  
  30.     return NULL;
  31. }
  32.  
  33.  
  34. void os_findclose(struct _filefind *pff)
  35. {
  36.     _dos_findclose(&pff->fileinfo);
  37. }
  38.