Subversion Repositories SvarDOS

Rev

Rev 2058 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2058 Rev 2059
Line 39... Line 39...
39
#include "dosdisk.h"
39
#include "dosdisk.h"
40
 
40
 
41
#define searchAttr ( FILE_A_SUBDIR | FILE_A_HIDDEN | FILE_A_SYSTEM | FILE_A_RDONLY | FILE_A_ARCH )
41
#define searchAttr ( FILE_A_SUBDIR | FILE_A_HIDDEN | FILE_A_SYSTEM | FILE_A_RDONLY | FILE_A_ARCH )
42
 
42
 
43
 
43
 
44
struct FFDTA *FindFirstFile(const char *pathname, struct FFDTA *hnd) {
44
int FindFirstFile(const char *pathname, struct FFDTA *hnd) {
45
  char path[PATH_MAX];
45
  char path[PATH_MAX];
46
  short cflag = 0;  /* used to indicate if findfirst is succesful or not */
46
  short cflag = 0;  /* used to indicate if findfirst is succesful or not */
47
 
47
 
48
  /* initialize structure (clear) */
48
  /* initialize structure (clear) */
49
  /* hnd->handle = 0;  hnd->ffdtaptr = NULL; */
49
  /* hnd->handle = 0;  hnd->ffdtaptr = NULL; */
Line 105... Line 105...
105
    pop bx
105
    pop bx
106
    pop ax
106
    pop ax
107
  }
107
  }
108
  }
108
  }
109
 
109
 
110
  if (cflag) return(NULL);
-
 
111
 
-
 
112
  return hnd;
110
  return(cflag);
113
}
111
}
114
 
112
 
115
 
113
 
116
int FindNextFile(struct FFDTA *hnd) {
114
int FindNextFile(struct FFDTA *hnd) {
117
  short cflag = 0;  /* used to indicate if dos findnext succesful or not */
115
  short cflag = 0;  /* used to indicate if dos findnext succesful or not */
Line 157... Line 155...
157
      pop bx
155
      pop bx
158
      pop ax
156
      pop ax
159
    }
157
    }
160
  }
158
  }
161
 
159
 
162
  if (cflag) return 0;
-
 
163
 
-
 
164
  return 1;
160
  return(cflag);
165
}
161
}
166
 
162
 
167
 
163
 
168
/* free resources to prevent memory leaks */
164
/* free resources to prevent memory leaks */
169
void FindClose(struct FFDTA *hnd) {
165
void FindClose(struct FFDTA *hnd) {