]> git.ipfire.org Git - thirdparty/cups-filters.git/commitdiff
libcupsfilters, libppd: Rename API functions of log.h to "cf..."
authorTill Kamppeter <till.kamppeter@gmail.com>
Wed, 6 Apr 2022 20:51:30 +0000 (22:51 +0200)
committerTill Kamppeter <till.kamppeter@gmail.com>
Wed, 6 Apr 2022 20:51:30 +0000 (22:51 +0200)
Also renamed constants to start with "CF_" and data types to start
with "cf_".

44 files changed:
cupsfilters/attr.c
cupsfilters/bannertopdf.c
cupsfilters/cmyk.c
cupsfilters/colord.c
cupsfilters/colormanager.c
cupsfilters/driver.h
cupsfilters/filter.c
cupsfilters/filter.h
cupsfilters/ghostscript.c
cupsfilters/imagetopdf.c
cupsfilters/imagetops.c
cupsfilters/imagetoraster.c
cupsfilters/log.h
cupsfilters/lut.c
cupsfilters/mupdftopwg.c
cupsfilters/pclmtoraster.cxx
cupsfilters/pdftopdf/intervalset.cc
cupsfilters/pdftopdf/nup.cc
cupsfilters/pdftopdf/pdftopdf.cc
cupsfilters/pdftopdf/pdftopdf.h
cupsfilters/pdftopdf/pdftopdf_processor.cc
cupsfilters/pdftopdf/pptypes.cc
cupsfilters/pdftopdf/qpdf_pdftopdf_processor.cc
cupsfilters/pdftops.c
cupsfilters/pdftoraster.cxx
cupsfilters/pstops.c
cupsfilters/pwgtoraster.c
cupsfilters/raster.c
cupsfilters/rastertopdf.cpp
cupsfilters/rastertops.c
cupsfilters/rastertopwg.c
cupsfilters/rgb.c
cupsfilters/testcmyk.c
cupsfilters/testdither.c
cupsfilters/texttopdf.c
cupsfilters/texttotext.c
cupsfilters/universal.c
filter/rastertoescpx.c
filter/rastertopclx.c
ppd/file-private.h
ppd/file.c
ppd/ppd-collection.cxx
ppd/ppd.h
ppd/testppd.c

index 625c4c8613e0d57434be128c9fcfd69d6ef26eb6..09eeff2b0caa2fbf75c5810e482431b1aa573545 100644 (file)
@@ -38,7 +38,7 @@ cfFindAttr(ppd_file_t *ppd,           /* I - PPD file */
              const char *resolution,   /* I - Resolution */
             char       *spec,          /* O - Final selection string */
             int        specsize,       /* I - Size of string buffer */
-            filter_logfunc_t log,      /* I - Log function */
+            cf_logfunc_t log,      /* I - Log function */
             void       *ld)            /* I - Log function data */
 {
   ppd_attr_t   *attr;                  /* Attribute */
@@ -65,48 +65,48 @@ cfFindAttr(ppd_file_t *ppd,         /* I - PPD file */
   */
 
   snprintf(spec, specsize, "%s.%s.%s", colormodel, media, resolution);
-  if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+  if (log) log(ld, CF_LOGLEVEL_DEBUG,
               "Looking for \"*%s %s\"...", name, spec);
   if ((attr = ppdFindAttr(ppd, name, spec)) != NULL && attr->value != NULL)
     return (attr);
 
   snprintf(spec, specsize, "%s.%s", colormodel, resolution);
-  if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+  if (log) log(ld, CF_LOGLEVEL_DEBUG,
               "Looking for \"*%s %s\"...", name, spec);
   if ((attr = ppdFindAttr(ppd, name, spec)) != NULL && attr->value != NULL)
     return (attr);
 
   snprintf(spec, specsize, "%s", colormodel);
-  if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+  if (log) log(ld, CF_LOGLEVEL_DEBUG,
               "Looking for \"*%s %s\"...", name, spec);
   if ((attr = ppdFindAttr(ppd, name, spec)) != NULL && attr->value != NULL)
     return (attr);
 
   snprintf(spec, specsize, "%s.%s", media, resolution);
-  if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+  if (log) log(ld, CF_LOGLEVEL_DEBUG,
               "Looking for \"*%s %s\"...", name, spec);
   if ((attr = ppdFindAttr(ppd, name, spec)) != NULL && attr->value != NULL)
     return (attr);
 
   snprintf(spec, specsize, "%s", media);
-  if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+  if (log) log(ld, CF_LOGLEVEL_DEBUG,
               "Looking for \"*%s %s\"...", name, spec);
   if ((attr = ppdFindAttr(ppd, name, spec)) != NULL && attr->value != NULL)
     return (attr);
 
   snprintf(spec, specsize, "%s", resolution);
-  if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+  if (log) log(ld, CF_LOGLEVEL_DEBUG,
               "Looking for \"*%s %s\"...", name, spec);
   if ((attr = ppdFindAttr(ppd, name, spec)) != NULL && attr->value != NULL)
     return (attr);
 
   spec[0] = '\0';
-  if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+  if (log) log(ld, CF_LOGLEVEL_DEBUG,
               "Looking for \"*%s\"...", name);
   if ((attr = ppdFindAttr(ppd, name, spec)) != NULL && attr->value != NULL)
     return (attr);
 
-  if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+  if (log) log(ld, CF_LOGLEVEL_DEBUG,
               "No instance of \"*%s\" found...", name);
 
   return (NULL);
index 633538fe7dcc29c84703c23ca2bc0e0d4736853a..4241ecd5920ccbd9db3a0026c196fc3faf6e0b73 100644 (file)
@@ -118,7 +118,7 @@ static int parse_line(char *line, char **key, char **value)
     return 1;
 }
 
-static unsigned parse_show(char *s, filter_logfunc_t log, void *ld)
+static unsigned parse_show(char *s, cf_logfunc_t log, void *ld)
 {
     unsigned info = 0;
     char *tok;
@@ -162,7 +162,7 @@ static unsigned parse_show(char *s, filter_logfunc_t log, void *ld)
         else if (!strcasecmp(tok, "time-at-processing"))
             info |= INFO_TIME_AT_PROCESSING;
         else if (log)
-            log(ld, FILTER_LOGLEVEL_ERROR, "cfFilterBannerToPDF: error: unknown value for 'Show': %s\n", tok);
+            log(ld, CF_LOGLEVEL_ERROR, "cfFilterBannerToPDF: error: unknown value for 'Show': %s\n", tok);
     }
     return info;
 }
@@ -182,7 +182,7 @@ static char *template_path(const char *name, const char *datadir)
 
 banner_t *banner_new_from_file(const char *filename, int *num_options,
                               cups_option_t **options, const char *datadir,
-                              filter_logfunc_t log, void *ld)
+                              cf_logfunc_t log, void *ld)
 {
     FILE *f;
     char *line = NULL;
@@ -195,7 +195,7 @@ banner_t *banner_new_from_file(const char *filename, int *num_options,
     if (!(f = fopen(filename, "r")))
     {
       if (log)
-       log(ld, FILTER_LOGLEVEL_ERROR,
+       log(ld, CF_LOGLEVEL_ERROR,
            "cfFilterBannerToPDF: Error opening temporary file with input stream");
       goto out;
     }
@@ -209,7 +209,7 @@ banner_t *banner_new_from_file(const char *filename, int *num_options,
       if (bytes_read == -1)
       {
        if (log)
-         log(ld, FILTER_LOGLEVEL_ERROR,
+         log(ld, CF_LOGLEVEL_ERROR,
              "cfFilterBannerToPDF: No banner instructions found in input stream");
        goto out;
       }
@@ -240,7 +240,7 @@ banner_t *banner_new_from_file(const char *filename, int *num_options,
            if (ispdf)
              break;
             if (log)
-                log(ld, FILTER_LOGLEVEL_ERROR,
+                log(ld, CF_LOGLEVEL_ERROR,
                    "cfFilterBannerToPDF: Line %d is missing a value", linenr);
             continue;
         }
@@ -274,7 +274,7 @@ banner_t *banner_new_from_file(const char *filename, int *num_options,
                  !strcasecmp(key, "notice"))
         {
             if (log)
-                log(ld, FILTER_LOGLEVEL_ERROR,
+                log(ld, CF_LOGLEVEL_ERROR,
                     "cfFilterBannerToPDF: Note: %d: bannertopdf does not support '%s'",
                     linenr, key);
         }
@@ -283,7 +283,7 @@ banner_t *banner_new_from_file(const char *filename, int *num_options,
            if (ispdf)
              break;
             if (log)
-                log(ld, FILTER_LOGLEVEL_ERROR,
+                log(ld, CF_LOGLEVEL_ERROR,
                     "cfFilterBannerToPDF: Error: %d: unknown keyword '%s'",
                     linenr, key);
         }
@@ -723,7 +723,7 @@ static int generate_banner_pdf(banner_t *banner,
                                const char *jobtitle,
                                int noptions,
                                cups_option_t *options,
-                               filter_logfunc_t log,
+                               cf_logfunc_t log,
                                void *ld,
                                FILE *outputfp)
 {
@@ -747,7 +747,7 @@ static int generate_banner_pdf(banner_t *banner,
 
     if (!(doc = pdf_load_template(banner->template_file)))
     {
-      if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "PDF template must exist and contain exactly 1 page: %s",
                   banner->template_file);
       return (1);
@@ -758,7 +758,7 @@ static int generate_banner_pdf(banner_t *banner,
 
     if (pdf_resize_page(doc, 1, page_width, page_length, &page_scale) != 0)
     {
-      if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "Unable to resize requested PDF page");
       pdf_free(doc);
       return (1);
@@ -766,7 +766,7 @@ static int generate_banner_pdf(banner_t *banner,
 
     if (pdf_add_type1_font(doc, 1, "Courier") != 0)
     {
-      if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "Unable to add type1 font to requested PDF page");
       pdf_free(doc);
       return (1);
@@ -778,7 +778,7 @@ static int generate_banner_pdf(banner_t *banner,
     if ((s = tmpfile()) == NULL)
     {
         if (log)
-            log(ld, FILTER_LOGLEVEL_ERROR, "cfFilterBannerToPDF: Cannot create temp file: %s\n", strerror(errno));
+            log(ld, CF_LOGLEVEL_ERROR, "cfFilterBannerToPDF: Cannot create temp file: %s\n", strerror(errno));
        pdf_free(doc);
         return 1;
     }
@@ -932,14 +932,14 @@ static int generate_banner_pdf(banner_t *banner,
     if (fstat(fileno(s), &st) < 0)
     {
         if (log)
-            log(ld, FILTER_LOGLEVEL_ERROR, "cfFilterBannerToPDF: Cannot fstat(): %s\n", , strerror(errno));
+            log(ld, CF_LOGLEVEL_ERROR, "cfFilterBannerToPDF: Cannot fstat(): %s\n", , strerror(errno));
         return 1;
     }
     fseek(s, 0L, SEEK_SET);
     if ((buf = malloc(st.st_size + 1)) == NULL)
     {
         if (log)
-            log(ld, FILTER_LOGLEVEL_ERROR, "cfFilterBannerToPDF: Cannot malloc(): %s\n", , strerror(errno));
+            log(ld, CF_LOGLEVEL_ERROR, "cfFilterBannerToPDF: Cannot malloc(): %s\n", , strerror(errno));
         return 1;
     }
     size_t nbytes = fread(buf, 1, st.st_size, s);
@@ -967,7 +967,7 @@ static int generate_banner_pdf(banner_t *banner,
 
       if (pdf_prepend_stream(doc, 1, buf, len) != 0)
       {
-       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+       if (log) log(ld, CF_LOGLEVEL_ERROR,
                     "Unable to prepend stream to requested PDF page");
       }
     }
@@ -981,7 +981,7 @@ static int generate_banner_pdf(banner_t *banner,
     {
       if (pdf_duplicate_page(doc, 1, copies - 1) != 0)
       {
-       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+       if (log) log(ld, CF_LOGLEVEL_ERROR,
                     "Unable to duplicate requested PDF page");
       }
     }
@@ -1021,7 +1021,7 @@ int cfFilterBannerToPDF(int inputfd,         /* I - File descriptor input stream
     size_t bytes;
     const char *datadir = (const char *)parameters;
 
-    filter_logfunc_t log = data->logfunc;
+    cf_logfunc_t log = data->logfunc;
     void *ld = data->logdata;
     cf_filter_iscanceledfunc_t iscanceled = data->iscanceledfunc;
     void *icd = data->iscanceleddata;
@@ -1038,7 +1038,7 @@ int cfFilterBannerToPDF(int inputfd,         /* I - File descriptor input stream
         if (!iscanceled || !iscanceled(icd))
         {
             if (log)
-                log(ld, FILTER_LOGLEVEL_DEBUG,
+                log(ld, CF_LOGLEVEL_DEBUG,
                     "cfFilterBannerToPDF: Unable to open input data stream.");
         }
         return (1);
@@ -1050,13 +1050,13 @@ int cfFilterBannerToPDF(int inputfd,         /* I - File descriptor input stream
 
     if ((tempfd = cupsTempFd(tempfile, sizeof(tempfile))) < 0)
     {
-      if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "cfFilterBannerToPDF: Unable to copy input file: %s",
                   strerror(errno));
       return (1);
     }
 
-    if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "cfFilterBannerToPDF: Copying input to temp file \"%s\"",
                 tempfile);
 
@@ -1079,7 +1079,7 @@ int cfFilterBannerToPDF(int inputfd,         /* I - File descriptor input stream
         if (!iscanceled || !iscanceled(icd))
         {
             if (log)
-                log(ld, FILTER_LOGLEVEL_DEBUG,
+                log(ld, CF_LOGLEVEL_DEBUG,
                     "cfFilterBannerToPDF: Unable to open output data stream.");
         }
 
@@ -1096,7 +1096,7 @@ int cfFilterBannerToPDF(int inputfd,         /* I - File descriptor input stream
     if (!ppd)
     {
         if (log)
-            log(ld, FILTER_LOGLEVEL_DEBUG, "cfFilterBannerToPDF: Could not open PPD file '%s'", ppd);
+            log(ld, CF_LOGLEVEL_DEBUG, "cfFilterBannerToPDF: Could not open PPD file '%s'", ppd);
     }
 
    /*
@@ -1108,7 +1108,7 @@ int cfFilterBannerToPDF(int inputfd,         /* I - File descriptor input stream
     if (!banner)
     {
         if (log)
-            log(ld, FILTER_LOGLEVEL_ERROR, "cfFilterBannerToPDF: Could not read banner file");
+            log(ld, CF_LOGLEVEL_ERROR, "cfFilterBannerToPDF: Could not read banner file");
         return 1;
     }
 
index 242d004404ff1845af1a6f03e3c98eb302c82a2d..3dcaa6882cf3fbcca344096d6b0b08584fc2c000 100644 (file)
@@ -1025,7 +1025,7 @@ cfCMYKLoad(ppd_file_t *ppd,               /* I - PPD file */
             const char *colormodel,    /* I - ColorModel value */
             const char *media,         /* I - MediaType value */
             const char *resolution,    /* I - Resolution value */
-            filter_logfunc_t log,      /* I - Log function */
+            cf_logfunc_t log,      /* I - Log function */
             void       *ld)            /* I - Log function data */
 {
   cf_cmyk_t    *cmyk;                  /* CMYK color separation */
@@ -1508,12 +1508,12 @@ cfCMYKLoad(ppd_file_t *ppd,             /* I - PPD file */
              break;
        }
       else
-       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+       if (log) log(ld, CF_LOGLEVEL_ERROR,
                     "Bad cupsBlackLtDk value \"%s\"!",
                     attr->value);
     }
     else
-      if (log) log(ld, FILTER_LOGLEVEL_WARN,
+      if (log) log(ld, CF_LOGLEVEL_WARN,
                   "No light black attribute found for %s!",
                   spec);
   }
@@ -1553,12 +1553,12 @@ cfCMYKLoad(ppd_file_t *ppd,             /* I - PPD file */
       if (sscanf(attr->value, "%f%f", &light, &dark) == 2)
        cfCMYKSetLtDk(cmyk, 0, light, dark, log, ld);
       else
-       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+       if (log) log(ld, CF_LOGLEVEL_ERROR,
                     "Bad cupsCyanLtDk value \"%s\"!",
                     attr->value);
     }
     else
-      if (log) log(ld, FILTER_LOGLEVEL_WARN,
+      if (log) log(ld, CF_LOGLEVEL_WARN,
                   "No light cyan attribute found for %s!",
                   spec);
 
@@ -1595,12 +1595,12 @@ cfCMYKLoad(ppd_file_t *ppd,             /* I - PPD file */
       if (sscanf(attr->value, "%f%f", &light, &dark) == 2)
        cfCMYKSetLtDk(cmyk, 2, light, dark, log, ld);
       else
-       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+       if (log) log(ld, CF_LOGLEVEL_ERROR,
                     "Bad cupsMagentaLtDk value \"%s\"!",
                     attr->value);
     }
     else
-      if (log) log(ld, FILTER_LOGLEVEL_WARN,
+      if (log) log(ld, CF_LOGLEVEL_WARN,
                   "No light magenta attribute found for %s!",
                   spec);
   }
@@ -1714,7 +1714,7 @@ void
 cfCMYKSetBlack(cf_cmyk_t *cmyk,        /* I - CMYK color separation */
                 float       lower,     /* I - No black ink */
                 float       upper,     /* I - Only black ink */
-                filter_logfunc_t log,  /* I - Log function */
+                cf_logfunc_t log,  /* I - Log function */
                 void       *ld)        /* I - Log function data */
 {
   int  i,                              /* Looping var */
@@ -1769,13 +1769,13 @@ cfCMYKSetBlack(cf_cmyk_t *cmyk, /* I - CMYK color separation */
     cmyk->color_lut[i] = 0;
   }
 
-  if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+  if (log) log(ld, CF_LOGLEVEL_DEBUG,
               "cfCMYKSetBlack(cmyk, lower=%.3f, upper=%.3f)",
               lower, upper);
 
   if (log)
     for (i = 0; i < 256; i += 17)
-      log(ld, FILTER_LOGLEVEL_DEBUG,
+      log(ld, CF_LOGLEVEL_DEBUG,
          "   %3d = %3dk + %3dc", i,
          cmyk->black_lut[i], cmyk->color_lut[i]);
 }
@@ -1791,7 +1791,7 @@ cfCMYKSetCurve(cf_cmyk_t *cmyk,   /* I - CMYK color separation */
                 int         num_xypoints,
                                        /* I - Number of X,Y points */
                 const float *xypoints, /* I - X,Y points */
-                filter_logfunc_t log,  /* I - Log function */
+                cf_logfunc_t log,  /* I - Log function */
                 void       *ld)        /* I - Log function data */
 {
   int  i;                              /* Looping var */
@@ -1835,7 +1835,7 @@ cfCMYKSetCurve(cf_cmyk_t *cmyk,   /* I - CMYK color separation */
   for (i = xend; i < 256; i ++)
     cmyk->channels[channel][i] = yend;
 
-  if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+  if (log) log(ld, CF_LOGLEVEL_DEBUG,
               "cupsCMYKSetXY(cmyk, channel=%d, num_xypoints=%d, "
               "xypoints=[%.3f %.3f %.3f %.3f ...])", channel,
               num_xypoints, xypoints[0], xypoints[1], xypoints[2],
@@ -1843,7 +1843,7 @@ cfCMYKSetCurve(cf_cmyk_t *cmyk,   /* I - CMYK color separation */
 
   if (log)
     for (i = 0; i < 256; i += 17)
-      log(ld, FILTER_LOGLEVEL_DEBUG,
+      log(ld, CF_LOGLEVEL_DEBUG,
          "    %3d = %4d", i,
          cmyk->channels[channel + 0][i]);
 }
@@ -1858,7 +1858,7 @@ cfCMYKSetGamma(cf_cmyk_t *cmyk,   /* I - CMYK color separation */
                  int         channel,  /* I - Ink channel */
                  float       gamval,   /* I - Gamma correction */
                 float       density,   /* I - Maximum density */
-                filter_logfunc_t log,  /* I - Log function */
+                cf_logfunc_t log,  /* I - Log function */
                 void       *ld)        /* I - Log function data */
 {
   int  i;                              /* Looping var */
@@ -1880,13 +1880,13 @@ cfCMYKSetGamma(cf_cmyk_t *cmyk, /* I - CMYK color separation */
     cmyk->channels[channel][i] = (int)(density * CF_MAX_LUT *
                                        pow((float)i / 255.0, gamval) + 0.5);
 
-  if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+  if (log) log(ld, CF_LOGLEVEL_DEBUG,
               "cfCMYKSetGamma(cmyk, channel=%d, gamval=%.3f, "
               "density=%.3f)", channel, gamval, density);
 
   if (log)
     for (i = 0; i < 256; i += 17)
-      log(ld, FILTER_LOGLEVEL_DEBUG,
+      log(ld, CF_LOGLEVEL_DEBUG,
          "    %3d = %4d", i,
          cmyk->channels[channel + 0][i]);
 }
@@ -1916,7 +1916,7 @@ cfCMYKSetLtDk(cf_cmyk_t *cmyk,    /* I - CMYK color separation */
                 int         channel,   /* I - Dark ink channel (+1 for light) */
                float       light,      /* I - Light ink only level */
                float       dark,       /* I - Dark ink only level */
-               filter_logfunc_t log,   /* I - Log function */
+               cf_logfunc_t log,   /* I - Log function */
                void       *ld)         /* I - Log function data */
 {
   int  i,                              /* Looping var */
@@ -1980,13 +1980,13 @@ cfCMYKSetLtDk(cf_cmyk_t *cmyk,  /* I - CMYK color separation */
     cmyk->channels[channel + 1][i] = 0;
   }
 
-  if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+  if (log) log(ld, CF_LOGLEVEL_DEBUG,
               "cfCMYKSetLtDk(cmyk, channel=%d, light=%.3f, "
               "dark=%.3f)", channel, light, dark);
 
   if (log)
     for (i = 0; i < 256; i += 17)
-      log(ld, FILTER_LOGLEVEL_DEBUG,
+      log(ld, CF_LOGLEVEL_DEBUG,
          "    %3d = %4dlt + %4ddk", i,
          cmyk->channels[channel + 0][i], cmyk->channels[channel + 1][i]);
 }
index 5b46278b63469c60ae875a7f332c366f3e6f007e..c370bb40bd32bf45d72daea66579e3132e88c1be 100644 (file)
@@ -116,7 +116,7 @@ get_filename_for_profile_path ( cf_filter_data_t *data,
                                DBusConnection *con,
                                const char *object_path)
 {
-  filter_logfunc_t log = data->logfunc;
+  cf_logfunc_t log = data->logfunc;
   void *ld = data->logdata;
   char *filename = NULL;
   const char *interface = "org.freedesktop.ColorManager.Profile";
@@ -139,14 +139,14 @@ get_filename_for_profile_path ( cf_filter_data_t *data,
 
   /* send syncronous */
   dbus_error_init(&error);
-  if(log) log(ld, FILTER_LOGLEVEL_DEBUG, "Calling %s.Get(%s)", interface, property);
+  if(log) log(ld, CF_LOGLEVEL_DEBUG, "Calling %s.Get(%s)", interface, property);
 
   reply = dbus_connection_send_with_reply_and_block(con,
                 message,
                 -1,
                 &error);
   if (reply == NULL) {
-    if(log) log(ld, FILTER_LOGLEVEL_DEBUG, 
+    if(log) log(ld, CF_LOGLEVEL_DEBUG, 
                "DEBUG: Failed to send: %s:%s",
            error.name, error.message);
     dbus_error_free(&error);
@@ -156,7 +156,7 @@ get_filename_for_profile_path ( cf_filter_data_t *data,
   /* get reply data */
   dbus_message_iter_init(reply, &args);
   if (dbus_message_iter_get_arg_type(&args) != DBUS_TYPE_VARIANT) {
-    if(log) log(ld, FILTER_LOGLEVEL_DEBUG,"Incorrect reply type");
+    if(log) log(ld, CF_LOGLEVEL_DEBUG,"Incorrect reply type");
 
     goto out;
   }
@@ -178,7 +178,7 @@ get_profile_for_device_path ( cf_filter_data_t *data,
                              const char *object_path,
                              const char **split)
 {
-  filter_logfunc_t log = data->logfunc;
+  cf_logfunc_t log = data->logfunc;
   void *ld = data->logdata;
   char **key = NULL;
   char *profile = NULL;
@@ -233,13 +233,13 @@ get_profile_for_device_path ( cf_filter_data_t *data,
 
   /* send syncronous */
   dbus_error_init(&error);
-  if(log) log(ld, FILTER_LOGLEVEL_DEBUG, "Calling GetProfileForQualifiers(%s...)", key[0]);
+  if(log) log(ld, CF_LOGLEVEL_DEBUG, "Calling GetProfileForQualifiers(%s...)", key[0]);
   reply = dbus_connection_send_with_reply_and_block(con,
                                                     message,
                                                     -1,
                                                     &error);
   if (reply == NULL) {
-    if(log) log(ld, FILTER_LOGLEVEL_DEBUG, "Failed to send: %s:%s",
+    if(log) log(ld, CF_LOGLEVEL_DEBUG, "Failed to send: %s:%s",
            error.name, error.message);
     dbus_error_free(&error);
     goto out;
@@ -248,11 +248,11 @@ get_profile_for_device_path ( cf_filter_data_t *data,
   /* get reply data */
   dbus_message_iter_init(reply, &args);
   if (dbus_message_iter_get_arg_type(&args) != DBUS_TYPE_OBJECT_PATH) {
-    if(log) log(ld, FILTER_LOGLEVEL_DEBUG, "Incorrect reply type");
+    if(log) log(ld, CF_LOGLEVEL_DEBUG, "Incorrect reply type");
     goto out;
   }
   dbus_message_iter_get_basic(&args, &tmp);
-  if(log) log(ld, FILTER_LOGLEVEL_DEBUG, "Found profile %s", tmp);
+  if(log) log(ld, CF_LOGLEVEL_DEBUG, "Found profile %s", tmp);
 
   /* get filename */
   profile = get_filename_for_profile_path(data, con, tmp);
@@ -275,7 +275,7 @@ get_device_path_for_device_id ( cf_filter_data_t *data,
                                DBusConnection *con,
                                const char *device_id)
 {
-  filter_logfunc_t log = data->logfunc;
+  cf_logfunc_t log = data->logfunc;
   void *ld = data->logdata;
   char *device_path = NULL;
   const char *device_path_tmp;
@@ -293,13 +293,13 @@ get_device_path_for_device_id ( cf_filter_data_t *data,
 
   /* send syncronous */
   dbus_error_init(&error);
-  if(log) log(ld, FILTER_LOGLEVEL_DEBUG, "Calling FindDeviceById(%s)", device_id);
+  if(log) log(ld, CF_LOGLEVEL_DEBUG, "Calling FindDeviceById(%s)", device_id);
   reply = dbus_connection_send_with_reply_and_block(con,
                 message,
                 -1,
                 &error);
   if (reply == NULL) {
-    if(log) log(ld, FILTER_LOGLEVEL_DEBUG, "Failed to send: %s:%s",
+    if(log) log(ld, CF_LOGLEVEL_DEBUG, "Failed to send: %s:%s",
             error.name, error.message);
     dbus_error_free(&error);
     goto out;
@@ -308,12 +308,12 @@ get_device_path_for_device_id ( cf_filter_data_t *data,
   /* get reply data */
   dbus_message_iter_init(reply, &args);
   if (dbus_message_iter_get_arg_type(&args) != DBUS_TYPE_OBJECT_PATH) {
-    if(log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if(log) log(ld, CF_LOGLEVEL_DEBUG,
                "Incorrect reply type");
     goto out;
   }
   dbus_message_iter_get_basic(&args, &device_path_tmp);
-  if(log) log(ld, FILTER_LOGLEVEL_DEBUG,
+  if(log) log(ld, CF_LOGLEVEL_DEBUG,
                "Found device %s", device_path_tmp);
   device_path = strdup(device_path_tmp);
 out:
@@ -329,14 +329,14 @@ cfColordGetProfileForDeviceID (cf_filter_data_t *data,
                                  const char *device_id,
                                  const char **qualifier_tuple)
 {
-  filter_logfunc_t log = data->logfunc;
+  cf_logfunc_t log = data->logfunc;
   void *ld = data->logdata;
   DBusConnection *con = NULL;
   char *device_path = NULL;
   char *filename = NULL;
 
   if (device_id == NULL) {
-    if(log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if(log) log(ld, CF_LOGLEVEL_DEBUG,
                "No colord device ID available");
     goto out;
   }
@@ -345,7 +345,7 @@ cfColordGetProfileForDeviceID (cf_filter_data_t *data,
   con = dbus_bus_get(DBUS_BUS_SYSTEM, NULL);
   if (con == NULL) {
     // If D-Bus is not reachable, gracefully leave and ignore error
-    if(log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if(log) log(ld, CF_LOGLEVEL_DEBUG,
                "Failed to connect to system bus");
     goto out;
   }
@@ -353,7 +353,7 @@ cfColordGetProfileForDeviceID (cf_filter_data_t *data,
   /* find the device */
   device_path = get_device_path_for_device_id (data, con, device_id);
   if (device_path == NULL) {
-    if(log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if(log) log(ld, CF_LOGLEVEL_DEBUG,
                "Failed to get device %s", device_id);
     goto out;
   }
@@ -361,11 +361,11 @@ cfColordGetProfileForDeviceID (cf_filter_data_t *data,
   /* get the best profile for the device */
   filename = get_profile_for_device_path(data, con, device_path, qualifier_tuple);
   if (filename == NULL || !filename[0]) {
-    if(log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if(log) log(ld, CF_LOGLEVEL_DEBUG,
                "Failed to get profile filename for %s", device_id);
     goto out;
   }
-  if(log) log(ld, FILTER_LOGLEVEL_ERROR,
+  if(log) log(ld, CF_LOGLEVEL_ERROR,
                "Use profile filename: '%s'", filename);
 out:
   free(device_path);
@@ -378,7 +378,7 @@ int
 get_profile_inhibitors ( cf_filter_data_t *data,
                          DBusConnection *con, const char *object_path)
 {
-  filter_logfunc_t log = data->logfunc;
+  cf_logfunc_t log = data->logfunc;
   void *ld = data->logdata;
   char *tmp;
   const char *interface = "org.freedesktop.ColorManager.Device";
@@ -402,14 +402,14 @@ get_profile_inhibitors ( cf_filter_data_t *data,
 
   /* send syncronous */
   dbus_error_init(&error);
-  if(log) log(ld, FILTER_LOGLEVEL_DEBUG,
+  if(log) log(ld, CF_LOGLEVEL_DEBUG,
                "Calling %s.Get(%s)", interface, property);
   reply = dbus_connection_send_with_reply_and_block(con,
                                                     message,
                                                     -1,
                                                     &error);
   if (reply == NULL) {
-    if(log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if(log) log(ld, CF_LOGLEVEL_DEBUG,
                "Failed to send: %s:%s",
            error.name, error.message);
     dbus_error_free(&error);
@@ -419,7 +419,7 @@ get_profile_inhibitors ( cf_filter_data_t *data,
   /* get reply data */
   dbus_message_iter_init(reply, &args);
   if (dbus_message_iter_get_arg_type(&args) != DBUS_TYPE_VARIANT) {
-    if(log) log(ld, FILTER_LOGLEVEL_DEBUG, 
+    if(log) log(ld, CF_LOGLEVEL_DEBUG, 
                "Incorrect reply type");
     goto out;
   }
@@ -429,7 +429,7 @@ get_profile_inhibitors ( cf_filter_data_t *data,
   dbus_message_iter_recurse(&sub2, &sub);
   while (dbus_message_iter_get_arg_type(&sub) != DBUS_TYPE_INVALID) {
     dbus_message_iter_get_basic(&sub, &tmp);
-    if(log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if(log) log(ld, CF_LOGLEVEL_DEBUG,
                "Inhibitor %s exists", tmp);
     dbus_message_iter_next(&sub);
     inhibitors++;
@@ -446,7 +446,7 @@ int
 cfColordGetInhibitForDeviceID (cf_filter_data_t *data,
                        const char *device_id)
 {
-  filter_logfunc_t log = data->logfunc;
+  cf_logfunc_t log = data->logfunc;
   void* ld = data->logdata;
   DBusConnection *con;
   char *device_path = NULL;
@@ -456,7 +456,7 @@ cfColordGetInhibitForDeviceID (cf_filter_data_t *data,
   con = dbus_bus_get(DBUS_BUS_SYSTEM, NULL);
   if (con == NULL) {
     // If D-Bus is not reachable, gracefully leave and ignore error
-    if(log) log(ld, FILTER_LOGLEVEL_ERROR, 
+    if(log) log(ld, CF_LOGLEVEL_ERROR, 
                "Failed to connect to system bus");
     goto out;
   }
@@ -464,7 +464,7 @@ cfColordGetInhibitForDeviceID (cf_filter_data_t *data,
   /* find the device */
   device_path = get_device_path_for_device_id (data, con, device_id);
   if (device_path == NULL) {
-    if(log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if(log) log(ld, CF_LOGLEVEL_DEBUG,
                "Failed to get find device %s", device_id);
     goto out;
   }
@@ -485,9 +485,9 @@ cfColordGetProfileForDeviceID (cf_filter_data_t *data,
                                  const char *device_id,
                                   const char **qualifier_tuple)
 {
-  filter_logfunc_t log = data->logfunc;
+  cf_logfunc_t log = data->logfunc;
   void *ld = data->logdata;
-  if(log) log(ld, FILTER_LOGLEVEL_WARN,
+  if(log) log(ld, CF_LOGLEVEL_WARN,
                        "not compiled with DBus support");
   return NULL;
 }
@@ -496,9 +496,9 @@ int
 cfColordGetInhibitForDeviceID (cf_filter_data_t *data,
                        const char *device_id)
 {
-  filter_logfunc_t log = data->logfunc;
+  cf_logfunc_t log = data->logfunc;
   void *ld = data->logdata;
-  if(log) log(ld, FILTER_LOGLEVEL_WARN,
+  if(log) log(ld, CF_LOGLEVEL_WARN,
                        "not compiled with DBus support");
   
   return 0;
index 494992278e995e7a0408344753593c6ea756853f..29a5b0cfabbcc398af73da57f418e281f54ffa39 100644 (file)
@@ -69,7 +69,7 @@ double    blackpoint_default[3] = {0.0, 0.0, 0.0};
 int          
 cfCmIsPrinterCmDisabled(cf_filter_data_t *data)
 {
-    filter_logfunc_t log = data->logfunc;
+    cf_logfunc_t log = data->logfunc;
     void *ld = data->logdata;
     int is_cm_off = 0;          /* color management status flag */
 
@@ -78,7 +78,7 @@ cfCmIsPrinterCmDisabled(cf_filter_data_t *data)
     is_cm_off = _get_colord_printer_cm_status(data);
 
     if (is_cm_off)
-       if(log) log(ld, FILTER_LOGLEVEL_DEBUG,
+       if(log) log(ld, CF_LOGLEVEL_DEBUG,
                "Color Manager: Color management disabled by OS.");
 
     return is_cm_off;      
@@ -92,14 +92,14 @@ cfCmGetPrinterIccProfile(cf_filter_data_t *data,
                        char **icc_profile,        /* ICC Profile Path */
                        ppd_file_t *ppd)           /* Optional PPD file for fallback profile */
 {
-    filter_logfunc_t log = data->logfunc;
+    cf_logfunc_t log = data->logfunc;
     void *ld = data->logdata;
     int profile_set = 0;        /* 'is profile found' flag */
 
 
     /* Request a profile from colord */
     profile_set = _get_colord_profile(data, icc_profile, ppd);
-    if(log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if(log) log(ld, CF_LOGLEVEL_DEBUG,
                "Color Manager: ICC Profile: %s", *icc_profile ?
         *icc_profile : "None");
 
@@ -115,7 +115,7 @@ cfCmGetCupsColorCalibrateMode(cf_filter_data_t *data,
                             int num_options)           /* Options from CUPS */
 {
 
-    filter_logfunc_t log = data->logfunc;
+    cf_logfunc_t log = data->logfunc;
     void *ld = data->logdata;
     cf_cm_calibration_t status;     /* color management status */
 
@@ -126,7 +126,7 @@ cfCmGetCupsColorCalibrateMode(cf_filter_data_t *data,
     else
       status = CF_CM_CALIBRATION_DISABLED;
 
-    if(log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if(log) log(ld, CF_LOGLEVEL_DEBUG,
                "Color Manager: %s", status ?
            "Calibration Mode/Enabled" : "Calibration Mode/Off");
 
@@ -189,10 +189,10 @@ char *
 _get_colord_printer_id( cf_filter_data_t *data)
 {
 
-    filter_logfunc_t log = data->logfunc;
+    cf_logfunc_t log = data->logfunc;
     void *ld = data->logdata;
     if (data->printer == NULL) {
-      if(log) log(ld, FILTER_LOGLEVEL_DEBUG,
+      if(log) log(ld, CF_LOGLEVEL_DEBUG,
                "Color Manager: Invalid printer name.");
       return 0;
     }
@@ -210,12 +210,12 @@ int
 _get_colord_printer_cm_status( cf_filter_data_t *data)
 {
 
-    filter_logfunc_t log = data->logfunc;
+    cf_logfunc_t log = data->logfunc;
     void *ld = data->logdata;
 
     /* If invalid input, we leave color management alone */
     if (data->printer == NULL) {
-      if(log) log(ld, FILTER_LOGLEVEL_DEBUG,
+      if(log) log(ld, CF_LOGLEVEL_DEBUG,
                "Color Manager: Invalid printer name.");
       return 0;
     } else if (!strcmp(data->printer, "(null)"))
@@ -242,11 +242,11 @@ _get_colord_profile(cf_filter_data_t *data,
                     ppd_file_t   *ppd)              /* PPD file */
 {
 
-    filter_logfunc_t log = data->logfunc;
+    cf_logfunc_t log = data->logfunc;
     void *ld = data->logdata;
 
     if (data->printer == NULL || profile == 0) {
-      if(log) log(ld, FILTER_LOGLEVEL_DEBUG,
+      if(log) log(ld, CF_LOGLEVEL_DEBUG,
                "Color Manager: Invalid input - Unable to find profile."); 
       return -1;
     }
@@ -309,7 +309,7 @@ char *
 _get_ppd_icc_fallback (cf_filter_data_t *data, ppd_file_t *ppd, char **qualifier)
 {
 
-  filter_logfunc_t log = data->logfunc;
+  cf_logfunc_t log = data->logfunc;
   void *ld = data->logdata;
   char full_path[1024];
   char *icc_profile = NULL;
@@ -334,7 +334,7 @@ _get_ppd_icc_fallback (cf_filter_data_t *data, ppd_file_t *ppd, char **qualifier
 
   /* neither */
   if (attr == NULL) {
-    if(log) log(ld, FILTER_LOGLEVEL_INFO,
+    if(log) log(ld, CF_LOGLEVEL_INFO,
                "Color Manager: no profiles specified in PPD");
                
     goto out;
@@ -342,7 +342,7 @@ _get_ppd_icc_fallback (cf_filter_data_t *data, ppd_file_t *ppd, char **qualifier
 
   /* try to find a profile that matches the qualifier exactly */
   for (;attr != NULL; attr = ppdFindNextAttr(ppd, profile_key, NULL)) {
-    if(log) log(ld, FILTER_LOGLEVEL_INFO,
+    if(log) log(ld, CF_LOGLEVEL_INFO,
                "Color Manager: found profile %s in PPD with qualifier '%s'",
                        attr->value, attr->spec);
 
@@ -362,7 +362,7 @@ _get_ppd_icc_fallback (cf_filter_data_t *data, ppd_file_t *ppd, char **qualifier
 
     /* check the file exists */
     if (access(full_path, 0)) {
-      if(log) log(ld, FILTER_LOGLEVEL_INFO,
+      if(log) log(ld, CF_LOGLEVEL_INFO,
                "Color Manager: found profile %s in PPD that does not exist",
               full_path);
       continue;
@@ -377,7 +377,7 @@ _get_ppd_icc_fallback (cf_filter_data_t *data, ppd_file_t *ppd, char **qualifier
 
   /* no match */
   if (attr == NULL) {
-    if(log) log(ld, FILTER_LOGLEVEL_INFO,
+    if(log) log(ld, CF_LOGLEVEL_INFO,
                "Color Manager: no profiles in PPD for qualifier '%s'",
             qualifer_tmp);
     goto out;
index 66187b03db5189849f7709031b81193e48db92b4..753d2fa9aca6c63f763004b3ee8ba7832af1ed97 100644 (file)
@@ -130,7 +130,7 @@ extern ppd_attr_t   *cfFindAttr(ppd_file_t *ppd, const char *name,
                                    const char *media,
                                    const char *resolution,
                                    char *spec, int specsize,
-                                   filter_logfunc_t log,
+                                   cf_logfunc_t log,
                                    void *ld);
                               
 /*
@@ -156,14 +156,14 @@ extern void               cfDitherDelete(cf_dither_t *);
  */
 
 extern cf_lut_t                *cfLutNew(int num_vals, const float *vals,
-                                 filter_logfunc_t log, void *ld);
+                                 cf_logfunc_t log, void *ld);
 extern void            cfLutDelete(cf_lut_t *lut);
 extern cf_lut_t                *cfLutLoad(ppd_file_t *ppd,
                                   const char *colormodel,
                                   const char *media,
                                   const char *resolution,
                                   const char *ink,
-                                  filter_logfunc_t log,
+                                  cf_logfunc_t log,
                                   void *ld);
 
 
@@ -198,7 +198,7 @@ extern cf_rgb_t             *cfRGBLoad(ppd_file_t *ppd,
                                   const char *colormodel,
                                   const char *media,
                                   const char *resolution,
-                                  filter_logfunc_t log,
+                                  cf_logfunc_t log,
                                   void *ld);
 extern cf_rgb_t                *cfRGBNew(int num_samples, cf_sample_t *samples,
                                  int cube_size, int num_channels);
@@ -225,22 +225,22 @@ extern cf_cmyk_t  *cfCMYKLoad(ppd_file_t *ppd,
                                    const char *colormodel,
                                    const char *media,
                                    const char *resolution,
-                                   filter_logfunc_t log,
+                                   cf_logfunc_t log,
                                    void *ld);
   extern void          cfCMYKSetBlack(cf_cmyk_t *cmyk,
                                       float lower, float upper,
-                                      filter_logfunc_t log, void *ld);
+                                      cf_logfunc_t log, void *ld);
 extern void            cfCMYKSetCurve(cf_cmyk_t *cmyk, int channel,
                                       int num_xypoints,
                                       const float *xypoints,
-                                      filter_logfunc_t log, void *ld);
+                                      cf_logfunc_t log, void *ld);
 extern void            cfCMYKSetGamma(cf_cmyk_t *cmyk, int channel,
                                       float gamval, float density,
-                                      filter_logfunc_t log, void *ld);
+                                      cf_logfunc_t log, void *ld);
 extern void            cfCMYKSetInkLimit(cf_cmyk_t *cmyk, float limit);
   extern void          cfCMYKSetLtDk(cf_cmyk_t *cmyk, int channel,
                                      float light, float dark,
-                                     filter_logfunc_t log, void *ld);
+                                     cf_logfunc_t log, void *ld);
 
 
 /*
index f6f7abd1a9a5d9d22063608adf94d0723e2ef0c6..852998ba65770a8fdc2c983b6f61b2b2f204b086 100644 (file)
@@ -67,7 +67,7 @@ fcntl_add_nonblock(int fd) /* File descriptor to add O_NONBLOCK to */
 
 void
 cfCUPSLogFunc(void *data,
-            filter_loglevel_t level,
+            cf_loglevel_t level,
             const char *message,
             ...)
 {
@@ -78,22 +78,22 @@ cfCUPSLogFunc(void *data,
 
   switch(level)
   {
-    case FILTER_LOGLEVEL_UNSPEC:
-    case FILTER_LOGLEVEL_DEBUG:
+    case CF_LOGLEVEL_UNSPEC:
+    case CF_LOGLEVEL_DEBUG:
     default:
       fprintf(stderr, "DEBUG: ");
       break;
-    case FILTER_LOGLEVEL_INFO:
+    case CF_LOGLEVEL_INFO:
       fprintf(stderr, "INFO: ");
       break;
-    case FILTER_LOGLEVEL_WARN:
+    case CF_LOGLEVEL_WARN:
       fprintf(stderr, "WARN: ");
       break;
-    case FILTER_LOGLEVEL_ERROR:
-    case FILTER_LOGLEVEL_FATAL:
+    case CF_LOGLEVEL_ERROR:
+    case CF_LOGLEVEL_FATAL:
       fprintf(stderr, "ERROR: ");
       break;
-    case FILTER_LOGLEVEL_CONTROL:
+    case CF_LOGLEVEL_CONTROL:
       break;
   }      
   va_start(arglist, message);
@@ -279,7 +279,7 @@ cfFilterTee(int inputfd,         /* I - File descriptor input stream */
   const char           *filename = (const char *)parameters;
   ssize_t             bytes, total = 0;      /* Bytes read/written */
   char                buffer[65536];         /* Read/write buffer */
-  filter_logfunc_t     log = data->logfunc;   /* Log function */
+  cf_logfunc_t     log = data->logfunc;   /* Log function */
   void                 *ld = data->logdata;   /* log function data */
   int                  teefd = -1;            /* File descriptor for "tee"ed
                                                  copy */
@@ -295,7 +295,7 @@ cfFilterTee(int inputfd,         /* I - File descriptor input stream */
   {
     total += bytes;
     if (log)
-      log(ld, FILTER_LOGLEVEL_DEBUG,
+      log(ld, CF_LOGLEVEL_DEBUG,
          "cfFilterTee (%s): Passing on%s %d bytes, total %d bytes.",
          filename, teefd >= 0 ? " and copying" : "", bytes, total);
 
@@ -303,7 +303,7 @@ cfFilterTee(int inputfd,         /* I - File descriptor input stream */
       if (write(teefd, buffer, (size_t)bytes) != bytes)
       {
        if (log)
-         log(ld, FILTER_LOGLEVEL_ERROR,
+         log(ld, CF_LOGLEVEL_ERROR,
              "cfFilterTee (%s): Unable to write %d bytes to the copy, stopping copy, continuing job output.",
              filename, (int)bytes);
        close(teefd);
@@ -313,7 +313,7 @@ cfFilterTee(int inputfd,         /* I - File descriptor input stream */
     if (write(outputfd, buffer, (size_t)bytes) != bytes)
     {
       if (log)
-       log(ld, FILTER_LOGLEVEL_ERROR,
+       log(ld, CF_LOGLEVEL_ERROR,
            "cfFilterTee (%s): Unable to pass on %d bytes.",
            filename, (int)bytes);
       if (teefd >= 0)
@@ -351,7 +351,7 @@ cfFilterPOpen(cf_filter_function_t filter_func, /* I - Filter function */
                pid,                 /* Process ID of filter */
                 ret,
                 infd, outfd;         /* Temporary file descriptors */
-  filter_logfunc_t log = data->logfunc;
+  cf_logfunc_t log = data->logfunc;
   void          *ld = data->logdata;
 
 
@@ -362,7 +362,7 @@ cfFilterPOpen(cf_filter_function_t filter_func, /* I - Filter function */
   if (inputfd < 0 && outputfd < 0)
   {
     if (log)
-      log(ld, FILTER_LOGLEVEL_ERROR,
+      log(ld, CF_LOGLEVEL_ERROR,
          "cfFilterPOpen: Either inputfd or outputfd must be < 0, not both");
     return (-1);
   }
@@ -370,7 +370,7 @@ cfFilterPOpen(cf_filter_function_t filter_func, /* I - Filter function */
   if (inputfd > 0 && outputfd > 0)
   {
     if (log)
-      log(ld, FILTER_LOGLEVEL_ERROR,
+      log(ld, CF_LOGLEVEL_ERROR,
          "cfFilterPOpen: One of inputfd or outputfd must be < 0");
     return (-1);
   }
@@ -386,7 +386,7 @@ cfFilterPOpen(cf_filter_function_t filter_func, /* I - Filter function */
   */
 
   if (pipe(pipefds) < 0) {
-    if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+    if (log) log(ld, CF_LOGLEVEL_ERROR,
                 "cfFilterPOpen: Could not create pipe for %s: %s",
                 inputfd < 0 ? "input" : "output",
                 strerror(errno));
@@ -423,13 +423,13 @@ cfFilterPOpen(cf_filter_function_t filter_func, /* I - Filter function */
 
     close(infd);
     close(outfd);
-    if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "cfFilterPOpen: Filter function completed with status %d.",
                 ret);
     exit(ret);
 
   } else if (pid > 0) {
-    if (log) log(ld, FILTER_LOGLEVEL_INFO,
+    if (log) log(ld, CF_LOGLEVEL_INFO,
                 "cfFilterPOpen: Filter function (PID %d) started.", pid);
 
    /*
@@ -456,7 +456,7 @@ cfFilterPOpen(cf_filter_function_t filter_func, /* I - Filter function */
      * fork() error
      */
 
-    if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+    if (log) log(ld, CF_LOGLEVEL_ERROR,
                 "cfFilterPOpen: Could not fork to start filter function: %s",
                 strerror(errno));
     return (-1);
@@ -476,7 +476,7 @@ cfFilterPClose(int fd,             /* I - Pipe file descriptor */
 {
   int          status,          /* Exit status */
                 retval;                 /* Return value */
-  filter_logfunc_t log = data->logfunc;
+  cf_logfunc_t log = data->logfunc;
   void          *ld = data->logdata;
 
 
@@ -498,13 +498,13 @@ cfFilterPClose(int fd,             /* I - Pipe file descriptor */
     if (errno == EINTR)
       goto retry_wait;
     if (log)
-      log(ld, FILTER_LOGLEVEL_DEBUG,
+      log(ld, CF_LOGLEVEL_DEBUG,
          "cfFilterPClose: Filter function (PID %d) stopped with an error: %s!",
          filter_pid, strerror(errno));
     goto out;
   }
 
-  if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+  if (log) log(ld, CF_LOGLEVEL_DEBUG,
                "cfFilterPClose: Filter function (PID %d) exited with no errors.",
                filter_pid);
 
@@ -561,7 +561,7 @@ cfFilterChain(int inputfd,         /* I - File descriptor input stream */
   cups_array_t *pids;               /* Executed filters array */
   filter_function_pid_t        *pid_entry,  /* Entry in executed filters array */
                key;                 /* Search key for filters */
-  filter_logfunc_t log = data->logfunc;
+  cf_logfunc_t log = data->logfunc;
   void          *ld = data->logdata;
   cf_filter_iscanceledfunc_t iscanceled = data->iscanceledfunc;
   void          *icd = data->iscanceleddata;
@@ -581,12 +581,12 @@ cfFilterChain(int inputfd,         /* I - File descriptor input stream */
        filter;
        filter = (cf_filter_filter_in_chain_t *)cupsArrayNext(filter_chain)) {
     if (!filter->function) {
-      if (log) log(ld, FILTER_LOGLEVEL_INFO,
+      if (log) log(ld, CF_LOGLEVEL_INFO,
                   "cfFilterChain: Invalid filter: %s - Removing...",
                   filter->name ? filter->name : "Unspecified");
       cupsArrayRemove(filter_chain, filter);
     } else
-      if (log) log(ld, FILTER_LOGLEVEL_INFO,
+      if (log) log(ld, CF_LOGLEVEL_INFO,
                   "cfFilterChain: Running filter: %s",
                   filter->name ? filter->name : "Unspecified");
   }
@@ -597,20 +597,20 @@ cfFilterChain(int inputfd,         /* I - File descriptor input stream */
 
   if (cupsArrayCount(filter_chain) == 0)
   {
-    if (log) log(ld, FILTER_LOGLEVEL_INFO,
+    if (log) log(ld, CF_LOGLEVEL_INFO,
                 "cfFilterChain: No filter at all in chain, passing through the data.");
     retval = 0;
     while ((bytes = read(inputfd, buf, sizeof(buf))) > 0)
       if (write(outputfd, buf, bytes) < bytes)
       {
-       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+       if (log) log(ld, CF_LOGLEVEL_ERROR,
                     "cfFilterChain: Data write error: %s", strerror(errno));
        retval = 1;
        break;
       }
     if (bytes < 0)
     {
-      if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
                     "cfFilterChain: Data read error: %s", strerror(errno));
       retval = 1;
     }
@@ -646,7 +646,7 @@ cfFilterChain(int inputfd,         /* I - File descriptor input stream */
 
     if (next) {
       if (pipe(filterfds[1 - current]) < 0) {
-       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+       if (log) log(ld, CF_LOGLEVEL_ERROR,
                     "cfFilterChain: Could not create pipe for output of %s: %s",
                     filter->name ? filter->name : "Unspecified filter",
                     strerror(errno));
@@ -686,13 +686,13 @@ cfFilterChain(int inputfd,         /* I - File descriptor input stream */
 
       close(infd);
       close(outfd);
-      if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+      if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "cfFilterChain: %s completed with status %d.",
                   filter->name ? filter->name : "Unspecified filter", ret);
       exit(ret);
 
     } else if (pid > 0) {
-      if (log) log(ld, FILTER_LOGLEVEL_INFO,
+      if (log) log(ld, CF_LOGLEVEL_INFO,
                   "cfFilterChain: %s (PID %d) started.",
                   filter->name ? filter->name : "Unspecified filter", pid);
 
@@ -701,7 +701,7 @@ cfFilterChain(int inputfd,         /* I - File descriptor input stream */
       pid_entry->name = filter->name ? filter->name : "Unspecified filter";
       cupsArrayAdd(pids, pid_entry);
     } else {
-      if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "cfFilterChain: Could not fork to start %s: %s",
                   filter->name ? filter->name : "Unspecified filter",
                   strerror(errno));
@@ -733,7 +733,7 @@ cfFilterChain(int inputfd,         /* I - File descriptor input stream */
   while (cupsArrayCount(pids) > 0) {
     if ((pid = wait(&status)) < 0) {
       if (errno == EINTR && iscanceled && iscanceled(icd)) {
-       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+       if (log) log(ld, CF_LOGLEVEL_DEBUG,
                     "cfFilterChain: Job canceled, killing filters ...");
        for (pid_entry = (filter_function_pid_t *)cupsArrayFirst(pids);
             pid_entry;
@@ -753,17 +753,17 @@ cfFilterChain(int inputfd,         /* I - File descriptor input stream */
 
       if (status) {
        if (WIFEXITED(status)) {
-         if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+         if (log) log(ld, CF_LOGLEVEL_ERROR,
                       "cfFilterChain: %s (PID %d) stopped with status %d",
                       pid_entry->name, pid, WEXITSTATUS(status));
        } else {
-         if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+         if (log) log(ld, CF_LOGLEVEL_ERROR,
                       "cfFilterChain: %s (PID %d) crashed on signal %d",
                       pid_entry->name, pid, WTERMSIG(status));
        }
        retval = 1;
       } else {
-       if (log) log(ld, FILTER_LOGLEVEL_INFO,
+       if (log) log(ld, CF_LOGLEVEL_INFO,
                       "cfFilterChain: %s (PID %d) exited with no errors.",
                       pid_entry->name, pid);
       }
@@ -936,7 +936,7 @@ cfFilterExternalCUPS(int inputfd,         /* I - File descriptor input stream */
   int           stderrpipe[2];       /* Pipe to log stderr */
   cups_file_t   *fp;                 /* File pointer to read log lines */
   char          buf[2048];           /* Log line buffer */
-  filter_loglevel_t log_level;       /* Log level of filter's log message */
+  cf_loglevel_t log_level;       /* Log level of filter's log message */
   char          *ptr1, *ptr2,
                 *msg,                /* Filter log message */
                 *filter_name;        /* Filter name for logging */
@@ -951,14 +951,14 @@ cfFilterExternalCUPS(int inputfd,         /* I - File descriptor input stream */
   cups_option_t *opt;
   int status = 65536;
   int wstatus;
-  filter_logfunc_t log = data->logfunc;
+  cf_logfunc_t log = data->logfunc;
   void          *ld = data->logdata;
   cf_filter_iscanceledfunc_t iscanceled = data->iscanceledfunc;
   void          *icd = data->iscanceleddata;
 
 
   if (!params->filter || !params->filter[0]) {
-    if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+    if (log) log(ld, CF_LOGLEVEL_ERROR,
                 "cfFilterExternalCUPS: Filter executable path/command not specified");
     return (1);
   }
@@ -1060,14 +1060,14 @@ cfFilterExternalCUPS(int inputfd,         /* I - File descriptor input stream */
   {
     for (i = 0; envp[i]; i ++)
       if (!strncmp(envp[i], "AUTH_", 5))
-       log(ld, FILTER_LOGLEVEL_DEBUG, "cfFilterExternalCUPS (%s): envp[%d]: AUTH_%c****",
+       log(ld, CF_LOGLEVEL_DEBUG, "cfFilterExternalCUPS (%s): envp[%d]: AUTH_%c****",
            filter_name, i, envp[i][5]);
       else if (!strncmp(envp[i], "DEVICE_URI=", 11))
-       log(ld, FILTER_LOGLEVEL_DEBUG, "cfFilterExternalCUPS (%s): envp[%d]: DEVICE_URI=%s",
+       log(ld, CF_LOGLEVEL_DEBUG, "cfFilterExternalCUPS (%s): envp[%d]: DEVICE_URI=%s",
            filter_name, i, sanitize_device_uri(envp[i] + 11,
                                                buf, sizeof(buf)));
       else
-       log(ld, FILTER_LOGLEVEL_DEBUG, "cfFilterExternalCUPS (%s): envp[%d]: %s",
+       log(ld, CF_LOGLEVEL_DEBUG, "cfFilterExternalCUPS (%s): envp[%d]: %s",
            filter_name, i, envp[i]);
   }
 
@@ -1153,7 +1153,7 @@ cfFilterExternalCUPS(int inputfd,         /* I - File descriptor input stream */
     /* Log the arguments */
     if (log)
       for (i = 0; argv[i]; i ++)
-       log(ld, FILTER_LOGLEVEL_DEBUG, "cfFilterExternalCUPS (%s): argv[%d]: %s",
+       log(ld, CF_LOGLEVEL_DEBUG, "cfFilterExternalCUPS (%s): argv[%d]: %s",
            filter_name, i, argv[i]);
   } else {
    /*
@@ -1170,7 +1170,7 @@ cfFilterExternalCUPS(int inputfd,         /* I - File descriptor input stream */
   */
 
   if (pipe(stderrpipe) < 0) {
-    if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+    if (log) log(ld, CF_LOGLEVEL_ERROR,
                 "cfFilterExternalCUPS (%s): Could not create pipe for stderr: %s",
                 filter_name, strerror(errno));
     return (1);
@@ -1186,7 +1186,7 @@ cfFilterExternalCUPS(int inputfd,         /* I - File descriptor input stream */
     if (inputfd != 0) {
       if (inputfd < 0) {
         inputfd = open("/dev/null", O_RDONLY);
-       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+       if (log) log(ld, CF_LOGLEVEL_ERROR,
                     "cfFilterExternalCUPS (%s): No input file descriptor supplied for CUPS filter - %s",
                   filter_name, strerror(errno));
       }
@@ -1194,18 +1194,18 @@ cfFilterExternalCUPS(int inputfd,         /* I - File descriptor input stream */
       if (inputfd > 0) {
        fcntl_add_cloexec(inputfd);
         if (dup2(inputfd, 0) < 0) {
-         if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+         if (log) log(ld, CF_LOGLEVEL_ERROR,
                       "cfFilterExternalCUPS (%s): Failed to connect input file descriptor with CUPS filter's stdin - %s",
                       filter_name, strerror(errno));
          goto fd_error;
        } else
-         if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+         if (log) log(ld, CF_LOGLEVEL_DEBUG,
                       "cfFilterExternalCUPS (%s): Connected input file descriptor %d to CUPS filter's stdin.",
                       filter_name, inputfd);
        close(inputfd);
       }
     } else
-      if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+      if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "cfFilterExternalCUPS (%s): Input comes from stdin, letting the filter grab stdin directly",
                   filter_name);
 
@@ -1274,7 +1274,7 @@ cfFilterExternalCUPS(int inputfd,         /* I - File descriptor input stream */
 
     execve(filter_path, argv, envp);
 
-    if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+    if (log) log(ld, CF_LOGLEVEL_ERROR,
                 "cfFilterExternalCUPS (%s): Execution of %s %s failed - %s",
                 filter_name, params->is_backend ? "backend" : "filter",
                 filter_path, strerror(errno));
@@ -1282,11 +1282,11 @@ cfFilterExternalCUPS(int inputfd,         /* I - File descriptor input stream */
   fd_error:
     exit(errno);
   } else if (pid > 0) {
-    if (log) log(ld, FILTER_LOGLEVEL_INFO,
+    if (log) log(ld, CF_LOGLEVEL_INFO,
                 "cfFilterExternalCUPS (%s): %s (PID %d) started.",
                 filter_name, filter_path, pid);
   } else {
-    if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+    if (log) log(ld, CF_LOGLEVEL_ERROR,
                 "cfFilterExternalCUPS (%s): Unable to fork process for %s %s",
                 filter_name, params->is_backend ? "backend" : "filter",
                 filter_path);
@@ -1314,31 +1314,31 @@ cfFilterExternalCUPS(int inputfd,         /* I - File descriptor input stream */
     while (cupsFileGets(fp, buf, sizeof(buf)))
       if (log) {
        if (strncmp(buf, "DEBUG: ", 7) == 0) {
-         log_level = FILTER_LOGLEVEL_DEBUG;
+         log_level = CF_LOGLEVEL_DEBUG;
          msg = buf + 7;
        } else if (strncmp(buf, "DEBUG2: ", 8) == 0) {
-         log_level = FILTER_LOGLEVEL_DEBUG;
+         log_level = CF_LOGLEVEL_DEBUG;
          msg = buf + 8;
        } else if (strncmp(buf, "INFO: ", 6) == 0) {
-         log_level = FILTER_LOGLEVEL_INFO;
+         log_level = CF_LOGLEVEL_INFO;
          msg = buf + 6;
        } else if (strncmp(buf, "WARNING: ", 9) == 0) {
-         log_level = FILTER_LOGLEVEL_WARN;
+         log_level = CF_LOGLEVEL_WARN;
          msg = buf + 9;
        } else if (strncmp(buf, "ERROR: ", 7) == 0) {
-         log_level = FILTER_LOGLEVEL_ERROR;
+         log_level = CF_LOGLEVEL_ERROR;
          msg = buf + 7;
        } else if (strncmp(buf, "PAGE: ", 6) == 0 ||
                   strncmp(buf, "ATTR: ", 6) == 0 ||
                   strncmp(buf, "STATE: ", 6) == 0 ||
                   strncmp(buf, "PPD: ", 6) == 0) {
-         log_level = FILTER_LOGLEVEL_CONTROL;
+         log_level = CF_LOGLEVEL_CONTROL;
          msg = buf;
        } else {
-         log_level = FILTER_LOGLEVEL_DEBUG;
+         log_level = CF_LOGLEVEL_DEBUG;
          msg = buf;
        }
-       if (log_level == FILTER_LOGLEVEL_CONTROL)
+       if (log_level == CF_LOGLEVEL_CONTROL)
          log(ld, log_level, msg);
        else
          log(ld, log_level, "cfFilterExternalCUPS (%s): %s", filter_name, msg);
@@ -1349,11 +1349,11 @@ cfFilterExternalCUPS(int inputfd,         /* I - File descriptor input stream */
     /* Ignore errors of the logging process */
     exit(0);
   } else if (stderrpid > 0) {
-    if (log) log(ld, FILTER_LOGLEVEL_INFO,
+    if (log) log(ld, CF_LOGLEVEL_INFO,
                 "cfFilterExternalCUPS (%s): Logging (PID %d) started.",
                 filter_name, stderrpid);
   } else {
-    if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+    if (log) log(ld, CF_LOGLEVEL_ERROR,
                 "cfFilterExternalCUPS (%s): Unable to fork process for logging",
                 filter_name);
     close(stderrpipe[0]);
@@ -1374,7 +1374,7 @@ cfFilterExternalCUPS(int inputfd,         /* I - File descriptor input stream */
   while (pid > 0 || stderrpid > 0) {
     if ((wpid = wait(&wstatus)) < 0) {
       if (errno == EINTR && iscanceled && iscanceled(icd)) {
-       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+       if (log) log(ld, CF_LOGLEVEL_DEBUG,
                     "cfFilterExternalCUPS (%s): Job canceled, killing %s ...",
                     filter_name, params->is_backend ? "backend" : "filter");
        kill(pid, SIGTERM);
@@ -1390,7 +1390,7 @@ cfFilterExternalCUPS(int inputfd,         /* I - File descriptor input stream */
     if (wstatus) {
       if (WIFEXITED(wstatus)) {
        /* Via exit() anywhere or return() in the main() function */
-       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+       if (log) log(ld, CF_LOGLEVEL_ERROR,
                     "cfFilterExternalCUPS (%s): %s (PID %d) stopped with status %d",
                     filter_name,
                     (wpid == pid ?
@@ -1399,7 +1399,7 @@ cfFilterExternalCUPS(int inputfd,         /* I - File descriptor input stream */
                     wpid, WEXITSTATUS(wstatus));
       } else {
        /* Via signal */
-       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+       if (log) log(ld, CF_LOGLEVEL_ERROR,
                     "cfFilterExternalCUPS (%s): %s (PID %d) crashed on signal %d",
                     filter_name,
                     (wpid == pid ?
@@ -1409,7 +1409,7 @@ cfFilterExternalCUPS(int inputfd,         /* I - File descriptor input stream */
       }
       status = 1;
     } else {
-      if (log) log(ld, FILTER_LOGLEVEL_INFO,
+      if (log) log(ld, CF_LOGLEVEL_INFO,
                   "cfFilterExternalCUPS (%s): %s (PID %d) exited with no errors.",
                   filter_name,
                   (wpid == pid ?
@@ -1458,7 +1458,7 @@ int                           /* O - 0 on success, -1 on error */
 cfFilterOpenBackAndSidePipes(
     cf_filter_data_t *data)      /* O - FDs in filter_data record */
 {
-  filter_logfunc_t log = data->logfunc;
+  cf_logfunc_t log = data->logfunc;
   void          *ld = data->logdata;
 
 
@@ -1509,7 +1509,7 @@ cfFilterOpenBackAndSidePipes(
   if (fcntl_add_cloexec(data->side_pipe[1]))
     goto out;
 
-  if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+  if (log) log(ld, CF_LOGLEVEL_DEBUG,
               "Pipes for back and side channels opened");
 
  /*
@@ -1524,7 +1524,7 @@ cfFilterOpenBackAndSidePipes(
   * Clean up after failure...
   */
 
-  if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+  if (log) log(ld, CF_LOGLEVEL_ERROR,
               "Unable to open pipes for back and side channels");
 
   cfFilterCloseBackAndSidePipes(data);
@@ -1544,7 +1544,7 @@ void
 cfFilterCloseBackAndSidePipes(
     cf_filter_data_t *data)      /* O - FDs in filter_data record */
 {
-  filter_logfunc_t log = data->logfunc;
+  cf_logfunc_t log = data->logfunc;
   void          *ld = data->logdata;
 
 
@@ -1570,7 +1570,7 @@ cfFilterCloseBackAndSidePipes(
   data->side_pipe[0] = -1;
   data->side_pipe[1] = -1;
 
-  if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+  if (log) log(ld, CF_LOGLEVEL_DEBUG,
               "Closed the pipes for back and side channels");
 }
 
@@ -1596,7 +1596,7 @@ cfFilterSetCommonOptions(
     float         *PageBottom,
     float         *PageWidth,
     float         *PageLength,
-    filter_logfunc_t log,               /* I - Logging function,
+    cf_logfunc_t log,               /* I - Logging function,
                                               NULL for no logging */
     void *ld)                           /* I - User data for logging function,
                                               can be NULL */
@@ -1623,7 +1623,7 @@ cfFilterSetCommonOptions(
       *PageWidth = pagesize->width;
     else
     {
-      if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "Invalid value for page width: %.0f",
                   pagesize->width);
       corrected = 1;
@@ -1632,7 +1632,7 @@ cfFilterSetCommonOptions(
       *PageLength = pagesize->length;
     else
     {
-      if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "Invalid value for page length: %.0f",
                   pagesize->length);
       corrected = 1;
@@ -1641,7 +1641,7 @@ cfFilterSetCommonOptions(
       *PageTop = pagesize->top;
     else
     {
-      if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "Invalid value for page top margin: %.0f",
                   pagesize->top);
       if (*PageLength >= *PageBottom)
@@ -1654,7 +1654,7 @@ cfFilterSetCommonOptions(
       *PageBottom = pagesize->bottom;
     else
     {
-      if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "Invalid value for page bottom margin: %.0f",
                   pagesize->bottom);
       if (*PageLength <= *PageBottom)
@@ -1663,7 +1663,7 @@ cfFilterSetCommonOptions(
     }
     if (*PageBottom == *PageTop)
     {
-      if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "Invalid values for page margins: Bottom: %.0f; Top: %.0f",
                   *PageBottom, *PageTop);
       *PageTop = *PageLength - *PageBottom;
@@ -1676,7 +1676,7 @@ cfFilterSetCommonOptions(
     }
     if (*PageBottom > *PageTop)
     {
-      if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "Invalid values for page margins: Bottom: %.0f; Top: %.0f",
                   *PageBottom, *PageTop);
       float swap = *PageBottom;
@@ -1689,7 +1689,7 @@ cfFilterSetCommonOptions(
       *PageLeft = pagesize->left;
     else
     {
-      if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "Invalid value for page left margin: %.0f",
                   pagesize->left);
       if (*PageWidth <= *PageLeft)
@@ -1700,7 +1700,7 @@ cfFilterSetCommonOptions(
       *PageRight = pagesize->right;
     else
     {
-      if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "Invalid value for page right margin: %.0f",
                   pagesize->right);
       if (*PageWidth >= *PageLeft)
@@ -1711,7 +1711,7 @@ cfFilterSetCommonOptions(
     }
     if (*PageLeft == *PageRight)
     {
-      if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "Invalid values for page margins: Left: %.0f; Right: %.0f",
                   *PageLeft, *PageRight);
       *PageRight = *PageWidth - *PageLeft;
@@ -1724,7 +1724,7 @@ cfFilterSetCommonOptions(
     }
     if (*PageLeft > *PageRight)
     {
-      if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "Invalid values for page margins: Left: %.0f; Right: %.0f",
                   *PageLeft, *PageRight);
       float swap = *PageLeft;
@@ -1735,17 +1735,17 @@ cfFilterSetCommonOptions(
 
     if (corrected)
     {
-      if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "PPD Page = %.0fx%.0f; %.0f,%.0f to %.0f,%.0f",
                   pagesize->width, pagesize->length, pagesize->left,
                   pagesize->bottom, pagesize->right, pagesize->top);
-      if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "Corrected Page = %.0fx%.0f; %.0f,%.0f to %.0f,%.0f",
                   *PageWidth, *PageLength, *PageLeft,
                   *PageBottom, *PageRight, *PageTop);
     }
     else
-      if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+      if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "Page = %.0fx%.0f; %.0f,%.0f to %.0f,%.0f",
                   pagesize->width, pagesize->length, pagesize->left,
                   pagesize->bottom, pagesize->right, pagesize->top);
index 7a3853c4aa829621f13d10ae0cee07621ac033ae..e9f517115afc8d11f246b1f3220246cd0ca329b1 100644 (file)
@@ -60,7 +60,7 @@ typedef struct cf_filter_data_s {
   ppd_file_t *ppd;           /* PPD file data */
   int back_pipe[2];          /* File descriptors of backchannel pipe */
   int side_pipe[2];          /* File descriptors of sidechannel pipe */
-  filter_logfunc_t logfunc;  /* Logging function, NULL for no logging */
+  cf_logfunc_t logfunc;  /* Logging function, NULL for no logging */
   void *logdata;             /* User data for logging function, can be NULL */
   cf_filter_iscanceledfunc_t iscanceledfunc; /* Function returning 1 when
                                                job is canceled, NULL for not
@@ -138,7 +138,7 @@ typedef struct cf_filter_universal_parameter_s { /* Contains input and output
  */
 
 extern void cfCUPSLogFunc(void *data,
-                         filter_loglevel_t level,
+                         cf_loglevel_t level,
                          const char *message,
                          ...);
 
@@ -425,7 +425,7 @@ extern void cfFilterSetCommonOptions(ppd_file_t *ppd,
                                     float *PageBottom,
                                     float *PageWidth,
                                     float *PageLength,
-                                    filter_logfunc_t log,
+                                    cf_logfunc_t log,
                                     void *ld);
 
 
index f70ab8832e63396fd4bfa22e80deabd513dae337..9eab20d1708b9a3d5c596f046c686b3f07d76fc0 100644 (file)
@@ -389,7 +389,7 @@ gs_spawn (const char *filename,
           char **envp,
           FILE *fp,
          int outputfd,
-         filter_logfunc_t log,
+         cf_logfunc_t log,
          void *ld,
          cf_filter_iscanceledfunc_t iscanceled,
          void *icd)
@@ -404,7 +404,7 @@ gs_spawn (const char *filename,
   int numargs;
   int pid, gspid, errpid;
   cups_file_t *logfp;
-  filter_loglevel_t log_level;
+  cf_loglevel_t log_level;
   char *msg;
   int status = 65536;
   int wstatus;
@@ -431,10 +431,10 @@ gs_spawn (const char *filename,
       snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf),
               " %s%s%s", apos, gsargv[i], apos);
     }
-    log(ld, FILTER_LOGLEVEL_DEBUG, "%s", buf);
+    log(ld, CF_LOGLEVEL_DEBUG, "%s", buf);
 
     for (i = 0; envp[i]; i ++)
-      log(ld, FILTER_LOGLEVEL_DEBUG,
+      log(ld, CF_LOGLEVEL_DEBUG,
          "cfFilterGhostscript: envp[%d]=\"%s\"", i, envp[i]);
   }
 
@@ -443,7 +443,7 @@ gs_spawn (const char *filename,
   {
     infds[0] = -1;
     infds[1] = -1;
-    if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+    if (log) log(ld, CF_LOGLEVEL_ERROR,
                 "cfFilterGhostscript: Unable to establish stdin pipe for Ghostscript call");
     goto out;
   }
@@ -453,7 +453,7 @@ gs_spawn (const char *filename,
   {
     errfds[0] = -1;
     errfds[1] = -1;
-    if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+    if (log) log(ld, CF_LOGLEVEL_ERROR,
                 "cfFilterGhostscript: Unable to establish stderr pipe for Ghostscript call");
     goto out;
   }
@@ -465,7 +465,7 @@ gs_spawn (const char *filename,
     close(infds[1]);
     infds[0] = -1;
     infds[1] = -1;
-    if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+    if (log) log(ld, CF_LOGLEVEL_ERROR,
                 "cfFilterGhostscript: Unable to set \"close on exec\" flag on read end of the stdin pipe for Ghostscript call");
     goto out;
   }
@@ -473,7 +473,7 @@ gs_spawn (const char *filename,
   {
     close(infds[0]);
     close(infds[1]);
-    if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+    if (log) log(ld, CF_LOGLEVEL_ERROR,
                 "cfFilterGhostscript: Unable to set \"close on exec\" flag on write end of the stdin pipe for Ghostscript call");
     goto out;
   }
@@ -483,7 +483,7 @@ gs_spawn (const char *filename,
     close(errfds[1]);
     errfds[0] = -1;
     errfds[1] = -1;
-    if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+    if (log) log(ld, CF_LOGLEVEL_ERROR,
                 "cfFilterGhostscript: Unable to set \"close on exec\" flag on read end of the stderr pipe for Ghostscript call");
     goto out;
   }
@@ -491,7 +491,7 @@ gs_spawn (const char *filename,
   {
     close(errfds[0]);
     close(errfds[1]);
-    if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+    if (log) log(ld, CF_LOGLEVEL_ERROR,
                 "cfFilterGhostscript: Unable to set \"close on exec\" flag on write end of the stderr pipe for Ghostscript call");
     goto out;
   }
@@ -502,7 +502,7 @@ gs_spawn (const char *filename,
     if (infds[0] >= 0) {
       if (infds[0] != 0) {
        if (dup2(infds[0], 0) < 0) {
-         if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+         if (log) log(ld, CF_LOGLEVEL_ERROR,
                       "cfFilterGhostscript: Unable to couple pipe with stdin of Ghostscript process");
          exit(1);
        }
@@ -510,7 +510,7 @@ gs_spawn (const char *filename,
       }
       close(infds[1]);
     } else {
-      if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "cfFilterGhostscript: invalid pipe file descriptor to couple with stdin of Ghostscript process");
       exit(1);
     }
@@ -519,7 +519,7 @@ gs_spawn (const char *filename,
     if (errfds[1] >= 2) {
       if (errfds[1] != 2) {
        if (dup2(errfds[1], 2) < 0) {
-         if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+         if (log) log(ld, CF_LOGLEVEL_ERROR,
                       "cfFilterGhostscript: Unable to couple pipe with stderr of Ghostscript process");
          exit(1);
        }
@@ -527,7 +527,7 @@ gs_spawn (const char *filename,
       }
       close(errfds[0]);
     } else {
-      if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "cfFilterGhostscript: invalid pipe file descriptor to couple with stderr of Ghostscript process");
       exit(1);
     }
@@ -536,26 +536,26 @@ gs_spawn (const char *filename,
     if (outputfd >= 1) {
       if (outputfd != 1) {
        if (dup2(outputfd, 1) < 0) {
-         if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+         if (log) log(ld, CF_LOGLEVEL_ERROR,
                       "cfFilterGhostscript: Unable to couple stdout of Ghostscript process");
          exit(1);
        }
        close(outputfd);
       }
     } else {
-      if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "cfFilterGhostscript: Invalid file descriptor to couple with stdout of Ghostscript process");
       exit(1);
     }
 
     /* Execute Ghostscript command line ... */
     execvpe(filename, gsargv, envp);
-    if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+    if (log) log(ld, CF_LOGLEVEL_ERROR,
                 "cfFilterGhostscript: Unable to launch Ghostscript: %s: %s",
                 filename, strerror(errno));
     exit(1);
   }
-  if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+  if (log) log(ld, CF_LOGLEVEL_DEBUG,
               "cfFilterGhostscript: Started Ghostscript (PID %d)", gspid);
 
   close(infds[0]);
@@ -568,22 +568,22 @@ gs_spawn (const char *filename,
     while (cupsFileGets(logfp, buf, sizeof(buf)))
       if (log) {
        if (strncmp(buf, "DEBUG: ", 7) == 0) {
-         log_level = FILTER_LOGLEVEL_DEBUG;
+         log_level = CF_LOGLEVEL_DEBUG;
          msg = buf + 7;
        } else if (strncmp(buf, "DEBUG2: ", 8) == 0) {
-         log_level = FILTER_LOGLEVEL_DEBUG;
+         log_level = CF_LOGLEVEL_DEBUG;
          msg = buf + 8;
        } else if (strncmp(buf, "INFO: ", 6) == 0) {
-         log_level = FILTER_LOGLEVEL_INFO;
+         log_level = CF_LOGLEVEL_INFO;
          msg = buf + 6;
        } else if (strncmp(buf, "WARNING: ", 9) == 0) {
-         log_level = FILTER_LOGLEVEL_WARN;
+         log_level = CF_LOGLEVEL_WARN;
          msg = buf + 9;
        } else if (strncmp(buf, "ERROR: ", 7) == 0) {
-         log_level = FILTER_LOGLEVEL_ERROR;
+         log_level = CF_LOGLEVEL_ERROR;
          msg = buf + 7;
        } else {
-         log_level = FILTER_LOGLEVEL_DEBUG;
+         log_level = CF_LOGLEVEL_DEBUG;
          msg = buf;
        }
        log(ld, log_level, "cfFilterGhostscript: %s", msg);
@@ -594,7 +594,7 @@ gs_spawn (const char *filename,
     /* Ignore errors of the logging process */
     exit(0);
   }
-  if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+  if (log) log(ld, CF_LOGLEVEL_DEBUG,
               "cfFilterGhostscript: Started logging (PID %d)", errpid);
 
   close(errfds[0]);
@@ -609,22 +609,22 @@ gs_spawn (const char *filename,
       if (count == -1) {
         if (errno == EINTR)
           goto retry_write;
-       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+       if (log) log(ld, CF_LOGLEVEL_ERROR,
                     "cfFilterGhostscript: write failed: %s", strerror(errno));
       }
-      if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "cfFilterGhostscript: Can't feed job data into Ghostscript");
       goto out;
     }
   }
   close (infds[1]);
-  if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+  if (log) log(ld, CF_LOGLEVEL_DEBUG,
               "cfFilterGhostscript: Input data feed completed");
 
   while (gspid > 0 || errpid > 0) {
     if ((pid = wait(&wstatus)) < 0) {
       if (errno == EINTR && iscanceled && iscanceled(icd)) {
-       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+       if (log) log(ld, CF_LOGLEVEL_DEBUG,
                     "cfFilterGhostscript: Job canceled, killing Ghostscript ...");
        kill(gspid, SIGTERM);
        gspid = -1;
@@ -639,21 +639,21 @@ gs_spawn (const char *filename,
     if (wstatus) {
       if (WIFEXITED(wstatus)) {
        /* Via exit() anywhere or return() in the main() function */
-       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+       if (log) log(ld, CF_LOGLEVEL_ERROR,
                     "cfFilterGhostscript: %s (PID %d) stopped with status %d",
                     (pid == gspid ? "Ghostscript" : "Logging"), pid,
                     WEXITSTATUS(wstatus));
        status = WEXITSTATUS(wstatus);
       } else {
        /* Via signal */
-       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+       if (log) log(ld, CF_LOGLEVEL_ERROR,
                     "cfFilterGhostscript: %s (PID %d) crashed on signal %d",
                     (pid == gspid ? "Ghostscript" : "Logging"), pid,
                     WTERMSIG(wstatus));
        status = 256 * WTERMSIG(wstatus);
       }
     } else {
-      if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+      if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "cfFilterGhostscript: %s (PID %d) exited with no errors.",
                   (pid == gspid ? "Ghostscript" : "Logging"), pid);
       status = 0;
@@ -713,7 +713,7 @@ cfFilterGhostscript(int inputfd,            /* I - File descriptor input
   int pxlcolor = 0; /* 1 if printer is color printer otherwise 0. */
   ppd_attr_t *attr;
   ipp_attribute_t *ipp_attr;
-  filter_logfunc_t log = data->logfunc;
+  cf_logfunc_t log = data->logfunc;
   void          *ld = data->logdata;
   cf_filter_iscanceledfunc_t iscanceled = data->iscanceledfunc;
   void          *icd = data->iscanceleddata;
@@ -740,7 +740,7 @@ cfFilterGhostscript(int inputfd,            /* I - File descriptor input
   } else
     outformat = CF_FILTER_OUT_FORMAT_CUPS_RASTER;
 
-  if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+  if (log) log(ld, CF_LOGLEVEL_DEBUG,
               "cfFilterGhostscript: Output format: %s",
               (outformat == CF_FILTER_OUT_FORMAT_CUPS_RASTER ? "CUPS Raster" :
                (outformat == CF_FILTER_OUT_FORMAT_PWG_RASTER ? "PWG Raster" :
@@ -801,7 +801,7 @@ cfFilterGhostscript(int inputfd,            /* I - File descriptor input
   {
     if (!iscanceled || !iscanceled(icd))
     {
-      if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+      if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "cfFilterGhostscript: Unable to open input data stream.");
     }
 
@@ -834,13 +834,13 @@ cfFilterGhostscript(int inputfd,            /* I - File descriptor input
     if (!inputseekable || doc_type == GS_DOC_TYPE_PS) {
       if ((fd = cupsTempFd(tempfile, sizeof(tempfile))) < 0)
       {
-       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+       if (log) log(ld, CF_LOGLEVEL_ERROR,
                     "cfFilterGhostscript: Unable to copy PDF file: %s", strerror(errno));
        fclose(fp);
        return (1);
       }
 
-      if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+      if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "cfFilterGhostscript: Copying input to temp file \"%s\"",
                   tempfile);
 
@@ -860,7 +860,7 @@ cfFilterGhostscript(int inputfd,            /* I - File descriptor input
       {
        if (!iscanceled || !iscanceled(icd))
         {
-         if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+         if (log) log(ld, CF_LOGLEVEL_DEBUG,
                       "cfFilterGhostscript: Unable to open temporary file.");
        }
 
@@ -873,7 +873,7 @@ cfFilterGhostscript(int inputfd,            /* I - File descriptor input
       doc_type = parse_doc_type(fp);
 
     if (doc_type == GS_DOC_TYPE_EMPTY) {
-      if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+      if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "cfFilterGhostscript: Input is empty, outputting empty file.");
       status = 0;
       if (outformat == CF_FILTER_OUT_FORMAT_CUPS_RASTER ||
@@ -882,7 +882,7 @@ cfFilterGhostscript(int inputfd,            /* I - File descriptor input
        if (write(outputfd, "RaS2", 4)) {};
       goto out;
     } if (doc_type == GS_DOC_TYPE_UNKNOWN) {
-      if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "cfFilterGhostscript: Can't detect file type");
       goto out;
     }
@@ -891,7 +891,7 @@ cfFilterGhostscript(int inputfd,            /* I - File descriptor input
       int pages = pdf_pages_fp(fp);
 
       if (pages == 0) {
-       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+       if (log) log(ld, CF_LOGLEVEL_DEBUG,
                     "cfFilterGhostscript: No pages left, outputting empty file.");
        status = 0;
        if (outformat == CF_FILTER_OUT_FORMAT_CUPS_RASTER ||
@@ -901,7 +901,7 @@ cfFilterGhostscript(int inputfd,            /* I - File descriptor input
        goto out;
       }
       if (pages < 0) {
-       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+       if (log) log(ld, CF_LOGLEVEL_ERROR,
                     "cfFilterGhostscript: Unexpected page count");
        goto out;
       }
@@ -918,7 +918,7 @@ cfFilterGhostscript(int inputfd,            /* I - File descriptor input
     
       FILE *pd = popen(gscommand, "r");
       if (!pd) {
-       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+       if (log) log(ld, CF_LOGLEVEL_ERROR,
                     "cfFilterGhostscript: Failed to execute ghostscript to determine "
                     "number of input pages!");
        goto out;
@@ -931,7 +931,7 @@ cfFilterGhostscript(int inputfd,            /* I - File descriptor input
        pagecount = -1;
 
       if (pagecount == 0) {
-       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+       if (log) log(ld, CF_LOGLEVEL_DEBUG,
                     "cfFilterGhostscript: No pages left, outputting empty file.");
        status = 0;
        if (outformat == CF_FILTER_OUT_FORMAT_CUPS_RASTER ||
@@ -941,7 +941,7 @@ cfFilterGhostscript(int inputfd,            /* I - File descriptor input
        goto out;
       }
       if (pagecount < 0) {
-       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+       if (log) log(ld, CF_LOGLEVEL_ERROR,
                     "cfFilterGhostscript: Unexpected page count");
        goto out;
       }
@@ -953,7 +953,7 @@ cfFilterGhostscript(int inputfd,            /* I - File descriptor input
       filename = NULL;
     }
 
-    if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "cfFilterGhostscript: Input format: %s",
                 (doc_type == GS_DOC_TYPE_PDF ? "PDF" :
                  (doc_type == GS_DOC_TYPE_PS ? "PostScript" :
@@ -963,15 +963,15 @@ cfFilterGhostscript(int inputfd,            /* I - File descriptor input
   else
   {
     doc_type = GS_DOC_TYPE_UNKNOWN;
-    if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "cfFilterGhostscript: Input format: Not determined");
-    if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "cfFilterGhostscript: Streaming mode, no checks for input format, zero-page input, instructions from previous filter");
   }
 
   /* Find print-rendering-intent */
   getPrintRenderIntent(data, &h);
-  if(log) log(ld, FILTER_LOGLEVEL_DEBUG,
+  if(log) log(ld, CF_LOGLEVEL_DEBUG,
              "Print rendering intent = %s", h.cupsRenderingIntent);
 
   /*  Check status of color management in CUPS */
@@ -988,7 +988,7 @@ cfFilterGhostscript(int inputfd,            /* I - File descriptor input
   /* Ghostscript parameters */
   gs_args = cupsArrayNew(NULL, NULL);
   if (!gs_args) {
-    if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+    if (log) log(ld, CF_LOGLEVEL_ERROR,
                 "cfFilterGhostscript: Unable to allocate memory for Ghostscript arguments array");
     goto out;
   }
@@ -1468,12 +1468,12 @@ cfFilterGhostscript(int inputfd,            /* I - File descriptor input
        !strcasecmp(attr->value, "yes"))) ||
       (t && (!strcasecmp(t, "true") || !strcasecmp(t, "on") ||
             !strcasecmp(t, "yes")))) {
-    if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "cfFilterGhostscript: Ghostscript using Center-of-Pixel method to "
                 "fill paths.");
     cupsArrayAdd(gs_args, strdup("0 0 .setfilladjust2"));
   } else
-    if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "cfFilterGhostscript: Ghostscript using Any-Part-of-Pixel method to "
                 "fill paths.");
 
index f9c20c8ee45b61375219351059e49734de8db614..e21b396fdc477bc89e5e81bb148888e8aabe3f9f 100644 (file)
@@ -727,7 +727,7 @@ cfFilterImageToPDF(int inputfd,         /* I - File descriptor input stream */
   int          pl, pr;
   int          fillprint = 0;          /* print-scaling = fill */
   int          cropfit = 0;            /* -o crop-to-fit = true */
-  filter_logfunc_t log = data->logfunc;
+  cf_logfunc_t log = data->logfunc;
   void          *ld = data->logdata;
   cf_filter_iscanceledfunc_t iscanceled = data->iscanceledfunc;
   void          *icd = data->iscanceleddata;
@@ -778,7 +778,7 @@ cfFilterImageToPDF(int inputfd,         /* I - File descriptor input stream */
   {
     if (!iscanceled || !iscanceled(icd))
     {
-      if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "cfFilterImageToPDF: Unable to open input data stream.");
     }
 
@@ -792,14 +792,14 @@ cfFilterImageToPDF(int inputfd,         /* I - File descriptor input stream */
   if (!inputseekable) {
     if ((fd = cupsTempFd(tempfile, sizeof(tempfile))) < 0)
     {
-      if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "cfFilterImageToPDF: Unable to copy input: %s",
                   strerror(errno));
       fclose(fp);
       return (1);
     }
 
-    if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "cfFilterImageToPDF: Copying input to temp file \"%s\"",
                 tempfile);
 
@@ -817,7 +817,7 @@ cfFilterImageToPDF(int inputfd,         /* I - File descriptor input stream */
     {
       if (!iscanceled || !iscanceled(icd))
       {
-       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+       if (log) log(ld, CF_LOGLEVEL_ERROR,
                     "cfFilterImageToPDF: Unable to open temporary file.");
       }
 
@@ -834,7 +834,7 @@ cfFilterImageToPDF(int inputfd,         /* I - File descriptor input stream */
   {
     if (!iscanceled || !iscanceled(icd))
     {
-      if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "cfFilterImageToPDF: Unable to open output data stream.");
     }
 
@@ -1376,7 +1376,7 @@ cfFilterImageToPDF(int inputfd,         /* I - File descriptor input stream */
 
   if (doc.img == NULL)
   {
-    if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+    if (log) log(ld, CF_LOGLEVEL_ERROR,
                 "cfFilterImageToPDF: Unable to open image file for printing!");
     fclose(doc.outputfp);
     close(outputfd);
@@ -1398,7 +1398,7 @@ cfFilterImageToPDF(int inputfd,         /* I - File descriptor input stream */
   if (yppi == 0)
     yppi = xppi;
 
-  if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+  if (log) log(ld, CF_LOGLEVEL_DEBUG,
               "cfFilterImageToPDF: Before scaling: xppi=%d, yppi=%d, zoom=%.2f",
               xppi, yppi, zoom);
 
@@ -1419,14 +1419,14 @@ cfFilterImageToPDF(int inputfd,         /* I - File descriptor input stream */
       doc.yprint = (doc.PageTop - doc.PageBottom) / 72.0;
     }
 
-    if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "cfFilterImageToPDF: Before scaling: xprint=%.1f, yprint=%.1f",
                 doc.xprint, doc.yprint);
 
     doc.xinches = (float)cfImageGetWidth(doc.img) / (float)xppi;
     doc.yinches = (float)cfImageGetHeight(doc.img) / (float)yppi;
 
-    if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "cfFilterImageToPDF: Image size is %.1f x %.1f inches...",
                 doc.xinches, doc.yinches);
 
@@ -1443,7 +1443,7 @@ cfFilterImageToPDF(int inputfd,         /* I - File descriptor input stream */
       * Rotate the image if it will fit landscape but not portrait...
       */
 
-      if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+      if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "cfFilterImageToPDF: Auto orientation...");
 
       if ((doc.xinches > doc.xprint || doc.yinches > doc.yprint) &&
@@ -1453,7 +1453,7 @@ cfFilterImageToPDF(int inputfd,         /* I - File descriptor input stream */
        * Rotate the image as needed...
        */
 
-       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+       if (log) log(ld, CF_LOGLEVEL_DEBUG,
                     "cfFilterImageToPDF: Using landscape orientation...");
 
        doc.Orientation = (doc.Orientation + 1) & 3;
@@ -1474,11 +1474,11 @@ cfFilterImageToPDF(int inputfd,         /* I - File descriptor input stream */
     doc.aspect = (float)cfImageGetYPPI(doc.img) /
       (float)cfImageGetXPPI(doc.img);
 
-    if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "cfFilterImageToPDF: Before scaling: xprint=%.1f, yprint=%.1f",
                 doc.xprint, doc.yprint);
 
-    if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "cfFilterImageToPDF: cfImageGetXPPI(img) = %d, "
                 "cfImageGetYPPI(img) = %d, aspect = %f",
                 cfImageGetXPPI(doc.img), cfImageGetYPPI(doc.img),
@@ -1506,10 +1506,10 @@ cfFilterImageToPDF(int inputfd,         /* I - File descriptor input stream */
        doc.aspect / cfImageGetHeight(doc.img);
     }
 
-    if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "cfFilterImageToPDF: Portrait size is %.2f x %.2f inches",
                 doc.xsize, doc.ysize);
-    if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "cfFilterImageToPDF: Landscape size is %.2f x %.2f inches",
                 doc.xsize2, doc.ysize2);
 
@@ -1521,7 +1521,7 @@ cfFilterImageToPDF(int inputfd,         /* I - File descriptor input stream */
       * portrait if they are equal...
       */
 
-      if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+      if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "cfFilterImageToPDF: Auto orientation...");
 
       if ((doc.xsize * doc.ysize) < (doc.xsize2 * doc.xsize2))
@@ -1530,7 +1530,7 @@ cfFilterImageToPDF(int inputfd,         /* I - File descriptor input stream */
        * Do landscape orientation...
        */
 
-       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+       if (log) log(ld, CF_LOGLEVEL_DEBUG,
                     "cfFilterImageToPDF: Using landscape orientation...");
 
        doc.Orientation = 1;
@@ -1545,7 +1545,7 @@ cfFilterImageToPDF(int inputfd,         /* I - File descriptor input stream */
        * Do portrait orientation...
        */
 
-       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+       if (log) log(ld, CF_LOGLEVEL_DEBUG,
                     "cfFilterImageToPDF: Using portrait orientation...");
 
        doc.Orientation = 0;
@@ -1555,7 +1555,7 @@ cfFilterImageToPDF(int inputfd,         /* I - File descriptor input stream */
     }
     else if (doc.Orientation & 1)
     {
-      if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+      if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "cfFilterImageToPDF: Using landscape orientation...");
 
       doc.xinches     = doc.xsize2;
@@ -1565,7 +1565,7 @@ cfFilterImageToPDF(int inputfd,         /* I - File descriptor input stream */
     }
     else
     {
-      if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+      if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "cfFilterImageToPDF: Using portrait orientation...");
 
       doc.xinches     = doc.xsize;
@@ -1594,7 +1594,7 @@ cfFilterImageToPDF(int inputfd,         /* I - File descriptor input stream */
   doc.xprint = doc.xinches / doc.xpages;
   doc.yprint = doc.yinches / doc.ypages;
 
-  if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+  if (log) log(ld, CF_LOGLEVEL_DEBUG,
               "cfFilterImageToPDF: xpages = %dx%.2fin, ypages = %dx%.2fin",
               doc.xpages, doc.xprint, doc.ypages, doc.yprint);
 
@@ -1671,7 +1671,7 @@ cfFilterImageToPDF(int inputfd,         /* I - File descriptor input stream */
          length = min_length;
     }
 
-    if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "cfFilterImageToPDF: Updated custom page size to %.2f x %.2f "
                 "inches...",
                 width / 72.0, length / 72.0);
@@ -1877,15 +1877,15 @@ cfFilterImageToPDF(int inputfd,         /* I - File descriptor input stream */
   doc.row = malloc(cfImageGetWidth(doc.img) * abs(doc.colorspace) + 3);
 
   if (log) {
-    log(ld, FILTER_LOGLEVEL_DEBUG,
+    log(ld, CF_LOGLEVEL_DEBUG,
        "cfFilterImageToPDF: XPosition=%d, YPosition=%d, Orientation=%d",
        doc.XPosition, doc.YPosition, doc.Orientation);
-    log(ld, FILTER_LOGLEVEL_DEBUG,
+    log(ld, CF_LOGLEVEL_DEBUG,
        "cfFilterImageToPDF: xprint=%.2f, yprint=%.2f", doc.xprint, doc.yprint);
-    log(ld, FILTER_LOGLEVEL_DEBUG,
+    log(ld, CF_LOGLEVEL_DEBUG,
        "cfFilterImageToPDF: PageLeft=%.0f, PageRight=%.0f, PageWidth=%.0f",
        doc.PageLeft, doc.PageRight, doc.PageWidth);
-    log(ld, FILTER_LOGLEVEL_DEBUG,
+    log(ld, CF_LOGLEVEL_DEBUG,
        "cfFilterImageToPDF: PageBottom=%.0f, PageTop=%.0f, PageLength=%.0f",
        doc.PageBottom, doc.PageTop, doc.PageLength);
   }
@@ -2013,7 +2013,7 @@ cfFilterImageToPDF(int inputfd,         /* I - File descriptor input stream */
        break;
   }
 
-  if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+  if (log) log(ld, CF_LOGLEVEL_DEBUG,
               "cfFilterImageToPDF: left=%.2f, top=%.2f", doc.left, doc.top);
 
   if (doc.Collate)
@@ -2023,13 +2023,13 @@ cfFilterImageToPDF(int inputfd,         /* I - File descriptor input stream */
 
     if ((contentsObjs = malloc(sizeof(int)*doc.xpages*doc.ypages)) == NULL)
     {
-      if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "cfFilterImageToPDF: Can't allocate contentsObjs");
       goto out_of_memory;
     }
     if ((imgObjs = malloc(sizeof(int)*doc.xpages*doc.ypages)) == NULL)
     {
-      if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "cfFilterImageToPDF: Can't allocate imgObjs");
       goto out_of_memory;
     }
@@ -2041,7 +2041,7 @@ cfFilterImageToPDF(int inputfd,         /* I - File descriptor input stream */
 
        if (iscanceled && iscanceled(icd))
        {
-         if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+         if (log) log(ld, CF_LOGLEVEL_DEBUG,
                       "cfFilterImageToPDF: Job canceled");
          goto canceled;
        }
@@ -2067,7 +2067,7 @@ cfFilterImageToPDF(int inputfd,         /* I - File descriptor input stream */
        {
          if (iscanceled && iscanceled(icd))
          {
-           if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+           if (log) log(ld, CF_LOGLEVEL_DEBUG,
                         "cfFilterImageToPDF: Job canceled");
            goto canceled;
          }
@@ -2078,7 +2078,7 @@ cfFilterImageToPDF(int inputfd,         /* I - File descriptor input stream */
                            imgObjs[doc.ypages * doc.xpage + doc.ypage]) < 0)
            goto out_of_memory;
          if (pdf_printer && log)
-           log(ld, FILTER_LOGLEVEL_CONTROL,
+           log(ld, CF_LOGLEVEL_CONTROL,
                "PAGE: %d %d\n", doc.page+1, 1);
        }
       if (doc.EvenDuplex) {
@@ -2086,7 +2086,7 @@ cfFilterImageToPDF(int inputfd,         /* I - File descriptor input stream */
        if (outPageObject(&doc, doc.pageObjects[doc.page], -1, -1) < 0)
          goto out_of_memory;
        if (pdf_printer && log)
-         log(ld, FILTER_LOGLEVEL_CONTROL,
+         log(ld, CF_LOGLEVEL_CONTROL,
              "PAGE: %d %d\n", doc.page+1, 1);
       }
     }
@@ -2104,7 +2104,7 @@ cfFilterImageToPDF(int inputfd,         /* I - File descriptor input stream */
 
        if (iscanceled && iscanceled(icd))
        {
-         if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+         if (log) log(ld, CF_LOGLEVEL_DEBUG,
                       "cfFilterImageToPDF: Job canceled");
          goto canceled;
        }
@@ -2126,7 +2126,7 @@ cfFilterImageToPDF(int inputfd,         /* I - File descriptor input stream */
        {
          if (iscanceled && iscanceled(icd))
          {
-           if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+           if (log) log(ld, CF_LOGLEVEL_DEBUG,
                         "cfFilterImageToPDF: Job canceled");
            goto canceled;
          }
@@ -2136,7 +2136,7 @@ cfFilterImageToPDF(int inputfd,         /* I - File descriptor input stream */
                            imgObj) < 0)
            goto out_of_memory;
          if (pdf_printer && log)
-           log(ld, FILTER_LOGLEVEL_CONTROL,
+           log(ld, CF_LOGLEVEL_CONTROL,
                "PAGE: %d %d\n", doc.page+1, 1);
        }
       }
@@ -2148,7 +2148,7 @@ cfFilterImageToPDF(int inputfd,         /* I - File descriptor input stream */
       {
        if (iscanceled && iscanceled(icd))
        {
-         if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+         if (log) log(ld, CF_LOGLEVEL_DEBUG,
                       "cfFilterImageToPDF: Job canceled");
          goto canceled;
        }
@@ -2156,7 +2156,7 @@ cfFilterImageToPDF(int inputfd,         /* I - File descriptor input stream */
        if (outPageObject(&doc, doc.pageObjects[doc.page], -1, -1) < 0)
          goto out_of_memory;
        if (pdf_printer && log)
-         log(ld, FILTER_LOGLEVEL_CONTROL,
+         log(ld, CF_LOGLEVEL_CONTROL,
              "PAGE: %d %d\n", doc.page+1, 1);
       }
     }
@@ -2185,7 +2185,7 @@ cfFilterImageToPDF(int inputfd,         /* I - File descriptor input stream */
 
  out_of_memory:
 
-  if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+  if (log) log(ld, CF_LOGLEVEL_ERROR,
               "cfFilterImageToPDF: Cannot allocate any more memory.");
   freeAllObj(&doc);
   cfImageClose(doc.img);
index 71eaab7dd83d5239a8bfb45e787946720f61aa6e..a93a424bcade1225bb37775466c91cc8962aab76 100644 (file)
@@ -139,7 +139,7 @@ cfFilterImageToPS(int inputfd,         /* I - File descriptor input stream */
   int           fd;                    /* File descriptor for temp file */
   char          buf[BUFSIZ];
   int           bytes;
-  filter_logfunc_t log = data->logfunc;
+  cf_logfunc_t log = data->logfunc;
   void          *ld = data->logdata;
   cf_filter_iscanceledfunc_t iscanceled = data->iscanceledfunc;
   void          *icd = data->iscanceleddata;
@@ -175,7 +175,7 @@ cfFilterImageToPS(int inputfd,         /* I - File descriptor input stream */
   {
     if (!iscanceled || !iscanceled(icd))
     {
-      if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "cfFilterImageToPS: Unable to open input data stream.");
     }
 
@@ -189,13 +189,13 @@ cfFilterImageToPS(int inputfd,         /* I - File descriptor input stream */
   if (!inputseekable) {
     if ((fd = cupsTempFd(tempfile, sizeof(tempfile))) < 0)
     {
-      if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "cfFilterImageToPS: Unable to copy input: %s",
                   strerror(errno));
       return (1);
     }
 
-    if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "cfFilterImageToPS: Copying input to temp file \"%s\"",
                 tempfile);
 
@@ -213,7 +213,7 @@ cfFilterImageToPS(int inputfd,         /* I - File descriptor input stream */
     {
       if (!iscanceled || !iscanceled(icd))
       {
-       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+       if (log) log(ld, CF_LOGLEVEL_ERROR,
                     "cfFilterImageToPS: Unable to open temporary file.");
       }
 
@@ -230,7 +230,7 @@ cfFilterImageToPS(int inputfd,         /* I - File descriptor input stream */
   {
     if (!iscanceled || !iscanceled(icd))
     {
-      if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "cfFilterImageToPS: Unable to open output data stream.");
     }
 
@@ -642,7 +642,7 @@ cfFilterImageToPS(int inputfd,         /* I - File descriptor input stream */
 
   if (img == NULL)
   {
-    if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+    if (log) log(ld, CF_LOGLEVEL_ERROR,
                 "cfFilterImageToPS: The print file could not be opened - %s",
                 strerror(errno));
     return (1);
@@ -663,7 +663,7 @@ cfFilterImageToPS(int inputfd,         /* I - File descriptor input stream */
   if (yppi == 0)
     yppi = xppi;
 
-  if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+  if (log) log(ld, CF_LOGLEVEL_DEBUG,
               "cfFilterImageToPS: Before scaling: xppi=%d, yppi=%d, zoom=%.2f",
               xppi, yppi, zoom);
 
@@ -684,14 +684,14 @@ cfFilterImageToPS(int inputfd,         /* I - File descriptor input stream */
       yprint = (doc.PageTop - doc.PageBottom) / 72.0;
     }
 
-    if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "cfFilterImageToPS: Before scaling: xprint=%.1f, yprint=%.1f",
                 xprint, yprint);
 
     xinches = (float)cfImageGetWidth(img) / (float)xppi;
     yinches = (float)cfImageGetHeight(img) / (float)yppi;
 
-    if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "cfFilterImageToPS: Image size is %.1f x %.1f inches...",
                 xinches, yinches);
 
@@ -708,7 +708,7 @@ cfFilterImageToPS(int inputfd,         /* I - File descriptor input stream */
       * Rotate the image if it will fit landscape but not portrait...
       */
 
-      if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+      if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "cfFilterImageToPS: Auto orientation...");
 
       if ((xinches > xprint || yinches > yprint) &&
@@ -718,7 +718,7 @@ cfFilterImageToPS(int inputfd,         /* I - File descriptor input stream */
        * Rotate the image as needed...
        */
 
-       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+       if (log) log(ld, CF_LOGLEVEL_DEBUG,
                     "cfFilterImageToPS: Using landscape orientation...");
 
        doc.Orientation = (doc.Orientation + 1) & 3;
@@ -738,11 +738,11 @@ cfFilterImageToPS(int inputfd,         /* I - File descriptor input stream */
     yprint = (doc.PageTop - doc.PageBottom) / 72.0;
     aspect = (float)cfImageGetYPPI(img) / (float)cfImageGetXPPI(img);
 
-    if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "cfFilterImageToPS: Before scaling: xprint=%.1f, yprint=%.1f",
                 xprint, yprint);
 
-    if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "cfFilterImageToPS: cfImageGetXPPI(img) = %d, "
                 "cfImageGetYPPI(img) = %d, aspect = %f",
                 cfImageGetXPPI(img), cfImageGetYPPI(img), aspect);
@@ -768,10 +768,10 @@ cfFilterImageToPS(int inputfd,         /* I - File descriptor input stream */
        cfImageGetHeight(img);
     }
 
-    if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "cfFilterImageToPS: Portrait size is %.2f x %.2f inches",
                 xsize, ysize);
-    if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "cfFilterImageToPS: Landscape size is %.2f x %.2f inches",
                 xsize2, ysize2);
 
@@ -783,7 +783,7 @@ cfFilterImageToPS(int inputfd,         /* I - File descriptor input stream */
       * portrait if they are equal...
       */
 
-      if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+      if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "cfFilterImageToPS: Auto orientation...");
 
       if ((xsize * ysize) < (xsize2 * xsize2))
@@ -792,7 +792,7 @@ cfFilterImageToPS(int inputfd,         /* I - File descriptor input stream */
        * Do landscape orientation...
        */
 
-       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+       if (log) log(ld, CF_LOGLEVEL_DEBUG,
                     "cfFilterImageToPS: Using landscape orientation...");
 
        doc.Orientation = 1;
@@ -807,7 +807,7 @@ cfFilterImageToPS(int inputfd,         /* I - File descriptor input stream */
        * Do portrait orientation...
        */
 
-       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+       if (log) log(ld, CF_LOGLEVEL_DEBUG,
                     "cfFilterImageToPS: Using portrait orientation...");
 
        doc.Orientation = 0;
@@ -817,7 +817,7 @@ cfFilterImageToPS(int inputfd,         /* I - File descriptor input stream */
     }
     else if (doc.Orientation & 1)
     {
-      if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+      if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "cfFilterImageToPS: Using landscape orientation...");
 
       xinches     = xsize2;
@@ -827,7 +827,7 @@ cfFilterImageToPS(int inputfd,         /* I - File descriptor input stream */
     }
     else
     {
-      if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+      if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "cfFilterImageToPS: Using portrait orientation...");
 
       xinches     = xsize;
@@ -848,7 +848,7 @@ cfFilterImageToPS(int inputfd,         /* I - File descriptor input stream */
   xprint = xinches / xpages;
   yprint = yinches / ypages;
 
-  if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+  if (log) log(ld, CF_LOGLEVEL_DEBUG,
               "cfFilterImageToPS: xpages = %dx%.2fin, ypages = %dx%.2fin",
               xpages, xprint, ypages, yprint);
 
@@ -896,7 +896,7 @@ cfFilterImageToPS(int inputfd,         /* I - File descriptor input stream */
     if (length < ppd->custom_min[1])
       length = ppd->custom_min[1];
 
-    if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "cfFilterImageToPS: Updated custom page size to %.2f x %.2f inches...",
                 width / 72.0, length / 72.0);
 
@@ -1040,7 +1040,7 @@ cfFilterImageToPS(int inputfd,         /* I - File descriptor input stream */
   row = malloc(cfImageGetWidth(img) * abs(colorspace) + 3);
   if (row == NULL)
   {
-    log(ld, FILTER_LOGLEVEL_ERROR,
+    log(ld, CF_LOGLEVEL_ERROR,
        "cfFilterImageToPS: Could not allocate memory.");
     cfImageClose(img);
     return (2);
@@ -1048,15 +1048,15 @@ cfFilterImageToPS(int inputfd,         /* I - File descriptor input stream */
 
   if (log)
   {
-    log(ld, FILTER_LOGLEVEL_DEBUG,
+    log(ld, CF_LOGLEVEL_DEBUG,
        "cfFilterImageToPS: XPosition=%d, YPosition=%d, Orientation=%d",
        XPosition, YPosition, doc.Orientation);
-    log(ld, FILTER_LOGLEVEL_DEBUG,
+    log(ld, CF_LOGLEVEL_DEBUG,
        "cfFilterImageToPS: xprint=%.1f, yprint=%.1f", xprint, yprint);
-    log(ld, FILTER_LOGLEVEL_DEBUG,
+    log(ld, CF_LOGLEVEL_DEBUG,
        "cfFilterImageToPS: PageLeft=%.0f, PageRight=%.0f, PageWidth=%.0f",
        doc.PageLeft, doc.PageRight, doc.PageWidth);
-    log(ld, FILTER_LOGLEVEL_DEBUG,
+    log(ld, CF_LOGLEVEL_DEBUG,
        "cfFilterImageToPS: PageBottom=%.0f, PageTop=%.0f, PageLength=%.0f",
        doc.PageBottom, doc.PageTop, doc.PageLength);
   }
@@ -1176,7 +1176,7 @@ cfFilterImageToPS(int inputfd,         /* I - File descriptor input stream */
        break;
   }
 
-  if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+  if (log) log(ld, CF_LOGLEVEL_DEBUG,
               "cfFilterImageToPS: left=%.2f, top=%.2f", left, top);
 
   for (page = 1; Copies > 0; Copies --)
@@ -1185,16 +1185,16 @@ cfFilterImageToPS(int inputfd,         /* I - File descriptor input stream */
       {
        if (iscanceled && iscanceled(icd))
        {
-         if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+         if (log) log(ld, CF_LOGLEVEL_DEBUG,
                       "cfFilterImageToPS: Job canceled");
          goto canceled;
        }
 
         if (log && ppd && ppd->num_filters == 0)
-         log(ld, FILTER_LOGLEVEL_CONTROL,
+         log(ld, CF_LOGLEVEL_CONTROL,
              "PAGE: %d %d", page, realcopies);
 
-       if (log) log(ld, FILTER_LOGLEVEL_INFO,
+       if (log) log(ld, CF_LOGLEVEL_INFO,
                     "cfFilterImageToPS: Printing page %d.", page);
 
         fprintf(doc.outputfp, "%%%%Page: %d %d\n", page, page);
@@ -1338,7 +1338,7 @@ cfFilterImageToPS(int inputfd,         /* I - File descriptor input stream */
       fputc(0x04, doc.outputfp);
   }
 
-  if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+  if (log) log(ld, CF_LOGLEVEL_DEBUG,
               "cfFilterImageToPS: Printing completed.", page);
 
  /*
index 000bb8b484c5151e816751d4ec9fce5bb65419cd..04847a8688de58fa620494deef1b8b7316241e8e 100644 (file)
@@ -63,7 +63,7 @@ typedef struct {                /**** Document information ****/
         PageLength;            /* Total page length */
   cf_ib_t OnPixels[256],       /* On-pixel LUT */
            OffPixels[256];     /* Off-pixel LUT */
-  filter_logfunc_t logfunc;     /* Logging function, NULL for no
+  cf_logfunc_t logfunc;     /* Logging function, NULL for no
                                   logging */
   void  *logdata;               /* User data for logging function, can
                                   be NULL */
@@ -252,7 +252,7 @@ cfFilterImageToRaster(int inputfd,         /* I - File descriptor input stream *
   int                   cm_disabled;    /* Color management disabled? */
   int                   fillprint = 0; /* print-scaling = fill */
   int                   cropfit = 0;   /* -o crop-to-fit */
-  filter_logfunc_t      log = data->logfunc;
+  cf_logfunc_t      log = data->logfunc;
   void                  *ld = data->logdata;
   cf_filter_iscanceledfunc_t iscanceled = data->iscanceledfunc;
   void                  *icd = data->iscanceleddata;
@@ -290,7 +290,7 @@ cfFilterImageToRaster(int inputfd,         /* I - File descriptor input stream *
   } else
     outformat = CF_FILTER_OUT_FORMAT_CUPS_RASTER;
 
-  if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+  if (log) log(ld, CF_LOGLEVEL_DEBUG,
               "cfFilterImageToRaster: Final output format: %s",
               (outformat == CF_FILTER_OUT_FORMAT_CUPS_RASTER ? "CUPS Raster" :
                (outformat == CF_FILTER_OUT_FORMAT_PWG_RASTER ? "PWG Raster" :
@@ -346,7 +346,7 @@ cfFilterImageToRaster(int inputfd,         /* I - File descriptor input stream *
   {
     if (!iscanceled || !iscanceled(icd))
     {
-      if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+      if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "cfFilterImageToRaster: Unable to open input data stream.");
     }
 
@@ -360,14 +360,14 @@ cfFilterImageToRaster(int inputfd,         /* I - File descriptor input stream *
   if (!inputseekable) {
     if ((fd = cupsTempFd(tempfile, sizeof(tempfile))) < 0)
     {
-      if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "cfFilterImageToRaster: Unable to copy input: %s",
                   strerror(errno));
       fclose(fp);
       return (1);
     }
 
-    if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "cfFilterImageToRaster: Copying input to temp file \"%s\"",
                 tempfile);
 
@@ -385,7 +385,7 @@ cfFilterImageToRaster(int inputfd,         /* I - File descriptor input stream *
     {
       if (!iscanceled || !iscanceled(icd))
       {
-       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+       if (log) log(ld, CF_LOGLEVEL_DEBUG,
                     "cfFilterImageToRaster: Unable to open temporary file.");
       }
 
@@ -440,30 +440,30 @@ cfFilterImageToRaster(int inputfd,         /* I - File descriptor input stream *
 
   if (log)
   {
-    log(ld, FILTER_LOGLEVEL_DEBUG,
+    log(ld, CF_LOGLEVEL_DEBUG,
        "cfFilterImageToRaster: doc.color = %d", doc.Color);
-    log(ld, FILTER_LOGLEVEL_DEBUG,
+    log(ld, CF_LOGLEVEL_DEBUG,
        "cfFilterImageToRaster: doc.Orientation = %d", doc.Orientation);
-    log(ld, FILTER_LOGLEVEL_DEBUG,
+    log(ld, CF_LOGLEVEL_DEBUG,
        "cfFilterImageToRaster: doc.Duplex = %d", doc.Duplex);
-    log(ld, FILTER_LOGLEVEL_DEBUG,
+    log(ld, CF_LOGLEVEL_DEBUG,
        "cfFilterImageToRaster: doc.PageWidth = %.1f", doc.PageWidth);
-    log(ld, FILTER_LOGLEVEL_DEBUG,
+    log(ld, CF_LOGLEVEL_DEBUG,
        "cfFilterImageToRaster: doc.PageLength = %.1f", doc.PageLength);
-    log(ld, FILTER_LOGLEVEL_DEBUG,
+    log(ld, CF_LOGLEVEL_DEBUG,
        "cfFilterImageToRaster: doc.PageLeft = %.1f", doc.PageLeft);
-    log(ld, FILTER_LOGLEVEL_DEBUG,
+    log(ld, CF_LOGLEVEL_DEBUG,
        "cfFilterImageToRaster: doc.PageRight = %.1f", doc.PageRight);
-    log(ld, FILTER_LOGLEVEL_DEBUG,
+    log(ld, CF_LOGLEVEL_DEBUG,
        "cfFilterImageToRaster: doc.PageTop = %.1f", doc.PageTop);
-    log(ld, FILTER_LOGLEVEL_DEBUG,
+    log(ld, CF_LOGLEVEL_DEBUG,
        "cfFilterImageToRaster: doc.PageBottom = %.1f", doc.PageBottom);
   }
 
   /*  Find print-rendering-intent */
 
   getPrintRenderIntent(data, &header);
-  if(log) log(ld, FILTER_LOGLEVEL_DEBUG,
+  if(log) log(ld, CF_LOGLEVEL_DEBUG,
              "cfFilterImageToRaster: Print rendering intent = %s",
              header.cupsRenderingIntent);
 
@@ -666,7 +666,7 @@ cfFilterImageToRaster(int inputfd,         /* I - File descriptor input stream *
   }
   else
     resolution = strdup("300dpi");
-  if(log) log(ld, FILTER_LOGLEVEL_DEBUG, "Resolution = %s", resolution);
+  if(log) log(ld, CF_LOGLEVEL_DEBUG, "Resolution = %s", resolution);
 
   /* support the "cm-calibration" option */
   cm_calibrate = cfCmGetCupsColorCalibrateMode(data, options, num_options);
@@ -778,7 +778,7 @@ cfFilterImageToRaster(int inputfd,         /* I - File descriptor input stream *
     case CUPS_CSPACE_DEVICED :
     case CUPS_CSPACE_DEVICEE :
     case CUPS_CSPACE_DEVICEF :
-        if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+        if (log) log(ld, CF_LOGLEVEL_DEBUG,
                     "cfFilterImageToRaster: Colorspace %d not supported.",
                     header.cupsColorSpace);
        if (!inputseekable)
@@ -818,14 +818,14 @@ cfFilterImageToRaster(int inputfd,         /* I - File descriptor input stream *
   }
   else if (ppd != NULL && !cm_disabled)
   {
-    if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "cfFilterImageToRaster: Searching for profile \"%s/%s\"...",
                 resolution, media_type);
 
     for (i = 0, profile = ppd->profiles; i < ppd->num_profiles;
         i ++, profile ++)
     {
-      if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+      if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "cfFilterImageToRaster: \"%s/%s\" = ", profile->resolution,
                   profile->media_type);
 
@@ -834,12 +834,12 @@ cfFilterImageToRaster(int inputfd,         /* I - File descriptor input stream *
           (strcmp(profile->media_type, media_type) == 0 ||
            profile->media_type[0] == '-'))
       {
-       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+       if (log) log(ld, CF_LOGLEVEL_DEBUG,
                     "cfFilterImageToRaster:    MATCH");
        break;
       }
       else
-       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+       if (log) log(ld, CF_LOGLEVEL_DEBUG,
                     "cfFilterImageToRaster:    no.");
     }
 
@@ -868,7 +868,7 @@ cfFilterImageToRaster(int inputfd,         /* I - File descriptor input stream *
   * Open the input image to print...
   */
 
-  if (log) log(ld, FILTER_LOGLEVEL_INFO,
+  if (log) log(ld, CF_LOGLEVEL_INFO,
               "cfFilterImageToRaster: Loading print file.");
 
   if (header.cupsColorSpace == CUPS_CSPACE_CIEXYZ ||
@@ -1153,7 +1153,7 @@ cfFilterImageToRaster(int inputfd,         /* I - File descriptor input stream *
 
   if (img == NULL)
   {
-    if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+    if (log) log(ld, CF_LOGLEVEL_ERROR,
                 "cfFilterImageToRaster: The print file could not be opened.");
     return (1);
   }
@@ -1171,7 +1171,7 @@ cfFilterImageToRaster(int inputfd,         /* I - File descriptor input stream *
   if (yppi == 0)
     yppi = xppi;
 
-  if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+  if (log) log(ld, CF_LOGLEVEL_DEBUG,
               "cfFilterImageToRaster: Before scaling: xppi=%d, yppi=%d, zoom=%.2f",
               xppi, yppi, zoom);
 
@@ -1192,14 +1192,14 @@ cfFilterImageToRaster(int inputfd,         /* I - File descriptor input stream *
       yprint = (doc.PageTop - doc.PageBottom) / 72.0;
     }
 
-    if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "cfFilterImageToRaster: Before scaling: xprint=%.1f, yprint=%.1f",
                 xprint, yprint);
 
     xinches = (float)img->xsize / (float)xppi;
     yinches = (float)img->ysize / (float)yppi;
 
-    if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "cfFilterImageToRaster: Image size is %.1f x %.1f inches...",
                 xinches, yinches);
 
@@ -1216,7 +1216,7 @@ cfFilterImageToRaster(int inputfd,         /* I - File descriptor input stream *
       * Rotate the image if it will fit landscape but not portrait...
       */
 
-      if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+      if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "cfFilterImageToRaster: Auto orientation...");
 
       if ((xinches > xprint || yinches > yprint) &&
@@ -1226,7 +1226,7 @@ cfFilterImageToRaster(int inputfd,         /* I - File descriptor input stream *
        * Rotate the image as needed...
        */
 
-       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+       if (log) log(ld, CF_LOGLEVEL_DEBUG,
                     "cfFilterImageToRaster: Using landscape orientation...");
 
        doc.Orientation = (doc.Orientation + 1) & 3;
@@ -1246,11 +1246,11 @@ cfFilterImageToRaster(int inputfd,         /* I - File descriptor input stream *
     yprint = (doc.PageTop - doc.PageBottom) / 72.0;
     aspect = (float)img->yppi / (float)img->xppi;
 
-    if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "cfFilterImageToRaster: Before scaling: xprint=%.1f, yprint=%.1f",
                 xprint, yprint);
 
-    if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "cfFilterImageToRaster: img->xppi = %d, img->yppi = %d, aspect = %f",
                 img->xppi, img->yppi, aspect);
 
@@ -1272,10 +1272,10 @@ cfFilterImageToRaster(int inputfd,         /* I - File descriptor input stream *
       xsize2 = ysize2 * img->xsize * aspect / img->ysize;
     }
 
-    if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "cfFilterImageToRaster: Portrait size is %.2f x %.2f inches",
                 xsize, ysize);
-    if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "cfFilterImageToRaster: Landscape size is %.2f x %.2f inches",
                 xsize2, ysize2);
 
@@ -1287,7 +1287,7 @@ cfFilterImageToRaster(int inputfd,         /* I - File descriptor input stream *
       * portrait if they are equal...
       */
 
-      if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+      if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "cfFilterImageToRaster: Auto orientation...");
 
       if ((xsize * ysize) < (xsize2 * ysize2))
@@ -1296,7 +1296,7 @@ cfFilterImageToRaster(int inputfd,         /* I - File descriptor input stream *
        * Do landscape orientation...
        */
 
-       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+       if (log) log(ld, CF_LOGLEVEL_DEBUG,
                     "cfFilterImageToRaster: Using landscape orientation...");
 
        doc.Orientation = 1;
@@ -1311,7 +1311,7 @@ cfFilterImageToRaster(int inputfd,         /* I - File descriptor input stream *
        * Do portrait orientation...
        */
 
-       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+       if (log) log(ld, CF_LOGLEVEL_DEBUG,
                     "cfFilterImageToRaster: Using portrait orientation...");
 
        doc.Orientation = 0;
@@ -1321,7 +1321,7 @@ cfFilterImageToRaster(int inputfd,         /* I - File descriptor input stream *
     }
     else if (doc.Orientation & 1)
     {
-      if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+      if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "cfFilterImageToRaster: Using landscape orientation...");
 
       xinches     = xsize2;
@@ -1331,7 +1331,7 @@ cfFilterImageToRaster(int inputfd,         /* I - File descriptor input stream *
     }
     else
     {
-      if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+      if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "cfFilterImageToRaster: Using portrait orientation...");
 
       xinches     = xsize;
@@ -1352,7 +1352,7 @@ cfFilterImageToRaster(int inputfd,         /* I - File descriptor input stream *
   xprint = xinches / xpages;
   yprint = yinches / ypages;
 
-  if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+  if (log) log(ld, CF_LOGLEVEL_DEBUG,
               "cfFilterImageToRaster: xpages = %dx%.2fin, ypages = %dx%.2fin",
               xpages, xprint, ypages, yprint);
 
@@ -1431,7 +1431,7 @@ cfFilterImageToRaster(int inputfd,         /* I - File descriptor input stream *
        length = min_length;
    }
 
-   if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+   if (log) log(ld, CF_LOGLEVEL_DEBUG,
                "cfFilterImageToRaster: Updated custom page size to %.2f x %.2f "
                "inches...",
                width / 72.0, length / 72.0);
@@ -1509,10 +1509,10 @@ cfFilterImageToRaster(int inputfd,         /* I - File descriptor input stream *
   header.Margins[0] = doc.PageLeft;
   header.Margins[1] = doc.PageBottom;
 
-  if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+  if (log) log(ld, CF_LOGLEVEL_DEBUG,
               "cfFilterImageToRaster: PageSize = [%d %d]", header.PageSize[0],
               header.PageSize[1]);
-  if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+  if (log) log(ld, CF_LOGLEVEL_DEBUG,
               "cfFilterImageToRaster: PageLeft = %f, PageRight = %f, "
               "PageBottom = %f, PageTop = %f",
               doc.PageLeft, doc.PageRight, doc.PageBottom, doc.PageTop);
@@ -1677,7 +1677,7 @@ cfFilterImageToRaster(int inputfd,         /* I - File descriptor input stream *
   header.ImagingBoundingBox[2] = header.cupsImagingBBox[2];
   header.ImagingBoundingBox[3] = header.cupsImagingBBox[3];
 
-  if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+  if (log) log(ld, CF_LOGLEVEL_DEBUG,
               "cfFilterImageToRaster: Orientation: %d, XPosition: %d, YPosition: %d, "
               "ImagingBoundingBox = [%d %d %d %d]",
               doc.Orientation, doc.XPosition, doc.YPosition,
@@ -1749,21 +1749,21 @@ cfFilterImageToRaster(int inputfd,         /* I - File descriptor input stream *
   */
 
   if (log) {
-    log(ld, FILTER_LOGLEVEL_DEBUG,
+    log(ld, CF_LOGLEVEL_DEBUG,
        "cfFilterImageToRaster: cupsWidth = %d", header.cupsWidth);
-    log(ld, FILTER_LOGLEVEL_DEBUG,
+    log(ld, CF_LOGLEVEL_DEBUG,
        "cfFilterImageToRaster: cupsHeight = %d", header.cupsHeight);
-    log(ld, FILTER_LOGLEVEL_DEBUG,
+    log(ld, CF_LOGLEVEL_DEBUG,
        "cfFilterImageToRaster: cupsBitsPerColor = %d", header.cupsBitsPerColor);
-    log(ld, FILTER_LOGLEVEL_DEBUG,
+    log(ld, CF_LOGLEVEL_DEBUG,
        "cfFilterImageToRaster: cupsBitsPerPixel = %d", header.cupsBitsPerPixel);
-    log(ld, FILTER_LOGLEVEL_DEBUG,
+    log(ld, CF_LOGLEVEL_DEBUG,
        "cfFilterImageToRaster: cupsBytesPerLine = %d", header.cupsBytesPerLine);
-    log(ld, FILTER_LOGLEVEL_DEBUG,
+    log(ld, CF_LOGLEVEL_DEBUG,
        "cfFilterImageToRaster: cupsColorOrder = %d", header.cupsColorOrder);
-    log(ld, FILTER_LOGLEVEL_DEBUG,
+    log(ld, CF_LOGLEVEL_DEBUG,
        "cfFilterImageToRaster: cupsColorSpace = %d", header.cupsColorSpace);
-    log(ld, FILTER_LOGLEVEL_DEBUG,
+    log(ld, CF_LOGLEVEL_DEBUG,
        "cfFilterImageToRaster: img->colorspace = %d", img->colorspace);
   }
 
@@ -1776,12 +1776,12 @@ cfFilterImageToRaster(int inputfd,         /* I - File descriptor input stream *
       {
        if (iscanceled && iscanceled(icd))
         {
-         if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+         if (log) log(ld, CF_LOGLEVEL_DEBUG,
                       "cfFilterImageToRaster: Job canceled");
          goto canceled;
        }
 
-       if (log) log(ld, FILTER_LOGLEVEL_INFO,
+       if (log) log(ld, CF_LOGLEVEL_INFO,
                     "cfFilterImageToRaster: Formatting page %d.", page);
 
        if (doc.Orientation & 1)
@@ -1832,7 +1832,7 @@ cfFilterImageToRaster(int inputfd,         /* I - File descriptor input stream *
            if (doc.YPosition == 0)
              y /= 2;
 
-           if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+           if (log) log(ld, CF_LOGLEVEL_DEBUG,
                         "cfFilterImageToRaster: Writing %d leading blank lines...",
                         y);
 
@@ -1841,7 +1841,7 @@ cfFilterImageToRaster(int inputfd,         /* I - File descriptor input stream *
              if (cupsRasterWritePixels(ras, row, header.cupsBytesPerLine) <
                      header.cupsBytesPerLine)
              {
-               if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+               if (log) log(ld, CF_LOGLEVEL_ERROR,
                             "cfFilterImageToRaster: Unable to send raster data.");
                cfImageClose(img);
                return (1);
@@ -1940,7 +1940,7 @@ cfFilterImageToRaster(int inputfd,         /* I - File descriptor input stream *
            if (cupsRasterWritePixels(ras, row, header.cupsBytesPerLine) <
                                      header.cupsBytesPerLine)
            {
-             if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+             if (log) log(ld, CF_LOGLEVEL_DEBUG,
                           "cfFilterImageToRaster: Unable to send raster data.");
              cfImageClose(img);
              return (1);
@@ -1973,7 +1973,7 @@ cfFilterImageToRaster(int inputfd,         /* I - File descriptor input stream *
            if (doc.YPosition == 0)
              y = y - y / 2;
 
-           if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+           if (log) log(ld, CF_LOGLEVEL_DEBUG,
                         "cfFilterImageToRaster: Writing %d trailing blank lines...",
                         y);
 
@@ -1982,7 +1982,7 @@ cfFilterImageToRaster(int inputfd,         /* I - File descriptor input stream *
              if (cupsRasterWritePixels(ras, row, header.cupsBytesPerLine) <
                      header.cupsBytesPerLine)
              {
-               if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+               if (log) log(ld, CF_LOGLEVEL_ERROR,
                             "cfFilterImageToRaster: Unable to send raster data.");
                cfImageClose(img);
                return (1);
index 9a13c90b0e3242488ccf58e31a1500b332deec8e..dfbabfa263df064c7d9437bbaaca2dec15a24e0c 100644 (file)
@@ -19,19 +19,19 @@ extern "C" {
  * Types...
  */
 
-typedef enum filter_loglevel_e {        /* Log levels, same as PAPPL, similar
-                                          to CUPS */
FILTER_LOGLEVEL_UNSPEC = -1,           /* Not specified */
FILTER_LOGLEVEL_DEBUG,                 /* Debug message */
FILTER_LOGLEVEL_INFO,                  /* Informational message */
FILTER_LOGLEVEL_WARN,                  /* Warning message */
FILTER_LOGLEVEL_ERROR,                 /* Error message */
FILTER_LOGLEVEL_FATAL,                 /* Fatal message */
FILTER_LOGLEVEL_CONTROL                /* Control message */
-} filter_loglevel_t;
-
-typedef void (*filter_logfunc_t)(void *data, filter_loglevel_t level,
-                                const char *message, ...);
+typedef enum cf_loglevel_e {         /* Log levels, same as PAPPL, similar
+                                       to CUPS */
 CF_LOGLEVEL_UNSPEC = -1,           /* Not specified */
 CF_LOGLEVEL_DEBUG,                 /* Debug message */
 CF_LOGLEVEL_INFO,                  /* Informational message */
 CF_LOGLEVEL_WARN,                  /* Warning message */
 CF_LOGLEVEL_ERROR,                 /* Error message */
 CF_LOGLEVEL_FATAL,                 /* Fatal message */
 CF_LOGLEVEL_CONTROL                /* Control message */
+} cf_loglevel_t;
+
+typedef void (*cf_logfunc_t)(void *data, cf_loglevel_t level,
+                            const char *message, ...);
 
 #  ifdef __cplusplus
 }
index 24890322030a1fcc6fd7e776c624f31a787ff645..f8114d2863d91619d9e9499584d571b86c894443 100644 (file)
@@ -46,7 +46,7 @@ cfLutLoad(ppd_file_t *ppd,            /* I - PPD file */
             const char *media,         /* I - Media type */
             const char *resolution,    /* I - Resolution */
            const char *ink,            /* I - Ink name */
-           filter_logfunc_t log,       /* I - Log function */
+           cf_logfunc_t log,       /* I - Log function */
            void       *ld)             /* I - Log function data */
 {
   char         name[PPD_MAX_NAME],     /* Attribute name */
@@ -83,7 +83,7 @@ cfLutLoad(ppd_file_t *ppd,            /* I - PPD file */
   vals[3] = 0.0;
   nvals   = sscanf(attr->value, "%f%f%f", vals + 1, vals + 2, vals + 3) + 1;
 
-  if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+  if (log) log(ld, CF_LOGLEVEL_DEBUG,
               "Loaded LUT %s from PPD with values [%.3f %.3f %.3f %.3f]",
               name, vals[0], vals[1], vals[2], vals[3]);
 
@@ -100,7 +100,7 @@ cfLutLoad(ppd_file_t *ppd,          /* I - PPD file */
 cf_lut_t *                             /* O - New lookup table */
 cfLutNew(int         num_values,       /* I - Number of values */
           const float *values,         /* I - Lookup table values */
-          filter_logfunc_t log,        /* I - Log function */
+          cf_logfunc_t log,        /* I - Log function */
           void        *ld)             /* I - Log function data */
 {
   int          pixel;                  /* Pixel value */
@@ -189,7 +189,7 @@ cfLutNew(int         num_values,    /* I - Number of values */
 
   if (log)
     for (start = 0; start <= CF_MAX_LUT; start += CF_MAX_LUT / 15)
-      log(ld, FILTER_LOGLEVEL_DEBUG,
+      log(ld, CF_LOGLEVEL_DEBUG,
          "%d = %d/%d/%d", start, lut[start].intensity,
          lut[start].pixel, lut[start].error);
 
index 6005507b30362e684de5fa6dc8e58740f5456ddb..477ad451bb57c45e99de2d3757aba773e665b4d8 100644 (file)
@@ -63,7 +63,7 @@ typedef cups_page_header_t mupdf_page_header;
 
 
 int
-parse_doc_type(FILE *fp, filter_logfunc_t log, void *ld)
+parse_doc_type(FILE *fp, cf_logfunc_t log, void *ld)
 {
   char buf[5];
   char *rc;
@@ -79,7 +79,7 @@ parse_doc_type(FILE *fp, filter_logfunc_t log, void *ld)
   if (strncmp(buf,"%PDF",4) == 0)
     return 0;
 
-  if(log) log(ld, FILTER_LOGLEVEL_DEBUG, "cfFilterMuPDFToPWG: input file cannot be identified");
+  if(log) log(ld, CF_LOGLEVEL_DEBUG, "cfFilterMuPDFToPWG: input file cannot be identified");
   return -1;
 }
 
@@ -174,7 +174,7 @@ static int
 mutool_spawn (const char *filename,
              cups_array_t *mutool_args,
              int outputfd,
-             filter_logfunc_t log,
+             cf_logfunc_t log,
              void *ld,
              cf_filter_iscanceledfunc_t iscanceled,
              void *icd)
@@ -188,7 +188,7 @@ mutool_spawn (const char *filename,
   int numargs;
   int pid, mutoolpid, errpid;
   cups_file_t *logfp;
-  filter_loglevel_t log_level;
+  cf_loglevel_t log_level;
   char *msg;
   int status = 65536;
   int wstatus;
@@ -214,7 +214,7 @@ mutool_spawn (const char *filename,
       snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf),
               " %s%s%s", apos, mutoolargv[i], apos);
     }
-    log(ld, FILTER_LOGLEVEL_DEBUG, "%s", buf);
+    log(ld, CF_LOGLEVEL_DEBUG, "%s", buf);
   }
 
   /* Create a pipe for stderr output of mutool */
@@ -222,7 +222,7 @@ mutool_spawn (const char *filename,
   {
     errfds[0] = -1;
     errfds[1] = -1;
-    if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+    if (log) log(ld, CF_LOGLEVEL_ERROR,
                 "cfFilterMuPDFToPWG: Unable to establish stderr pipe for mutool "
                 "call");
     goto out;
@@ -235,7 +235,7 @@ mutool_spawn (const char *filename,
     close(errfds[1]);
     errfds[0] = -1;
     errfds[1] = -1;
-    if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+    if (log) log(ld, CF_LOGLEVEL_ERROR,
                 "cfFilterMuPDFToPWG: Unable to set \"close on exec\" flag on read "
                 "end of the stderr pipe for mutool call");
     goto out;
@@ -244,7 +244,7 @@ mutool_spawn (const char *filename,
   {
     close(errfds[0]);
     close(errfds[1]);
-    if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+    if (log) log(ld, CF_LOGLEVEL_ERROR,
                 "cfFilterMuPDFToPWG: Unable to set \"close on exec\" flag on write "
                 "end of the stderr pipe for mutool call");
     goto out;
@@ -256,7 +256,7 @@ mutool_spawn (const char *filename,
     if (errfds[1] >= 2) {
       if (errfds[1] != 2) {
        if (dup2(errfds[1], 2) < 0) {
-         if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+         if (log) log(ld, CF_LOGLEVEL_ERROR,
                       "cfFilterMuPDFToPWG: Unable to couple pipe with stderr of "
                       "mutool process");
          exit(1);
@@ -265,7 +265,7 @@ mutool_spawn (const char *filename,
       }
       close(errfds[0]);
     } else {
-      if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "cfFilterMuPDFToPWG: invalid pipe file descriptor to couple with "
                   "stderr of mutool process");
       exit(1);
@@ -275,7 +275,7 @@ mutool_spawn (const char *filename,
     if (outputfd >= 1) {
       if (outputfd != 1) {
        if (dup2(outputfd, 1) < 0) {
-         if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+         if (log) log(ld, CF_LOGLEVEL_ERROR,
                       "cfFilterMuPDFToPWG: Unable to couple stdout of mutool "
                       "process");
          exit(1);
@@ -283,7 +283,7 @@ mutool_spawn (const char *filename,
        close(outputfd);
       }
     } else {
-      if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "cfFilterMuPDFToPWG: Invalid file descriptor to couple with "
                   "stdout of mutool process");
       exit(1);
@@ -291,12 +291,12 @@ mutool_spawn (const char *filename,
 
     /* Execute mutool command line ... */
     execvp(filename, mutoolargv);
-    if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+    if (log) log(ld, CF_LOGLEVEL_ERROR,
                 "cfFilterMuPDFToPWG: Unable to launch mutool: %s: %s", filename,
                 strerror(errno));
     exit(1);
   }
-  if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+  if (log) log(ld, CF_LOGLEVEL_DEBUG,
               "cfFilterMuPDFToPWG: Started mutool (PID %d)", mutoolpid);
 
   close(errfds[1]);
@@ -307,22 +307,22 @@ mutool_spawn (const char *filename,
     while (cupsFileGets(logfp, buf, sizeof(buf)))
       if (log) {
        if (strncmp(buf, "DEBUG: ", 7) == 0) {
-         log_level = FILTER_LOGLEVEL_DEBUG;
+         log_level = CF_LOGLEVEL_DEBUG;
          msg = buf + 7;
        } else if (strncmp(buf, "DEBUG2: ", 8) == 0) {
-         log_level = FILTER_LOGLEVEL_DEBUG;
+         log_level = CF_LOGLEVEL_DEBUG;
          msg = buf + 8;
        } else if (strncmp(buf, "INFO: ", 6) == 0) {
-         log_level = FILTER_LOGLEVEL_INFO;
+         log_level = CF_LOGLEVEL_INFO;
          msg = buf + 6;
        } else if (strncmp(buf, "WARNING: ", 9) == 0) {
-         log_level = FILTER_LOGLEVEL_WARN;
+         log_level = CF_LOGLEVEL_WARN;
          msg = buf + 9;
        } else if (strncmp(buf, "ERROR: ", 7) == 0) {
-         log_level = FILTER_LOGLEVEL_ERROR;
+         log_level = CF_LOGLEVEL_ERROR;
          msg = buf + 7;
        } else {
-         log_level = FILTER_LOGLEVEL_DEBUG;
+         log_level = CF_LOGLEVEL_DEBUG;
          msg = buf;
        }
        log(ld, log_level, "cfFilterMuPDFToPWG: %s", msg);
@@ -333,7 +333,7 @@ mutool_spawn (const char *filename,
     /* Ignore errors of the logging process */
     exit(0);
   }
-  if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+  if (log) log(ld, CF_LOGLEVEL_DEBUG,
               "cfFilterMuPDFToPWG: Started logging (PID %d)", errpid);
 
   close(errfds[0]);
@@ -341,7 +341,7 @@ mutool_spawn (const char *filename,
   while (mutoolpid > 0 || errpid > 0) {
     if ((pid = wait(&wstatus)) < 0) {
       if (errno == EINTR && iscanceled && iscanceled(icd)) {
-       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+       if (log) log(ld, CF_LOGLEVEL_DEBUG,
                     "cfFilterMuPDFToPWG: Job canceled, killing mutool ...");
        kill(mutoolpid, SIGTERM);
        mutoolpid = -1;
@@ -356,21 +356,21 @@ mutool_spawn (const char *filename,
     if (wstatus) {
       if (WIFEXITED(wstatus)) {
        /* Via exit() anywhere or return() in the main() function */
-       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+       if (log) log(ld, CF_LOGLEVEL_ERROR,
                     "cfFilterMuPDFToPWG: %s (PID %d) stopped with status %d",
                     (pid == mutoolpid ? "mutool" : "Logging"), pid,
                     WEXITSTATUS(wstatus));
        status = WEXITSTATUS(wstatus);
       } else {
        /* Via signal */
-       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+       if (log) log(ld, CF_LOGLEVEL_ERROR,
                     "cfFilterMuPDFToPWG: %s (PID %d) crashed on signal %d",
                     (pid == mutoolpid ? "mutool" : "Logging"), pid,
                     WTERMSIG(wstatus));
        status = 256 * WTERMSIG(wstatus);
       }
     } else {
-      if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+      if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "cfFilterMuPDFToPWG: %s (PID %d) exited with no errors.",
                   (pid == mutoolpid ? "mutool" : "Logging"), pid);
       status = 0;
@@ -413,7 +413,7 @@ cfFilterMuPDFToPWG(int inputfd,         /* I - File descriptor input stream */
   ppd_file_t *ppd = NULL;
   struct sigaction sa;
   cf_cm_calibration_t cm_calibrate;
-  filter_logfunc_t log = data->logfunc;
+  cf_logfunc_t log = data->logfunc;
   void *ld = data->logdata;
   cf_filter_iscanceledfunc_t iscanceled = data->iscanceledfunc;
   void *icd = data->iscanceleddata;
@@ -435,7 +435,7 @@ cfFilterMuPDFToPWG(int inputfd,         /* I - File descriptor input stream */
   } else
     outformat = CF_FILTER_OUT_FORMAT_PWG_RASTER;
 
-  if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+  if (log) log(ld, CF_LOGLEVEL_DEBUG,
               "cfFilterMuPDFToPWG: Output format: %s",
               (outformat == CF_FILTER_OUT_FORMAT_CUPS_RASTER ? "CUPS Raster" :
                (outformat == CF_FILTER_OUT_FORMAT_PWG_RASTER ? "PWG Raster" :
@@ -456,14 +456,14 @@ cfFilterMuPDFToPWG(int inputfd,         /* I - File descriptor input stream */
 
   fd = cupsTempFd(infilename, 1024);
     if (fd < 0) {
-      if(log) log(ld, FILTER_LOGLEVEL_ERROR, "cfFilterMuPDFToPWG: Can't create temporary file");
+      if(log) log(ld, CF_LOGLEVEL_ERROR, "cfFilterMuPDFToPWG: Can't create temporary file");
       goto out;
     }
 
     /* copy input file to the tmp file */
     while ((n = read(inputfd, buf, BUFSIZ)) > 0) {
       if (write(fd,buf,n) != n) {
-        if(log) log(ld, FILTER_LOGLEVEL_ERROR, "cfFilterMuPDFToPWG: Can't copy input to temporary file");
+        if(log) log(ld, CF_LOGLEVEL_ERROR, "cfFilterMuPDFToPWG: Can't copy input to temporary file");
         close(fd);
         goto out;
       }
@@ -472,13 +472,13 @@ cfFilterMuPDFToPWG(int inputfd,         /* I - File descriptor input stream */
   if (!inputfd) {
 
     if (lseek(fd,0,SEEK_SET) < 0) {
-      if(log) log(ld, FILTER_LOGLEVEL_ERROR, "cfFilterMuPDFToPWG: Can't rewind temporary file");
+      if(log) log(ld, CF_LOGLEVEL_ERROR, "cfFilterMuPDFToPWG: Can't rewind temporary file");
       close(fd);
       goto out;
     }
 
     if ((fp = fdopen(fd,"rb")) == 0) {
-      if(log) log(ld, FILTER_LOGLEVEL_ERROR, "cfFilterMuPDFToPWG: Can't open temporary file");
+      if(log) log(ld, CF_LOGLEVEL_ERROR, "cfFilterMuPDFToPWG: Can't open temporary file");
       close(fd);
       goto out;
     }
@@ -486,7 +486,7 @@ cfFilterMuPDFToPWG(int inputfd,         /* I - File descriptor input stream */
     /* filename is specified */
 
     if ((fp = fdopen(fd,"rb")) == 0) {
-      if(log) log(ld, FILTER_LOGLEVEL_ERROR, "cfFilterMuPDFToPWG: Can't open temporary file");
+      if(log) log(ld, CF_LOGLEVEL_ERROR, "cfFilterMuPDFToPWG: Can't open temporary file");
       goto out;
     }
   }
@@ -510,18 +510,18 @@ cfFilterMuPDFToPWG(int inputfd,         /* I - File descriptor input stream */
 /*  Find print-rendering-intent */
 
     getPrintRenderIntent(data, &h);
-    if(log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if(log) log(ld, CF_LOGLEVEL_DEBUG,
        "Print rendering intent = %s", h.cupsRenderingIntent);
 
 
   /* mutool parameters */
   mupdf_args = cupsArrayNew(NULL, NULL);
   if (!mupdf_args) {
-    if(log) log(ld, FILTER_LOGLEVEL_ERROR, "cfFilterMuPDFToPWG: Unable to allocate memory for mutool arguments array");
+    if(log) log(ld, CF_LOGLEVEL_ERROR, "cfFilterMuPDFToPWG: Unable to allocate memory for mutool arguments array");
     goto out;
   }
 
-  if(log) log(ld, FILTER_LOGLEVEL_DEBUG, "cfFilterMuPDFToPWG: command: %s",
+  if(log) log(ld, CF_LOGLEVEL_DEBUG, "cfFilterMuPDFToPWG: command: %s",
              CUPS_MUTOOL);
   snprintf(tmpstr, sizeof(tmpstr), "%s", CUPS_MUTOOL);
   cupsArrayAdd(mupdf_args, strdup(tmpstr));
@@ -587,7 +587,7 @@ cfFilterMuPDFToPWG(int inputfd,         /* I - File descriptor input stream */
 
   if(empty)
   {
-    if(log) log(ld, FILTER_LOGLEVEL_ERROR, "cfFilterMuPDFToPWG: Input is empty, outputting empty file.");
+    if(log) log(ld, CF_LOGLEVEL_ERROR, "cfFilterMuPDFToPWG: Input is empty, outputting empty file.");
      status = 0;
   }
 out:
index a10ae2725086dd89093f6ba4c7ee793f270feaa5..dbddc20c69965f759cd0cb80af9dea22e9c99ade 100644 (file)
@@ -87,7 +87,7 @@ parseOpts(cf_filter_data_t *data, cf_filter_out_format_t outformat,
   const char*          t = NULL;
   ppd_attr_t*          attr;
   const char           *val;
-  filter_logfunc_t     log = data->logfunc;
+  cf_logfunc_t log = data->logfunc;
   void                 *ld = data->logdata;
   ppd_file_t           *ppd = pclmtoraster_data->ppd;
   cups_page_header2_t  *header = &(pclmtoraster_data->header);
@@ -119,7 +119,7 @@ parseOpts(cf_filter_data_t *data, cf_filter_out_format_t outformat,
   }
   else
   {
-    if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "cfFilterPCLmToRaster: PPD file is not specified.");
 
     t = cupsGetOption("media-class", num_options, options);
@@ -265,7 +265,7 @@ parseOpts(cf_filter_data_t *data, cf_filter_out_format_t outformat,
     pclmtoraster_data->bi_level = 1;
 
   strncpy(pclmtoraster_data->pageSizeRequested, header->cupsPageSizeName, 64);
-  if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+  if (log) log(ld, CF_LOGLEVEL_DEBUG,
                "cfFilterPCLmToRaster: Page size requested: %s.",
               header->cupsPageSizeName);
   return(0);
@@ -303,7 +303,7 @@ rotatebitmap(unsigned char *src,    /* I - Input string */
             unsigned int width,    /* I - Width of raster image in pixels */
             int rowsize,           /* I - Length of one row of pixels */
             std::string colorspace,/* I - Colorspace of input bitmap */
-            filter_logfunc_t log,  /* I - Log function */
+            cf_logfunc_t log,  /* I - Log function */
             void *ld)              /* I - Aux. data for log function */
 {
   unsigned char *bp = src;
@@ -446,7 +446,7 @@ rotatebitmap(unsigned char *src,    /* I - Input string */
   }
   else
   {
-    if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+    if (log) log(ld, CF_LOGLEVEL_ERROR,
                 "cfFilterPCLmToRaster: Incorrect Rotate Value %d, not rotating",
                 rotate);
     return (src);
@@ -735,7 +735,7 @@ convertReverseLine(unsigned char    *src,           /* I - Input line */
 
 static void                                     /* O - Exit status */
 selectConvertFunc(int                  pgno,    /* I - Page number */
-                 filter_logfunc_t      log,     /* I - Log function */
+                 cf_logfunc_t  log,     /* I - Log function */
                  void                  *ld,     /* I - Aux. data for log
                                                        function */
                  pclmtoraster_data_t   *data,   /* I - pclmtoraster filter
@@ -762,7 +762,7 @@ selectConvertFunc(int                       pgno,    /* I - Page number */
   }
   else
   {
-    if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+    if (log) log(ld, CF_LOGLEVEL_ERROR,
                 "cfFilterPCLmToRaster: Colorspace %s not supported, "
                 "defaulting to /deviceRGB",
                 colorspace.c_str());
@@ -831,7 +831,7 @@ static int                          /* O - Exit status */
 outPage(cups_raster_t*  raster,        /* I - Raster stream */
        QPDFObjectHandle page,          /* I - QPDF Page Object */
        int              pgno,          /* I - Page number */
-       filter_logfunc_t log,           /* I - Log function */
+       cf_logfunc_t log,               /* I - Log function */
        void*            ld,            /* I - Aux. data for log function */
        pclmtoraster_data_t *data,      /* I - pclmtoraster filter data */
        cf_filter_data_t        *filter_data,   /* I - filter data */
@@ -861,14 +861,14 @@ outPage(cups_raster_t*     raster,        /* I - Raster stream */
   // Get pagesize by the mediabox key of the page.
   if (!mediaboxlookup(page, mediaBox))
   {
-    if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+    if (log) log(ld, CF_LOGLEVEL_ERROR,
                 "cfFilterPCLmToRaster: PDF page %d doesn't contain a valid mediaBox",
                 pgno + 1);
     return (1);
   }
   else
   {
-    if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "cfFilterPCLmToRaster: mediaBox = [%f %f %f %f]: ",
                 mediaBox[0], mediaBox[1], mediaBox[2], mediaBox[3]);
     l = mediaBox[2] - mediaBox[0];
@@ -1011,7 +1011,7 @@ outPage(cups_raster_t*     raster,        /* I - Raster stream */
 
   if (!cupsRasterWriteHeader2(raster,&(data->header)))
   {
-    if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+    if (log) log(ld, CF_LOGLEVEL_ERROR,
                 "cfFilterPCLmToRaster: Can't write page %d header", pgno + 1);
     return (1);
   }
@@ -1114,7 +1114,7 @@ cfFilterPCLmToRaster(int inputfd,         /* I - File descriptor input stream */
   cups_raster_t                *raster;
   pclmtoraster_data_t  pclmtoraster_data;
   conversion_function_t convert;
-  filter_logfunc_t     log = data->logfunc;
+  cf_logfunc_t log = data->logfunc;
   void                 *ld = data->logdata;
   cf_filter_iscanceledfunc_t iscanceled = data->iscanceledfunc;
   void                  *icd = data->iscanceleddata;
@@ -1128,7 +1128,7 @@ cfFilterPCLmToRaster(int inputfd,         /* I - File descriptor input stream */
   } else
     outformat = CF_FILTER_OUT_FORMAT_PWG_RASTER;
 
-  if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+  if (log) log(ld, CF_LOGLEVEL_DEBUG,
               "cfFilterPCLmToRaster: Output format: %s",
               (outformat == CF_FILTER_OUT_FORMAT_CUPS_RASTER ? "CUPS Raster" :
                (outformat == CF_FILTER_OUT_FORMAT_PWG_RASTER ? "PWG Raster" :
@@ -1142,7 +1142,7 @@ cfFilterPCLmToRaster(int inputfd,         /* I - File descriptor input stream */
   {
     if (!iscanceled || !iscanceled(icd))
     {
-      if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+      if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "cfFilterPCLmToRaster: Unable to open input data stream.");
     }
 
@@ -1151,14 +1151,14 @@ cfFilterPCLmToRaster(int inputfd,         /* I - File descriptor input stream */
 
   if ((fd = cupsTempFd(tempfile, sizeof(tempfile))) < 0)
   {
-    if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+    if (log) log(ld, CF_LOGLEVEL_ERROR,
                 "cfFilterPCLmToRaster: Unable to copy PDF file: %s",
                 strerror(errno));
     fclose(inputfp);
     return (1);
   }
 
-  if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+  if (log) log(ld, CF_LOGLEVEL_DEBUG,
               "cfFilterPCLmToRaster: Copying input to temp file \"%s\"",
               tempfile);
 
@@ -1184,7 +1184,7 @@ cfFilterPCLmToRaster(int inputfd,         /* I - File descriptor input stream */
      && pclmtoraster_data.header.cupsBitsPerColor != 8
      && pclmtoraster_data.header.cupsBitsPerColor != 16)
   {
-    if(log) log(ld, FILTER_LOGLEVEL_ERROR,
+    if(log) log(ld, CF_LOGLEVEL_ERROR,
                "cfFilterPCLmToRaster: Specified color format is not supported: %s",
                strerror(errno));
     delete(pdf);
@@ -1218,7 +1218,7 @@ cfFilterPCLmToRaster(int inputfd,         /* I - File descriptor input stream */
                                   CUPS_RASTER_WRITE_PWG :
                                 CUPS_RASTER_WRITE_APPLE)))) == 0)
   {
-    if(log) log(ld, FILTER_LOGLEVEL_ERROR,
+    if(log) log(ld, CF_LOGLEVEL_ERROR,
                "cfFilterPCLmToRaster: Can't open raster stream: %s",
                strerror(errno));
     delete(pdf);
@@ -1233,12 +1233,12 @@ cfFilterPCLmToRaster(int inputfd,         /* I - File descriptor input stream */
   {
     if (iscanceled && iscanceled(icd))
     {
-      if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+      if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "cfFilterPCLmToRaster: Job canceled");
       break;
     }
 
-    if (log) log(ld, FILTER_LOGLEVEL_INFO,
+    if (log) log(ld, CF_LOGLEVEL_INFO,
                 "cfFilterPCLmToRaster: Starting page %d.", i+1);
     if (outPage(raster, pages[i], i, log, ld, &pclmtoraster_data,data,
                &convert) != 0)
index 18dcdf080c6b7703d19ab778067e3bf91508adcb..efff5e04b4837674bed642ba3698534caa066597 100644 (file)
@@ -105,22 +105,22 @@ void IntervalSet::dump(pdftopdf_doc_t *doc) const // {{{
 {
   int len=data.size();
   if (len==0) {
-    if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
+    if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_DEBUG,
                                   "cfFilterPDFToPDF: (empty)");
     return;
   }
   len--;
   for (int iA=0;iA<len;iA++) {
-    if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
+    if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_DEBUG,
                                   "cfFilterPDFToPDF: [%d,%d)",
                                   data[iA].first, data[iA].second);
   }
   if (data[len].second==npos) {
-    if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
+    if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_DEBUG,
                                   "cfFilterPDFToPDF: [%d,inf)",
                                   data[len].first);
   } else {
-    if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
+    if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_DEBUG,
                                   "cfFilterPDFToPDF: [%d,%d)",
                                   data[len].first, data[len].second);
   }
index 41421c920795f0b1789d361c12480f0d5cb0b35c..64ac291497eb0eefc0c260dee3d0d4072a20cbf4 100644 (file)
@@ -6,7 +6,7 @@
 
 void NupParameters::dump(pdftopdf_doc_t *doc) const // {{{
 {
-  if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
+  if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_DEBUG,
                                 "cfFilterPDFToPDF: NupX: %d, NupY: %d, "
                                 "width: %f, height: %f",
                                 nupX,nupY,
@@ -24,28 +24,28 @@ void NupParameters::dump(pdftopdf_doc_t *doc) const // {{{
     spos=1;
   }
   if (first==Axis::X) {
-    if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
+    if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_DEBUG,
                                   "cfFilterPDFToPDF: First Axis: X");
     opos=0;
   } else if (first==Axis::Y) {
-    if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
+    if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_DEBUG,
                                   "cfFilterPDFToPDF: First Axis: Y");
     opos=2;
     std::swap(fpos,spos);
   }
 
   if ( (opos==-1)||(fpos==-1)||(spos==-1) ) {
-    if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
+    if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_DEBUG,
                                   "cfFilterPDFToPDF: Bad Spec: %d; start: %d, %d",
                                   first,xstart,ystart);
   } else {
     static const char *order[4]={"lr","rl","bt","tb"};
-    if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
+    if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_DEBUG,
                                   "cfFilterPDFToPDF: Order: %s%s",
                                   order[opos+fpos],order[(opos+2)%4+spos]);
   }
 
-  if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
+  if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_DEBUG,
                                 "cfFilterPDFToPDF: Alignment:");
   Position_dump(xalign,Axis::X,doc);
   Position_dump(yalign,Axis::Y,doc);
@@ -139,7 +139,7 @@ void NupState::reset() // {{{
 
 void NupPageEdit::dump(pdftopdf_doc_t *doc) const // {{{
 {
-  if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
+  if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_DEBUG,
                                 "cfFilterPDFToPDF: xpos: %f, ypos: %f, scale: %f",
                                 xpos,ypos,scale);
   sub.dump(doc);
index 31df65800808d79cf8513b6fae5a2974edfb6e71..6b166055dceb0717955591ce7ec8b80a1aedacda 100644 (file)
@@ -161,7 +161,7 @@ static bool ppdDefaultOrder(ppd_file_t *ppd, pdftopdf_doc_t *doc) // {{{  -- is
     return true;
   }
 
-  if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_ERROR,
+  if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_ERROR,
                                 "cfFilterPDFToPDF: Unsupported output-order "
                                 "value %s, using 'normal'!",
                                 val);
@@ -382,7 +382,7 @@ void getParameters(cf_filter_data_t *data,int num_options,cups_option_t *options
      */
     if ((ipprot<3)||(ipprot>6)) {
       if (ipprot && doc->logfunc)
-       doc->logfunc(doc->logdata, FILTER_LOGLEVEL_ERROR,
+       doc->logfunc(doc->logdata, CF_LOGLEVEL_ERROR,
                     "cfFilterPDFToPDF: Bad value (%d) for "
                     "orientation-requested, using 0 degrees",
                     ipprot);
@@ -432,7 +432,7 @@ void getParameters(cf_filter_data_t *data,int num_options,cups_option_t *options
                (val = cupsGetOption("page-size", num_options, options)) != NULL ||
                (val = cupsGetOption("PageSize", num_options, options)) != NULL) {
        pwg_media_t *size_found = NULL;
-       if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
+       if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_DEBUG,
                                        "cfFilterPDFToPDF: Page size from command "
                                        "line: %s", val);
        if ((size_found = pwgMediaForPWG(val)) == NULL)
@@ -445,12 +445,12 @@ void getParameters(cf_filter_data_t *data,int num_options,cups_option_t *options
                param.page.right=param.page.left=18.0;
                param.page.right=param.page.width-param.page.right;
                param.page.top=param.page.height-param.page.top;
-               if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
+               if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_DEBUG,
                                        "cfFilterPDFToPDF: Width: %f, Length: %f",
                                        param.page.width, param.page.height);
        }
        else
-               if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
+               if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_DEBUG,
                                        "cfFilterPDFToPDF: Unsupported page size %s.",
                                        val);
        }
@@ -502,7 +502,7 @@ void getParameters(cf_filter_data_t *data,int num_options,cups_option_t *options
       param.duplex=true;
       param.setDuplex=true;
     } else if (strcasecmp(val,"one-sided")!=0) {
-      if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_ERROR,
+      if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_ERROR,
                                     "cfFilterPDFToPDF: Unsupported sides value %s, "
                                     "using sides=one-sided!", val);
     }
@@ -512,7 +512,7 @@ void getParameters(cf_filter_data_t *data,int num_options,cups_option_t *options
   int nup=1;
   if (optGetInt("number-up",num_options,options,&nup)) {
     if (!NupParameters::possible(nup)) {
-      if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_ERROR,
+      if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_ERROR,
                                     "cfFilterPDFToPDF: Unsupported number-up value "
                                     "%d, using number-up=1!", nup);
       nup=1;
@@ -524,7 +524,7 @@ void getParameters(cf_filter_data_t *data,int num_options,cups_option_t *options
 
   if ((val=cupsGetOption("number-up-layout",num_options,options)) != NULL) {
     if (!parseNupLayout(val,param.nup)) {
-      if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_ERROR,
+      if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_ERROR,
                                     "cfFilterPDFToPDF: Unsupported number-up-layout "
                                     "%s, using number-up-layout=lrtb!" ,val);
       param.nup.first=Axis::X;
@@ -535,7 +535,7 @@ void getParameters(cf_filter_data_t *data,int num_options,cups_option_t *options
 
   if ((val=cupsGetOption("page-border",num_options,options)) != NULL) {
     if (!parseBorder(val,param.border)) {
-      if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_ERROR,
+      if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_ERROR,
                                     "cfFilterPDFToPDF: Unsupported page-border value "
                                     "%s, using page-border=none!", val);
       param.border=BorderType::NONE;
@@ -579,7 +579,7 @@ void getParameters(cf_filter_data_t *data,int num_options,cups_option_t *options
     } else if (strcasecmp(val,"odd")==0) {
       param.evenPages=false;
     } else if (strcasecmp(val,"all")!=0) {
-      if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_ERROR,
+      if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_ERROR,
                                     "cfFilterPDFToPDF: Unsupported page-set value %s, "
                                     "using page-set=all!", val);
     }
@@ -615,7 +615,7 @@ void getParameters(cf_filter_data_t *data,int num_options,cups_option_t *options
     } else if (is_true(val)) {
       param.booklet=BookletMode::BOOKLET_ON;
     } else if (!is_false(val)) {
-      if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_ERROR,
+      if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_ERROR,
                                     "cfFilterPDFToPDF: Unsupported booklet value %s, "
                                     "using booklet=off!", val);
     }
@@ -623,7 +623,7 @@ void getParameters(cf_filter_data_t *data,int num_options,cups_option_t *options
   param.bookSignature=-1;
   if (optGetInt("booklet-signature",num_options,options,&param.bookSignature)) {
     if (param.bookSignature==0) {
-      if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_ERROR,
+      if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_ERROR,
                                     "cfFilterPDFToPDF: Unsupported booklet-signature "
                                     "value, using booklet-signature=-1 "
                                     "(all)!", val);
@@ -633,7 +633,7 @@ void getParameters(cf_filter_data_t *data,int num_options,cups_option_t *options
 
   if ((val=cupsGetOption("position",num_options,options)) != NULL) {
     if (!parsePosition(val,param.xpos,param.ypos)) {
-      if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_ERROR,
+      if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_ERROR,
                                     "cfFilterPDFToPDF: Unrecognized position value "
                                     "%s, using position=center!", val);
       param.xpos=Position::CENTER;
@@ -711,21 +711,21 @@ bool checkFeature(const char *feature, int num_options, cups_option_t *options)
   if ((val=cupsGetOption("page-logging",num_options,options)) != NULL) {
     if (strcasecmp(val,"auto") == 0) {
       param.page_logging = -1;
-      if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
+      if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_DEBUG,
                                     "cfFilterPDFToPDF: Automatic page logging "
                                     "selected by command line.");
     } else if (is_true(val)) {
       param.page_logging = 1;
-      if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
+      if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_DEBUG,
                                     "cfFilterPDFToPDF: Forced page logging selected "
                                     "by command line.");
     } else if (is_false(val)) {
       param.page_logging = 0;
-      if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
+      if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_DEBUG,
                                     "cfFilterPDFToPDF: Suppressed page logging "
                                     "selected by command line.");
     } else {
-      if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_ERROR,
+      if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_ERROR,
                                     "cfFilterPDFToPDF: Unsupported page-logging "
                                     "value %s, using page-logging=auto!",val);
       param.page_logging = -1;
@@ -752,18 +752,18 @@ bool checkFeature(const char *feature, int num_options, cups_option_t *options)
                final_content_type[0]=='\0'){
            param.page_logging = -1;     
        }
-       if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
+       if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_DEBUG,
                "cfFilterPDFToPDF: No PPD file specified,  "
                "determined whether to log pages or "
                "not using final_content_type env variable.");
-               doc->logfunc(doc->logdata,FILTER_LOGLEVEL_DEBUG,"final_content_type = %s page_logging=%d",final_content_type?final_content_type:"NULL",param.page_logging);
+               doc->logfunc(doc->logdata,CF_LOGLEVEL_DEBUG,"final_content_type = %s page_logging=%d",final_content_type?final_content_type:"NULL",param.page_logging);
     } else {
       char *lastfilter = NULL;
       if (final_content_type == NULL) {
        // No FINAL_CONTENT_TYPE env variable set, we cannot determine
        // whether we have to log pages, so do not log.
        param.page_logging = 0;
-       if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
+       if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_DEBUG,
                                       "cfFilterPDFToPDF: No FINAL_CONTENT_TYPE "
                                       "environment variable, could not "
                                       "determine whether to log pages or "
@@ -860,14 +860,14 @@ bool checkFeature(const char *feature, int num_options, cups_option_t *options)
            param.page_logging = 0;
          }
        } else {
-         if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_ERROR,
+         if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_ERROR,
                                         "cfFilterPDFToPDF: Last filter could not "
                                         "get determined, page logging turned "
                                         "off.");
          param.page_logging = 0;
        }
       }
-      if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
+      if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_DEBUG,
                                     "cfFilterPDFToPDF: Last filter determined by the "
                                     "PPD: %s; FINAL_CONTENT_TYPE: "
                                     "%s => pdftopdf will %slog pages in "
@@ -982,7 +982,7 @@ FILE *copy_fd_to_temp(int infd, pdftopdf_doc_t *doc) // {{{
   // FIXME:  what does >buf mean here?
   int outfd=cupsTempFd(buf,sizeof(buf));
   if (outfd<0) {
-    if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_ERROR,
+    if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_ERROR,
                                   "cfFilterPDFToPDF: Can't create temporary file");
     return NULL;
   }
@@ -992,7 +992,7 @@ FILE *copy_fd_to_temp(int infd, pdftopdf_doc_t *doc) // {{{
   // copy stdin to the tmp file
   while ((n=read(infd,buf,BUFSIZ)) > 0) {
     if (write(outfd,buf,n) != n) {
-      if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_ERROR,
+      if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_ERROR,
                                     "cfFilterPDFToPDF: Can't copy stdin to temporary "
                                     "file");
       close(outfd);
@@ -1000,7 +1000,7 @@ FILE *copy_fd_to_temp(int infd, pdftopdf_doc_t *doc) // {{{
     }
   }
   if (lseek(outfd,0,SEEK_SET) < 0) {
-    if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_ERROR,
+    if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_ERROR,
                                   "cfFilterPDFToPDF: Can't rewind temporary file");
     close(outfd);
     return NULL;
@@ -1008,7 +1008,7 @@ FILE *copy_fd_to_temp(int infd, pdftopdf_doc_t *doc) // {{{
 
   FILE *f;
   if ((f=fdopen(outfd,"rb")) == 0) {
-    if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_ERROR,
+    if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_ERROR,
                                   "cfFilterPDFToPDF: Can't fdopen temporary file");
     close(outfd);
     return NULL;
@@ -1048,7 +1048,7 @@ cfFilterPDFToPDF(int inputfd,         /* I - File descriptor input stream */
   int                streaming = 0;
   size_t             bytes;
   char               buf[BUFSIZ];
-  filter_logfunc_t   log = data->logfunc;
+  cf_logfunc_t   log = data->logfunc;
   void               *ld = data->logdata;
   cf_filter_iscanceledfunc_t iscanceled = data->iscanceledfunc;
   void               *icd = data->iscanceleddata;
@@ -1092,7 +1092,7 @@ cfFilterPDFToPDF(int inputfd,         /* I - File descriptor input stream */
        (strcasecmp(t, "false") && strcasecmp(t, "off") &
         strcasecmp(t, "no"))) {
       streaming = 1;
-      if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+      if (log) log(ld, CF_LOGLEVEL_DEBUG,
                     "cfFilterPDFToPDF: Streaming mode: No PDF processing, only adding of JCL");
     }
 
@@ -1109,12 +1109,12 @@ cfFilterPDFToPDF(int inputfd,         /* I - File descriptor input stream */
     if (!streaming) {
       if (is_empty(inputfp)) {
        fclose(inputfp);
-       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+       if (log) log(ld, CF_LOGLEVEL_DEBUG,
                     "cfFilterPDFToPDF: Input is empty, outputting empty file.");
        return 0;
       }
 
-      if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+      if (log) log(ld, CF_LOGLEVEL_DEBUG,
                     "cfFilterPDFToPDF: Processing PDF input with QPDF: Page-ranges, page-set, number-up, booklet, size adjustment, ...");
 
       // Load the PDF input data into QPDF
@@ -1156,7 +1156,7 @@ cfFilterPDFToPDF(int inputfd,         /* I - File descriptor input stream */
       // proc->emitFilename(NULL);
     } else {
       // Pass through the input data
-      if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+      if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "cfFilterPDFToPDF: Passing on unchanged PDF data from input");
       while ((bytes = fread(buf, 1, sizeof(buf), inputfp)) > 0)
        if (fwrite(buf, 1, bytes, outputfp) != bytes)
@@ -1168,11 +1168,11 @@ cfFilterPDFToPDF(int inputfd,         /* I - File descriptor input stream */
     fclose(outputfp);
   } catch (std::exception &e) {
     // TODO? exception type
-    if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+    if (log) log(ld, CF_LOGLEVEL_ERROR,
                 "cfFilterPDFToPDF: Exception: %s",e.what());
     return 5;
   } catch (...) {
-    if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+    if (log) log(ld, CF_LOGLEVEL_ERROR,
                 "cfFilterPDFToPDF: Unknown exception caught. Exiting.");
     return 6;
   }
index aab10428164cc55980187b2469da72252d25dd0f..4c77d956b5deaece80d81afe9248b2beffa81a2e 100644 (file)
@@ -9,7 +9,7 @@
 
 typedef struct                                   /***** Document information *****/
 {
-  filter_logfunc_t logfunc;           /* Log function */
+  cf_logfunc_t logfunc;           /* Log function */
   void *logdata;                      /* Log data */
   cf_filter_iscanceledfunc_t iscanceledfunc; /* Function returning 1 when
                                              job is canceled, NULL for not
index 2c925c94939b13bff07d5fd752ae11ee9b3a00a5..e3c7f771342638b1b5cc960d0629e166b38e3676 100644 (file)
@@ -8,11 +8,11 @@ void BookletMode_dump(BookletMode bkm,pdftopdf_doc_t *doc) // {{{
 {
   static const char *bstr[3]={"Off","On","Shuffle-Only"};
   if ((bkm<BOOKLET_OFF) || (bkm>BOOKLET_JUSTSHUFFLE)) {
-    if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
+    if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_DEBUG,
                                   "cfFilterPDFToPDF: bookletMode: (bad booklet mode: "
                                   "%d)", bkm);
   } else {
-    if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
+    if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_DEBUG,
                                   "cfFilterPDFToPDF: bookletMode: %s", bstr[bkm]);
   }
 }
@@ -37,13 +37,13 @@ bool ProcessingParameters::havePage(int pageno) const
 
 void ProcessingParameters::dump(pdftopdf_doc_t *doc) const // {{{
 {
-  if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
+  if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_DEBUG,
                                 "cfFilterPDFToPDF: jobId: %d, numCopies: %d",
                                 jobId,numCopies);
-  if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
+  if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_DEBUG,
                                 "cfFilterPDFToPDF: user: %s, title: %s",
                                 (user)?user:"(null)",(title)?title:"(null)");
-  if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
+  if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_DEBUG,
                                 "cfFilterPDFToPDF: fitplot: %s",
                                 (fitplot)?"true":"false");
 
@@ -51,11 +51,11 @@ void ProcessingParameters::dump(pdftopdf_doc_t *doc) const // {{{
 
   Rotation_dump(orientation,doc);
 
-  if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
+  if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_DEBUG,
                                 "cfFilterPDFToPDF: paper_is_landscape: %s",
                                 (paper_is_landscape)?"true":"false");
 
-  if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
+  if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_DEBUG,
                                 "cfFilterPDFToPDF: duplex: %s",
                                 (duplex)?"true":"false");
 
@@ -63,64 +63,64 @@ void ProcessingParameters::dump(pdftopdf_doc_t *doc) const // {{{
 
   nup.dump(doc);
 
-  if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
+  if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_DEBUG,
                                 "cfFilterPDFToPDF: reverse: %s",
                                 (reverse)?"true":"false");
 
-  if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
+  if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_DEBUG,
                                 "cfFilterPDFToPDF: evenPages: %s, oddPages: %s",
                                 (evenPages)?"true":"false",
                                 (oddPages)?"true":"false");
   
-   if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
+   if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_DEBUG,
                                 "cfFilterPDFToPDF: input page range:");
   inputPageRange.dump(doc);
 
-  if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
+  if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_DEBUG,
                                 "cfFilterPDFToPDF: page range:");
   pageRange.dump(doc);
 
-  if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
+  if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_DEBUG,
                                 "cfFilterPDFToPDF: mirror: %s",
                                 (mirror)?"true":"false");
 
-  if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
+  if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_DEBUG,
                                 "cfFilterPDFToPDF: Position:");
   Position_dump(xpos,Axis::X,doc);
   Position_dump(ypos,Axis::Y,doc);
 
-  if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
+  if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_DEBUG,
                                 "cfFilterPDFToPDF: collate: %s",
                                 (collate)?"true":"false");
 
-  if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
+  if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_DEBUG,
                                 "cfFilterPDFToPDF: evenDuplex: %s",
                                 (evenDuplex)?"true":"false");
 
-  if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
+  if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_DEBUG,
                                 "cfFilterPDFToPDF: pageLabel: %s",
                                 pageLabel.empty () ? "(none)" :
                                 pageLabel.c_str());
 
   BookletMode_dump(booklet,doc);
-  if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
+  if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_DEBUG,
                                 "cfFilterPDFToPDF: booklet signature: %d",
                                 bookSignature);
 
-  if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
+  if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_DEBUG,
                                 "cfFilterPDFToPDF: autoRotate: %s",
                                 (autoRotate)?"true":"false");
 
-  if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
+  if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_DEBUG,
                                 "cfFilterPDFToPDF: emitJCL: %s",
                                 (emitJCL)?"true":"false");
-  if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
+  if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_DEBUG,
                                 "cfFilterPDFToPDF: deviceCopies: %d",
                                 deviceCopies);
-  if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
+  if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_DEBUG,
                                 "cfFilterPDFToPDF: deviceCollate: %s",
                                 (deviceCollate)?"true":"false");
-  if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
+  if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_DEBUG,
                                 "cfFilterPDFToPDF: setDuplex: %s",
                                 (setDuplex)?"true":"false");
 }
@@ -169,7 +169,7 @@ std::vector<int> bookletShuffle(int numPages,int signature) // {{{
 bool processPDFTOPDF(PDFTOPDF_Processor &proc,ProcessingParameters &param,pdftopdf_doc_t *doc) // {{{
 {
   if (!proc.check_print_permissions(doc)) {
-    if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
+    if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_DEBUG,
                                   "cfFilterPDFToPDF: Not allowed to print");
     return false;
   }
@@ -210,7 +210,7 @@ bool processPDFTOPDF(PDFTOPDF_Processor &proc,ProcessingParameters &param,pdftop
   }
   const int numPages=std::max(shuffle.size(),input_page_range_list.size());
 
-  if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
+  if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_DEBUG,
                                 "cfFilterPDFToPDF: \"print-scaling\" IPP attribute: %s",
                                 (param.autoprint ? "auto" :
                                  (param.autofit ? "auto-fit" :
@@ -237,14 +237,14 @@ bool processPDFTOPDF(PDFTOPDF_Processor &proc,ProcessingParameters &param,pdftop
          (h > param.page.width || w > param.page.height))
       {
        if (doc->logfunc)
-         doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
+         doc->logfunc(doc->logdata, CF_LOGLEVEL_DEBUG,
                       "cfFilterPDFToPDF: Page %d too large for output page size, scaling pages to fit.",
                       i + 1);
        document_large = true;
       }
     }
     if (param.fidelity && doc->logfunc)
-      doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
+      doc->logfunc(doc->logdata, CF_LOGLEVEL_DEBUG,
                   "cfFilterPDFToPDF: \"ipp-attribute-fidelity\" IPP attribute is set, scaling pages to fit.");
 
     if (param.autoprint)
@@ -268,7 +268,7 @@ bool processPDFTOPDF(PDFTOPDF_Processor &proc,ProcessingParameters &param,pdftop
     }
   }
 
-  if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
+  if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_DEBUG,
                                 "cfFilterPDFToPDF: Print scaling mode: %s",
                                 (param.fitplot ?
                                  "Scale to fit printable area" :
@@ -382,7 +382,7 @@ bool processPDFTOPDF(PDFTOPDF_Processor &proc,ProcessingParameters &param,pdftop
        outputno ++;
        if (param.page_logging == 1)
          if (doc->logfunc) doc->logfunc(doc->logdata,
-                                        FILTER_LOGLEVEL_CONTROL,
+                                        CF_LOGLEVEL_CONTROL,
                                         "PAGE: %d %d", outputno,
                                         param.copies_to_be_logged);
       }
@@ -445,7 +445,7 @@ bool processPDFTOPDF(PDFTOPDF_Processor &proc,ProcessingParameters &param,pdftop
     // Log page in /var/log/cups/page_log
     outputno ++;
     if (param.page_logging == 1)
-      if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_CONTROL,
+      if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_CONTROL,
                                     "PAGE: %d %d", outputno,
                                     param.copies_to_be_logged);
   }
@@ -455,7 +455,7 @@ bool processPDFTOPDF(PDFTOPDF_Processor &proc,ProcessingParameters &param,pdftop
     proc.add_page(proc.new_page(param.page.width,param.page.height,doc),param.reverse);
     // Log page in /var/log/cups/page_log
     if (param.page_logging == 1)
-      if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_CONTROL,
+      if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_CONTROL,
                                     "PAGE: %d %d", outputno + 1,
                                     param.copies_to_be_logged);
   }
index 42a518fdec38b2ff6bde7ed7050a744028840e80..97cd05f4e305a98fbbc0cb823558e31e4f0c2b2c 100644 (file)
@@ -7,10 +7,10 @@ void Position_dump(Position pos,pdftopdf_doc_t *doc) // {{{
 {
   static const char *pstr[3]={"Left/Bottom","Center","Right/Top"};
   if ((pos < LEFT) || (pos > RIGHT)) {
-    if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
+    if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_DEBUG,
       "cfFilterPDFToPDF: (bad position: %d)",pos);
   } else {
-    if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
+    if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_DEBUG,
       "cfFilterPDFToPDF: %s",pstr[pos+1]);
   }
 }
@@ -20,18 +20,18 @@ void Position_dump(Position pos,Axis axis,pdftopdf_doc_t *doc) // {{{
 {
   assert((axis == Axis::X) || (axis == Axis::Y));
   if ((pos < LEFT) || (pos > RIGHT)) {
-    if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
+    if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_DEBUG,
       "cfFilterPDFToPDF: Position %s: (bad position: %d)",
       (axis == Axis::X) ? "X" : "Y", pos);
     return;
   }
   if (axis==Axis::X) {
     static const char *pxstr[3]={"Left","Center","Right"};
-    if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
+    if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_DEBUG,
       "cfFilterPDFToPDF: Position X: %s", pxstr[pos+1]);
   } else {
     static const char *pystr[3]={"Bottom","Center","Top"};
-    if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
+    if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_DEBUG,
       "cfFilterPDFToPDF: Position Y: %s",pystr[pos+1]);
   }
 }
@@ -41,10 +41,10 @@ void Rotation_dump(Rotation rot,pdftopdf_doc_t *doc) // {{{
 {
   static const char *rstr[4]={"0 deg","90 deg","180 deg","270 deg"}; // CCW
   if ((rot < ROT_0) || (rot > ROT_270)) {
-    if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
+    if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_DEBUG,
       "cfFilterPDFToPDF: Rotation(CCW): (bad rotation: %d)",rot);
   } else {
-    if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
+    if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_DEBUG,
       "cfFilterPDFToPDF: Rotation(CCW): %s",rstr[rot]);
   }
 }
@@ -71,11 +71,11 @@ Rotation operator-(Rotation rhs) // {{{
 void BorderType_dump(BorderType border,pdftopdf_doc_t *doc) // {{{
 {
   if ((border < NONE) || (border == 1) || (border > TWO_THICK)) {
-    if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
+    if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_DEBUG,
       "cfFilterPDFToPDF: Border: (bad border: %d)",border);
   } else {
     static const char *bstr[6]={"None",NULL,"one thin","one thick","two thin","two thick"};
-    if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
+    if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_DEBUG,
       "cfFilterPDFToPDF: Border: %s",bstr[border]);
   }
 }
@@ -179,7 +179,7 @@ void PageRect::set(const PageRect &rhs) // {{{
 
 void PageRect::dump(pdftopdf_doc_t *doc) const // {{{
 {
-  if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
+  if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_DEBUG,
       "cfFilterPDFToPDF: top: %f, left: %f, right: %f, bottom: %f, "
          "width: %f, height: %f",
          top,left,right,bottom,
index 20deb0869bdac5e00f080e982445d3b1289ac1a0..e9282836a4dd3fe1429bc671c45bd9b600ab23c0 100644 (file)
@@ -221,7 +221,7 @@ Rotation QPDF_PDFTOPDF_PageHandle::crop(const PageRect &cropRect,Rotation orient
     final_w = pageWidth;
     final_h = pageHeight;
   }
-  if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
+  if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_DEBUG,
              "cfFilterPDFToPDF: After Cropping: %lf %lf %lf %lf",
              width,height,final_w,final_h);
   double posw = (width-final_w)/2,
@@ -484,7 +484,7 @@ bool QPDF_PDFTOPDF_Processor::loadFile(FILE *f,pdftopdf_doc_t *doc,ArgOwnership
     try {
       pdf->processFile("temp file",f,false);
     } catch (const std::exception &e) {
-      if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_ERROR,
+      if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_ERROR,
         "cfFilterPDFToPDF: loadFile failed: %s", e.what());
       return false;
     }
@@ -493,13 +493,13 @@ bool QPDF_PDFTOPDF_Processor::loadFile(FILE *f,pdftopdf_doc_t *doc,ArgOwnership
     try {
       pdf->processFile("temp file",f,true);
     } catch (const std::exception &e) {
-      if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_ERROR,
+      if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_ERROR,
         "cfFilterPDFToPDF: loadFile failed: %s", e.what());
       return false;
     }
     break;
   case MustDuplicate:
-    if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_ERROR,
+    if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_ERROR,
         "cfFilterPDFToPDF: loadFile with MustDuplicate is not supported");
     return false;
   }
@@ -515,7 +515,7 @@ bool QPDF_PDFTOPDF_Processor::loadFilename(const char *name,pdftopdf_doc_t *doc,
     pdf.reset(new QPDF);
     pdf->processFile(name);
   } catch (const std::exception &e) {
-    if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_ERROR,
+    if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_ERROR,
         "cfFilterPDFToPDF: loadFilename failed: %s",e.what());
     return false;
   }
@@ -556,7 +556,7 @@ void QPDF_PDFTOPDF_Processor::start(int flatten_forms) // {{{
 bool QPDF_PDFTOPDF_Processor::check_print_permissions(pdftopdf_doc_t *doc) // {{{
 {
   if (!pdf) {
-    if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_ERROR,
+    if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_ERROR,
         "cfFilterPDFToPDF: No PDF loaded");
     return false;
   }
@@ -568,7 +568,7 @@ std::vector<std::shared_ptr<PDFTOPDF_PageHandle>> QPDF_PDFTOPDF_Processor::get_p
 {
   std::vector<std::shared_ptr<PDFTOPDF_PageHandle>> ret;
   if (!pdf) {
-    if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_ERROR,
+    if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_ERROR,
         "cfFilterPDFToPDF: No PDF loaded");
     assert(0);
     return ret;
@@ -585,7 +585,7 @@ std::vector<std::shared_ptr<PDFTOPDF_PageHandle>> QPDF_PDFTOPDF_Processor::get_p
 std::shared_ptr<PDFTOPDF_PageHandle> QPDF_PDFTOPDF_Processor::new_page(float width,float height,pdftopdf_doc_t *doc) // {{{
 {
   if (!pdf) {
-    if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_ERROR,
+    if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_ERROR,
         "cfFilterPDFToPDF: No PDF loaded");
     assert(0);
     return std::shared_ptr<PDFTOPDF_PageHandle>();
@@ -713,7 +713,7 @@ void QPDF_PDFTOPDF_Processor::emitFile(FILE *f,pdftopdf_doc_t *doc,ArgOwnership
     out.setOutputFile("temp file",f,true);
     break;
   case MustDuplicate:
-    if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_ERROR,
+    if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_ERROR,
         "cfFilterPDFToPDF: emitFile with MustDuplicate is not supported");
     return;
   }
@@ -751,7 +751,7 @@ void QPDF_PDFTOPDF_Processor::emitFilename(const char *name,pdftopdf_doc_t *doc)
   if (len)
   out.write();
   else
-  if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
+  if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_DEBUG,
              "cfFilterPDFToPDF: No pages left, outputting empty file.");
 }
 // }}}
index 7ab9bb2581540656d0a263b43641aa2c8f358ee2..17f2ffd8c34871ce623c6cd600ebf1813b6ad6ec 100644 (file)
@@ -107,7 +107,7 @@ static void parsePDFTOPDFComment(char *filename,       /* I - Input file */
                                 char *deviceCopies,   /* O - Number of copies
                                                              (hardware) */
                                 int *deviceCollate,   /* O - Hardware collate*/
-                                filter_logfunc_t log, /* I - Log function */
+                                cf_logfunc_t log, /* I - Log function */
                                 void *ld)             /* I - Aux. data for
                                                              log function */
 {
@@ -116,7 +116,7 @@ static void parsePDFTOPDFComment(char *filename,       /* I - Input file */
   FILE *fp;
 
   if ((fp = fopen(filename,"rb")) == NULL) {
-    if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+    if (log) log(ld, CF_LOGLEVEL_ERROR,
                 "cfFilterPDFToPS: Cannot open input file \"%s\"",
                 filename);
     return;
@@ -167,14 +167,14 @@ static void parsePDFTOPDFComment(char *filename,       /* I - Input file */
 
 int                            /* O - Result: 1: Empty; 0: Contains pages */
 is_empty(char *filename,       /* I - Input file */
-        filter_logfunc_t log, /* I - Log function */
+        cf_logfunc_t log, /* I - Log function */
         void *ld)             /* I - Auxiliary data for log function */
 {
   FILE *fp = NULL;
   fp = fopen(filename, "rb");
   if (fp == NULL)
   {
-    if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+    if (log) log(ld, CF_LOGLEVEL_ERROR,
                 "cfFilterPDFToPS: Cannot open input file \"%s\"",
                 filename);
     return 1;
@@ -185,14 +185,14 @@ is_empty(char *filename,       /* I - Input file */
     rewind(fp);
     if (fread(buf, 1, 1, fp) == 0) {
       fclose(fp);
-      if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+      if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "cfFilterPDFToPS: Input is empty, outputting empty file.");
       return 1;
     }
     fclose(fp);
     int pages = pdf_pages(filename);
     if (pages == 0) {
-      if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+      if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "cfFilterPDFToPS: No pages left, outputting empty file.");
       return 1;
     }
@@ -211,7 +211,7 @@ is_empty(char *filename,       /* I - Input file */
 void
 log_command_line(const char* file,     /* I - Program to be executed */
                 char *const argv[],   /* I - Argument list */
-                filter_logfunc_t log, /* I - Log function */
+                cf_logfunc_t log, /* I - Log function */
                 void *ld)             /* I - Auxiliary data for log function */
 {
   int i;
@@ -237,7 +237,7 @@ log_command_line(const char* file,     /* I - Program to be executed */
   }
   buf[sizeof(buf) - 1] = '\0';
 
-  log(ld, FILTER_LOGLEVEL_DEBUG, "%s", buf);
+  log(ld, CF_LOGLEVEL_DEBUG, "%s", buf);
 }
 
 
@@ -303,7 +303,7 @@ cfFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
                *ptr;                   /* Pointer into value */
   int          duplex, tumble;         /* Duplex settings for PPD-less
                                           printing */
-  filter_logfunc_t log = data->logfunc;
+  cf_logfunc_t log = data->logfunc;
   void          *ld = data->logdata;
   cf_filter_iscanceledfunc_t iscanceled = data->iscanceledfunc;
   void          *icd = data->iscanceleddata;
@@ -329,7 +329,7 @@ cfFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
   {
     if (!iscanceled || !iscanceled(icd))
     {
-      if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+      if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "cfFilterPDFToPS: Unable to open input data stream.");
     }
 
@@ -342,12 +342,12 @@ cfFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
 
   if ((fd = cupsTempFd(tempfile, sizeof(tempfile))) < 0)
   {
-    if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+    if (log) log(ld, CF_LOGLEVEL_ERROR,
                 "cfFilterPDFToPS: Unable to copy PDF file: %s", strerror(errno));
     return (1);
   }
 
-  if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+  if (log) log(ld, CF_LOGLEVEL_DEBUG,
               "cfFilterPDFToPS: Copying input to temp file \"%s\"",
               tempfile);
 
@@ -425,7 +425,7 @@ cfFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
             ppd->product + 1);
     make_model[strlen(make_model) - 1] = '\0';
   }
-  if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+  if (log) log(ld, CF_LOGLEVEL_DEBUG,
               "cfFilterPDFToPS: Printer make and model: %s", make_model);
 
  /*
@@ -450,7 +450,7 @@ cfFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
     else if (strcasecmp(val, "hybrid") == 0)
       renderer = HYBRID;
     else
-      if (log) log(ld, FILTER_LOGLEVEL_WARN,
+      if (log) log(ld, CF_LOGLEVEL_WARN,
                   "cfFilterPDFToPS: Invalid value for \"pdftops-renderer\": \"%s\"",
                   val);
   }
@@ -464,7 +464,7 @@ cfFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
         (!strncasecmp(make_model, "Apple", 5) &&
          (ptr = strcasestr(make_model, "LaserWriter")))))
     {
-      if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+      if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "cfFilterPDFToPS: Switching to Poppler's pdftops instead of "
                   "Ghostscript for Brother, Minolta, Konica Minolta, Dell, "
                   "and Apple LaserWriter printers to work around bugs in the "
@@ -494,7 +494,7 @@ cfFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
          while (*ptr && isalnum(*ptr)) ptr ++;
          if (!*ptr) /* End of string, no further word */
          {
-           if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+           if (log) log(ld, CF_LOGLEVEL_DEBUG,
                         "cfFilterPDFToPS: Switching to Poppler's pdftops instead of "
                         "Ghostscript for old HP LaserJet (\"LaserJet "
                         "<number>\", no letters before <number>, no "
@@ -700,18 +700,18 @@ cfFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
        pdf_argv[pdf_argc++] = (char *)"-dLanguageLevel=1";
       else if (renderer == PDFTOCAIRO)
       {
-       if (log) log(ld, FILTER_LOGLEVEL_WARN,
+       if (log) log(ld, CF_LOGLEVEL_WARN,
                     "cfFilterPDFToPS: Level 1 PostScript not supported by "
                     "pdftocairo.");
       }
       else if (renderer == ACROREAD)
       {
-       if (log) log(ld, FILTER_LOGLEVEL_WARN,
+       if (log) log(ld, CF_LOGLEVEL_WARN,
                     "cfFilterPDFToPS: Level 1 PostScript not supported by acroread.");
       }
       else if (renderer == MUPDF)
       {
-       if (log) log(ld, FILTER_LOGLEVEL_WARN,
+       if (log) log(ld, CF_LOGLEVEL_WARN,
                     "cfFilterPDFToPS: Level 1 PostScript not supported by mutool.");
       }
     }
@@ -760,7 +760,7 @@ cfFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
       }
       else if (renderer == MUPDF)
       {
-       if (log) log(ld, FILTER_LOGLEVEL_WARN,
+       if (log) log(ld, CF_LOGLEVEL_WARN,
                     "cfFilterPDFToPS: Level 3 PostScript not supported by mutool.");
       }
       else /* PDFTOCAIRO || ACROREAD */
@@ -836,7 +836,7 @@ cfFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
     resolution[sizeof(resolution)-1] = '\0';
     if ((xres == 0) && (yres == 0) &&
        ((numvalues = sscanf(resolution, "%dx%d", &xres, &yres)) <= 0))
-      if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+      if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "cfFilterPDFToPS: No resolution information found in the PPD file.");
   }
   else{
@@ -891,7 +891,7 @@ cfFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
           strcasecmp(ptr, "dpc") &&
           strcasecmp(ptr, "dpcm")))
       {
-       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+       if (log) log(ld, CF_LOGLEVEL_DEBUG,
                     "cfFilterPDFToPS: Bad resolution value \"%s\".", val);
       }
       else
@@ -927,7 +927,7 @@ cfFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
     if ((numvalues = sscanf(val, "%d", &mres)) > 0)
       maxres = mres;
     else
-      if (log) log(ld, FILTER_LOGLEVEL_WARN,
+      if (log) log(ld, CF_LOGLEVEL_WARN,
                   "cfFilterPDFToPS: Invalid value for "
                   "\"pdftops-max-image-resolution\": \"%s\"",
                   val);
@@ -954,7 +954,7 @@ cfFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
     pdf_argv[pdf_argc++] = (char *)"-r";
     snprintf(resolution, sizeof(resolution), "%d", res);
     pdf_argv[pdf_argc++] = resolution;
-    if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "cfFilterPDFToPS: Using image rendering resolution %d dpi", res);
 #endif /* HAVE_POPPLER_PDFTOPS_WITH_RESOLUTION */
     if (gray_output == 1) /* Checking for monochrome/grayscale PostScript
@@ -973,11 +973,11 @@ cfFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
       /* pdf_argv[1] = (char *)"-level1";
         pdf_argv[pdf_argc++] = (char *)"-optimizecolorspace"; */
       /* Issue a warning message when printing a grayscale job with Poppler */
-      if (log) log(ld, FILTER_LOGLEVEL_WARN,
+      if (log) log(ld, CF_LOGLEVEL_WARN,
                   "cfFilterPDFToPS: Grayscale/monochrome printing requested for this "
                   "job but Poppler is not able to convert to "
                   "grayscale/monochrome PostScript.");
-      if (log) log(ld, FILTER_LOGLEVEL_WARN,
+      if (log) log(ld, CF_LOGLEVEL_WARN,
                   "cfFilterPDFToPS: Use \"pdftops-renderer\" option (see "
                   "cups-filters README file) to use Ghostscript or MuPDF for "
                   "the PDF -> PostScript conversion.");
@@ -993,7 +993,7 @@ cfFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
     */
     snprintf(resolution, 127, "-r%d", res);
     pdf_argv[pdf_argc++] = resolution;
-    if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "cfFilterPDFToPS: Using image rendering resolution %d dpi", res);
    /*
     * PostScript debug mode: If you send a job with "lpr -o psdebug" Ghostscript
@@ -1010,7 +1010,7 @@ cfFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
         (!strncasecmp(make_model, "Kyocera", 7) ||
          !strncasecmp(make_model, "Utax", 4))))
     {
-      if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+      if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "cfFilterPDFToPS: Deactivated compression of pages in "
                   "Ghostscript's PostScript output (\"psdebug\" debug mode "
                   "or Kyocera/Utax printer)");
@@ -1027,7 +1027,7 @@ cfFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
     if (make_model[0] &&
        !strncasecmp(make_model, "Brother", 7))
     {
-      if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+      if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "cfFilterPDFToPS: Deactivation of Ghostscript's image compression "
                   "for Brother printers to workarounmd PS interpreter bug");
       pdf_argv[pdf_argc++] = (char *)"-dEncodeMonoImages=false";
@@ -1043,7 +1043,7 @@ cfFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
     if (make_model[0] &&
        !strncasecmp(make_model, "Toshiba", 7))
     {
-      if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+      if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "cfFilterPDFToPS: To work around a bug in Toshiba's PS "
                   "interpreters turn TTF font glyphs into bitmaps, usually "
                   "Type 3 PS fonts, or images for large characters");
@@ -1115,7 +1115,7 @@ cfFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
   {
     if (pipe(pstops_pipe))
     {
-      if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "cfFilterPDFToPS: Unable to create pipe for cfFilterPSToPS: %s",
                   strerror(errno));
 
@@ -1128,7 +1128,7 @@ cfFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
   {
     if (pipe(post_proc_pipe))
     {
-      if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "cfFilterPDFToPS: Unable to create pipe for post-processing: %s",
                   strerror(errno));
 
@@ -1161,21 +1161,21 @@ cfFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
     if (renderer == PDFTOPS)
     {
       execvp(CUPS_POPPLER_PDFTOPS, pdf_argv);
-      if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "cfFilterPDFToPS: Unable to execute pdftops program: %s",
                   strerror(errno));
     }
     else if (renderer == GS)
     {
       execvp(CUPS_GHOSTSCRIPT, pdf_argv);
-      if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "cfFilterPDFToPS: Unable to execute gs program: %s",
                   strerror(errno));
     }
     else if (renderer == PDFTOCAIRO)
     {
       execvp(CUPS_POPPLER_PDFTOCAIRO, pdf_argv);
-      if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "cfFilterPDFToPS: Unable to execute pdftocairo program: %s",
                   strerror(errno));
     }
@@ -1192,14 +1192,14 @@ cfFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
       }
      
       execvp(CUPS_ACROREAD, pdf_argv);
-      if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "cfFilterPDFToPS: Unable to execute acroread program: %s",
                   strerror(errno));
     }
     else if (renderer == MUPDF)
     {
       execvp(CUPS_MUTOOL, pdf_argv);
-      if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "cfFilterPDFToPS: Unable to execute mutool program: %s",
                   strerror(errno));
     }
@@ -1215,23 +1215,23 @@ cfFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
     if (log)
     {
       if (renderer == PDFTOPS)
-       log(ld, FILTER_LOGLEVEL_ERROR,
+       log(ld, CF_LOGLEVEL_ERROR,
            "cfFilterPDFToPS: Unable to execute pdftops program: %s",
            strerror(errno));
       else if (renderer == GS)
-       log(ld, FILTER_LOGLEVEL_ERROR,
+       log(ld, CF_LOGLEVEL_ERROR,
            "cfFilterPDFToPS: Unable to execute gs program: %s",
            strerror(errno));
       else if (renderer == PDFTOCAIRO)
-       log(ld, FILTER_LOGLEVEL_ERROR,
+       log(ld, CF_LOGLEVEL_ERROR,
            "cfFilterPDFToPS: Unable to execute pdftocairo program: %s",
            strerror(errno));
       else if (renderer == ACROREAD)
-       log(ld, FILTER_LOGLEVEL_ERROR,
+       log(ld, CF_LOGLEVEL_ERROR,
            "cfFilterPDFToPS: Unable to execute acroread program: %s",
            strerror(errno));
       else if (renderer == MUPDF)
-       log(ld, FILTER_LOGLEVEL_ERROR,
+       log(ld, CF_LOGLEVEL_ERROR,
            "cfFilterPDFToPS: Unable to execute mutool program: %s",
            strerror(errno));
     }
@@ -1240,7 +1240,7 @@ cfFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
     goto error;
   }
 
-  if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+  if (log) log(ld, CF_LOGLEVEL_DEBUG,
               "cfFilterPDFToPS: Started filter %s (PID %d)", pdf_argv[0], pdf_pid);
 
   if (need_post_proc)
@@ -1309,7 +1309,7 @@ cfFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
          if (strncmp(buffer, "%%BeginProlog", 13))
          {
            /* No Prolog section, create one */
-           if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+           if (log) log(ld, CF_LOGLEVEL_DEBUG,
                         "cfFilterPDFToPS: Adding Prolog section for workaround "
                         "PostScript code");
            puts("%%BeginProlog");
@@ -1340,7 +1340,7 @@ cfFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
            if (!strncasecmp(make_model, "Kyocera", 7) ||
                !strncasecmp(make_model, "Utax", 4))
            {
-             if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+             if (log) log(ld, CF_LOGLEVEL_DEBUG,
                           "cfFilterPDFToPS: Inserted workaround PostScript code for "
                           "Kyocera and Utax printers");
              puts("% ===== Workaround insertion by pdftops CUPS filter =====");
@@ -1376,7 +1376,7 @@ cfFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
 
            else if (!strncasecmp(make_model, "Brother", 7))
            {
-             if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+             if (log) log(ld, CF_LOGLEVEL_DEBUG,
                           "cfFilterPDFToPS: Inserted workaround PostScript code for "
                           "Brother printers");
              puts("% ===== Workaround insertion by pdftops CUPS filter =====");
@@ -1425,7 +1425,7 @@ cfFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
              if (strncmp(buffer, "%%BeginSetup", 12))
              {
                /* No Setup section, create one */
-               if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+               if (log) log(ld, CF_LOGLEVEL_DEBUG,
                             "cfFilterPDFToPS: Adding Setup section for option "
                             "PostScript code");
                puts("%%BeginSetup");
@@ -1586,7 +1586,7 @@ cfFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
       * Unable to fork!
       */
 
-      if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "cfFilterPDFToPS: Unable to execute post-processing process: %s",
                   strerror(errno));
 
@@ -1594,7 +1594,7 @@ cfFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
       goto error;
     }
 
-    if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "cfFilterPDFToPS: Started post-processing (PID %d)", post_proc_pid);
   }
 
@@ -1616,7 +1616,7 @@ cfFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
       ret = cfFilterPSToPS(pstops_pipe[0], outputfd, 0, &pstops_filter_data, NULL);
       close(pstops_pipe[0]);
 
-      if (ret && log) log(ld, FILTER_LOGLEVEL_ERROR,
+      if (ret && log) log(ld, CF_LOGLEVEL_ERROR,
                          "cfFilterPDFToPS: pstops filter function failed.");
 
       close(outputfd);
@@ -1628,7 +1628,7 @@ cfFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
       * Unable to fork!
       */
 
-      if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "cfFilterPDFToPS: Unable to execute pstops program: %s",
                   strerror(errno));
 
@@ -1636,7 +1636,7 @@ cfFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
       goto error;
     }
 
-    if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "cfFilterPDFToPS: Started filter pstops (PID %d)", pstops_pid);
 
     close(pstops_pipe[0]);
@@ -1687,7 +1687,7 @@ cfFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
       {
        exit_status = WEXITSTATUS(wait_status);
 
-       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+       if (log) log(ld, CF_LOGLEVEL_DEBUG,
                     "cfFilterPDFToPS: PID %d (%s) stopped with status %d!",
                     wait_pid,
                     wait_pid == pdf_pid ?
@@ -1704,7 +1704,7 @@ cfFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
       }
       else if (WTERMSIG(wait_status) == SIGTERM)
       {
-       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+       if (log) log(ld, CF_LOGLEVEL_DEBUG,
                     "cfFilterPDFToPS: PID %d (%s) was terminated normally with "
                     "signal %d!",
                     wait_pid,
@@ -1724,7 +1724,7 @@ cfFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
       {
        exit_status = WTERMSIG(wait_status);
 
-       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+       if (log) log(ld, CF_LOGLEVEL_ERROR,
                     "cfFilterPDFToPS: PID %d (%s) crashed on signal %d!",
                     wait_pid,
                     wait_pid == pdf_pid ?
@@ -1742,7 +1742,7 @@ cfFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
     }
     else
     {
-      if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+      if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "cfFilterPDFToPS: PID %d (%s) exited with no errors.",
                   wait_pid,
                   wait_pid == pdf_pid ?
@@ -1764,7 +1764,7 @@ cfFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
 
   error:
 
-  if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+  if (log) log(ld, CF_LOGLEVEL_DEBUG,
               "cfFilterPDFToPS: Closing files ...");
 
   close(outputfd);
index 10fdcc512b0004bfeda40e767c68946a12086e44..e333c01cbafe724d2cb02d84505f2f380e05313d 100644 (file)
@@ -121,7 +121,7 @@ typedef struct pdftoraster_doc_s
   ppd_file_t *ppd = 0;
   poppler::document *poppler_doc;
   cups_page_header2_t header;
-  filter_logfunc_t logfunc;             /* Logging function, NULL for no
+  cf_logfunc_t logfunc;             /* Logging function, NULL for no
                                           logging */
   void          *logdata;               /* User data for logging function, can
                                           be NULL */
@@ -309,7 +309,7 @@ static int parseOpts(cf_filter_data_t *data,
   const char *t = NULL;
   ppd_attr_t *attr;
   const char *val;
-  filter_logfunc_t log = data->logfunc;
+  cf_logfunc_t log = data->logfunc;
   void *ld = data ->logdata;
   ipp_t *printer_attrs = data->printer_attrs;
   cups_cspace_t cspace = (cups_cspace_t)(-1);
@@ -333,7 +333,7 @@ static int parseOpts(cf_filter_data_t *data,
   } else
     outformat = CF_FILTER_OUT_FORMAT_CUPS_RASTER;
 
-  if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+  if (log) log(ld, CF_LOGLEVEL_DEBUG,
               "cfFilterPDFToRaster: Output format: %s",
               (outformat == CF_FILTER_OUT_FORMAT_CUPS_RASTER ? "CUPS Raster" :
                "PWG Raster"));
@@ -352,7 +352,7 @@ static int parseOpts(cf_filter_data_t *data,
     ppdMarkOptions(doc->ppd,num_options,options);
     handleRqeuiresPageRegion(doc);
   } else
-    if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if (log) log(ld, CF_LOGLEVEL_DEBUG,
       "cfFilterPDFToRaster: PPD file is not specified.");
 
   cupsRasterPrepareHeader(&(doc->header), data, outformat,
@@ -465,7 +465,7 @@ static int parseOpts(cf_filter_data_t *data,
     } else if (strcasecmp(doc->header.cupsRenderingIntent,"ABSOLUTE") == 0) {
        doc->colour_profile.renderingIntent = INTENT_ABSOLUTE_COLORIMETRIC;
     }
-    if(log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if(log) log(ld, CF_LOGLEVEL_DEBUG,
        "Print rendering intent = %s", doc->header.cupsRenderingIntent);
     
     int backside = getBackSideAndHeaderDuplex(printer_attrs, &(doc->header));
@@ -520,7 +520,7 @@ static int parseOpts(cf_filter_data_t *data,
   if ((val = cupsGetOption("print-color-mode", num_options, options)) != NULL
                            && !strncasecmp(val, "bi-level", 8))
     doc->bi_level = 1;
-  if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+  if (log) log(ld, CF_LOGLEVEL_DEBUG,
     "cfFilterPDFToRaster: Page size requested: %s", doc->header.cupsPageSizeName);
 
   if (num_options)
@@ -1063,7 +1063,7 @@ static unsigned int getCMSColorSpaceType(cmsColorSpaceSignature cs)
 }
 
 /* select convertLine function */
-static int selectConvertFunc(cups_raster_t *raster, pdftoraster_doc_t* doc, conversion_function_t *convert, filter_logfunc_t log, void* ld)
+static int selectConvertFunc(cups_raster_t *raster, pdftoraster_doc_t* doc, conversion_function_t *convert, cf_logfunc_t log, void* ld)
 {
   doc->bitspercolor = doc->header.cupsBitsPerColor;
   if ((doc->colour_profile.colorProfile == NULL || doc->colour_profile.popplerColorProfile == doc->colour_profile.colorProfile)
@@ -1148,7 +1148,7 @@ static int selectConvertFunc(cups_raster_t *raster, pdftoraster_doc_t* doc, conv
                            CHANNELS_SH(doc->header.cupsNumColors) |
                            BYTES_SH(bytes),
                            doc->colour_profile.renderingIntent,0)) == 0) {
-      if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "cfFilterPDFToRaster: Can't create color transform.");
       return (1);
     }
@@ -1220,7 +1220,7 @@ static int selectConvertFunc(cups_raster_t *raster, pdftoraster_doc_t* doc, conv
       convert->convertCSpace = W8toK8;
       break;
     default:
-      if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "cfFilterPDFToRaster: Specified ColorSpace is not supported");
       return (1);
     }
@@ -1361,7 +1361,7 @@ static void writePageImage(cups_raster_t *raster, pdftoraster_doc_t *doc,
 }
 
 static int outPage(pdftoraster_doc_t *doc, int pageNo, cf_filter_data_t *data,
-  cups_raster_t *raster, conversion_function_t *convert, filter_logfunc_t log, void* ld, cf_filter_iscanceledfunc_t iscanceled, void *icd)
+  cups_raster_t *raster, conversion_function_t *convert, cf_logfunc_t log, void* ld, cf_filter_iscanceledfunc_t iscanceled, void *icd)
 {
   int rotate = 0;
   double paperdimensions[2], /* Physical size of the paper */
@@ -1386,7 +1386,7 @@ static int outPage(pdftoraster_doc_t *doc, int pageNo, cf_filter_data_t *data,
      break;
      default:rotate=0;
   }
-  if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+  if (log) log(ld, CF_LOGLEVEL_DEBUG,
               "cfFilterPDFToRaster: mediabox = [ %f %f %f %f ]; rotate = %d",
               mediaBox.left(), mediaBox.top(), mediaBox.right(),
               mediaBox.bottom(), rotate);
@@ -1493,7 +1493,7 @@ static int outPage(pdftoraster_doc_t *doc, int pageNo, cf_filter_data_t *data,
     doc->header.cupsBytesPerLine *= doc->header.cupsNumColors;
   }
   if (!cupsRasterWriteHeader2(raster,&(doc->header))) {
-    if (log) log(ld,FILTER_LOGLEVEL_ERROR,
+    if (log) log(ld,CF_LOGLEVEL_ERROR,
                 "cfFilterPDFToRaster: Cannot write page %d header", pageNo);
     return (1);
   }
@@ -1503,7 +1503,7 @@ static int outPage(pdftoraster_doc_t *doc, int pageNo, cf_filter_data_t *data,
   return (0);
 }
 
-static int setPopplerColorProfile(pdftoraster_doc_t *doc, filter_logfunc_t log, void *ld)
+static int setPopplerColorProfile(pdftoraster_doc_t *doc, cf_logfunc_t log, void *ld)
 {
   if (doc->header.cupsBitsPerColor != 8 && doc->header.cupsBitsPerColor != 16) {
     /* color Profile is not supported */
@@ -1582,7 +1582,7 @@ static int setPopplerColorProfile(pdftoraster_doc_t *doc, filter_logfunc_t log,
     doc->colour_profile.popplerColorProfile = NULL;
     break;
   default:
-    if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+    if (log) log(ld, CF_LOGLEVEL_ERROR,
                 "cfFilterPDFToRaster: Specified ColorSpace is not supported");
     return (1);
     break;
@@ -1601,7 +1601,7 @@ int cfFilterPDFToRaster(int inputfd,         /* I - File descriptor input stream
   int npages = 0;
   cups_raster_t *raster = NULL;
   cups_file_t           *inputfp;              /* Print file */
-  filter_logfunc_t     log = data->logfunc;
+  cf_logfunc_t     log = data->logfunc;
   void          *ld = data->logdata;
   int deviceCopies = 1;
   bool deviceCollate = false;
@@ -1621,7 +1621,7 @@ int cfFilterPDFToRaster(int inputfd,         /* I - File descriptor input stream
   {
     if (!iscanceled || !iscanceled(icd))
     {
-      if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "cfFilterPDFToRaster: Unable to open input data stream.");
     }
 
@@ -1640,7 +1640,7 @@ int cfFilterPDFToRaster(int inputfd,         /* I - File descriptor input stream
 
   fd = cupsTempFd(name,sizeof(name));
   if (fd < 0) {
-    if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+    if (log) log(ld, CF_LOGLEVEL_ERROR,
                 "cfFilterPDFToRaster: Can't create temporary file.");
     return (1);
   }
@@ -1648,7 +1648,7 @@ int cfFilterPDFToRaster(int inputfd,         /* I - File descriptor input stream
   /* copy input data to the tmp file */
   while ((n = read(inputfd, buf, BUFSIZ)) > 0) {
     if (write(fd, buf, n) != n) {
-      if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "cfFilterPDFToRaster: Can't copy input data to temporary file.");
       close(fd);
       unlink(name);
@@ -1668,7 +1668,7 @@ int cfFilterPDFToRaster(int inputfd,         /* I - File descriptor input stream
 
   FILE *fp;
   if ((fp = fdopen(inputfd,"rb")) == 0) {
-    if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+    if (log) log(ld, CF_LOGLEVEL_ERROR,
                 "cfFilterPDFToRaster: Can't open input file.");
     ret = 1;
     goto out;
@@ -1692,7 +1692,7 @@ int cfFilterPDFToRaster(int inputfd,         /* I - File descriptor input stream
      && doc.header.cupsBitsPerColor != 4
      && doc.header.cupsBitsPerColor != 8
      && doc.header.cupsBitsPerColor != 16) {
-    if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+    if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "cfFilterPDFToRaster: Specified color format is not supported.");
     ret = 1;
     goto out;
@@ -1730,7 +1730,7 @@ int cfFilterPDFToRaster(int inputfd,         /* I - File descriptor input stream
     if (doc.header.cupsColorOrder != CUPS_ORDER_CHUNKED
        || (doc.header.cupsBitsPerColor != 8
           && doc.header.cupsBitsPerColor != 16)) {
-      if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "cfFilterPDFToRaster: Specified color format is not supported.");
       ret = 1;
       goto out;
@@ -1760,14 +1760,14 @@ int cfFilterPDFToRaster(int inputfd,         /* I - File descriptor input stream
     doc.popplerNumColors = 1;
     break;
   default:
-    if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+    if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "cfFilterPDFToRaster: Specified ColorSpace is not supported.");
     ret = 1;
     goto out;
   }
   if (!(doc.colour_profile.cm_disabled)) {
     if (setPopplerColorProfile(&doc, log, ld) != 0) {
-      if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "cfFilterPDFToRaster: Cannot set color profile.");
       ret = 1;
       goto out;
@@ -1776,7 +1776,7 @@ int cfFilterPDFToRaster(int inputfd,         /* I - File descriptor input stream
 
   if ((raster = cupsRasterOpen(outputfd, doc.pwgraster ? CUPS_RASTER_WRITE_PWG :
                               CUPS_RASTER_WRITE)) == 0) {
-    if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+    if (log) log(ld, CF_LOGLEVEL_ERROR,
                 "cfFilterPDFToRaster: Cannot open raster stream.");
     ret = 1;
     goto out;
@@ -1784,7 +1784,7 @@ int cfFilterPDFToRaster(int inputfd,         /* I - File descriptor input stream
   memset(&convert, 0, sizeof(conversion_function_t));
   if (selectConvertFunc(raster, &doc, &convert, log, ld) == 1)
   {
-    if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+    if (log) log(ld, CF_LOGLEVEL_ERROR,
                 "cfFilterPDFToRaster: Unable to select color conversion function.");
     ret = 1;
     goto out;
@@ -1793,14 +1793,14 @@ int cfFilterPDFToRaster(int inputfd,         /* I - File descriptor input stream
     for (i = 1;i <= npages;i++) {
       if (outPage(&doc,i,data,raster, &convert, log, ld, iscanceled, icd) == 1)
       {
-       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+       if (log) log(ld, CF_LOGLEVEL_DEBUG,
                     "cfFilterPDFToRaster: Unable to output page %d.", i);
        ret = 1;
        goto out;
       }
     }
   } else
-    if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "cfFilterPDFToRaster: Input is empty outputting empty file.");
 
  out:
index f9bc01e13d4a382a03b14889f4a5697851d9e80a..d70258ddc9dc72ab5aa19b54d708ecf2eef614af 100644 (file)
@@ -123,7 +123,7 @@ typedef struct                              /**** Document information ****/
                 PageLength;             /* Total page length */
   cups_file_t  *inputfp;               /* Temporary file, if any */
   FILE         *outputfp;              /* Temporary file, if any */
-  filter_logfunc_t logfunc;             /* Logging function, NULL for no
+  cf_logfunc_t logfunc;             /* Logging function, NULL for no
                                           logging */
   void          *logdata;               /* User data for logging function, can
                                           be NULL */
@@ -192,7 +192,7 @@ static int          set_pstops_options(pstops_doc_t *doc, ppd_file_t *ppd,
                                           char *job_title, int copies,
                                           int num_options,
                                           cups_option_t *options,
-                                          filter_logfunc_t logfunc,
+                                          cf_logfunc_t logfunc,
                                           void *logdata,
                                           cf_filter_iscanceledfunc_t
                                           iscanceledfunc,
@@ -231,7 +231,7 @@ cfFilterPSToPS(int inputfd,         /* I - File descriptor input stream */
           buffer[8192];                /* Line buffers */
   ssize_t      len,bytes;                      /* Length of line buffers */
   pstops_page_t *pageinfo;
-  filter_logfunc_t log = data->logfunc;
+  cf_logfunc_t log = data->logfunc;
   void          *ld = data->logdata;
   cf_filter_iscanceledfunc_t iscanceled = data->iscanceledfunc;
   void          *icd = data->iscanceleddata;
@@ -268,7 +268,7 @@ cfFilterPSToPS(int inputfd,         /* I - File descriptor input stream */
  {   
      if(pipe(proc_pipe))
      {
-        if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+        if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "cfFilterPSToPS: Unable to create pipe for input-page-ranges");
                   return (1);
      }
@@ -280,7 +280,7 @@ cfFilterPSToPS(int inputfd,         /* I - File descriptor input stream */
      {
         if (!iscanceled || !iscanceled(icd))
         {
-        if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+        if (log) log(ld, CF_LOGLEVEL_DEBUG,
                     "cfFilterPSToPS: Unable to open input data stream.");
         }
 
@@ -344,7 +344,7 @@ cfFilterPSToPS(int inputfd,         /* I - File descriptor input stream */
   {
     if (!iscanceled || !iscanceled(icd))
     {
-      if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+      if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "cfFilterPSToPS: Unable to open input data stream.");
     }
 
@@ -359,7 +359,7 @@ cfFilterPSToPS(int inputfd,         /* I - File descriptor input stream */
   {
     if (!iscanceled || !iscanceled(icd))
     {
-      if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+      if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "cfFilterPSToPS: Unable to open output data stream.");
     }
 
@@ -374,7 +374,7 @@ cfFilterPSToPS(int inputfd,         /* I - File descriptor input stream */
 
   if ((len = (ssize_t)cupsFileGetLine(inputfp, line, sizeof(line))) == 0)
   {
-    if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "cfFilterPSToPS: The print file is empty.");
     /* Do not treat this an error, if a previous filter eliminated all
        pages the job should get dequeued without anything printed. */
@@ -414,7 +414,7 @@ cfFilterPSToPS(int inputfd,         /* I - File descriptor input stream */
     * with "ENTER LANGUAGE"...
     */
 
-    if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "cfFilterPSToPS: Skipping PJL header...");
 
     while (strstr(line, "ENTER LANGUAGE") == NULL && strncmp(line, "%!", 2))
@@ -501,7 +501,7 @@ cfFilterPSToPS(int inputfd,         /* I - File descriptor input stream */
         if (waitpid (pstops_pid, &childStatus, 0) == -1) {
           if (errno == EINTR)
             goto retry_wait;
-          if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+          if (log) log(ld, CF_LOGLEVEL_ERROR,
           "cfFilterPSToPS: Error while waiting for input_page_ranges to finish - %s.",
           strerror(errno));
         }
@@ -509,18 +509,18 @@ cfFilterPSToPS(int inputfd,         /* I - File descriptor input stream */
     if (childStatus) {
       if (WIFEXITED(childStatus)) {
        /* Via exit() anywhere or return() in the main() function */
-       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+       if (log) log(ld, CF_LOGLEVEL_ERROR,
                     "cfFilterPSToPS: input-page-ranges filter (PID %d) stopped with status %d",
                     pstops_pid, WEXITSTATUS(childStatus));
       } else {
        /* Via signal */
-       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+       if (log) log(ld, CF_LOGLEVEL_ERROR,
                     "cfFilterPSToPS: imput-page-ranges filter (PID %d) crashed on signal %d",
                     pstops_pid, WTERMSIG(childStatus));
       }
       status=1;
     } else {
-      if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+      if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "cfFilterPSToPS: input-page-ranges-filter (PID %d) exited with no errors.",
                   pstops_pid);
     }
@@ -545,7 +545,7 @@ add_page(pstops_doc_t *doc,         /* I - Document information */
          const char   *label)          /* I - Page label */
 {
   pstops_page_t        *pageinfo;              /* New page info object */
-  filter_logfunc_t log = doc->logfunc;
+  cf_logfunc_t log = doc->logfunc;
   void          *ld = doc->logdata;
 
 
@@ -554,14 +554,14 @@ add_page(pstops_doc_t *doc,               /* I - Document information */
 
   if (!doc->pages)
   {
-    if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+    if (log) log(ld, CF_LOGLEVEL_ERROR,
                 "cfFilterPSToPS: Unable to allocate memory for pages array");
     return (NULL);
   }
 
   if ((pageinfo = calloc(1, sizeof(pstops_page_t))) == NULL)
   {
-    if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+    if (log) log(ld, CF_LOGLEVEL_ERROR,
                 "cfFilterPSToPS: Unable to allocate memory for page info");
     return (NULL);
   }
@@ -656,7 +656,7 @@ copy_bytes(pstops_doc_t *doc,               /* I - Document info */
   char         buffer[8192];           /* Data buffer */
   ssize_t      nbytes;                 /* Number of bytes read */
   size_t       nleft;                  /* Number of bytes left/remaining */
-  filter_logfunc_t log = doc->logfunc;
+  cf_logfunc_t log = doc->logfunc;
   void          *ld = doc->logdata;
 
 
@@ -664,7 +664,7 @@ copy_bytes(pstops_doc_t *doc,               /* I - Document info */
 
   if (cupsFileSeek(doc->temp, offset) < 0)
   {
-    if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+    if (log) log(ld, CF_LOGLEVEL_ERROR,
                 "Unable to seek in file");
     return;
   }
@@ -704,7 +704,7 @@ copy_comments(pstops_doc_t *doc,    /* I - Document info */
        saw_for,                        /* Saw %%For: comment? */
        saw_pages,                      /* Saw %%Pages: comment? */
        saw_title;                      /* Saw %%Title: comment? */
-  filter_logfunc_t log = doc->logfunc;
+  cf_logfunc_t log = doc->logfunc;
   void          *ld = doc->logdata;
 
 
@@ -737,7 +737,7 @@ copy_comments(pstops_doc_t *doc,    /* I - Document info */
     * Log the header...
     */
 
-    if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "cfFilterPSToPS: %s", line);
 
    /*
@@ -749,7 +749,7 @@ copy_comments(pstops_doc_t *doc,    /* I - Document info */
       int      pages;                  /* Number of pages */
 
       if (saw_pages && log)
-       log(ld, FILTER_LOGLEVEL_DEBUG,
+       log(ld, CF_LOGLEVEL_DEBUG,
            "cfFilterPSToPS: A duplicate %%Pages: comment was seen.");
 
       saw_pages = 1;
@@ -804,7 +804,7 @@ copy_comments(pstops_doc_t *doc,    /* I - Document info */
     {
       if (saw_bounding_box)
       {
-       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+       if (log) log(ld, CF_LOGLEVEL_DEBUG,
                     "cfFilterPSToPS: A duplicate %%BoundingBox: comment was seen.");
       }
       else if (strstr(line + 14, "(atend)"))
@@ -817,7 +817,7 @@ copy_comments(pstops_doc_t *doc,    /* I - Document info */
                      doc->bounding_box + 1, doc->bounding_box + 2,
                      doc->bounding_box + 3) != 4)
       {
-       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+       if (log) log(ld, CF_LOGLEVEL_DEBUG,
                     "cfFilterPSToPS: A bad %%BoundingBox: comment was seen.");
 
        doc->bounding_box[0] = (int)(doc->PageLeft);
@@ -873,11 +873,11 @@ copy_comments(pstops_doc_t *doc,  /* I - Document info */
   }
 
   if (!saw_bounding_box && log)
-    log(ld, FILTER_LOGLEVEL_DEBUG,
+    log(ld, CF_LOGLEVEL_DEBUG,
        "cfFilterPSToPS: There wasn't a %%BoundingBox: comment in the header.");
 
   if (!saw_pages && log)
-    log(ld, FILTER_LOGLEVEL_DEBUG,
+    log(ld, CF_LOGLEVEL_DEBUG,
        "cfFilterPSToPS: There wasn't a %%Pages: comment in the header.");
 
   if (!saw_for)
@@ -942,7 +942,7 @@ copy_dsc(pstops_doc_t *doc,         /* I - Document info */
 {
   int          number;                 /* Page number */
   pstops_page_t        *pageinfo;              /* Page information */
-  filter_logfunc_t log = doc->logfunc;
+  cf_logfunc_t log = doc->logfunc;
   void          *ld = doc->logdata;
   cf_filter_iscanceledfunc_t iscanceled = doc->iscanceledfunc;
   void          *icd = doc->iscanceleddata;
@@ -962,7 +962,7 @@ copy_dsc(pstops_doc_t *doc,         /* I - Document info */
   * Start sending the document with any commands needed...
   */
 
-  if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+  if (log) log(ld, CF_LOGLEVEL_DEBUG,
               "cfFilterPSToPS: Before copy_comments - %s", line);
   linelen = copy_comments(doc, ppd, line, linelen, linesize);
 
@@ -970,7 +970,7 @@ copy_dsc(pstops_doc_t *doc,         /* I - Document info */
   * Now find the prolog section, if any...
   */
 
-  if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+  if (log) log(ld, CF_LOGLEVEL_DEBUG,
               "cfFilterPSToPS: Before copy_prolog - %s", line);
   linelen = copy_prolog(doc, ppd, line, linelen, linesize);
 
@@ -978,7 +978,7 @@ copy_dsc(pstops_doc_t *doc,         /* I - Document info */
   * Then the document setup section...
   */
 
-  if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+  if (log) log(ld, CF_LOGLEVEL_DEBUG,
               "cfFilterPSToPS: Before copy_setup - %s", line);
   linelen = copy_setup(doc, ppd, line, linelen, linesize);
 
@@ -1000,13 +1000,13 @@ copy_dsc(pstops_doc_t *doc,             /* I - Document info */
 
   number = 0;
 
-  if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+  if (log) log(ld, CF_LOGLEVEL_DEBUG,
               "cfFilterPSToPS: Before page loop - %s", line);
   while (!strncmp(line, "%%Page:", 7))
   {
     if (iscanceled && iscanceled(icd))
     {
-      if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+      if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "cfFilterPSToPS: Job canceled");
       break;
     }
@@ -1015,13 +1015,13 @@ copy_dsc(pstops_doc_t *doc,             /* I - Document info */
 
     if (check_range((number - 1) / doc->number_up + 1,doc->page_ranges,doc->page_set))
     {
-      if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+      if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "cfFilterPSToPS: Copying page %d...", number);
       linelen = copy_page(doc, ppd, number, line, linelen, linesize);
     }
     else
     {
-      if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+      if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "cfFilterPSToPS: Skipping page %d...", number);
       linelen = skip_page(doc, line, linelen, linesize);
     }
@@ -1056,7 +1056,7 @@ copy_dsc(pstops_doc_t *doc,               /* I - Document info */
     if (!doc->slow_order)
     {
       if ((!ppd || !ppd->num_filters) && log)
-       log(ld, FILTER_LOGLEVEL_CONTROL,
+       log(ld, CF_LOGLEVEL_CONTROL,
            "PAGE: %d %d", doc->page,
            doc->slow_collate ? 1 : doc->copies);
 
@@ -1103,7 +1103,7 @@ copy_dsc(pstops_doc_t *doc,               /* I - Document info */
     {
       if (iscanceled && iscanceled(icd))
       {
-       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+       if (log) log(ld, CF_LOGLEVEL_DEBUG,
                     "cfFilterPSToPS: Job canceled");
        break;
       }
@@ -1164,7 +1164,7 @@ copy_dsc(pstops_doc_t *doc,               /* I - Document info */
 
        if (iscanceled && iscanceled(icd))
          {
-           if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+           if (log) log(ld, CF_LOGLEVEL_DEBUG,
                         "cfFilterPSToPS: Job canceled");
            break;
          }
@@ -1172,7 +1172,7 @@ copy_dsc(pstops_doc_t *doc,               /* I - Document info */
         number ++;
 
        if ((!ppd || !ppd->num_filters) && log)
-         log(ld, FILTER_LOGLEVEL_CONTROL,
+         log(ld, CF_LOGLEVEL_CONTROL,
              "PAGE: %d %d", number,
              doc->slow_collate ? 1 : doc->copies);
 
@@ -1231,7 +1231,7 @@ copy_non_dsc(pstops_doc_t *doc,           /* I - Document info */
   int          copy;                   /* Current copy */
   char         buffer[8192];           /* Copy buffer */
   ssize_t      bytes;                  /* Number of bytes copied */
-  filter_logfunc_t log = doc->logfunc;
+  cf_logfunc_t log = doc->logfunc;
   void          *ld = doc->logdata;
   cf_filter_iscanceledfunc_t iscanceled = doc->iscanceledfunc;
   void          *icd = doc->iscanceleddata;
@@ -1244,7 +1244,7 @@ copy_non_dsc(pstops_doc_t *doc,           /* I - Document info */
   * that may not print correctly...
   */
 
-  if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+  if (log) log(ld, CF_LOGLEVEL_DEBUG,
               "cfFilterPSToPS: This document does not conform to the Adobe Document "
               "Structuring Conventions and may not print correctly.");
 
@@ -1323,7 +1323,7 @@ copy_non_dsc(pstops_doc_t *doc,           /* I - Document info */
   */
 
   if ((!ppd || !ppd->num_filters) && log)
-    log(ld, FILTER_LOGLEVEL_CONTROL,
+    log(ld, CF_LOGLEVEL_CONTROL,
        "PAGE: 1 %d", doc->temp ? 1 : doc->copies);
 
   fputs("%%Page: 1 1\n", doc->outputfp);
@@ -1371,13 +1371,13 @@ copy_non_dsc(pstops_doc_t *doc,         /* I - Document info */
     {
       if (iscanceled && iscanceled(icd))
       {
-       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+       if (log) log(ld, CF_LOGLEVEL_DEBUG,
                     "cfFilterPSToPS: Job canceled");
        break;
       }
 
       if ((!ppd || !ppd->num_filters) && log)
-       log(ld, FILTER_LOGLEVEL_CONTROL,
+       log(ld, CF_LOGLEVEL_CONTROL,
            "PAGE: 1 1");
 
       fprintf(doc->outputfp, "%%%%Page: %d %d\n", copy + 1, copy + 1);
@@ -1430,7 +1430,7 @@ copy_page(pstops_doc_t *doc,              /* I - Document info */
   int          has_page_setup = 0;     /* Does the page have
                                           %%Begin/EndPageSetup? */
   int          bounding_box[4];        /* PageBoundingBox */
-  filter_logfunc_t log = doc->logfunc;
+  cf_logfunc_t log = doc->logfunc;
   void          *ld = doc->logdata;
 
 
@@ -1442,14 +1442,14 @@ copy_page(pstops_doc_t *doc,            /* I - Document info */
 
   if (!parse_text(line + 7, &ptr, label, sizeof(label)))
   {
-    if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "cfFilterPSToPS: There was a bad %%Page: comment in the file.");
     label[0] = '\0';
     number   = doc->page;
   }
   else if (strtol(ptr, &ptr, 10) == LONG_MAX || !isspace(*ptr & 255))
   {
-    if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "cfFilterPSToPS: There was a bad %%Page: comment in the file.");
     number = doc->page;
   }
@@ -1550,7 +1550,7 @@ copy_page(pstops_doc_t *doc,              /* I - Document info */
                 bounding_box + 3) != 4)
       {
        if (log)
-         log(ld, FILTER_LOGLEVEL_DEBUG,
+         log(ld, CF_LOGLEVEL_DEBUG,
              "cfFilterPSToPS: There was a bad %%PageBoundingBox: comment in the "
              "file.");
         memcpy(bounding_box, doc->bounding_box,
@@ -1565,13 +1565,13 @@ copy_page(pstops_doc_t *doc,            /* I - Document info */
 
        if (log)
        {
-         log(ld, FILTER_LOGLEVEL_DEBUG,
+         log(ld, CF_LOGLEVEL_DEBUG,
              "cfFilterPSToPS: Orientation = %d", doc->Orientation);
-         log(ld, FILTER_LOGLEVEL_DEBUG,
+         log(ld, CF_LOGLEVEL_DEBUG,
              "cfFilterPSToPS: original bounding_box = [ %d %d %d %d ]",
              bounding_box[0], bounding_box[1],
              bounding_box[2], bounding_box[3]);
-         log(ld, FILTER_LOGLEVEL_DEBUG,
+         log(ld, CF_LOGLEVEL_DEBUG,
              "cfFilterPSToPS: PageWidth = %.1f, PageLength = %.1f",
              doc->PageWidth, doc->PageLength);
        }
@@ -1600,7 +1600,7 @@ copy_page(pstops_doc_t *doc,              /* I - Document info */
               break;
        }
 
-       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+       if (log) log(ld, CF_LOGLEVEL_DEBUG,
                     "cfFilterPSToPS: updated bounding_box = [ %d %d %d %d ]",
                     bounding_box[0], bounding_box[1],
                     bounding_box[2], bounding_box[3]);
@@ -1701,7 +1701,7 @@ copy_page(pstops_doc_t *doc,              /* I - Document info */
   if (!doc->slow_order && first_page)
   {
     if ((!ppd || !ppd->num_filters) && log)
-      log(ld, FILTER_LOGLEVEL_CONTROL,
+      log(ld, CF_LOGLEVEL_CONTROL,
          "PAGE: %d %d", doc->page,
          doc->slow_collate ? 1 : doc->copies);
 
@@ -1858,7 +1858,7 @@ copy_page(pstops_doc_t *doc,              /* I - Document info */
        {
          line[0] = '\0';
          if (log)
-           log(ld, FILTER_LOGLEVEL_ERROR,
+           log(ld, CF_LOGLEVEL_ERROR,
                "cfFilterPSToPS: Early end-of-file while reading binary data: %s",
                strerror(errno));
          return (0);
@@ -1901,7 +1901,7 @@ copy_prolog(pstops_doc_t *doc,            /* I - Document info */
            ssize_t      linelen,       /* I - Length of initial line */
            size_t       linesize)      /* I - Size of line buffer */
 {
-  filter_logfunc_t log = doc->logfunc;
+  cf_logfunc_t log = doc->logfunc;
   void          *ld = doc->logdata;
 
 
@@ -1936,7 +1936,7 @@ copy_prolog(pstops_doc_t *doc,            /* I - Document info */
     if (!strncmp(line, "%%EndProlog", 11))
       linelen = (ssize_t)cupsFileGetLine(doc->inputfp, line, linesize);
     else
-      if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+      if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "cfFilterPSToPS: The %%EndProlog comment is missing.");
   }
 
@@ -1962,7 +1962,7 @@ copy_setup(pstops_doc_t *doc,             /* I - Document info */
 {
   int          num_options;            /* Number of options */
   cups_option_t        *options;               /* Options */
-  filter_logfunc_t log = doc->logfunc;
+  cf_logfunc_t log = doc->logfunc;
   void          *ld = doc->logdata;
 
 
@@ -2010,7 +2010,7 @@ copy_setup(pstops_doc_t *doc,             /* I - Document info */
     if (!strncmp(line, "%%EndSetup", 10))
       linelen = (ssize_t)cupsFileGetLine(doc->inputfp, line, linesize);
     else
-      if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+      if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "cfFilterPSToPS: The %%EndSetup comment is missing.");
   }
 
@@ -2041,7 +2041,7 @@ copy_trailer(pstops_doc_t *doc,           /* I - Document info */
             ssize_t      linelen,      /* I - Length of initial line */
             size_t       linesize)     /* I - Size of line buffer */
 {
-  filter_logfunc_t log = doc->logfunc;
+  cf_logfunc_t log = doc->logfunc;
   void          *ld = doc->logdata;
 
 
@@ -2065,7 +2065,7 @@ copy_trailer(pstops_doc_t *doc,           /* I - Document info */
     linelen = (ssize_t)cupsFileGetLine(doc->inputfp, line, linesize);
   }
 
-  if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+  if (log) log(ld, CF_LOGLEVEL_DEBUG,
               "cfFilterPSToPS: Wrote %d pages...", number);
 
   fprintf(doc->outputfp, "%%%%Pages: %d\n", number);
@@ -2243,7 +2243,7 @@ doc_printf(pstops_doc_t *doc,             /* I - Document information */
   va_list      ap;                     /* Pointer to arguments */
   char         buffer[1024];           /* Output buffer */
   ssize_t      bytes;                  /* Number of bytes to write */
-  filter_logfunc_t log = doc->logfunc;
+  cf_logfunc_t log = doc->logfunc;
   void          *ld = doc->logdata;
 
 
@@ -2253,7 +2253,7 @@ doc_printf(pstops_doc_t *doc,             /* I - Document information */
 
   if ((size_t)bytes > sizeof(buffer))
   {
-    if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+    if (log) log(ld, CF_LOGLEVEL_ERROR,
                 "cfFilterPSToPS: Buffer overflow detected, truncating.");
     bytes = sizeof(buffer);
   }
@@ -2377,7 +2377,7 @@ include_feature(
   char         name[255],              /* Option name */
                value[255];             /* Option value */
   ppd_option_t *option;                /* Option in file */
-  filter_logfunc_t log = doc->logfunc;
+  cf_logfunc_t log = doc->logfunc;
   void          *ld = doc->logdata;
 
 
@@ -2387,7 +2387,7 @@ include_feature(
 
   if (sscanf(line + 17, "%254s%254s", name, value) != 2)
   {
-    if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "cfFilterPSToPS: The %%IncludeFeature: comment is not valid.");
     return (num_options);
   }
@@ -2398,7 +2398,7 @@ include_feature(
 
   if ((option = ppdFindOption(ppd, name + 1)) == NULL)
   {
-    if (log) log(ld, FILTER_LOGLEVEL_WARN,
+    if (log) log(ld, CF_LOGLEVEL_WARN,
                 "cfFilterPSToPS: Unknown option \"%s\".", name + 1);
     return (num_options);
   }
@@ -2406,7 +2406,7 @@ include_feature(
   if (option->section == PPD_ORDER_EXIT ||
       option->section == PPD_ORDER_JCL)
   {
-    if (log) log(ld, FILTER_LOGLEVEL_WARN,
+    if (log) log(ld, CF_LOGLEVEL_WARN,
                 "cfFilterPSToPS: Option \"%s\" cannot be included via "
                 "%%%%IncludeFeature.", name + 1);
     return (num_options);
@@ -2414,7 +2414,7 @@ include_feature(
 
   if (!ppdFindChoice(option, value))
   {
-    if (log) log(ld, FILTER_LOGLEVEL_WARN,
+    if (log) log(ld, CF_LOGLEVEL_WARN,
                 "cfFilterPSToPS: Unknown choice \"%s\" for option \"%s\".",
                 value, name + 1);
     return (num_options);
@@ -2531,7 +2531,7 @@ set_pstops_options(
     int           copies,               /* I - Number of copies */
     int           num_options,         /* I - Number of options */
     cups_option_t *options,            /* I - Options */
-    filter_logfunc_t logfunc,           /* I - Logging function,
+    cf_logfunc_t logfunc,           /* I - Logging function,
                                               NULL for no logging */
     void *logdata,                      /* I - User data for logging function,
                                               can be NULL */
@@ -2548,7 +2548,7 @@ set_pstops_options(
   ppd_choice_t *choice;                /* PPD choice */
   const char   *content_type;          /* Original content type */
   int          max_copies;             /* Maximum number of copies supported */
-  filter_logfunc_t log = logfunc;
+  cf_logfunc_t log = logfunc;
   void          *ld = logdata;
   cf_filter_iscanceledfunc_t iscanceled = iscanceledfunc;
   void          *icd = iscanceleddata;
@@ -2716,7 +2716,7 @@ set_pstops_options(
           doc->number_up = intval;
          break;
       default :
-         if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+         if (log) log(ld, CF_LOGLEVEL_ERROR,
                       "cfFilterPSToPS: Unsupported number-up value %d, using "
                       "number-up=1.", intval);
           doc->number_up = 1;
@@ -2750,7 +2750,7 @@ set_pstops_options(
       doc->number_up_layout = PSTOPS_LAYOUT_BTRL;
     else
     {
-      if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "cfFilterPSToPS: Unsupported number-up-layout value %s, using "
                   "number-up-layout=lrtb.", val);
       doc->number_up_layout = PSTOPS_LAYOUT_LRTB;
@@ -2801,7 +2801,7 @@ set_pstops_options(
       doc->page_border = PSTOPS_BORDERDOUBLE2;
     else
     {
-      if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "cfFilterPSToPS: Unsupported page-border value %s, using "
                   "page-border=none.", val);
       doc->page_border = PSTOPS_BORDERNONE;
@@ -2913,7 +2913,7 @@ set_pstops_options(
     if ((doc->temp = cupsTempFile2(doc->tempfile,
                                    sizeof(doc->tempfile))) == NULL)
     {
-      if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "cfFilterPSToPS: Unable to create temporary file: %s",
                   strerror(errno));
       return (1);
@@ -2934,7 +2934,7 @@ set_pstops_options(
     doc->use_ESPshowpage = 1;
   }
 
-  if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+  if (log) log(ld, CF_LOGLEVEL_DEBUG,
               "cfFilterPSToPS: slow_collate=%d, slow_duplex=%d, slow_order=%d",
               doc->slow_collate, doc->slow_duplex, doc->slow_order);
 
@@ -2953,7 +2953,7 @@ skip_page(pstops_doc_t *doc,              /* I - Document information */
           size_t      linesize)                /* I - Size of line buffer */
 {
   int  level;                          /* Embedded document level */
-  filter_logfunc_t log = doc->logfunc;
+  cf_logfunc_t log = doc->logfunc;
   void          *ld = doc->logdata;
 
 
@@ -2993,7 +2993,7 @@ skip_page(pstops_doc_t *doc,              /* I - Document information */
        {
          line[0] = '\0';
          if (log)
-           log(ld, FILTER_LOGLEVEL_ERROR,
+           log(ld, CF_LOGLEVEL_ERROR,
                "cfFilterPSToPS: Early end-of-file while reading binary data: %s",
                strerror(errno));
          return (0);
@@ -3029,7 +3029,7 @@ start_nup(pstops_doc_t *doc,              /* I - Document information */
                bboxw,                  /* BoundingBox width */
                bboxl;                  /* BoundingBox height */
   double       margin = 0;             /* Current margin for border */
-  filter_logfunc_t log = doc->logfunc;
+  cf_logfunc_t log = doc->logfunc;
   void          *ld = doc->logdata;
 
 
@@ -3057,18 +3057,18 @@ start_nup(pstops_doc_t *doc,            /* I - Document information */
 
   if (log)
   {
-    log(ld, FILTER_LOGLEVEL_DEBUG,
+    log(ld, CF_LOGLEVEL_DEBUG,
        "cfFilterPSToPS: pagew = %.1f, pagel = %.1f", pagew, pagel);
-    log(ld, FILTER_LOGLEVEL_DEBUG,
+    log(ld, CF_LOGLEVEL_DEBUG,
        "cfFilterPSToPS: bboxx = %d, bboxy = %d, bboxw = %d, bboxl = %d",
        bboxx, bboxy, bboxw, bboxl);
-    log(ld, FILTER_LOGLEVEL_DEBUG,
+    log(ld, CF_LOGLEVEL_DEBUG,
        "cfFilterPSToPS: PageLeft = %.1f, PageRight = %.1f",
        doc->PageLeft, doc->PageRight);
-    log(ld, FILTER_LOGLEVEL_DEBUG,
+    log(ld, CF_LOGLEVEL_DEBUG,
        "cfFilterPSToPS: PageTop = %.1f, PageBottom = %.1f",
        doc->PageTop, doc->PageBottom);
-    log(ld, FILTER_LOGLEVEL_DEBUG,
+    log(ld, CF_LOGLEVEL_DEBUG,
        "cfFilterPSToPS: PageWidth = %.1f, PageLength = %.1f",
        doc->PageWidth, doc->PageLength);
   }
index b1cb35fb3004638f1dd95659576bd459dbcac72b..031378c8b0ee39e48c4f43812d52fbde374085e8 100644 (file)
@@ -113,7 +113,7 @@ typedef struct pwgtoraster_doc_s
   ppd_file_t *ppd;
   cups_page_header2_t inheader;
   cups_page_header2_t outheader;
-  filter_logfunc_t logfunc;             /* Logging function, NULL for no
+  cf_logfunc_t logfunc;             /* Logging function, NULL for no
                                           logging */
   void          *logdata;               /* User data for logging function, can
                                           be NULL */
@@ -295,7 +295,7 @@ static int parseOpts(cf_filter_data_t *data,
   char *profile = NULL;
   ppd_attr_t *attr;
   const char *val;
-  filter_logfunc_t log = data->logfunc;
+  cf_logfunc_t log = data->logfunc;
   void *ld = data ->logdata;
   cups_cspace_t         cspace = (cups_cspace_t)(-1);
 
@@ -321,7 +321,7 @@ static int parseOpts(cf_filter_data_t *data,
                          CF_FILTER_OUT_FORMAT_CUPS_RASTER : outformat, 0, &cspace);
 
   if (doc->ppd) {
-    if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "cfFilterPWGToRaster: Using PPD file: %s", doc->ppd->nickname);
     ppdMarkOptions(doc->ppd,num_options,options);
     handleRequiresPageRegion(doc);
@@ -397,7 +397,7 @@ static int parseOpts(cf_filter_data_t *data,
       free(profile);
     }
   } else {
-    if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if (log) log(ld, CF_LOGLEVEL_DEBUG,
       "cfFilterPWGToRaster: No PPD file is specified.");
     if (strcasecmp(doc->outheader.cupsRenderingIntent, "Perceptual") == 0) {
       doc->color_profile.renderingIntent = INTENT_PERCEPTUAL;
@@ -413,7 +413,7 @@ static int parseOpts(cf_filter_data_t *data,
                            && !strncasecmp(val, "bi-level", 8))
     doc->bi_level = 1;
 
-  if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+  if (log) log(ld, CF_LOGLEVEL_DEBUG,
               "cfFilterPWGToRaster: Page size %s: %s",
               doc->page_size_requested ? "requested" : "default",
               doc->outheader.cupsPageSizeName);
@@ -924,7 +924,7 @@ static unsigned int getCMSColorSpaceType(cmsColorSpaceSignature cs)
 static int selectConvertFunc(cups_raster_t *raster,
                             pwgtoraster_doc_t* doc,
                             conversion_function_t *convert,
-                            filter_logfunc_t log,
+                            cf_logfunc_t log,
                             void* ld)
 {
   doc->bitspercolor = doc->outheader.cupsBitsPerColor;
@@ -1009,7 +1009,7 @@ static int selectConvertFunc(cups_raster_t *raster,
                            CHANNELS_SH(doc->outheader.cupsNumColors) |
                            BYTES_SH(bytes),
                            doc->color_profile.renderingIntent,0)) == 0) {
-      if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "cfFilterPWGToRaster: Can't create color transform.");
       return (1);
     }
@@ -1081,7 +1081,7 @@ static int selectConvertFunc(cups_raster_t *raster,
       convert->convertCSpace = W8toK8;
       break;
     default:
-      if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "cfFilterPWGToRaster: Specified ColorSpace is not supported");
       return (1);
       break;
@@ -1101,7 +1101,7 @@ static bool outPage(pwgtoraster_doc_t *doc,
                    cups_raster_t *inras,
                    cups_raster_t *outras,
                    conversion_function_t *convert,
-                   filter_logfunc_t log,
+                   cf_logfunc_t log,
                    void *ld,
                    cf_filter_iscanceledfunc_t iscanceled,
                    void *icd)
@@ -1135,7 +1135,7 @@ static bool outPage(pwgtoraster_doc_t *doc,
   if (iscanceled && iscanceled(icd))
   {
     // Canceled
-    log(ld, FILTER_LOGLEVEL_DEBUG,
+    log(ld, CF_LOGLEVEL_DEBUG,
        "cfFilterPWGToRaster: Job canceled on input page %d", pageNo);
     return (false);
   }
@@ -1143,7 +1143,7 @@ static bool outPage(pwgtoraster_doc_t *doc,
   if (!cupsRasterReadHeader2(inras, &(doc->inheader)))
   {
     // Done
-    log(ld, FILTER_LOGLEVEL_DEBUG,
+    log(ld, CF_LOGLEVEL_DEBUG,
        "cfFilterPWGToRaster: Job completed");
     return (false);
   }
@@ -1158,37 +1158,37 @@ static bool outPage(pwgtoraster_doc_t *doc,
     // Raster and Apple Raster (the input formats supported by this
     // filter function) these values are all zero. With at least one not
     // zero we consider the input not supported.
-    log(ld, FILTER_LOGLEVEL_ERROR,
+    log(ld, CF_LOGLEVEL_ERROR,
        "cfFilterPWGToRaster: Input page %d is not PWG or Apple Raster", pageNo);
     return (false);
   }
   
   if (log) {
-    log(ld, FILTER_LOGLEVEL_DEBUG,
+    log(ld, CF_LOGLEVEL_DEBUG,
        "cfFilterPWGToRaster: Input page %d", pageNo);
-    log(ld, FILTER_LOGLEVEL_DEBUG,
+    log(ld, CF_LOGLEVEL_DEBUG,
        "cfFilterPWGToRaster:   HWResolution = [ %d %d ]",
        doc->inheader.HWResolution[0], doc->inheader.HWResolution[1]);
-    log(ld, FILTER_LOGLEVEL_DEBUG,
+    log(ld, CF_LOGLEVEL_DEBUG,
        "cfFilterPWGToRaster:   PageSize = [ %d %d ]",
        doc->inheader.PageSize[0], doc->inheader.PageSize[1]);
-    log(ld, FILTER_LOGLEVEL_DEBUG,
+    log(ld, CF_LOGLEVEL_DEBUG,
        "cfFilterPWGToRaster:   cupsWidth = %d", doc->inheader.cupsWidth);
-    log(ld, FILTER_LOGLEVEL_DEBUG,
+    log(ld, CF_LOGLEVEL_DEBUG,
        "cfFilterPWGToRaster:   cupsHeight = %d", doc->inheader.cupsHeight);
-    log(ld, FILTER_LOGLEVEL_DEBUG,
+    log(ld, CF_LOGLEVEL_DEBUG,
        "cfFilterPWGToRaster:   cupsBitsPerColor = %d", doc->inheader.cupsBitsPerColor);
-    log(ld, FILTER_LOGLEVEL_DEBUG,
+    log(ld, CF_LOGLEVEL_DEBUG,
        "cfFilterPWGToRaster:   cupsBitsPerPixel = %d", doc->inheader.cupsBitsPerPixel);
-    log(ld, FILTER_LOGLEVEL_DEBUG,
+    log(ld, CF_LOGLEVEL_DEBUG,
        "cfFilterPWGToRaster:   cupsBytesPerLine = %d", doc->inheader.cupsBytesPerLine);
-    log(ld, FILTER_LOGLEVEL_DEBUG,
+    log(ld, CF_LOGLEVEL_DEBUG,
        "cfFilterPWGToRaster:   cupsColorOrder = %d", doc->inheader.cupsColorOrder);
-    log(ld, FILTER_LOGLEVEL_DEBUG,
+    log(ld, CF_LOGLEVEL_DEBUG,
        "cfFilterPWGToRaster:   cupsColorSpace = %d", doc->inheader.cupsColorSpace);
-    log(ld, FILTER_LOGLEVEL_DEBUG,
+    log(ld, CF_LOGLEVEL_DEBUG,
        "cfFilterPWGToRaster:   cupsCompression = %d", doc->inheader.cupsCompression);
-    log(ld, FILTER_LOGLEVEL_DEBUG,
+    log(ld, CF_LOGLEVEL_DEBUG,
        "cfFilterPWGToRaster:   cupsPageSizeName = %s", doc->inheader.cupsPageSizeName);
   }
 
@@ -1276,66 +1276,66 @@ static bool outPage(pwgtoraster_doc_t *doc,
     doc->outheader.cupsBytesPerLine *= doc->outheader.cupsNumColors;
 
   if (!cupsRasterWriteHeader2(outras, &(doc->outheader))) {
-    if (log) log(ld,FILTER_LOGLEVEL_ERROR,
+    if (log) log(ld,CF_LOGLEVEL_ERROR,
                 "cfFilterPWGToRaster: Can't write page %d header", pageNo);
     return (false);
   }
 
   if (log) {
-    log(ld, FILTER_LOGLEVEL_DEBUG,
+    log(ld, CF_LOGLEVEL_DEBUG,
        "cfFilterPWGToRaster: Output page %d", pageNo);
     if (doc->outheader.ImagingBoundingBox[3] > 0)
-      log(ld, FILTER_LOGLEVEL_DEBUG,
+      log(ld, CF_LOGLEVEL_DEBUG,
          "cfFilterPWGToRaster:   Duplex = %d", doc->outheader.Duplex);
-    log(ld, FILTER_LOGLEVEL_DEBUG,
+    log(ld, CF_LOGLEVEL_DEBUG,
        "cfFilterPWGToRaster:   HWResolution = [ %d %d ]",
        doc->outheader.HWResolution[0], doc->outheader.HWResolution[1]);
     if (doc->outheader.ImagingBoundingBox[3] > 0)
     {
-      log(ld, FILTER_LOGLEVEL_DEBUG,
+      log(ld, CF_LOGLEVEL_DEBUG,
          "cfFilterPWGToRaster:   ImagingBoundingBox = [ %d %d %d %d ]",
          doc->outheader.ImagingBoundingBox[0],
          doc->outheader.ImagingBoundingBox[1],
          doc->outheader.ImagingBoundingBox[2],
          doc->outheader.ImagingBoundingBox[3]);
-      log(ld, FILTER_LOGLEVEL_DEBUG,
+      log(ld, CF_LOGLEVEL_DEBUG,
          "cfFilterPWGToRaster:   Margins = [ %d %d ]",
          doc->outheader.Margins[0], doc->outheader.Margins[1]);
-      log(ld, FILTER_LOGLEVEL_DEBUG,
+      log(ld, CF_LOGLEVEL_DEBUG,
          "cfFilterPWGToRaster:   ManualFeed = %d", doc->outheader.ManualFeed);
-      log(ld, FILTER_LOGLEVEL_DEBUG,
+      log(ld, CF_LOGLEVEL_DEBUG,
          "cfFilterPWGToRaster:   MediaPosition = %d", doc->outheader.MediaPosition);
-      log(ld, FILTER_LOGLEVEL_DEBUG,
+      log(ld, CF_LOGLEVEL_DEBUG,
          "cfFilterPWGToRaster:   NumCopies = %d", doc->outheader.NumCopies);
-      log(ld, FILTER_LOGLEVEL_DEBUG,
+      log(ld, CF_LOGLEVEL_DEBUG,
          "cfFilterPWGToRaster:   Orientation = %d", doc->outheader.Orientation);
     }
-    log(ld, FILTER_LOGLEVEL_DEBUG,
+    log(ld, CF_LOGLEVEL_DEBUG,
        "cfFilterPWGToRaster:   PageSize = [ %d %d ]",
        doc->outheader.PageSize[0], doc->outheader.PageSize[1]);
-    log(ld, FILTER_LOGLEVEL_DEBUG,
+    log(ld, CF_LOGLEVEL_DEBUG,
        "cfFilterPWGToRaster:   cupsWidth = %d", doc->outheader.cupsWidth);
-    log(ld, FILTER_LOGLEVEL_DEBUG,
+    log(ld, CF_LOGLEVEL_DEBUG,
        "cfFilterPWGToRaster:   cupsHeight = %d", doc->outheader.cupsHeight);
     if (doc->outheader.ImagingBoundingBox[3] > 0)
-      log(ld, FILTER_LOGLEVEL_DEBUG,
+      log(ld, CF_LOGLEVEL_DEBUG,
          "cfFilterPWGToRaster:   cupsMediaType = %d", doc->outheader.cupsMediaType);
-    log(ld, FILTER_LOGLEVEL_DEBUG,
+    log(ld, CF_LOGLEVEL_DEBUG,
        "cfFilterPWGToRaster:   cupsBitsPerColor = %d",
        doc->outheader.cupsBitsPerColor);
-    log(ld, FILTER_LOGLEVEL_DEBUG,
+    log(ld, CF_LOGLEVEL_DEBUG,
        "cfFilterPWGToRaster:   cupsBitsPerPixel = %d",
        doc->outheader.cupsBitsPerPixel);
-    log(ld, FILTER_LOGLEVEL_DEBUG,
+    log(ld, CF_LOGLEVEL_DEBUG,
        "cfFilterPWGToRaster:   cupsBytesPerLine = %d",
        doc->outheader.cupsBytesPerLine);
-    log(ld, FILTER_LOGLEVEL_DEBUG,
+    log(ld, CF_LOGLEVEL_DEBUG,
        "cfFilterPWGToRaster:   cupsColorOrder = %d", doc->outheader.cupsColorOrder);
-    log(ld, FILTER_LOGLEVEL_DEBUG,
+    log(ld, CF_LOGLEVEL_DEBUG,
        "cfFilterPWGToRaster:   cupsColorSpace = %d", doc->outheader.cupsColorSpace);
-    log(ld, FILTER_LOGLEVEL_DEBUG,
+    log(ld, CF_LOGLEVEL_DEBUG,
        "cfFilterPWGToRaster:   cupsCompression = %d", doc->outheader.cupsCompression);
-    log(ld, FILTER_LOGLEVEL_DEBUG,
+    log(ld, CF_LOGLEVEL_DEBUG,
        "cfFilterPWGToRaster:   cupsPageSizeName = %s", doc->outheader.cupsPageSizeName);
   }
   
@@ -1376,7 +1376,7 @@ static bool outPage(pwgtoraster_doc_t *doc,
 
     if (doc->outheader.HWResolution[i] == doc->inheader.HWResolution[i])
     {
-      log(ld, FILTER_LOGLEVEL_DEBUG,
+      log(ld, CF_LOGLEVEL_DEBUG,
          "cfFilterPWGToRaster: %s resolution: %d dpi",
          i == 0 ? "Horizontal" : "Vertical", doc->inheader.HWResolution[i]);
       continue;
@@ -1386,7 +1386,7 @@ static bool outPage(pwgtoraster_doc_t *doc,
     {
       if (doc->outheader.HWResolution[i] % doc->inheader.HWResolution[i])
       {
-       log(ld, FILTER_LOGLEVEL_ERROR,
+       log(ld, CF_LOGLEVEL_ERROR,
            "cfFilterPWGToRaster: %s output resolution %d dpi is not an integer multiple of %s input resolution %d dpi",
            i == 0 ? "Horizontal" : "Vertical", doc->outheader.HWResolution[i],
            i == 0 ? "horizontal" : "vertical", doc->inheader.HWResolution[i]);
@@ -1396,7 +1396,7 @@ static bool outPage(pwgtoraster_doc_t *doc,
       {
        res_up_factor[i] =
          doc->outheader.HWResolution[i] / doc->inheader.HWResolution[i];
-       log(ld, FILTER_LOGLEVEL_DEBUG,
+       log(ld, CF_LOGLEVEL_DEBUG,
            "cfFilterPWGToRaster: %s input resolution: %d dpi; %s output resolution: %d dpi -> Raising by factor %d",
            i == 0 ? "Horizontal" : "Vertical", doc->inheader.HWResolution[i],
            i == 0 ? "Horizontal" : "Vertical", doc->outheader.HWResolution[i],
@@ -1407,7 +1407,7 @@ static bool outPage(pwgtoraster_doc_t *doc,
     {
       if (doc->inheader.HWResolution[i] % doc->outheader.HWResolution[i])
       {
-       log(ld, FILTER_LOGLEVEL_ERROR,
+       log(ld, CF_LOGLEVEL_ERROR,
            "cfFilterPWGToRaster: %s input resolution %d dpi is not an integer multiple of %s output resolution %d dpi",
            i == 0 ? "Horizontal" : "Vertical", doc->inheader.HWResolution[i],
            i == 0 ? "horizontal" : "vertical", doc->outheader.HWResolution[i]);
@@ -1417,7 +1417,7 @@ static bool outPage(pwgtoraster_doc_t *doc,
       {
        res_down_factor[i] =
          doc->inheader.HWResolution[i] / doc->outheader.HWResolution[i];
-       log(ld, FILTER_LOGLEVEL_DEBUG,
+       log(ld, CF_LOGLEVEL_DEBUG,
            "cfFilterPWGToRaster: %s input resolution: %d dpi; %s output resolution: %d dpi -> Reducing by factor %d",
            i == 0 ? "Horizontal" : "Vertical", doc->inheader.HWResolution[i],
            i == 0 ? "Horizontal" : "Vertical", doc->outheader.HWResolution[i],
@@ -1449,7 +1449,7 @@ static bool outPage(pwgtoraster_doc_t *doc,
   }
   else
   {
-    if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+    if (log) log(ld, CF_LOGLEVEL_ERROR,
                 "cfFilterPWGToRaster: Unsupported input color space: Number of colors: %d; Bits per color: %d.",
                 doc->inheader.cupsNumColors, doc->inheader.cupsBitsPerColor);
     return false;
@@ -1479,7 +1479,7 @@ static bool outPage(pwgtoraster_doc_t *doc,
 
   if (input_color_mode != color_mode_needed)
   {
-    if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "cfFilterPWGToRaster: Need to pre-convert input from %s to %s",
                 (input_color_mode == 0 ? "1-bit mono" :
                  (input_color_mode == 1 ? "8-bit gray" :
@@ -1490,7 +1490,7 @@ static bool outPage(pwgtoraster_doc_t *doc,
   }
   else
   {
-    if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "cfFilterPWGToRaster: Input color mode: %s",
                 (input_color_mode == 0 ? "1-bit mono" :
                  (input_color_mode == 1 ? "8-bit gray" :
@@ -1566,7 +1566,7 @@ static bool outPage(pwgtoraster_doc_t *doc,
     if (doc->outheader.PageSize[0] >= 2 * doc->inheader.PageSize[0] ||
        doc->outheader.PageSize[1] >= 2 * doc->inheader.PageSize[1])
     {
-      if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "cfFilterPWGToRaster: Difference between input and output page dimensions too large, probably the input has a wrong page size");
       goto out;
     }
@@ -1589,13 +1589,13 @@ static bool outPage(pwgtoraster_doc_t *doc,
     if  (abs(doc->outheader.PageSize[0] - doc->inheader.PageSize[0]) > 2 ||
         abs(doc->outheader.PageSize[1] - doc->inheader.PageSize[1]) > 2)
     {
-      if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+      if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "cfFilterPWGToRaster: Output page dimensions are larger for borderless printing with overspray, inserting one extra pixel after each %d pixels",
                   overspray_duplicate_after_pixels);
     }
     else
     {
-      if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+      if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "cfFilterPWGToRaster: Output page dimensions are larger than input page dimensions due to rounding error, inserting one extra pixel after each %d pixels",
                   overspray_duplicate_after_pixels);
     }
@@ -1612,7 +1612,7 @@ static bool outPage(pwgtoraster_doc_t *doc,
                                   doc->inheader.cupsBytesPerLine) !=
              doc->inheader.cupsBytesPerLine)
          {
-           if (log) log(ld,FILTER_LOGLEVEL_DEBUG,
+           if (log) log(ld,CF_LOGLEVEL_DEBUG,
                         "cfFilterPWGToRaster: Unable to read line %d for page %d.",
                         yin + 1, pageNo);
            ret = false;
@@ -1649,7 +1649,7 @@ static bool outPage(pwgtoraster_doc_t *doc,
                                         doc->inheader.cupsBytesPerLine) !=
                    doc->inheader.cupsBytesPerLine)
                {
-                 if (log) log(ld,FILTER_LOGLEVEL_DEBUG,
+                 if (log) log(ld,CF_LOGLEVEL_DEBUG,
                               "cfFilterPWGToRaster: Unable to read line %d for page %d.",
                               yin + 1, pageNo);
                  ret = false;
@@ -1985,7 +1985,7 @@ static bool outPage(pwgtoraster_doc_t *doc,
                             doc->inheader.cupsBytesPerLine) !=
        doc->inheader.cupsBytesPerLine)
     {
-      if (log) log(ld,FILTER_LOGLEVEL_DEBUG,
+      if (log) log(ld,CF_LOGLEVEL_DEBUG,
                   "cfFilterPWGToRaster: Unable to read line %d for page %d.",
                   yin + 1, pageNo);
       ret = false;
@@ -2005,7 +2005,7 @@ static bool outPage(pwgtoraster_doc_t *doc,
   return (ret);
 }
 
-static int setColorProfile(pwgtoraster_doc_t *doc, filter_logfunc_t log, void *ld)
+static int setColorProfile(pwgtoraster_doc_t *doc, cf_logfunc_t log, void *ld)
 {
   if (doc->outheader.cupsBitsPerColor != 8 && doc->outheader.cupsBitsPerColor != 16) {
     /* color Profile is not supported */
@@ -2084,7 +2084,7 @@ static int setColorProfile(pwgtoraster_doc_t *doc, filter_logfunc_t log, void *l
     doc->color_profile.outputColorProfile = NULL;
     break;
   default:
-    if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+    if (log) log(ld, CF_LOGLEVEL_ERROR,
                 "cfFilterPWGToRaster: Specified ColorSpace is not supported");
     return (1);
   }
@@ -2103,7 +2103,7 @@ int cfFilterPWGToRaster(int inputfd,        /* I - File descriptor input stream
   int i;
   cups_raster_t *inras = NULL,
                 *outras = NULL;
-  filter_logfunc_t     log = data->logfunc;
+  cf_logfunc_t     log = data->logfunc;
   void                 *ld = data->logdata;
   conversion_function_t convert;
   cf_filter_iscanceledfunc_t iscanceled = data->iscanceledfunc;
@@ -2123,7 +2123,7 @@ int cfFilterPWGToRaster(int inputfd,        /* I - File descriptor input stream
   } else
     outformat = CF_FILTER_OUT_FORMAT_CUPS_RASTER;
 
-  if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+  if (log) log(ld, CF_LOGLEVEL_DEBUG,
               "cfFilterPWGToRaster: Output format: %s",
               (outformat == CF_FILTER_OUT_FORMAT_CUPS_RASTER ? "CUPS Raster" :
                (outformat == CF_FILTER_OUT_FORMAT_PWG_RASTER ? "PWG Raster" :
@@ -2140,7 +2140,7 @@ int cfFilterPWGToRaster(int inputfd,        /* I - File descriptor input stream
   {
     if (!iscanceled || !iscanceled(icd))
     {
-      if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "cfFilterPWGToRaster: Unable to open input data stream.");
     }
 
@@ -2168,7 +2168,7 @@ int cfFilterPWGToRaster(int inputfd,        /* I - File descriptor input stream
      && doc.outheader.cupsBitsPerColor != 4
      && doc.outheader.cupsBitsPerColor != 8
      && doc.outheader.cupsBitsPerColor != 16) {
-    if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+    if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "cfFilterPWGToRaster: Specified color format is not supported.");
     ret = 1;
     goto out;
@@ -2210,7 +2210,7 @@ int cfFilterPWGToRaster(int inputfd,        /* I - File descriptor input stream
     if (doc.outheader.cupsColorOrder != CUPS_ORDER_CHUNKED
        || (doc.outheader.cupsBitsPerColor != 8
           && doc.outheader.cupsBitsPerColor != 16)) {
-      if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "cfFilterPWGToRaster: Specified color format is not supported.");
       ret = 1;
       goto out;
@@ -2240,14 +2240,14 @@ int cfFilterPWGToRaster(int inputfd,        /* I - File descriptor input stream
     doc.outputNumColors = 1;
     break;
   default:
-    if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+    if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "cfFilterPWGToRaster: Specified ColorSpace is not supported.");
     ret = 1;
     goto out;
   }
   if (!(doc.color_profile.cm_disabled)) {
     if (setColorProfile(&doc, log, ld) == 1) {
-      if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "cfFilterPWGToRaster: Cannot set color profile.");
       ret = 1;
       goto out;
@@ -2269,7 +2269,7 @@ int cfFilterPWGToRaster(int inputfd,        /* I - File descriptor input stream
                                            CUPS_RASTER_WRITE_APPLE :
                                            CUPS_RASTER_WRITE))))) == 0)
   {
-    if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+    if (log) log(ld, CF_LOGLEVEL_ERROR,
                 "cfFilterPWGToRaster: Can't open output raster stream.");
     ret = 1;
     goto out;
@@ -2282,67 +2282,67 @@ int cfFilterPWGToRaster(int inputfd,        /* I - File descriptor input stream
   memset(&convert, 0, sizeof(conversion_function_t));
   if (selectConvertFunc(outras, &doc, &convert, log, ld) == 1)
   {
-    if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+    if (log) log(ld, CF_LOGLEVEL_ERROR,
                 "cfFilterPWGToRaster: Unable to select color conversion function.");
     ret = 1;
     goto out;
   }
 
   if (log) {
-    log(ld, FILTER_LOGLEVEL_DEBUG,
+    log(ld, CF_LOGLEVEL_DEBUG,
        "cfFilterPWGToRaster: Output page header");
     if (doc.outheader.ImagingBoundingBox[3] > 0)
-      log(ld, FILTER_LOGLEVEL_DEBUG,
+      log(ld, CF_LOGLEVEL_DEBUG,
          "cfFilterPWGToRaster:   Duplex = %d", doc.outheader.Duplex);
-    log(ld, FILTER_LOGLEVEL_DEBUG,
+    log(ld, CF_LOGLEVEL_DEBUG,
        "cfFilterPWGToRaster:   HWResolution = [ %d %d ]",
        doc.outheader.HWResolution[0], doc.outheader.HWResolution[1]);
     if (doc.outheader.ImagingBoundingBox[3] > 0)
     {
-      log(ld, FILTER_LOGLEVEL_DEBUG,
+      log(ld, CF_LOGLEVEL_DEBUG,
          "cfFilterPWGToRaster:   ImagingBoundingBox = [ %d %d %d %d ]",
          doc.outheader.ImagingBoundingBox[0],
          doc.outheader.ImagingBoundingBox[1],
          doc.outheader.ImagingBoundingBox[2],
          doc.outheader.ImagingBoundingBox[3]);
-      log(ld, FILTER_LOGLEVEL_DEBUG,
+      log(ld, CF_LOGLEVEL_DEBUG,
          "cfFilterPWGToRaster:   Margins = [ %d %d ]",
          doc.outheader.Margins[0], doc.outheader.Margins[1]);
-      log(ld, FILTER_LOGLEVEL_DEBUG,
+      log(ld, CF_LOGLEVEL_DEBUG,
          "cfFilterPWGToRaster:   ManualFeed = %d", doc.outheader.ManualFeed);
-      log(ld, FILTER_LOGLEVEL_DEBUG,
+      log(ld, CF_LOGLEVEL_DEBUG,
          "cfFilterPWGToRaster:   MediaPosition = %d", doc.outheader.MediaPosition);
-      log(ld, FILTER_LOGLEVEL_DEBUG,
+      log(ld, CF_LOGLEVEL_DEBUG,
          "cfFilterPWGToRaster:   NumCopies = %d", doc.outheader.NumCopies);
-      log(ld, FILTER_LOGLEVEL_DEBUG,
+      log(ld, CF_LOGLEVEL_DEBUG,
          "cfFilterPWGToRaster:   Orientation = %d", doc.outheader.Orientation);
     }
-    log(ld, FILTER_LOGLEVEL_DEBUG,
+    log(ld, CF_LOGLEVEL_DEBUG,
        "cfFilterPWGToRaster:   PageSize = [ %d %d ]",
        doc.outheader.PageSize[0], doc.outheader.PageSize[1]);
-    log(ld, FILTER_LOGLEVEL_DEBUG,
+    log(ld, CF_LOGLEVEL_DEBUG,
        "cfFilterPWGToRaster:   cupsWidth = %d", doc.outheader.cupsWidth);
-    log(ld, FILTER_LOGLEVEL_DEBUG,
+    log(ld, CF_LOGLEVEL_DEBUG,
        "cfFilterPWGToRaster:   cupsHeight = %d", doc.outheader.cupsHeight);
     if (doc.outheader.ImagingBoundingBox[3] > 0)
-      log(ld, FILTER_LOGLEVEL_DEBUG,
+      log(ld, CF_LOGLEVEL_DEBUG,
          "cfFilterPWGToRaster:   cupsMediaType = %d", doc.outheader.cupsMediaType);
-    log(ld, FILTER_LOGLEVEL_DEBUG,
+    log(ld, CF_LOGLEVEL_DEBUG,
        "cfFilterPWGToRaster:   cupsBitsPerColor = %d",
        doc.outheader.cupsBitsPerColor);
-    log(ld, FILTER_LOGLEVEL_DEBUG,
+    log(ld, CF_LOGLEVEL_DEBUG,
        "cfFilterPWGToRaster:   cupsBitsPerPixel = %d",
        doc.outheader.cupsBitsPerPixel);
-    log(ld, FILTER_LOGLEVEL_DEBUG,
+    log(ld, CF_LOGLEVEL_DEBUG,
        "cfFilterPWGToRaster:   cupsBytesPerLine = %d",
        doc.outheader.cupsBytesPerLine);
-    log(ld, FILTER_LOGLEVEL_DEBUG,
+    log(ld, CF_LOGLEVEL_DEBUG,
        "cfFilterPWGToRaster:   cupsColorOrder = %d", doc.outheader.cupsColorOrder);
-    log(ld, FILTER_LOGLEVEL_DEBUG,
+    log(ld, CF_LOGLEVEL_DEBUG,
        "cfFilterPWGToRaster:   cupsColorSpace = %d", doc.outheader.cupsColorSpace);
-    log(ld, FILTER_LOGLEVEL_DEBUG,
+    log(ld, CF_LOGLEVEL_DEBUG,
        "cfFilterPWGToRaster:   cupsCompression = %d", doc.outheader.cupsCompression);
-    log(ld, FILTER_LOGLEVEL_DEBUG,
+    log(ld, CF_LOGLEVEL_DEBUG,
        "cfFilterPWGToRaster:   cupsPageSizeName = %s", doc.outheader.cupsPageSizeName);
   }
 
@@ -2355,7 +2355,7 @@ int cfFilterPWGToRaster(int inputfd,        /* I - File descriptor input stream
                 icd))
     i ++;
   if (i == 0)
-    if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "cfFilterPWGToRaster: No page printed, outputting empty file.");
 
  out:
index d0c44d3563b0c166166382f1130fb8f090e8ac3e..6232c3f81470af990e5b27e7056dde03547d0d2b 100644 (file)
@@ -84,7 +84,7 @@ ippRasterMatchIPPSize(
   cups_size_t          *size,          /* Current media size */
                        *size_matched = NULL;
                                        /* Matched size */
-  filter_logfunc_t log = data->logfunc; /* logging function for debugging */
+  cf_logfunc_t log = data->logfunc; /* logging function for debugging */
   void          *ld = data->logdata;
   ipp_attribute_t      *defattr;       /* default value of attr */
   int                  i,              /* looping var */
@@ -114,12 +114,12 @@ ippRasterMatchIPPSize(
 
   if (!header)
   {
-    if(log) log(ld, FILTER_LOGLEVEL_ERROR, "Page header cannot be NULL!\n");
+    if(log) log(ld, CF_LOGLEVEL_ERROR, "Page header cannot be NULL!\n");
     return (-1);
   }
   if (!printer_attrs)
   {
-    if(log) log(ld, FILTER_LOGLEVEL_ERROR, "Printer-attributes info not supplied!\n");
+    if(log) log(ld, CF_LOGLEVEL_ERROR, "Printer-attributes info not supplied!\n");
     return (-1);
   }
 
@@ -201,7 +201,7 @@ ippRasterMatchIPPSize(
        if(fabs(header->PageSize[1] - temptop + tempbottom) / templength < 0.01 &&
           fabs(header->PageSize[0] - tempright + templeft) / tempwidth < 0.01  &&
           (size_matched==NULL || !strcasecmp(pageSizeRequested, ippsizename))){
-               if(log)log(ld,FILTER_LOGLEVEL_DEBUG,"Imageable area fit\n");
+               if(log)log(ld,CF_LOGLEVEL_DEBUG,"Imageable area fit\n");
                size_matched = size;
                if (landscape) *landscape = 0;
                if (image_fit) *image_fit = 1;
@@ -213,7 +213,7 @@ ippRasterMatchIPPSize(
    /*
     * Standard size...
     */
-    if(log)log(ld,FILTER_LOGLEVEL_DEBUG,"IPP matched size = %s\n", size_matched->media);
+    if(log)log(ld,CF_LOGLEVEL_DEBUG,"IPP matched size = %s\n", size_matched->media);
     size = size_matched;
     dimensions[0] = size->width * 72.0 / 2540.0;
     dimensions[1] = size->length * 72.0 / 2540.0;
@@ -288,7 +288,7 @@ ippRasterMatchIPPSize(
                if(fabs(header->PageSize[0] - temptop + tempbottom) / templength < 0.01 &&
                fabs(header->PageSize[1] - tempright + templeft) / tempwidth < 0.01     &&
                (size_matched==NULL || !strcasecmp(pageSizeRequested, ippsizename))){
-                       if(log) log(ld, FILTER_LOGLEVEL_DEBUG, "Imageable area fit\n");
+                       if(log) log(ld, CF_LOGLEVEL_DEBUG, "Imageable area fit\n");
                        size_matched = size;
                        if (landscape) *landscape = 1;
                        if (image_fit) *image_fit = 1;
@@ -301,7 +301,7 @@ ippRasterMatchIPPSize(
      * Standard size in landscape orientation...
      */
     size = size_matched;
-    if(log) log(ld, FILTER_LOGLEVEL_DEBUG, "landscape size = %s\n", size->media);
+    if(log) log(ld, CF_LOGLEVEL_DEBUG, "landscape size = %s\n", size->media);
     dimensions[0] = size->width * 72.0 / 2540.0;
     dimensions[1] = size->length * 72.0 / 2540.0;
     margins[0] = size->left * 72.0 / 2540.0;
@@ -316,7 +316,7 @@ ippRasterMatchIPPSize(
     /*
      * Custom size...
      */
-    if(log) log(ld, FILTER_LOGLEVEL_DEBUG, "size = custom\n");
+    if(log) log(ld, CF_LOGLEVEL_DEBUG, "size = custom\n");
     for (i = 0; i < 2; i ++)
       dimensions[i] = header->PageSize[i];
     margins[0] = left * 72.0 / 2540.0;
@@ -432,7 +432,7 @@ getPrintRenderIntent(cf_filter_data_t *data,
   cups_option_t        *options = NULL;
   ipp_t                *printer_attrs = data->printer_attrs;
   ipp_attribute_t      *ipp_attr;
-  filter_logfunc_t     log = data->logfunc;
+  cf_logfunc_t         log = data->logfunc;
   void                  *ld = data->logdata;
   int                  i;
   num_options = joinJobOptionsAndAttrs(data, num_options, &options);
@@ -481,7 +481,7 @@ getPrintRenderIntent(cf_filter_data_t *data,
                    }
                }
                if(i==count){
-                   if(log) log(ld, FILTER_LOGLEVEL_DEBUG,
+                   if(log) log(ld, CF_LOGLEVEL_DEBUG,
                                "User specified print-rendering-intent not supported by printer,"
                                        "using default print rendering intent.");
                    header->cupsRenderingIntent[0] = '\0';
@@ -555,7 +555,7 @@ cupsRasterPrepareHeader(cups_page_header2_t *h, /* I  - Raster header */
   ipp_t *printer_attrs, *job_attrs;
   int num_options = 0;
   cups_option_t *options = NULL;
-  filter_logfunc_t log = data->logfunc;
+  cf_logfunc_t log = data->logfunc;
   void          *ld = data->logdata;
   int pwgraster = 0,
       appleraster = 0,
@@ -668,12 +668,12 @@ cupsRasterPrepareHeader(cups_page_header2_t *h, /* I  - Raster header */
 
   if (log) {
     if (*cspace == -1)
-      log(ld, FILTER_LOGLEVEL_DEBUG,
+      log(ld, CF_LOGLEVEL_DEBUG,
          "Color space requested: Default");
     else
-      log(ld, FILTER_LOGLEVEL_DEBUG,
+      log(ld, CF_LOGLEVEL_DEBUG,
          "Color space requested: #%d", *cspace);
-    log(ld, FILTER_LOGLEVEL_DEBUG,
+    log(ld, CF_LOGLEVEL_DEBUG,
        "Final output format: %s",
        appleraster ? "Apple Raster" :
        (pwgraster ? "PWG Raster" :
@@ -683,7 +683,7 @@ cupsRasterPrepareHeader(cups_page_header2_t *h, /* I  - Raster header */
   if (ppd)
   {
     if (log)
-      log(ld, FILTER_LOGLEVEL_DEBUG, "PPD file present");
+      log(ld, CF_LOGLEVEL_DEBUG, "PPD file present");
     ppdRasterInterpretPPD(h, ppd, num_options, options, NULL);
     if ((ppd_attr = ppdFindAttr(ppd,"PWGRaster",0)) != 0 &&
        (!strcasecmp(ppd_attr->value, "true") ||
@@ -694,7 +694,7 @@ cupsRasterPrepareHeader(cups_page_header2_t *h, /* I  - Raster header */
       appleraster = 0;
       pclm = 0;
       if (log)
-       log(ld, FILTER_LOGLEVEL_DEBUG,
+       log(ld, CF_LOGLEVEL_DEBUG,
            "PWG Raster output requested (via \"PWGRaster\" PPD attribute)");
     }
 
@@ -728,10 +728,10 @@ cupsRasterPrepareHeader(cups_page_header2_t *h, /* I  - Raster header */
                      (!strcasecmp(quality, "High") || !strcmp(quality, "5"))) ?
            1 : 0;
          if (log) {
-           log(ld, FILTER_LOGLEVEL_DEBUG,
+           log(ld, CF_LOGLEVEL_DEBUG,
                "Color mode requested: %s; color depth requested: %s",
                color_mode, hi_depth ? "High" : "Standard");
-           log(ld, FILTER_LOGLEVEL_DEBUG,
+           log(ld, CF_LOGLEVEL_DEBUG,
                "Determining best color space/depth ...");
          }
          res = cupsRasterSetColorSpace(h, cspaces_available, color_mode,
@@ -752,7 +752,7 @@ cupsRasterPrepareHeader(cups_page_header2_t *h, /* I  - Raster header */
        }
        hi_depth = 0;
        if (log)
-         log(ld, FILTER_LOGLEVEL_DEBUG,
+         log(ld, CF_LOGLEVEL_DEBUG,
              "For PCLm color mode is always SRGB/SGray 8-bit.");
        res = cupsRasterSetColorSpace(h, cspaces_available, color_mode,
                                      cspace, &hi_depth);
@@ -772,7 +772,7 @@ cupsRasterPrepareHeader(cups_page_header2_t *h, /* I  - Raster header */
   else
   {
     if (log)
-      log(ld, FILTER_LOGLEVEL_DEBUG, "No PPD file present");
+      log(ld, CF_LOGLEVEL_DEBUG, "No PPD file present");
     if (cupsraster)
     {
       pwgraster = 0;
@@ -785,7 +785,7 @@ cupsRasterPrepareHeader(cups_page_header2_t *h, /* I  - Raster header */
          pwgraster = 1;
          cupsraster = 0;
          if (log)
-           log(ld, FILTER_LOGLEVEL_DEBUG,
+           log(ld, CF_LOGLEVEL_DEBUG,
                "PWG Raster output requested (via \"MediaClass\"/\"media-class\" option)");
        } else
          pwgraster = 0;
@@ -823,10 +823,10 @@ cupsRasterPrepareHeader(cups_page_header2_t *h, /* I  - Raster header */
                  (!strcasecmp(quality, "high") || !strcmp(quality, "5"))) ?
        1 : 0;
       if (log) {
-       log(ld, FILTER_LOGLEVEL_DEBUG,
+       log(ld, CF_LOGLEVEL_DEBUG,
            "Color mode requested: %s; color depth requested: %s",
            color_mode, hi_depth ? "High" : "Standard");
-       log(ld, FILTER_LOGLEVEL_DEBUG,
+       log(ld, CF_LOGLEVEL_DEBUG,
            "Determining best color space/depth ...");
       }
       res = cupsRasterSetColorSpace(h, cspaces_available, color_mode,
@@ -842,7 +842,7 @@ cupsRasterPrepareHeader(cups_page_header2_t *h, /* I  - Raster header */
                                              "print-color-mode");
       hi_depth = 0;
       if (log)
-       log(ld, FILTER_LOGLEVEL_DEBUG,
+       log(ld, CF_LOGLEVEL_DEBUG,
            "For PCLm color mode is always SRGB/SGray 8-bit.");
       res = cupsRasterSetColorSpace(h, cspaces_available, color_mode,
                                    cspace, &hi_depth);
@@ -854,13 +854,13 @@ cupsRasterPrepareHeader(cups_page_header2_t *h, /* I  - Raster header */
     if (res < 0) {
       /* failed */
       if (log) {
-       log(ld, FILTER_LOGLEVEL_ERROR,
+       log(ld, CF_LOGLEVEL_ERROR,
            "Unable to set color space/depth for Raster output!");
        if (*cspace < 0)
-         log(ld, FILTER_LOGLEVEL_ERROR,
+         log(ld, CF_LOGLEVEL_ERROR,
              "Did not find a valid color space!");
        else
-         log(ld, FILTER_LOGLEVEL_ERROR,
+         log(ld, CF_LOGLEVEL_ERROR,
              "Requested color space #%d not a valid PWG/Apple Raster color space!",
              *cspace);
       }
@@ -868,7 +868,7 @@ cupsRasterPrepareHeader(cups_page_header2_t *h, /* I  - Raster header */
     } else
       /* succeeded */
       if (log)
-       log(ld, FILTER_LOGLEVEL_DEBUG,
+       log(ld, CF_LOGLEVEL_DEBUG,
            "Using color space #%d with %s color depth",
            *cspace, hi_depth ? "high" : "standard");
   }
index 15e99c6b37f7ae10011c141865f68879b0f0bafc..eab56ea6055131be87c3883c0e97d1634b646915 100644 (file)
@@ -112,7 +112,7 @@ typedef struct                                 /**** Document information ****/
                                                  function */
   bitFunction         bit_function;            /* Raster bit function */
   FILE               *outputfp;               /* Temporary file, if any */
-  filter_logfunc_t    logfunc;                 /* Logging function, NULL for no
+  cf_logfunc_t    logfunc;                 /* Logging function, NULL for no
                                                  logging */
   void                *logdata;                /* User data for logging
                                                  function, can be NULL */
@@ -462,7 +462,7 @@ QPDFObjectHandle embedIccProfile(QPDF &pdf, rastertopdf_doc_t *doc)
         alternate_cs = "/DeviceCMYK";
         break;
       default:
-        if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
+        if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_DEBUG,
                      "cfFilterRasterToPDF: Failed to embed ICC Profile.");
         return QPDFObjectHandle::newNull();
     }
@@ -488,7 +488,7 @@ QPDFObjectHandle embedIccProfile(QPDF &pdf, rastertopdf_doc_t *doc)
     ret = pdf.makeIndirectObject(array);
 
     free(buff);
-    if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
+    if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_DEBUG,
                      "cfFilterRasterToPDF: ICC Profile embedded in PDF.");
 
     return ret;
@@ -649,7 +649,7 @@ makePclmStrips(QPDF &pdf, unsigned num_strips,
         components = 3;
         break;
       default:
-        if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
+        if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_DEBUG,
                      "cfFilterRasterToPDF: Color space not supported.");
         return std::vector<QPDFObjectHandle>(num_strips, QPDFObjectHandle());
     }
@@ -808,7 +808,7 @@ QPDFObjectHandle makeImage(QPDF &pdf, PointerHolder<Buffer> page_data,
                 break;
             default:
                 if (doc->logfunc)
-                 doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
+                 doc->logfunc(doc->logdata, CF_LOGLEVEL_DEBUG,
                               "cfFilterRasterToPDF: Color space not supported.");
                 return QPDFObjectHandle();
         }
@@ -843,7 +843,7 @@ QPDFObjectHandle makeImage(QPDF &pdf, PointerHolder<Buffer> page_data,
             break;
           default:
             if (doc->logfunc)
-             doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
+             doc->logfunc(doc->logdata, CF_LOGLEVEL_DEBUG,
                           "cfFilterRasterToPDF: Color space not supported.");
             return QPDFObjectHandle();
         }
@@ -887,7 +887,7 @@ int finish_page(struct pdf_info * info, rastertopdf_doc_t *doc)
       if(!image.isInitialized())
       {
         if (doc->logfunc)
-         doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
+         doc->logfunc(doc->logdata, CF_LOGLEVEL_DEBUG,
                       "cfFilterRasterToPDF: Unable to load image data");
         return 1;
       }
@@ -914,7 +914,7 @@ int finish_page(struct pdf_info * info, rastertopdf_doc_t *doc)
         if(!strips[i].isInitialized())
         {
           if (doc->logfunc)
-           doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
+           doc->logfunc(doc->logdata, CF_LOGLEVEL_DEBUG,
                         "cfFilterRasterToPDF: Unable to load strip data");
           return 1;
         }
@@ -1057,7 +1057,7 @@ int prepare_pdf_page(struct pdf_info * info, unsigned width, unsigned height,
           break;
         default:
           if (doc->logfunc)
-           doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
+           doc->logfunc(doc->logdata, CF_LOGLEVEL_DEBUG,
                         "cfFilterRasterToPDF: Unable to convert PDF from profile.");
           doc->colorProfile = NULL;
           error = 1;
@@ -1121,7 +1121,7 @@ int prepare_pdf_page(struct pdf_info * info, unsigned width, unsigned height,
              break;
          default:
            if (doc->logfunc)
-            doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
+            doc->logfunc(doc->logdata, CF_LOGLEVEL_DEBUG,
                          "cfFilterRasterToPDF: Color space not supported.");
            error = 1;
            break;
@@ -1149,7 +1149,7 @@ int add_pdf_page(struct pdf_info * info, int pagen, unsigned width,
         if (info->height > (std::numeric_limits<unsigned>::max() /
                            info->line_bytes)) {
             if (doc->logfunc)
-             doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
+             doc->logfunc(doc->logdata, CF_LOGLEVEL_DEBUG,
                           "cfFilterRasterToPDF: Page too big");
             return 1;
         }
@@ -1203,7 +1203,7 @@ int add_pdf_page(struct pdf_info * info, int pagen, unsigned width,
         info->pdf.addPage(info->page, false);
     } catch (std::bad_alloc &ex) {
         if (doc->logfunc)
-         doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
+         doc->logfunc(doc->logdata, CF_LOGLEVEL_DEBUG,
                       "cfFilterRasterToPDF: Unable to allocate page data");
         return 1;
     } catch (...) {
@@ -1237,7 +1237,7 @@ void pdf_set_line(struct pdf_info * info, unsigned line_n,
     if(line_n > info->height)
     {
         if (doc->logfunc)
-         doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
+         doc->logfunc(doc->logdata, CF_LOGLEVEL_DEBUG,
                       "cfFilterRasterToPDF: Bad line %d", line_n);
         return;
     }
@@ -1311,13 +1311,13 @@ int setProfile(const char * path, rastertopdf_doc_t *doc)
 
     if (doc->colorProfile != NULL) {
       if (doc->logfunc)
-       doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
+       doc->logfunc(doc->logdata, CF_LOGLEVEL_DEBUG,
                     "cfFilterRasterToPDF: Load profile successful.");
       return 0;
     }
     else {
       if (doc->logfunc)
-       doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
+       doc->logfunc(doc->logdata, CF_LOGLEVEL_DEBUG,
                     "cfFilterRasterToPDF: Unable to load profile.");
       return 1;
     }
@@ -1395,7 +1395,7 @@ cfFilterRasterToPDF(int inputfd,    /* I - File descriptor input stream */
   ipp_t *printer_attrs = data->printer_attrs; /* Printer attributes from printer data*/
   ipp_attribute_t *ipp_attr; /* Printer attribute*/
   const char*         profile_name = NULL;     /* IPP Profile Name */
-  filter_logfunc_t log = data->logfunc;
+  cf_logfunc_t log = data->logfunc;
   void          *ld = data->logdata;
   cf_filter_iscanceledfunc_t iscanceled = data->iscanceledfunc;
   void          *icd = data->iscanceleddata;
@@ -1414,7 +1414,7 @@ cfFilterRasterToPDF(int inputfd,    /* I - File descriptor input stream */
   }
   else
     outformat = CF_FILTER_OUT_FORMAT_PDF;
-  if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+  if (log) log(ld, CF_LOGLEVEL_DEBUG,
               "cfFilterRasterToPDF: OUTFORMAT=\"%s\"",
               outformat == CF_FILTER_OUT_FORMAT_PDF ? "PDF" : "PCLM");
 
@@ -1426,7 +1426,7 @@ cfFilterRasterToPDF(int inputfd,    /* I - File descriptor input stream */
   {
     if (!iscanceled || !iscanceled(icd))
     {
-      if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+      if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "cfFilterRasterToPDF: Unable to open output data stream.");
     }
 
@@ -1453,7 +1453,7 @@ cfFilterRasterToPDF(int inputfd,    /* I - File descriptor input stream */
   if (outformat == CF_FILTER_OUT_FORMAT_PCLM && data->ppd == NULL
         && printer_attrs == NULL )
   {
-    if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+    if (log) log(ld, CF_LOGLEVEL_ERROR,
       "cfFilterRasterToPDF: PCLm output:  Neither a PPD file nor printer IPP attributes are supplied, PCLm output not possible.");
     return 1;
   }
@@ -1470,7 +1470,7 @@ cfFilterRasterToPDF(int inputfd,    /* I - File descriptor input stream */
     char *attr_name = (char *)"cupsPclmStripHeightPreferred";
     if ((attr = ppdFindAttr(data->ppd, attr_name, NULL)) != NULL)
     {
-      if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+      if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "cfFilterRasterToPDF: PPD PCLm attribute \"%s\" with value \"%s\"",
                   attr_name, attr->value);
       pdf.pclm_strip_height_preferred = atoi(attr->value);
@@ -1481,7 +1481,7 @@ cfFilterRasterToPDF(int inputfd,    /* I - File descriptor input stream */
     attr_name = (char *)"cupsPclmStripHeightSupported";
     if ((attr = ppdFindAttr(data->ppd, attr_name, NULL)) != NULL)
     {
-      if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+      if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "cfFilterRasterToPDF: PPD PCLm attribute \"%s\" with value \"%s\"",
                   attr_name, attr->value);
       pdf.pclm_strip_height_supported.clear();  // remove default value = 16
@@ -1494,7 +1494,7 @@ cfFilterRasterToPDF(int inputfd,    /* I - File descriptor input stream */
     attr_name = (char *)"cupsPclmRasterBackSide";
     if ((attr = ppdFindAttr(data->ppd, attr_name, NULL)) != NULL)
     {
-      if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+      if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "cfFilterRasterToPDF: PPD PCLm attribute \"%s\" with value \"%s\"",
                   attr_name, attr->value);
       pdf.pclm_raster_back_side = attr->value;
@@ -1503,7 +1503,7 @@ cfFilterRasterToPDF(int inputfd,    /* I - File descriptor input stream */
     attr_name = (char *)"cupsPclmSourceResolutionSupported";
     if ((attr = ppdFindAttr(data->ppd, attr_name, NULL)) != NULL)
     {
-      if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+      if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "cfFilterRasterToPDF: PPD PCLm attribute \"%s\" with value \"%s\"",
                   attr_name, attr->value);
       pdf.pclm_source_resolution_supported = split_strings(attr->value, ",");
@@ -1512,7 +1512,7 @@ cfFilterRasterToPDF(int inputfd,    /* I - File descriptor input stream */
     attr_name = (char *)"cupsPclmSourceResolutionDefault";
     if ((attr = ppdFindAttr(data->ppd, attr_name, NULL)) != NULL)
     {
-      if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+      if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "cfFilterRasterToPDF: PPD PCLm attribute \"%s\" with value \"%s\"",
                   attr_name, attr->value);
       pdf.pclm_source_resolution_default = attr->value;
@@ -1521,13 +1521,13 @@ cfFilterRasterToPDF(int inputfd,    /* I - File descriptor input stream */
     {
       pdf.pclm_source_resolution_default =
        pdf.pclm_source_resolution_supported[0];
-      if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+      if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "cfFilterRasterToPDF: PPD PCLm attribute \"%s\" missing, taking first item of \"cupsPclmSourceResolutionSupported\" as default resolution",
                   attr_name);
     }
     else
     {
-      if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "cfFilterRasterToPDF: PCLm output: PPD file does not contain printer resolution information for PCLm.");
       return 1;
     }
@@ -1535,7 +1535,7 @@ cfFilterRasterToPDF(int inputfd,    /* I - File descriptor input stream */
     attr_name = (char *)"cupsPclmCompressionMethodPreferred";
     if ((attr = ppdFindAttr(data->ppd, attr_name, NULL)) != NULL)
     {
-      if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+      if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "cfFilterRasterToPDF: PPD PCLm attribute \"%s\" with value \"%s\"",
                   attr_name, attr->value);
       std::vector<std::string> vec = split_strings(attr->value, ",");
@@ -1560,7 +1560,7 @@ cfFilterRasterToPDF(int inputfd,    /* I - File descriptor input stream */
     // use FLATE as compression method and show a warning.
     if (pdf.pclm_compression_method_preferred.empty())
     {
-      if (log) log(ld, FILTER_LOGLEVEL_WARN,
+      if (log) log(ld, CF_LOGLEVEL_WARN,
                   "(rastertopclm) Unable parse PPD attribute \"%s\". "
                   "Using FLATE for encoding image streams.", attr_name);
       pdf.pclm_compression_method_preferred.push_back(FLATE_DECODE);
@@ -1570,7 +1570,7 @@ cfFilterRasterToPDF(int inputfd,    /* I - File descriptor input stream */
   {
     if (log)
     {
-      log(ld, FILTER_LOGLEVEL_DEBUG, "PCLm-related printer IPP attributes:");
+      log(ld, CF_LOGLEVEL_DEBUG, "PCLm-related printer IPP attributes:");
       total_attrs = 0;
       ipp_attr = ippFirstAttribute(printer_attrs);
       while (ipp_attr)
@@ -1579,21 +1579,21 @@ cfFilterRasterToPDF(int inputfd,    /* I - File descriptor input stream */
         {
           total_attrs ++;
           ippAttributeString(ipp_attr, buf, sizeof(buf));
-          log(ld, FILTER_LOGLEVEL_DEBUG, "  Attr: %s",ippGetName(ipp_attr));
-          log(ld, FILTER_LOGLEVEL_DEBUG, "  Value: %s", buf);
+          log(ld, CF_LOGLEVEL_DEBUG, "  Attr: %s",ippGetName(ipp_attr));
+          log(ld, CF_LOGLEVEL_DEBUG, "  Value: %s", buf);
           for (i = 0; i < ippGetCount(ipp_attr); i ++)
             if ((kw = ippGetString(ipp_attr, i, NULL)) != NULL)
-                 log(ld, FILTER_LOGLEVEL_DEBUG, "  Keyword: %s", kw);
+                 log(ld, CF_LOGLEVEL_DEBUG, "  Keyword: %s", kw);
              }
              ipp_attr = ippNextAttribute(printer_attrs);
       }
-      log(ld, FILTER_LOGLEVEL_DEBUG, "  %d attributes", total_attrs);
+      log(ld, CF_LOGLEVEL_DEBUG, "  %d attributes", total_attrs);
     }
 
     char *attr_name = (char *)"pclm-strip-height-preferred";
     if ((ipp_attr = ippFindAttribute(printer_attrs, attr_name, IPP_TAG_ZERO)) != NULL)
     {
-      if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+      if (log) log(ld, CF_LOGLEVEL_DEBUG,
                  "cfFilterRasterToPDF: Printer PCLm attribute \"%s\" with value %d",
                  attr_name, ippGetInteger(ipp_attr, 0));
       pdf.pclm_strip_height_preferred = ippGetInteger(ipp_attr, 0);
@@ -1604,7 +1604,7 @@ cfFilterRasterToPDF(int inputfd,    /* I - File descriptor input stream */
     attr_name = (char *)"pclm-strip-height-supported";
     if ((ipp_attr = ippFindAttribute(printer_attrs, attr_name, IPP_TAG_ZERO)) != NULL)
     {
-      if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+      if (log) log(ld, CF_LOGLEVEL_DEBUG,
       "cfFilterRasterToPDF: Printer PCLm attribute \"%s\"",
       attr_name);
       pdf.pclm_strip_height_supported.clear();  // remove default value = 16
@@ -1615,7 +1615,7 @@ cfFilterRasterToPDF(int inputfd,    /* I - File descriptor input stream */
     attr_name = (char *)"pclm-raster-back-side";
     if ((ipp_attr = ippFindAttribute(printer_attrs, attr_name, IPP_TAG_ZERO)) != NULL)
     {
-      if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+      if (log) log(ld, CF_LOGLEVEL_DEBUG,
       "cfFilterRasterToPDF: Printer PCLm attribute \"%s\" with value \"%s\"",
       attr_name, ippGetString(ipp_attr, 0, NULL));
       pdf.pclm_raster_back_side = ippGetString(ipp_attr, 0, NULL);
@@ -1625,7 +1625,7 @@ cfFilterRasterToPDF(int inputfd,    /* I - File descriptor input stream */
     if ((ipp_attr = ippFindAttribute(printer_attrs, attr_name, IPP_TAG_ZERO)) != NULL)
     {
       ippAttributeString(ipp_attr, buf, sizeof(buf));
-      if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+      if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "cfFilterRasterToPDF: Printer PCLm attribute \"%s\" with value \"%s\"",
                   attr_name, buf);
       pdf.pclm_source_resolution_supported = split_strings(buf, ",");
@@ -1635,7 +1635,7 @@ cfFilterRasterToPDF(int inputfd,    /* I - File descriptor input stream */
     if ((ipp_attr = ippFindAttribute(printer_attrs, attr_name, IPP_TAG_ZERO)) != NULL)
     {
       ippAttributeString(ipp_attr, buf, sizeof(buf));
-      if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+      if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "cfFilterRasterToPDF: Printer PCLm attribute \"%s\" with value \"%s\"",
                   attr_name, buf);
       pdf.pclm_source_resolution_default = buf;
@@ -1644,13 +1644,13 @@ cfFilterRasterToPDF(int inputfd,    /* I - File descriptor input stream */
     {
       pdf.pclm_source_resolution_default =
        pdf.pclm_source_resolution_supported[0];
-      if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+      if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "cfFilterRasterToPDF: Printer PCLm attribute \"%s\" missing, taking first item of \"pclm-source-resolution-supported\" as default resolution",
                   attr_name);
     }
     else
     {
-      if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "cfFilterRasterToPDF: PCLm output: Printer IPP attributes do not contain printer resolution information for PCLm.");
       return 1;
     }
@@ -1659,7 +1659,7 @@ cfFilterRasterToPDF(int inputfd,    /* I - File descriptor input stream */
     if ((ipp_attr = ippFindAttribute(printer_attrs, attr_name, IPP_TAG_ZERO)) != NULL)
     {
       ippAttributeString(ipp_attr, buf, sizeof(buf));
-      if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+      if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "cfFilterRasterToPDF: Printer PCLm attribute \"%s\" with value \"%s\"",
                   attr_name, buf);
       std::vector<std::string> vec = split_strings(buf, ",");
@@ -1684,7 +1684,7 @@ cfFilterRasterToPDF(int inputfd,    /* I - File descriptor input stream */
     // use FLATE as compression method and show a warning.
     if (pdf.pclm_compression_method_preferred.empty())
     {
-      if (log) log(ld, FILTER_LOGLEVEL_WARN,
+      if (log) log(ld, CF_LOGLEVEL_WARN,
                   "(rastertopclm) Unable parse Printer attribute \"%s\". "
                   "Using FLATE for encoding image streams.", attr_name);
       pdf.pclm_compression_method_preferred.push_back(FLATE_DECODE);
@@ -1695,7 +1695,7 @@ cfFilterRasterToPDF(int inputfd,    /* I - File descriptor input stream */
   {
     if (iscanceled && iscanceled(icd))
     {
-      if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+      if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "cfFilterRasterToPDF: Job canceled");
       break;
     }
@@ -1706,7 +1706,7 @@ cfFilterRasterToPDF(int inputfd,    /* I - File descriptor input stream */
       // We have a valid input page, so create PDF file
       if (create_pdf_file(&pdf, outformat) != 0)
       {
-       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+       if (log) log(ld, CF_LOGLEVEL_ERROR,
                     "cfFilterRasterToPDF: Unable to create PDF file");
        return 1;
       }
@@ -1714,7 +1714,7 @@ cfFilterRasterToPDF(int inputfd,    /* I - File descriptor input stream */
 
     // Write a status message with the page number
     Page ++;
-    if (log) log(ld, FILTER_LOGLEVEL_INFO,
+    if (log) log(ld, CF_LOGLEVEL_INFO,
                 "cfFilterRasterToPDF: Starting page %d.", Page);
 
     // Use "profile=profile_name.icc" to embed 'profile_name.icc' into the PDF
@@ -1726,7 +1726,7 @@ cfFilterRasterToPDF(int inputfd,    /* I - File descriptor input stream */
       doc.cm_disabled = 0;
     }
     if (doc.colorProfile != NULL)       
-      if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+      if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "cfFilterRasterToPDF: TEST ICC Profile specified (color "
                   "management forced ON): \n[%s]", profile_name);
 
@@ -1737,7 +1737,7 @@ cfFilterRasterToPDF(int inputfd,    /* I - File descriptor input stream */
                       header.cupsColorSpace, header.HWResolution[0],
           header.HWResolution[1], &doc) != 0)
     {
-      if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
                    "cfFilterRasterToPDF: Unable to start new PDF page");
       return 1;
     }
@@ -1747,7 +1747,7 @@ cfFilterRasterToPDF(int inputfd,    /* I - File descriptor input stream */
       header.cupsBitsPerPixel, header.cupsBytesPerLine, 
       &pdf, &doc) != 0)
     {
-      if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "cfFilterRasterToPDF: Failed to convert page bitmap");
       return 1;
     }
@@ -1755,7 +1755,7 @@ cfFilterRasterToPDF(int inputfd,    /* I - File descriptor input stream */
 
   if (empty)
   {
-    if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "cfFilterRasterToPDF: Input is empty, outputting empty file.");
     cupsRasterClose(ras);
     return 0;
index b8a6a27de814449caaaee73a5f9f1b2404dda02d..2cf3322023d9bfd57840067764a3fd0c21cd1a8b 100644 (file)
@@ -21,7 +21,7 @@
 typedef struct {                /**** Document information ****/
   cups_file_t  *inputfp;                 /* Temporary file, if any */
   FILE         *outputfp;                /* Temporary file, if any */
-  filter_logfunc_t logfunc;               /* Logging function, NULL for no
+  cf_logfunc_t logfunc;               /* Logging function, NULL for no
                                             logging */
   void          *logdata;                 /* User data for logging function, can
                                             be NULL */
@@ -64,7 +64,7 @@ writeStartPage(int  page,   /* I - Page to write */
                int  length, /* I - Page length in points */
                rastertops_doc_t *doc) /* I - Document information */
 {
-  if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_CONTROL,
+  if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_CONTROL,
                                 "PAGE: %d %d", page, 1);
   fprintf(doc->outputfp, "%%%%Page: %d %d\n", page, page);
   fprintf(doc->outputfp, "%%%%BeginPageSetup\n");
@@ -318,23 +318,23 @@ zerr(int ret, /* I - Return status of deflate */
 {
   switch (ret) {
   case Z_ERRNO:
-    if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_ERROR,
+    if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_ERROR,
                  "cfFilterRasterToPS: zpipe - error in source data or output file");
     break;
   case Z_STREAM_ERROR:
-    if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_ERROR,
+    if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_ERROR,
                  "cfFilterRasterToPS: zpipe - invalid compression level");
     break;
   case Z_DATA_ERROR:
-    if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_ERROR,
+    if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_ERROR,
                  "cfFilterRasterToPS: zpipe - invalid or incomplete deflate data");
     break;
   case Z_MEM_ERROR:
-    if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_ERROR,
+    if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_ERROR,
                  "cfFilterRasterToPS: zpipe - out of memory");
     break;
   case Z_VERSION_ERROR:
-    if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_ERROR,
+    if (doc->logfunc) doc->logfunc(doc->logdata, CF_LOGLEVEL_ERROR,
                  "cfFilterRasterToPS: zpipe - zlib version mismatch!");
   }
 }
@@ -384,7 +384,7 @@ cfFilterRasterToPS(int inputfd,         /* I - File descriptor input stream */
   int           empty,         /* Is the input empty? */
                 Page = 0,      /* variable for counting the pages */
                 ret;           /* Return value of deflate compression */
-  filter_logfunc_t     log = data->logfunc;
+  cf_logfunc_t     log = data->logfunc;
   void                 *ld = data->logdata;
   cf_filter_iscanceledfunc_t iscanceled = data->iscanceledfunc;
   void                 *icd = data->iscanceleddata;
@@ -401,7 +401,7 @@ cfFilterRasterToPS(int inputfd,         /* I - File descriptor input stream */
   {
     if (!iscanceled || !iscanceled(icd))
     {
-      if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+      if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "cfFilterRasterToPS: Unable to open input data stream.");
     }
 
@@ -416,7 +416,7 @@ cfFilterRasterToPS(int inputfd,         /* I - File descriptor input stream */
   {
     if (!iscanceled || !iscanceled(icd))
     {
-      if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+      if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "cfFilterRasterToPS: Unable to open output data stream.");
     }
 
@@ -446,7 +446,7 @@ cfFilterRasterToPS(int inputfd,         /* I - File descriptor input stream */
   {
     if (iscanceled && iscanceled(icd))
     {
-      if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+      if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "cfFilterRasterToPS: Job canceled");
       break;
     }
@@ -467,7 +467,7 @@ cfFilterRasterToPS(int inputfd,         /* I - File descriptor input stream */
 
     Page ++;
 
-    if (log) log(ld, FILTER_LOGLEVEL_INFO,
+    if (log) log(ld, CF_LOGLEVEL_INFO,
      "cfFilterRasterToPS: Starting page %d.", Page);
 
    /*
@@ -492,7 +492,7 @@ cfFilterRasterToPS(int inputfd,         /* I - File descriptor input stream */
 
   if (empty)
   {
-     if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+     if (log) log(ld, CF_LOGLEVEL_DEBUG,
       "cfFilterRasterToPS: Input is empty, outputting empty file.");
      cupsRasterClose(ras);
      return 0;
index 0ebf70196ee42b4b1b6d1ce54c70c4402ce40d07..fc96d5c64d1d0e99358c156adc66ed703c517f6b 100644 (file)
@@ -57,7 +57,7 @@ cfFilterRasterToPWG(int inputfd,         /* I - File descriptor input stream */
   const char           *val;           /* Option value */
   cf_filter_iscanceledfunc_t iscanceled = data->iscanceledfunc;
   void                 *icd = data->iscanceleddata;
-  filter_logfunc_t     log = data->logfunc;
+  cf_logfunc_t     log = data->logfunc;
   void          *ld = data->logdata;
   cf_filter_out_format_t output_format;
 
@@ -71,14 +71,14 @@ cfFilterRasterToPWG(int inputfd,         /* I - File descriptor input stream */
       outras = cupsRasterOpen(outputfd, CUPS_RASTER_WRITE_APPLE);
     else
     {
-      if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "cfFilterRasterToPWG: Invalid output format specified. Only PWG Raster and Apple Raster/URF are supported.");
       return (1);
     }
   }
   else
   {
-    if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+    if (log) log(ld, CF_LOGLEVEL_ERROR,
                 "cfFilterRasterToPWG: Output format not specified.");
     return (1);
   }
@@ -92,7 +92,7 @@ cfFilterRasterToPWG(int inputfd,         /* I - File descriptor input stream */
 
   if (!data->ppd)
   {
-    if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if (log) log(ld, CF_LOGLEVEL_DEBUG,
      "cfFilterRasterToPWG: PPD file is not specified.");
   }
 
@@ -103,58 +103,58 @@ cfFilterRasterToPWG(int inputfd,         /* I - File descriptor input stream */
     if (iscanceled && iscanceled(icd))
     {
       /* Canceled */
-      log(ld, FILTER_LOGLEVEL_DEBUG,
+      log(ld, CF_LOGLEVEL_DEBUG,
          "cfFilterRasterToPWG: Job canceled on input page %d", page + 1);
     }
     
    /*
     * Show page device dictionary...
     */
-    if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "cfFilterRasterToPWG: Duplex = %d", inheader.Duplex);
-    if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "cfFilterRasterToPWG: HWResolution = [ %d %d ]",
                 inheader.HWResolution[0], inheader.HWResolution[1]);
-    if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "cfFilterRasterToPWG: ImagingBoundingBox = [ %d %d %d %d ]",
                 inheader.ImagingBoundingBox[0],
                 inheader.ImagingBoundingBox[1],
                 inheader.ImagingBoundingBox[2],
                 inheader.ImagingBoundingBox[3]);
-    if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "cfFilterRasterToPWG: Margins = [ %d %d ]",
                 inheader.Margins[0], inheader.Margins[1]);
-    if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "cfFilterRasterToPWG: ManualFeed = %d", inheader.ManualFeed);
-    if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "cfFilterRasterToPWG: MediaPosition = %d", inheader.MediaPosition);
-    if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "cfFilterRasterToPWG: NumCopies = %d", inheader.NumCopies);
-    if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "cfFilterRasterToPWG: Orientation = %d", inheader.Orientation);
-    if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "cfFilterRasterToPWG: PageSize = [ %d %d ]",
                 inheader.PageSize[0], inheader.PageSize[1]);
-    if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "cfFilterRasterToPWG: cupsWidth = %d", inheader.cupsWidth);
-    if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "cfFilterRasterToPWG: cupsHeight = %d", inheader.cupsHeight);
-    if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "cfFilterRasterToPWG: cupsMediaType = %d", inheader.cupsMediaType);
-    if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "cfFilterRasterToPWG: cupsBitsPerColor = %d",
                 inheader.cupsBitsPerColor);
-    if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "cfFilterRasterToPWG: cupsBitsPerPixel = %d",
                 inheader.cupsBitsPerPixel);
-    if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "cfFilterRasterToPWG: cupsBytesPerLine = %d",
                 inheader.cupsBytesPerLine);
-    if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "cfFilterRasterToPWG: cupsColorOrder = %d", inheader.cupsColorOrder);
-    if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "cfFilterRasterToPWG: cupsColorSpace = %d", inheader.cupsColorSpace);
-    if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "cfFilterRasterToPWG: cupsCompression = %d", inheader.cupsCompression);
 
    /*
@@ -163,7 +163,7 @@ cfFilterRasterToPWG(int inputfd,         /* I - File descriptor input stream */
 
     page ++;
 
-    if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "cfFilterRasterToPWG: %d %d\n", page, inheader.NumCopies);
 
     page_width  = (unsigned)(inheader.cupsPageSize[0] *
@@ -193,16 +193,16 @@ cfFilterRasterToPWG(int inputfd,         /* I - File descriptor input stream */
     linesize    = (page_width * inheader.cupsBitsPerPixel + 7) / 8;
     lineoffset  = page_left * inheader.cupsBitsPerPixel / 8; /* Round down */
 
-    if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "cfFilterRasterToPWG: In pixels: Width: %u  Height: %u  Left: %u  Right:  %u  Top: %u  Bottom: %u",
                 page_width, page_height,
                 page_left, page_right, page_top, page_bottom);
     if (page_left > page_width || page_top > page_height ||
        page_bottom > page_height || page_right > page_width)
     {
-      if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "cfFilterRasterToPWG: Unsupported raster data.");
-      if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+      if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "cfFilterRasterToPWG: Bad bottom/left/top margin on page %d.", page);
       return (1);
     }
@@ -238,9 +238,9 @@ cfFilterRasterToPWG(int inputfd,         /* I - File descriptor input stream */
          break;
 
       default :
-       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+       if (log) log(ld, CF_LOGLEVEL_ERROR,
                    "cfFilterRasterToPWG: Unsupported raster data.");
-       if (log) log(ld,FILTER_LOGLEVEL_DEBUG,
+       if (log) log(ld,CF_LOGLEVEL_DEBUG,
                     "cfFilterRasterToPWG: Unsupported cupsColorSpace %d on page %d.",
                     inheader.cupsColorSpace, page);
        return (1);
@@ -248,9 +248,9 @@ cfFilterRasterToPWG(int inputfd,         /* I - File descriptor input stream */
 
     if (inheader.cupsColorOrder != CUPS_ORDER_CHUNKED)
     {
-      if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "cfFilterRasterToPWG: Unsupported raster data.");
-      if (log) log(ld,FILTER_LOGLEVEL_DEBUG,
+      if (log) log(ld,CF_LOGLEVEL_DEBUG,
                   "cfFilterRasterToPWG: Unsupported cupsColorOrder %d on page %d.",
                   inheader.cupsColorOrder, page);
       return (1);
@@ -259,9 +259,9 @@ cfFilterRasterToPWG(int inputfd,         /* I - File descriptor input stream */
     if (inheader.cupsBitsPerPixel != 1 &&
         inheader.cupsBitsPerColor != 8 && inheader.cupsBitsPerColor != 16)
     {
-      if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "cfFilterRasterToPWG: Unsupported raster data.");
-      if (log) log(ld,FILTER_LOGLEVEL_DEBUG,
+      if (log) log(ld,CF_LOGLEVEL_DEBUG,
                   "cfFilterRasterToPWG: Unsupported cupsBitsPerColor %d on page %d.",
                   inheader.cupsBitsPerColor, page);
       return (1);
@@ -294,7 +294,7 @@ cfFilterRasterToPWG(int inputfd,         /* I - File descriptor input stream */
                 sizeof(outheader.OutputType));
       else
       {
-        if (log) log(ld,FILTER_LOGLEVEL_DEBUG,
+        if (log) log(ld,CF_LOGLEVEL_DEBUG,
                     "cfFilterRasterToPWG: Unsupported print-content-optimize value.");
         outheader.OutputType[0] = '\0';
       }
@@ -309,7 +309,7 @@ cfFilterRasterToPWG(int inputfd,         /* I - File descriptor input stream */
        outheader.cupsInteger[8] = quality;
       else
       {
-       if (log) log(ld,FILTER_LOGLEVEL_DEBUG,
+       if (log) log(ld,CF_LOGLEVEL_DEBUG,
                     "cfFilterRasterToPWG: Unsupported print-quality %d.", quality);
        outheader.cupsInteger[8] = 0;
       }
@@ -338,7 +338,7 @@ cfFilterRasterToPWG(int inputfd,         /* I - File descriptor input stream */
                 sizeof(outheader.cupsRenderingIntent));
       else
       {
-        if (log) log(ld,FILTER_LOGLEVEL_DEBUG,
+        if (log) log(ld,CF_LOGLEVEL_DEBUG,
                     "cfFilterRasterToPWG: Unsupported print-rendering-intent value.");
         outheader.cupsRenderingIntent[0] = '\0';
       }
@@ -363,7 +363,7 @@ cfFilterRasterToPWG(int inputfd,         /* I - File descriptor input stream */
                 sizeof(outheader.cupsPageSizeName) - 1);
       else
       {
-        if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+        if (log) log(ld, CF_LOGLEVEL_DEBUG,
                     "cfFilterRasterToPWG: Unsupported PageSize %.2fx%.2f.",
                     inheader.cupsPageSize[0], inheader.cupsPageSize[1]);
         outheader.cupsPageSizeName[0] = '\0';
@@ -473,7 +473,7 @@ cfFilterRasterToPWG(int inputfd,         /* I - File descriptor input stream */
         * Unsupported value...
         */
 
-        if (log) log(ld,FILTER_LOGLEVEL_DEBUG,
+        if (log) log(ld,CF_LOGLEVEL_DEBUG,
                     "cfFilterRasterToPWG: Unsupported cupsBackSide value.");
 
        outheader.cupsInteger[1] = 1;   /* CrossFeedTransform */
@@ -506,9 +506,9 @@ cfFilterRasterToPWG(int inputfd,         /* I - File descriptor input stream */
 
     if (!cupsRasterWriteHeader2(outras, &outheader))
     {
-      if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "cfFilterRasterToPWG: Error sending raster data.");
-      if (log) log(ld,FILTER_LOGLEVEL_DEBUG,
+      if (log) log(ld,CF_LOGLEVEL_DEBUG,
                   "cfFilterRasterToPWG: Unable to write header for page %d.", page);
       return (1);
     }
@@ -529,9 +529,9 @@ cfFilterRasterToPWG(int inputfd,         /* I - File descriptor input stream */
     for (y = page_top; y > 0; y --)
       if (!cupsRasterWritePixels(outras, line, outheader.cupsBytesPerLine))
       {
-       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+       if (log) log(ld, CF_LOGLEVEL_ERROR,
                     "cfFilterRasterToPWG: Error sending raster data.");
-       if (log) log(ld,FILTER_LOGLEVEL_DEBUG,
+       if (log) log(ld,CF_LOGLEVEL_DEBUG,
                     "cfFilterRasterToPWG: Unable to write line %d for page %d.",
                     page_top - y + 1, page);
        return (1);
@@ -543,9 +543,9 @@ cfFilterRasterToPWG(int inputfd,         /* I - File descriptor input stream */
                               inheader.cupsBytesPerLine) !=
          inheader.cupsBytesPerLine)
       {
-       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+       if (log) log(ld, CF_LOGLEVEL_ERROR,
                     "cfFilterRasterToPWG: Error sending raster data.");
-       if (log) log(ld,FILTER_LOGLEVEL_DEBUG,
+       if (log) log(ld,CF_LOGLEVEL_DEBUG,
                     "cfFilterRasterToPWG: Unable to read line %d for page %d.",
                     inheader.cupsHeight - y + page_top + 1, page);
        return (1);
@@ -553,9 +553,9 @@ cfFilterRasterToPWG(int inputfd,         /* I - File descriptor input stream */
 
       if (!cupsRasterWritePixels(outras, line, outheader.cupsBytesPerLine))
       {
-       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+       if (log) log(ld, CF_LOGLEVEL_ERROR,
                     "cfFilterRasterToPWG: Error sending raster data.");
-       if (log) log(ld,FILTER_LOGLEVEL_DEBUG,
+       if (log) log(ld,CF_LOGLEVEL_DEBUG,
                     "cfFilterRasterToPWG: Unable to write line %d for page %d.",
                     inheader.cupsHeight - y + page_top + 1, page);
        return (1);
@@ -566,9 +566,9 @@ cfFilterRasterToPWG(int inputfd,         /* I - File descriptor input stream */
     for (y = page_bottom; y > 0; y --)
       if (!cupsRasterWritePixels(outras, line, outheader.cupsBytesPerLine))
       {
-       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+       if (log) log(ld, CF_LOGLEVEL_ERROR,
                     "cfFilterRasterToPWG: Error sending raster data.");
-       if (log) log(ld,FILTER_LOGLEVEL_DEBUG,
+       if (log) log(ld,CF_LOGLEVEL_DEBUG,
                     "cfFilterRasterToPWG: Unable to write line %d for page %d.",
                     page_bottom - y + page_top + inheader.cupsHeight + 1,
                     page);
index dc39c76747c65405a6366ad4230b9551b8805608..e34431dac44222bcdf66cafc709a5d112b9fdb2d 100644 (file)
@@ -308,7 +308,7 @@ cfRGBLoad(ppd_file_t *ppd,          /* I - PPD file */
             const char *colormodel,    /* I - Color model */
             const char *media,         /* I - Media type */
             const char *resolution,    /* I - Resolution */
-           filter_logfunc_t log,       /* I - Log function */
+           cf_logfunc_t log,       /* I - Log function */
            void       *ld)             /* I - Log function data */
 {
   int          i,                      /* Looping var */
@@ -333,7 +333,7 @@ cfRGBLoad(ppd_file_t *ppd,          /* I - PPD file */
   if ((attr = cfFindAttr(ppd, "cupsRGBProfile", colormodel, media,
                            resolution, spec, sizeof(spec), log, ld)) == NULL)
   {
-    if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "No cupsRGBProfile attribute found for the current settings!");
     return (NULL);
   }
@@ -341,7 +341,7 @@ cfRGBLoad(ppd_file_t *ppd,          /* I - PPD file */
   if (!attr->value || sscanf(attr->value, "%d%d%d", &cube_size, &num_channels,
                              &num_samples) != 3)
   {
-    if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+    if (log) log(ld, CF_LOGLEVEL_ERROR,
                 "Bad cupsRGBProfile attribute \'%s\'!",
                 attr->value ? attr->value : "(null)");
     return (NULL);
@@ -351,7 +351,7 @@ cfRGBLoad(ppd_file_t *ppd,          /* I - PPD file */
       num_channels < 1 || num_channels > CF_MAX_RGB ||
       num_samples != (cube_size * cube_size * cube_size))
   {
-    if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+    if (log) log(ld, CF_LOGLEVEL_ERROR,
                 "Bad cupsRGBProfile attribute \'%s\'!",
                 attr->value);
     return (NULL);
@@ -363,7 +363,7 @@ cfRGBLoad(ppd_file_t *ppd,          /* I - PPD file */
 
   if ((samples = calloc(num_samples, sizeof(cf_sample_t))) == NULL)
   {
-    if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+    if (log) log(ld, CF_LOGLEVEL_ERROR,
                 "Unable to allocate memory for RGB profile!");
     return (NULL);
   }
@@ -377,7 +377,7 @@ cfRGBLoad(ppd_file_t *ppd,          /* I - PPD file */
       break;
     else if (!attr->value)
     {
-      if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "Bad cupsRGBSample value!");
       break;
     }
@@ -385,7 +385,7 @@ cfRGBLoad(ppd_file_t *ppd,          /* I - PPD file */
                     values + 1, values + 2, values + 3, values + 4, values + 5,
                     values + 6) != (3 + num_channels))
     {
-      if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "Bad cupsRGBSample value!");
       break;
     }
index 6f534808d0591312256b815fbc325843ee9f2d53..93c734c12bb6f8c28ce1c67ac7f612e138e27852 100644 (file)
@@ -26,7 +26,7 @@
 #include "driver.h"
 #include <sys/stat.h>
 
-filter_logfunc_t logfunc = cfCUPSLogFunc;    /* Log function */
+cf_logfunc_t logfunc = cfCUPSLogFunc;    /* Log function */
 void             *ld = NULL;                /* Log function data */
 
 void   test_gray(int num_comps, const char *basename);
index 5726f704f06184127a558c4332bdb3ca9f49d586..6b334795c6f9bda75100c5a54a0b16a7aa92e389 100644 (file)
@@ -33,7 +33,7 @@
 #include <string.h>
 #include <ctype.h>
 
-filter_logfunc_t logfunc = cfCUPSLogFunc;    /* Log function */
+cf_logfunc_t logfunc = cfCUPSLogFunc;    /* Log function */
 void             *ld = NULL;                /* Log function data */
 
 
index 1070b0c029e0e58690deb3091d5e9c57084ca365..e9d59b0e73f7dc4ec3daeac98f2beeca7a4a1558 100644 (file)
@@ -527,7 +527,7 @@ typedef struct texttopdf_doc_s
 } texttopdf_doc_t;
 
 
-EMB_PARAMS *font_load(const char *font, int fontwidth, filter_logfunc_t log,
+EMB_PARAMS *font_load(const char *font, int fontwidth, cf_logfunc_t log,
                      void *ld)
 {
   OTF_FILE *otf;
@@ -594,7 +594,7 @@ EMB_PARAMS *font_load(const char *font, int fontwidth, filter_logfunc_t log,
   if (!fontname)
   {
     // TODO: try /usr/share/fonts/*/*/%s.ttf
-    if(log) log(ld, FILTER_LOGLEVEL_ERROR,"cfFilterTextToPDF: No viable font found.");
+    if(log) log(ld, CF_LOGLEVEL_ERROR,"cfFilterTextToPDF: No viable font found.");
     return NULL;
   }
 
@@ -729,7 +729,7 @@ static void     write_pretty_header();
 int             WriteProlog(const char *title, const char *user,
                            const char *classification, const char *label, 
                            ppd_file_t *ppd, texttopdf_doc_t *doc,
-                           filter_logfunc_t log, void *ld);
+                           cf_logfunc_t log, void *ld);
 void            WritePage(texttopdf_doc_t *doc);
 void            WriteEpilogue(texttopdf_doc_t *doc);
 
@@ -764,7 +764,7 @@ cfFilterTextToPDF(int inputfd,      /* I - File descriptor input stream */
   enum {StrBeg=-1, NoStr, StrEnd}      
                strState;       /* Inside a dbl-quoted string */
 
-  filter_logfunc_t log = data->logfunc;
+  cf_logfunc_t log = data->logfunc;
   void         *ld = data->logdata;
   cf_filter_iscanceledfunc_t iscanceled = data->iscanceledfunc;
   void         *icd = data->iscanceleddata;
@@ -826,7 +826,7 @@ cfFilterTextToPDF(int inputfd,      /* I - File descriptor input stream */
   {
     if (!iscanceled || !iscanceled(icd))
     {
-      if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+      if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "textopdf: Unable to open input data stream.");
     }
     return (1);
@@ -943,7 +943,7 @@ cfFilterTextToPDF(int inputfd,      /* I - File descriptor input stream */
 
     if (doc.PageColumns < 1)
     {
-      if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "cfFilterTextToPDF: Bad columns value %d", doc.PageColumns);
       ret = 1;
       goto out;
@@ -956,7 +956,7 @@ cfFilterTextToPDF(int inputfd,      /* I - File descriptor input stream */
 
     if (doc.CharsPerInch <= 0.0)
     {
-      if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "cfFilterTextToPDF: Bad cpi value %f", doc.CharsPerInch);
       ret = 1;
       goto out;
@@ -969,7 +969,7 @@ cfFilterTextToPDF(int inputfd,      /* I - File descriptor input stream */
 
     if (doc.LinesPerInch <= 0.0)
     {
-      if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "cfFilterTextToPDF: Bad lpi value %f", doc.LinesPerInch);
       ret = 1;
       goto out;
@@ -996,7 +996,7 @@ cfFilterTextToPDF(int inputfd,      /* I - File descriptor input stream */
 
   if (doc.SizeLines >= INT_MAX / doc.SizeColumns / sizeof(lchar_t))
   {
-    if (log) log(ld, FILTER_LOGLEVEL_ERROR, "cfFilterTextToPDF: Bad page size");
+    if (log) log(ld, CF_LOGLEVEL_ERROR, "cfFilterTextToPDF: Bad page size");
     ret = 1;
     goto out;
   }
@@ -1004,7 +1004,7 @@ cfFilterTextToPDF(int inputfd,    /* I - File descriptor input stream */
   doc.Page    = calloc(sizeof(lchar_t *), doc.SizeLines);
   if (!doc.Page)
   {
-    if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+    if (log) log(ld, CF_LOGLEVEL_ERROR,
                 "cfFilterTextToPDF: cannot allocate memory for page");
     ret = 1;
     goto out;
@@ -1014,7 +1014,7 @@ cfFilterTextToPDF(int inputfd,    /* I - File descriptor input stream */
   if (!doc.Page[0])
   {
     free(doc.Page);
-    if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+    if (log) log(ld, CF_LOGLEVEL_ERROR,
                 "cfFilterTextToPDF: cannot allocate memory for page");
     ret = 1;
     goto out;
@@ -1519,7 +1519,7 @@ cfFilterTextToPDF(int inputfd,    /* I - File descriptor input stream */
   /* Do not write anything if the input file is empty */
   if (empty)
   {
-    if(log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if(log) log(ld, CF_LOGLEVEL_DEBUG,
                "Input is empty, outputting empty file");
     goto out;
   }
@@ -1703,7 +1703,7 @@ WriteProlog(const char *title,            /* I - Title of job */
            const char *label,          /* I - Page label */
             ppd_file_t *ppd,           /* I - PPD file info */
             texttopdf_doc_t *doc,
-            filter_logfunc_t log,
+            cf_logfunc_t log,
             void *ld)
 {
   int          i, j, k;        /* Looping vars */
@@ -1815,7 +1815,7 @@ WriteProlog(const char *title,            /* I - Title of job */
       * Can't open charset file!
       */
 
-      if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "cfFilterTextToPDF: Unable to open %s: %s",
                   filename, strerror(errno));
       return (1);
@@ -1832,7 +1832,7 @@ WriteProlog(const char *title,            /* I - Title of job */
       */
 
       fclose(fp);
-      if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "cfFilterTextToPDF: Bad charset file %s", filename);
       return (1);
     }
@@ -1844,7 +1844,7 @@ WriteProlog(const char *title,            /* I - Title of job */
       */
 
       fclose(fp);
-      if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "cfFilterTextToPDF: Bad charset file %s", filename);
       return (1);
     }
@@ -1908,7 +1908,7 @@ WriteProlog(const char *title,            /* I - Title of job */
          * Can't have a font without all required values...
          */
 
-         if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+         if (log) log(ld, CF_LOGLEVEL_ERROR,
                       "cfFilterTextToPDF: Bad font description line: %s", valptr);
          return (1);
        }
@@ -1921,7 +1921,7 @@ WriteProlog(const char *title,            /* I - Title of job */
          doc->Directions[doc->NumFonts] = -1;
        else
        {
-         if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+         if (log) log(ld, CF_LOGLEVEL_ERROR,
                       "cfFilterTextToPDF: Bad text direction %s", valptr);
          return (1);
        }
@@ -1944,7 +1944,7 @@ WriteProlog(const char *title,            /* I - Title of job */
          * Can't have a font without all required values...
          */
 
-         if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+         if (log) log(ld, CF_LOGLEVEL_ERROR,
                       "cfFilterTextToPDF: Bad font description line: %s", valptr);
          return (1);
        }
@@ -1957,7 +1957,7 @@ WriteProlog(const char *title,            /* I - Title of job */
           doc->Widths[doc->NumFonts] = 2;
        else 
        {
-         if(log) log(ld, FILTER_LOGLEVEL_ERROR,
+         if(log) log(ld, CF_LOGLEVEL_ERROR,
                      "cfFilterTextToPDF: Bad text width %s", valptr);
          return (1);
        }
@@ -1995,7 +1995,7 @@ WriteProlog(const char *title,            /* I - Title of job */
                font_load(valptr, doc->Widths[doc->NumFonts], log, ld);
               if (!fonts[num_fonts]) // font missing/corrupt, replace by first
              {
-                if(log) log(ld, FILTER_LOGLEVEL_WARN,
+                if(log) log(ld, CF_LOGLEVEL_WARN,
                            "cfFilterTextToPDF: Ignored bad font \"%s\"",valptr);
                 break;
               }
@@ -2099,7 +2099,7 @@ WriteProlog(const char *title,            /* I - Title of job */
         /*
          * Can't have a font without all required values...
          */
-         if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+         if (log) log(ld, CF_LOGLEVEL_ERROR,
                       "cfFilterTextToPDF: Bad font description line: %s", valptr);
          return (1);
        }
@@ -2112,7 +2112,7 @@ WriteProlog(const char *title,            /* I - Title of job */
          doc->Directions[doc->NumFonts] = -1;
        else
        {
-         if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+         if (log) log(ld, CF_LOGLEVEL_ERROR,
                       "cfFilterTextToPDF: Bad text direction %s", valptr);
          return (1);
        }
@@ -2134,7 +2134,7 @@ WriteProlog(const char *title,            /* I - Title of job */
         /*
          * Can't have a font without all required values...
          */
-         if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+         if (log) log(ld, CF_LOGLEVEL_ERROR,
                       "cfFilterTextToPDF: Bad font description line: %s", valptr);
          return (1);
        }
@@ -2147,7 +2147,7 @@ WriteProlog(const char *title,            /* I - Title of job */
           doc->Widths[doc->NumFonts] = 2;
        else 
        {
-         if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+         if (log) log(ld, CF_LOGLEVEL_ERROR,
                       "cfFilterTextToPDF: Bad text width %s", valptr);
          return (1);
        }
@@ -2185,7 +2185,7 @@ WriteProlog(const char *title,            /* I - Title of job */
                font_load(valptr, doc->Widths[doc->NumFonts], log, ld);
               if (!fonts[num_fonts]) // font missing/corrupt, replace by first
              {
-                if(log) log(ld, FILTER_LOGLEVEL_WARN,
+                if(log) log(ld, CF_LOGLEVEL_WARN,
                            "cfFilterTextToPDF: Ignored bad font \"%s\"",valptr);
                 break;
               }
@@ -2229,7 +2229,7 @@ WriteProlog(const char *title,            /* I - Title of job */
     } // }}}
     else // {{{
     {
-      if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "cfFilterTextToPDF: Bad charset type %s", lineptr);
       return (1);
     } // }}}
@@ -2264,7 +2264,7 @@ WriteProlog(const char *title,            /* I - Title of job */
   // }}}
 
   if (doc->NumFonts == 0) {
-    if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+    if (log) log(ld, CF_LOGLEVEL_ERROR,
                 "cfFilterTextToPDF:No usable font available");
     return (1);
   }
index 2f3f78f431df4b725ef67cea5dc5f82c79b9b16c..622a305b51be57a331a17005c599ad6ae35bb5bf 100644 (file)
@@ -157,7 +157,7 @@ int cfFilterTextToText(int inputfd,         /* I - File descriptor input stream
   ipp_t *defsize;
   char buf[2048];
 
-  filter_logfunc_t     log = data->logfunc;
+  cf_logfunc_t     log = data->logfunc;
   void          *ld = data->logdata;
 
   cf_filter_iscanceledfunc_t iscanceled = data->iscanceledfunc;
@@ -175,7 +175,7 @@ int cfFilterTextToText(int inputfd,         /* I - File descriptor input stream
   {
     if (!iscanceled || !iscanceled(icd))
     {
-      if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+      if (log) log(ld, CF_LOGLEVEL_DEBUG,
                     "cfFilterBannerToPDF: Unable to open output data stream.");
     }
     return (1);
@@ -241,8 +241,8 @@ int cfFilterTextToText(int inputfd,         /* I - File descriptor input stream
       }
       num_chars_per_inch = atoi(val);
     }
-    if(log) log(ld, FILTER_LOGLEVEL_DEBUG,"cfFilterTextToText: num of lines per inch = %d",num_lines_per_inch);
-    if(log) log(ld, FILTER_LOGLEVEL_DEBUG,"cfFilterTextToText: num of chars per inch = %d",num_chars_per_inch);
+    if(log) log(ld, CF_LOGLEVEL_DEBUG,"cfFilterTextToText: num of lines per inch = %d",num_lines_per_inch);
+    if(log) log(ld, CF_LOGLEVEL_DEBUG,"cfFilterTextToText: num of chars per inch = %d",num_chars_per_inch);
 
   /* With the "PageSize"/"PageRegion" options we only determine the number
      of lines and columns of a page, we do not use the geometry defined by
@@ -260,7 +260,7 @@ int cfFilterTextToText(int inputfd,         /* I - File descriptor input stream
     if(val==NULL)
       val = ppd_attr->value;
 
-    if(log) log(ld, FILTER_LOGLEVEL_DEBUG,"cfFilterTextToText: PageSize: %s", val);
+    if(log) log(ld, CF_LOGLEVEL_DEBUG,"cfFilterTextToText: PageSize: %s", val);
     snprintf(buffer, sizeof(buffer), "Default%sNumLines", val);
     if ((val2 = cupsGetOption(buffer + 7, num_options, options)) != NULL ||
   (ipp = ippFindAttribute(job_attrs, buffer+7, IPP_TAG_ZERO))!= NULL   ||
@@ -294,12 +294,12 @@ if(val2==NULL)
       num_columns = atoi(val2);
     }
     if (num_lines <= 0) {
-      if(log) log(ld, FILTER_LOGLEVEL_DEBUG,"cfFilterTextToText: Invalid number of lines %d, using default: 66",
+      if(log) log(ld, CF_LOGLEVEL_DEBUG,"cfFilterTextToText: Invalid number of lines %d, using default: 66",
              num_lines);
       num_lines = 66;
     }
     if (num_columns <= 0) {
-      if(log) log(ld, FILTER_LOGLEVEL_DEBUG,"cfFilterTextToText: Invalid number of columns %d, using default: 80",
+      if(log) log(ld, CF_LOGLEVEL_DEBUG,"cfFilterTextToText: Invalid number of columns %d, using default: 80",
              num_columns);
       num_columns = 80;
     }
@@ -320,12 +320,12 @@ if(val2==NULL)
     num_columns = (int)((x_dim/72.0)*(num_chars_per_inch));
   }
   if (num_lines <= 0) {
-    if(log) log(ld, FILTER_LOGLEVEL_DEBUG,"cfFilterTextToText: Invalid number of lines %d, using default: 66",
+    if(log) log(ld, CF_LOGLEVEL_DEBUG,"cfFilterTextToText: Invalid number of lines %d, using default: 66",
              num_lines);
     num_lines = 66;
   }
   if (num_columns <= 0) {
-    if(log) log(ld, FILTER_LOGLEVEL_DEBUG,"cfFilterTextToText: Invalid number of columns %d, using default: 80",
+    if(log) log(ld, CF_LOGLEVEL_DEBUG,"cfFilterTextToText: Invalid number of columns %d, using default: 80",
              num_columns);
     num_columns = 80;
   }
@@ -342,7 +342,7 @@ if(val2==NULL)
     if (i > 0)
       num_lines = i;
     else
-      if(log) log(ld, FILTER_LOGLEVEL_DEBUG, "cfFilterTextToText: Invalid number of lines %d, using default value: %d",
+      if(log) log(ld, CF_LOGLEVEL_DEBUG, "cfFilterTextToText: Invalid number of lines %d, using default value: %d",
              i, num_lines);
   }
   if ((val = cupsGetOption("page-width", num_options, options)) != NULL ||
@@ -355,11 +355,11 @@ if(val2==NULL)
     if (i > 0)
       num_columns = i;
     else
-      if(log) log(ld, FILTER_LOGLEVEL_DEBUG, "cfFilterTextToText: Invalid number of columns %d, using default value: %d",
+      if(log) log(ld, CF_LOGLEVEL_DEBUG, "cfFilterTextToText: Invalid number of columns %d, using default value: %d",
              i, num_columns);
   }
 
-  if(log) log(ld, FILTER_LOGLEVEL_DEBUG, "cfFilterTextToText: Lines per page: %d; Characters per line: %d",
+  if(log) log(ld, CF_LOGLEVEL_DEBUG, "cfFilterTextToText: Lines per page: %d; Characters per line: %d",
          num_lines, num_columns);
   
   if ((val = cupsGetOption("page-left", num_options, options)) != NULL ||
@@ -376,7 +376,7 @@ if(val2==NULL)
       val += 7;
     page_left = atoi(val);
     if (page_left < 0 || page_left > num_columns - 1) {
-      if(log) log(ld, FILTER_LOGLEVEL_DEBUG, "cfFilterTextToText: Invalid left margin %d, setting to 0",
+      if(log) log(ld, CF_LOGLEVEL_DEBUG, "cfFilterTextToText: Invalid left margin %d, setting to 0",
              page_left);
       page_left = 0;
     }
@@ -395,7 +395,7 @@ if(val2==NULL)
       val += 7;
     page_right = atoi(val);
     if (page_right < 0 || page_right > num_columns - page_left - 1) {
-      if(log) log(ld, FILTER_LOGLEVEL_DEBUG, "cfFilterTextToText: Invalid right margin %d, setting to 0",
+      if(log) log(ld, CF_LOGLEVEL_DEBUG, "cfFilterTextToText: Invalid right margin %d, setting to 0",
              page_right);
       page_right = 0;
     }
@@ -415,7 +415,7 @@ if(val2==NULL)
       val += 7;
     page_top = atoi(val);
     if (page_top < 0 || page_top > num_lines - 1) {
-      if(log) log(ld, FILTER_LOGLEVEL_DEBUG, "cfFilterTextToText: Invalid top margin %d, setting to 0",
+      if(log) log(ld, CF_LOGLEVEL_DEBUG, "cfFilterTextToText: Invalid top margin %d, setting to 0",
              page_top);
       page_top = 0;
     }
@@ -434,17 +434,17 @@ if(val2==NULL)
       val += 7;
     page_bottom = atoi(val);
     if (page_bottom < 0 || page_bottom > num_lines - page_top - 1) {
-      if(log) log(ld, FILTER_LOGLEVEL_DEBUG, "cfFilterTextToText: Invalid bottom margin %d, setting to 0",
+      if(log) log(ld, CF_LOGLEVEL_DEBUG, "cfFilterTextToText: Invalid bottom margin %d, setting to 0",
              page_bottom);
       page_bottom = 0;
     }
   }
-  if(log) log(ld, FILTER_LOGLEVEL_DEBUG, "cfFilterTextToText: Margins: Left (Columns): %d; Right (Columns): %d; Top (Lines): %d; Bottom (Lines): %d",
+  if(log) log(ld, CF_LOGLEVEL_DEBUG, "cfFilterTextToText: Margins: Left (Columns): %d; Right (Columns): %d; Top (Lines): %d; Bottom (Lines): %d",
          page_left, page_right, page_top, page_bottom);
 
   text_width = num_columns - page_left - page_right;
   text_height = num_lines - page_top - page_bottom;
-  if(log) log(ld, FILTER_LOGLEVEL_DEBUG, "cfFilterTextToText: Text area: Lines per page: %d; Characters per line: %d",
+  if(log) log(ld, CF_LOGLEVEL_DEBUG, "cfFilterTextToText: Text area: Lines per page: %d; Characters per line: %d",
          text_height, text_width);
 
   strcpy(encoding, "ASCII//IGNORE");
@@ -466,7 +466,7 @@ if(val2==NULL)
        *p = toupper(*p);
     }
   }
-  if(log) log(ld, FILTER_LOGLEVEL_DEBUG, "cfFilterTextToText: Output encoding: %s", encoding);
+  if(log) log(ld, CF_LOGLEVEL_DEBUG, "cfFilterTextToText: Output encoding: %s", encoding);
   
   if ((val = cupsGetOption("OverlongLines", num_options, options)) != NULL ||
       (ipp = ippFindAttribute(job_attrs, "overlong-lines", IPP_TAG_ENUM))!=NULL ||
@@ -485,10 +485,10 @@ if(val2==NULL)
     else if (!strcasecmp(val, "WrapAtWidth"))
       overlong_lines = WRAPATWIDTH;
     else
-      if(log) log(ld, FILTER_LOGLEVEL_DEBUG, "cfFilterTextToText: Invalid value for OverlongLines: %s, using default value",
+      if(log) log(ld, CF_LOGLEVEL_DEBUG, "cfFilterTextToText: Invalid value for OverlongLines: %s, using default value",
              val);
   }
-  if(log) log(ld, FILTER_LOGLEVEL_DEBUG, "cfFilterTextToText: Handling of overlong lines: %s",
+  if(log) log(ld, CF_LOGLEVEL_DEBUG, "cfFilterTextToText: Handling of overlong lines: %s",
          (overlong_lines == TRUNCATE ? "Truncate at maximum width" :
           (overlong_lines == WORDWRAP ? "Word-wrap" :
            "Wrap exactly at maximum width")));
@@ -509,10 +509,10 @@ if(val2==NULL)
     if (i > 0)
       tab_width = i;
     else
-      if(log) log(ld, FILTER_LOGLEVEL_DEBUG, "cfFilterTextToText: Invalid tab width %d, using default value: %d",
+      if(log) log(ld, CF_LOGLEVEL_DEBUG, "cfFilterTextToText: Invalid tab width %d, using default value: %d",
              i, tab_width);
   }
-  if(log) log(ld, FILTER_LOGLEVEL_DEBUG, "cfFilterTextToText: Tab width: %d", tab_width);
+  if(log) log(ld, CF_LOGLEVEL_DEBUG, "cfFilterTextToText: Tab width: %d", tab_width);
 
   if ((val = cupsGetOption("Pagination", num_options, options)) != NULL ||
       (ipp = ippFindAttribute(job_attrs, "pagination", IPP_TAG_BOOLEAN))!=NULL  ||
@@ -529,10 +529,10 @@ if(val2==NULL)
     else if (is_false(val))
       pagination = 0;
     else
-      if(log) log(ld, FILTER_LOGLEVEL_DEBUG, "cfFilterTextToText: Invalid value for Pagination: %s, using default value",
+      if(log) log(ld, CF_LOGLEVEL_DEBUG, "cfFilterTextToText: Invalid value for Pagination: %s, using default value",
              val);
   }
-  if(log) log(ld, FILTER_LOGLEVEL_DEBUG, "cfFilterTextToText: Pagination (Print in defined pages): %s",
+  if(log) log(ld, CF_LOGLEVEL_DEBUG, "cfFilterTextToText: Pagination (Print in defined pages): %s",
          (pagination ? "Yes" : "No"));
 
   if ((val = cupsGetOption("SendFF", num_options, options)) != NULL ||
@@ -550,10 +550,10 @@ if(val2==NULL)
     else if (is_false(val))
       send_ff = 0;
     else
-      if(log) log(ld, FILTER_LOGLEVEL_DEBUG, "cfFilterTextToText: Invalid value for SendFF: %s, using default value",
+      if(log) log(ld, CF_LOGLEVEL_DEBUG, "cfFilterTextToText: Invalid value for SendFF: %s, using default value",
              val);
   }
-  if(log) log(ld, FILTER_LOGLEVEL_DEBUG, "cfFilterTextToText: Send Form Feed character at end of page: %s",
+  if(log) log(ld, CF_LOGLEVEL_DEBUG, "cfFilterTextToText: Send Form Feed character at end of page: %s",
          (send_ff ? "Yes" : "No"));
 
   if ((val = cupsGetOption("NewlineCharacters", num_options, options)) !=
@@ -574,10 +574,10 @@ if(val2==NULL)
     else if (!strcasecmp(val, "CRLF"))
       newline_char = CRLF;
     else
-      if(log) log(ld, FILTER_LOGLEVEL_DEBUG, "cfFilterTextToText: Invalid value for NewlineCharacters: %s, using default value",
+      if(log) log(ld, CF_LOGLEVEL_DEBUG, "cfFilterTextToText: Invalid value for NewlineCharacters: %s, using default value",
              val);
   }
-  if(log) log(ld, FILTER_LOGLEVEL_DEBUG, "cfFilterTextToText: Characters sent to make printer start a new line: %s",
+  if(log) log(ld, CF_LOGLEVEL_DEBUG, "cfFilterTextToText: Characters sent to make printer start a new line: %s",
          (newline_char == LF ? "Line Feed (LF)" :
           (newline_char == CR ? "Carriage Return (CR)" :
            "Carriage Return (CR) and Line Feed (LF)")));
@@ -593,7 +593,7 @@ if(val2==NULL)
       page_ranges = strdup(val);
   }
   if (page_ranges)
-    if(log) log(ld, FILTER_LOGLEVEL_DEBUG, "cfFilterTextToText: Page selection: %s", page_ranges);
+    if(log) log(ld, CF_LOGLEVEL_DEBUG, "cfFilterTextToText: Page selection: %s", page_ranges);
 
   if ((val = cupsGetOption("page-set", num_options, options)) !=
       NULL  ||
@@ -612,11 +612,11 @@ if(val2==NULL)
       even_pages = 1;
       odd_pages = 1;
     } else
-      if(log) log(ld, FILTER_LOGLEVEL_DEBUG, "cfFilterTextToText: Invalid value for page-set: %s, using default value",
+      if(log) log(ld, CF_LOGLEVEL_DEBUG, "cfFilterTextToText: Invalid value for page-set: %s, using default value",
              val);
   }
   if (!even_pages || !odd_pages)
-    if(log) log(ld, FILTER_LOGLEVEL_DEBUG, "cfFilterTextToText: Print %s",
+    if(log) log(ld, CF_LOGLEVEL_DEBUG, "cfFilterTextToText: Print %s",
            (even_pages ? "only the even pages" :
             (odd_pages ? "only the odd pages" :
              "no pages")));
@@ -631,10 +631,10 @@ if(val2==NULL)
     if (!strcasecmp(val, "reverse"))
       reverse_order = 1;
     else
-      if(log) log(ld, FILTER_LOGLEVEL_DEBUG, "cfFilterTextToText: Invalid value for OutputOrder: %s, using default value",
+      if(log) log(ld, CF_LOGLEVEL_DEBUG, "cfFilterTextToText: Invalid value for OutputOrder: %s, using default value",
              val);
   }
-  if(log) log(ld, FILTER_LOGLEVEL_DEBUG, "cfFilterTextToText: Print pages in reverse order: %s",
+  if(log) log(ld, CF_LOGLEVEL_DEBUG, "cfFilterTextToText: Print pages in reverse order: %s",
          (reverse_order ? "Yes" : "No"));
 
   if ((val = cupsGetOption("Collate", num_options, options)) != NULL  ||
@@ -648,10 +648,10 @@ if(val2==NULL)
     else if (is_false(val))
       collate = 0;
     else
-      if(log) log(ld, FILTER_LOGLEVEL_DEBUG, "cfFilterTextToText: Invalid value for Collate: %s, using default value",
+      if(log) log(ld, CF_LOGLEVEL_DEBUG, "cfFilterTextToText: Invalid value for Collate: %s, using default value",
              val);
   }
-  if(log) log(ld, FILTER_LOGLEVEL_DEBUG, "cfFilterTextToText: Collate copies: %s",
+  if(log) log(ld, CF_LOGLEVEL_DEBUG, "cfFilterTextToText: Collate copies: %s",
          (collate ? "Yes" : "No"));
 
   /* Create a string to insert as the newline mark */
@@ -677,11 +677,11 @@ if(val2==NULL)
     /* Something went wrong.  */
     if (errno == EINVAL)
     {
-      if(log) log(ld, FILTER_LOGLEVEL_ERROR, "cfFilterTextToText: Conversion from UTF-8 to %s not available",
+      if(log) log(ld, CF_LOGLEVEL_ERROR, "cfFilterTextToText: Conversion from UTF-8 to %s not available",
              encoding);
     }else
     {
-      if(log) log(ld, FILTER_LOGLEVEL_ERROR, "cfFilterTextToText: Error setting up conversion from UTF-8 to %s",
+      if(log) log(ld, CF_LOGLEVEL_ERROR, "cfFilterTextToText: Error setting up conversion from UTF-8 to %s",
              encoding);
     }
     goto error;
@@ -690,7 +690,7 @@ if(val2==NULL)
   /* Open the input file */
   fd = inputfd;
   if (fd < 0) {
-    if(log) log(ld, FILTER_LOGLEVEL_ERROR, "cfFilterTextToText: Unable to open input text file");
+    if(log) log(ld, CF_LOGLEVEL_ERROR, "cfFilterTextToText: Unable to open input text file");
     goto error;
   }
 
@@ -728,7 +728,7 @@ if(val2==NULL)
          ends with an incomplete UTF-8 character. Log
          this fact. */
       if (insize > 0 && incomplete_char){
-             if(log) log(ld, FILTER_LOGLEVEL_DEBUG, "cfFilterTextToText: Input text file ends with incomplete UTF-8 character sequence, file possibly incomplete, but printing the successfully read part anyway");
+             if(log) log(ld, CF_LOGLEVEL_DEBUG, "cfFilterTextToText: Input text file ends with incomplete UTF-8 character sequence, file possibly incomplete, but printing the successfully read part anyway");
       }
 
       /* Now write out the byte sequence to get into the
@@ -756,7 +756,7 @@ if(val2==NULL)
        } else {
          /* We found an illegal UTF-8 byte sequence here,
             so error out at this point. */
-         if(log) log(ld, FILTER_LOGLEVEL_ERROR, "cfFilterTextToText: Illegal UTF-8 sequence found. Input file perhaps not UTF-8-encoded");
+         if(log) log(ld, CF_LOGLEVEL_ERROR, "cfFilterTextToText: Illegal UTF-8 sequence found. Input file perhaps not UTF-8-encoded");
          result = -1;
          break;
        }
@@ -833,12 +833,12 @@ if(val2==NULL)
               load) */
            if (num_pages == 1)
       {
-            if(log) log(ld, FILTER_LOGLEVEL_INFO, "cfFilterTextToText: 1 1");
+            if(log) log(ld, CF_LOGLEVEL_INFO, "cfFilterTextToText: 1 1");
       }
          } else if ((num_copies == 1 || !collate) && !reverse_order) {
       
            /* Log the page output */
-           if(log) log(ld, FILTER_LOGLEVEL_INFO, "cfFilterTextToText: %d %d", num_pages, num_copies);
+           if(log) log(ld, CF_LOGLEVEL_INFO, "cfFilterTextToText: %d %d", num_pages, num_copies);
          } else {
            /* Save the page in the page array */
            cupsArrayAdd(page_array, strdup(out_page));
@@ -935,7 +935,7 @@ if(val2==NULL)
   close(fd);
   
   if (iconv_close (cd) != 0)
-    if(log) log(ld, FILTER_LOGLEVEL_DEBUG, "cfFilterTextToText: Error closing iconv encoding conversion session");
+    if(log) log(ld, CF_LOGLEVEL_DEBUG, "cfFilterTextToText: Error closing iconv encoding conversion session");
 
   /* Error out on an illegal UTF-8 sequence in the input file */
   if (result < 0)
@@ -952,7 +952,7 @@ if(val2==NULL)
           (reverse_order ? (page >= 1) : (page <= num_pages));
           page += (reverse_order ? -1 : 1)) {
        p = (char *)cupsArrayIndex(page_array, page - 1);
-       if(log) log(ld, FILTER_LOGLEVEL_INFO, "cfFilterTextToText: %d %d", page, (collate ? 1 : num_copies));
+       if(log) log(ld, CF_LOGLEVEL_INFO, "cfFilterTextToText: %d %d", page, (collate ? 1 : num_copies));
       }
     /* Clean up */
     for (page = 0; page < num_pages; page ++) {
index e82559f7af199837e1071446afeac982edaa64d4..d9129067b9819957381e2edccc75c5db08f56892 100644 (file)
@@ -33,7 +33,7 @@ cfFilterUniversal(int inputfd,         /* I - File descriptor input stream */
   cf_filter_universal_parameter_t universal_parameters;
   ppd_file_t *ppd;
   ppd_cache_t *cache;
-  filter_logfunc_t log = data->logfunc;
+  cf_logfunc_t log = data->logfunc;
   void *ld = data->logdata;
   int ret = 0;
 
@@ -41,14 +41,14 @@ cfFilterUniversal(int inputfd,         /* I - File descriptor input stream */
   input = universal_parameters.input_format;
   if (input == NULL)
   {
-    if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+    if (log) log(ld, CF_LOGLEVEL_ERROR,
                 "cfFilterUniversal: No input data format supplied.");
     return (1);
   }
   final_output = universal_parameters.output_format;
   if (final_output == NULL)
   {
-    if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+    if (log) log(ld, CF_LOGLEVEL_ERROR,
                 "cfFilterUniversal: No output data format supplied.");
     return (1);
   }
@@ -90,7 +90,7 @@ cfFilterUniversal(int inputfd,         /* I - File descriptor input stream */
     int lowest_cost = INT_MAX;
     char *filter;
 
-    if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "cfFilterUniversal: \"*cupsFilter(2): ...\" lines in the PPD file:");
 
     for (filter = (char *)cupsArrayFirst(cache->filters);
@@ -104,7 +104,7 @@ cfFilterUniversal(int inputfd,         /* I - File descriptor input stream */
           *coststr = NULL;
       int cost;
 
-      if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+      if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "cfFilterUniversal:    %s", filter);
 
       /* String of the "*cupsfilter:" or "*cupsfilter2:" line */
@@ -150,7 +150,7 @@ cfFilterUniversal(int inputfd,         /* I - File descriptor input stream */
           strcasecmp(in, "application/PCLm") == 0 ||
           strcasecmp(in, "application/postscript") == 0))
       {
-       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+       if (log) log(ld, CF_LOGLEVEL_DEBUG,
                     "cfFilterUniversal:       --> Selecting this line");
        /* Take the input format of the line as output format for us */
        strncpy(output, in, sizeof(output));
@@ -159,7 +159,7 @@ cfFilterUniversal(int inputfd,         /* I - File descriptor input stream */
        /* We cannot find a "better" solution ... */
        if (lowest_cost == 0)
        {
-         if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+         if (log) log(ld, CF_LOGLEVEL_DEBUG,
                       "cfFilterUniversal:    Cost value is down to zero, stopping reading further lines");
          break;
        }
@@ -170,11 +170,11 @@ cfFilterUniversal(int inputfd,         /* I - File descriptor input stream */
     error:
       if (lowest_cost == INT_MAX && coststr)
       {
-       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+       if (log) log(ld, CF_LOGLEVEL_DEBUG,
                     "cfFilterUniversal: PPD uses \"*cupsFilter: ...\" lines, so we always convert to format given by FINAL_CONTENT_TYPE");
        break;
       }
-      if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "cfFilterUniversal: Invalid \"*cupsFilter2: ...\" line in PPD: %s",
                   filter);
     }
@@ -183,13 +183,13 @@ cfFilterUniversal(int inputfd,         /* I - File descriptor input stream */
 
   if (strcasecmp(output, final_output) != 0)
   {
-    if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "cfFilterUniversal: Converting from %s to %s, final output will be %s",
                 input, output, final_output);
   }
   else
   {
-    if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "cfFilterUniversal: Converting from %s to %s", input, output);
   }
 
@@ -226,7 +226,7 @@ cfFilterUniversal(int inputfd,         /* I - File descriptor input stream */
       filter->parameters = outformat;
       filter->name = "imagetoraster";
       cupsArrayAdd(filter_chain, filter);
-      if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+      if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "cfFilterUniversal: Adding %s to chain", filter->name);
 
       if (!strcmp(output, "image/pwg-raster"))
@@ -238,7 +238,7 @@ cfFilterUniversal(int inputfd,         /* I - File descriptor input stream */
        filter->parameters = outformat;
        filter->name = "rastertopwg";
        cupsArrayAdd(filter_chain, filter);
-       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+       if (log) log(ld, CF_LOGLEVEL_DEBUG,
                     "cfFilterUniversal: Adding %s to chain", filter->name);
       }
       else if (!strcmp(output, "application/PCLm"))
@@ -250,7 +250,7 @@ cfFilterUniversal(int inputfd,         /* I - File descriptor input stream */
        filter->parameters = outformat;
        filter->name = "rastertopclm";
        cupsArrayAdd(filter_chain, filter);
-       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+       if (log) log(ld, CF_LOGLEVEL_DEBUG,
                     "cfFilterUniversal: Adding %s to chain", filter->name);
       }
       else if (!strcmp(output, "image/urf"))
@@ -262,7 +262,7 @@ cfFilterUniversal(int inputfd,         /* I - File descriptor input stream */
        filter->parameters = outformat;
        filter->name = "rastertopwg";
        cupsArrayAdd(filter_chain, filter);
-       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+       if (log) log(ld, CF_LOGLEVEL_DEBUG,
                     "cfFilterUniversal: Adding %s to chain", filter->name);
       }
     }
@@ -273,7 +273,7 @@ cfFilterUniversal(int inputfd,         /* I - File descriptor input stream */
       filter->parameters = NULL;
       filter->name = "imagetopdf";
       cupsArrayAdd(filter_chain, filter);
-      if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+      if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "cfFilterUniversal: Adding %s to chain", filter->name);
     }
   }
@@ -288,7 +288,7 @@ cfFilterUniversal(int inputfd,         /* I - File descriptor input stream */
       filter->parameters = outformat;
       filter->name = "ghostscript";
       cupsArrayAdd(filter_chain, filter);
-      if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+      if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "cfFilterUniversal: Adding %s to chain", filter->name);
     }
     else if (!strcmp(input_super, "text") ||
@@ -302,7 +302,7 @@ cfFilterUniversal(int inputfd,         /* I - File descriptor input stream */
       filter->parameters = parameters;
       filter->name = "texttopdf";
       cupsArrayAdd(filter_chain, filter);
-      if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+      if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "cfFilterUniversal: Adding %s to chain",
                   filter->name);
     }
@@ -317,7 +317,7 @@ cfFilterUniversal(int inputfd,         /* I - File descriptor input stream */
       filter->parameters = outformat;
       filter->name = "rastertopdf";
       cupsArrayAdd(filter_chain, filter);
-      if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+      if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "cfFilterUniversal: Adding %s to chain", filter->name);
     }
     else if (!strcmp(input_type, "vnd.adobe-reader-postscript"))
@@ -337,7 +337,7 @@ cfFilterUniversal(int inputfd,         /* I - File descriptor input stream */
       filter->parameters = outformat;
       filter->name = "ghostscript";
       cupsArrayAdd(filter_chain, filter);
-      if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+      if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "cfFilterUniversal: Adding %s to chain", filter->name);
 
       if (!strcmp(output, "image/urf"))
@@ -349,7 +349,7 @@ cfFilterUniversal(int inputfd,         /* I - File descriptor input stream */
        filter->parameters = outformat;
        filter->name = "rastertopwg";
        cupsArrayAdd(filter_chain, filter);
-       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+       if (log) log(ld, CF_LOGLEVEL_DEBUG,
                     "cfFilterUniversal: Adding %s to chain",
                     filter->name);
       }
@@ -364,7 +364,7 @@ cfFilterUniversal(int inputfd,         /* I - File descriptor input stream */
        filter->parameters = outformat;
        filter->name = "rastertopdf";
        cupsArrayAdd(filter_chain, filter);
-       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+       if (log) log(ld, CF_LOGLEVEL_DEBUG,
                     "cfFilterUniversal: Adding %s to chain", filter->name);
       }
     }
@@ -375,7 +375,7 @@ cfFilterUniversal(int inputfd,         /* I - File descriptor input stream */
       filter->parameters = NULL;
       filter->name = "bannertopdf";
       cupsArrayAdd(filter_chain, filter);
-      if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+      if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "cfFilterUniversal: Adding %s to chain", filter->name);
     }
     else if (!strstr(input_type, "pdf"))
@@ -401,7 +401,7 @@ cfFilterUniversal(int inputfd,         /* I - File descriptor input stream */
        filter->parameters = strdup(output);
        filter->name = "pdftopdf";
        cupsArrayAdd(filter_chain, filter);
-       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+       if (log) log(ld, CF_LOGLEVEL_DEBUG,
                     "cfFilterUniversal: Adding %s to chain", filter->name);
       }
 
@@ -427,7 +427,7 @@ cfFilterUniversal(int inputfd,         /* I - File descriptor input stream */
          filter->parameters = outformat;
          filter->name = "ghostscript";
          cupsArrayAdd(filter_chain, filter);
-         if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+         if (log) log(ld, CF_LOGLEVEL_DEBUG,
                       "cfFilterUniversal: Adding %s to chain",
                       filter->name);
 
@@ -440,7 +440,7 @@ cfFilterUniversal(int inputfd,         /* I - File descriptor input stream */
            filter->parameters = outformat;
            filter->name = "rastertopwg";
            cupsArrayAdd(filter_chain, filter);
-           if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+           if (log) log(ld, CF_LOGLEVEL_DEBUG,
                         "cfFilterUniversal: Adding %s to chain",
                         filter->name);
          }
@@ -452,7 +452,7 @@ cfFilterUniversal(int inputfd,         /* I - File descriptor input stream */
          filter->function = cfFilterPDFToPS;
          filter->parameters = NULL;
          filter->name = "pdftops";
-         if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+         if (log) log(ld, CF_LOGLEVEL_DEBUG,
                       "cfFilterUniversal: Adding %s to chain", filter->name);
          cupsArrayAdd(filter_chain, filter);
        }
@@ -469,7 +469,7 @@ cfFilterUniversal(int inputfd,         /* I - File descriptor input stream */
  out:
 
   if (ret) {
-    if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+    if (log) log(ld, CF_LOGLEVEL_ERROR,
                 "cfFilterUniversal: Unsupported combination of input and output formats: %s -> %s",
                 input, output);
   }
index 2a6c18984cb88a9eb765d5e4dae46add68f80d95..8c851afece8b310121a368c407674df506550a29 100644 (file)
@@ -83,7 +83,7 @@ cf_lut_t      *DitherLuts[7];         /* Lookup tables for dithering */
 cf_dither_t    *DitherStates[7];       /* Dither state tables */
 int            OutputFeed;             /* Number of lines to skip */
 int            Canceled;               /* Is the job canceled? */
-filter_logfunc_t logfunc;               /* Log function */
+cf_logfunc_t logfunc;               /* Log function */
 void            *ld;                    /* Log function data */
 
 
index bb70e4a8f6b668edfb27edf254a5abe4044707a9..8ba022854d928f236412df2b6b343b6bee8a9855 100644 (file)
@@ -80,7 +80,7 @@ const int     ColorOrders[7][7] =     /* Order of color planes */
                  { 5, 0, 1, 2, 3, 4, 6 }       /* KCMYcmk */
                };
 int            Canceled;               /* Is the job canceled? */
-filter_logfunc_t logfunc;               /* Log function */
+cf_logfunc_t logfunc;               /* Log function */
 void            *ld;                    /* Log function data */
 
 
index 19a226625be55f6627318ce6ae29fe5d555f8f94..4c672d923c40b57dfb6f79f08af826774ccbcfb1 100644 (file)
@@ -67,7 +67,7 @@ typedef void (*_ppd_fc_func_t)(void *context, _ppd_fc_result_t result,
 extern _ppd_fc_result_t        _ppdFileCheck(const char *filename,
                                      _ppd_fc_filetype_t filetype,
                                      int dorootchecks,
-                                     filter_logfunc_t log,
+                                     cf_logfunc_t log,
                                      void *ld);
 
 #  ifdef __cplusplus
index d50130507d7026b06c709139afb019fc7cf548d2..b050e3590430d8a5d6833828b35b40cb37d36150 100644 (file)
@@ -34,7 +34,7 @@ _ppdFileCheck(
     const char          *filename,     /* I - Filename to check */
     _ppd_fc_filetype_t  filetype,      /* I - Type of file checks? */
     int                 dorootchecks,  /* I - Check for root permissions? */
-    filter_logfunc_t    log,           /* I - Log function */
+    cf_logfunc_t    log,               /* I - Log function */
     void                *ld)           /* I - Data pointer for log function */
 {
   struct stat          fileinfo;       /* File information */
@@ -175,12 +175,12 @@ _ppdFileCheck(
   {
     cups_lang_t *lang = cupsLangDefault();
                                        /* Localization information */
-    filter_loglevel_t loglevel;
+    cf_loglevel_t loglevel;
 
     switch (result)
     {
       case _PPD_FILE_CHECK_OK :
-         loglevel = FILTER_LOGLEVEL_DEBUG;
+         loglevel = CF_LOGLEVEL_DEBUG;
          if (filetype == _PPD_FILE_CHECK_DIRECTORY)
            snprintf(message, sizeof(message),
                     _ppdLangString(lang, _("Directory \"%s\" permissions OK "
@@ -196,7 +196,7 @@ _ppdFileCheck(
           break;
 
       case _PPD_FILE_CHECK_MISSING :
-         loglevel = FILTER_LOGLEVEL_ERROR;
+         loglevel = CF_LOGLEVEL_ERROR;
          if (filetype == _PPD_FILE_CHECK_DIRECTORY)
            snprintf(message, sizeof(message),
                     _ppdLangString(lang, _("Directory \"%s\" not available: "
@@ -209,7 +209,7 @@ _ppdFileCheck(
           break;
 
       case _PPD_FILE_CHECK_PERMISSIONS :
-         loglevel = FILTER_LOGLEVEL_ERROR;
+         loglevel = CF_LOGLEVEL_ERROR;
          if (filetype == _PPD_FILE_CHECK_DIRECTORY)
            snprintf(message, sizeof(message),
                     _ppdLangString(lang, _("Directory \"%s\" has insecure "
@@ -227,7 +227,7 @@ _ppdFileCheck(
           break;
 
       case _PPD_FILE_CHECK_WRONG_TYPE :
-         loglevel = FILTER_LOGLEVEL_ERROR;
+         loglevel = CF_LOGLEVEL_ERROR;
          if (filetype == _PPD_FILE_CHECK_DIRECTORY)
            snprintf(message, sizeof(message),
                     _ppdLangString(lang, _("Directory \"%s\" is a file.")),
@@ -239,7 +239,7 @@ _ppdFileCheck(
           break;
 
       case _PPD_FILE_CHECK_RELATIVE_PATH :
-         loglevel = FILTER_LOGLEVEL_ERROR;
+         loglevel = CF_LOGLEVEL_ERROR;
          if (filetype == _PPD_FILE_CHECK_DIRECTORY)
            snprintf(message, sizeof(message),
                     _ppdLangString(lang, _("Directory \"%s\" contains a "
index 8cc4d99c91e784c880530bbf803abb66a59dcbc4..966c604db98631644f6a3c0f95d60531781e9887 100644 (file)
@@ -119,13 +119,13 @@ static ppd_info_t *add_ppd(const char *filename, const char *name,
                                 const char *psversion, time_t mtime,
                                 size_t size, int model_number, int type,
                                 const char *scheme, ppd_list_t *ppdlist,
-                                filter_logfunc_t log, void *ld);
+                                cf_logfunc_t log, void *ld);
 static cups_file_t     *cat_drv(const char *name, char *ppdname,
-                                filter_logfunc_t log, void *ld);
+                                cf_logfunc_t log, void *ld);
 static cups_file_t     *cat_static(const char *name,
-                                   filter_logfunc_t log, void *ld);
+                                   cf_logfunc_t log, void *ld);
 static cups_file_t     *cat_tar(const char *name, char *ppdname,
-                                filter_logfunc_t log, void *ld);
+                                cf_logfunc_t log, void *ld);
 static int             compare_inodes(struct stat *a, struct stat *b);
 static int             compare_matches(const ppd_info_t *p0,
                                        const ppd_info_t *p1);
@@ -138,41 +138,41 @@ static void               free_ppdlist(ppd_list_t *ppdlist);
 static int             load_driver(const char *filename,
                                    const char *name,
                                    ppd_list_t *ppdlist,
-                                   filter_logfunc_t log, void *ld);
+                                   cf_logfunc_t log, void *ld);
 static int             load_drv(const char *filename, const char *name,
                                 cups_file_t *fp, time_t mtime, off_t size,
                                 ppd_list_t *ppdlist,
-                                filter_logfunc_t log, void *ld);
+                                cf_logfunc_t log, void *ld);
 static void            load_ppd(const char *filename, const char *name,
                                 const char *scheme, struct stat *fileinfo,
                                 ppd_info_t *ppd, cups_file_t *fp, off_t end,
                                 ppd_list_t *ppdlist,
-                                filter_logfunc_t log, void *ld);
+                                cf_logfunc_t log, void *ld);
 static int             load_ppds(const char *d, const char *p, int descend,
                                  ppd_list_t *ppdlist,
-                                 filter_logfunc_t log, void *ld);
+                                 cf_logfunc_t log, void *ld);
 static int             load_ppds_dat(const char *filename, int verbose,
                                      ppd_list_t *ppdlist,
-                                     filter_logfunc_t log, void *ld);
+                                     cf_logfunc_t log, void *ld);
 static int             load_tar(const char *filename, const char *name,
                                 cups_file_t *fp, time_t mtime, off_t size,
                                 ppd_list_t *ppdlist,
-                                filter_logfunc_t log, void *ld);
+                                cf_logfunc_t log, void *ld);
 static int             read_tar(cups_file_t *fp, char *name, size_t namesize,
                                 struct stat *info,
-                                filter_logfunc_t log, void *ld);
+                                cf_logfunc_t log, void *ld);
 static regex_t         *regex_device_id(const char *device_id,
-                                        filter_logfunc_t log, void *ld);
+                                        cf_logfunc_t log, void *ld);
 static regex_t         *regex_string(const char *s,
-                                     filter_logfunc_t log, void *ld);
+                                     cf_logfunc_t log, void *ld);
 static int             CompareNames(const char *s, const char *t);
 static cups_array_t    *CreateStringsArray(const char *s);
 static int             ExecCommand(const char *command, char **argv);
 static cups_file_t     *PipeCommand(int *cpid, int *epid, const char *command,
                                     char **argv, uid_t user,
-                                    filter_logfunc_t log, void *ld);
+                                    cf_logfunc_t log, void *ld);
 static int             ClosePipeCommand(cups_file_t *fp, int cpid, int epid,
-                                        filter_logfunc_t log, void *ld);
+                                        cf_logfunc_t log, void *ld);
 
 
 /*
@@ -186,7 +186,7 @@ ppdCollectionListPPDs(
        int           limit,            /* I - Limit */
        int           num_options,      /* I - Number of options */
        cups_option_t *options,         /* I - Options */
-       filter_logfunc_t log,           /* I - Log function */
+       cf_logfunc_t log,               /* I - Log function */
        void *ld)                       /* I - Aux. data for log function */
 {
   int          i;                      /* Looping var */
@@ -282,7 +282,7 @@ ppdCollectionListPPDs(
     * Write the new ppds.dat file...
     */
 
-    if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "libppd: [PPD Collections] ChangedPPD=%d",
                 ppdlist.ChangedPPD);
 
@@ -307,22 +307,22 @@ ppdCollectionListPPDs(
 
        if (rename(newname, cachename))
        {
-         if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+         if (log) log(ld, CF_LOGLEVEL_ERROR,
                       "libppd: [PPD Collections] Unable to rename \"%s\" - %s",
                       newname, strerror(errno));
        }
        else
-         if (log) log(ld, FILTER_LOGLEVEL_INFO,
+         if (log) log(ld, CF_LOGLEVEL_INFO,
                       "libppd: [PPD Collections] Wrote \"%s\", %d PPDs...",
                       cachename, cupsArrayCount(ppdlist.PPDsByName));
       }
       else
-       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+       if (log) log(ld, CF_LOGLEVEL_ERROR,
                     "libppd: [PPD Collections] Unable to write \"%s\" - %s",
                     cachename, strerror(errno));
     }
     else
-      if (log) log(ld, FILTER_LOGLEVEL_INFO,
+      if (log) log(ld, CF_LOGLEVEL_INFO,
                   "libppd: [PPD Collections] No new or changed PPDs...");
   }
 
@@ -374,7 +374,7 @@ ppdCollectionListPPDs(
 
     if (type >= (int)(sizeof(PPDTypes) / sizeof(PPDTypes[0])))
     {
-      if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "libppd: [PPD Collections] Bad ppd-type=\"%s\" ignored!",
                   type_str);
       type_str = NULL;
@@ -384,7 +384,7 @@ ppdCollectionListPPDs(
     type = 0;
 
   for (i = 0; i < num_options; i ++)
-    if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "libppd: [PPD Collections] %s=\"%s\"", options[i].name,
                 options[i].value);
 
@@ -517,7 +517,7 @@ ppdCollectionListPPDs(
 
       if (ppd->matches)
       {
-       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+       if (log) log(ld, CF_LOGLEVEL_DEBUG,
                     "libppd: [PPD Collections] %s matches with score %d!",
                     ppd->record.name, ppd->matches);
         cupsArrayAdd(matches, ppd);
@@ -573,7 +573,7 @@ ppdCollectionListPPDs(
     * Output this PPD...
     */
 
-    if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "libppd: [PPD Collections] Sending %s (%s)...",
                 ppd->record.name, ppd->record.make_and_model);
 
@@ -626,7 +626,7 @@ ppdCollectionGetPPD(
        const char *name,               /* I - PPD URI of the desired PPD */
        cups_array_t *ppd_collections,  /* I - Directories to search for PPDs
                                               in */
-       filter_logfunc_t log,           /* I - Log function */
+       cf_logfunc_t log,               /* I - Log function */
        void *ld)                       /* I - Aux. data for log function */
 {
   ppd_collection_t *col;               /* Pointer to PPD collection */
@@ -651,7 +651,7 @@ ppdCollectionGetPPD(
 
   if (strstr(name, "../"))
   {
-    if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+    if (log) log(ld, CF_LOGLEVEL_ERROR,
                 "libppd: [PPD Collections] Invalid PPD name.");
     return(NULL);
   }
@@ -696,7 +696,7 @@ ppdCollectionGetPPD(
     }
     if (col == NULL)
     {
-      if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "libppd: [PPD Collections] Requested PPD %s is in none of "
                   "the collections",
                   name);      
@@ -717,7 +717,7 @@ ppdCollectionGetPPD(
     }
     if (access(realname, R_OK))
     {
-      if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "libppd: [PPD Collections] Cannot access file %s - %s",
                   realname, strerror(errno));      
       return(NULL);
@@ -750,7 +750,7 @@ ppdCollectionGetPPD(
       * File does not exist or is not executable...
       */
 
-      if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "libppd: [PPD Collections] Unable to access \"%s\" - %s",
                   realname, strerror(errno));
 
@@ -760,7 +760,7 @@ ppdCollectionGetPPD(
    /*
     * Yes, let it cat the PPD file...
     */
-    if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "libppd: [PPD Collections] Grabbing PPD via command: \"%s cat %s\"",
                 realname, ptr);
 
@@ -773,7 +773,7 @@ ppdCollectionGetPPD(
     {
       if ((fd = cupsTempFd(tempname, sizeof(tempname))) < 0)
       {
-       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+       if (log) log(ld, CF_LOGLEVEL_ERROR,
                     "libppd: [PPD Collections] Unable to copy PPD to temp "
                     "file: %s",
                     strerror(errno));
@@ -788,7 +788,7 @@ ppdCollectionGetPPD(
     }
     else
     {
-      if (log) log(ld, FILTER_LOGLEVEL_WARN,
+      if (log) log(ld, CF_LOGLEVEL_WARN,
                   "libppd: [PPD Collections] Unable to execute \"%s\": %s",
                   tempname, strerror(errno));
       return(NULL);
@@ -809,7 +809,7 @@ ppdCollectionGetPPD(
 
 int
 ppdCollectionDumpCache(const char *filename,   /* I - Filename */
-                      filter_logfunc_t log,    /* I - Log function */
+                      cf_logfunc_t log,        /* I - Log function */
                       void *ld)                /* I - Aux. data for log
                                                       function */
 {
@@ -876,7 +876,7 @@ add_ppd(const char *filename,               /* I - PPD filename */
        int        type,                /* I - Driver type */
        const char *scheme,             /* I - PPD scheme */
        ppd_list_t *ppdlist,
-       filter_logfunc_t log,           /* I - Log function */
+       cf_logfunc_t log,               /* I - Log function */
        void *ld)                       /* I - Aux. data for log function */
 {
   ppd_info_t   *ppd;                   /* PPD */
@@ -888,7 +888,7 @@ add_ppd(const char *filename,               /* I - PPD filename */
 
   if ((ppd = (ppd_info_t *)calloc(1, sizeof(ppd_info_t))) == NULL)
   {
-    if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+    if (log) log(ld, CF_LOGLEVEL_ERROR,
                 "libppd: [PPD Collections] Ran out of memory for %d PPD "
                 "files!",
                 cupsArrayCount(ppdlist->PPDsByName));
@@ -940,7 +940,7 @@ add_ppd(const char *filename,               /* I - PPD filename */
 static cups_file_t *                   /* O - Pointer to PPD file */
 cat_drv(const char *filename,          /* I - *.drv file name */
        char *ppdname,                  /* I - PPD name in the *.drv file */
-       filter_logfunc_t log,           /* I - Log function */
+       cf_logfunc_t log,               /* I - Log function */
        void *ld)                       /* I - Aux. data for log function */
 {
   cups_file_t  *fp;                    // File pointer
@@ -953,7 +953,7 @@ cat_drv(const char *filename,               /* I - *.drv file name */
 
   if ((fp = cupsFileOpen(filename, "r")) == NULL)
   {
-    if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+    if (log) log(ld, CF_LOGLEVEL_ERROR,
                 "libppd: [PPD Collections] Unable to open \"%s\" - %s\n",
                 filename, strerror(errno));
 
@@ -984,14 +984,14 @@ cat_drv(const char *filename,             /* I - *.drv file name */
 
     if ((fd = cupsTempFd(tempname, sizeof(tempname))) < 0)
     {
-      if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "libppd: [PPD Collections] Unable to copy PPD to temp "
                   "file: %s",
                   strerror(errno));
     }
     else
     {
-      if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+      if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "libppd: [PPD Collections] %u locales defined in \"%s\"...\n",
                   (unsigned)src->po_files->count, filename);
 
@@ -1000,7 +1000,7 @@ cat_drv(const char *filename,             /* I - *.drv file name */
           catalog;
           catalog = (ppdcCatalog *)src->po_files->next())
       {
-       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+       if (log) log(ld, CF_LOGLEVEL_DEBUG,
                     "libppd: [PPD Collections] Adding locale \"%s\"...\n",
                     catalog->locale->value);
        catalog->locale->retain();
@@ -1018,7 +1018,7 @@ cat_drv(const char *filename,             /* I - *.drv file name */
     }
   }
   else
-    if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+    if (log) log(ld, CF_LOGLEVEL_ERROR,
                 "libppd: [PPD Collections] PPD \"%s\" not found.\n", ppdname);
 
   src->release();
@@ -1038,14 +1038,14 @@ cat_drv(const char *filename,           /* I - *.drv file name */
 
 static cups_file_t *                   /* O - Pointer to PPD file */
 cat_static(const char *name,           /* I - PPD name */
-          filter_logfunc_t log,        /* I - Log function */
+          cf_logfunc_t log,    /* I - Log function */
           void *ld)                    /* I - Aux. data for log function */
 {
   cups_file_t  *fp;
 
   if ((fp = cupsFileOpen(name, "r")) == NULL)
   {
-    if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+    if (log) log(ld, CF_LOGLEVEL_ERROR,
                 "libppd: [PPD Collections] Unable to open \"%s\" - %s",
                 name, strerror(errno));
 
@@ -1063,7 +1063,7 @@ cat_static(const char *name,              /* I - PPD name */
 static cups_file_t *                   /* O - Pointer to PPD file */
 cat_tar(const char *filename,          /* I - Archive name */
        char *ppdname,                  /* I - PPD name in the archive */
-       filter_logfunc_t log,           /* I - Log function */
+       cf_logfunc_t log,               /* I - Log function */
        void *ld)                       /* I - Aux. data for log function */
 {
   cups_file_t  *fp;                    /* Archive file pointer */
@@ -1083,7 +1083,7 @@ cat_tar(const char *filename,             /* I - Archive name */
 
   if ((fp = cupsFileOpen(filename, "r")) == NULL)
   {
-    if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+    if (log) log(ld, CF_LOGLEVEL_ERROR,
                 "libppd: [PPD Collections] Unable to open \"%s\" - %s",
                 filename, strerror(errno));
 
@@ -1103,7 +1103,7 @@ cat_tar(const char *filename,             /* I - Archive name */
     {
       if ((fd = cupsTempFd(tempname, sizeof(tempname))) < 0)
       {
-       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+       if (log) log(ld, CF_LOGLEVEL_ERROR,
                     "libppd: [PPD Collections] Unable to copy PPD to temp "
                     "file: %s",
                     strerror(errno));
@@ -1122,7 +1122,7 @@ cat_tar(const char *filename,             /* I - Archive name */
           }
           else
           {
-           if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+           if (log) log(ld, CF_LOGLEVEL_ERROR,
                         "libppd: [PPD Collections] Read error - %s",
                         strerror(errno));
            cupsFileClose(fp);
@@ -1133,7 +1133,7 @@ cat_tar(const char *filename,             /* I - Archive name */
         }
         else if (bytes > 0 && write(fd, buffer, bytes) != bytes)
        {
-         if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+         if (log) log(ld, CF_LOGLEVEL_ERROR,
                       "libppd: [PPD Collections] Write error - %s",
                       strerror(errno));
          cupsFileClose(fp);
@@ -1157,7 +1157,7 @@ cat_tar(const char *filename,             /* I - Archive name */
 
   cupsFileClose(fp);
 
-  if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+  if (log) log(ld, CF_LOGLEVEL_ERROR,
               "libppd: [PPD Collections] PPD \"%s\" not found.", ppdname);
 
   return (NULL);
@@ -1294,7 +1294,7 @@ static int                                /* O - 1 on success, 0 on failure */
 load_driver(const char *filename,      /* I - Driver excutable file name */
            const char *name,           /* I - Name to the rest of the world */
            ppd_list_t *ppdlist,
-           filter_logfunc_t log,       /* I - Log function */
+           cf_logfunc_t log,   /* I - Log function */
            void *ld)                   /* I - Aux. data for log function */
 {
   int          i;                      /* Looping var */
@@ -1356,7 +1356,7 @@ load_driver(const char *filename, /* I - Driver excutable file name */
        if (line[strlen(line) - 1] == '\n')
          line[strlen(line) - 1] = '\0';
 
-       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+       if (log) log(ld, CF_LOGLEVEL_ERROR,
                     "libppd: [PPD Collections] Bad line from \"%s\": %s",
                     filename, line);
        break;
@@ -1378,7 +1378,7 @@ load_driver(const char *filename, /* I - Driver excutable file name */
 
        if (type >= (int)(sizeof(PPDTypes) / sizeof(PPDTypes[0])))
        {
-         if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+         if (log) log(ld, CF_LOGLEVEL_ERROR,
                       "libppd: [PPD Collections] Bad ppd-type \"%s\" ignored!",
                       type_str);
          type = PPD_TYPE_UNKNOWN;
@@ -1428,7 +1428,7 @@ load_driver(const char *filename, /* I - Driver excutable file name */
          }
        }
 
-       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+       if (log) log(ld, CF_LOGLEVEL_DEBUG,
                     "libppd: [PPD Collections] Adding PPD \"%s\"...",
                     ppd_name);
       }
@@ -1437,7 +1437,7 @@ load_driver(const char *filename, /* I - Driver excutable file name */
     ClosePipeCommand(fp, cpid, epid, log, ld);
   }
   else
-    if (log) log(ld, FILTER_LOGLEVEL_WARN,
+    if (log) log(ld, CF_LOGLEVEL_WARN,
                 "libppd: [PPD Collections] Unable to execute \"%s\": %s",
                 filename, strerror(errno));
 
@@ -1456,7 +1456,7 @@ load_drv(const char  *filename,           /* I - Actual filename */
         time_t      mtime,             /* I - Mod time of driver info file */
         off_t       size,              /* I - Size of driver info file */
         ppd_list_t  *ppdlist,
-        filter_logfunc_t log,          /* I - Log function */
+        cf_logfunc_t log,              /* I - Log function */
         void *ld)                      /* I - Aux. data for log function */
 {
   ppdcSource   *src;                   // Driver information file
@@ -1493,7 +1493,7 @@ load_drv(const char  *filename,           /* I - Actual filename */
 
   if (src->drivers->count == 0)
   {
-    if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+    if (log) log(ld, CF_LOGLEVEL_ERROR,
                 "libppd: [PPD Collections] Bad driver information file \"%s\"!\n",
                 filename);
     src->release();
@@ -1612,7 +1612,7 @@ load_ppd(const char  *filename,           /* I - Real filename */
          cups_file_t *fp,              /* I - File to read from */
          off_t       end,              /* I - End of file position or 0 */
         ppd_list_t  *ppdlist,
-        filter_logfunc_t log,          /* I - Log function */
+        cf_logfunc_t log,              /* I - Log function */
         void *ld)                      /* I - Aux. data for log function */
 {
   int          i;                      /* Looping var */
@@ -1819,18 +1819,18 @@ load_ppd(const char  *filename,         /* I - Real filename */
     */
 
     if (!make_model[0])
-      if (log) log(ld, FILTER_LOGLEVEL_WARN,
+      if (log) log(ld, CF_LOGLEVEL_WARN,
                   "libppd: [PPD Collections] Missing NickName and ModelName "
                   "in %s!",
                   filename);
 
     if (cupsArrayCount(products) == 0)
-      if (log) log(ld, FILTER_LOGLEVEL_WARN,
+      if (log) log(ld, CF_LOGLEVEL_WARN,
                   "libppd: [PPD Collections] Missing Product in %s!",
                   filename);
 
     if (cupsArrayCount(psversions) == 0)
-      if (log) log(ld, FILTER_LOGLEVEL_WARN,
+      if (log) log(ld, CF_LOGLEVEL_WARN,
                   "libppd: [PPD Collections] Missing PSVersion in %s!",
                   filename);
 
@@ -1951,7 +1951,7 @@ load_ppd(const char  *filename,           /* I - Real filename */
     * Add new PPD file...
     */
 
-    if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "libppd: [PPD Collections] Adding PPD \"%s\"...", name);
 
     ppd = add_ppd(filename, name, lang_version, manufacturer, make_model,
@@ -1969,7 +1969,7 @@ load_ppd(const char  *filename,           /* I - Real filename */
     * Update existing record...
     */
 
-    if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+    if (log) log(ld, CF_LOGLEVEL_DEBUG,
                 "libppd: [PPD Collections] Updating ppd \"%s\"...", name);
 
     memset(ppd, 0, sizeof(ppd_info_t));
@@ -2038,7 +2038,7 @@ load_ppds(const char *d,          /* I - Actual directory */
           const char *p,               /* I - Virtual path in name */
          int        descend,           /* I - Descend into directories? */
          ppd_list_t *ppdlist,
-         filter_logfunc_t log,         /* I - Log function */
+         cf_logfunc_t log,             /* I - Log function */
          void *ld)                     /* I - Aux. data for log function */
 {
   struct stat  dinfo,                  /* Directory information */
@@ -2061,7 +2061,7 @@ load_ppds(const char *d,          /* I - Actual directory */
   if (stat(d, &dinfo))
   {
     if (errno != ENOENT)
-      if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "libppd: [PPD Collections] Unable to stat \"%s\": %s", d,
                   strerror(errno));
 
@@ -2069,7 +2069,7 @@ load_ppds(const char *d,          /* I - Actual directory */
   }
   else if (cupsArrayFind(ppdlist->Inodes, &dinfo))
   {
-    if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+    if (log) log(ld, CF_LOGLEVEL_ERROR,
                 "libppd: [PPD Collections] Skipping \"%s\": loop detected!",
                 d);
     return (1);
@@ -2093,7 +2093,7 @@ load_ppds(const char *d,          /* I - Actual directory */
   if ((dir = cupsDirOpen(d)) == NULL)
   {
     if (errno != ENOENT)
-      if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+      if (log) log(ld, CF_LOGLEVEL_ERROR,
                   "libppd: [PPD Collections] Unable to open PPD directory "
                   "\"%s\": %s\n",
                   d, strerror(errno));
@@ -2101,7 +2101,7 @@ load_ppds(const char *d,          /* I - Actual directory */
     return (0);
   }
 
-  if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+  if (log) log(ld, CF_LOGLEVEL_DEBUG,
               "libppd: [PPD Collections] Loading \"%s\"...", d);
 
   while ((dent = cupsDirRead(dir)) != NULL)
@@ -2258,7 +2258,7 @@ static int
 load_ppds_dat(const char *filename,    /* I - Filename */
               int        verbose,      /* I - Be verbose? */
              ppd_list_t *ppdlist,
-             filter_logfunc_t log,     /* I - Log function */
+             cf_logfunc_t log, /* I - Log function */
              void *ld)                 /* I - Aux. data for log function */
 {
   ppd_info_t   *ppd;                   /* Current PPD file */
@@ -2296,7 +2296,7 @@ load_ppds_dat(const char *filename,       /* I - Filename */
        if ((ppd = (ppd_info_t *)calloc(1, sizeof(ppd_info_t))) == NULL)
        {
          if (verbose)
-           if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+           if (log) log(ld, CF_LOGLEVEL_ERROR,
                         "libppd: [PPD Collections] Unable to allocate memory "
                         "for PPD!");
          return(1);
@@ -2315,7 +2315,7 @@ load_ppds_dat(const char *filename,       /* I - Filename */
       }
 
       if (verbose)
-       if (log) log(ld, FILTER_LOGLEVEL_INFO,
+       if (log) log(ld, CF_LOGLEVEL_INFO,
                     "libppd: [PPD Collections] Read \"%s\", %d PPDs...",
                     filename, cupsArrayCount(ppdlist->PPDsByName));
     }
@@ -2338,7 +2338,7 @@ load_tar(const char  *filename,           /* I - Actual filename */
         time_t      mtime,             /* I - Mod time of driver info file */
         off_t       size,              /* I - Size of driver info file */
         ppd_list_t  *ppdlist,
-        filter_logfunc_t log,          /* I - Log function */
+        cf_logfunc_t log,              /* I - Log function */
         void *ld)                      /* I - Aux. data for log function */
 {
   char         curname[256],           /* Current archive file name */
@@ -2392,7 +2392,7 @@ read_tar(cups_file_t *fp,         /* I - Archive to read */
          char        *name,            /* I - Filename buffer */
          size_t      namesize,         /* I - Size of filename buffer */
          struct stat *info,            /* O - File information */
-        filter_logfunc_t log,          /* I - Log function */
+        cf_logfunc_t log,              /* I - Log function */
         void *ld)                      /* I - Aux. data for log function */
 {
   tar_rec_t    record;                 /* Record from file */
@@ -2411,7 +2411,7 @@ read_tar(cups_file_t *fp,         /* I - Archive to read */
     {
       if (record.header.magic[0] ||
           memcmp(record.header.magic, record.header.magic + 1, 5))
-       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+       if (log) log(ld, CF_LOGLEVEL_ERROR,
                     "libppd: [PPD Collections] Bad tar magic/version.");
       break;
     }
@@ -2451,7 +2451,7 @@ read_tar(cups_file_t *fp,         /* I - Archive to read */
 
 static regex_t *                       /* O - Regular expression */
 regex_device_id(const char *device_id, /* I - IEEE-1284 device ID */
-               filter_logfunc_t log,   /* I - Log function */
+               cf_logfunc_t log,       /* I - Log function */
                void *ld)               /* I - Aux. data for log function */
 {
   char         res[2048],              /* Regular expression string */
@@ -2460,7 +2460,7 @@ regex_device_id(const char *device_id,    /* I - IEEE-1284 device ID */
   int          cmd;                    /* Command set string? */
 
 
-  if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+  if (log) log(ld, CF_LOGLEVEL_DEBUG,
               "libppd: [PPD Collections] regex_device_id(\"%s\")",
               device_id);
 
@@ -2532,7 +2532,7 @@ regex_device_id(const char *device_id,    /* I - IEEE-1284 device ID */
 
   *ptr = '\0';
 
-  if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+  if (log) log(ld, CF_LOGLEVEL_DEBUG,
               "libppd: [PPD Collections] regex_device_id: \"%s\"", res);
 
  /*
@@ -2543,7 +2543,7 @@ regex_device_id(const char *device_id,    /* I - IEEE-1284 device ID */
   {
     if (!regcomp(re, res, REG_EXTENDED | REG_ICASE))
     {
-      if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+      if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "libppd: [PPD Collections] regex_device_id: OK");
       return (re);
     }
@@ -2561,7 +2561,7 @@ regex_device_id(const char *device_id,    /* I - IEEE-1284 device ID */
 
 static regex_t *                       /* O - Regular expression */
 regex_string(const char *s,            /* I - String to compare */
-            filter_logfunc_t log,      /* I - Log function */
+            cf_logfunc_t log,  /* I - Log function */
             void *ld)                  /* I - Aux. data for log function */
 {
   char         res[2048],              /* Regular expression string */
@@ -2569,7 +2569,7 @@ regex_string(const char *s,               /* I - String to compare */
   regex_t      *re;                    /* Regular expression */
 
 
-  if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+  if (log) log(ld, CF_LOGLEVEL_DEBUG,
               "libppd: [PPD Collections] regex_string(\"%s\")", s);
 
  /*
@@ -2589,7 +2589,7 @@ regex_string(const char *s,               /* I - String to compare */
 
   *ptr = '\0';
 
-  if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+  if (log) log(ld, CF_LOGLEVEL_DEBUG,
               "libppd: [PPD Collections] regex_string: \"%s\"", res);
 
  /*
@@ -2600,7 +2600,7 @@ regex_string(const char *s,               /* I - String to compare */
   {
     if (!regcomp(re, res, REG_ICASE))
     {
-      if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+      if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "libppd: [PPD Collections] regex_string: OK");
       return (re);
     }
@@ -2826,7 +2826,7 @@ PipeCommand(int        *cpid,             /* O - Process ID or 0 on error */
            const char *command,        /* I - Command to run */
            char       **argv,          /* I - Arguments to pass to command */
            uid_t      user,            /* I - User to run as or 0 for current*/
-           filter_logfunc_t log,
+           cf_logfunc_t log,
            void       *ld)
 {
   int        fd,                       /* Temporary file descriptor */
@@ -2834,7 +2834,7 @@ PipeCommand(int        *cpid,             /* O - Process ID or 0 on error */
              efds[2];                  /* Error/Log Pipe file descriptors */
   cups_file_t *outfp, *logfp;
   char        buf[BUFSIZ];
-  filter_loglevel_t log_level;
+  cf_loglevel_t log_level;
   char        *msg;
 
 
@@ -2847,7 +2847,7 @@ PipeCommand(int        *cpid,             /* O - Process ID or 0 on error */
 
   if (pipe(cfds))
   {
-    if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+    if (log) log(ld, CF_LOGLEVEL_ERROR,
                 "libppd: [PPD Collections] Unable to establish output pipe for %s call: %s",
                 argv[0], strerror(errno));
     return (NULL);
@@ -2855,7 +2855,7 @@ PipeCommand(int        *cpid,             /* O - Process ID or 0 on error */
   if (log)
     if (pipe(efds))
     {
-      log(ld, FILTER_LOGLEVEL_ERROR,
+      log(ld, CF_LOGLEVEL_ERROR,
          "libppd: [PPD Collections] Unable to establish error/logging pipe for %s call: %s",
          argv[0], strerror(errno));
       return (NULL);
@@ -2869,7 +2869,7 @@ PipeCommand(int        *cpid,             /* O - Process ID or 0 on error */
   {
     close(cfds[0]);
     close(cfds[1]);
-    if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+    if (log) log(ld, CF_LOGLEVEL_ERROR,
                 "libppd: [PPD Collections] Unable to set \"close on exec\" flag on read end of the output pipe for %s call: %s",
                 argv[0], strerror(errno));
     return (NULL);
@@ -2879,7 +2879,7 @@ PipeCommand(int        *cpid,             /* O - Process ID or 0 on error */
   {
     close(cfds[0]);
     close(cfds[1]);
-    if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+    if (log) log(ld, CF_LOGLEVEL_ERROR,
                 "libppd: [PPD Collections] Unable to set \"close on exec\" flag on write end of the output pipe for %s call: %s",
                 argv[0], strerror(errno));
     return (NULL);
@@ -2893,7 +2893,7 @@ PipeCommand(int        *cpid,             /* O - Process ID or 0 on error */
       close(cfds[1]);
       close(efds[0]);
       close(efds[1]);
-      log(ld, FILTER_LOGLEVEL_ERROR,
+      log(ld, CF_LOGLEVEL_ERROR,
          "libppd: [PPD Collections] Unable to set \"close on exec\" flag on read end of the error/logging pipe for %s call: %s",
          argv[0], strerror(errno));
       return (NULL);
@@ -2905,7 +2905,7 @@ PipeCommand(int        *cpid,             /* O - Process ID or 0 on error */
       close(cfds[1]);
       close(efds[0]);
       close(efds[1]);
-      log(ld, FILTER_LOGLEVEL_ERROR,
+      log(ld, CF_LOGLEVEL_ERROR,
          "libppd: [PPD Collections] Unable to set \"close on exec\" flag on write end of the error/logging pipe for %s call: %s",
          argv[0], strerror(errno));
       return (NULL);
@@ -2931,7 +2931,7 @@ PipeCommand(int        *cpid,             /* O - Process ID or 0 on error */
       close(efds[1]);
     }
 
-    if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+    if (log) log(ld, CF_LOGLEVEL_ERROR,
                 "libppd: [PPD Collections] Unable to fork for %s: %s", argv[0],
                 strerror(errno));
 
@@ -2967,12 +2967,12 @@ PipeCommand(int        *cpid,           /* O - Process ID or 0 on error */
     }
 
     ExecCommand(command, argv);
-    if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+    if (log) log(ld, CF_LOGLEVEL_ERROR,
                 "libppd: [PPD Collections] Unable to launch %s: %s", argv[0],
                 strerror(errno));
     exit(errno);
   }
-  if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+  if (log) log(ld, CF_LOGLEVEL_DEBUG,
               "libppd: [PPD Collections] Started %s (PID %d)", argv[0], cpid);
 
  /*
@@ -3006,7 +3006,7 @@ PipeCommand(int        *cpid,             /* O - Process ID or 0 on error */
       kill(*cpid, SIGTERM);
       ClosePipeCommand(outfp, *cpid, 0, log, ld);
 
-      log(ld, FILTER_LOGLEVEL_ERROR,
+      log(ld, CF_LOGLEVEL_ERROR,
          "libppd: [PPD Collections] Unable to fork for logging for %s: %s",
          argv[0], strerror(errno));
 
@@ -3024,22 +3024,22 @@ PipeCommand(int        *cpid,           /* O - Process ID or 0 on error */
       while (cupsFileGets(logfp, buf, sizeof(buf)))
        if (log) {
          if (strncmp(buf, "DEBUG: ", 7) == 0) {
-           log_level = FILTER_LOGLEVEL_DEBUG;
+           log_level = CF_LOGLEVEL_DEBUG;
            msg = buf + 7;
          } else if (strncmp(buf, "DEBUG2: ", 8) == 0) {
-           log_level = FILTER_LOGLEVEL_DEBUG;
+           log_level = CF_LOGLEVEL_DEBUG;
            msg = buf + 8;
          } else if (strncmp(buf, "INFO: ", 6) == 0) {
-           log_level = FILTER_LOGLEVEL_INFO;
+           log_level = CF_LOGLEVEL_INFO;
            msg = buf + 6;
          } else if (strncmp(buf, "WARNING: ", 9) == 0) {
-           log_level = FILTER_LOGLEVEL_WARN;
+           log_level = CF_LOGLEVEL_WARN;
            msg = buf + 9;
          } else if (strncmp(buf, "ERROR: ", 7) == 0) {
-           log_level = FILTER_LOGLEVEL_ERROR;
+           log_level = CF_LOGLEVEL_ERROR;
            msg = buf + 7;
          } else {
-           log_level = FILTER_LOGLEVEL_DEBUG;
+           log_level = CF_LOGLEVEL_DEBUG;
            msg = buf;
          }
          log(ld, log_level, "libppd: [PPD Collections] %s: %s", argv[0], msg);
@@ -3051,7 +3051,7 @@ PipeCommand(int        *cpid,             /* O - Process ID or 0 on error */
       exit(0);
     }
 
-    log(ld, FILTER_LOGLEVEL_DEBUG,
+    log(ld, CF_LOGLEVEL_DEBUG,
        "libppd: [PPD Collections] Started logging for %s (PID %d)",
        argv[0], cpid);
 
@@ -3076,7 +3076,7 @@ static int
 ClosePipeCommand(cups_file_t *fp,
                 int cpid,
                 int epid,
-                filter_logfunc_t log,
+                cf_logfunc_t log,
                 void *ld)
 {
   int           pid;
@@ -3100,7 +3100,7 @@ ClosePipeCommand(cups_file_t *fp,
        continue;
       else
       {
-       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+       if (log) log(ld, CF_LOGLEVEL_ERROR,
                     "libppd: [PPD Collections] Error closing sub-processes: %s - killing processes",
                     strerror(errno));
        kill(cpid, SIGTERM);
@@ -3115,21 +3115,21 @@ ClosePipeCommand(cups_file_t *fp,
     if (wstatus) {
       if (WIFEXITED(wstatus)) {
        /* Via exit() anywhere or return() in the main() function */
-       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+       if (log) log(ld, CF_LOGLEVEL_ERROR,
                     "libppd: [PPD Collections] %s (PID %d) stopped with status %d",
                     (pid == cpid ? "Command" : "Logging"), pid,
                     WEXITSTATUS(wstatus));
        status = WEXITSTATUS(wstatus);
       } else {
        /* Via signal */
-       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
+       if (log) log(ld, CF_LOGLEVEL_ERROR,
                     "libppd: [PPD Collections] %s (PID %d) crashed on signal %d",
                     (pid == cpid ? "Command" : "Logging"), pid,
                     WTERMSIG(wstatus));
        status = 256 * WTERMSIG(wstatus);
       }
     } else {
-      if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
+      if (log) log(ld, CF_LOGLEVEL_DEBUG,
                   "libppd: [PPD Collections] %s (PID %d) exited with no errors.",
                   (pid == cpid ? "Command" : "Logging"), pid);
       status = 0;
index b6912bb0833bc3769bb3904fb16d12714a890cb7..81fc86a5534e82b9dff09602919bb29295dfc65c 100644 (file)
--- a/ppd/ppd.h
+++ b/ppd/ppd.h
@@ -809,14 +809,14 @@ extern cups_array_t       *ppdCollectionListPPDs(cups_array_t *ppd_collections,
                                               int limit,
                                               int num_options,
                                               cups_option_t *options,
-                                              filter_logfunc_t log,
+                                              cf_logfunc_t log,
                                               void *ld);
 extern cups_file_t     *ppdCollectionGetPPD(const char *name,
                                             cups_array_t *ppd_collections,
-                                            filter_logfunc_t log,
+                                            cf_logfunc_t log,
                                             void *ld);
 extern int             ppdCollectionDumpCache(const char *filename,
-                                              filter_logfunc_t log,
+                                              cf_logfunc_t log,
                                               void *ld);
 
 /**** New in cups-filters 2.0.0: For PPD retro-fit Printer Applications ****/
index 21e5f0bba32c4d990a6d1e2c081258f0d6f6de06..6028302bd8e89a65e0421633ca00e1e31ba287a1 100644 (file)
@@ -377,7 +377,7 @@ _ppdRasterColorSpaceString(
 
 void
 _log(void *data,
-     filter_loglevel_t level,
+     cf_loglevel_t level,
      const char *message,
      ...)
 {
@@ -389,10 +389,10 @@ _log(void *data,
   {
     default:
       break;
-    case FILTER_LOGLEVEL_ERROR:
+    case CF_LOGLEVEL_ERROR:
       printf("ERROR: ");
       break;
-    case FILTER_LOGLEVEL_FATAL:
+    case CF_LOGLEVEL_FATAL:
       printf("FATAL: ");
       break;
   }