comparison win/dirent.c @ 1362:412af8059331

Attempt to get it building with Mingw again... builds but crashes. Fix building DLL without HTML widget support... Mingw is missing required headers. Moved wrapper functions into the main source file so it will export the APIs even if unsupported. Removed debugging code from XBrowseForFolder.cpp because Mingw does not support it.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Fri, 18 Nov 2011 18:56:40 +0000
parents 1e3ab8adba90
children 6baf177f335c
comparison
equal deleted inserted replaced
1361:324812debcc9 1362:412af8059331
5 5
6 #include <windows.h> 6 #include <windows.h>
7 7
8 #include "compat.h" 8 #include "compat.h"
9 #include <errno.h> 9 #include <errno.h>
10 #include <direct.h>
10 11
11 #define error(rc) errno = 255 12 #define error(rc) errno = 255
12 13
13 struct _dirdescr { 14 struct _dirdescr {
14 HANDLE handle; /* DosFindFirst handle */ 15 HANDLE handle; /* DosFindFirst handle */
134 { 135 {
135 static int dummy_ino = 2; 136 static int dummy_ino = 2;
136 137
137 if (dir->number) 138 if (dir->number)
138 { 139 {
139 ULONG rc;
140 dir->count = 100; 140 dir->count = 100;
141 if(!FindNextFile(dir->handle, &(dir->data))) 141 if(!FindNextFile(dir->handle, &(dir->data)))
142 { 142 {
143 error(rc); 143 error(rc);
144 return NULL; 144 return NULL;
170 170
171 void API seekdir(DIR *dir, long off) 171 void API seekdir(DIR *dir, long off)
172 { 172 {
173 if (dir->number > off) { 173 if (dir->number > off) {
174 char name[MAXPATHLEN+2]; 174 char name[MAXPATHLEN+2];
175 ULONG rc;
176 175
177 FindClose(dir->handle); 176 FindClose(dir->handle);
178 177
179 strcpy(name, dir->name); 178 strcpy(name, dir->name);
180 strcat(name, "*"); 179 strcat(name, "*");