(path)
| 187 | } |
| 188 | |
| 189 | long |
| 190 | freediskspace(path) |
| 191 | char *path; |
| 192 | { |
| 193 | FSALLOCATE FSInfoBuf; |
| 194 | #ifdef OS2_32BITAPI |
| 195 | ULONG |
| 196 | #else |
| 197 | USHORT |
| 198 | #endif |
| 199 | DriveNumber, FSInfoLevel = 1, res; |
| 200 | |
| 201 | if (path[0] && path[1] == ':') |
| 202 | DriveNumber = (toupper(path[0]) - 'A') + 1; |
| 203 | else |
| 204 | DriveNumber = 0; |
| 205 | res = |
| 206 | #ifdef OS2_32BITAPI |
| 207 | DosQueryFSInfo(DriveNumber, FSInfoLevel, (PVOID) &FSInfoBuf, |
| 208 | (ULONG) sizeof(FSInfoBuf)); |
| 209 | #else |
| 210 | DosQFSInfo(DriveNumber, FSInfoLevel, (PBYTE) &FSInfoBuf, |
| 211 | (USHORT) sizeof(FSInfoBuf)); |
| 212 | #endif |
| 213 | if (res) |
| 214 | return -1L; /* error */ |
| 215 | else |
| 216 | return ((long) FSInfoBuf.cSectorUnit * FSInfoBuf.cUnitAvail |
| 217 | * FSInfoBuf.cbSector); |
| 218 | } |
| 219 | |
| 220 | /* |
| 221 | * Functions to get filenames using wildcards |
nothing calls this directly
no outgoing calls
no test coverage detected