| 304 | #if 0 /* this function isn't used, if you use it, uncomment prototype in \ |
| 305 | macwin.h */ |
| 306 | char * |
| 307 | macgets (int fd, char *ptr, unsigned len) |
| 308 | { |
| 309 | int idx = 0; |
| 310 | char c; |
| 311 | |
| 312 | while (-- len > 0) { |
| 313 | if (macread (fd, ptr + idx, 1) <= 0) |
| 314 | return (char *)0; |
| 315 | c = ptr[idx++]; |
| 316 | if (c == '\n' || c == '\r') |
| 317 | break; |
| 318 | } |
| 319 | ptr [idx] = '\0'; |
| 320 | return ptr; |
| 321 | } |
| 322 | #endif /* 0 */ |
| 323 | |
| 324 | int |