| 1324 | */ |
| 1325 | |
| 1326 | int /* O - Character or -1 on end of file */ |
| 1327 | cupsFilePeekChar(cups_file_t *fp) /* I - CUPS file */ |
| 1328 | { |
| 1329 | /* |
| 1330 | * Range check input... |
| 1331 | */ |
| 1332 | |
| 1333 | if (!fp || (fp->mode != 'r' && fp->mode != 's')) |
| 1334 | return (-1); |
| 1335 | |
| 1336 | /* |
| 1337 | * If the input buffer is empty, try to read more data... |
| 1338 | */ |
| 1339 | |
| 1340 | if (fp->ptr >= fp->end) |
| 1341 | if (cups_fill(fp) <= 0) |
| 1342 | return (-1); |
| 1343 | |
| 1344 | /* |
| 1345 | * Return the next character in the buffer... |
| 1346 | */ |
| 1347 | |
| 1348 | return (*(fp->ptr) & 255); |
| 1349 | } |
| 1350 | |
| 1351 | |
| 1352 | /* |