From 206f75403a085c6bf2033f8e2c0eae2c81ac4e82 Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Mon, 26 Aug 2024 09:19:34 -0400 Subject: [PATCH] Add debug printfs. --- pdfio-file.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pdfio-file.c b/pdfio-file.c index ee972a8..f675bf4 100644 --- a/pdfio-file.c +++ b/pdfio-file.c @@ -188,6 +188,8 @@ pdfioFileCreate( int fd; // File descriptor + PDFIO_DEBUG("pdfioFileCreate(filename=\"%s\", version=\"%s\", media_box=%p, crop_box=%p, error_cb=%p, error_cbdata=%p)\n", filename, version, (void *)media_box, (void *)crop_box, (void *)error_cb, (void *)error_cbdata); + // Range check input... if (!filename) return (NULL); @@ -390,6 +392,8 @@ pdfioFileCreateOutput( pdfio_error_cb_t error_cb, // I - Error callback or `NULL` for default void *error_cbdata) // I - Error callback data, if any { + PDFIO_DEBUG("pdfioFileCreate(output_cb=%p, output_cbdata=%p, version=\"%s\", media_box=%p, crop_box=%p, error_cb=%p, error_cbdata=%p)\n", (void *)output_cb, (void *)output_cbdata, version, (void *)media_box, (void *)crop_box, (void *)error_cb, (void *)error_cbdata); + return (create_common("output.pdf", /*fd*/-1, output_cb, output_cbdata, version, media_box, crop_box, error_cb, error_cbdata)); } @@ -524,6 +528,8 @@ pdfioFileCreateTemporary( unsigned tmpnum; // Temporary filename number + PDFIO_DEBUG("pdfioFileCreate(buffer=%p, bufsize=%lu, version=\"%s\", media_box=%p, crop_box=%p, error_cb=%p, error_cbdata=%p)\n", (void *)buffer, (unsigned long)bufsize, version, (void *)media_box, (void *)crop_box, (void *)error_cb, (void *)error_cbdata); + // Range check input... if (!buffer || bufsize < 32) { @@ -938,6 +944,8 @@ pdfioFileOpen( off_t xref_offset; // Offset to xref table + PDFIO_DEBUG("pdfioFileOpen(filename=\"%s\", password_cb=%p, password_cbdata=%p, error_cb=%p, error_cbdata=%p)\n", filename, (void *)password_cb, (void *)password_cbdata, (void *)error_cb, (void *)error_cbdata); + // Range check input... if (!filename) return (NULL); @@ -1295,6 +1303,8 @@ create_common( unsigned char id_value[16]; // File ID value + PDFIO_DEBUG("create_common(filename=\"%s\", fd=%d, output_cb=%p, output_cbdata=%p, version=\"%s\", media_box=%p, crop_box=%p, error_cb=%p, error_cbdata=%p)\n", filename, fd, (void *)output_cb, (void *)output_cbdata, version, (void *)media_box, (void *)crop_box, (void *)error_cb, (void *)error_cbdata); + // Range check input... if (!filename || (fd < 0 && !output_cb)) return (NULL);