MCPcopy Create free account
hub / github.com/OpenPrinting/cups / cups_raster_io

Function cups_raster_io

cups/raster-stream.c:1373–1410  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1371 */
1372
1373static ssize_t /* O - Bytes read/write or -1 */
1374cups_raster_io(cups_raster_t *r, /* I - Raster stream */
1375 unsigned char *buf, /* I - Buffer for read/write */
1376 size_t bytes) /* I - Number of bytes to read/write */
1377{
1378 ssize_t count, /* Number of bytes read/written */
1379 total; /* Total bytes read/written */
1380
1381
1382 DEBUG_printf(("5cups_raster_io(r=%p, buf=%p, bytes=" CUPS_LLFMT ")", (void *)r, (void *)buf, CUPS_LLCAST bytes));
1383
1384 for (total = 0; total < (ssize_t)bytes; total += count, buf += count)
1385 {
1386 count = (*r->iocb)(r->ctx, buf, bytes - (size_t)total);
1387
1388 DEBUG_printf(("6cups_raster_io: count=%d, total=%d", (int)count, (int)total));
1389 if (count == 0)
1390 break;
1391// {
1392// DEBUG_puts("6cups_raster_io: Returning 0.");
1393// return (0);
1394// }
1395 else if (count < 0)
1396 {
1397 DEBUG_puts("6cups_raster_io: Returning -1 on error.");
1398 return (-1);
1399 }
1400
1401#ifdef DEBUG
1402 r->iocount += (size_t)count;
1403#endif /* DEBUG */
1404 }
1405
1406 DEBUG_printf(("6cups_raster_io: iocount=" CUPS_LLFMT, CUPS_LLCAST r->iocount));
1407 DEBUG_printf(("6cups_raster_io: Returning " CUPS_LLFMT ".", CUPS_LLCAST total));
1408
1409 return (total);
1410}
1411
1412
1413/*

Callers 6

_cupsRasterNewFunction · 0.85
_cupsRasterReadPixelsFunction · 0.85
_cupsRasterWriteHeaderFunction · 0.85
_cupsRasterWritePixelsFunction · 0.85
cups_raster_readFunction · 0.85
cups_raster_writeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected