int is_stdio; /* Is a stdio file? */
- DEBUG_printf(("cupsFileClose(fp=%p)\n", fp));
+ DEBUG_printf(("cupsFileClose(fp=%p)", fp));
/*
* Range check...
* Range check input...
*/
+ DEBUG_printf(("cupsFileFind(filename=\"%s\", path=\"%s\", executable=%d, "
+ "buffer=%p, bufsize=%d)", filename, path, executable, buffer,
+ bufsize));
+
if (!filename || !buffer || bufsize < 2)
return (NULL);
if (!access(buffer, executable ? X_OK : 0))
#endif /* WIN32 */
{
- DEBUG_printf(("cupsFileFind: Returning \"%s\"\n", buffer));
+ DEBUG_printf(("1cupsFileFind: Returning \"%s\"", buffer));
return (buffer);
}
if (!access(buffer, 0))
{
- DEBUG_printf(("cupsFileFind: Returning \"%s\"\n", buffer));
+ DEBUG_printf(("1cupsFileFind: Returning \"%s\"", buffer));
return (buffer);
}
else
{
- DEBUG_puts("cupsFileFind: Returning NULL");
+ DEBUG_puts("1cupsFileFind: Returning NULL");
return (NULL);
}
}
ssize_t bytes; /* Bytes to write */
- DEBUG_printf(("cupsFileFlush(fp=%p)\n", fp));
+ DEBUG_printf(("cupsFileFlush(fp=%p)", fp));
/*
* Range check input...
if (!fp || fp->mode != 'w')
{
- DEBUG_puts("cupsFileFlush: Attempt to flush a read-only file...");
+ DEBUG_puts("1cupsFileFlush: Attempt to flush a read-only file...");
return (-1);
}
bytes = (ssize_t)(fp->ptr - fp->buf);
- DEBUG_printf(("cupsFileFlush: Flushing " CUPS_LLFMT " bytes...\n",
+ DEBUG_printf(("2cupsFileFlush: Flushing " CUPS_LLFMT " bytes...",
CUPS_LLCAST bytes));
if (bytes > 0)
* Range check input...
*/
- DEBUG_printf(("cupsFileGetChar(fp=%p)\n", fp));
-
if (!fp || (fp->mode != 'r' && fp->mode != 's'))
{
- DEBUG_puts("cupsFileGetChar: Bad arguments!");
+ DEBUG_puts("3cupsFileGetChar: Bad arguments!");
return (-1);
}
if (fp->ptr >= fp->end)
if (cups_fill(fp) < 0)
{
- DEBUG_puts("cupsFileGetChar: Unable to fill buffer!");
+ DEBUG_puts("3cupsFileGetChar: Unable to fill buffer!");
return (-1);
}
* Return the next character in the buffer...
*/
- DEBUG_printf(("cupsFileGetChar: Returning %d...\n", *(fp->ptr) & 255));
+ DEBUG_printf(("3cupsFileGetChar: Returning %d...", *(fp->ptr) & 255));
fp->pos ++;
- DEBUG_printf(("cupsFileGetChar: pos=" CUPS_LLFMT "\n", CUPS_LLCAST fp->pos));
+ DEBUG_printf(("4cupsFileGetChar: pos=" CUPS_LLFMT, CUPS_LLCAST fp->pos));
return (*(fp->ptr)++ & 255);
}
* Range check input...
*/
- DEBUG_printf(("cupsFileGetConf(fp=%p, buf=%p, buflen=" CUPS_LLFMT
- ", value=%p, linenum=%p)\n", fp, buf, CUPS_LLCAST buflen,
+ DEBUG_printf(("2cupsFileGetConf(fp=%p, buf=%p, buflen=" CUPS_LLFMT
+ ", value=%p, linenum=%p)", fp, buf, CUPS_LLCAST buflen,
value, linenum));
if (!fp || (fp->mode != 'r' && fp->mode != 's') ||
* Range check input...
*/
- DEBUG_printf(("cupsFileGetLine(fp=%p, buf=%p, buflen=" CUPS_LLFMT ")\n",
+ DEBUG_printf(("2cupsFileGetLine(fp=%p, buf=%p, buflen=" CUPS_LLFMT ")",
fp, buf, CUPS_LLCAST buflen));
if (!fp || (fp->mode != 'r' && fp->mode != 's') || !buf || buflen < 3)
*ptr = '\0';
- DEBUG_printf(("cupsFileGetLine: pos=" CUPS_LLFMT "\n", CUPS_LLCAST fp->pos));
+ DEBUG_printf(("4cupsFileGetLine: pos=" CUPS_LLFMT, CUPS_LLCAST fp->pos));
return (ptr - buf);
}
* Range check input...
*/
- DEBUG_printf(("cupsFileGets(fp=%p, buf=%p, buflen=" CUPS_LLFMT ")\n", fp, buf,
+ DEBUG_printf(("2cupsFileGets(fp=%p, buf=%p, buflen=" CUPS_LLFMT ")", fp, buf,
CUPS_LLCAST buflen));
if (!fp || (fp->mode != 'r' && fp->mode != 's') || !buf || buflen < 2)
*ptr = '\0';
- DEBUG_printf(("cupsFileGets: pos=" CUPS_LLFMT "\n", CUPS_LLCAST fp->pos));
+ DEBUG_printf(("4cupsFileGets: pos=" CUPS_LLFMT, CUPS_LLCAST fp->pos));
return (buf);
}
http_addrlist_t *addrlist; /* Host address list */
- DEBUG_printf(("cupsFileOpen(filename=\"%s\", mode=\"%s\")\n", filename,
+ DEBUG_printf(("cupsFileOpen(filename=\"%s\", mode=\"%s\")", filename,
mode));
/*
cups_file_t *fp; /* New CUPS file */
- DEBUG_printf(("cupsFileOpenFd(fd=%d, mode=\"%s\")\n", fd, mode));
+ DEBUG_printf(("cupsFileOpenFd(fd=%d, mode=\"%s\")", fd, mode));
/*
* Range check input...
ssize_t bytes; /* Formatted size */
- DEBUG_printf(("cupsFilePrintf(fp=%p, format=\"%s\", ...)\n", fp, format));
+ DEBUG_printf(("2cupsFilePrintf(fp=%p, format=\"%s\", ...)", fp, format));
if (!fp || !format || (fp->mode != 'w' && fp->mode != 's'))
return (-1);
fp->pos += bytes;
- DEBUG_printf(("cupsFilePrintf: pos=" CUPS_LLFMT "\n", CUPS_LLCAST fp->pos));
+ DEBUG_printf(("4cupsFilePrintf: pos=" CUPS_LLFMT, CUPS_LLCAST fp->pos));
return (bytes);
}
fp->pos += bytes;
- DEBUG_printf(("cupsFilePrintf: pos=" CUPS_LLFMT "\n", CUPS_LLCAST fp->pos));
+ DEBUG_printf(("4cupsFilePrintf: pos=" CUPS_LLFMT, CUPS_LLCAST fp->pos));
if (bytes > sizeof(fp->buf))
{
fp->pos ++;
- DEBUG_printf(("cupsFilePutChar: pos=" CUPS_LLFMT "\n", CUPS_LLCAST fp->pos));
+ DEBUG_printf(("4cupsFilePutChar: pos=" CUPS_LLFMT, CUPS_LLCAST fp->pos));
return (0);
}
*
* This function handles any comment escaping of the value.
*
- * @since CUPS 1.4@
+ * @since CUPS 1.4/Mac OS X 10.6@
*/
ssize_t /* O - Number of bytes written or -1 on error */
fp->pos += bytes;
- DEBUG_printf(("cupsFilePuts: pos=" CUPS_LLFMT "\n", CUPS_LLCAST fp->pos));
+ DEBUG_printf(("4cupsFilePuts: pos=" CUPS_LLFMT, CUPS_LLCAST fp->pos));
return (bytes);
}
fp->pos += bytes;
- DEBUG_printf(("cupsFilePuts: pos=" CUPS_LLFMT "\n", CUPS_LLCAST fp->pos));
+ DEBUG_printf(("4cupsFilePuts: pos=" CUPS_LLFMT, CUPS_LLCAST fp->pos));
if (bytes > sizeof(fp->buf))
{
ssize_t count; /* Bytes read */
- DEBUG_printf(("cupsFileRead(fp=%p, buf=%p, bytes=" CUPS_LLFMT ")\n", fp, buf,
+ DEBUG_printf(("2cupsFileRead(fp=%p, buf=%p, bytes=" CUPS_LLFMT ")", fp, buf,
CUPS_LLCAST bytes));
/*
if (fp->ptr >= fp->end)
if (cups_fill(fp) <= 0)
{
- DEBUG_printf(("cupsFileRead: cups_fill() returned -1, total=" CUPS_LLFMT "\n",
- CUPS_LLCAST total));
+ DEBUG_printf(("4cupsFileRead: cups_fill() returned -1, total="
+ CUPS_LLFMT, CUPS_LLCAST total));
if (total > 0)
return ((ssize_t)total);
fp->ptr += count;
fp->pos += count;
- DEBUG_printf(("cupsFileRead: pos=" CUPS_LLFMT "\n", CUPS_LLCAST fp->pos));
+ DEBUG_printf(("4cupsFileRead: pos=" CUPS_LLFMT, CUPS_LLCAST fp->pos));
/*
* Update the counts for the last read...
* Return the total number of bytes read...
*/
- DEBUG_printf(("cupsFileRead: total=%d\n", (int)total));
+ DEBUG_printf(("3cupsFileRead: total=" CUPS_LLFMT, CUPS_LLCAST total));
return ((ssize_t)total);
}
* Range check input...
*/
- DEBUG_printf(("cupsFileRewind(fp=%p)\n", fp));
- DEBUG_printf(("cupsFileRewind: pos=" CUPS_LLFMT "\n", CUPS_LLCAST fp->pos));
+ DEBUG_printf(("cupsFileRewind(fp=%p)", fp));
+ DEBUG_printf(("2cupsFileRewind: pos=" CUPS_LLFMT, CUPS_LLCAST fp->pos));
if (!fp || fp->mode != 'r')
return (-1);
fp->eof = 0;
}
- DEBUG_printf(("cupsFileRewind: pos=" CUPS_LLFMT "\n", CUPS_LLCAST fp->pos));
+ DEBUG_printf(("2cupsFileRewind: pos=" CUPS_LLFMT, CUPS_LLCAST fp->pos));
return (0);
}
if (lseek(fp->fd, 0, SEEK_SET))
{
- DEBUG_printf(("cupsFileRewind: lseek failed: %s\n", strerror(errno)));
+ DEBUG_printf(("1cupsFileRewind: lseek failed: %s", strerror(errno)));
return (-1);
}
fp->end = NULL;
fp->eof = 0;
- DEBUG_printf(("cupsFileRewind: pos=" CUPS_LLFMT "\n", CUPS_LLCAST fp->pos));
+ DEBUG_printf(("2cupsFileRewind: pos=" CUPS_LLFMT, CUPS_LLCAST fp->pos));
return (0);
}
ssize_t bytes; /* Number bytes in buffer */
- DEBUG_printf(("cupsFileSeek(fp=%p, pos=" CUPS_LLFMT ")\n", fp,
+ DEBUG_printf(("cupsFileSeek(fp=%p, pos=" CUPS_LLFMT ")", fp,
CUPS_LLCAST pos));
- DEBUG_printf(("cupsFileSeek: fp->pos=" CUPS_LLFMT "\n", CUPS_LLCAST fp->pos));
- DEBUG_printf(("cupsFileSeek: fp->ptr=%p, fp->end=%p\n", fp->ptr, fp->end));
+ DEBUG_printf(("2cupsFileSeek: fp->pos=" CUPS_LLFMT, CUPS_LLCAST fp->pos));
+ DEBUG_printf(("2cupsFileSeek: fp->ptr=%p, fp->end=%p", fp->ptr, fp->end));
/*
* Range check input...
{
bytes = (ssize_t)(fp->end - fp->buf);
- DEBUG_printf(("cupsFileSeek: bytes=" CUPS_LLFMT "\n", CUPS_LLCAST bytes));
+ DEBUG_printf(("2cupsFileSeek: bytes=" CUPS_LLFMT, CUPS_LLCAST bytes));
if (pos >= fp->bufpos && pos < (fp->bufpos + bytes))
{
* Need to seek backwards...
*/
- DEBUG_puts("cupsFileSeek: SEEK BACKWARDS");
+ DEBUG_puts("2cupsFileSeek: SEEK BACKWARDS");
#ifdef HAVE_LIBZ
if (fp->compressed)
fp->ptr = NULL;
fp->end = NULL;
- DEBUG_printf(("cupsFileSeek: lseek() returned " CUPS_LLFMT "...\n",
+ DEBUG_printf(("2cupsFileSeek: lseek() returned " CUPS_LLFMT,
CUPS_LLCAST fp->pos));
}
}
* Need to seek forwards...
*/
- DEBUG_puts("cupsFileSeek: SEEK FORWARDS");
+ DEBUG_puts("2cupsFileSeek: SEEK FORWARDS");
#ifdef HAVE_LIBZ
if (fp->compressed)
fp->ptr = NULL;
fp->end = NULL;
- DEBUG_printf(("cupsFileSeek: lseek() returned " CUPS_LLFMT "...\n",
+ DEBUG_printf(("2cupsFileSeek: lseek() returned " CUPS_LLFMT,
CUPS_LLCAST fp->pos));
}
}
- DEBUG_printf(("cupsFileSeek: pos=" CUPS_LLFMT "\n", CUPS_LLCAST fp->pos));
+ DEBUG_printf(("2cupsFileSeek: pos=" CUPS_LLFMT, CUPS_LLCAST fp->pos));
return (fp->pos);
}
off_t /* O - File position */
cupsFileTell(cups_file_t *fp) /* I - CUPS file */
{
- DEBUG_printf(("cupsFileTell(fp=%p)\n", fp));
- DEBUG_printf(("cupsFileTell: pos=" CUPS_LLFMT "\n", CUPS_LLCAST (fp ? fp->pos : -1)));
+ DEBUG_printf(("2cupsFileTell(fp=%p)", fp));
+ DEBUG_printf(("3cupsFileTell: pos=" CUPS_LLFMT,
+ CUPS_LLCAST (fp ? fp->pos : -1)));
return (fp ? fp->pos : 0);
}
* Range check...
*/
- DEBUG_printf(("cupsFileUnlock(fp=%p)\n", fp));
+ DEBUG_printf(("cupsFileUnlock(fp=%p)", fp));
if (!fp || fp->mode == 's')
return (-1);
* Range check input...
*/
- DEBUG_printf(("cupsFileWrite(fp=%p, buf=%p, bytes=" CUPS_LLFMT ")\n",
+ DEBUG_printf(("2cupsFileWrite(fp=%p, buf=%p, bytes=" CUPS_LLFMT ")",
fp, buf, CUPS_LLCAST bytes));
if (!fp || !buf || bytes < 0 || (fp->mode != 'w' && fp->mode != 's'))
fp->pos += (off_t)bytes;
- DEBUG_printf(("cupsFileWrite: pos=" CUPS_LLFMT "\n", CUPS_LLCAST fp->pos));
+ DEBUG_printf(("4cupsFileWrite: pos=" CUPS_LLFMT, CUPS_LLCAST fp->pos));
return ((ssize_t)bytes);
}
fp->pos += (off_t)bytes;
- DEBUG_printf(("cupsFileWrite: pos=" CUPS_LLFMT "\n", CUPS_LLCAST fp->pos));
+ DEBUG_printf(("4cupsFileWrite: pos=" CUPS_LLFMT, CUPS_LLCAST fp->pos));
if (bytes > sizeof(fp->buf))
{
const char *buf, /* I - Buffer */
size_t bytes) /* I - Number bytes */
{
- DEBUG_printf(("cups_compress(fp=%p, buf=%p, bytes=" CUPS_LLFMT "\n", fp, buf,
+ DEBUG_printf(("7cups_compress(fp=%p, buf=%p, bytes=" CUPS_LLFMT ")", fp, buf,
CUPS_LLCAST bytes));
/*
* Flush the current buffer...
*/
- DEBUG_printf(("cups_compress: avail_in=%d, avail_out=%d\n",
+ DEBUG_printf(("9cups_compress: avail_in=%d, avail_out=%d",
fp->stream.avail_in, fp->stream.avail_out));
if (fp->stream.avail_out < (int)(sizeof(fp->cbuf) / 8))
#endif /* HAVE_LIBZ */
- DEBUG_printf(("cups_fill(fp=%p)\n", fp));
- DEBUG_printf(("cups_fill: fp->ptr=%p, fp->end=%p, fp->buf=%p, "
- "fp->bufpos=" CUPS_LLFMT ", fp->eof=%d\n",
+ DEBUG_printf(("7cups_fill(fp=%p)", fp));
+ DEBUG_printf(("9cups_fill: fp->ptr=%p, fp->end=%p, fp->buf=%p, "
+ "fp->bufpos=" CUPS_LLFMT ", fp->eof=%d",
fp->ptr, fp->end, fp->buf, CUPS_LLCAST fp->bufpos, fp->eof));
if (fp->ptr && fp->end)
fp->bufpos += fp->end - fp->buf;
#ifdef HAVE_LIBZ
- DEBUG_printf(("cups_fill: fp->compressed=%d\n", fp->compressed));
+ DEBUG_printf(("9cups_fill: fp->compressed=%d", fp->compressed));
while (!fp->ptr || fp->compressed)
{
* Can't read from file!
*/
- DEBUG_printf(("cups_fill: cups_read() returned " CUPS_LLFMT "!\n",
+ DEBUG_printf(("9cups_fill: cups_read() returned " CUPS_LLFMT,
CUPS_LLCAST bytes));
return (-1);
fp->ptr = fp->buf;
fp->end = fp->buf + bytes;
- DEBUG_printf(("cups_fill: Returning " CUPS_LLFMT "!\n",
+ DEBUG_printf(("9cups_fill: Returning " CUPS_LLFMT,
CUPS_LLCAST bytes));
return (bytes);
* Bad CRC, mark end-of-file...
*/
- DEBUG_printf(("cups_fill: tcrc=%08x, fp->crc=%08x\n",
+ DEBUG_printf(("9cups_fill: tcrc=%08x, fp->crc=%08x",
(unsigned int)tcrc, (unsigned int)fp->crc));
fp->eof = 1;
ssize_t total; /* Total bytes read */
- DEBUG_printf(("cups_read(fp=%p, buf=%p, bytes=" CUPS_LLFMT ")\n", fp, buf,
+ DEBUG_printf(("7cups_read(fp=%p, buf=%p, bytes=" CUPS_LLFMT ")", fp, buf,
CUPS_LLCAST bytes));
/*
total = read(fp->fd, buf, bytes);
#endif /* WIN32 */
- DEBUG_printf(("cups_read: total=" CUPS_LLFMT "\n", CUPS_LLCAST total));
+ DEBUG_printf(("9cups_read: total=" CUPS_LLFMT, CUPS_LLCAST total));
if (total >= 0)
break;
ssize_t count; /* Count this time */
- DEBUG_printf(("cups_write(fp=%p, buf=%p, bytes=" CUPS_LLFMT ")\n", fp, buf,
+ DEBUG_printf(("7cups_write(fp=%p, buf=%p, bytes=" CUPS_LLFMT ")", fp, buf,
CUPS_LLCAST bytes));
/*
count = write(fp->fd, buf, bytes);
#endif /* WIN32 */
- DEBUG_printf(("cups_write: count=" CUPS_LLFMT "\n", CUPS_LLCAST count));
+ DEBUG_printf(("9cups_write: count=" CUPS_LLFMT, CUPS_LLCAST count));
if (count < 0)
{