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

59 files changed:
backend/implicitclass.c
cupsfilters/bannertopdf.c
cupsfilters/colord.c
cupsfilters/colord.h
cupsfilters/colormanager.c
cupsfilters/colormanager.h
cupsfilters/filter.c
cupsfilters/filter.h
cupsfilters/ghostscript.c
cupsfilters/imagetopdf.c
cupsfilters/imagetops.c
cupsfilters/imagetoraster.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/raster.h
cupsfilters/rastertopdf.cpp
cupsfilters/rastertops.c
cupsfilters/rastertopwg.c
cupsfilters/testcmyk.c
cupsfilters/testdither.c
cupsfilters/texttopdf.c
cupsfilters/texttotext.c
cupsfilters/universal.c
filter/bannertopdf.c
filter/foomatic-rip/foomaticrip.c
filter/gstopdf.c
filter/gstopxl.c
filter/gstoraster.c
filter/imagetopdf.c
filter/imagetops.c
filter/imagetoraster.c
filter/mupdftopwg.c
filter/pclmtoraster.c
filter/pdftopdf.c
filter/pdftops.c
filter/pdftoraster.c
filter/pstops.c
filter/pwgtoraster.c
filter/rastertoescpx.c
filter/rastertopclm.c
filter/rastertopclx.c
filter/rastertopdf.c
filter/rastertops.c
filter/rastertopwg.c
filter/texttopdf.c
filter/texttotext.c
filter/universal.c

index 606f6c947b3b7c438ba874ee0fb75b0a787279cc..84b520135db830c0d1f1af7ea6a6268ec16b20a2 100644 (file)
@@ -239,10 +239,10 @@ main(int  argc,                           /* I - Number of command-line args */
       int num_options = 0;
       cups_option_t *options = NULL;
       int fd, nullfd;
-      filter_data_t filter_data;
-      universal_parameter_t universal_parameters;
-      filter_external_cups_t ipp_backend_params;
-      filter_filter_in_chain_t universal_in_chain,
+      cf_filter_data_t filter_data;
+      cf_filter_universal_parameter_t universal_parameters;
+      cf_filter_external_cups_t ipp_backend_params;
+      cf_filter_filter_in_chain_t universal_in_chain,
                               ipp_in_chain;
       cups_array_t *filter_chain;
       int retval;
@@ -290,7 +290,7 @@ main(int  argc,                             /* I - Number of command-line args */
       fprintf(stderr,"DEBUG: Received job for the printer with the destination uri - %s, Final-document format for the printer - %s and requested resolution - %s\n",
              printer_uri, document_format, resolution);
 
-      /* Adjust option list for the universal() filter function call */
+      /* Adjust option list for the cfFilterUniversal() filter function call */
       num_options = cupsAddOption("Resolution", resolution,
                                  num_options, &options);
       num_options = cupsRemoveOption("cups-browsed-dest-printer",
@@ -348,20 +348,20 @@ main(int  argc,                           /* I - Number of command-line args */
       filter_data.back_pipe[1] = -1;
       filter_data.side_pipe[0] = -1;
       filter_data.side_pipe[1] = -1;
-      filter_data.logfunc = cups_logfunc;  /* Logging scheme of CUPS */
+      filter_data.logfunc = cfCUPSLogFunc;  /* Logging scheme of CUPS */
       filter_data.logdata = NULL;
-      filter_data.iscanceledfunc = cups_iscanceledfunc; /* Job-is-canceled
+      filter_data.iscanceledfunc = cfCUPSIsCanceledFunc; /* Job-is-canceled
                                                           function */
       filter_data.iscanceleddata = &job_canceled;
-      filterOpenBackAndSidePipes(&filter_data);
+      cfFilterOpenBackAndSidePipes(&filter_data);
 
-      /* Parameters (input/output MIME types) for universal() call */
+      /* Parameters (input/output MIME types) for cfFilterUniversal() call */
       universal_parameters.input_format = "application/vnd.cups-pdf";
       universal_parameters.output_format = document_format;
       memset(&(universal_parameters.texttopdf_params), 0,
-            sizeof(texttopdf_parameter_t));
+            sizeof(cf_filter_texttopdf_parameter_t));
 
-      /* Parameters for filterExternalCUPS() call for IPP backend */
+      /* Parameters for cfFilterExternalCUPS() call for IPP backend */
       ipp_backend_params.filter = "ipp";
       ipp_backend_params.is_backend = 1;
       ipp_backend_params.device_uri = printer_uri;
@@ -369,13 +369,13 @@ main(int  argc,                           /* I - Number of command-line args */
       ipp_backend_params.options = NULL;
       ipp_backend_params.envp = NULL;
 
-      /* Filter chain entry for the universal() filter function call */
-      universal_in_chain.function = universal;
+      /* Filter chain entry for the cfFilterUniversal() filter function call */
+      universal_in_chain.function = cfFilterUniversal;
       universal_in_chain.parameters = &universal_parameters;
       universal_in_chain.name = "Filters";
 
       /* Filter chain entry for the IPP CUPS backend call */
-      ipp_in_chain.function = filterExternalCUPS;
+      ipp_in_chain.function = cfFilterExternalCUPS;
       ipp_in_chain.parameters = &ipp_backend_params;
       ipp_in_chain.name = "Backend";
 
@@ -401,10 +401,10 @@ main(int  argc,                           /* I - Number of command-line args */
       nullfd = open("/dev/null", O_WRONLY);
 
       /* Call the filter chain to run the needed filters and the backend */
-      retval = filterChain(fd, nullfd, fd != 0 ? 1 : 0, &filter_data,
+      retval = cfFilterChain(fd, nullfd, fd != 0 ? 1 : 0, &filter_data,
                           filter_chain);
 
-      filterCloseBackAndSidePipes(&filter_data);
+      cfFilterCloseBackAndSidePipes(&filter_data);
 
       /* Clean up */
       cupsArrayDelete(filter_chain);
index 1d7be65bf87bc49a64b30daf7c009e156ae1e0b8..633538fe7dcc29c84703c23ca2bc0e0d4736853a 100644 (file)
@@ -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, "bannertopdf: error: unknown value for 'Show': %s\n", tok);
+            log(ld, FILTER_LOGLEVEL_ERROR, "cfFilterBannerToPDF: error: unknown value for 'Show': %s\n", tok);
     }
     return info;
 }
@@ -196,7 +196,7 @@ banner_t *banner_new_from_file(const char *filename, int *num_options,
     {
       if (log)
        log(ld, FILTER_LOGLEVEL_ERROR,
-           "bannertopdf: Error opening temporary file with input stream");
+           "cfFilterBannerToPDF: Error opening temporary file with input stream");
       goto out;
     }
 
@@ -210,7 +210,7 @@ banner_t *banner_new_from_file(const char *filename, int *num_options,
       {
        if (log)
          log(ld, FILTER_LOGLEVEL_ERROR,
-             "bannertopdf: No banner instructions found in input stream");
+             "cfFilterBannerToPDF: No banner instructions found in input stream");
        goto out;
       }
 
@@ -241,7 +241,7 @@ banner_t *banner_new_from_file(const char *filename, int *num_options,
              break;
             if (log)
                 log(ld, FILTER_LOGLEVEL_ERROR,
-                   "bannertopdf: Line %d is missing a value", linenr);
+                   "cfFilterBannerToPDF: Line %d is missing a value", linenr);
             continue;
         }
 
@@ -275,7 +275,7 @@ banner_t *banner_new_from_file(const char *filename, int *num_options,
         {
             if (log)
                 log(ld, FILTER_LOGLEVEL_ERROR,
-                    "bannertopdf: Note: %d: bannertopdf does not support '%s'",
+                    "cfFilterBannerToPDF: Note: %d: bannertopdf does not support '%s'",
                     linenr, key);
         }
         else
@@ -284,7 +284,7 @@ banner_t *banner_new_from_file(const char *filename, int *num_options,
              break;
             if (log)
                 log(ld, FILTER_LOGLEVEL_ERROR,
-                    "bannertopdf: Error: %d: unknown keyword '%s'",
+                    "cfFilterBannerToPDF: Error: %d: unknown keyword '%s'",
                     linenr, key);
         }
     }
@@ -329,7 +329,7 @@ static int get_int_option(const char *name,
     return value ? atoi(value) : def;
 }
 
-static void get_pagesize(filter_data_t *data,
+static void get_pagesize(cf_filter_data_t *data,
                          int noptions,
                          cups_option_t *options,
                          float *width,
@@ -562,7 +562,7 @@ static opt_t *add_opt(opt_t *in_opt, const char *key, const char *val)
  * Create PDF form's field names according above.
  */
 opt_t *get_known_opts(
-    filter_data_t *data,
+    cf_filter_data_t *data,
     const char *jobid,
     const char *user,
     const char *jobtitle,
@@ -717,7 +717,7 @@ opt_t *get_known_opts(
 }
 
 static int generate_banner_pdf(banner_t *banner,
-                               filter_data_t *data,
+                               cf_filter_data_t *data,
                                const char *jobid,
                                const char *user,
                                const char *jobtitle,
@@ -778,7 +778,7 @@ static int generate_banner_pdf(banner_t *banner,
     if ((s = tmpfile()) == NULL)
     {
         if (log)
-            log(ld, FILTER_LOGLEVEL_ERROR, "bannertopdf: Cannot create temp file: %s\n", strerror(errno));
+            log(ld, FILTER_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, "bannertopdf: Cannot fstat(): %s\n", , strerror(errno));
+            log(ld, FILTER_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, "bannertopdf: Cannot malloc(): %s\n", , strerror(errno));
+            log(ld, FILTER_LOGLEVEL_ERROR, "cfFilterBannerToPDF: Cannot malloc(): %s\n", , strerror(errno));
         return 1;
     }
     size_t nbytes = fread(buf, 1, st.st_size, s);
@@ -1002,10 +1002,10 @@ static int generate_banner_pdf(banner_t *banner,
     return 0;
 }
 
-int bannertopdf(int inputfd,         /* I - File descriptor input stream */
+int cfFilterBannerToPDF(int inputfd,         /* I - File descriptor input stream */
                 int outputfd,        /* I - File descriptor output stream */
                 int inputseekable,   /* I - Is input stream seekable? (unused)*/
-                filter_data_t *data, /* I - Job and printer data */
+                cf_filter_data_t *data, /* I - Job and printer data */
                 void *parameters)    /* I - Filter-specific parameters -
                                            Template/Banner data directory */
 {
@@ -1023,7 +1023,7 @@ int bannertopdf(int inputfd,         /* I - File descriptor input stream */
 
     filter_logfunc_t log = data->logfunc;
     void *ld = data->logdata;
-    filter_iscanceledfunc_t iscanceled = data->iscanceledfunc;
+    cf_filter_iscanceledfunc_t iscanceled = data->iscanceledfunc;
     void *icd = data->iscanceleddata;
     char jobid[50];
 
@@ -1039,7 +1039,7 @@ int bannertopdf(int inputfd,         /* I - File descriptor input stream */
         {
             if (log)
                 log(ld, FILTER_LOGLEVEL_DEBUG,
-                    "bannertopdf: Unable to open input data stream.");
+                    "cfFilterBannerToPDF: Unable to open input data stream.");
         }
         return (1);
     }
@@ -1051,13 +1051,13 @@ int bannertopdf(int inputfd,         /* I - File descriptor input stream */
     if ((tempfd = cupsTempFd(tempfile, sizeof(tempfile))) < 0)
     {
       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                  "bannertopdf: Unable to copy input file: %s",
+                  "cfFilterBannerToPDF: Unable to copy input file: %s",
                   strerror(errno));
       return (1);
     }
 
     if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                "bannertopdf: Copying input to temp file \"%s\"",
+                "cfFilterBannerToPDF: Copying input to temp file \"%s\"",
                 tempfile);
 
     while ((bytes = fread(buffer, 1, sizeof(buffer), inputfp)) > 0)
@@ -1080,7 +1080,7 @@ int bannertopdf(int inputfd,         /* I - File descriptor input stream */
         {
             if (log)
                 log(ld, FILTER_LOGLEVEL_DEBUG,
-                    "bannertopdf: Unable to open output data stream.");
+                    "cfFilterBannerToPDF: Unable to open output data stream.");
         }
 
         fclose(inputfp);
@@ -1096,7 +1096,7 @@ int bannertopdf(int inputfd,         /* I - File descriptor input stream */
     if (!ppd)
     {
         if (log)
-            log(ld, FILTER_LOGLEVEL_DEBUG, "bannertopdf: Could not open PPD file '%s'", ppd);
+            log(ld, FILTER_LOGLEVEL_DEBUG, "cfFilterBannerToPDF: Could not open PPD file '%s'", ppd);
     }
 
    /*
@@ -1108,7 +1108,7 @@ int bannertopdf(int inputfd,         /* I - File descriptor input stream */
     if (!banner)
     {
         if (log)
-            log(ld, FILTER_LOGLEVEL_ERROR, "bannertopdf: Could not read banner file");
+            log(ld, FILTER_LOGLEVEL_ERROR, "cfFilterBannerToPDF: Could not read banner file");
         return 1;
     }
 
index 68aa3418ea6382b10f45d912a32b643c56eef74a..5b46278b63469c60ae875a7f332c366f3e6f007e 100644 (file)
@@ -112,7 +112,7 @@ cfColordGetQualifierForPPD (ppd_file_t *ppd)
 #ifdef HAVE_DBUS
 
 static char *
-get_filename_for_profile_path ( filter_data_t *data,
+get_filename_for_profile_path ( cf_filter_data_t *data,
                                DBusConnection *con,
                                const char *object_path)
 {
@@ -173,7 +173,7 @@ out:
 }
 
 static char *
-get_profile_for_device_path ( filter_data_t *data,
+get_profile_for_device_path ( cf_filter_data_t *data,
                             DBusConnection *con,
                              const char *object_path,
                              const char **split)
@@ -271,7 +271,7 @@ out:
 }
 
 static char *
-get_device_path_for_device_id ( filter_data_t *data,
+get_device_path_for_device_id ( cf_filter_data_t *data,
                                DBusConnection *con,
                                const char *device_id)
 {
@@ -325,7 +325,7 @@ out:
 }
 
 char *
-cfColordGetProfileForDeviceID (filter_data_t *data,
+cfColordGetProfileForDeviceID (cf_filter_data_t *data,
                                  const char *device_id,
                                  const char **qualifier_tuple)
 {
@@ -375,7 +375,7 @@ out:
 }
 
 int
-get_profile_inhibitors ( filter_data_t *data,
+get_profile_inhibitors ( cf_filter_data_t *data,
                          DBusConnection *con, const char *object_path)
 {
   filter_logfunc_t log = data->logfunc;
@@ -443,7 +443,7 @@ out:
 }
 
 int
-cfColordGetInhibitForDeviceID (filter_data_t *data,
+cfColordGetInhibitForDeviceID (cf_filter_data_t *data,
                        const char *device_id)
 {
   filter_logfunc_t log = data->logfunc;
@@ -481,7 +481,7 @@ out:
 #else
 
 char *
-cfColordGetProfileForDeviceID (filter_data_t *data,
+cfColordGetProfileForDeviceID (cf_filter_data_t *data,
                                  const char *device_id,
                                   const char **qualifier_tuple)
 {
@@ -493,7 +493,7 @@ cfColordGetProfileForDeviceID (filter_data_t *data,
 }
 
 int
-cfColordGetInhibitForDeviceID (filter_data_t *data,
+cfColordGetInhibitForDeviceID (cf_filter_data_t *data,
                        const char *device_id)
 {
   filter_logfunc_t log = data->logfunc;
index 03b024ef41d79d4c670302c4977642e563c4a561..02072b37f487cd87b7a1205b7ada42e85499a834 100644 (file)
@@ -39,10 +39,10 @@ extern "C" {
 #include <cupsfilters/filter.h>
 
 char **cfColordGetQualifierForPPD(ppd_file_t *ppd);
-char *cfColordGetProfileForDeviceID(filter_data_t *data,
+char *cfColordGetProfileForDeviceID(cf_filter_data_t *data,
                                    const char *device_id,
                                    const char **qualifier_tuple);
-int cfColordGetInhibitForDeviceID(filter_data_t *data,
+int cfColordGetInhibitForDeviceID(cf_filter_data_t *data,
                                  const char *device_id);
 
 #  ifdef __cplusplus
index b01eacbae790f14eb9fe3b94fd060d33447c582c..494992278e995e7a0408344753593c6ea756853f 100644 (file)
@@ -35,12 +35,12 @@ MIT Open Source License  -  http://www.opensource.org/
 
 
 /* Private function prototypes */
-static int      _get_colord_printer_cm_status   (filter_data_t *data);
-static char    *_get_colord_printer_id          (filter_data_t *data);
-static int      _get_colord_profile             (filter_data_t *data,
+static int      _get_colord_printer_cm_status   (cf_filter_data_t *data);
+static char    *_get_colord_printer_id          (cf_filter_data_t *data);
+static int      _get_colord_profile             (cf_filter_data_t *data,
                                                  char **profile,
                                                  ppd_file_t *ppd);
-static char    *_get_ppd_icc_fallback           (filter_data_t *data, 
+static char    *_get_ppd_icc_fallback           (cf_filter_data_t *data, 
                                                 ppd_file_t *ppd, 
                                                  char **qualifier);
 
@@ -67,7 +67,7 @@ double    blackpoint_default[3] = {0.0, 0.0, 0.0};
 
 /* Get printer color management status from the system's color manager */
 int          
-cfCmIsPrinterCmDisabled(filter_data_t *data)
+cfCmIsPrinterCmDisabled(cf_filter_data_t *data)
 {
     filter_logfunc_t log = data->logfunc;
     void *ld = data->logdata;
@@ -88,7 +88,7 @@ cfCmIsPrinterCmDisabled(filter_data_t *data)
 
 /* Get printer ICC profile from the system's color manager */
 int 
-cfCmGetPrinterIccProfile(filter_data_t *data,
+cfCmGetPrinterIccProfile(cf_filter_data_t *data,
                        char **icc_profile,        /* ICC Profile Path */
                        ppd_file_t *ppd)           /* Optional PPD file for fallback profile */
 {
@@ -110,7 +110,7 @@ cfCmGetPrinterIccProfile(filter_data_t *data,
 
 /* Find the "cm-calibration" CUPS option */
 cf_cm_calibration_t    
-cfCmGetCupsColorCalibrateMode(filter_data_t *data,
+cfCmGetCupsColorCalibrateMode(cf_filter_data_t *data,
                            cups_option_t *options,    /* Options from CUPS */
                             int num_options)           /* Options from CUPS */
 {
@@ -186,7 +186,7 @@ double *cfCmBlackPointDefault(void)
 
 
 char * 
-_get_colord_printer_id( filter_data_t *data)
+_get_colord_printer_id( cf_filter_data_t *data)
 {
 
     filter_logfunc_t log = data->logfunc;
@@ -207,7 +207,7 @@ _get_colord_printer_id( filter_data_t *data)
 
 
 int 
-_get_colord_printer_cm_status( filter_data_t *data)
+_get_colord_printer_cm_status( cf_filter_data_t *data)
 {
 
     filter_logfunc_t log = data->logfunc;
@@ -237,7 +237,7 @@ _get_colord_printer_cm_status( filter_data_t *data)
 }
 
 int 
-_get_colord_profile(filter_data_t *data,
+_get_colord_profile(cf_filter_data_t *data,
                     char         **profile,         /* Requested icc profile path */      
                     ppd_file_t   *ppd)              /* PPD file */
 {
@@ -306,7 +306,7 @@ _get_colord_profile(filter_data_t *data,
 
 /* From gstoraster */
 char *
-_get_ppd_icc_fallback (filter_data_t *data, ppd_file_t *ppd, char **qualifier)
+_get_ppd_icc_fallback (cf_filter_data_t *data, ppd_file_t *ppd, char **qualifier)
 {
 
   filter_logfunc_t log = data->logfunc;
index c8f05812f009f77738b78259a5b1bc66b89ee480..30d3f07cee0950681c9224631a3ed806911ce552 100644 (file)
@@ -62,15 +62,15 @@ typedef enum cf_cm_calibration_e
 
 
 extern 
-cf_cm_calibration_t cfCmGetCupsColorCalibrateMode(filter_data_t *data,
+cf_cm_calibration_t cfCmGetCupsColorCalibrateMode(cf_filter_data_t *data,
                                                  cups_option_t *options,
                                                  int num_options);
 
-extern int cfCmGetPrinterIccProfile(filter_data_t *data,
+extern int cfCmGetPrinterIccProfile(cf_filter_data_t *data,
                                    char **icc_profile,
                                    ppd_file_t *ppd);
 
-extern int cfCmIsPrinterCmDisabled(filter_data_t *data);
+extern int cfCmIsPrinterCmDisabled(cf_filter_data_t *data);
 
 extern double* cfCmGammaAdobeRGB(void);
 extern double* cfCmGammaSGray(void);
index 06b5cb8a4ab0a00d97b0cbbe5313e7f923f80218..f6f7abd1a9a5d9d22063608adf94d0723e2ef0c6 100644 (file)
@@ -60,13 +60,13 @@ fcntl_add_nonblock(int fd) /* File descriptor to add O_NONBLOCK to */
 
 
 /*
- * 'cups_logfunc()' - Output log messages on stderr, compatible to CUPS,
+ * 'cfCUPSLogFunc()' - Output log messages on stderr, compatible to CUPS,
  *                    meaning that the debug level is represented by a
  *                    prefix like "DEBUG: ", "INFO: ", ...
  */
 
 void
-cups_logfunc(void *data,
+cfCUPSLogFunc(void *data,
             filter_loglevel_t level,
             const char *message,
             ...)
@@ -105,28 +105,28 @@ cups_logfunc(void *data,
 
 
 /*
- * 'cups_iscanceledfunc()' - Return 1 if the job is canceled, which is
+ * 'cfCUPSIsCanceledFunc()' - Return 1 if the job is canceled, which is
  *                           the case when the integer pointed at by data
  *                           is not zero.
  */
 
 int
-cups_iscanceledfunc(void *data)
+cfCUPSIsCanceledFunc(void *data)
 {
   return (*((int *)data) != 0 ? 1 : 0);
 }
 
 
 /*
- * 'filterCUPSWrapper()' - Wrapper function to use a filter function as
+ * 'cfFilterCUPSWrapper()' - Wrapper function to use a filter function as
  *                         classic CUPS filter
  */
 
 int                                    /* O - Exit status */
-filterCUPSWrapper(
+cfFilterCUPSWrapper(
      int  argc,                                /* I - Number of command-line args */
      char *argv[],                     /* I - Command-line arguments */
-     filter_function_t filter,          /* I - Filter function */
+     cf_filter_function_t filter,          /* I - Filter function */
      void *parameters,                  /* I - Filter function parameters */
      int *JobCanceled)                  /* I - Var set to 1 when job canceled */
 {
@@ -135,7 +135,7 @@ filterCUPSWrapper(
                                           not stdin)? */
   int          num_options;            /* Number of print options */
   cups_option_t        *options;               /* Print options */
-  filter_data_t filter_data;
+  cf_filter_data_t filter_data;
   int           retval = 0;
 
 
@@ -223,9 +223,9 @@ filterCUPSWrapper(
   filter_data.back_pipe[1] = 3;        /* the back channel */
   filter_data.side_pipe[0] = 4;        /* CUPS uses file descriptor 4 for */
   filter_data.side_pipe[1] = 4;        /* the side channel */
-  filter_data.logfunc = cups_logfunc;  /* Logging scheme of CUPS */
+  filter_data.logfunc = cfCUPSLogFunc;  /* Logging scheme of CUPS */
   filter_data.logdata = NULL;
-  filter_data.iscanceledfunc = cups_iscanceledfunc; /* Job-is-canceled
+  filter_data.iscanceledfunc = cfCUPSIsCanceledFunc; /* Job-is-canceled
                                                       function */
   filter_data.iscanceleddata = JobCanceled;
 
@@ -255,12 +255,12 @@ filterCUPSWrapper(
 
 
 /*
- * 'filterTee()' - This filter function is mainly for debugging. it
+ * 'cfFilterTee()' - This filter function is mainly for debugging. it
  *                 resembles the "tee" utility, passing through the
  *                 data unfiltered and copying it to a file. The file
  *                 name is simply given as parameter. This makes using
  *                 the function easy (add it as item of a filter chain
- *                 called via filterChain()) and can even be used more
+ *                 called via cfFilterChain()) and can even be used more
  *                 than once in the same filter chain (using different
  *                 file names). In case of write error to the copy
  *                 file, copying is stopped but the rest of the job is
@@ -270,10 +270,10 @@ filterCUPSWrapper(
  */
 
 int                            /* O - Error status */
-filterTee(int inputfd,         /* I - File descriptor input stream */
+cfFilterTee(int inputfd,         /* I - File descriptor input stream */
          int outputfd,        /* I - File descriptor output stream */
          int inputseekable,   /* I - Is input stream seekable? (unused) */
-         filter_data_t *data, /* I - Job and printer data */
+         cf_filter_data_t *data, /* I - Job and printer data */
          void *parameters)    /* I - Filter-specific parameters (File name) */
 {
   const char           *filename = (const char *)parameters;
@@ -296,7 +296,7 @@ filterTee(int inputfd,         /* I - File descriptor input stream */
     total += bytes;
     if (log)
       log(ld, FILTER_LOGLEVEL_DEBUG,
-         "filterTee (%s): Passing on%s %d bytes, total %d bytes.",
+         "cfFilterTee (%s): Passing on%s %d bytes, total %d bytes.",
          filename, teefd >= 0 ? " and copying" : "", bytes, total);
 
     if (teefd >= 0)
@@ -304,7 +304,7 @@ filterTee(int inputfd,         /* I - File descriptor input stream */
       {
        if (log)
          log(ld, FILTER_LOGLEVEL_ERROR,
-             "filterTee (%s): Unable to write %d bytes to the copy, stopping copy, continuing job output.",
+             "cfFilterTee (%s): Unable to write %d bytes to the copy, stopping copy, continuing job output.",
              filename, (int)bytes);
        close(teefd);
        teefd = -1;
@@ -314,7 +314,7 @@ filterTee(int inputfd,         /* I - File descriptor input stream */
     {
       if (log)
        log(ld, FILTER_LOGLEVEL_ERROR,
-           "filterTee (%s): Unable to pass on %d bytes.",
+           "cfFilterTee (%s): Unable to pass on %d bytes.",
            filename, (int)bytes);
       if (teefd >= 0)
        close(teefd);
@@ -333,17 +333,17 @@ filterTee(int inputfd,         /* I - File descriptor input stream */
 
 
 /*
- * 'filterPOpen()' - Pipe a stream to or from a filter function
+ * 'cfFilterPOpen()' - Pipe a stream to or from a filter function
  *                   Can be the input to or the output from the
  *                   filter function.
  */
 
 int                              /* O - File decriptor */
-filterPOpen(filter_function_t filter_func, /* I - Filter function */
+cfFilterPOpen(cf_filter_function_t filter_func, /* I - Filter function */
            int inputfd,         /* I - File descriptor input stream or -1 */
            int outputfd,        /* I - File descriptor output stream or -1 */
            int inputseekable,   /* I - Is input stream seekable? */
-           filter_data_t *data, /* I - Job and printer data */
+           cf_filter_data_t *data, /* I - Job and printer data */
            void *parameters,    /* I - Filter-specific parameters */
            int *filter_pid)     /* O - PID of forked filter process */
 {
@@ -363,7 +363,7 @@ filterPOpen(filter_function_t filter_func, /* I - Filter function */
   {
     if (log)
       log(ld, FILTER_LOGLEVEL_ERROR,
-         "filterPOpen: Either inputfd or outputfd must be < 0, not both");
+         "cfFilterPOpen: Either inputfd or outputfd must be < 0, not both");
     return (-1);
   }
 
@@ -371,7 +371,7 @@ filterPOpen(filter_function_t filter_func, /* I - Filter function */
   {
     if (log)
       log(ld, FILTER_LOGLEVEL_ERROR,
-         "filterPOpen: One of inputfd or outputfd must be < 0");
+         "cfFilterPOpen: One of inputfd or outputfd must be < 0");
     return (-1);
   }
 
@@ -387,7 +387,7 @@ filterPOpen(filter_function_t filter_func, /* I - Filter function */
 
   if (pipe(pipefds) < 0) {
     if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                "filterPOpen: Could not create pipe for %s: %s",
+                "cfFilterPOpen: Could not create pipe for %s: %s",
                 inputfd < 0 ? "input" : "output",
                 strerror(errno));
     return (-1);
@@ -424,13 +424,13 @@ filterPOpen(filter_function_t filter_func, /* I - Filter function */
     close(infd);
     close(outfd);
     if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                "filterPOpen: Filter function completed with status %d.",
+                "cfFilterPOpen: Filter function completed with status %d.",
                 ret);
     exit(ret);
 
   } else if (pid > 0) {
     if (log) log(ld, FILTER_LOGLEVEL_INFO,
-                "filterPOpen: Filter function (PID %d) started.", pid);
+                "cfFilterPOpen: Filter function (PID %d) started.", pid);
 
    /*
     * Save PID for waiting for or terminating the sub-process
@@ -457,7 +457,7 @@ filterPOpen(filter_function_t filter_func, /* I - Filter function */
      */
 
     if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                "filterPOpen: Could not fork to start filter function: %s",
+                "cfFilterPOpen: Could not fork to start filter function: %s",
                 strerror(errno));
     return (-1);
   }
@@ -465,14 +465,14 @@ filterPOpen(filter_function_t filter_func, /* I - Filter function */
 
 
 /*
- * 'filterPClose()' - Close a piped stream created with
- *                    filterPOpen().
+ * 'cfFilterPClose()' - Close a piped stream created with
+ *                    cfFilterPOpen().
  */
 
 int                              /* O - Error status */
-filterPClose(int fd,             /* I - Pipe file descriptor */
+cfFilterPClose(int fd,             /* I - Pipe file descriptor */
             int filter_pid,     /* I - PID of forked filter process */
-            filter_data_t *data)
+            cf_filter_data_t *data)
 {
   int          status,          /* Exit status */
                 retval;                 /* Return value */
@@ -499,13 +499,13 @@ filterPClose(int fd,             /* I - Pipe file descriptor */
       goto retry_wait;
     if (log)
       log(ld, FILTER_LOGLEVEL_DEBUG,
-         "filterPClose: Filter function (PID %d) stopped with an error: %s!",
+         "cfFilterPClose: Filter function (PID %d) stopped with an error: %s!",
          filter_pid, strerror(errno));
     goto out;
   }
 
   if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-               "filterPClose: Filter function (PID %d) exited with no errors.",
+               "cfFilterPClose: Filter function (PID %d) exited with no errors.",
                filter_pid);
 
   /* How did the filter function terminate */
@@ -534,20 +534,20 @@ compare_filter_pids(filter_function_pid_t *a,     /* I - First filter */
 
 
 /*
- * 'filterChain()' - Call filter functions in a chain to do a data
+ * 'cfFilterChain()' - Call filter functions in a chain to do a data
  *                   format conversion which non of the individual
  *                   filter functions does
  */
 
 int                              /* O - Error status */
-filterChain(int inputfd,         /* I - File descriptor input stream */
+cfFilterChain(int inputfd,         /* I - File descriptor input stream */
            int outputfd,        /* I - File descriptor output stream */
            int inputseekable,   /* I - Is input stream seekable? */
-           filter_data_t *data, /* I - Job and printer data */
+           cf_filter_data_t *data, /* I - Job and printer data */
            void *parameters)    /* I - Filter-specific parameters */
 {
   cups_array_t  *filter_chain = (cups_array_t *)parameters;
-  filter_filter_in_chain_t *filter,  /* Current filter */
+  cf_filter_filter_in_chain_t *filter,  /* Current filter */
                *next;               /* Next filter */
   int          current,             /* Current filter */
                filterfds[2][2],     /* Pipes for filters */
@@ -563,7 +563,7 @@ filterChain(int inputfd,         /* I - File descriptor input stream */
                key;                 /* Search key for filters */
   filter_logfunc_t log = data->logfunc;
   void          *ld = data->logdata;
-  filter_iscanceledfunc_t iscanceled = data->iscanceledfunc;
+  cf_filter_iscanceledfunc_t iscanceled = data->iscanceledfunc;
   void          *icd = data->iscanceleddata;
 
 
@@ -577,17 +577,17 @@ filterChain(int inputfd,         /* I - File descriptor input stream */
   * Remove NULL filters...
   */
 
-  for (filter = (filter_filter_in_chain_t *)cupsArrayFirst(filter_chain);
+  for (filter = (cf_filter_filter_in_chain_t *)cupsArrayFirst(filter_chain);
        filter;
-       filter = (filter_filter_in_chain_t *)cupsArrayNext(filter_chain)) {
+       filter = (cf_filter_filter_in_chain_t *)cupsArrayNext(filter_chain)) {
     if (!filter->function) {
       if (log) log(ld, FILTER_LOGLEVEL_INFO,
-                  "filterChain: Invalid filter: %s - Removing...",
+                  "cfFilterChain: Invalid filter: %s - Removing...",
                   filter->name ? filter->name : "Unspecified");
       cupsArrayRemove(filter_chain, filter);
     } else
       if (log) log(ld, FILTER_LOGLEVEL_INFO,
-                  "filterChain: Running filter: %s",
+                  "cfFilterChain: Running filter: %s",
                   filter->name ? filter->name : "Unspecified");
   }
 
@@ -598,20 +598,20 @@ filterChain(int inputfd,         /* I - File descriptor input stream */
   if (cupsArrayCount(filter_chain) == 0)
   {
     if (log) log(ld, FILTER_LOGLEVEL_INFO,
-                "filterChain: No filter at all in chain, passing through the data.");
+                "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,
-                    "filterChain: Data write error: %s", strerror(errno));
+                    "cfFilterChain: Data write error: %s", strerror(errno));
        retval = 1;
        break;
       }
     if (bytes < 0)
     {
       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                    "filterChain: Data read error: %s", strerror(errno));
+                    "cfFilterChain: Data read error: %s", strerror(errno));
       retval = 1;
     }
     close(inputfd);
@@ -630,10 +630,10 @@ filterChain(int inputfd,         /* I - File descriptor input stream */
   filterfds[1][0] = -1;
   filterfds[1][1] = -1;
 
-  for (filter = (filter_filter_in_chain_t *)cupsArrayFirst(filter_chain);
+  for (filter = (cf_filter_filter_in_chain_t *)cupsArrayFirst(filter_chain);
        filter;
        filter = next, current = 1 - current) {
-    next = (filter_filter_in_chain_t *)cupsArrayNext(filter_chain);
+    next = (cf_filter_filter_in_chain_t *)cupsArrayNext(filter_chain);
 
     if (filterfds[1 - current][0] > 1) {
       close(filterfds[1 - current][0]);
@@ -647,7 +647,7 @@ filterChain(int inputfd,         /* I - File descriptor input stream */
     if (next) {
       if (pipe(filterfds[1 - current]) < 0) {
        if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                    "filterChain: Could not create pipe for output of %s: %s",
+                    "cfFilterChain: Could not create pipe for output of %s: %s",
                     filter->name ? filter->name : "Unspecified filter",
                     strerror(errno));
        return (1);
@@ -687,13 +687,13 @@ filterChain(int inputfd,         /* I - File descriptor input stream */
       close(infd);
       close(outfd);
       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                  "filterChain: %s completed with status %d.",
+                  "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,
-                  "filterChain: %s (PID %d) started.",
+                  "cfFilterChain: %s (PID %d) started.",
                   filter->name ? filter->name : "Unspecified filter", pid);
 
       pid_entry = malloc(sizeof(filter_function_pid_t));
@@ -702,7 +702,7 @@ filterChain(int inputfd,         /* I - File descriptor input stream */
       cupsArrayAdd(pids, pid_entry);
     } else {
       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                  "filterChain: Could not fork to start %s: %s",
+                  "cfFilterChain: Could not fork to start %s: %s",
                   filter->name ? filter->name : "Unspecified filter",
                   strerror(errno));
       break;
@@ -734,7 +734,7 @@ filterChain(int inputfd,         /* I - File descriptor input stream */
     if ((pid = wait(&status)) < 0) {
       if (errno == EINTR && iscanceled && iscanceled(icd)) {
        if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                    "filterChain: Job canceled, killing filters ...");
+                    "cfFilterChain: Job canceled, killing filters ...");
        for (pid_entry = (filter_function_pid_t *)cupsArrayFirst(pids);
             pid_entry;
             pid_entry = (filter_function_pid_t *)cupsArrayNext(pids)) {
@@ -754,17 +754,17 @@ filterChain(int inputfd,         /* I - File descriptor input stream */
       if (status) {
        if (WIFEXITED(status)) {
          if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                      "filterChain: %s (PID %d) stopped with status %d",
+                      "cfFilterChain: %s (PID %d) stopped with status %d",
                       pid_entry->name, pid, WEXITSTATUS(status));
        } else {
          if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                      "filterChain: %s (PID %d) crashed on signal %d",
+                      "cfFilterChain: %s (PID %d) crashed on signal %d",
                       pid_entry->name, pid, WTERMSIG(status));
        }
        retval = 1;
       } else {
        if (log) log(ld, FILTER_LOGLEVEL_INFO,
-                      "filterChain: %s (PID %d) exited with no errors.",
+                      "cfFilterChain: %s (PID %d) exited with no errors.",
                       pid_entry->name, pid);
       }
 
@@ -779,7 +779,7 @@ filterChain(int inputfd,         /* I - File descriptor input stream */
 
 
 /*
- * 'get_env_var()' - Auxiliary function for filterExternalCUPS(), gets value of
+ * 'get_env_var()' - Auxiliary function for cfFilterExternalCUPS(), gets value of
  *                   an environment variable in a list of environment variables
  *                   as used by the execve() function
  */
@@ -803,7 +803,7 @@ get_env_var(char *name,   /* I - Name of environment variable to read */
 
 
 /*
- * 'add_env_var()' - Auxiliary function for filterExternalCUPS(), adds/sets
+ * 'add_env_var()' - Auxiliary function for cfFilterExternalCUPS(), adds/sets
  *                   an environment variable in a list of environment variables
  *                   as used by the execve() function
  */
@@ -908,7 +908,7 @@ sanitize_device_uri(const char *uri,        /* I - Device URI */
 
 
 /*
- * 'filterExternalCUPS()' - Filter function which calls an external,
+ * 'cfFilterExternalCUPS()' - Filter function which calls an external,
  *                          classic CUPS filter, for example a
  *                          (proprietary) printer driver which cannot
  *                          be converted to a filter function or is to
@@ -918,13 +918,13 @@ sanitize_device_uri(const char *uri,      /* I - Device URI */
  */
 
 int                                     /* O - Error status */
-filterExternalCUPS(int inputfd,         /* I - File descriptor input stream */
+cfFilterExternalCUPS(int inputfd,         /* I - File descriptor input stream */
                   int outputfd,        /* I - File descriptor output stream */
                   int inputseekable,   /* I - Is input stream seekable? */
-                  filter_data_t *data, /* I - Job and printer data */
+                  cf_filter_data_t *data, /* I - Job and printer data */
                   void *parameters)    /* I - Filter-specific parameters */
 {
-  filter_external_cups_t *params = (filter_external_cups_t *)parameters;
+  cf_filter_external_cups_t *params = (cf_filter_external_cups_t *)parameters;
   int           i;
   int           is_backend = 0;      /* Do we call a CUPS backend? */
   int          pid,                 /* Process ID of filter */
@@ -953,13 +953,13 @@ filterExternalCUPS(int inputfd,         /* I - File descriptor input stream */
   int wstatus;
   filter_logfunc_t log = data->logfunc;
   void          *ld = data->logdata;
-  filter_iscanceledfunc_t iscanceled = data->iscanceledfunc;
+  cf_filter_iscanceledfunc_t iscanceled = data->iscanceledfunc;
   void          *icd = data->iscanceleddata;
 
 
   if (!params->filter || !params->filter[0]) {
     if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                "filterExternalCUPS: Filter executable path/command not specified");
+                "cfFilterExternalCUPS: Filter executable path/command not specified");
     return (1);
   }
 
@@ -1060,14 +1060,14 @@ filterExternalCUPS(int inputfd,         /* I - File descriptor input stream */
   {
     for (i = 0; envp[i]; i ++)
       if (!strncmp(envp[i], "AUTH_", 5))
-       log(ld, FILTER_LOGLEVEL_DEBUG, "filterExternalCUPS (%s): envp[%d]: AUTH_%c****",
+       log(ld, FILTER_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, "filterExternalCUPS (%s): envp[%d]: DEVICE_URI=%s",
+       log(ld, FILTER_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, "filterExternalCUPS (%s): envp[%d]: %s",
+       log(ld, FILTER_LOGLEVEL_DEBUG, "cfFilterExternalCUPS (%s): envp[%d]: %s",
            filter_name, i, envp[i]);
   }
 
@@ -1153,7 +1153,7 @@ filterExternalCUPS(int inputfd,         /* I - File descriptor input stream */
     /* Log the arguments */
     if (log)
       for (i = 0; argv[i]; i ++)
-       log(ld, FILTER_LOGLEVEL_DEBUG, "filterExternalCUPS (%s): argv[%d]: %s",
+       log(ld, FILTER_LOGLEVEL_DEBUG, "cfFilterExternalCUPS (%s): argv[%d]: %s",
            filter_name, i, argv[i]);
   } else {
    /*
@@ -1171,7 +1171,7 @@ filterExternalCUPS(int inputfd,         /* I - File descriptor input stream */
 
   if (pipe(stderrpipe) < 0) {
     if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                "filterExternalCUPS (%s): Could not create pipe for stderr: %s",
+                "cfFilterExternalCUPS (%s): Could not create pipe for stderr: %s",
                 filter_name, strerror(errno));
     return (1);
   }
@@ -1187,7 +1187,7 @@ filterExternalCUPS(int inputfd,         /* I - File descriptor input stream */
       if (inputfd < 0) {
         inputfd = open("/dev/null", O_RDONLY);
        if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                    "filterExternalCUPS (%s): No input file descriptor supplied for CUPS filter - %s",
+                    "cfFilterExternalCUPS (%s): No input file descriptor supplied for CUPS filter - %s",
                   filter_name, strerror(errno));
       }
 
@@ -1195,18 +1195,18 @@ filterExternalCUPS(int inputfd,         /* I - File descriptor input stream */
        fcntl_add_cloexec(inputfd);
         if (dup2(inputfd, 0) < 0) {
          if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                      "filterExternalCUPS (%s): Failed to connect input file descriptor with CUPS filter's stdin - %s",
+                      "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,
-                      "filterExternalCUPS (%s): Connected input file descriptor %d to CUPS filter's stdin.",
+                      "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,
-                  "filterExternalCUPS (%s): Input comes from stdin, letting the filter grab stdin directly",
+                  "cfFilterExternalCUPS (%s): Input comes from stdin, letting the filter grab stdin directly",
                   filter_name);
 
     if (outputfd != 1) {
@@ -1275,7 +1275,7 @@ filterExternalCUPS(int inputfd,         /* I - File descriptor input stream */
     execve(filter_path, argv, envp);
 
     if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                "filterExternalCUPS (%s): Execution of %s %s failed - %s",
+                "cfFilterExternalCUPS (%s): Execution of %s %s failed - %s",
                 filter_name, params->is_backend ? "backend" : "filter",
                 filter_path, strerror(errno));
 
@@ -1283,11 +1283,11 @@ filterExternalCUPS(int inputfd,         /* I - File descriptor input stream */
     exit(errno);
   } else if (pid > 0) {
     if (log) log(ld, FILTER_LOGLEVEL_INFO,
-                "filterExternalCUPS (%s): %s (PID %d) started.",
+                "cfFilterExternalCUPS (%s): %s (PID %d) started.",
                 filter_name, filter_path, pid);
   } else {
     if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                "filterExternalCUPS (%s): Unable to fork process for %s %s",
+                "cfFilterExternalCUPS (%s): Unable to fork process for %s %s",
                 filter_name, params->is_backend ? "backend" : "filter",
                 filter_path);
     close(stderrpipe[0]);
@@ -1341,7 +1341,7 @@ filterExternalCUPS(int inputfd,         /* I - File descriptor input stream */
        if (log_level == FILTER_LOGLEVEL_CONTROL)
          log(ld, log_level, msg);
        else
-         log(ld, log_level, "filterExternalCUPS (%s): %s", filter_name, msg);
+         log(ld, log_level, "cfFilterExternalCUPS (%s): %s", filter_name, msg);
       }
     cupsFileClose(fp);
     /* No need to close the fd stderrpipe[0], as cupsFileClose(fp) does this
@@ -1350,11 +1350,11 @@ filterExternalCUPS(int inputfd,         /* I - File descriptor input stream */
     exit(0);
   } else if (stderrpid > 0) {
     if (log) log(ld, FILTER_LOGLEVEL_INFO,
-                "filterExternalCUPS (%s): Logging (PID %d) started.",
+                "cfFilterExternalCUPS (%s): Logging (PID %d) started.",
                 filter_name, stderrpid);
   } else {
     if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                "filterExternalCUPS (%s): Unable to fork process for logging",
+                "cfFilterExternalCUPS (%s): Unable to fork process for logging",
                 filter_name);
     close(stderrpipe[0]);
     close(stderrpipe[1]);
@@ -1375,7 +1375,7 @@ filterExternalCUPS(int inputfd,         /* I - File descriptor input stream */
     if ((wpid = wait(&wstatus)) < 0) {
       if (errno == EINTR && iscanceled && iscanceled(icd)) {
        if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                    "filterExternalCUPS (%s): Job canceled, killing %s ...",
+                    "cfFilterExternalCUPS (%s): Job canceled, killing %s ...",
                     filter_name, params->is_backend ? "backend" : "filter");
        kill(pid, SIGTERM);
        pid = -1;
@@ -1391,7 +1391,7 @@ filterExternalCUPS(int inputfd,         /* I - File descriptor input stream */
       if (WIFEXITED(wstatus)) {
        /* Via exit() anywhere or return() in the main() function */
        if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                    "filterExternalCUPS (%s): %s (PID %d) stopped with status %d",
+                    "cfFilterExternalCUPS (%s): %s (PID %d) stopped with status %d",
                     filter_name,
                     (wpid == pid ?
                      (params->is_backend ? "Backend" : "Filter") :
@@ -1400,7 +1400,7 @@ filterExternalCUPS(int inputfd,         /* I - File descriptor input stream */
       } else {
        /* Via signal */
        if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                    "filterExternalCUPS (%s): %s (PID %d) crashed on signal %d",
+                    "cfFilterExternalCUPS (%s): %s (PID %d) crashed on signal %d",
                     filter_name,
                     (wpid == pid ?
                      (params->is_backend ? "Backend" : "Filter") :
@@ -1410,7 +1410,7 @@ filterExternalCUPS(int inputfd,         /* I - File descriptor input stream */
       status = 1;
     } else {
       if (log) log(ld, FILTER_LOGLEVEL_INFO,
-                  "filterExternalCUPS (%s): %s (PID %d) exited with no errors.",
+                  "cfFilterExternalCUPS (%s): %s (PID %d) exited with no errors.",
                   filter_name,
                   (wpid == pid ?
                    (params->is_backend ? "Backend" : "Filter") : "Logging"),
@@ -1441,13 +1441,13 @@ filterExternalCUPS(int inputfd,         /* I - File descriptor input stream */
 
 
 /*
- * 'filterOpenBackAndSidePipes()' - Open the pipes for the back
+ * 'cfFilterOpenBackAndSidePipes()' - Open the pipes for the back
  *                                  channel and the side channel, so
  *                                  that the filter functions can
  *                                  communicate with a backend. Only
  *                                  needed if a CUPS backend (either
  *                                  implemented as filter function or
- *                                  called via filterExternalCUPS())
+ *                                  called via cfFilterExternalCUPS())
  *                                  is called with the same
  *                                  filter_data record as the
  *                                  filters. Usually to be called when
@@ -1455,8 +1455,8 @@ filterExternalCUPS(int inputfd,         /* I - File descriptor input stream */
  */
 
 int                           /* O - 0 on success, -1 on error */
-filterOpenBackAndSidePipes(
-    filter_data_t *data)      /* O - FDs in filter_data record */
+cfFilterOpenBackAndSidePipes(
+    cf_filter_data_t *data)      /* O - FDs in filter_data record */
 {
   filter_logfunc_t log = data->logfunc;
   void          *ld = data->logdata;
@@ -1527,22 +1527,22 @@ filterOpenBackAndSidePipes(
   if (log) log(ld, FILTER_LOGLEVEL_ERROR,
               "Unable to open pipes for back and side channels");
 
-  filterCloseBackAndSidePipes(data);
+  cfFilterCloseBackAndSidePipes(data);
 
   return (-1);
 }
 
 
 /*
- * 'filterCloseBackAndSidePipes()' - Close the pipes for the back
+ * 'cfFilterCloseBackAndSidePipes()' - Close the pipes for the back
  *                                   hannel and the side channel.
  *                                   sually to be called when done
  *                                   with the filter chain .
  */
 
 void
-filterCloseBackAndSidePipes(
-    filter_data_t *data)      /* O - FDs in filter_data record */
+cfFilterCloseBackAndSidePipes(
+    cf_filter_data_t *data)      /* O - FDs in filter_data record */
 {
   filter_logfunc_t log = data->logfunc;
   void          *ld = data->logdata;
@@ -1576,12 +1576,12 @@ filterCloseBackAndSidePipes(
 
 
 /*
- * 'filterSetCommonOptions()' - Set common filter options for media size, etc.
+ * 'cfFilterSetCommonOptions()' - Set common filter options for media size, etc.
  *                              based on PPD file
  */
 
 void
-filterSetCommonOptions(
+cfFilterSetCommonOptions(
     ppd_file_t    *ppd,                        /* I - PPD file */
     int           num_options,          /* I - Number of options */
     cups_option_t *options,             /* I - Options */
@@ -1862,7 +1862,7 @@ filterSetCommonOptions(
   }
 
   if (change_size)
-    filterUpdatePageVars(*Orientation, PageLeft, PageRight,
+    cfFilterUpdatePageVars(*Orientation, PageLeft, PageRight,
                         PageTop, PageBottom, PageWidth, PageLength);
 
   if (ppdIsMarked(ppd, "Duplex", "DuplexNoTumble") ||
@@ -1884,11 +1884,11 @@ filterSetCommonOptions(
 
 
 /*
- * 'filterUpdatePageVars()' - Update the page variables for the orientation.
+ * 'cfFilterUpdatePageVars()' - Update the page variables for the orientation.
  */
 
 void
-filterUpdatePageVars(int Orientation,
+cfFilterUpdatePageVars(int Orientation,
                     float *PageLeft, float *PageRight,
                     float *PageTop, float *PageBottom,
                     float *PageWidth, float *PageLength)
index e7c345b47ba45810e356b5fdb49683add91d46fb..7a3853c4aa829621f13d10ae0cee07621ac033ae 100644 (file)
@@ -42,9 +42,9 @@ extern "C" {
  * Types and structures...
  */
 
-typedef int (*filter_iscanceledfunc_t)(void *data);
+typedef int (*cf_filter_iscanceledfunc_t)(void *data);
 
-typedef struct filter_data_s {
+typedef struct cf_filter_data_s {
   char *printer;             /* Print queue name or NULL */
   int job_id;                /* Job ID or 0 */
   char *job_user;            /* Job user or NULL */
@@ -62,29 +62,30 @@ typedef struct filter_data_s {
   int side_pipe[2];          /* File descriptors of sidechannel pipe */
   filter_logfunc_t logfunc;  /* Logging function, NULL for no logging */
   void *logdata;             /* User data for logging function, can be NULL */
-  filter_iscanceledfunc_t iscanceledfunc; /* Function returning 1 when
-                                            job is canceled, NULL for not
-                                            supporting stop on cancel */
+  cf_filter_iscanceledfunc_t iscanceledfunc; /* Function returning 1 when
+                                               job is canceled, NULL for not
+                                               supporting stop on cancel */
   void *iscanceleddata;      /* User data for is-canceled function, can be
                                NULL */
-} filter_data_t;
-
-typedef int (*filter_function_t)(int inputfd, int outputfd, int inputseekable,
-                                filter_data_t *data, void *parameters);
-
-typedef enum filter_out_format_e { /* Possible output formats for filter
-                                     functions */
-  OUTPUT_FORMAT_PDF,        /* PDF */
-  OUTPUT_FORMAT_PDF_IMAGE,   /* Raster-only PDF */
-  OUTPUT_FORMAT_PCLM,       /* PCLM */
-  OUTPUT_FORMAT_CUPS_RASTER, /* CUPS Raster */
-  OUTPUT_FORMAT_PWG_RASTER,  /* PWG Raster */
-  OUTPUT_FORMAT_APPLE_RASTER,/* Apple Raster */
-  OUTPUT_FORMAT_PXL          /* PCL-XL */
-} filter_out_format_t;
-
-typedef struct filter_external_cups_s { /* Parameters for the
-                                          filterExternalCUPS() filter
+} cf_filter_data_t;
+
+typedef int (*cf_filter_function_t)(int inputfd, int outputfd,
+                                   int inputseekable, cf_filter_data_t *data,
+                                   void *parameters);
+
+typedef enum cf_filter_out_format_e { /* Possible output formats for filter
+                                        functions */
+  CF_FILTER_OUT_FORMAT_PDF,          /* PDF */
+  CF_FILTER_OUT_FORMAT_PDF_IMAGE,     /* Raster-only PDF */
+  CF_FILTER_OUT_FORMAT_PCLM,         /* PCLM */
+  CF_FILTER_OUT_FORMAT_CUPS_RASTER,   /* CUPS Raster */
+  CF_FILTER_OUT_FORMAT_PWG_RASTER,    /* PWG Raster */
+  CF_FILTER_OUT_FORMAT_APPLE_RASTER,  /* Apple Raster */
+  CF_FILTER_OUT_FORMAT_PXL            /* PCL-XL */
+} cf_filter_out_format_t;
+
+typedef struct cf_filter_external_cups_s { /* Parameters for the
+                                          cfFilterExternalCUPS() filter
                                           function */
   const char *filter;        /* Path/Name of the CUPS filter to be called by
                                this filter function, required */
@@ -101,115 +102,118 @@ typedef struct filter_external_cups_s { /* Parameters for the
   char **envp;               /* Additional environment variables, the already
                                 defined ones stay valid but can be overwritten
                                 by these ones, NULL if none */
-} filter_external_cups_t;
-
-typedef struct filter_filter_in_chain_s { /* filter entry for CUPS array to
-                                            be supplied to filterChain()
-                                            filter function */
-  filter_function_t function; /* Filter function to be called */
-  void *parameters;           /* Parameters for this filter function call */
-  char *name;                 /* Name/comment, only for logging */
-} filter_filter_in_chain_t;
-
-typedef struct texttopdf_parameter_s {  /* parameters container of environemnt
-                                          variables needed by texttopdf
-                                          filter function */
+} cf_filter_external_cups_t;
+
+typedef struct cf_filter_filter_in_chain_s { /* filter entry for CUPS array to
+                                               be supplied to cfFilterChain()
+                                               filter function */
+  cf_filter_function_t function; /* Filter function to be called */
+  void *parameters;              /* Parameters for this filter function call */
+  char *name;                    /* Name/comment, only for logging */
+} cf_filter_filter_in_chain_t;
+
+typedef struct cf_filter_texttopdf_parameter_s { /* parameters container of
+                                                   environemnt variables needed
+                                                   by texttopdf filter
+                                                   function */
   char *data_dir;
   char *char_set;
   char *content_type;
   char *classification;
-} texttopdf_parameter_t;
+} cf_filter_texttopdf_parameter_t;
 
-typedef struct universal_parameter_s { /* Contains input and output
-                                         type to be supplied to the
-                                         universal function, and also
-                                         parameters for texttopdf() */
+typedef struct cf_filter_universal_parameter_s { /* Contains input and output
+                                                   type to be supplied to the
+                                                   universal function, and also
+                                                   parameters for
+                                                   cfFilterTextToPDF() */
   char *input_format;                 
   char *output_format;
-  texttopdf_parameter_t texttopdf_params;
-} universal_parameter_t;
+  cf_filter_texttopdf_parameter_t texttopdf_params;
+} cf_filter_universal_parameter_t;
 
 
 /*
  * Prototypes...
  */
 
-extern void cups_logfunc(void *data,
-                        filter_loglevel_t level,
-                        const char *message,
-                        ...);
+extern void cfCUPSLogFunc(void *data,
+                         filter_loglevel_t level,
+                         const char *message,
+                         ...);
 
 
-extern int cups_iscanceledfunc(void *data);
+extern int cfCUPSIsCanceledFunc(void *data);
 
 
-extern int filterCUPSWrapper(int argc,
-                            char *argv[],
-                            filter_function_t filter,
-                            void *parameters,
-                            int *JobCanceled);
+extern int cfFilterCUPSWrapper(int argc,
+                              char *argv[],
+                              cf_filter_function_t filter,
+                              void *parameters,
+                              int *JobCanceled);
 
 
-extern int filterTee(int inputfd,
-                    int outputfd,
-                    int inputseekable,
-                    filter_data_t *data,
-                    void *parameters);
+extern int cfFilterTee(int inputfd,
+                      int outputfd,
+                      int inputseekable,
+                      cf_filter_data_t *data,
+                      void *parameters);
 
 /* Parameters: Filename/path (const char *) to copy the data to */
 
 
-extern int filterPOpen(filter_function_t filter_func, /* I - Filter function */
-                      int inputfd,
-                      int outputfd,
-                      int inputseekable,
-                      filter_data_t *data,
-                      void *parameters,
-                      int *filter_pid);
+extern int cfFilterPOpen(cf_filter_function_t filter_func, /* I - Filter
+                                                                 function */
+                        int inputfd,
+                        int outputfd,
+                        int inputseekable,
+                        cf_filter_data_t *data,
+                        void *parameters,
+                        int *filter_pid);
 
 
-extern int filterPClose(int fd,
-                       int filter_pid,
-                       filter_data_t *data);
+extern int cfFilterPClose(int fd,
+                         int filter_pid,
+                         cf_filter_data_t *data);
 
 
-extern int filterChain(int inputfd,
-                      int outputfd,
-                      int inputseekable,
-                      filter_data_t *data,
-                      void *parameters);
+extern int cfFilterChain(int inputfd,
+                        int outputfd,
+                        int inputseekable,
+                        cf_filter_data_t *data,
+                        void *parameters);
 
-/* Parameters: Unsorted (!) CUPS array of filter_filter_in_chain_t*
+/* Parameters: Unsorted (!) CUPS array of cf_filter_filter_in_chain_t*
    List of filters to execute in a chain, next filter takes output of
    previous filter as input, all get the same filter data, parameters
    from the array */
 
 
-extern int filterExternalCUPS(int inputfd,
-                             int outputfd,
-                             int inputseekable,
-                             filter_data_t *data,
-                             void *parameters);
+extern int cfFilterExternalCUPS(int inputfd,
+                               int outputfd,
+                               int inputseekable,
+                               cf_filter_data_t *data,
+                               void *parameters);
 
-/* Parameters: filter_external_cups_t*
+/* Parameters: cf_filter_external_cups_t*
    Path/Name of the CUPS filter to be called by this filter function,
    extra options for the 5th command line argument, and extra environment
    variables */
 
 
-extern int filterOpenBackAndSidePipes(filter_data_t *data);
+extern int cfFilterOpenBackAndSidePipes(cf_filter_data_t *data);
 
 
-extern void filterCloseBackAndSidePipes(filter_data_t *data);
+extern void cfFilterCloseBackAndSidePipes(cf_filter_data_t *data);
 
 
-extern int ghostscript(int inputfd,
-                      int outputfd,
-                      int inputseekable,
-                      filter_data_t *data,
-                      void *parameters);
+extern int cfFilterGhostscript(int inputfd,
+                              int outputfd,
+                              int inputseekable,
+                              cf_filter_data_t *data,
+                              void *parameters);
 
-/* Parameters: filter_out_format_t*
+/* Parameters: cf_filter_out_format_t*
    Ouput format: PDF, raster-only PDF, PCLm, PostScript, CUPS Raster,
    PWG Raster, Apple Raster, PCL-XL
    Note: On the Apple Raster selection the output is actually CUPS Raster
@@ -221,11 +225,11 @@ extern int ghostscript(int inputfd,
    device.*/
 
 
-extern int bannertopdf(int inputfd,
-                     int outputfd,
-                     int inputseekable,
-                     filter_data_t *data,
-                     void *parameters);
+extern int cfFilterBannerToPDF(int inputfd,
+                              int outputfd,
+                              int inputseekable,
+                              cf_filter_data_t *data,
+                              void *parameters);
 
 /* Parameters: const char*
    Template directory: In this directory there are the PDF template files
@@ -235,27 +239,27 @@ extern int bannertopdf(int inputfd,
    as template. */
 
 
-extern int imagetopdf(int inputfd,
-                     int outputfd,
-                     int inputseekable,
-                     filter_data_t *data,
-                     void *parameters);
+extern int cfFilterImageToPDF(int inputfd,
+                             int outputfd,
+                             int inputseekable,
+                             cf_filter_data_t *data,
+                             void *parameters);
 
 
-extern int imagetops(int inputfd,
-                    int outputfd,
-                    int inputseekable,
-                    filter_data_t *data,
-                    void *parameters);
+extern int cfFilterImageToPS(int inputfd,
+                            int outputfd,
+                            int inputseekable,
+                            cf_filter_data_t *data,
+                            void *parameters);
 
 
-extern int imagetoraster(int inputfd,
-                        int outputfd,
-                        int inputseekable,
-                        filter_data_t *data,
-                        void *parameters);
+extern int cfFilterImageToRaster(int inputfd,
+                                int outputfd,
+                                int inputseekable,
+                                cf_filter_data_t *data,
+                                void *parameters);
 
-/* Parameters: filter_out_format_t* Ouput format: CUPS Raster, PWG
+/* Parameters: cf_filter_out_format_t* Ouput format: CUPS Raster, PWG
    Raster, Apple Raster, PCLM
    Note: On the Apple Raster, PWG Raster, and PCLm selection the
    output is actually CUPS Raster but information about available
@@ -267,13 +271,13 @@ extern int imagetoraster(int inputfd,
    this filter function. */
 
 
-extern int mupdftopwg(int inputfd,
-                        int outputfd,
-                        int inputseekable,
-                        filter_data_t *data,
-                        void *parameters);
+extern int cfFilterMuPDFToPWG(int inputfd,
+                             int outputfd,
+                             int inputseekable,
+                             cf_filter_data_t *data,
+                             void *parameters);
 
-/* Parameters: filter_out_format_t*
+/* Parameters: cf_filter_out_format_t*
    Ouput format: CUPS Raster, PWG Raster, Apple Raster, PCLm
    Note: With CUPS Raster, Apple Raster, or PCLm selections the output
    is actually PWG Raster but information about available color spaces
@@ -284,42 +288,42 @@ extern int mupdftopwg(int inputfd,
    future when MuPDF adds further output formats. */
 
 
-extern int pclmtoraster(int inputfd,
-                       int outputfd,
-                       int inputseekable,
-                       filter_data_t *data,
-                       void *parameters);
+extern int cfFilterPCLmToRaster(int inputfd,
+                               int outputfd,
+                               int inputseekable,
+                               cf_filter_data_t *data,
+                               void *parameters);
 
-/* Parameters: filter_out_format_t*
+/* Parameters: cf_filter_out_format_t*
    Ouput format: CUPS Raster, Apple Raster, or PWG Raster */
 
 
-extern int pdftopdf(int inputfd,
-                   int outputfd,
-                   int inputseekable,
-                   filter_data_t *data,
-                   void *parameters);
+extern int cfFilterPDFToPDF(int inputfd,
+                           int outputfd,
+                           int inputseekable,
+                           cf_filter_data_t *data,
+                           void *parameters);
 
 /* Parameters: const char*
    For CUPS value of FINAL_CONTENT_TYPE environment variable, generally
    MIME type of the final output format of the filter chain for this job
-   (not the output of the pdftopdf() filter function) */
+   (not the output of the cfFilterPDFToPDF() filter function) */
 
 
-extern int pdftops(int inputfd,
-                  int outputfd,
-                  int inputseekable,
-                  filter_data_t *data,
-                  void *parameters);
+extern int cfFilterPDFToPS(int inputfd,
+                          int outputfd,
+                          int inputseekable,
+                          cf_filter_data_t *data,
+                          void *parameters);
 
 
-extern int pdftoraster(int inputfd,
-                      int outputfd,
-                      int inputseekable,
-                      filter_data_t *data,
-                      void* parameters);
+extern int cfFilterPDFToRaster(int inputfd,
+                              int outputfd,
+                              int inputseekable,
+                              cf_filter_data_t *data,
+                              void* parameters);
 
-/* Parameters: filter_out_format_t*
+/* Parameters: cf_filter_out_format_t*
    Ouput format: CUPS Raster, PWG Raster, Apple Raster, PCLm
    Note: With Apple Raster or PCLm selections the output is actually
    CUPS Raster but information about available color spaces and depths
@@ -330,20 +334,20 @@ extern int pdftoraster(int inputfd,
    Raster output support to this filter. */
 
 
-extern int pstops(int inputfd,
-                 int outputfd,
-                 int inputseekable,
-                 filter_data_t *data,
-                 void *parameters);
+extern int cfFilterPSToPS(int inputfd,
+                         int outputfd,
+                         int inputseekable,
+                         cf_filter_data_t *data,
+                         void *parameters);
 
 
-extern int pwgtoraster(int inputfd,
-                      int outputfd,
-                      int inputseekable,
-                      filter_data_t *data,
-                      void *parameters);
+extern int cfFilterPWGToRaster(int inputfd,
+                              int outputfd,
+                              int inputseekable,
+                              cf_filter_data_t *data,
+                              void *parameters);
 
-/* Parameters: filter_out_format_t*
+/* Parameters: cf_filter_out_format_t*
    Ouput format: CUPS Raster, PWG Raster, Apple Raster, PCLm
    Note: On the PCLM selection the output is actually CUPS Raster
    but information about available color spaces and depths is taken from
@@ -351,84 +355,84 @@ extern int pwgtoraster(int inputfd,
    attribute. This mode is for further processing with rastertopclm. */
 
 
-extern int rastertopdf(int inputfd,
-                      int outputfd,
-                      int inputseekable,
-                      filter_data_t *data,
-                      void *parameters);
+extern int cfFilterRasterToPDF(int inputfd,
+                              int outputfd,
+                              int inputseekable,
+                              cf_filter_data_t *data,
+                              void *parameters);
 
-/* Parameters: filter_out_format_t*
+/* Parameters: cf_filter_out_format_t*
    Ouput format: PDF, PCLm */
 
 
-extern int rastertops(int inputfd,
-                     int outputfd,
-                     int inputseekable,
-                     filter_data_t *data,
-                     void *parameters);
+extern int cfFilterRasterToPS(int inputfd,
+                             int outputfd,
+                             int inputseekable,
+                             cf_filter_data_t *data,
+                             void *parameters);
 
 
-extern int rastertopwg(int inputfd,
-                      int outputfd,
-                      int inputseekable,
-                      filter_data_t *data,
-                      void *parameters);
+extern int cfFilterRasterToPWG(int inputfd,
+                              int outputfd,
+                              int inputseekable,
+                              cf_filter_data_t *data,
+                              void *parameters);
 
-/* Parameters: filter_out_format_t*
+/* Parameters: cf_filter_out_format_t*
    Ouput format: Apple Raster or PWG Raster */
 
 
-extern int texttopdf(int inputfd,
-                    int outputfd,
-                    int inputseekable,
-                    filter_data_t *data,
-                    void *parameters);
+extern int cfFilterTextToPDF(int inputfd,
+                            int outputfd,
+                            int inputseekable,
+                            cf_filter_data_t *data,
+                            void *parameters);
 
-/* Parameters: texttopdf_parameter_t*
+/* Parameters: cf_filter_texttopdf_parameter_t*
    Data directory (fonts, charsets), charset, content type (for prettyprint),
    classification (for overprint/watermark) */
 
 
-extern int texttotext(int inputfd,
-                     int outputfd,
-                     int inputseekable,
-                     filter_data_t *data,
-                     void *parameters);
+extern int cfFilterTextToText(int inputfd,
+                             int outputfd,
+                             int inputseekable,
+                             cf_filter_data_t *data,
+                             void *parameters);
 
-extern int universal(int inputfd,
-                    int outputfd,
-                    int inputseekable,
-                    filter_data_t *data,
-                    void *parameters);
+extern int cfFilterUniversal(int inputfd,
+                            int outputfd,
+                            int inputseekable,
+                            cf_filter_data_t *data,
+                            void *parameters);
 
-/* Parameters: universal_parameter_t
+/* Parameters: cf_filter_universal_parameter_t
    Contains : Input_type: CONTENT_TYPE environment variable of CUPS
               Output type: FINAL_CONTENT TYPE environment variable of CUPS
               texttopdf_params: parameters for texttopdf */
 
 
-extern void filterSetCommonOptions(ppd_file_t *ppd,
-                                  int num_options,
-                                  cups_option_t *options,
-                                  int change_size,
-                                  int *Orientation,
-                                  int *Duplex,
-                                  int *LanguageLevel,
-                                  int *ColorDevice,
-                                  float *PageLeft,
-                                  float *PageRight,
-                                  float *PageTop,
-                                  float *PageBottom,
-                                  float *PageWidth,
-                                  float *PageLength,
-                                  filter_logfunc_t log,
-                                  void *ld);
-
-
-extern void filterUpdatePageVars(int Orientation,
-                                float *PageLeft, float *PageRight,
-                                float *PageTop, float *PageBottom,
-                                float *PageWidth, float *PageLength);
+extern void cfFilterSetCommonOptions(ppd_file_t *ppd,
+                                    int num_options,
+                                    cups_option_t *options,
+                                    int change_size,
+                                    int *Orientation,
+                                    int *Duplex,
+                                    int *LanguageLevel,
+                                    int *ColorDevice,
+                                    float *PageLeft,
+                                    float *PageRight,
+                                    float *PageTop,
+                                    float *PageBottom,
+                                    float *PageWidth,
+                                    float *PageLength,
+                                    filter_logfunc_t log,
+                                    void *ld);
+
+
+extern void cfFilterUpdatePageVars(int Orientation,
+                                  float *PageLeft, float *PageRight,
+                                  float *PageTop, float *PageBottom,
+                                  float *PageWidth, float *PageLength);
 
 
 #  ifdef __cplusplus
index 973a62501164725c51cf03c59f55815adef7bcc1..f70ab8832e63396fd4bfa22e80deabd513dae337 100644 (file)
@@ -101,15 +101,15 @@ parse_pdf_header_options(FILE *fp, gs_page_header *h)
 
 static void
 add_pdf_header_options(gs_page_header *h, cups_array_t *gs_args,
-                      filter_out_format_t outformat, int pxlcolor)
+                      cf_filter_out_format_t outformat, int pxlcolor)
 {
   int i;
   char tmpstr[1024];
 
   /* Simple boolean, enumerated choice, numerical, and string parameters */
-  if (outformat == OUTPUT_FORMAT_CUPS_RASTER ||
-      outformat == OUTPUT_FORMAT_PWG_RASTER ||
-      outformat == OUTPUT_FORMAT_APPLE_RASTER) {
+  if (outformat == CF_FILTER_OUT_FORMAT_CUPS_RASTER ||
+      outformat == CF_FILTER_OUT_FORMAT_PWG_RASTER ||
+      outformat == CF_FILTER_OUT_FORMAT_APPLE_RASTER) {
     if (h->MediaClass[0] |= '\0') {
       snprintf(tmpstr, sizeof(tmpstr), "-sMediaClass=%s", h->MediaClass);
       cupsArrayAdd(gs_args, strdup(tmpstr));
@@ -145,10 +145,10 @@ add_pdf_header_options(gs_page_header *h, cups_array_t *gs_args,
       cupsArrayAdd(gs_args, strdup(tmpstr));
     }
   }
-  if (outformat == OUTPUT_FORMAT_CUPS_RASTER ||
-      outformat == OUTPUT_FORMAT_PWG_RASTER ||
-      outformat == OUTPUT_FORMAT_APPLE_RASTER ||
-      outformat == OUTPUT_FORMAT_PXL) {
+  if (outformat == CF_FILTER_OUT_FORMAT_CUPS_RASTER ||
+      outformat == CF_FILTER_OUT_FORMAT_PWG_RASTER ||
+      outformat == CF_FILTER_OUT_FORMAT_APPLE_RASTER ||
+      outformat == CF_FILTER_OUT_FORMAT_PXL) {
     /* PDF output is only for turning PostScript input data into PDF
        not for sending PDF to a PDF printer (this is done by pdftopdf)
        therefore we do not apply duplex/tumble here. */
@@ -156,7 +156,7 @@ add_pdf_header_options(gs_page_header *h, cups_array_t *gs_args,
       cupsArrayAdd(gs_args, strdup("-dDuplex"));
     }
   }
-  if (outformat != OUTPUT_FORMAT_PCLM) {
+  if (outformat != CF_FILTER_OUT_FORMAT_PCLM) {
     /* In PCLM we have our own method to generate the needed
        resolution, to respect the printer's supported resolutions for
        PCLm, so this is only for non-PCLm output formats */
@@ -164,9 +164,9 @@ add_pdf_header_options(gs_page_header *h, cups_array_t *gs_args,
             h->HWResolution[0], h->HWResolution[1]);
     cupsArrayAdd(gs_args, strdup(tmpstr));
   }
-  if (outformat == OUTPUT_FORMAT_CUPS_RASTER ||
-      outformat == OUTPUT_FORMAT_PWG_RASTER ||
-      outformat == OUTPUT_FORMAT_APPLE_RASTER) {
+  if (outformat == CF_FILTER_OUT_FORMAT_CUPS_RASTER ||
+      outformat == CF_FILTER_OUT_FORMAT_PWG_RASTER ||
+      outformat == CF_FILTER_OUT_FORMAT_APPLE_RASTER) {
     if (h->InsertSheet) {
       cupsArrayAdd(gs_args, strdup("-dInsertSheet"));
     }
@@ -184,13 +184,13 @@ add_pdf_header_options(gs_page_header *h, cups_array_t *gs_args,
       cupsArrayAdd(gs_args, strdup("-dManualFeed"));
     }
   }
-  if (outformat == OUTPUT_FORMAT_CUPS_RASTER ||
-      outformat == OUTPUT_FORMAT_PWG_RASTER ||
-      outformat == OUTPUT_FORMAT_APPLE_RASTER ||
-      outformat == OUTPUT_FORMAT_PXL) {
+  if (outformat == CF_FILTER_OUT_FORMAT_CUPS_RASTER ||
+      outformat == CF_FILTER_OUT_FORMAT_PWG_RASTER ||
+      outformat == CF_FILTER_OUT_FORMAT_APPLE_RASTER ||
+      outformat == CF_FILTER_OUT_FORMAT_PXL) {
     if (h->MediaPosition) {
       int mediapos;
-      if (outformat == OUTPUT_FORMAT_PXL) {
+      if (outformat == CF_FILTER_OUT_FORMAT_PXL) {
        /* Convert PWG MediaPosition values to PXL-ones */
        if (h->MediaPosition == 1) /* Main */
          mediapos = 4;
@@ -227,9 +227,9 @@ add_pdf_header_options(gs_page_header *h, cups_array_t *gs_args,
       cupsArrayAdd(gs_args, strdup(tmpstr));
     }
   }
-  if (outformat == OUTPUT_FORMAT_CUPS_RASTER ||
-      outformat == OUTPUT_FORMAT_PWG_RASTER ||
-      outformat == OUTPUT_FORMAT_APPLE_RASTER) {
+  if (outformat == CF_FILTER_OUT_FORMAT_CUPS_RASTER ||
+      outformat == CF_FILTER_OUT_FORMAT_PWG_RASTER ||
+      outformat == CF_FILTER_OUT_FORMAT_APPLE_RASTER) {
     if (h->MediaWeight) {
       snprintf(tmpstr, sizeof(tmpstr), "-dMediaWeight=%d",
               (unsigned)(h->MediaWeight));
@@ -259,9 +259,9 @@ add_pdf_header_options(gs_page_header *h, cups_array_t *gs_args,
   cupsArrayAdd(gs_args, strdup(tmpstr));
   snprintf(tmpstr, sizeof(tmpstr), "-dDEVICEHEIGHTPOINTS=%d",h->PageSize[1]);
   cupsArrayAdd(gs_args, strdup(tmpstr));
-  if (outformat == OUTPUT_FORMAT_CUPS_RASTER ||
-      outformat == OUTPUT_FORMAT_PWG_RASTER ||
-      outformat == OUTPUT_FORMAT_APPLE_RASTER) {
+  if (outformat == CF_FILTER_OUT_FORMAT_CUPS_RASTER ||
+      outformat == CF_FILTER_OUT_FORMAT_PWG_RASTER ||
+      outformat == CF_FILTER_OUT_FORMAT_APPLE_RASTER) {
     if (h->Separations) {
       cupsArrayAdd(gs_args, strdup("-dSeparations"));
     }
@@ -269,10 +269,10 @@ add_pdf_header_options(gs_page_header *h, cups_array_t *gs_args,
       cupsArrayAdd(gs_args, strdup("-dTraySwitch"));
     }
   }
-  if (outformat == OUTPUT_FORMAT_CUPS_RASTER ||
-      outformat == OUTPUT_FORMAT_PWG_RASTER ||
-      outformat == OUTPUT_FORMAT_APPLE_RASTER ||
-      outformat == OUTPUT_FORMAT_PXL) {
+  if (outformat == CF_FILTER_OUT_FORMAT_CUPS_RASTER ||
+      outformat == CF_FILTER_OUT_FORMAT_PWG_RASTER ||
+      outformat == CF_FILTER_OUT_FORMAT_APPLE_RASTER ||
+      outformat == CF_FILTER_OUT_FORMAT_PXL) {
     /* PDF output is only for turning PostScript input data into PDF
        not for sending PDF to a PDF printer (this is done by pdftopdf)
        therefore we do not apply duplex/tumble here. */
@@ -280,9 +280,9 @@ add_pdf_header_options(gs_page_header *h, cups_array_t *gs_args,
       cupsArrayAdd(gs_args, strdup("-dTumble"));
     }
   }
-  if (outformat == OUTPUT_FORMAT_CUPS_RASTER ||
-      outformat == OUTPUT_FORMAT_PWG_RASTER ||
-      outformat == OUTPUT_FORMAT_APPLE_RASTER) {
+  if (outformat == CF_FILTER_OUT_FORMAT_CUPS_RASTER ||
+      outformat == CF_FILTER_OUT_FORMAT_PWG_RASTER ||
+      outformat == CF_FILTER_OUT_FORMAT_APPLE_RASTER) {
     if (h->cupsMediaType) {
       snprintf(tmpstr, sizeof(tmpstr), "-dcupsMediaType=%d",
               (unsigned)(h->cupsMediaType));
@@ -297,7 +297,7 @@ add_pdf_header_options(gs_page_header *h, cups_array_t *gs_args,
     cupsArrayAdd(gs_args, strdup(tmpstr));
   }
   
-  if (outformat == OUTPUT_FORMAT_PXL) {
+  if (outformat == CF_FILTER_OUT_FORMAT_PXL) {
     if (h->cupsColorSpace == CUPS_CSPACE_W ||
        h->cupsColorSpace == CUPS_CSPACE_K ||
        h->cupsColorSpace == CUPS_CSPACE_WHITE ||
@@ -313,9 +313,9 @@ add_pdf_header_options(gs_page_header *h, cups_array_t *gs_args,
     else
       cupsArrayAdd(gs_args, strdup("-sDEVICE=pxlmono"));
   }
-  if (outformat == OUTPUT_FORMAT_CUPS_RASTER ||
-      outformat == OUTPUT_FORMAT_PWG_RASTER ||
-      outformat == OUTPUT_FORMAT_APPLE_RASTER) {
+  if (outformat == CF_FILTER_OUT_FORMAT_CUPS_RASTER ||
+      outformat == CF_FILTER_OUT_FORMAT_PWG_RASTER ||
+      outformat == CF_FILTER_OUT_FORMAT_APPLE_RASTER) {
     if (h->cupsCompression) {
       snprintf(tmpstr, sizeof(tmpstr), "-dcupsCompression=%d",
               (unsigned)(h->cupsCompression));
@@ -338,9 +338,9 @@ add_pdf_header_options(gs_page_header *h, cups_array_t *gs_args,
     }
   }
 #ifdef CUPS_RASTER_SYNCv1
-  if (outformat == OUTPUT_FORMAT_CUPS_RASTER ||
-      outformat == OUTPUT_FORMAT_PWG_RASTER ||
-      outformat == OUTPUT_FORMAT_APPLE_RASTER) {
+  if (outformat == CF_FILTER_OUT_FORMAT_CUPS_RASTER ||
+      outformat == CF_FILTER_OUT_FORMAT_PWG_RASTER ||
+      outformat == CF_FILTER_OUT_FORMAT_APPLE_RASTER) {
     if (h->cupsBorderlessScalingFactor != 1.0f) {
       snprintf(tmpstr, sizeof(tmpstr), "-dcupsBorderlessScalingFactor=%.4f",
               h->cupsBorderlessScalingFactor);
@@ -391,7 +391,7 @@ gs_spawn (const char *filename,
          int outputfd,
          filter_logfunc_t log,
          void *ld,
-         filter_iscanceledfunc_t iscanceled,
+         cf_filter_iscanceledfunc_t iscanceled,
          void *icd)
 {
   char *argument;
@@ -421,7 +421,8 @@ gs_spawn (const char *filename,
 
   if (log) {
     /* Debug output: Full Ghostscript command line and environment variables */
-    snprintf(buf, sizeof(buf), "ghostscript: Ghostscript command line:");
+    snprintf(buf, sizeof(buf),
+            "cfFilterGhostscript: Ghostscript command line:");
     for (i = 0; gsargv[i]; i ++) {
       if ((strchr(gsargv[i],' ')) || (strchr(gsargv[i],'\t')))
        apos = "'";
@@ -434,7 +435,7 @@ gs_spawn (const char *filename,
 
     for (i = 0; envp[i]; i ++)
       log(ld, FILTER_LOGLEVEL_DEBUG,
-         "ghostscript: envp[%d]=\"%s\"", i, envp[i]);
+         "cfFilterGhostscript: envp[%d]=\"%s\"", i, envp[i]);
   }
 
   /* Create a pipe for feeding the job into Ghostscript */
@@ -443,8 +444,7 @@ gs_spawn (const char *filename,
     infds[0] = -1;
     infds[1] = -1;
     if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                "ghostscript: Unable to establish stdin pipe for Ghostscript "
-                "call");
+                "cfFilterGhostscript: Unable to establish stdin pipe for Ghostscript call");
     goto out;
   }
 
@@ -454,8 +454,7 @@ gs_spawn (const char *filename,
     errfds[0] = -1;
     errfds[1] = -1;
     if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                "ghostscript: Unable to establish stderr pipe for Ghostscript "
-                "call");
+                "cfFilterGhostscript: Unable to establish stderr pipe for Ghostscript call");
     goto out;
   }
 
@@ -467,8 +466,7 @@ gs_spawn (const char *filename,
     infds[0] = -1;
     infds[1] = -1;
     if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                "ghostscript: Unable to set \"close on exec\" flag on read "
-                "end of the stdin pipe for Ghostscript call");
+                "cfFilterGhostscript: Unable to set \"close on exec\" flag on read end of the stdin pipe for Ghostscript call");
     goto out;
   }
   if (fcntl(infds[1], F_SETFD, fcntl(infds[1], F_GETFD) | FD_CLOEXEC))
@@ -476,8 +474,7 @@ gs_spawn (const char *filename,
     close(infds[0]);
     close(infds[1]);
     if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                "ghostscript: Unable to set \"close on exec\" flag on write "
-                "end of the stdin pipe for Ghostscript call");
+                "cfFilterGhostscript: Unable to set \"close on exec\" flag on write end of the stdin pipe for Ghostscript call");
     goto out;
   }
   if (fcntl(errfds[0], F_SETFD, fcntl(errfds[0], F_GETFD) | FD_CLOEXEC))
@@ -487,8 +484,7 @@ gs_spawn (const char *filename,
     errfds[0] = -1;
     errfds[1] = -1;
     if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                "ghostscript: Unable to set \"close on exec\" flag on read "
-                "end of the stderr pipe for Ghostscript call");
+                "cfFilterGhostscript: Unable to set \"close on exec\" flag on read end of the stderr pipe for Ghostscript call");
     goto out;
   }
   if (fcntl(errfds[1], F_SETFD, fcntl(errfds[1], F_GETFD) | FD_CLOEXEC))
@@ -496,8 +492,7 @@ gs_spawn (const char *filename,
     close(errfds[0]);
     close(errfds[1]);
     if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                "ghostscript: Unable to set \"close on exec\" flag on write "
-                "end of the stderr pipe for Ghostscript call");
+                "cfFilterGhostscript: Unable to set \"close on exec\" flag on write end of the stderr pipe for Ghostscript call");
     goto out;
   }
 
@@ -508,8 +503,7 @@ gs_spawn (const char *filename,
       if (infds[0] != 0) {
        if (dup2(infds[0], 0) < 0) {
          if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                      "ghostscript: Unable to couple pipe with stdin of "
-                      "Ghostscript process");
+                      "cfFilterGhostscript: Unable to couple pipe with stdin of Ghostscript process");
          exit(1);
        }
        close(infds[0]);
@@ -517,8 +511,7 @@ gs_spawn (const char *filename,
       close(infds[1]);
     } else {
       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                  "ghostscript: invalid pipe file descriptor to couple with "
-                  "stdin of Ghostscript process");
+                  "cfFilterGhostscript: invalid pipe file descriptor to couple with stdin of Ghostscript process");
       exit(1);
     }
 
@@ -527,8 +520,7 @@ gs_spawn (const char *filename,
       if (errfds[1] != 2) {
        if (dup2(errfds[1], 2) < 0) {
          if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                      "ghostscript: Unable to couple pipe with stderr of "
-                      "Ghostscript process");
+                      "cfFilterGhostscript: Unable to couple pipe with stderr of Ghostscript process");
          exit(1);
        }
        close(errfds[1]);
@@ -536,8 +528,7 @@ gs_spawn (const char *filename,
       close(errfds[0]);
     } else {
       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                  "ghostscript: invalid pipe file descriptor to couple with "
-                  "stderr of Ghostscript process");
+                  "cfFilterGhostscript: invalid pipe file descriptor to couple with stderr of Ghostscript process");
       exit(1);
     }
 
@@ -546,28 +537,26 @@ gs_spawn (const char *filename,
       if (outputfd != 1) {
        if (dup2(outputfd, 1) < 0) {
          if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                      "ghostscript: Unable to couple stdout of Ghostscript "
-                      "process");
+                      "cfFilterGhostscript: Unable to couple stdout of Ghostscript process");
          exit(1);
        }
        close(outputfd);
       }
     } else {
       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                  "ghostscript: Invalid file descriptor to couple with "
-                  "stdout of Ghostscript process");
+                  "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,
-                "ghostscript: Unable to launch Ghostscript: %s: %s", filename,
-                strerror(errno));
+                "cfFilterGhostscript: Unable to launch Ghostscript: %s: %s",
+                filename, strerror(errno));
     exit(1);
   }
   if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-              "ghostscript: Started Ghostscript (PID %d)", gspid);
+              "cfFilterGhostscript: Started Ghostscript (PID %d)", gspid);
 
   close(infds[0]);
   close(errfds[1]);
@@ -597,7 +586,7 @@ gs_spawn (const char *filename,
          log_level = FILTER_LOGLEVEL_DEBUG;
          msg = buf;
        }
-       log(ld, log_level, "ghostscript: %s", msg);
+       log(ld, log_level, "cfFilterGhostscript: %s", msg);
       }
     cupsFileClose(logfp);
     /* No need to close the fd errfds[0], as cupsFileClose(fp) does this
@@ -606,7 +595,7 @@ gs_spawn (const char *filename,
     exit(0);
   }
   if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-              "ghostscript: Started logging (PID %d)", errpid);
+              "cfFilterGhostscript: Started logging (PID %d)", errpid);
 
   close(errfds[0]);
 
@@ -621,22 +610,22 @@ gs_spawn (const char *filename,
         if (errno == EINTR)
           goto retry_write;
        if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                    "ghostscript: write failed: %s", strerror(errno));
+                    "cfFilterGhostscript: write failed: %s", strerror(errno));
       }
       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                  "ghostscript: Can't feed job data into Ghostscript");
+                  "cfFilterGhostscript: Can't feed job data into Ghostscript");
       goto out;
     }
   }
   close (infds[1]);
   if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-              "ghostscript: Input data feed completed");
+              "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,
-                    "ghostscript: Job canceled, killing Ghostscript ...");
+                    "cfFilterGhostscript: Job canceled, killing Ghostscript ...");
        kill(gspid, SIGTERM);
        gspid = -1;
        kill(errpid, SIGTERM);
@@ -651,21 +640,21 @@ gs_spawn (const char *filename,
       if (WIFEXITED(wstatus)) {
        /* Via exit() anywhere or return() in the main() function */
        if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                    "ghostscript: %s (PID %d) stopped with status %d",
+                    "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,
-                    "ghostscript: %s (PID %d) crashed on signal %d",
+                    "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,
-                  "ghostscript: %s (PID %d) exited with no errors.",
+                  "cfFilterGhostscript: %s (PID %d) exited with no errors.",
                   (pid == gspid ? "Ghostscript" : "Logging"), pid);
       status = 0;
     }
@@ -681,18 +670,20 @@ out:
 }
 
 /*
- * 'ghostscript()' - Filter function to use Ghostscript for print
- *                   data conversions
+ * 'cfFilterGhostscript()' - Filter function to use Ghostscript for print
+ *                           data conversions
  */
 
-int                              /* O - Error status */
-ghostscript(int inputfd,         /* I - File descriptor input stream */
-           int outputfd,        /* I - File descriptor output stream */
-           int inputseekable,   /* I - Is input stream seekable? */
-           filter_data_t *data, /* I - Job and printer data */
-           void *parameters)    /* I - Filter-specific parameters */
+int                                         /* O - Error status */
+cfFilterGhostscript(int inputfd,            /* I - File descriptor input
+                                                  stream */
+                   int outputfd,           /* I - File descriptor output
+                                                  stream */
+                   int inputseekable,      /* I - Is input stream seekable? */
+                   cf_filter_data_t *data, /* I - Job and printer data */
+                   void *parameters)       /* I - Filter-specific parameters */
 {
-  filter_out_format_t outformat;
+  cf_filter_out_format_t outformat;
   char buf[BUFSIZ];
   char *filename;
   char *icc_profile = NULL;
@@ -724,11 +715,11 @@ ghostscript(int inputfd,         /* I - File descriptor input stream */
   ipp_attribute_t *ipp_attr;
   filter_logfunc_t log = data->logfunc;
   void          *ld = data->logdata;
-  filter_iscanceledfunc_t iscanceled = data->iscanceledfunc;
+  cf_filter_iscanceledfunc_t iscanceled = data->iscanceledfunc;
   void          *icd = data->iscanceleddata;
 
 
-  /* Note: With the OUTPUT_FORMAT_APPLE_RASTER selection the output is
+  /* Note: With the CF_FILTER_OUT_FORMAT_APPLE_RASTER selection the output is
      actually CUPS Raster but information about available color spaces
      and depths is taken from the urf-supported printer IPP attribute
      or appropriate PPD file attribute. This mode is for further
@@ -737,26 +728,28 @@ ghostscript(int inputfd,         /* I - File descriptor input stream */
      device. */
 
   if (parameters) {
-    outformat = *(filter_out_format_t *)parameters;
-    if (outformat != OUTPUT_FORMAT_PDF &&
-       outformat != OUTPUT_FORMAT_PDF_IMAGE &&
-       outformat != OUTPUT_FORMAT_PCLM &&
-       outformat != OUTPUT_FORMAT_CUPS_RASTER &&
-       outformat != OUTPUT_FORMAT_PWG_RASTER &&
-       outformat != OUTPUT_FORMAT_APPLE_RASTER &&
-       outformat != OUTPUT_FORMAT_PXL)
-      outformat = OUTPUT_FORMAT_CUPS_RASTER;
+    outformat = *(cf_filter_out_format_t *)parameters;
+    if (outformat != CF_FILTER_OUT_FORMAT_PDF &&
+       outformat != CF_FILTER_OUT_FORMAT_PDF_IMAGE &&
+       outformat != CF_FILTER_OUT_FORMAT_PCLM &&
+       outformat != CF_FILTER_OUT_FORMAT_CUPS_RASTER &&
+       outformat != CF_FILTER_OUT_FORMAT_PWG_RASTER &&
+       outformat != CF_FILTER_OUT_FORMAT_APPLE_RASTER &&
+       outformat != CF_FILTER_OUT_FORMAT_PXL)
+      outformat = CF_FILTER_OUT_FORMAT_CUPS_RASTER;
   } else
-    outformat = OUTPUT_FORMAT_CUPS_RASTER;
+    outformat = CF_FILTER_OUT_FORMAT_CUPS_RASTER;
 
   if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-              "ghostscript: Output format: %s",
-              (outformat == OUTPUT_FORMAT_CUPS_RASTER ? "CUPS Raster" :
-               (outformat == OUTPUT_FORMAT_PWG_RASTER ? "PWG Raster" :
-                (outformat == OUTPUT_FORMAT_APPLE_RASTER ? "Apple Raster" :
-                 (outformat == OUTPUT_FORMAT_PDF ? "PDF" :
-                  (outformat == OUTPUT_FORMAT_PDF_IMAGE ? "raster-only PDF" :
-                   (outformat == OUTPUT_FORMAT_PCLM ? "PCLm" :
+              "cfFilterGhostscript: Output format: %s",
+              (outformat == CF_FILTER_OUT_FORMAT_CUPS_RASTER ? "CUPS Raster" :
+               (outformat == CF_FILTER_OUT_FORMAT_PWG_RASTER ? "PWG Raster" :
+                (outformat == CF_FILTER_OUT_FORMAT_APPLE_RASTER ?
+                 "Apple Raster" :
+                 (outformat == CF_FILTER_OUT_FORMAT_PDF ? "PDF" :
+                  (outformat == CF_FILTER_OUT_FORMAT_PDF_IMAGE ?
+                   "raster-only PDF" :
+                   (outformat == CF_FILTER_OUT_FORMAT_PCLM ? "PCLm" :
                     "PCL XL")))))));
   
   memset(&sa, 0, sizeof(sa));
@@ -809,7 +802,7 @@ ghostscript(int inputfd,         /* I - File descriptor input stream */
     if (!iscanceled || !iscanceled(icd))
     {
       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                  "ghostscript: Unable to open input data stream.");
+                  "cfFilterGhostscript: Unable to open input data stream.");
     }
 
     return (1);
@@ -842,13 +835,13 @@ ghostscript(int inputfd,         /* I - File descriptor input stream */
       if ((fd = cupsTempFd(tempfile, sizeof(tempfile))) < 0)
       {
        if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                    "ghostscript: Unable to copy PDF file: %s", strerror(errno));
+                    "cfFilterGhostscript: Unable to copy PDF file: %s", strerror(errno));
        fclose(fp);
        return (1);
       }
 
       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                  "ghostscript: Copying input to temp file \"%s\"",
+                  "cfFilterGhostscript: Copying input to temp file \"%s\"",
                   tempfile);
 
       while ((bytes = fread(buf, 1, sizeof(buf), fp)) > 0)
@@ -868,7 +861,7 @@ ghostscript(int inputfd,         /* I - File descriptor input stream */
        if (!iscanceled || !iscanceled(icd))
         {
          if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                      "ghostscript: Unable to open temporary file.");
+                      "cfFilterGhostscript: Unable to open temporary file.");
        }
 
        goto out;
@@ -881,16 +874,16 @@ ghostscript(int inputfd,         /* I - File descriptor input stream */
 
     if (doc_type == GS_DOC_TYPE_EMPTY) {
       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                  "ghostscript: Input is empty, outputting empty file.");
+                  "cfFilterGhostscript: Input is empty, outputting empty file.");
       status = 0;
-      if (outformat == OUTPUT_FORMAT_CUPS_RASTER ||
-         outformat == OUTPUT_FORMAT_PWG_RASTER ||
-         outformat == OUTPUT_FORMAT_APPLE_RASTER)
+      if (outformat == CF_FILTER_OUT_FORMAT_CUPS_RASTER ||
+         outformat == CF_FILTER_OUT_FORMAT_PWG_RASTER ||
+         outformat == CF_FILTER_OUT_FORMAT_APPLE_RASTER)
        if (write(outputfd, "RaS2", 4)) {};
       goto out;
     } if (doc_type == GS_DOC_TYPE_UNKNOWN) {
       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                  "ghostscript: Can't detect file type");
+                  "cfFilterGhostscript: Can't detect file type");
       goto out;
     }
 
@@ -899,17 +892,17 @@ ghostscript(int inputfd,         /* I - File descriptor input stream */
 
       if (pages == 0) {
        if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                    "ghostscript: No pages left, outputting empty file.");
+                    "cfFilterGhostscript: No pages left, outputting empty file.");
        status = 0;
-       if (outformat == OUTPUT_FORMAT_CUPS_RASTER ||
-           outformat == OUTPUT_FORMAT_PWG_RASTER ||
-           outformat == OUTPUT_FORMAT_APPLE_RASTER)
+       if (outformat == CF_FILTER_OUT_FORMAT_CUPS_RASTER ||
+           outformat == CF_FILTER_OUT_FORMAT_PWG_RASTER ||
+           outformat == CF_FILTER_OUT_FORMAT_APPLE_RASTER)
          if (write(outputfd, "RaS2", 4)) {};
        goto out;
       }
       if (pages < 0) {
        if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                    "ghostscript: Unexpected page count");
+                    "cfFilterGhostscript: Unexpected page count");
        goto out;
       }
     } else {
@@ -926,7 +919,7 @@ ghostscript(int inputfd,         /* I - File descriptor input stream */
       FILE *pd = popen(gscommand, "r");
       if (!pd) {
        if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                    "ghostscript: Failed to execute ghostscript to determine "
+                    "cfFilterGhostscript: Failed to execute ghostscript to determine "
                     "number of input pages!");
        goto out;
       }
@@ -939,17 +932,17 @@ ghostscript(int inputfd,         /* I - File descriptor input stream */
 
       if (pagecount == 0) {
        if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                    "ghostscript: No pages left, outputting empty file.");
+                    "cfFilterGhostscript: No pages left, outputting empty file.");
        status = 0;
-       if (outformat == OUTPUT_FORMAT_CUPS_RASTER ||
-           outformat == OUTPUT_FORMAT_PWG_RASTER ||
-           outformat == OUTPUT_FORMAT_APPLE_RASTER)
+       if (outformat == CF_FILTER_OUT_FORMAT_CUPS_RASTER ||
+           outformat == CF_FILTER_OUT_FORMAT_PWG_RASTER ||
+           outformat == CF_FILTER_OUT_FORMAT_APPLE_RASTER)
          if (write(outputfd, "RaS2", 4)) {};
        goto out;
       }
       if (pagecount < 0) {
        if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                    "ghostscript: Unexpected page count");
+                    "cfFilterGhostscript: Unexpected page count");
        goto out;
       }
     }
@@ -961,7 +954,7 @@ ghostscript(int inputfd,         /* I - File descriptor input stream */
     }
 
     if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                "ghostscript: Input format: %s",
+                "cfFilterGhostscript: Input format: %s",
                 (doc_type == GS_DOC_TYPE_PDF ? "PDF" :
                  (doc_type == GS_DOC_TYPE_PS ? "PostScript" :
                   (doc_type == GS_DOC_TYPE_EMPTY ? "Empty file" :
@@ -971,9 +964,9 @@ ghostscript(int inputfd,         /* I - File descriptor input stream */
   {
     doc_type = GS_DOC_TYPE_UNKNOWN;
     if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                "ghostscript: Input format: Not determined");
+                "cfFilterGhostscript: Input format: Not determined");
     if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                "ghostscript: Streaming mode, no checks for input format, zero-page input, instructions from previous filter");
+                "cfFilterGhostscript: Streaming mode, no checks for input format, zero-page input, instructions from previous filter");
   }
 
   /* Find print-rendering-intent */
@@ -996,8 +989,7 @@ ghostscript(int inputfd,         /* I - File descriptor input stream */
   gs_args = cupsArrayNew(NULL, NULL);
   if (!gs_args) {
     if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                "ghostscript: Unable to allocate memory for Ghostscript "
-                "arguments array");
+                "cfFilterGhostscript: Unable to allocate memory for Ghostscript arguments array");
     goto out;
   }
 
@@ -1020,17 +1012,17 @@ ghostscript(int inputfd,         /* I - File descriptor input stream */
   cupsArrayAdd(gs_args, strdup("-sOutputFile=%stdout"));
 
   /* Ghostscript output device */
-  if (outformat == OUTPUT_FORMAT_CUPS_RASTER ||
-      outformat == OUTPUT_FORMAT_PWG_RASTER ||
-      outformat == OUTPUT_FORMAT_APPLE_RASTER)
+  if (outformat == CF_FILTER_OUT_FORMAT_CUPS_RASTER ||
+      outformat == CF_FILTER_OUT_FORMAT_PWG_RASTER ||
+      outformat == CF_FILTER_OUT_FORMAT_APPLE_RASTER)
     cupsArrayAdd(gs_args, strdup("-sDEVICE=cups"));
-  else if (outformat == OUTPUT_FORMAT_PDF)
+  else if (outformat == CF_FILTER_OUT_FORMAT_PDF)
     cupsArrayAdd(gs_args, strdup("-sDEVICE=pdfwrite"));
   /* In case of PCL XL, raster-obly PDF, or PCLm output we determine
      the exact output device later */
 
   /* Special Ghostscript options for PDF output */
-  if (outformat == OUTPUT_FORMAT_PDF) {
+  if (outformat == CF_FILTER_OUT_FORMAT_PDF) {
     /* If we output PDF we are running as a PostScript-to-PDF filter
        for incoming PostScript jobs. If the client embeds a command
        for multiple copies in the PostScript job instead of using the
@@ -1075,8 +1067,8 @@ ghostscript(int inputfd,         /* I - File descriptor input stream */
 
   cspace = icc_profile ? CUPS_CSPACE_RGB : -1;
   cupsRasterPrepareHeader(&h, data, outformat,
-                         (outformat != OUTPUT_FORMAT_APPLE_RASTER ?
-                          outformat : OUTPUT_FORMAT_CUPS_RASTER), 0,
+                         (outformat != CF_FILTER_OUT_FORMAT_APPLE_RASTER ?
+                          outformat : CF_FILTER_OUT_FORMAT_CUPS_RASTER), 0,
                          &cspace);
 
   /* Special Ghostscript options for raster-only PDF output */
@@ -1086,8 +1078,8 @@ ghostscript(int inputfd,         /* I - File descriptor input stream */
 
   /* Note that these output formats require Ghostscript 9.55.0 or later */
 
-  if (outformat == OUTPUT_FORMAT_PDF_IMAGE ||
-      outformat == OUTPUT_FORMAT_PCLM) {
+  if (outformat == CF_FILTER_OUT_FORMAT_PDF_IMAGE ||
+      outformat == CF_FILTER_OUT_FORMAT_PCLM) {
     int res_x, res_y,
         sup_res_x, sup_res_y,
         best_res_x = 0, best_res_y = 0,
@@ -1099,7 +1091,7 @@ ghostscript(int inputfd,         /* I - File descriptor input stream */
 
     ipp_attr = NULL;
     attr = NULL;
-    if (outformat == OUTPUT_FORMAT_PCLM || /* PCLm forced */
+    if (outformat == CF_FILTER_OUT_FORMAT_PCLM || /* PCLm forced */
        /* PCLm supported according to printer IPP attributes */
        (printer_attrs &&
         (ipp_attr =
@@ -1110,7 +1102,7 @@ ghostscript(int inputfd,         /* I - File descriptor input stream */
         (attr =
          ppdFindAttr(ppd, "cupsPclmSourceResolutionSupported", 0)) != NULL)) {
 
-      outformat = OUTPUT_FORMAT_PCLM;
+      outformat = CF_FILTER_OUT_FORMAT_PCLM;
 
       /* Resolution */
 
@@ -1277,7 +1269,7 @@ ghostscript(int inputfd,         /* I - File descriptor input stream */
     cupsArrayAdd(gs_args, strdup("-dDownScaleFactor=1"));
   }
 
-  if (outformat == OUTPUT_FORMAT_PXL)
+  if (outformat == CF_FILTER_OUT_FORMAT_PXL)
   {
     if (ppd)
     {
@@ -1404,9 +1396,9 @@ ghostscript(int inputfd,         /* I - File descriptor input stream */
     snprintf(tmpstr, sizeof(tmpstr), "-sOutputICCProfile=%s", icc_profile);
     cupsArrayAdd(gs_args, strdup(tmpstr));
   } else if (!cm_disabled &&
-            (outformat == OUTPUT_FORMAT_CUPS_RASTER ||
-             outformat == OUTPUT_FORMAT_PWG_RASTER ||
-             outformat == OUTPUT_FORMAT_APPLE_RASTER)) {
+            (outformat == CF_FILTER_OUT_FORMAT_CUPS_RASTER ||
+             outformat == CF_FILTER_OUT_FORMAT_PWG_RASTER ||
+             outformat == CF_FILTER_OUT_FORMAT_APPLE_RASTER)) {
     /* Set standard output ICC profile sGray/sRGB/AdobeRGB */
     if (h.cupsColorSpace == CUPS_CSPACE_SW)
       cupsArrayAdd(gs_args, strdup("-sOutputICCProfile=sgray.icc"));
@@ -1415,7 +1407,7 @@ ghostscript(int inputfd,         /* I - File descriptor input stream */
     else if (h.cupsColorSpace == CUPS_CSPACE_ADOBERGB)
       cupsArrayAdd(gs_args, strdup("-sOutputICCProfile=a98.icc"));
   } else if (!cm_disabled &&
-            outformat == OUTPUT_FORMAT_PCLM) {
+            outformat == CF_FILTER_OUT_FORMAT_PCLM) {
     /* Set standard output ICC profile sGray/sRGB */
     /*if (h.cupsColorSpace == CUPS_CSPACE_SW)
       cupsArrayAdd(gs_args, strdup("-sOutputICCProfile=sgray.icc"));
@@ -1444,9 +1436,9 @@ ghostscript(int inputfd,         /* I - File descriptor input stream */
      filtering case which happens for converting PostScript input
      files before pdftopdf so margins will be handled later, whereas
      the other output formats for PDF-to-something filtering after
-     pdftopdf, to format the pages for the printer, so margins are
+     cfFilterPDFToPDF, to format the pages for the printer, so margins are
      important. */
-  if (h.cupsImagingBBox[3] > 0.0 && outformat != OUTPUT_FORMAT_PDF) {
+  if (h.cupsImagingBBox[3] > 0.0 && outformat != CF_FILTER_OUT_FORMAT_PDF) {
     snprintf(tmpstr, sizeof(tmpstr),
             "<</.HWMargins[%f %f %f %f] /Margins[0 0]>>setpagedevice",
             h.cupsImagingBBox[0], h.cupsImagingBBox[1],
@@ -1477,12 +1469,12 @@ ghostscript(int inputfd,         /* I - File descriptor input stream */
       (t && (!strcasecmp(t, "true") || !strcasecmp(t, "on") ||
             !strcasecmp(t, "yes")))) {
     if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                "ghostscript: Ghostscript using Center-of-Pixel method to "
+                "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,
-                "ghostscript: Ghostscript using Any-Part-of-Pixel method to "
+                "cfFilterGhostscript: Ghostscript using Any-Part-of-Pixel method to "
                 "fill paths.");
 
   /* Mark the end of PostScript commands supplied on the Ghostscript command
index 08e4a6c6f4be93e46283481ee94b73dce5f6e5cb..70aa060ab54f743222edf938309a877d35f9635b 100644 (file)
@@ -691,15 +691,15 @@ ppd_decode(char *string)          /* I - String to decode */
 }
 
 /*
- * 'imagetopdf()' - Filter function to convert many common image file
+ * 'cfFilterImageToPDF()' - Filter function to convert many common image file
  *                  formats into PDF
  */
 
 int                             /* O - Error status */
-imagetopdf(int inputfd,         /* I - File descriptor input stream */
+cfFilterImageToPDF(int inputfd,         /* I - File descriptor input stream */
           int outputfd,        /* I - File descriptor output stream */
           int inputseekable,   /* I - Is input stream seekable? (unused) */
-          filter_data_t *data, /* I - Job and printer data */
+          cf_filter_data_t *data, /* I - Job and printer data */
           void *parameters)    /* I - Filter-specific parameters (unused) */
 {
   imagetopdf_doc_t     doc;            /* Document information */
@@ -729,7 +729,7 @@ imagetopdf(int inputfd,         /* I - File descriptor input stream */
   int          cropfit = 0;            /* -o crop-to-fit = true */
   filter_logfunc_t log = data->logfunc;
   void          *ld = data->logdata;
-  filter_iscanceledfunc_t iscanceled = data->iscanceledfunc;
+  cf_filter_iscanceledfunc_t iscanceled = data->iscanceledfunc;
   void          *icd = data->iscanceleddata;
   ipp_t *printer_attrs = data->printer_attrs;
   ipp_t *job_attrs = data->job_attrs;
@@ -779,7 +779,7 @@ imagetopdf(int inputfd,         /* I - File descriptor input stream */
     if (!iscanceled || !iscanceled(icd))
     {
       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                  "imagetopdf: Unable to open input data stream.");
+                  "cfFilterImageToPDF: Unable to open input data stream.");
     }
 
     return (1);
@@ -793,14 +793,14 @@ imagetopdf(int inputfd,         /* I - File descriptor input stream */
     if ((fd = cupsTempFd(tempfile, sizeof(tempfile))) < 0)
     {
       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                  "imagetopdf: Unable to copy input: %s",
+                  "cfFilterImageToPDF: Unable to copy input: %s",
                   strerror(errno));
       fclose(fp);
       return (1);
     }
 
     if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                "imagetopdf: Copying input to temp file \"%s\"",
+                "cfFilterImageToPDF: Copying input to temp file \"%s\"",
                 tempfile);
 
     while ((bytes = fread(buf, 1, sizeof(buf), fp)) > 0)
@@ -818,7 +818,7 @@ imagetopdf(int inputfd,         /* I - File descriptor input stream */
       if (!iscanceled || !iscanceled(icd))
       {
        if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                    "imagetopdf: Unable to open temporary file.");
+                    "cfFilterImageToPDF: Unable to open temporary file.");
       }
 
       unlink(tempfile);
@@ -835,7 +835,7 @@ imagetopdf(int inputfd,         /* I - File descriptor input stream */
     if (!iscanceled || !iscanceled(icd))
     {
       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                  "imagetopdf: Unable to open output data stream.");
+                  "cfFilterImageToPDF: Unable to open output data stream.");
     }
 
     fclose(fp);
@@ -886,7 +886,7 @@ imagetopdf(int inputfd,         /* I - File descriptor input stream */
   */
 
   doc.ppd = data->ppd;
-  filterSetCommonOptions(doc.ppd, num_options, options, 0,
+  cfFilterSetCommonOptions(doc.ppd, num_options, options, 0,
                         &doc.Orientation, &doc.Duplex,
                         &doc.LanguageLevel, &doc.Color,
                         &doc.PageLeft, &doc.PageRight,
@@ -894,7 +894,7 @@ imagetopdf(int inputfd,         /* I - File descriptor input stream */
                         &doc.PageWidth, &doc.PageLength,
                         log, ld);
 
-  /* The filterSetCommonOptions() does not set doc.Color
+  /* The cfFilterSetCommonOptions() does not set doc.Color
      according to option settings (user's demand for color/gray),
      so we parse the options and set the mode here */
   cupsRasterParseIPPOptions(&h, data, 0, 1);
@@ -1377,7 +1377,7 @@ imagetopdf(int inputfd,         /* I - File descriptor input stream */
   if (doc.img == NULL)
   {
     if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                "imagetopdf: Unable to open image file for printing!");
+                "cfFilterImageToPDF: Unable to open image file for printing!");
     fclose(doc.outputfp);
     close(outputfd);
     return (1);
@@ -1399,7 +1399,7 @@ imagetopdf(int inputfd,         /* I - File descriptor input stream */
     yppi = xppi;
 
   if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-              "imagetopdf: Before scaling: xppi=%d, yppi=%d, zoom=%.2f",
+              "cfFilterImageToPDF: Before scaling: xppi=%d, yppi=%d, zoom=%.2f",
               xppi, yppi, zoom);
 
   if (xppi > 0)
@@ -1420,14 +1420,14 @@ imagetopdf(int inputfd,         /* I - File descriptor input stream */
     }
 
     if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                "imagetopdf: Before scaling: xprint=%.1f, yprint=%.1f",
+                "cfFilterImageToPDF: Before scaling: xprint=%.1f, yprint=%.1f",
                 doc.xprint, doc.yprint);
 
     doc.xinches = (float)cupsImageGetWidth(doc.img) / (float)xppi;
     doc.yinches = (float)cupsImageGetHeight(doc.img) / (float)yppi;
 
     if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                "imagetopdf: Image size is %.1f x %.1f inches...",
+                "cfFilterImageToPDF: Image size is %.1f x %.1f inches...",
                 doc.xinches, doc.yinches);
 
     if ((val = cupsGetOption("natural-scaling", num_options, options)) != NULL)
@@ -1444,7 +1444,7 @@ imagetopdf(int inputfd,         /* I - File descriptor input stream */
       */
 
       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                  "imagetopdf: Auto orientation...");
+                  "cfFilterImageToPDF: Auto orientation...");
 
       if ((doc.xinches > doc.xprint || doc.yinches > doc.yprint) &&
           doc.xinches <= doc.yprint && doc.yinches <= doc.xprint)
@@ -1454,7 +1454,7 @@ imagetopdf(int inputfd,         /* I - File descriptor input stream */
        */
 
        if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                    "imagetopdf: Using landscape orientation...");
+                    "cfFilterImageToPDF: Using landscape orientation...");
 
        doc.Orientation = (doc.Orientation + 1) & 3;
        doc.xsize       = doc.yprint;
@@ -1475,11 +1475,11 @@ imagetopdf(int inputfd,         /* I - File descriptor input stream */
       (float)cupsImageGetXPPI(doc.img);
 
     if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                "imagetopdf: Before scaling: xprint=%.1f, yprint=%.1f",
+                "cfFilterImageToPDF: Before scaling: xprint=%.1f, yprint=%.1f",
                 doc.xprint, doc.yprint);
 
     if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                "imagetopdf: cupsImageGetXPPI(img) = %d, "
+                "cfFilterImageToPDF: cupsImageGetXPPI(img) = %d, "
                 "cupsImageGetYPPI(img) = %d, aspect = %f",
                 cupsImageGetXPPI(doc.img), cupsImageGetYPPI(doc.img),
                 doc.aspect);
@@ -1507,10 +1507,10 @@ imagetopdf(int inputfd,         /* I - File descriptor input stream */
     }
 
     if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                "imagetopdf: Portrait size is %.2f x %.2f inches",
+                "cfFilterImageToPDF: Portrait size is %.2f x %.2f inches",
                 doc.xsize, doc.ysize);
     if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                "imagetopdf: Landscape size is %.2f x %.2f inches",
+                "cfFilterImageToPDF: Landscape size is %.2f x %.2f inches",
                 doc.xsize2, doc.ysize2);
 
     if (cupsGetOption("orientation-requested", num_options, options) == NULL &&
@@ -1522,7 +1522,7 @@ imagetopdf(int inputfd,         /* I - File descriptor input stream */
       */
 
       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                  "imagetopdf: Auto orientation...");
+                  "cfFilterImageToPDF: Auto orientation...");
 
       if ((doc.xsize * doc.ysize) < (doc.xsize2 * doc.xsize2))
       {
@@ -1531,7 +1531,7 @@ imagetopdf(int inputfd,         /* I - File descriptor input stream */
        */
 
        if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                    "imagetopdf: Using landscape orientation...");
+                    "cfFilterImageToPDF: Using landscape orientation...");
 
        doc.Orientation = 1;
        doc.xinches     = doc.xsize2;
@@ -1546,7 +1546,7 @@ imagetopdf(int inputfd,         /* I - File descriptor input stream */
        */
 
        if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                    "imagetopdf: Using portrait orientation...");
+                    "cfFilterImageToPDF: Using portrait orientation...");
 
        doc.Orientation = 0;
        doc.xinches     = doc.xsize;
@@ -1556,7 +1556,7 @@ imagetopdf(int inputfd,         /* I - File descriptor input stream */
     else if (doc.Orientation & 1)
     {
       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                  "imagetopdf: Using landscape orientation...");
+                  "cfFilterImageToPDF: Using landscape orientation...");
 
       doc.xinches     = doc.xsize2;
       doc.yinches     = doc.ysize2;
@@ -1566,7 +1566,7 @@ imagetopdf(int inputfd,         /* I - File descriptor input stream */
     else
     {
       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                  "imagetopdf: Using portrait orientation...");
+                  "cfFilterImageToPDF: Using portrait orientation...");
 
       doc.xinches     = doc.xsize;
       doc.yinches     = doc.ysize;
@@ -1595,7 +1595,7 @@ imagetopdf(int inputfd,         /* I - File descriptor input stream */
   doc.yprint = doc.yinches / doc.ypages;
 
   if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-              "imagetopdf: xpages = %dx%.2fin, ypages = %dx%.2fin",
+              "cfFilterImageToPDF: xpages = %dx%.2fin, ypages = %dx%.2fin",
               doc.xpages, doc.xprint, doc.ypages, doc.yprint);
 
  /*
@@ -1672,7 +1672,7 @@ imagetopdf(int inputfd,         /* I - File descriptor input stream */
     }
 
     if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                "imagetopdf: Updated custom page size to %.2f x %.2f "
+                "cfFilterImageToPDF: Updated custom page size to %.2f x %.2f "
                 "inches...",
                 width / 72.0, length / 72.0);
 
@@ -1878,15 +1878,15 @@ imagetopdf(int inputfd,         /* I - File descriptor input stream */
 
   if (log) {
     log(ld, FILTER_LOGLEVEL_DEBUG,
-       "imagetopdf: XPosition=%d, YPosition=%d, Orientation=%d",
+       "cfFilterImageToPDF: XPosition=%d, YPosition=%d, Orientation=%d",
        doc.XPosition, doc.YPosition, doc.Orientation);
     log(ld, FILTER_LOGLEVEL_DEBUG,
-       "imagetopdf: xprint=%.2f, yprint=%.2f", doc.xprint, doc.yprint);
+       "cfFilterImageToPDF: xprint=%.2f, yprint=%.2f", doc.xprint, doc.yprint);
     log(ld, FILTER_LOGLEVEL_DEBUG,
-       "imagetopdf: PageLeft=%.0f, PageRight=%.0f, PageWidth=%.0f",
+       "cfFilterImageToPDF: PageLeft=%.0f, PageRight=%.0f, PageWidth=%.0f",
        doc.PageLeft, doc.PageRight, doc.PageWidth);
     log(ld, FILTER_LOGLEVEL_DEBUG,
-       "imagetopdf: PageBottom=%.0f, PageTop=%.0f, PageLength=%.0f",
+       "cfFilterImageToPDF: PageBottom=%.0f, PageTop=%.0f, PageLength=%.0f",
        doc.PageBottom, doc.PageTop, doc.PageLength);
   }
 
@@ -2014,7 +2014,7 @@ imagetopdf(int inputfd,         /* I - File descriptor input stream */
   }
 
   if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-              "imagetopdf: left=%.2f, top=%.2f", doc.left, doc.top);
+              "cfFilterImageToPDF: left=%.2f, top=%.2f", doc.left, doc.top);
 
   if (doc.Collate)
   {
@@ -2024,13 +2024,13 @@ imagetopdf(int inputfd,         /* I - File descriptor input stream */
     if ((contentsObjs = malloc(sizeof(int)*doc.xpages*doc.ypages)) == NULL)
     {
       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                  "imagetopdf: Can't allocate contentsObjs");
+                  "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,
-                  "imagetopdf: Can't allocate imgObjs");
+                  "cfFilterImageToPDF: Can't allocate imgObjs");
       goto out_of_memory;
     }
     for (doc.xpage = 0; doc.xpage < doc.xpages; doc.xpage ++)
@@ -2042,7 +2042,7 @@ imagetopdf(int inputfd,         /* I - File descriptor input stream */
        if (iscanceled && iscanceled(icd))
        {
          if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                      "imagetopdf: Job canceled");
+                      "cfFilterImageToPDF: Job canceled");
          goto canceled;
        }
 
@@ -2068,7 +2068,7 @@ imagetopdf(int inputfd,         /* I - File descriptor input stream */
          if (iscanceled && iscanceled(icd))
          {
            if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                        "imagetopdf: Job canceled");
+                        "cfFilterImageToPDF: Job canceled");
            goto canceled;
          }
 
@@ -2105,7 +2105,7 @@ imagetopdf(int inputfd,         /* I - File descriptor input stream */
        if (iscanceled && iscanceled(icd))
        {
          if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                      "imagetopdf: Job canceled");
+                      "cfFilterImageToPDF: Job canceled");
          goto canceled;
        }
 
@@ -2127,7 +2127,7 @@ imagetopdf(int inputfd,         /* I - File descriptor input stream */
          if (iscanceled && iscanceled(icd))
          {
            if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                        "imagetopdf: Job canceled");
+                        "cfFilterImageToPDF: Job canceled");
            goto canceled;
          }
 
@@ -2149,7 +2149,7 @@ imagetopdf(int inputfd,         /* I - File descriptor input stream */
        if (iscanceled && iscanceled(icd))
        {
          if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                      "imagetopdf: Job canceled");
+                      "cfFilterImageToPDF: Job canceled");
          goto canceled;
        }
 
@@ -2186,7 +2186,7 @@ imagetopdf(int inputfd,         /* I - File descriptor input stream */
  out_of_memory:
 
   if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-              "imagetopdf: Cannot allocate any more memory.");
+              "cfFilterImageToPDF: Cannot allocate any more memory.");
   freeAllObj(&doc);
   cupsImageClose(doc.img);
   fclose(doc.outputfp);
index 1c7bdcd58a4e9e83eb0be04974e446558245c6ba..d61d1d53f81ea58a55e661add55743a103850623 100644 (file)
@@ -14,7 +14,7 @@
  *
  * Contents:
  *
- *   imagetops()        - imagetops filter function
+ *   cfFilterImageToPS()        - imagetops filter function
  *   WriteCommon()      - Write common procedures...
  *   WriteLabelProlog() - Write the prolog with the classification
  *                        and page label.
@@ -73,15 +73,15 @@ static void ps_ascii85(FILE *outputfp, cups_ib_t *, int, int);
 
 
 /*
- * 'imagetops()' - Filter function to convert many common image file
+ * 'cfFilterImageToPS()' - Filter function to convert many common image file
  *                 formats into PostScript
  */
 
 int                             /* O - Error status */
-imagetops(int inputfd,         /* I - File descriptor input stream */
+cfFilterImageToPS(int inputfd,         /* I - File descriptor input stream */
          int outputfd,        /* I - File descriptor output stream */
          int inputseekable,   /* I - Is input stream seekable? (unused) */
-         filter_data_t *data, /* I - Job and printer data */
+         cf_filter_data_t *data, /* I - Job and printer data */
          void *parameters)    /* I - Filter-specific parameters (unused) */
 {
   imagetops_doc_t      doc;            /* Document information */
@@ -141,7 +141,7 @@ imagetops(int inputfd,         /* I - File descriptor input stream */
   int           bytes;
   filter_logfunc_t log = data->logfunc;
   void          *ld = data->logdata;
-  filter_iscanceledfunc_t iscanceled = data->iscanceledfunc;
+  cf_filter_iscanceledfunc_t iscanceled = data->iscanceledfunc;
   void          *icd = data->iscanceleddata;
 
 
@@ -176,7 +176,7 @@ imagetops(int inputfd,         /* I - File descriptor input stream */
     if (!iscanceled || !iscanceled(icd))
     {
       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                  "imagetops: Unable to open input data stream.");
+                  "cfFilterImageToPS: Unable to open input data stream.");
     }
 
     return (1);
@@ -190,13 +190,13 @@ imagetops(int inputfd,         /* I - File descriptor input stream */
     if ((fd = cupsTempFd(tempfile, sizeof(tempfile))) < 0)
     {
       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                  "imagetops: Unable to copy input: %s",
+                  "cfFilterImageToPS: Unable to copy input: %s",
                   strerror(errno));
       return (1);
     }
 
     if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                "imagetops: Copying input to temp file \"%s\"",
+                "cfFilterImageToPS: Copying input to temp file \"%s\"",
                 tempfile);
 
     while ((bytes = fread(buf, 1, sizeof(buf), inputfp)) > 0)
@@ -214,7 +214,7 @@ imagetops(int inputfd,         /* I - File descriptor input stream */
       if (!iscanceled || !iscanceled(icd))
       {
        if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                    "imagetops: Unable to open temporary file.");
+                    "cfFilterImageToPS: Unable to open temporary file.");
       }
 
       unlink(tempfile);
@@ -231,7 +231,7 @@ imagetops(int inputfd,         /* I - File descriptor input stream */
     if (!iscanceled || !iscanceled(icd))
     {
       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                  "imagetops: Unable to open output data stream.");
+                  "cfFilterImageToPS: Unable to open output data stream.");
     }
 
     fclose(inputfp);
@@ -267,7 +267,7 @@ imagetops(int inputfd,         /* I - File descriptor input stream */
   */
 
   ppd = data->ppd;
-  filterSetCommonOptions(ppd, num_options, options, 0,
+  cfFilterSetCommonOptions(ppd, num_options, options, 0,
                         &doc.Orientation, &doc.Duplex,
                         &doc.LanguageLevel, &doc.Color,
                         &doc.PageLeft, &doc.PageRight,
@@ -275,7 +275,7 @@ imagetops(int inputfd,         /* I - File descriptor input stream */
                         &doc.PageWidth, &doc.PageLength,
                         log, ld);
 
-  /* The filterSetCommonOptions() does not set doc.Color
+  /* The cfFilterSetCommonOptions() does not set doc.Color
      according to option settings (user's demand for color/gray),
      so we parse the options and set the mode here */
   cupsRasterParseIPPOptions(&h, data, 0, 1);
@@ -643,7 +643,7 @@ imagetops(int inputfd,         /* I - File descriptor input stream */
   if (img == NULL)
   {
     if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                "imagetops: The print file could not be opened - %s",
+                "cfFilterImageToPS: The print file could not be opened - %s",
                 strerror(errno));
     return (1);
   }
@@ -664,7 +664,7 @@ imagetops(int inputfd,         /* I - File descriptor input stream */
     yppi = xppi;
 
   if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-              "imagetops: Before scaling: xppi=%d, yppi=%d, zoom=%.2f",
+              "cfFilterImageToPS: Before scaling: xppi=%d, yppi=%d, zoom=%.2f",
               xppi, yppi, zoom);
 
   if (xppi > 0)
@@ -685,14 +685,14 @@ imagetops(int inputfd,         /* I - File descriptor input stream */
     }
 
     if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                "imagetops: Before scaling: xprint=%.1f, yprint=%.1f",
+                "cfFilterImageToPS: Before scaling: xprint=%.1f, yprint=%.1f",
                 xprint, yprint);
 
     xinches = (float)cupsImageGetWidth(img) / (float)xppi;
     yinches = (float)cupsImageGetHeight(img) / (float)yppi;
 
     if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                "imagetops: Image size is %.1f x %.1f inches...",
+                "cfFilterImageToPS: Image size is %.1f x %.1f inches...",
                 xinches, yinches);
 
     if ((val = cupsGetOption("natural-scaling", num_options, options)) != NULL)
@@ -709,7 +709,7 @@ imagetops(int inputfd,         /* I - File descriptor input stream */
       */
 
       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                  "imagetops: Auto orientation...");
+                  "cfFilterImageToPS: Auto orientation...");
 
       if ((xinches > xprint || yinches > yprint) &&
           xinches <= yprint && yinches <= xprint)
@@ -719,7 +719,7 @@ imagetops(int inputfd,         /* I - File descriptor input stream */
        */
 
        if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                    "imagetops: Using landscape orientation...");
+                    "cfFilterImageToPS: Using landscape orientation...");
 
        doc.Orientation = (doc.Orientation + 1) & 3;
        xsize       = yprint;
@@ -739,11 +739,11 @@ imagetops(int inputfd,         /* I - File descriptor input stream */
     aspect = (float)cupsImageGetYPPI(img) / (float)cupsImageGetXPPI(img);
 
     if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                "imagetops: Before scaling: xprint=%.1f, yprint=%.1f",
+                "cfFilterImageToPS: Before scaling: xprint=%.1f, yprint=%.1f",
                 xprint, yprint);
 
     if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                "imagetops: cupsImageGetXPPI(img) = %d, "
+                "cfFilterImageToPS: cupsImageGetXPPI(img) = %d, "
                 "cupsImageGetYPPI(img) = %d, aspect = %f",
                 cupsImageGetXPPI(img), cupsImageGetYPPI(img), aspect);
 
@@ -769,10 +769,10 @@ imagetops(int inputfd,         /* I - File descriptor input stream */
     }
 
     if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                "imagetops: Portrait size is %.2f x %.2f inches",
+                "cfFilterImageToPS: Portrait size is %.2f x %.2f inches",
                 xsize, ysize);
     if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                "imagetops: Landscape size is %.2f x %.2f inches",
+                "cfFilterImageToPS: Landscape size is %.2f x %.2f inches",
                 xsize2, ysize2);
 
     if (cupsGetOption("orientation-requested", num_options, options) == NULL &&
@@ -784,7 +784,7 @@ imagetops(int inputfd,         /* I - File descriptor input stream */
       */
 
       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                  "imagetops: Auto orientation...");
+                  "cfFilterImageToPS: Auto orientation...");
 
       if ((xsize * ysize) < (xsize2 * xsize2))
       {
@@ -793,7 +793,7 @@ imagetops(int inputfd,         /* I - File descriptor input stream */
        */
 
        if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                    "imagetops: Using landscape orientation...");
+                    "cfFilterImageToPS: Using landscape orientation...");
 
        doc.Orientation = 1;
        xinches     = xsize2;
@@ -808,7 +808,7 @@ imagetops(int inputfd,         /* I - File descriptor input stream */
        */
 
        if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                    "imagetops: Using portrait orientation...");
+                    "cfFilterImageToPS: Using portrait orientation...");
 
        doc.Orientation = 0;
        xinches     = xsize;
@@ -818,7 +818,7 @@ imagetops(int inputfd,         /* I - File descriptor input stream */
     else if (doc.Orientation & 1)
     {
       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                  "imagetops: Using landscape orientation...");
+                  "cfFilterImageToPS: Using landscape orientation...");
 
       xinches     = xsize2;
       yinches     = ysize2;
@@ -828,7 +828,7 @@ imagetops(int inputfd,         /* I - File descriptor input stream */
     else
     {
       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                  "imagetops: Using portrait orientation...");
+                  "cfFilterImageToPS: Using portrait orientation...");
 
       xinches     = xsize;
       yinches     = ysize;
@@ -849,7 +849,7 @@ imagetops(int inputfd,         /* I - File descriptor input stream */
   yprint = yinches / ypages;
 
   if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-              "imagetops: xpages = %dx%.2fin, ypages = %dx%.2fin",
+              "cfFilterImageToPS: xpages = %dx%.2fin, ypages = %dx%.2fin",
               xpages, xprint, ypages, yprint);
 
  /*
@@ -897,7 +897,7 @@ imagetops(int inputfd,         /* I - File descriptor input stream */
       length = ppd->custom_min[1];
 
     if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                "imagetops: Updated custom page size to %.2f x %.2f inches...",
+                "cfFilterImageToPS: Updated custom page size to %.2f x %.2f inches...",
                 width / 72.0, length / 72.0);
 
    /*
@@ -1041,7 +1041,7 @@ imagetops(int inputfd,         /* I - File descriptor input stream */
   if (row == NULL)
   {
     log(ld, FILTER_LOGLEVEL_ERROR,
-       "imagetops: Could not allocate memory.");
+       "cfFilterImageToPS: Could not allocate memory.");
     cupsImageClose(img);
     return (2);
   }
@@ -1049,15 +1049,15 @@ imagetops(int inputfd,         /* I - File descriptor input stream */
   if (log)
   {
     log(ld, FILTER_LOGLEVEL_DEBUG,
-       "imagetops: XPosition=%d, YPosition=%d, Orientation=%d",
+       "cfFilterImageToPS: XPosition=%d, YPosition=%d, Orientation=%d",
        XPosition, YPosition, doc.Orientation);
     log(ld, FILTER_LOGLEVEL_DEBUG,
-       "imagetops: xprint=%.1f, yprint=%.1f", xprint, yprint);
+       "cfFilterImageToPS: xprint=%.1f, yprint=%.1f", xprint, yprint);
     log(ld, FILTER_LOGLEVEL_DEBUG,
-       "imagetops: PageLeft=%.0f, PageRight=%.0f, PageWidth=%.0f",
+       "cfFilterImageToPS: PageLeft=%.0f, PageRight=%.0f, PageWidth=%.0f",
        doc.PageLeft, doc.PageRight, doc.PageWidth);
     log(ld, FILTER_LOGLEVEL_DEBUG,
-       "imagetops: PageBottom=%.0f, PageTop=%.0f, PageLength=%.0f",
+       "cfFilterImageToPS: PageBottom=%.0f, PageTop=%.0f, PageLength=%.0f",
        doc.PageBottom, doc.PageTop, doc.PageLength);
   }
 
@@ -1177,7 +1177,7 @@ imagetops(int inputfd,         /* I - File descriptor input stream */
   }
 
   if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-              "imagetops: left=%.2f, top=%.2f", left, top);
+              "cfFilterImageToPS: left=%.2f, top=%.2f", left, top);
 
   for (page = 1; Copies > 0; Copies --)
     for (xpage = 0; xpage < xpages; xpage ++)
@@ -1186,7 +1186,7 @@ imagetops(int inputfd,         /* I - File descriptor input stream */
        if (iscanceled && iscanceled(icd))
        {
          if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                      "imagetops: Job canceled");
+                      "cfFilterImageToPS: Job canceled");
          goto canceled;
        }
 
@@ -1195,7 +1195,7 @@ imagetops(int inputfd,         /* I - File descriptor input stream */
              "PAGE: %d %d", page, realcopies);
 
        if (log) log(ld, FILTER_LOGLEVEL_INFO,
-                    "imagetops: Printing page %d.", page);
+                    "cfFilterImageToPS: Printing page %d.", page);
 
         fprintf(doc.outputfp, "%%%%Page: %d %d\n", page, page);
 
@@ -1339,7 +1339,7 @@ imagetops(int inputfd,         /* I - File descriptor input stream */
   }
 
   if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-              "imagetops: Printing completed.", page);
+              "cfFilterImageToPS: Printing completed.", page);
 
  /*
   * Close files...
index fb02dd56900048881b7f4775c7b456505daf825b..fc1adfbd411fc0b8ef0e5ff926f12ee3bc170919 100644 (file)
@@ -11,7 +11,7 @@
  *
  * Contents:
  *
- *   imagetoraster() - The image conversion filter function
+ *   cfFilterImageToRaster() - The image conversion filter function
  *   blank_line()    - Clear a line buffer to the blank value...
  *   format_CMY()    - Convert image data to CMY.
  *   format_CMYK()   - Convert image data to CMYK.
@@ -175,15 +175,15 @@ static void       make_lut(cups_ib_t *, int, float, float);
 
 
 /*
- * 'imagetoraster()' - Filter function to convert many common image file
+ * 'cfFilterImageToRaster()' - Filter function to convert many common image file
  *                     formats into CUPS Raster
  */
 
 int                                /* O - Error status */
-imagetoraster(int inputfd,         /* I - File descriptor input stream */
+cfFilterImageToRaster(int inputfd,         /* I - File descriptor input stream */
              int outputfd,        /* I - File descriptor output stream */
              int inputseekable,   /* I - Is input stream seekable? (unused) */
-             filter_data_t *data, /* I - Job and printer data */
+             cf_filter_data_t *data, /* I - Job and printer data */
              void *parameters)    /* I - Filter-specific parameters (unused) */
 {
   imagetoraster_doc_t  doc;            /* Document information */
@@ -254,7 +254,7 @@ imagetoraster(int inputfd,         /* I - File descriptor input stream */
   int                   cropfit = 0;   /* -o crop-to-fit */
   filter_logfunc_t      log = data->logfunc;
   void                  *ld = data->logdata;
-  filter_iscanceledfunc_t iscanceled = data->iscanceledfunc;
+  cf_filter_iscanceledfunc_t iscanceled = data->iscanceledfunc;
   void                  *icd = data->iscanceleddata;
   ipp_t                 *printer_attrs = data->printer_attrs;
   ipp_t                 *job_attrs = data->job_attrs;
@@ -268,10 +268,10 @@ imagetoraster(int inputfd,         /* I - File descriptor input stream */
                        customRight = 0.0,              /*  ppd->custom_margin[2]  */
                        customTop = 0.0;                /*  ppd->custom_margin[3]  */
   char                         defSize[41];
-  filter_out_format_t   outformat;
+  cf_filter_out_format_t   outformat;
 
-  /* Note: With the OUTPUT_FORMAT_APPLE_RASTER,
-     OUTPUT_FORMAT_PWG_RASTER, or OUTPUT_FORMAT_PCLM selections the
+  /* Note: With the CF_FILTER_OUT_FORMAT_APPLE_RASTER,
+     CF_FILTER_OUT_FORMAT_PWG_RASTER, or CF_FILTER_OUT_FORMAT_PCLM selections the
      output is actually CUPS Raster but information about available
      color spaces and depths are taken from the urf-supported or
      pwg-raster-document-type-supported printer IPP attributes or
@@ -281,20 +281,20 @@ imagetoraster(int inputfd,         /* I - File descriptor input stream */
      Raster and PWG Raster output support to this filter. */
 
   if (parameters) {
-    outformat = *(filter_out_format_t *)parameters;
-    if (outformat != OUTPUT_FORMAT_PCLM &&
-       outformat != OUTPUT_FORMAT_CUPS_RASTER &&
-       outformat != OUTPUT_FORMAT_PWG_RASTER &&
-       outformat != OUTPUT_FORMAT_APPLE_RASTER)
-      outformat = OUTPUT_FORMAT_CUPS_RASTER;
+    outformat = *(cf_filter_out_format_t *)parameters;
+    if (outformat != CF_FILTER_OUT_FORMAT_PCLM &&
+       outformat != CF_FILTER_OUT_FORMAT_CUPS_RASTER &&
+       outformat != CF_FILTER_OUT_FORMAT_PWG_RASTER &&
+       outformat != CF_FILTER_OUT_FORMAT_APPLE_RASTER)
+      outformat = CF_FILTER_OUT_FORMAT_CUPS_RASTER;
   } else
-    outformat = OUTPUT_FORMAT_CUPS_RASTER;
+    outformat = CF_FILTER_OUT_FORMAT_CUPS_RASTER;
 
   if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-              "imagetoraster: Final output format: %s",
-              (outformat == OUTPUT_FORMAT_CUPS_RASTER ? "CUPS Raster" :
-               (outformat == OUTPUT_FORMAT_PWG_RASTER ? "PWG Raster" :
-                (outformat == OUTPUT_FORMAT_APPLE_RASTER ? "Apple Raster" :
+              "cfFilterImageToRaster: Final output format: %s",
+              (outformat == CF_FILTER_OUT_FORMAT_CUPS_RASTER ? "CUPS Raster" :
+               (outformat == CF_FILTER_OUT_FORMAT_PWG_RASTER ? "PWG Raster" :
+                (outformat == CF_FILTER_OUT_FORMAT_APPLE_RASTER ? "Apple Raster" :
                  "PCLm"))));
 
   if (printer_attrs != NULL) {
@@ -347,7 +347,7 @@ imagetoraster(int inputfd,         /* I - File descriptor input stream */
     if (!iscanceled || !iscanceled(icd))
     {
       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                  "imagetoraster: Unable to open input data stream.");
+                  "cfFilterImageToRaster: Unable to open input data stream.");
     }
 
     return (1);
@@ -361,14 +361,14 @@ imagetoraster(int inputfd,         /* I - File descriptor input stream */
     if ((fd = cupsTempFd(tempfile, sizeof(tempfile))) < 0)
     {
       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                  "imagetoraster: Unable to copy input: %s",
+                  "cfFilterImageToRaster: Unable to copy input: %s",
                   strerror(errno));
       fclose(fp);
       return (1);
     }
 
     if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                "imagetoraster: Copying input to temp file \"%s\"",
+                "cfFilterImageToRaster: Copying input to temp file \"%s\"",
                 tempfile);
 
     while ((bytes = fread(buf, 1, sizeof(buf), fp)) > 0)
@@ -386,7 +386,7 @@ imagetoraster(int inputfd,         /* I - File descriptor input stream */
       if (!iscanceled || !iscanceled(icd))
       {
        if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                    "imagetoraster: Unable to open temporary file.");
+                    "cfFilterImageToRaster: Unable to open temporary file.");
       }
 
       unlink(tempfile);
@@ -413,7 +413,7 @@ imagetoraster(int inputfd,         /* I - File descriptor input stream */
   */
 
   cupsRasterPrepareHeader(&header, data, outformat,
-                         OUTPUT_FORMAT_CUPS_RASTER, 1, &cspace);
+                         CF_FILTER_OUT_FORMAT_CUPS_RASTER, 1, &cspace);
   ppd = data->ppd;
   doc.Orientation = header.Orientation;
   doc.Duplex = header.Duplex;
@@ -441,30 +441,30 @@ imagetoraster(int inputfd,         /* I - File descriptor input stream */
   if (log)
   {
     log(ld, FILTER_LOGLEVEL_DEBUG,
-       "imagetoraster: doc.color = %d", doc.Color);
+       "cfFilterImageToRaster: doc.color = %d", doc.Color);
     log(ld, FILTER_LOGLEVEL_DEBUG,
-       "imagetoraster: doc.Orientation = %d", doc.Orientation);
+       "cfFilterImageToRaster: doc.Orientation = %d", doc.Orientation);
     log(ld, FILTER_LOGLEVEL_DEBUG,
-       "imagetoraster: doc.Duplex = %d", doc.Duplex);
+       "cfFilterImageToRaster: doc.Duplex = %d", doc.Duplex);
     log(ld, FILTER_LOGLEVEL_DEBUG,
-       "imagetoraster: doc.PageWidth = %.1f", doc.PageWidth);
+       "cfFilterImageToRaster: doc.PageWidth = %.1f", doc.PageWidth);
     log(ld, FILTER_LOGLEVEL_DEBUG,
-       "imagetoraster: doc.PageLength = %.1f", doc.PageLength);
+       "cfFilterImageToRaster: doc.PageLength = %.1f", doc.PageLength);
     log(ld, FILTER_LOGLEVEL_DEBUG,
-       "imagetoraster: doc.PageLeft = %.1f", doc.PageLeft);
+       "cfFilterImageToRaster: doc.PageLeft = %.1f", doc.PageLeft);
     log(ld, FILTER_LOGLEVEL_DEBUG,
-       "imagetoraster: doc.PageRight = %.1f", doc.PageRight);
+       "cfFilterImageToRaster: doc.PageRight = %.1f", doc.PageRight);
     log(ld, FILTER_LOGLEVEL_DEBUG,
-       "imagetoraster: doc.PageTop = %.1f", doc.PageTop);
+       "cfFilterImageToRaster: doc.PageTop = %.1f", doc.PageTop);
     log(ld, FILTER_LOGLEVEL_DEBUG,
-       "imagetoraster: doc.PageBottom = %.1f", doc.PageBottom);
+       "cfFilterImageToRaster: doc.PageBottom = %.1f", doc.PageBottom);
   }
 
   /*  Find print-rendering-intent */
 
   getPrintRenderIntent(data, &header);
   if(log) log(ld, FILTER_LOGLEVEL_DEBUG,
-             "imagetoraster: Print rendering intent = %s",
+             "cfFilterImageToRaster: Print rendering intent = %s",
              header.cupsRenderingIntent);
 
   if ((val = cupsGetOption("multiple-document-handling",
@@ -779,7 +779,7 @@ imagetoraster(int inputfd,         /* I - File descriptor input stream */
     case CUPS_CSPACE_DEVICEE :
     case CUPS_CSPACE_DEVICEF :
         if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                    "imagetoraster: Colorspace %d not supported.",
+                    "cfFilterImageToRaster: Colorspace %d not supported.",
                     header.cupsColorSpace);
        if (!inputseekable)
          unlink(tempfile);
@@ -819,14 +819,14 @@ imagetoraster(int inputfd,         /* I - File descriptor input stream */
   else if (ppd != NULL && !cm_disabled)
   {
     if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                "imagetoraster: Searching for profile \"%s/%s\"...",
+                "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,
-                  "imagetoraster: \"%s/%s\" = ", profile->resolution,
+                  "cfFilterImageToRaster: \"%s/%s\" = ", profile->resolution,
                   profile->media_type);
 
       if ((strcmp(profile->resolution, resolution) == 0 ||
@@ -835,12 +835,12 @@ imagetoraster(int inputfd,         /* I - File descriptor input stream */
            profile->media_type[0] == '-'))
       {
        if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                    "imagetoraster:    MATCH");
+                    "cfFilterImageToRaster:    MATCH");
        break;
       }
       else
        if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                    "imagetoraster:    no.");
+                    "cfFilterImageToRaster:    no.");
     }
 
    /*
@@ -869,7 +869,7 @@ imagetoraster(int inputfd,         /* I - File descriptor input stream */
   */
 
   if (log) log(ld, FILTER_LOGLEVEL_INFO,
-              "imagetoraster: Loading print file.");
+              "cfFilterImageToRaster: Loading print file.");
 
   if (header.cupsColorSpace == CUPS_CSPACE_CIEXYZ ||
       header.cupsColorSpace == CUPS_CSPACE_CIELab ||
@@ -1154,7 +1154,7 @@ imagetoraster(int inputfd,         /* I - File descriptor input stream */
   if (img == NULL)
   {
     if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                "imagetoraster: The print file could not be opened.");
+                "cfFilterImageToRaster: The print file could not be opened.");
     return (1);
   }
 
@@ -1172,7 +1172,7 @@ imagetoraster(int inputfd,         /* I - File descriptor input stream */
     yppi = xppi;
 
   if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-              "imagetoraster: Before scaling: xppi=%d, yppi=%d, zoom=%.2f",
+              "cfFilterImageToRaster: Before scaling: xppi=%d, yppi=%d, zoom=%.2f",
               xppi, yppi, zoom);
 
   if (xppi > 0)
@@ -1193,14 +1193,14 @@ imagetoraster(int inputfd,         /* I - File descriptor input stream */
     }
 
     if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                "imagetoraster: Before scaling: xprint=%.1f, yprint=%.1f",
+                "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,
-                "imagetoraster: Image size is %.1f x %.1f inches...",
+                "cfFilterImageToRaster: Image size is %.1f x %.1f inches...",
                 xinches, yinches);
 
     if ((val = cupsGetOption("natural-scaling", num_options, options)) != NULL)
@@ -1217,7 +1217,7 @@ imagetoraster(int inputfd,         /* I - File descriptor input stream */
       */
 
       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                  "imagetoraster: Auto orientation...");
+                  "cfFilterImageToRaster: Auto orientation...");
 
       if ((xinches > xprint || yinches > yprint) &&
           xinches <= yprint && yinches <= xprint)
@@ -1227,7 +1227,7 @@ imagetoraster(int inputfd,         /* I - File descriptor input stream */
        */
 
        if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                    "imagetoraster: Using landscape orientation...");
+                    "cfFilterImageToRaster: Using landscape orientation...");
 
        doc.Orientation = (doc.Orientation + 1) & 3;
        xsize       = yprint;
@@ -1247,11 +1247,11 @@ imagetoraster(int inputfd,         /* I - File descriptor input stream */
     aspect = (float)img->yppi / (float)img->xppi;
 
     if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                "imagetoraster: Before scaling: xprint=%.1f, yprint=%.1f",
+                "cfFilterImageToRaster: Before scaling: xprint=%.1f, yprint=%.1f",
                 xprint, yprint);
 
     if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                "imagetoraster: img->xppi = %d, img->yppi = %d, aspect = %f",
+                "cfFilterImageToRaster: img->xppi = %d, img->yppi = %d, aspect = %f",
                 img->xppi, img->yppi, aspect);
 
     xsize = xprint * zoom;
@@ -1273,10 +1273,10 @@ imagetoraster(int inputfd,         /* I - File descriptor input stream */
     }
 
     if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                "imagetoraster: Portrait size is %.2f x %.2f inches",
+                "cfFilterImageToRaster: Portrait size is %.2f x %.2f inches",
                 xsize, ysize);
     if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                "imagetoraster: Landscape size is %.2f x %.2f inches",
+                "cfFilterImageToRaster: Landscape size is %.2f x %.2f inches",
                 xsize2, ysize2);
 
     if (cupsGetOption("orientation-requested", num_options, options) == NULL &&
@@ -1288,7 +1288,7 @@ imagetoraster(int inputfd,         /* I - File descriptor input stream */
       */
 
       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                  "imagetoraster: Auto orientation...");
+                  "cfFilterImageToRaster: Auto orientation...");
 
       if ((xsize * ysize) < (xsize2 * ysize2))
       {
@@ -1297,7 +1297,7 @@ imagetoraster(int inputfd,         /* I - File descriptor input stream */
        */
 
        if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                    "imagetoraster: Using landscape orientation...");
+                    "cfFilterImageToRaster: Using landscape orientation...");
 
        doc.Orientation = 1;
        xinches     = xsize2;
@@ -1312,7 +1312,7 @@ imagetoraster(int inputfd,         /* I - File descriptor input stream */
        */
 
        if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                    "imagetoraster: Using portrait orientation...");
+                    "cfFilterImageToRaster: Using portrait orientation...");
 
        doc.Orientation = 0;
        xinches     = xsize;
@@ -1322,7 +1322,7 @@ imagetoraster(int inputfd,         /* I - File descriptor input stream */
     else if (doc.Orientation & 1)
     {
       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                  "imagetoraster: Using landscape orientation...");
+                  "cfFilterImageToRaster: Using landscape orientation...");
 
       xinches     = xsize2;
       yinches     = ysize2;
@@ -1332,7 +1332,7 @@ imagetoraster(int inputfd,         /* I - File descriptor input stream */
     else
     {
       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                  "imagetoraster: Using portrait orientation...");
+                  "cfFilterImageToRaster: Using portrait orientation...");
 
       xinches     = xsize;
       yinches     = ysize;
@@ -1353,7 +1353,7 @@ imagetoraster(int inputfd,         /* I - File descriptor input stream */
   yprint = yinches / ypages;
 
   if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-              "imagetoraster: xpages = %dx%.2fin, ypages = %dx%.2fin",
+              "cfFilterImageToRaster: xpages = %dx%.2fin, ypages = %dx%.2fin",
               xpages, xprint, ypages, yprint);
 
  /*
@@ -1432,7 +1432,7 @@ imagetoraster(int inputfd,         /* I - File descriptor input stream */
    }
 
    if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-               "imagetoraster: Updated custom page size to %.2f x %.2f "
+               "cfFilterImageToRaster: Updated custom page size to %.2f x %.2f "
                "inches...",
                width / 72.0, length / 72.0);
 
@@ -1510,10 +1510,10 @@ imagetoraster(int inputfd,         /* I - File descriptor input stream */
   header.Margins[1] = doc.PageBottom;
 
   if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-              "imagetoraster: PageSize = [%d %d]", header.PageSize[0],
+              "cfFilterImageToRaster: PageSize = [%d %d]", header.PageSize[0],
               header.PageSize[1]);
   if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-              "imagetoraster: PageLeft = %f, PageRight = %f, "
+              "cfFilterImageToRaster: PageLeft = %f, PageRight = %f, "
               "PageBottom = %f, PageTop = %f",
               doc.PageLeft, doc.PageRight, doc.PageBottom, doc.PageTop);
 
@@ -1678,7 +1678,7 @@ imagetoraster(int inputfd,         /* I - File descriptor input stream */
   header.ImagingBoundingBox[3] = header.cupsImagingBBox[3];
 
   if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-              "imagetoraster: Orientation: %d, XPosition: %d, YPosition: %d, "
+              "cfFilterImageToRaster: Orientation: %d, XPosition: %d, YPosition: %d, "
               "ImagingBoundingBox = [%d %d %d %d]",
               doc.Orientation, doc.XPosition, doc.YPosition,
               header.ImagingBoundingBox[0], header.ImagingBoundingBox[1],
@@ -1750,21 +1750,21 @@ imagetoraster(int inputfd,         /* I - File descriptor input stream */
 
   if (log) {
     log(ld, FILTER_LOGLEVEL_DEBUG,
-       "imagetoraster: cupsWidth = %d", header.cupsWidth);
+       "cfFilterImageToRaster: cupsWidth = %d", header.cupsWidth);
     log(ld, FILTER_LOGLEVEL_DEBUG,
-       "imagetoraster: cupsHeight = %d", header.cupsHeight);
+       "cfFilterImageToRaster: cupsHeight = %d", header.cupsHeight);
     log(ld, FILTER_LOGLEVEL_DEBUG,
-       "imagetoraster: cupsBitsPerColor = %d", header.cupsBitsPerColor);
+       "cfFilterImageToRaster: cupsBitsPerColor = %d", header.cupsBitsPerColor);
     log(ld, FILTER_LOGLEVEL_DEBUG,
-       "imagetoraster: cupsBitsPerPixel = %d", header.cupsBitsPerPixel);
+       "cfFilterImageToRaster: cupsBitsPerPixel = %d", header.cupsBitsPerPixel);
     log(ld, FILTER_LOGLEVEL_DEBUG,
-       "imagetoraster: cupsBytesPerLine = %d", header.cupsBytesPerLine);
+       "cfFilterImageToRaster: cupsBytesPerLine = %d", header.cupsBytesPerLine);
     log(ld, FILTER_LOGLEVEL_DEBUG,
-       "imagetoraster: cupsColorOrder = %d", header.cupsColorOrder);
+       "cfFilterImageToRaster: cupsColorOrder = %d", header.cupsColorOrder);
     log(ld, FILTER_LOGLEVEL_DEBUG,
-       "imagetoraster: cupsColorSpace = %d", header.cupsColorSpace);
+       "cfFilterImageToRaster: cupsColorSpace = %d", header.cupsColorSpace);
     log(ld, FILTER_LOGLEVEL_DEBUG,
-       "imagetoraster: img->colorspace = %d", img->colorspace);
+       "cfFilterImageToRaster: img->colorspace = %d", img->colorspace);
   }
 
   row = malloc(2 * header.cupsBytesPerLine);
@@ -1777,12 +1777,12 @@ imagetoraster(int inputfd,         /* I - File descriptor input stream */
        if (iscanceled && iscanceled(icd))
         {
          if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                      "imagetoraster: Job canceled");
+                      "cfFilterImageToRaster: Job canceled");
          goto canceled;
        }
 
        if (log) log(ld, FILTER_LOGLEVEL_INFO,
-                    "imagetoraster: Formatting page %d.", page);
+                    "cfFilterImageToRaster: Formatting page %d.", page);
 
        if (doc.Orientation & 1)
        {
@@ -1833,7 +1833,7 @@ imagetoraster(int inputfd,         /* I - File descriptor input stream */
              y /= 2;
 
            if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                        "imagetoraster: Writing %d leading blank lines...",
+                        "cfFilterImageToRaster: Writing %d leading blank lines...",
                         y);
 
            for (; y > 0; y --)
@@ -1842,7 +1842,7 @@ imagetoraster(int inputfd,         /* I - File descriptor input stream */
                      header.cupsBytesPerLine)
              {
                if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                            "imagetoraster: Unable to send raster data.");
+                            "cfFilterImageToRaster: Unable to send raster data.");
                cupsImageClose(img);
                return (1);
              }
@@ -1941,7 +1941,7 @@ imagetoraster(int inputfd,         /* I - File descriptor input stream */
                                      header.cupsBytesPerLine)
            {
              if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                          "imagetoraster: Unable to send raster data.");
+                          "cfFilterImageToRaster: Unable to send raster data.");
              cupsImageClose(img);
              return (1);
            }
@@ -1974,7 +1974,7 @@ imagetoraster(int inputfd,         /* I - File descriptor input stream */
              y = y - y / 2;
 
            if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                        "imagetoraster: Writing %d trailing blank lines...",
+                        "cfFilterImageToRaster: Writing %d trailing blank lines...",
                         y);
 
            for (; y > 0; y --)
@@ -1983,7 +1983,7 @@ imagetoraster(int inputfd,         /* I - File descriptor input stream */
                      header.cupsBytesPerLine)
              {
                if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                            "imagetoraster: Unable to send raster data.");
+                            "cfFilterImageToRaster: Unable to send raster data.");
                cupsImageClose(img);
                return (1);
              }
index 68e75a71526686ff437510286707c52e024dc248..6005507b30362e684de5fa6dc8e58740f5456ddb 100644 (file)
@@ -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, "mupdftopwg: input file cannot be identified");
+  if(log) log(ld, FILTER_LOGLEVEL_DEBUG, "cfFilterMuPDFToPWG: input file cannot be identified");
   return -1;
 }
 
@@ -119,7 +119,7 @@ parse_pdf_header_options(FILE *fp, mupdf_page_header *h)
 
 static void
 add_pdf_header_options(mupdf_page_header   *h,
-                      filter_out_format_t outformat,
+                      cf_filter_out_format_t outformat,
                       cups_array_t        *mupdf_args)
 {
   char tmpstr[1024];
@@ -150,7 +150,7 @@ add_pdf_header_options(mupdf_page_header   *h,
     break;
 
   case CUPS_CSPACE_CMYK:
-    if (outformat == OUTPUT_FORMAT_PWG_RASTER) /* No post-filtering needed */
+    if (outformat == CF_FILTER_OUT_FORMAT_PWG_RASTER) /* No post-filtering needed */
       snprintf(tmpstr, sizeof(tmpstr), "-ccmyk");
     else
       snprintf(tmpstr, sizeof(tmpstr), "-crgb"); /* Post-filtering needed, only
@@ -176,7 +176,7 @@ mutool_spawn (const char *filename,
              int outputfd,
              filter_logfunc_t log,
              void *ld,
-             filter_iscanceledfunc_t iscanceled,
+             cf_filter_iscanceledfunc_t iscanceled,
              void *icd)
 {
   char *argument;
@@ -205,7 +205,7 @@ mutool_spawn (const char *filename,
 
   if (log) {
     /* Debug output: Full mutool command line and environment variables */
-    snprintf(buf, sizeof(buf), "mupdftopwg: mutool command line:");
+    snprintf(buf, sizeof(buf), "cfFilterMuPDFToPWG: mutool command line:");
     for (i = 0; mutoolargv[i]; i ++) {
       if ((strchr(mutoolargv[i],' ')) || (strchr(mutoolargv[i],'\t')))
        apos = "'";
@@ -223,7 +223,7 @@ mutool_spawn (const char *filename,
     errfds[0] = -1;
     errfds[1] = -1;
     if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                "mupdftopwg: Unable to establish stderr pipe for mutool "
+                "cfFilterMuPDFToPWG: Unable to establish stderr pipe for mutool "
                 "call");
     goto out;
   }
@@ -236,7 +236,7 @@ mutool_spawn (const char *filename,
     errfds[0] = -1;
     errfds[1] = -1;
     if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                "mupdftopwg: Unable to set \"close on exec\" flag on read "
+                "cfFilterMuPDFToPWG: Unable to set \"close on exec\" flag on read "
                 "end of the stderr pipe for mutool call");
     goto out;
   }
@@ -245,7 +245,7 @@ mutool_spawn (const char *filename,
     close(errfds[0]);
     close(errfds[1]);
     if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                "mupdftopwg: Unable to set \"close on exec\" flag on write "
+                "cfFilterMuPDFToPWG: Unable to set \"close on exec\" flag on write "
                 "end of the stderr pipe for mutool call");
     goto out;
   }
@@ -257,7 +257,7 @@ mutool_spawn (const char *filename,
       if (errfds[1] != 2) {
        if (dup2(errfds[1], 2) < 0) {
          if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                      "mupdftopwg: Unable to couple pipe with stderr of "
+                      "cfFilterMuPDFToPWG: Unable to couple pipe with stderr of "
                       "mutool process");
          exit(1);
        }
@@ -266,7 +266,7 @@ mutool_spawn (const char *filename,
       close(errfds[0]);
     } else {
       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                  "mupdftopwg: invalid pipe file descriptor to couple with "
+                  "cfFilterMuPDFToPWG: invalid pipe file descriptor to couple with "
                   "stderr of mutool process");
       exit(1);
     }
@@ -276,7 +276,7 @@ mutool_spawn (const char *filename,
       if (outputfd != 1) {
        if (dup2(outputfd, 1) < 0) {
          if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                      "mupdftopwg: Unable to couple stdout of mutool "
+                      "cfFilterMuPDFToPWG: Unable to couple stdout of mutool "
                       "process");
          exit(1);
        }
@@ -284,7 +284,7 @@ mutool_spawn (const char *filename,
       }
     } else {
       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                  "mupdftopwg: Invalid file descriptor to couple with "
+                  "cfFilterMuPDFToPWG: Invalid file descriptor to couple with "
                   "stdout of mutool process");
       exit(1);
     }
@@ -292,12 +292,12 @@ mutool_spawn (const char *filename,
     /* Execute mutool command line ... */
     execvp(filename, mutoolargv);
     if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                "mupdftopwg: Unable to launch mutool: %s: %s", filename,
+                "cfFilterMuPDFToPWG: Unable to launch mutool: %s: %s", filename,
                 strerror(errno));
     exit(1);
   }
   if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-              "mupdftopwg: Started mutool (PID %d)", mutoolpid);
+              "cfFilterMuPDFToPWG: Started mutool (PID %d)", mutoolpid);
 
   close(errfds[1]);
 
@@ -325,7 +325,7 @@ mutool_spawn (const char *filename,
          log_level = FILTER_LOGLEVEL_DEBUG;
          msg = buf;
        }
-       log(ld, log_level, "mupdftopwg: %s", msg);
+       log(ld, log_level, "cfFilterMuPDFToPWG: %s", msg);
       }
     cupsFileClose(logfp);
     /* No need to close the fd errfds[0], as cupsFileClose(fp) does this
@@ -334,7 +334,7 @@ mutool_spawn (const char *filename,
     exit(0);
   }
   if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-              "mupdftopwg: Started logging (PID %d)", errpid);
+              "cfFilterMuPDFToPWG: Started logging (PID %d)", errpid);
 
   close(errfds[0]);
 
@@ -342,7 +342,7 @@ mutool_spawn (const char *filename,
     if ((pid = wait(&wstatus)) < 0) {
       if (errno == EINTR && iscanceled && iscanceled(icd)) {
        if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                    "mupdftopwg: Job canceled, killing mutool ...");
+                    "cfFilterMuPDFToPWG: Job canceled, killing mutool ...");
        kill(mutoolpid, SIGTERM);
        mutoolpid = -1;
        kill(errpid, SIGTERM);
@@ -357,21 +357,21 @@ mutool_spawn (const char *filename,
       if (WIFEXITED(wstatus)) {
        /* Via exit() anywhere or return() in the main() function */
        if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                    "mupdftopwg: %s (PID %d) stopped with status %d",
+                    "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,
-                    "mupdftopwg: %s (PID %d) crashed on signal %d",
+                    "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,
-                  "mupdftopwg: %s (PID %d) exited with no errors.",
+                  "cfFilterMuPDFToPWG: %s (PID %d) exited with no errors.",
                   (pid == mutoolpid ? "mutool" : "Logging"), pid);
       status = 0;
     }
@@ -388,13 +388,14 @@ out:
 
 
 int
-mupdftopwg (int inputfd,         /* I - File descriptor input stream */
-              int outputfd,        /* I - File descriptor output stream */
-              int inputseekable,   /* I - Is input stream seekable? (unused)*/
-              filter_data_t *data, /* I - Job and printer data */
-              void *parameters)    /* I - Filter-specific parameters */
+cfFilterMuPDFToPWG(int inputfd,         /* I - File descriptor input stream */
+                  int outputfd,        /* I - File descriptor output stream */
+                  int inputseekable,   /* I - Is input stream seekable?
+                                              (unused)*/
+                  cf_filter_data_t *data, /* I - Job and printer data */
+                  void *parameters)    /* I - Filter-specific parameters */
 {
-  filter_out_format_t outformat;
+  cf_filter_out_format_t outformat;
   char buf[BUFSIZ];
   char *icc_profile = NULL;
   char tmpstr[1024];
@@ -414,7 +415,7 @@ mupdftopwg (int inputfd,         /* I - File descriptor input stream */
   cf_cm_calibration_t cm_calibrate;
   filter_logfunc_t log = data->logfunc;
   void *ld = data->logdata;
-  filter_iscanceledfunc_t iscanceled = data->iscanceledfunc;
+  cf_filter_iscanceledfunc_t iscanceled = data->iscanceledfunc;
   void *icd = data->iscanceleddata;
   cups_cspace_t cspace = -1;
 
@@ -425,20 +426,20 @@ mupdftopwg (int inputfd,         /* I - File descriptor input stream */
   (void)inputseekable;
 
   if (parameters) {
-    outformat = *(filter_out_format_t *)parameters;
-    if (outformat != OUTPUT_FORMAT_CUPS_RASTER &&
-       outformat != OUTPUT_FORMAT_PWG_RASTER &&
-       outformat != OUTPUT_FORMAT_APPLE_RASTER &&
-       outformat != OUTPUT_FORMAT_PCLM)
-      outformat = OUTPUT_FORMAT_PWG_RASTER;
+    outformat = *(cf_filter_out_format_t *)parameters;
+    if (outformat != CF_FILTER_OUT_FORMAT_CUPS_RASTER &&
+       outformat != CF_FILTER_OUT_FORMAT_PWG_RASTER &&
+       outformat != CF_FILTER_OUT_FORMAT_APPLE_RASTER &&
+       outformat != CF_FILTER_OUT_FORMAT_PCLM)
+      outformat = CF_FILTER_OUT_FORMAT_PWG_RASTER;
   } else
-    outformat = OUTPUT_FORMAT_PWG_RASTER;
+    outformat = CF_FILTER_OUT_FORMAT_PWG_RASTER;
 
   if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-              "mupdftopwg: Output format: %s",
-              (outformat == OUTPUT_FORMAT_CUPS_RASTER ? "CUPS Raster" :
-               (outformat == OUTPUT_FORMAT_PWG_RASTER ? "PWG Raster" :
-                (outformat == OUTPUT_FORMAT_APPLE_RASTER ? "Apple Raster" :
+              "cfFilterMuPDFToPWG: Output format: %s",
+              (outformat == CF_FILTER_OUT_FORMAT_CUPS_RASTER ? "CUPS Raster" :
+               (outformat == CF_FILTER_OUT_FORMAT_PWG_RASTER ? "PWG Raster" :
+                (outformat == CF_FILTER_OUT_FORMAT_APPLE_RASTER ? "Apple Raster" :
                  "PCLM"))));
 
   memset(&sa, 0, sizeof(sa));
@@ -455,14 +456,14 @@ mupdftopwg (int inputfd,         /* I - File descriptor input stream */
 
   fd = cupsTempFd(infilename, 1024);
     if (fd < 0) {
-      if(log) log(ld, FILTER_LOGLEVEL_ERROR, "mupdftopwg: Can't create temporary file");
+      if(log) log(ld, FILTER_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, "mupdftopwg: Can't copy input to temporary file");
+        if(log) log(ld, FILTER_LOGLEVEL_ERROR, "cfFilterMuPDFToPWG: Can't copy input to temporary file");
         close(fd);
         goto out;
       }
@@ -471,13 +472,13 @@ mupdftopwg (int inputfd,         /* I - File descriptor input stream */
   if (!inputfd) {
 
     if (lseek(fd,0,SEEK_SET) < 0) {
-      if(log) log(ld, FILTER_LOGLEVEL_ERROR, "mupdftopwg: Can't rewind temporary file");
+      if(log) log(ld, FILTER_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, "mupdftopwg: Can't open temporary file");
+      if(log) log(ld, FILTER_LOGLEVEL_ERROR, "cfFilterMuPDFToPWG: Can't open temporary file");
       close(fd);
       goto out;
     }
@@ -485,7 +486,7 @@ mupdftopwg (int inputfd,         /* I - File descriptor input stream */
     /* filename is specified */
 
     if ((fp = fdopen(fd,"rb")) == 0) {
-      if(log) log(ld, FILTER_LOGLEVEL_ERROR, "mupdftopwg: Can't open temporary file");
+      if(log) log(ld, FILTER_LOGLEVEL_ERROR, "cfFilterMuPDFToPWG: Can't open temporary file");
       goto out;
     }
   }
@@ -516,11 +517,11 @@ mupdftopwg (int inputfd,         /* I - File descriptor input stream */
   /* mutool parameters */
   mupdf_args = cupsArrayNew(NULL, NULL);
   if (!mupdf_args) {
-    if(log) log(ld, FILTER_LOGLEVEL_ERROR, "mupdftopwg: Unable to allocate memory for mutool arguments array");
+    if(log) log(ld, FILTER_LOGLEVEL_ERROR, "cfFilterMuPDFToPWG: Unable to allocate memory for mutool arguments array");
     goto out;
   }
 
-  if(log) log(ld, FILTER_LOGLEVEL_DEBUG, "mupdftopwg: command: %s",
+  if(log) log(ld, FILTER_LOGLEVEL_DEBUG, "cfFilterMuPDFToPWG: command: %s",
              CUPS_MUTOOL);
   snprintf(tmpstr, sizeof(tmpstr), "%s", CUPS_MUTOOL);
   cupsArrayAdd(mupdf_args, strdup(tmpstr));
@@ -539,7 +540,7 @@ mupdftopwg (int inputfd,         /* I - File descriptor input stream */
      From the header h only cupsWidth/cupsHeight (dimensions in pixels),
      resolution, and color space are used here. */
   cupsRasterPrepareHeader(&h, data, outformat,
-                         OUTPUT_FORMAT_PWG_RASTER, 1, &cspace);
+                         CF_FILTER_OUT_FORMAT_PWG_RASTER, 1, &cspace);
 
   if ((h.HWResolution[0] == 100) && (h.HWResolution[1] == 100)) {
     /* No "Resolution" option */
@@ -586,7 +587,7 @@ mupdftopwg (int inputfd,         /* I - File descriptor input stream */
 
   if(empty)
   {
-    if(log) log(ld, FILTER_LOGLEVEL_ERROR, "mupdftopwg: Input is empty, outputting empty file.");
+    if(log) log(ld, FILTER_LOGLEVEL_ERROR, "cfFilterMuPDFToPWG: Input is empty, outputting empty file.");
      status = 0;
   }
 out:
index 034ff1d145a29aa63c50ce87cce74c3868fe7929..9a8be4d861db048802e839bf68f585ec5a75b80d 100644 (file)
@@ -41,7 +41,7 @@
 
 typedef struct pclmtoraster_data_s
 {
-  filter_out_format_t outformat = OUTPUT_FORMAT_PWG_RASTER;
+  cf_filter_out_format_t outformat = CF_FILTER_OUT_FORMAT_PWG_RASTER;
   int numcolors = 0;
   int rowsize = 0;
   cups_page_header2_t header;
@@ -79,7 +79,7 @@ typedef struct conversion_function_s
 } conversion_function_t;
 
 static int
-parseOpts(filter_data_t *data, filter_out_format_t outformat,
+parseOpts(cf_filter_data_t *data, cf_filter_out_format_t outformat,
          pclmtoraster_data_t *pclmtoraster_data)
 {
   int                  num_options = 0;
@@ -115,12 +115,12 @@ parseOpts(filter_data_t *data, filter_out_format_t outformat,
         (!strcasecmp(attr->value, "true")
          || !strcasecmp(attr->value, "on") ||
          !strcasecmp(attr->value, "yes")))
-      pclmtoraster_data->outformat = OUTPUT_FORMAT_PWG_RASTER;
+      pclmtoraster_data->outformat = CF_FILTER_OUT_FORMAT_PWG_RASTER;
   }
   else
   {
     if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                "pclmtoraster: PPD file is not specified.");
+                "cfFilterPCLmToRaster: PPD file is not specified.");
 
     t = cupsGetOption("media-class", num_options, options);
     if (t == NULL)
@@ -128,7 +128,7 @@ parseOpts(filter_data_t *data, filter_out_format_t outformat,
     if (t != NULL)
     {
       if (strcasestr(t, "pwg"))
-       pclmtoraster_data->outformat = OUTPUT_FORMAT_PWG_RASTER;
+       pclmtoraster_data->outformat = CF_FILTER_OUT_FORMAT_PWG_RASTER;
     }
   }
 
@@ -266,7 +266,7 @@ parseOpts(filter_data_t *data, filter_out_format_t outformat,
 
   strncpy(pclmtoraster_data->pageSizeRequested, header->cupsPageSizeName, 64);
   if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-               "pclmtoraster: Page size requested: %s.",
+               "cfFilterPCLmToRaster: Page size requested: %s.",
               header->cupsPageSizeName);
   return(0);
 }
@@ -447,7 +447,7 @@ rotatebitmap(unsigned char *src,    /* I - Input string */
   else
   {
     if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                "pclmtoraster: Incorrect Rotate Value %d, not rotating",
+                "cfFilterPCLmToRaster: Incorrect Rotate Value %d, not rotating",
                 rotate);
     return (src);
   }
@@ -763,7 +763,7 @@ selectConvertFunc(int                       pgno,    /* I - Page number */
   else
   {
     if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                "pclmtoraster: Colorspace %s not supported, "
+                "cfFilterPCLmToRaster: Colorspace %s not supported, "
                 "defaulting to /deviceRGB",
                 colorspace.c_str());
     data->colorspace = "/DeviceRGB";
@@ -834,7 +834,7 @@ outPage(cups_raster_t*       raster,        /* I - Raster stream */
        filter_logfunc_t log,           /* I - Log function */
        void*            ld,            /* I - Aux. data for log function */
        pclmtoraster_data_t *data,      /* I - pclmtoraster filter data */
-       filter_data_t   *filter_data,   /* I - filter data */
+       cf_filter_data_t        *filter_data,   /* I - filter data */
        conversion_function_t *convert) /* I - Conversion functions */
 {
   long long            rotate = 0,
@@ -862,14 +862,14 @@ outPage(cups_raster_t*     raster,        /* I - Raster stream */
   if (!mediaboxlookup(page, mediaBox))
   {
     if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                "pclmtoraster: PDF page %d doesn't contain a valid mediaBox",
+                "cfFilterPCLmToRaster: PDF page %d doesn't contain a valid mediaBox",
                 pgno + 1);
     return (1);
   }
   else
   {
     if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                "pclmtoraster: mediaBox = [%f %f %f %f]: ",
+                "cfFilterPCLmToRaster: mediaBox = [%f %f %f %f]: ",
                 mediaBox[0], mediaBox[1], mediaBox[2], mediaBox[3]);
     l = mediaBox[2] - mediaBox[0];
     if (l < 0) l = -l;
@@ -890,13 +890,13 @@ outPage(cups_raster_t*     raster,        /* I - Raster stream */
   {
     ppdRasterMatchPPDSize(&(data->header), ppd, margins, paperdimensions, NULL,
                          NULL);
-    if (data->outformat != OUTPUT_FORMAT_CUPS_RASTER)
+    if (data->outformat != CF_FILTER_OUT_FORMAT_CUPS_RASTER)
       memset(margins, 0, sizeof(margins));
   }
   else if(filter_data!=NULL &&(filter_data->printer_attrs)!=NULL)
   {
     ippRasterMatchIPPSize(&(data->header), filter_data, margins, paperdimensions, NULL, NULL);
-    if (data->outformat != OUTPUT_FORMAT_CUPS_RASTER)
+    if (data->outformat != CF_FILTER_OUT_FORMAT_CUPS_RASTER)
       memset(margins, 0, sizeof(margins));
   }
   else
@@ -906,7 +906,7 @@ outPage(cups_raster_t*       raster,        /* I - Raster stream */
     if (data->header.cupsImagingBBox[3] > 0.0)
     {
       /* Set margins if we have a bounding box defined ... */
-      if (data->outformat == OUTPUT_FORMAT_CUPS_RASTER)
+      if (data->outformat == CF_FILTER_OUT_FORMAT_CUPS_RASTER)
       {
        margins[0] = data->header.cupsImagingBBox[0];
        margins[1] = data->header.cupsImagingBBox[1];
@@ -940,12 +940,12 @@ outPage(cups_raster_t*     raster,        /* I - Raster stream */
     data->header.cupsPageSize[i] = paperdimensions[i];
     data->header.PageSize[i] = (unsigned int)(data->header.cupsPageSize[i] +
                                              0.5);
-    if (data->outformat == OUTPUT_FORMAT_CUPS_RASTER)
+    if (data->outformat == CF_FILTER_OUT_FORMAT_CUPS_RASTER)
       data->header.Margins[i] = margins[i] + 0.5;
     else
       data->header.Margins[i] = 0;
   }
-  if (data->outformat == OUTPUT_FORMAT_CUPS_RASTER)
+  if (data->outformat == CF_FILTER_OUT_FORMAT_CUPS_RASTER)
   {
     data->header.cupsImagingBBox[0] = margins[0];
     data->header.cupsImagingBBox[1] = margins[1];
@@ -1012,7 +1012,7 @@ outPage(cups_raster_t*     raster,        /* I - Raster stream */
   if (!cupsRasterWriteHeader2(raster,&(data->header)))
   {
     if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                "pclmtoraster: Can't write page %d header", pgno + 1);
+                "cfFilterPCLmToRaster: Can't write page %d header", pgno + 1);
     return (1);
   }
 
@@ -1091,18 +1091,18 @@ outPage(cups_raster_t*   raster,        /* I - Raster stream */
 }
 
 /*
- * 'pclmtoraster()' - Filter function to convert raster-only PDF/PCLm input to
+ * 'cfFilterPCLmToRaster()' - Filter function to convert raster-only PDF/PCLm input to
  *                   CUPS/PWG Raster output.
  */
 
 int                              /* O - Error status */
-pclmtoraster(int inputfd,         /* I - File descriptor input stream */
+cfFilterPCLmToRaster(int inputfd,         /* I - File descriptor input stream */
             int outputfd,        /* I - File descriptor output stream */
             int inputseekable,   /* I - Is input stream seekable? (unused) */
-            filter_data_t *data, /* I - Job and printer data */
+            cf_filter_data_t *data, /* I - Job and printer data */
             void *parameters)    /* I - Filter-specific parameters (unused) */
 {
-  filter_out_format_t   outformat;
+  cf_filter_out_format_t   outformat;
   FILE                 *inputfp;               /* Input file pointer */
   int                  fd = 0;                 /* Copy file descriptor */
   char                 *filename,              /* PDF file to convert */
@@ -1116,22 +1116,22 @@ pclmtoraster(int inputfd,         /* I - File descriptor input stream */
   conversion_function_t convert;
   filter_logfunc_t     log = data->logfunc;
   void                 *ld = data->logdata;
-  filter_iscanceledfunc_t iscanceled = data->iscanceledfunc;
+  cf_filter_iscanceledfunc_t iscanceled = data->iscanceledfunc;
   void                  *icd = data->iscanceleddata;
 
   if (parameters) {
-    outformat = *(filter_out_format_t *)parameters;
-    if (outformat != OUTPUT_FORMAT_CUPS_RASTER &&
-       outformat != OUTPUT_FORMAT_PWG_RASTER &&
-       outformat != OUTPUT_FORMAT_APPLE_RASTER)
-      outformat = OUTPUT_FORMAT_PWG_RASTER;
+    outformat = *(cf_filter_out_format_t *)parameters;
+    if (outformat != CF_FILTER_OUT_FORMAT_CUPS_RASTER &&
+       outformat != CF_FILTER_OUT_FORMAT_PWG_RASTER &&
+       outformat != CF_FILTER_OUT_FORMAT_APPLE_RASTER)
+      outformat = CF_FILTER_OUT_FORMAT_PWG_RASTER;
   } else
-    outformat = OUTPUT_FORMAT_PWG_RASTER;
+    outformat = CF_FILTER_OUT_FORMAT_PWG_RASTER;
 
   if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-              "pclmtoraster: Output format: %s",
-              (outformat == OUTPUT_FORMAT_CUPS_RASTER ? "CUPS Raster" :
-               (outformat == OUTPUT_FORMAT_PWG_RASTER ? "PWG Raster" :
+              "cfFilterPCLmToRaster: Output format: %s",
+              (outformat == CF_FILTER_OUT_FORMAT_CUPS_RASTER ? "CUPS Raster" :
+               (outformat == CF_FILTER_OUT_FORMAT_PWG_RASTER ? "PWG Raster" :
                 "Apple Raster")));
 
  /*
@@ -1143,7 +1143,7 @@ pclmtoraster(int inputfd,         /* I - File descriptor input stream */
     if (!iscanceled || !iscanceled(icd))
     {
       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                  "pclmtoraster: Unable to open input data stream.");
+                  "cfFilterPCLmToRaster: Unable to open input data stream.");
     }
 
     return (1);
@@ -1152,14 +1152,14 @@ pclmtoraster(int inputfd,         /* I - File descriptor input stream */
   if ((fd = cupsTempFd(tempfile, sizeof(tempfile))) < 0)
   {
     if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                "pclmtoraster: Unable to copy PDF file: %s",
+                "cfFilterPCLmToRaster: Unable to copy PDF file: %s",
                 strerror(errno));
     fclose(inputfp);
     return (1);
   }
 
   if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-              "pclmtoraster: Copying input to temp file \"%s\"",
+              "cfFilterPCLmToRaster: Copying input to temp file \"%s\"",
               tempfile);
 
   while ((bytes = fread(buffer, 1, sizeof(buffer), inputfp)) > 0)
@@ -1185,7 +1185,7 @@ pclmtoraster(int inputfd,         /* I - File descriptor input stream */
      && pclmtoraster_data.header.cupsBitsPerColor != 16)
   {
     if(log) log(ld, FILTER_LOGLEVEL_ERROR,
-               "pclmtoraster: Specified color format is not supported: %s",
+               "cfFilterPCLmToRaster: Specified color format is not supported: %s",
                strerror(errno));
     delete(pdf);
     unlink(tempfile);
@@ -1211,15 +1211,15 @@ pclmtoraster(int inputfd,         /* I - File descriptor input stream */
 
   if ((raster = cupsRasterOpen(outputfd,
                               (pclmtoraster_data.outformat ==
-                                 OUTPUT_FORMAT_CUPS_RASTER ?
+                                 CF_FILTER_OUT_FORMAT_CUPS_RASTER ?
                                  CUPS_RASTER_WRITE :
                                (pclmtoraster_data.outformat ==
-                                  OUTPUT_FORMAT_PWG_RASTER ?
+                                  CF_FILTER_OUT_FORMAT_PWG_RASTER ?
                                   CUPS_RASTER_WRITE_PWG :
                                 CUPS_RASTER_WRITE_APPLE)))) == 0)
   {
     if(log) log(ld, FILTER_LOGLEVEL_ERROR,
-               "pclmtoraster: Can't open raster stream: %s",
+               "cfFilterPCLmToRaster: Can't open raster stream: %s",
                strerror(errno));
     delete(pdf);
     unlink(tempfile);
@@ -1234,12 +1234,12 @@ pclmtoraster(int inputfd,         /* I - File descriptor input stream */
     if (iscanceled && iscanceled(icd))
     {
       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                  "pclmtoraster: Job canceled");
+                  "cfFilterPCLmToRaster: Job canceled");
       break;
     }
 
     if (log) log(ld, FILTER_LOGLEVEL_INFO,
-                "pclmtoraster: Starting page %d.", i+1);
+                "cfFilterPCLmToRaster: Starting page %d.", i+1);
     if (outPage(raster, pages[i], i, log, ld, &pclmtoraster_data,data,
                &convert) != 0)
       break;
index e739ffbfa239d6f7430aea515344840a721732f0..18dcdf080c6b7703d19ab778067e3bf91508adcb 100644 (file)
@@ -106,22 +106,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,
-                                  "pdftopdf: (empty)");
+                                  "cfFilterPDFToPDF: (empty)");
     return;
   }
   len--;
   for (int iA=0;iA<len;iA++) {
     if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
-                                  "pdftopdf: [%d,%d)",
+                                  "cfFilterPDFToPDF: [%d,%d)",
                                   data[iA].first, data[iA].second);
   }
   if (data[len].second==npos) {
     if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
-                                  "pdftopdf: [%d,inf)",
+                                  "cfFilterPDFToPDF: [%d,inf)",
                                   data[len].first);
   } else {
     if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
-                                  "pdftopdf: [%d,%d)",
+                                  "cfFilterPDFToPDF: [%d,%d)",
                                   data[len].first, data[len].second);
   }
 }
index 2ce4ac46933eae9235bfc49aad0325771f0e1f34..41421c920795f0b1789d361c12480f0d5cb0b35c 100644 (file)
@@ -7,7 +7,7 @@
 void NupParameters::dump(pdftopdf_doc_t *doc) const // {{{
 {
   if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
-                                "pdftopdf: NupX: %d, NupY: %d, "
+                                "cfFilterPDFToPDF: NupX: %d, NupY: %d, "
                                 "width: %f, height: %f",
                                 nupX,nupY,
                                 width,height);
@@ -25,28 +25,28 @@ void NupParameters::dump(pdftopdf_doc_t *doc) const // {{{
   }
   if (first==Axis::X) {
     if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
-                                  "pdftopdf: First Axis: X");
+                                  "cfFilterPDFToPDF: First Axis: X");
     opos=0;
   } else if (first==Axis::Y) {
     if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
-                                  "pdftopdf: First Axis: Y");
+                                  "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,
-                                  "pdftopdf: Bad Spec: %d; start: %d, %d",
+                                  "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,
-                                  "pdftopdf: Order: %s%s",
+                                  "cfFilterPDFToPDF: Order: %s%s",
                                   order[opos+fpos],order[(opos+2)%4+spos]);
   }
 
   if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
-                                "pdftopdf: Alignment:");
+                                "cfFilterPDFToPDF: Alignment:");
   Position_dump(xalign,Axis::X,doc);
   Position_dump(yalign,Axis::Y,doc);
 }
@@ -140,7 +140,7 @@ void NupState::reset() // {{{
 void NupPageEdit::dump(pdftopdf_doc_t *doc) const // {{{
 {
   if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
-                                "pdftopdf: xpos: %f, ypos: %f, scale: %f",
+                                "cfFilterPDFToPDF: xpos: %f, ypos: %f, scale: %f",
                                 xpos,ypos,scale);
   sub.dump(doc);
 }
index cf29037acf961a6a6a9c9992c4a5d564001c0e9c..31df65800808d79cf8513b6fae5a2974edfb6e71 100644 (file)
@@ -162,7 +162,7 @@ static bool ppdDefaultOrder(ppd_file_t *ppd, pdftopdf_doc_t *doc) // {{{  -- is
   }
 
   if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_ERROR,
-                                "pdftopdf: Unsupported output-order "
+                                "cfFilterPDFToPDF: Unsupported output-order "
                                 "value %s, using 'normal'!",
                                 val);
   return false;
@@ -296,7 +296,7 @@ static bool parseBorder(const char *val,BorderType &ret) // {{{
 }
 // }}}
 
-void getParameters(filter_data_t *data,int num_options,cups_option_t *options,ProcessingParameters &param,char *final_content_type,pdftopdf_doc_t *doc) // {{{
+void getParameters(cf_filter_data_t *data,int num_options,cups_option_t *options,ProcessingParameters &param,char *final_content_type,pdftopdf_doc_t *doc) // {{{
 {
 
   ppd_file_t *ppd = data->ppd;
@@ -383,7 +383,7 @@ void getParameters(filter_data_t *data,int num_options,cups_option_t *options,Pr
     if ((ipprot<3)||(ipprot>6)) {
       if (ipprot && doc->logfunc)
        doc->logfunc(doc->logdata, FILTER_LOGLEVEL_ERROR,
-                    "pdftopdf: Bad value (%d) for "
+                    "cfFilterPDFToPDF: Bad value (%d) for "
                     "orientation-requested, using 0 degrees",
                     ipprot);
       param.noOrientation = true;
@@ -433,7 +433,7 @@ void getParameters(filter_data_t *data,int num_options,cups_option_t *options,Pr
                (val = cupsGetOption("PageSize", num_options, options)) != NULL) {
        pwg_media_t *size_found = NULL;
        if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
-                                       "pdftopdf: Page size from command "
+                                       "cfFilterPDFToPDF: Page size from command "
                                        "line: %s", val);
        if ((size_found = pwgMediaForPWG(val)) == NULL)
                if ((size_found = pwgMediaForPPD(val)) == NULL)
@@ -446,12 +446,12 @@ void getParameters(filter_data_t *data,int num_options,cups_option_t *options,Pr
                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,
-                                       "pdftopdf: Width: %f, Length: %f",
+                                       "cfFilterPDFToPDF: Width: %f, Length: %f",
                                        param.page.width, param.page.height);
        }
        else
                if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
-                                       "pdftopdf: Unsupported page size %s.",
+                                       "cfFilterPDFToPDF: Unsupported page size %s.",
                                        val);
        }
     #endif /* HAVE_CUPS_1_7 */
@@ -503,7 +503,7 @@ void getParameters(filter_data_t *data,int num_options,cups_option_t *options,Pr
       param.setDuplex=true;
     } else if (strcasecmp(val,"one-sided")!=0) {
       if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_ERROR,
-                                    "pdftopdf: Unsupported sides value %s, "
+                                    "cfFilterPDFToPDF: Unsupported sides value %s, "
                                     "using sides=one-sided!", val);
     }
   }
@@ -513,7 +513,7 @@ void getParameters(filter_data_t *data,int num_options,cups_option_t *options,Pr
   if (optGetInt("number-up",num_options,options,&nup)) {
     if (!NupParameters::possible(nup)) {
       if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_ERROR,
-                                    "pdftopdf: Unsupported number-up value "
+                                    "cfFilterPDFToPDF: Unsupported number-up value "
                                     "%d, using number-up=1!", nup);
       nup=1;
     }
@@ -525,7 +525,7 @@ void getParameters(filter_data_t *data,int num_options,cups_option_t *options,Pr
   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,
-                                    "pdftopdf: Unsupported number-up-layout "
+                                    "cfFilterPDFToPDF: Unsupported number-up-layout "
                                     "%s, using number-up-layout=lrtb!" ,val);
       param.nup.first=Axis::X;
       param.nup.xstart=Position::LEFT;
@@ -536,7 +536,7 @@ void getParameters(filter_data_t *data,int num_options,cups_option_t *options,Pr
   if ((val=cupsGetOption("page-border",num_options,options)) != NULL) {
     if (!parseBorder(val,param.border)) {
       if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_ERROR,
-                                    "pdftopdf: Unsupported page-border value "
+                                    "cfFilterPDFToPDF: Unsupported page-border value "
                                     "%s, using page-border=none!", val);
       param.border=BorderType::NONE;
     }
@@ -580,7 +580,7 @@ void getParameters(filter_data_t *data,int num_options,cups_option_t *options,Pr
       param.evenPages=false;
     } else if (strcasecmp(val,"all")!=0) {
       if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_ERROR,
-                                    "pdftopdf: Unsupported page-set value %s, "
+                                    "cfFilterPDFToPDF: Unsupported page-set value %s, "
                                     "using page-set=all!", val);
     }
   }
@@ -616,7 +616,7 @@ void getParameters(filter_data_t *data,int num_options,cups_option_t *options,Pr
       param.booklet=BookletMode::BOOKLET_ON;
     } else if (!is_false(val)) {
       if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_ERROR,
-                                    "pdftopdf: Unsupported booklet value %s, "
+                                    "cfFilterPDFToPDF: Unsupported booklet value %s, "
                                     "using booklet=off!", val);
     }
   }
@@ -624,7 +624,7 @@ void getParameters(filter_data_t *data,int num_options,cups_option_t *options,Pr
   if (optGetInt("booklet-signature",num_options,options,&param.bookSignature)) {
     if (param.bookSignature==0) {
       if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_ERROR,
-                                    "pdftopdf: Unsupported booklet-signature "
+                                    "cfFilterPDFToPDF: Unsupported booklet-signature "
                                     "value, using booklet-signature=-1 "
                                     "(all)!", val);
       param.bookSignature=-1;
@@ -634,7 +634,7 @@ void getParameters(filter_data_t *data,int num_options,cups_option_t *options,Pr
   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,
-                                    "pdftopdf: Unrecognized position value "
+                                    "cfFilterPDFToPDF: Unrecognized position value "
                                     "%s, using position=center!", val);
       param.xpos=Position::CENTER;
       param.ypos=Position::CENTER;
@@ -712,21 +712,21 @@ bool checkFeature(const char *feature, int num_options, cups_option_t *options)
     if (strcasecmp(val,"auto") == 0) {
       param.page_logging = -1;
       if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
-                                    "pdftopdf: Automatic page logging "
+                                    "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,
-                                    "pdftopdf: Forced page logging selected "
+                                    "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,
-                                    "pdftopdf: Suppressed page logging "
+                                    "cfFilterPDFToPDF: Suppressed page logging "
                                     "selected by command line.");
     } else {
       if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_ERROR,
-                                    "pdftopdf: Unsupported page-logging "
+                                    "cfFilterPDFToPDF: Unsupported page-logging "
                                     "value %s, using page-logging=auto!",val);
       param.page_logging = -1;
     }
@@ -753,7 +753,7 @@ bool checkFeature(const char *feature, int num_options, cups_option_t *options)
            param.page_logging = -1;     
        }
        if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
-               "pdftopdf: No PPD file specified,  "
+               "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);
@@ -764,14 +764,14 @@ bool checkFeature(const char *feature, int num_options, cups_option_t *options)
        // whether we have to log pages, so do not log.
        param.page_logging = 0;
        if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
-                                      "pdftopdf: No FINAL_CONTENT_TYPE "
+                                      "cfFilterPDFToPDF: No FINAL_CONTENT_TYPE "
                                       "environment variable, could not "
                                       "determine whether to log pages or "
                                       "not, so turned off page logging.");
       // Proceed depending on number of cupsFilter(2) lines in PPD
       } else if (ppd->num_filters == 0) {
        // No filter line, manufacturer-supplied PostScript PPD
-       // In this case pstops, called by pdftops, does the logging
+       // In this case cfFilterPSToPS, called by cfFilterPDFToPS, does the logging
        param.page_logging = 0;
       } else if (ppd->num_filters == 1) {
        // One filter line, so this one filter is the last filter
@@ -841,7 +841,7 @@ bool checkFeature(const char *feature, int num_options, cups_option_t *options)
                     !strcasecmp(lastfilter + strlen(lastfilter) - 5,
                                 "topwg")) {
            // On IPP Everywhere printers which accept PWG Raster data one
-           // of gstoraster, pdftoraster, or mupdftopwg is the last
+           // of gstoraster, cfFilterPDFToRaster, or mupdftopwg is the last
            // filter. These filters do not log pages so pdftopdf has to
            // do it
            param.page_logging = 1;
@@ -861,14 +861,14 @@ bool checkFeature(const char *feature, int num_options, cups_option_t *options)
          }
        } else {
          if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_ERROR,
-                                        "pdftopdf: Last filter could not "
+                                        "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,
-                                    "pdftopdf: Last filter determined by the "
+                                    "cfFilterPDFToPDF: Last filter determined by the "
                                     "PPD: %s; FINAL_CONTENT_TYPE: "
                                     "%s => pdftopdf will %slog pages in "
                                     "page_log.",
@@ -896,7 +896,7 @@ static bool printerWillCollate(ppd_file_t *ppd) // {{{
 }
 // }}}
 
-void calculate(filter_data_t *data,ProcessingParameters &param,char *final_content_type) // {{{
+void calculate(cf_filter_data_t *data,ProcessingParameters &param,char *final_content_type) // {{{
 {
   ppd_file_t *ppd = data->ppd;
   int num_options = 0;
@@ -983,7 +983,7 @@ FILE *copy_fd_to_temp(int infd, pdftopdf_doc_t *doc) // {{{
   int outfd=cupsTempFd(buf,sizeof(buf));
   if (outfd<0) {
     if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_ERROR,
-                                  "pdftopdf: Can't create temporary file");
+                                  "cfFilterPDFToPDF: Can't create temporary file");
     return NULL;
   }
   // remove name
@@ -993,7 +993,7 @@ FILE *copy_fd_to_temp(int infd, pdftopdf_doc_t *doc) // {{{
   while ((n=read(infd,buf,BUFSIZ)) > 0) {
     if (write(outfd,buf,n) != n) {
       if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_ERROR,
-                                    "pdftopdf: Can't copy stdin to temporary "
+                                    "cfFilterPDFToPDF: Can't copy stdin to temporary "
                                     "file");
       close(outfd);
       return NULL;
@@ -1001,7 +1001,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,
-                                  "pdftopdf: Can't rewind temporary file");
+                                  "cfFilterPDFToPDF: Can't rewind temporary file");
     close(outfd);
     return NULL;
   }
@@ -1009,7 +1009,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,
-                                  "pdftopdf: Can't fdopen temporary file");
+                                  "cfFilterPDFToPDF: Can't fdopen temporary file");
     close(outfd);
     return NULL;
   }
@@ -1034,10 +1034,10 @@ bool is_empty(FILE *f) // {{{
 
 
 int                           /* O - Error status */
-pdftopdf(int inputfd,         /* I - File descriptor input stream */
+cfFilterPDFToPDF(int inputfd,         /* I - File descriptor input stream */
         int outputfd,        /* I - File descriptor output stream */
         int inputseekable,   /* I - Is input stream seekable? */
-        filter_data_t *data, /* I - Job and printer data */
+        cf_filter_data_t *data, /* I - Job and printer data */
         void *parameters)    /* I - Filter-specific parameters */
 {
   pdftopdf_doc_t     doc;         /* Document information */
@@ -1050,7 +1050,7 @@ pdftopdf(int inputfd,         /* I - File descriptor input stream */
   char               buf[BUFSIZ];
   filter_logfunc_t   log = data->logfunc;
   void               *ld = data->logdata;
-  filter_iscanceledfunc_t iscanceled = data->iscanceledfunc;
+  cf_filter_iscanceledfunc_t iscanceled = data->iscanceledfunc;
   void               *icd = data->iscanceleddata;
   int num_options = 0;
   cups_option_t *options = NULL;
@@ -1093,7 +1093,7 @@ pdftopdf(int inputfd,         /* I - File descriptor input stream */
         strcasecmp(t, "no"))) {
       streaming = 1;
       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                    "pdftopdf: Streaming mode: No PDF processing, only adding of JCL");
+                    "cfFilterPDFToPDF: Streaming mode: No PDF processing, only adding of JCL");
     }
 
     std::unique_ptr<PDFTOPDF_Processor> proc(PDFTOPDF_Factory::processor());
@@ -1110,12 +1110,12 @@ pdftopdf(int inputfd,         /* I - File descriptor input stream */
       if (is_empty(inputfp)) {
        fclose(inputfp);
        if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                    "pdftopdf: Input is empty, outputting empty file.");
+                    "cfFilterPDFToPDF: Input is empty, outputting empty file.");
        return 0;
       }
 
       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                    "pdftopdf: Processing PDF input with QPDF: Page-ranges, page-set, number-up, booklet, size adjustment, ...");
+                    "cfFilterPDFToPDF: Processing PDF input with QPDF: Page-ranges, page-set, number-up, booklet, size adjustment, ...");
 
       // Load the PDF input data into QPDF
       if (!proc->loadFile(inputfp, &doc, WillStayAlive, 1)) {
@@ -1157,7 +1157,7 @@ pdftopdf(int inputfd,         /* I - File descriptor input stream */
     } else {
       // Pass through the input data
       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                  "pdftopdf: Passing on unchanged PDF data from input");
+                  "cfFilterPDFToPDF: Passing on unchanged PDF data from input");
       while ((bytes = fread(buf, 1, sizeof(buf), inputfp)) > 0)
        if (fwrite(buf, 1, bytes, outputfp) != bytes)
          break;
@@ -1169,11 +1169,11 @@ pdftopdf(int inputfd,         /* I - File descriptor input stream */
   } catch (std::exception &e) {
     // TODO? exception type
     if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                "pdftopdf: Exception: %s",e.what());
+                "cfFilterPDFToPDF: Exception: %s",e.what());
     return 5;
   } catch (...) {
     if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                "pdftopdf: Unknown exception caught. Exiting.");
+                "cfFilterPDFToPDF: Unknown exception caught. Exiting.");
     return 6;
   }
 
index 122dd9be783211f074203f84472a2f8adf9775d7..aab10428164cc55980187b2469da72252d25dd0f 100644 (file)
@@ -11,7 +11,7 @@ typedef struct                                   /***** Document information ***
 {
   filter_logfunc_t logfunc;           /* Log function */
   void *logdata;                      /* Log data */
-  filter_iscanceledfunc_t iscanceledfunc; /* Function returning 1 when
+  cf_filter_iscanceledfunc_t iscanceledfunc; /* Function returning 1 when
                                              job is canceled, NULL for not
                                              supporting stop on cancel */
   void *iscanceleddata;      /* User data for is-canceled function, can be
index dba97d5a1f768e06b57029cb63a818ba69cb4413..2c925c94939b13bff07d5fd752ae11ee9b3a00a5 100644 (file)
@@ -9,11 +9,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,
-                                  "pdftopdf: bookletMode: (bad booklet mode: "
+                                  "cfFilterPDFToPDF: bookletMode: (bad booklet mode: "
                                   "%d)", bkm);
   } else {
     if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
-                                  "pdftopdf: bookletMode: %s", bstr[bkm]);
+                                  "cfFilterPDFToPDF: bookletMode: %s", bstr[bkm]);
   }
 }
 // }}}
@@ -38,13 +38,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,
-                                "pdftopdf: jobId: %d, numCopies: %d",
+                                "cfFilterPDFToPDF: jobId: %d, numCopies: %d",
                                 jobId,numCopies);
   if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
-                                "pdftopdf: user: %s, title: %s",
+                                "cfFilterPDFToPDF: user: %s, title: %s",
                                 (user)?user:"(null)",(title)?title:"(null)");
   if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
-                                "pdftopdf: fitplot: %s",
+                                "cfFilterPDFToPDF: fitplot: %s",
                                 (fitplot)?"true":"false");
 
   page.dump(doc);
@@ -52,11 +52,11 @@ void ProcessingParameters::dump(pdftopdf_doc_t *doc) const // {{{
   Rotation_dump(orientation,doc);
 
   if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
-                                "pdftopdf: paper_is_landscape: %s",
+                                "cfFilterPDFToPDF: paper_is_landscape: %s",
                                 (paper_is_landscape)?"true":"false");
 
   if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
-                                "pdftopdf: duplex: %s",
+                                "cfFilterPDFToPDF: duplex: %s",
                                 (duplex)?"true":"false");
 
   BorderType_dump(border,doc);
@@ -64,64 +64,64 @@ void ProcessingParameters::dump(pdftopdf_doc_t *doc) const // {{{
   nup.dump(doc);
 
   if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
-                                "pdftopdf: reverse: %s",
+                                "cfFilterPDFToPDF: reverse: %s",
                                 (reverse)?"true":"false");
 
   if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
-                                "pdftopdf: evenPages: %s, oddPages: %s",
+                                "cfFilterPDFToPDF: evenPages: %s, oddPages: %s",
                                 (evenPages)?"true":"false",
                                 (oddPages)?"true":"false");
   
    if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
-                                "pdftopdf: input page range:");
+                                "cfFilterPDFToPDF: input page range:");
   inputPageRange.dump(doc);
 
   if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
-                                "pdftopdf: page range:");
+                                "cfFilterPDFToPDF: page range:");
   pageRange.dump(doc);
 
   if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
-                                "pdftopdf: mirror: %s",
+                                "cfFilterPDFToPDF: mirror: %s",
                                 (mirror)?"true":"false");
 
   if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
-                                "pdftopdf: Position:");
+                                "cfFilterPDFToPDF: Position:");
   Position_dump(xpos,Axis::X,doc);
   Position_dump(ypos,Axis::Y,doc);
 
   if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
-                                "pdftopdf: collate: %s",
+                                "cfFilterPDFToPDF: collate: %s",
                                 (collate)?"true":"false");
 
   if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
-                                "pdftopdf: evenDuplex: %s",
+                                "cfFilterPDFToPDF: evenDuplex: %s",
                                 (evenDuplex)?"true":"false");
 
   if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
-                                "pdftopdf: pageLabel: %s",
+                                "cfFilterPDFToPDF: pageLabel: %s",
                                 pageLabel.empty () ? "(none)" :
                                 pageLabel.c_str());
 
   BookletMode_dump(booklet,doc);
   if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
-                                "pdftopdf: booklet signature: %d",
+                                "cfFilterPDFToPDF: booklet signature: %d",
                                 bookSignature);
 
   if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
-                                "pdftopdf: autoRotate: %s",
+                                "cfFilterPDFToPDF: autoRotate: %s",
                                 (autoRotate)?"true":"false");
 
   if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
-                                "pdftopdf: emitJCL: %s",
+                                "cfFilterPDFToPDF: emitJCL: %s",
                                 (emitJCL)?"true":"false");
   if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
-                                "pdftopdf: deviceCopies: %d",
+                                "cfFilterPDFToPDF: deviceCopies: %d",
                                 deviceCopies);
   if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
-                                "pdftopdf: deviceCollate: %s",
+                                "cfFilterPDFToPDF: deviceCollate: %s",
                                 (deviceCollate)?"true":"false");
   if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
-                                "pdftopdf: setDuplex: %s",
+                                "cfFilterPDFToPDF: setDuplex: %s",
                                 (setDuplex)?"true":"false");
 }
 // }}}
@@ -170,7 +170,7 @@ bool processPDFTOPDF(PDFTOPDF_Processor &proc,ProcessingParameters &param,pdftop
 {
   if (!proc.check_print_permissions(doc)) {
     if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
-                                  "pdftopdf: Not allowed to print");
+                                  "cfFilterPDFToPDF: Not allowed to print");
     return false;
   }
 
@@ -211,7 +211,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,
-                                "pdftopdf: \"print-scaling\" IPP attribute: %s",
+                                "cfFilterPDFToPDF: \"print-scaling\" IPP attribute: %s",
                                 (param.autoprint ? "auto" :
                                  (param.autofit ? "auto-fit" :
                                   (param.fitplot ? "fit" :
@@ -238,14 +238,14 @@ bool processPDFTOPDF(PDFTOPDF_Processor &proc,ProcessingParameters &param,pdftop
       {
        if (doc->logfunc)
          doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
-                      "pdftopdf: Page %d too large for output page size, scaling pages to fit.",
+                      "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,
-                  "pdftopdf: \"ipp-attribute-fidelity\" IPP attribute is set, scaling pages to fit.");
+                  "cfFilterPDFToPDF: \"ipp-attribute-fidelity\" IPP attribute is set, scaling pages to fit.");
 
     if (param.autoprint)
     {
@@ -269,7 +269,7 @@ bool processPDFTOPDF(PDFTOPDF_Processor &proc,ProcessingParameters &param,pdftop
   }
 
   if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
-                                "pdftopdf: Print scaling mode: %s",
+                                "cfFilterPDFToPDF: Print scaling mode: %s",
                                 (param.fitplot ?
                                  "Scale to fit printable area" :
                                  (param.fillprint ?
index 0719681435d09378f74ad62b1fc2a562ecc4b2ab..42a518fdec38b2ff6bde7ed7050a744028840e80 100644 (file)
@@ -8,10 +8,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,
-      "pdftopdf: (bad position: %d)",pos);
+      "cfFilterPDFToPDF: (bad position: %d)",pos);
   } else {
     if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
-      "pdftopdf: %s",pstr[pos+1]);
+      "cfFilterPDFToPDF: %s",pstr[pos+1]);
   }
 }
 // }}}
@@ -21,18 +21,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,
-      "pdftopdf: Position %s: (bad position: %d)",
+      "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,
-      "pdftopdf: Position X: %s", pxstr[pos+1]);
+      "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,
-      "pdftopdf: Position Y: %s",pystr[pos+1]);
+      "cfFilterPDFToPDF: Position Y: %s",pystr[pos+1]);
   }
 }
 // }}}
@@ -42,10 +42,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,
-      "pdftopdf: Rotation(CCW): (bad rotation: %d)",rot);
+      "cfFilterPDFToPDF: Rotation(CCW): (bad rotation: %d)",rot);
   } else {
     if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
-      "pdftopdf: Rotation(CCW): %s",rstr[rot]);
+      "cfFilterPDFToPDF: Rotation(CCW): %s",rstr[rot]);
   }
 }
 // }}}
@@ -72,11 +72,11 @@ 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,
-      "pdftopdf: Border: (bad border: %d)",border);
+      "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,
-      "pdftopdf: Border: %s",bstr[border]);
+      "cfFilterPDFToPDF: Border: %s",bstr[border]);
   }
 }
 // }}}
@@ -180,7 +180,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,
-      "pdftopdf: top: %f, left: %f, right: %f, bottom: %f, "
+      "cfFilterPDFToPDF: top: %f, left: %f, right: %f, bottom: %f, "
          "width: %f, height: %f",
          top,left,right,bottom,
          width,height);
index d3be131071186b95e19bbefb9b9a73ffad199381..20deb0869bdac5e00f080e982445d3b1289ac1a0 100644 (file)
@@ -222,7 +222,7 @@ Rotation QPDF_PDFTOPDF_PageHandle::crop(const PageRect &cropRect,Rotation orient
     final_h = pageHeight;
   }
   if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
-             "pdftopdf: After Cropping: %lf %lf %lf %lf",
+             "cfFilterPDFToPDF: After Cropping: %lf %lf %lf %lf",
              width,height,final_w,final_h);
   double posw = (width-final_w)/2,
         posh = (height-final_h)/2;
@@ -485,7 +485,7 @@ bool QPDF_PDFTOPDF_Processor::loadFile(FILE *f,pdftopdf_doc_t *doc,ArgOwnership
       pdf->processFile("temp file",f,false);
     } catch (const std::exception &e) {
       if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_ERROR,
-        "pdftopdf: loadFile failed: %s", e.what());
+        "cfFilterPDFToPDF: loadFile failed: %s", e.what());
       return false;
     }
     break;
@@ -494,13 +494,13 @@ bool QPDF_PDFTOPDF_Processor::loadFile(FILE *f,pdftopdf_doc_t *doc,ArgOwnership
       pdf->processFile("temp file",f,true);
     } catch (const std::exception &e) {
       if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_ERROR,
-        "pdftopdf: loadFile failed: %s", e.what());
+        "cfFilterPDFToPDF: loadFile failed: %s", e.what());
       return false;
     }
     break;
   case MustDuplicate:
     if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_ERROR,
-        "pdftopdf: loadFile with MustDuplicate is not supported");
+        "cfFilterPDFToPDF: loadFile with MustDuplicate is not supported");
     return false;
   }
   start(flatten_forms);
@@ -516,7 +516,7 @@ bool QPDF_PDFTOPDF_Processor::loadFilename(const char *name,pdftopdf_doc_t *doc,
     pdf->processFile(name);
   } catch (const std::exception &e) {
     if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_ERROR,
-        "pdftopdf: loadFilename failed: %s",e.what());
+        "cfFilterPDFToPDF: loadFilename failed: %s",e.what());
     return false;
   }
   start(flatten_forms);
@@ -557,7 +557,7 @@ bool QPDF_PDFTOPDF_Processor::check_print_permissions(pdftopdf_doc_t *doc) // {{
 {
   if (!pdf) {
     if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_ERROR,
-        "pdftopdf: No PDF loaded");
+        "cfFilterPDFToPDF: No PDF loaded");
     return false;
   }
   return pdf->allowPrintHighRes() || pdf->allowPrintLowRes(); // from legacy pdftopdf
@@ -569,7 +569,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,
-        "pdftopdf: No PDF loaded");
+        "cfFilterPDFToPDF: No PDF loaded");
     assert(0);
     return ret;
   }
@@ -586,7 +586,7 @@ std::shared_ptr<PDFTOPDF_PageHandle> QPDF_PDFTOPDF_Processor::new_page(float wid
 {
   if (!pdf) {
     if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_ERROR,
-        "pdftopdf: No PDF loaded");
+        "cfFilterPDFToPDF: No PDF loaded");
     assert(0);
     return std::shared_ptr<PDFTOPDF_PageHandle>();
   }
@@ -714,7 +714,7 @@ void QPDF_PDFTOPDF_Processor::emitFile(FILE *f,pdftopdf_doc_t *doc,ArgOwnership
     break;
   case MustDuplicate:
     if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_ERROR,
-        "pdftopdf: emitFile with MustDuplicate is not supported");
+        "cfFilterPDFToPDF: emitFile with MustDuplicate is not supported");
     return;
   }
   if (hasCM) {
@@ -752,7 +752,7 @@ void QPDF_PDFTOPDF_Processor::emitFilename(const char *name,pdftopdf_doc_t *doc)
   out.write();
   else
   if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
-             "pdftopdf: No pages left, outputting empty file.");
+             "cfFilterPDFToPDF: No pages left, outputting empty file.");
 }
 // }}}
 
index 1e8f5f03ba4f14856d41de3105d7ccec88f96e8c..7ab9bb2581540656d0a263b43641aa2c8f358ee2 100644 (file)
@@ -13,7 +13,7 @@
  *   parsePDFTOPDFComment() - Check whether we are executed after pdftopdf
  *   remove_options()       - Remove unwished entries from an option list
  *   log_command_line()     - Log the command line of a program which we call
- *   pdftops()              - pdftops filter function
+ *   cfFilterPDFToPS()              - pdftops filter function
  */
 
 /*
@@ -117,7 +117,7 @@ static void parsePDFTOPDFComment(char *filename,       /* I - Input file */
 
   if ((fp = fopen(filename,"rb")) == NULL) {
     if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                "pdftops: Cannot open input file \"%s\"",
+                "cfFilterPDFToPS: Cannot open input file \"%s\"",
                 filename);
     return;
   }
@@ -175,7 +175,7 @@ is_empty(char *filename,       /* I - Input file */
   if (fp == NULL)
   {
     if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                "pdftops: Cannot open input file \"%s\"",
+                "cfFilterPDFToPS: Cannot open input file \"%s\"",
                 filename);
     return 1;
   }
@@ -186,14 +186,14 @@ is_empty(char *filename,       /* I - Input file */
     if (fread(buf, 1, 1, fp) == 0) {
       fclose(fp);
       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                  "pdftops: Input is empty, outputting empty file.");
+                  "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,
-                  "pdftops: No pages left, outputting empty file.");
+                  "cfFilterPDFToPS: No pages left, outputting empty file.");
       return 1;
     }
     if (pages > 0)
@@ -222,7 +222,7 @@ log_command_line(const char* file,     /* I - Program to be executed */
     return;
 
   /* Debug output: Full command line of program to be called */
-  snprintf(buf, sizeof(buf) - 1, "pdftops: Running command line for %s:",
+  snprintf(buf, sizeof(buf) - 1, "cfFilterPDFToPS: Running command line for %s:",
           (file ? file : argv[0]));
   if (file)
     snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf) - 1,
@@ -242,15 +242,15 @@ log_command_line(const char* file,     /* I - Program to be executed */
 
 
 /*
- * 'pdftops()' - Filter function to convert PDF input into
+ * 'cfFilterPDFToPS()' - Filter function to convert PDF input into
  *               PostScript to be printed on PostScript printers
  */
 
 int                          /* O - Error status */
-pdftops(int inputfd,         /* I - File descriptor input stream */
+cfFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
        int outputfd,        /* I - File descriptor output stream */
        int inputseekable,   /* I - Is input stream seekable? (unused) */
-       filter_data_t *data, /* I - Job and printer data */
+       cf_filter_data_t *data, /* I - Job and printer data */
        void *parameters)    /* I - Filter-specific parameters (unused) */
 {
   renderer_t    renderer = CUPS_PDFTOPS_RENDERER; /* Renderer: gs or pdftops
@@ -273,7 +273,7 @@ pdftops(int inputfd,         /* I - File descriptor input stream */
                 *pstops_options,       /* Options for pstops filter function */
                 *option;
   const char    *exclude;
-  filter_data_t pstops_filter_data;
+  cf_filter_data_t pstops_filter_data;
   int           ret;
   const char   *val;                   /* Option value */
   ppd_file_t   *ppd;                   /* PPD file */
@@ -305,7 +305,7 @@ pdftops(int inputfd,         /* I - File descriptor input stream */
                                           printing */
   filter_logfunc_t log = data->logfunc;
   void          *ld = data->logdata;
-  filter_iscanceledfunc_t iscanceled = data->iscanceledfunc;
+  cf_filter_iscanceledfunc_t iscanceled = data->iscanceledfunc;
   void          *icd = data->iscanceleddata;
   ipp_t *printer_attrs = data->printer_attrs;
   ipp_t *job_attrs = data->job_attrs;
@@ -330,7 +330,7 @@ pdftops(int inputfd,         /* I - File descriptor input stream */
     if (!iscanceled || !iscanceled(icd))
     {
       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                  "pdftops: Unable to open input data stream.");
+                  "cfFilterPDFToPS: Unable to open input data stream.");
     }
 
     return (1);
@@ -343,12 +343,12 @@ pdftops(int inputfd,         /* I - File descriptor input stream */
   if ((fd = cupsTempFd(tempfile, sizeof(tempfile))) < 0)
   {
     if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                "pdftops: Unable to copy PDF file: %s", strerror(errno));
+                "cfFilterPDFToPS: Unable to copy PDF file: %s", strerror(errno));
     return (1);
   }
 
   if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-              "pdftops: Copying input to temp file \"%s\"",
+              "cfFilterPDFToPS: Copying input to temp file \"%s\"",
               tempfile);
 
   while ((bytes = fread(buffer, 1, sizeof(buffer), inputfp)) > 0)
@@ -426,7 +426,7 @@ pdftops(int inputfd,         /* I - File descriptor input stream */
     make_model[strlen(make_model) - 1] = '\0';
   }
   if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-              "pdftops: Printer make and model: %s", make_model);
+              "cfFilterPDFToPS: Printer make and model: %s", make_model);
 
  /*
   * Select the PDF renderer: Ghostscript (gs), Poppler (pdftops),
@@ -451,7 +451,7 @@ pdftops(int inputfd,         /* I - File descriptor input stream */
       renderer = HYBRID;
     else
       if (log) log(ld, FILTER_LOGLEVEL_WARN,
-                  "pdftops: Invalid value for \"pdftops-renderer\": \"%s\"",
+                  "cfFilterPDFToPS: Invalid value for \"pdftops-renderer\": \"%s\"",
                   val);
   }
 
@@ -465,7 +465,7 @@ pdftops(int inputfd,         /* I - File descriptor input stream */
          (ptr = strcasestr(make_model, "LaserWriter")))))
     {
       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                  "pdftops: Switching to Poppler's pdftops instead of "
+                  "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 "
                   "printer's PS interpreters");
@@ -495,7 +495,7 @@ pdftops(int inputfd,         /* I - File descriptor input stream */
          if (!*ptr) /* End of string, no further word */
          {
            if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                        "pdftops: Switching to Poppler's pdftops instead of "
+                        "cfFilterPDFToPS: Switching to Poppler's pdftops instead of "
                         "Ghostscript for old HP LaserJet (\"LaserJet "
                         "<number>\", no letters before <number>, no "
                         "additional words after <number>) printers to "
@@ -620,7 +620,7 @@ pdftops(int inputfd,         /* I - File descriptor input stream */
   }
 
  /*
-  * Build the command-line for the pdftops, gs, mutool, pdftocairo, or
+  * Build the command-line for the cfFilterPDFToPS, gs, mutool, pdftocairo, or
   * acroread filter...
   */
 
@@ -701,18 +701,18 @@ pdftops(int inputfd,         /* I - File descriptor input stream */
       else if (renderer == PDFTOCAIRO)
       {
        if (log) log(ld, FILTER_LOGLEVEL_WARN,
-                    "pdftops: Level 1 PostScript not supported by "
+                    "cfFilterPDFToPS: Level 1 PostScript not supported by "
                     "pdftocairo.");
       }
       else if (renderer == ACROREAD)
       {
        if (log) log(ld, FILTER_LOGLEVEL_WARN,
-                    "pdftops: Level 1 PostScript not supported by acroread.");
+                    "cfFilterPDFToPS: Level 1 PostScript not supported by acroread.");
       }
       else if (renderer == MUPDF)
       {
        if (log) log(ld, FILTER_LOGLEVEL_WARN,
-                    "pdftops: Level 1 PostScript not supported by mutool.");
+                    "cfFilterPDFToPS: Level 1 PostScript not supported by mutool.");
       }
     }
     else if (ppd->language_level == 2)
@@ -761,7 +761,7 @@ pdftops(int inputfd,         /* I - File descriptor input stream */
       else if (renderer == MUPDF)
       {
        if (log) log(ld, FILTER_LOGLEVEL_WARN,
-                    "pdftops: Level 3 PostScript not supported by mutool.");
+                    "cfFilterPDFToPS: Level 3 PostScript not supported by mutool.");
       }
       else /* PDFTOCAIRO || ACROREAD */
         pdf_argv[pdf_argc++] = (char *)"-level3";
@@ -837,7 +837,7 @@ pdftops(int inputfd,         /* I - File descriptor input stream */
     if ((xres == 0) && (yres == 0) &&
        ((numvalues = sscanf(resolution, "%dx%d", &xres, &yres)) <= 0))
       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                  "pdftops: No resolution information found in the PPD file.");
+                  "cfFilterPDFToPS: No resolution information found in the PPD file.");
   }
   else{
     cupsRasterParseIPPOptions(&header, data, 0, 1);
@@ -892,7 +892,7 @@ pdftops(int inputfd,         /* I - File descriptor input stream */
           strcasecmp(ptr, "dpcm")))
       {
        if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                    "pdftops: Bad resolution value \"%s\".", val);
+                    "cfFilterPDFToPS: Bad resolution value \"%s\".", val);
       }
       else
       {
@@ -928,7 +928,7 @@ pdftops(int inputfd,         /* I - File descriptor input stream */
       maxres = mres;
     else
       if (log) log(ld, FILTER_LOGLEVEL_WARN,
-                  "pdftops: Invalid value for "
+                  "cfFilterPDFToPS: Invalid value for "
                   "\"pdftops-max-image-resolution\": \"%s\"",
                   val);
   }
@@ -955,7 +955,7 @@ pdftops(int inputfd,         /* I - File descriptor input stream */
     snprintf(resolution, sizeof(resolution), "%d", res);
     pdf_argv[pdf_argc++] = resolution;
     if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                "pdftops: Using image rendering resolution %d dpi", res);
+                "cfFilterPDFToPS: Using image rendering resolution %d dpi", res);
 #endif /* HAVE_POPPLER_PDFTOPS_WITH_RESOLUTION */
     if (gray_output == 1) /* Checking for monochrome/grayscale PostScript
                             output */
@@ -974,11 +974,11 @@ pdftops(int inputfd,         /* I - File descriptor input stream */
         pdf_argv[pdf_argc++] = (char *)"-optimizecolorspace"; */
       /* Issue a warning message when printing a grayscale job with Poppler */
       if (log) log(ld, FILTER_LOGLEVEL_WARN,
-                  "pdftops: Grayscale/monochrome printing requested for this "
+                  "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,
-                  "pdftops: Use \"pdftops-renderer\" option (see "
+                  "cfFilterPDFToPS: Use \"pdftops-renderer\" option (see "
                   "cups-filters README file) to use Ghostscript or MuPDF for "
                   "the PDF -> PostScript conversion.");
     }
@@ -994,7 +994,7 @@ pdftops(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,
-                "pdftops: Using image rendering resolution %d dpi", res);
+                "cfFilterPDFToPS: Using image rendering resolution %d dpi", res);
    /*
     * PostScript debug mode: If you send a job with "lpr -o psdebug" Ghostscript
     * will not compress the pages, so that the PostScript code can get
@@ -1011,7 +1011,7 @@ pdftops(int inputfd,         /* I - File descriptor input stream */
          !strncasecmp(make_model, "Utax", 4))))
     {
       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                  "pdftops: Deactivated compression of pages in "
+                  "cfFilterPDFToPS: Deactivated compression of pages in "
                   "Ghostscript's PostScript output (\"psdebug\" debug mode "
                   "or Kyocera/Utax printer)");
       pdf_argv[pdf_argc++] = (char *)"-dCompressPages=false";
@@ -1028,7 +1028,7 @@ pdftops(int inputfd,         /* I - File descriptor input stream */
        !strncasecmp(make_model, "Brother", 7))
     {
       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                  "pdftops: Deactivation of Ghostscript's image compression "
+                  "cfFilterPDFToPS: Deactivation of Ghostscript's image compression "
                   "for Brother printers to workarounmd PS interpreter bug");
       pdf_argv[pdf_argc++] = (char *)"-dEncodeMonoImages=false";
       pdf_argv[pdf_argc++] = (char *)"-dEncodeColorImages=false";
@@ -1044,7 +1044,7 @@ pdftops(int inputfd,         /* I - File descriptor input stream */
        !strncasecmp(make_model, "Toshiba", 7))
     {
       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                  "pdftops: To work around a bug in Toshiba's PS "
+                  "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");
       pdf_argv[pdf_argc++] = (char *)"-dHaveTrueTypes=false";
@@ -1116,7 +1116,7 @@ pdftops(int inputfd,         /* I - File descriptor input stream */
     if (pipe(pstops_pipe))
     {
       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                  "pdftops: Unable to create pipe for pstops: %s",
+                  "cfFilterPDFToPS: Unable to create pipe for cfFilterPSToPS: %s",
                   strerror(errno));
 
       exit_status = 1;
@@ -1129,7 +1129,7 @@ pdftops(int inputfd,         /* I - File descriptor input stream */
     if (pipe(post_proc_pipe))
     {
       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                  "pdftops: Unable to create pipe for post-processing: %s",
+                  "cfFilterPDFToPS: Unable to create pipe for post-processing: %s",
                   strerror(errno));
 
       exit_status = 1;
@@ -1162,21 +1162,21 @@ pdftops(int inputfd,         /* I - File descriptor input stream */
     {
       execvp(CUPS_POPPLER_PDFTOPS, pdf_argv);
       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                  "pdftops: Unable to execute pdftops program: %s",
+                  "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,
-                  "pdftops: Unable to execute gs program: %s",
+                  "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,
-                  "pdftops: Unable to execute pdftocairo program: %s",
+                  "cfFilterPDFToPS: Unable to execute pdftocairo program: %s",
                   strerror(errno));
     }
     else if (renderer == ACROREAD)
@@ -1193,14 +1193,14 @@ pdftops(int inputfd,         /* I - File descriptor input stream */
      
       execvp(CUPS_ACROREAD, pdf_argv);
       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                  "pdftops: Unable to execute acroread program: %s",
+                  "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,
-                  "pdftops: Unable to execute mutool program: %s",
+                  "cfFilterPDFToPS: Unable to execute mutool program: %s",
                   strerror(errno));
     }
 
@@ -1216,23 +1216,23 @@ pdftops(int inputfd,         /* I - File descriptor input stream */
     {
       if (renderer == PDFTOPS)
        log(ld, FILTER_LOGLEVEL_ERROR,
-           "pdftops: Unable to execute pdftops program: %s",
+           "cfFilterPDFToPS: Unable to execute pdftops program: %s",
            strerror(errno));
       else if (renderer == GS)
        log(ld, FILTER_LOGLEVEL_ERROR,
-           "pdftops: Unable to execute gs program: %s",
+           "cfFilterPDFToPS: Unable to execute gs program: %s",
            strerror(errno));
       else if (renderer == PDFTOCAIRO)
        log(ld, FILTER_LOGLEVEL_ERROR,
-           "pdftops: Unable to execute pdftocairo program: %s",
+           "cfFilterPDFToPS: Unable to execute pdftocairo program: %s",
            strerror(errno));
       else if (renderer == ACROREAD)
        log(ld, FILTER_LOGLEVEL_ERROR,
-           "pdftops: Unable to execute acroread program: %s",
+           "cfFilterPDFToPS: Unable to execute acroread program: %s",
            strerror(errno));
       else if (renderer == MUPDF)
        log(ld, FILTER_LOGLEVEL_ERROR,
-           "pdftops: Unable to execute mutool program: %s",
+           "cfFilterPDFToPS: Unable to execute mutool program: %s",
            strerror(errno));
     }
 
@@ -1241,7 +1241,7 @@ pdftops(int inputfd,         /* I - File descriptor input stream */
   }
 
   if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-              "pdftops: Started filter %s (PID %d)", pdf_argv[0], pdf_pid);
+              "cfFilterPDFToPS: Started filter %s (PID %d)", pdf_argv[0], pdf_pid);
 
   if (need_post_proc)
   {
@@ -1310,7 +1310,7 @@ pdftops(int inputfd,         /* I - File descriptor input stream */
          {
            /* No Prolog section, create one */
            if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                        "pdftops: Adding Prolog section for workaround "
+                        "cfFilterPDFToPS: Adding Prolog section for workaround "
                         "PostScript code");
            puts("%%BeginProlog");
          }
@@ -1341,7 +1341,7 @@ pdftops(int inputfd,         /* I - File descriptor input stream */
                !strncasecmp(make_model, "Utax", 4))
            {
              if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                          "pdftops: Inserted workaround PostScript code for "
+                          "cfFilterPDFToPS: Inserted workaround PostScript code for "
                           "Kyocera and Utax printers");
              puts("% ===== Workaround insertion by pdftops CUPS filter =====");
              puts("% Kyocera's/Utax's PostScript interpreter crashes on "
@@ -1377,7 +1377,7 @@ pdftops(int inputfd,         /* I - File descriptor input stream */
            else if (!strncasecmp(make_model, "Brother", 7))
            {
              if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                          "pdftops: Inserted workaround PostScript code for "
+                          "cfFilterPDFToPS: Inserted workaround PostScript code for "
                           "Brother printers");
              puts("% ===== Workaround insertion by pdftops CUPS filter =====");
              puts("% Brother's PostScript interpreter spits out the current "
@@ -1426,7 +1426,7 @@ pdftops(int inputfd,         /* I - File descriptor input stream */
              {
                /* No Setup section, create one */
                if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                            "pdftops: Adding Setup section for option "
+                            "cfFilterPDFToPS: Adding Setup section for option "
                             "PostScript code");
                puts("%%BeginSetup");
              }
@@ -1587,7 +1587,7 @@ pdftops(int inputfd,         /* I - File descriptor input stream */
       */
 
       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                  "pdftops: Unable to execute post-processing process: %s",
+                  "cfFilterPDFToPS: Unable to execute post-processing process: %s",
                   strerror(errno));
 
       exit_status = 1;
@@ -1595,7 +1595,7 @@ pdftops(int inputfd,         /* I - File descriptor input stream */
     }
 
     if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                "pdftops: Started post-processing (PID %d)", post_proc_pid);
+                "cfFilterPDFToPS: Started post-processing (PID %d)", post_proc_pid);
   }
 
   if (ppd)
@@ -1613,11 +1613,11 @@ pdftops(int inputfd,         /* I - File descriptor input stream */
        close(post_proc_pipe[1]);
       }
 
-      ret = pstops(pstops_pipe[0], outputfd, 0, &pstops_filter_data, NULL);
+      ret = cfFilterPSToPS(pstops_pipe[0], outputfd, 0, &pstops_filter_data, NULL);
       close(pstops_pipe[0]);
 
       if (ret && log) log(ld, FILTER_LOGLEVEL_ERROR,
-                         "pdftops: pstops filter function failed.");
+                         "cfFilterPDFToPS: pstops filter function failed.");
 
       close(outputfd);
       exit(ret);
@@ -1629,7 +1629,7 @@ pdftops(int inputfd,         /* I - File descriptor input stream */
       */
 
       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                  "pdftops: Unable to execute pstops program: %s",
+                  "cfFilterPDFToPS: Unable to execute pstops program: %s",
                   strerror(errno));
 
       exit_status = 1;
@@ -1637,7 +1637,7 @@ pdftops(int inputfd,         /* I - File descriptor input stream */
     }
 
     if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                "pdftops: Started filter pstops (PID %d)", pstops_pid);
+                "cfFilterPDFToPS: Started filter pstops (PID %d)", pstops_pid);
 
     close(pstops_pipe[0]);
     close(pstops_pipe[1]);
@@ -1688,7 +1688,7 @@ pdftops(int inputfd,         /* I - File descriptor input stream */
        exit_status = WEXITSTATUS(wait_status);
 
        if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                    "pdftops: PID %d (%s) stopped with status %d!",
+                    "cfFilterPDFToPS: PID %d (%s) stopped with status %d!",
                     wait_pid,
                     wait_pid == pdf_pid ?
                     (renderer == PDFTOPS ? "pdftops" :
@@ -1705,7 +1705,7 @@ pdftops(int inputfd,         /* I - File descriptor input stream */
       else if (WTERMSIG(wait_status) == SIGTERM)
       {
        if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                    "pdftops: PID %d (%s) was terminated normally with "
+                    "cfFilterPDFToPS: PID %d (%s) was terminated normally with "
                     "signal %d!",
                     wait_pid,
                     wait_pid == pdf_pid ?
@@ -1725,7 +1725,7 @@ pdftops(int inputfd,         /* I - File descriptor input stream */
        exit_status = WTERMSIG(wait_status);
 
        if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                    "pdftops: PID %d (%s) crashed on signal %d!",
+                    "cfFilterPDFToPS: PID %d (%s) crashed on signal %d!",
                     wait_pid,
                     wait_pid == pdf_pid ?
                     (renderer == PDFTOPS ? "pdftops" :
@@ -1743,7 +1743,7 @@ pdftops(int inputfd,         /* I - File descriptor input stream */
     else
     {
       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                  "pdftops: PID %d (%s) exited with no errors.",
+                  "cfFilterPDFToPS: PID %d (%s) exited with no errors.",
                   wait_pid,
                   wait_pid == pdf_pid ?
                   (renderer == PDFTOPS ? "pdftops" :
@@ -1765,7 +1765,7 @@ pdftops(int inputfd,         /* I - File descriptor input stream */
   error:
 
   if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-              "pdftops: Closing files ...");
+              "cfFilterPDFToPS: Closing files ...");
 
   close(outputfd);
 
index 33c98fd5d252fc0e741380fac3885ac614a77ba4..cbff99a2e63784dc84d951f309fbc8fc6e87b8b9 100644 (file)
@@ -296,12 +296,12 @@ static void  handleRqeuiresPageRegion(pdftoraster_doc_t*doc) {
   }
 }
 
-static int parseOpts(filter_data_t *data,
+static int parseOpts(cf_filter_data_t *data,
                     void *parameters,
                     pdftoraster_doc_t *doc)
 {
 #ifdef HAVE_CUPS_1_7
-  filter_out_format_t outformat;
+  cf_filter_out_format_t outformat;
 #endif /* HAVE_CUPS_1_7 */
   int num_options = 0;
   cups_option_t *options = NULL;
@@ -314,7 +314,7 @@ static int parseOpts(filter_data_t *data,
   ipp_t *printer_attrs = data->printer_attrs;
   cups_cspace_t cspace = (cups_cspace_t)(-1);
 
-  /* Note: With the OUTPUT_FORMAT_APPLE_RASTER or OUTPUT_FORMAT_PCLM
+  /* Note: With the CF_FILTER_OUT_FORMAT_APPLE_RASTER or CF_FILTER_OUT_FORMAT_PCLM
      selections the output is actually CUPS Raster but information
      about available color spaces and depths is taken from the
      urf-supported printer IPP attribute or the appropriate PPD file
@@ -324,21 +324,21 @@ static int parseOpts(filter_data_t *data,
      this filter. */
 
   if (parameters) {
-    outformat = *(filter_out_format_t *)parameters;
-    if (outformat != OUTPUT_FORMAT_CUPS_RASTER &&
-       outformat != OUTPUT_FORMAT_PWG_RASTER &&
-       outformat != OUTPUT_FORMAT_APPLE_RASTER &&
-       outformat != OUTPUT_FORMAT_PCLM)
-      outformat = OUTPUT_FORMAT_CUPS_RASTER;
+    outformat = *(cf_filter_out_format_t *)parameters;
+    if (outformat != CF_FILTER_OUT_FORMAT_CUPS_RASTER &&
+       outformat != CF_FILTER_OUT_FORMAT_PWG_RASTER &&
+       outformat != CF_FILTER_OUT_FORMAT_APPLE_RASTER &&
+       outformat != CF_FILTER_OUT_FORMAT_PCLM)
+      outformat = CF_FILTER_OUT_FORMAT_CUPS_RASTER;
   } else
-    outformat = OUTPUT_FORMAT_CUPS_RASTER;
+    outformat = CF_FILTER_OUT_FORMAT_CUPS_RASTER;
 
   if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-              "pdftoraster: Output format: %s",
-              (outformat == OUTPUT_FORMAT_CUPS_RASTER ? "CUPS Raster" :
+              "cfFilterPDFToRaster: Output format: %s",
+              (outformat == CF_FILTER_OUT_FORMAT_CUPS_RASTER ? "CUPS Raster" :
                "PWG Raster"));
 
-  if (outformat == OUTPUT_FORMAT_PWG_RASTER)
+  if (outformat == CF_FILTER_OUT_FORMAT_PWG_RASTER)
     doc->pwgraster = 1;
 
   num_options = joinJobOptionsAndAttrs(data, num_options, &options);
@@ -353,11 +353,11 @@ static int parseOpts(filter_data_t *data,
     handleRqeuiresPageRegion(doc);
   } else
     if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-      "pdftoraster: PPD file is not specified.");
+      "cfFilterPDFToRaster: PPD file is not specified.");
 
   cupsRasterPrepareHeader(&(doc->header), data, outformat,
-                         (outformat == OUTPUT_FORMAT_PWG_RASTER ?
-                          outformat : OUTPUT_FORMAT_CUPS_RASTER), 0,
+                         (outformat == CF_FILTER_OUT_FORMAT_PWG_RASTER ?
+                          outformat : CF_FILTER_OUT_FORMAT_CUPS_RASTER), 0,
                          &cspace);
 
   if (doc->ppd) {
@@ -521,7 +521,7 @@ static int parseOpts(filter_data_t *data,
                            && !strncasecmp(val, "bi-level", 8))
     doc->bi_level = 1;
   if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-    "pdftoraster: Page size requested: %s", doc->header.cupsPageSizeName);
+    "cfFilterPDFToRaster: Page size requested: %s", doc->header.cupsPageSizeName);
 
   if (num_options)
     cupsFreeOptions(num_options, options);
@@ -1149,7 +1149,7 @@ static int selectConvertFunc(cups_raster_t *raster, pdftoraster_doc_t* doc, conv
                            BYTES_SH(bytes),
                            doc->colour_profile.renderingIntent,0)) == 0) {
       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                  "pdftoraster: Can't create color transform.");
+                  "cfFilterPDFToRaster: Can't create color transform.");
       return (1);
     }
   } else {
@@ -1221,7 +1221,7 @@ static int selectConvertFunc(cups_raster_t *raster, pdftoraster_doc_t* doc, conv
       break;
     default:
       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                  "pdftoraster: Specified ColorSpace is not supported");
+                  "cfFilterPDFToRaster: Specified ColorSpace is not supported");
       return (1);
     }
   }
@@ -1260,7 +1260,7 @@ static unsigned char *removeAlpha(unsigned char *src, unsigned char *dst, unsign
 }
 
 static void writePageImage(cups_raster_t *raster, pdftoraster_doc_t *doc,
-  int pageNo, conversion_function_t* convert, filter_iscanceledfunc_t iscanceled, void *icd)
+  int pageNo, conversion_function_t* convert, cf_filter_iscanceledfunc_t iscanceled, void *icd)
 {
   ConvertLineFunc convertLine;
   unsigned char *lineBuf = NULL;
@@ -1360,8 +1360,8 @@ static void writePageImage(cups_raster_t *raster, pdftoraster_doc_t *doc,
   if (doc->allocLineBuf) delete[] lineBuf;
 }
 
-static int outPage(pdftoraster_doc_t *doc, int pageNo, filter_data_t *data,
-  cups_raster_t *raster, conversion_function_t *convert, filter_logfunc_t log, void* ld, filter_iscanceledfunc_t iscanceled, void *icd)
+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)
 {
   int rotate = 0;
   double paperdimensions[2], /* Physical size of the paper */
@@ -1387,7 +1387,7 @@ static int outPage(pdftoraster_doc_t *doc, int pageNo, filter_data_t *data,
      default:rotate=0;
   }
   if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-              "pdftoraster: mediabox = [ %f %f %f %f ]; rotate = %d",
+              "cfFilterPDFToRaster: mediabox = [ %f %f %f %f ]; rotate = %d",
               mediaBox.left(), mediaBox.top(), mediaBox.right(),
               mediaBox.bottom(), rotate);
   l = mediaBox.width();
@@ -1494,7 +1494,7 @@ static int outPage(pdftoraster_doc_t *doc, int pageNo, filter_data_t *data,
   }
   if (!cupsRasterWriteHeader2(raster,&(doc->header))) {
     if (log) log(ld,FILTER_LOGLEVEL_ERROR,
-                "pdftoraster: Cannot write page %d header", pageNo);
+                "cfFilterPDFToRaster: Cannot write page %d header", pageNo);
     return (1);
   }
 
@@ -1583,17 +1583,17 @@ static int setPopplerColorProfile(pdftoraster_doc_t *doc, filter_logfunc_t log,
     break;
   default:
     if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                "pdftoraster: Specified ColorSpace is not supported");
+                "cfFilterPDFToRaster: Specified ColorSpace is not supported");
     return (1);
     break;
   }
   return (0);
 }
 
-int pdftoraster(int inputfd,         /* I - File descriptor input stream */
+int cfFilterPDFToRaster(int inputfd,         /* I - File descriptor input stream */
        int outputfd,                 /* I - File descriptor output stream */
        int inputseekable,            /* I - Is input stream seekable? (unused)*/
-       filter_data_t *data,          /* I - Job and printer data */
+       cf_filter_data_t *data,          /* I - Job and printer data */
        void *parameters)             /* I - Filter-specific parameters */
 {
   pdftoraster_doc_t doc;
@@ -1606,7 +1606,7 @@ int pdftoraster(int inputfd,         /* I - File descriptor input stream */
   int deviceCopies = 1;
   bool deviceCollate = false;
   conversion_function_t convert;
-  filter_iscanceledfunc_t iscanceled = data->iscanceledfunc;
+  cf_filter_iscanceledfunc_t iscanceled = data->iscanceledfunc;
   void                 *icd = data->iscanceleddata;
   int ret = 0;
 
@@ -1622,7 +1622,7 @@ int pdftoraster(int inputfd,         /* I - File descriptor input stream */
     if (!iscanceled || !iscanceled(icd))
     {
       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                  "pdftoraster: Unable to open input data stream.");
+                  "cfFilterPDFToRaster: Unable to open input data stream.");
     }
 
     return (1);
@@ -1641,7 +1641,7 @@ int pdftoraster(int inputfd,         /* I - File descriptor input stream */
   fd = cupsTempFd(name,sizeof(name));
   if (fd < 0) {
     if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                "pdftoraster: Can't create temporary file.");
+                "cfFilterPDFToRaster: Can't create temporary file.");
     return (1);
   }
 
@@ -1649,7 +1649,7 @@ int pdftoraster(int inputfd,         /* I - File descriptor input stream */
   while ((n = read(inputfd, buf, BUFSIZ)) > 0) {
     if (write(fd, buf, n) != n) {
       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                  "pdftoraster: Can't copy input data to temporary file.");
+                  "cfFilterPDFToRaster: Can't copy input data to temporary file.");
       close(fd);
       unlink(name);
       return (1);
@@ -1669,7 +1669,7 @@ int pdftoraster(int inputfd,         /* I - File descriptor input stream */
   FILE *fp;
   if ((fp = fdopen(inputfd,"rb")) == 0) {
     if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                "pdftoraster: Can't open input file.");
+                "cfFilterPDFToRaster: Can't open input file.");
     ret = 1;
     goto out;
   }
@@ -1693,7 +1693,7 @@ int pdftoraster(int inputfd,         /* I - File descriptor input stream */
      && doc.header.cupsBitsPerColor != 8
      && doc.header.cupsBitsPerColor != 16) {
     if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                  "pdftoraster: Specified color format is not supported.");
+                  "cfFilterPDFToRaster: Specified color format is not supported.");
     ret = 1;
     goto out;
   }
@@ -1731,7 +1731,7 @@ int pdftoraster(int inputfd,         /* I - File descriptor input stream */
        || (doc.header.cupsBitsPerColor != 8
           && doc.header.cupsBitsPerColor != 16)) {
       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                  "pdftoraster: Specified color format is not supported.");
+                  "cfFilterPDFToRaster: Specified color format is not supported.");
       ret = 1;
       goto out;
     }
@@ -1761,14 +1761,14 @@ int pdftoraster(int inputfd,         /* I - File descriptor input stream */
     break;
   default:
     if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                  "pdftoraster: Specified ColorSpace is not supported.");
+                  "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,
-                  "pdftoraster: Cannot set color profile.");
+                  "cfFilterPDFToRaster: Cannot set color profile.");
       ret = 1;
       goto out;
     }
@@ -1777,7 +1777,7 @@ int pdftoraster(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,
-                "pdftoraster: Cannot open raster stream.");
+                "cfFilterPDFToRaster: Cannot open raster stream.");
     ret = 1;
     goto out;
   }
@@ -1785,7 +1785,7 @@ int pdftoraster(int inputfd,         /* I - File descriptor input stream */
   if (selectConvertFunc(raster, &doc, &convert, log, ld) == 1)
   {
     if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                "pdftoraster: Unable to select color conversion function.");
+                "cfFilterPDFToRaster: Unable to select color conversion function.");
     ret = 1;
     goto out;
   }
@@ -1794,14 +1794,14 @@ int pdftoraster(int inputfd,         /* I - File descriptor input stream */
       if (outPage(&doc,i,data,raster, &convert, log, ld, iscanceled, icd) == 1)
       {
        if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                    "pdftoraster: Unable to output page %d.", i);
+                    "cfFilterPDFToRaster: Unable to output page %d.", i);
        ret = 1;
        goto out;
       }
     }
   } else
     if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                "pdftoraster: Input is empty outputting empty file.");
+                "cfFilterPDFToRaster: Input is empty outputting empty file.");
 
  out:
   if (raster)
index 20c9162674c35d2624d09a70ec732920c23bbb48..f9bc01e13d4a382a03b14889f4a5697851d9e80a 100644 (file)
@@ -127,7 +127,7 @@ typedef struct                              /**** Document information ****/
                                           logging */
   void          *logdata;               /* User data for logging function, can
                                           be NULL */
-  filter_iscanceledfunc_t iscanceledfunc; /* Function returning 1 when
+  cf_filter_iscanceledfunc_t iscanceledfunc; /* Function returning 1 when
                                            job is canceled, NULL for not
                                            supporting stop on cancel */
   void *iscanceleddata;                 /* User data for is-canceled function,
@@ -194,7 +194,7 @@ static int          set_pstops_options(pstops_doc_t *doc, ppd_file_t *ppd,
                                           cups_option_t *options,
                                           filter_logfunc_t logfunc,
                                           void *logdata,
-                                          filter_iscanceledfunc_t
+                                          cf_filter_iscanceledfunc_t
                                           iscanceledfunc,
                                           void *iscanceleddata);
 static ssize_t         skip_page(pstops_doc_t *doc,
@@ -212,16 +212,16 @@ static void               write_text_comment(pstops_doc_t *doc,
                                           const char *name, const char *value);
 
 /*
- * 'pstops()' - Filter function to insert PostScript code from
+ * 'cfFilterPSToPS()' - Filter function to insert PostScript code from
  *              PPD file (PostScript printer driver) into a 
  *              PostScript data stream
  */
 
 int                         /* O - Error status */
-pstops(int inputfd,         /* I - File descriptor input stream */
+cfFilterPSToPS(int inputfd,         /* I - File descriptor input stream */
        int outputfd,        /* I - File descriptor output stream */
        int inputseekable,   /* I - Is input stream seekable? (unused) */
-       filter_data_t *data, /* I - Job and printer data */
+       cf_filter_data_t *data, /* I - Job and printer data */
        void *parameters)    /* I - Filter-specific parameters (unused) */
 {
   pstops_doc_t doc;                    /* Document information */
@@ -233,7 +233,7 @@ pstops(int inputfd,         /* I - File descriptor input stream */
   pstops_page_t *pageinfo;
   filter_logfunc_t log = data->logfunc;
   void          *ld = data->logdata;
-  filter_iscanceledfunc_t iscanceled = data->iscanceledfunc;
+  cf_filter_iscanceledfunc_t iscanceled = data->iscanceledfunc;
   void          *icd = data->iscanceleddata;
    int proc_pipe[2];
    int pstops_pid = 0; 
@@ -269,7 +269,7 @@ pstops(int inputfd,         /* I - File descriptor input stream */
      if(pipe(proc_pipe))
      {
         if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                  "pstops: Unable to create pipe for input-page-ranges");
+                  "cfFilterPSToPS: Unable to create pipe for input-page-ranges");
                   return (1);
      }
     if ((pstops_pid = fork()) == 0)
@@ -281,7 +281,7 @@ pstops(int inputfd,         /* I - File descriptor input stream */
         if (!iscanceled || !iscanceled(icd))
         {
         if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                    "pstops: Unable to open input data stream.");
+                    "cfFilterPSToPS: Unable to open input data stream.");
         }
 
      exit (1);
@@ -345,7 +345,7 @@ pstops(int inputfd,         /* I - File descriptor input stream */
     if (!iscanceled || !iscanceled(icd))
     {
       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                  "pstops: Unable to open input data stream.");
+                  "cfFilterPSToPS: Unable to open input data stream.");
     }
 
     return (1);
@@ -360,7 +360,7 @@ pstops(int inputfd,         /* I - File descriptor input stream */
     if (!iscanceled || !iscanceled(icd))
     {
       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                  "pstops: Unable to open output data stream.");
+                  "cfFilterPSToPS: Unable to open output data stream.");
     }
 
     cupsFileClose(inputfp);
@@ -375,7 +375,7 @@ pstops(int inputfd,         /* I - File descriptor input stream */
   if ((len = (ssize_t)cupsFileGetLine(inputfp, line, sizeof(line))) == 0)
   {
     if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                "pstops: The print file is empty.");
+                "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. */
     return (0);
@@ -415,7 +415,7 @@ pstops(int inputfd,         /* I - File descriptor input stream */
     */
 
     if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                "pstops: Skipping PJL header...");
+                "cfFilterPSToPS: Skipping PJL header...");
 
     while (strstr(line, "ENTER LANGUAGE") == NULL && strncmp(line, "%!", 2))
       if ((len = (ssize_t)cupsFileGetLine(inputfp, line, sizeof(line))) == 0)
@@ -502,7 +502,7 @@ pstops(int inputfd,         /* I - File descriptor input stream */
           if (errno == EINTR)
             goto retry_wait;
           if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-          "pstops: Error while waiting for input_page_ranges to finish - %s.",
+          "cfFilterPSToPS: Error while waiting for input_page_ranges to finish - %s.",
           strerror(errno));
         }
         /* How did the sub-process terminate */
@@ -510,18 +510,18 @@ pstops(int inputfd,         /* I - File descriptor input stream */
       if (WIFEXITED(childStatus)) {
        /* Via exit() anywhere or return() in the main() function */
        if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                    "pstops: input-page-ranges filter (PID %d) stopped with status %d",
+                    "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,
-                    "pstops: imput-page-ranges filter (PID %d) crashed on signal %d",
+                    "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,
-                  "pstops: input-page-ranges-filter (PID %d) exited with no errors.",
+                  "cfFilterPSToPS: input-page-ranges-filter (PID %d) exited with no errors.",
                   pstops_pid);
     }
   }
@@ -555,14 +555,14 @@ add_page(pstops_doc_t *doc,               /* I - Document information */
   if (!doc->pages)
   {
     if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                "pstops: Unable to allocate memory for pages array");
+                "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,
-                "pstops: Unable to allocate memory for page info");
+                "cfFilterPSToPS: Unable to allocate memory for page info");
     return (NULL);
   }
 
@@ -738,7 +738,7 @@ copy_comments(pstops_doc_t *doc,    /* I - Document info */
     */
 
     if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                "pstops: %s", line);
+                "cfFilterPSToPS: %s", line);
 
    /*
     * Pull the headers out...
@@ -750,7 +750,7 @@ copy_comments(pstops_doc_t *doc,    /* I - Document info */
 
       if (saw_pages && log)
        log(ld, FILTER_LOGLEVEL_DEBUG,
-           "pstops: A duplicate %%Pages: comment was seen.");
+           "cfFilterPSToPS: A duplicate %%Pages: comment was seen.");
 
       saw_pages = 1;
 
@@ -805,7 +805,7 @@ copy_comments(pstops_doc_t *doc,    /* I - Document info */
       if (saw_bounding_box)
       {
        if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                    "pstops: A duplicate %%BoundingBox: comment was seen.");
+                    "cfFilterPSToPS: A duplicate %%BoundingBox: comment was seen.");
       }
       else if (strstr(line + 14, "(atend)"))
       {
@@ -818,7 +818,7 @@ copy_comments(pstops_doc_t *doc,    /* I - Document info */
                      doc->bounding_box + 3) != 4)
       {
        if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                    "pstops: A bad %%BoundingBox: comment was seen.");
+                    "cfFilterPSToPS: A bad %%BoundingBox: comment was seen.");
 
        doc->bounding_box[0] = (int)(doc->PageLeft);
        doc->bounding_box[1] = (int)(doc->PageBottom);
@@ -853,7 +853,7 @@ copy_comments(pstops_doc_t *doc,    /* I - Document info */
        */
 
        doc->Orientation = (4 - doc->Orientation + orient) & 3;
-       filterUpdatePageVars(doc->Orientation,
+       cfFilterUpdatePageVars(doc->Orientation,
                             &doc->PageLeft, &doc->PageRight,
                             &doc->PageTop, &doc->PageBottom,
                             &doc->PageWidth, &doc->PageLength);
@@ -874,11 +874,11 @@ copy_comments(pstops_doc_t *doc,  /* I - Document info */
 
   if (!saw_bounding_box && log)
     log(ld, FILTER_LOGLEVEL_DEBUG,
-       "pstops: There wasn't a %%BoundingBox: comment in the header.");
+       "cfFilterPSToPS: There wasn't a %%BoundingBox: comment in the header.");
 
   if (!saw_pages && log)
     log(ld, FILTER_LOGLEVEL_DEBUG,
-       "pstops: There wasn't a %%Pages: comment in the header.");
+       "cfFilterPSToPS: There wasn't a %%Pages: comment in the header.");
 
   if (!saw_for)
     write_text_comment(doc, "For", doc->user);
@@ -944,7 +944,7 @@ copy_dsc(pstops_doc_t *doc,         /* I - Document info */
   pstops_page_t        *pageinfo;              /* Page information */
   filter_logfunc_t log = doc->logfunc;
   void          *ld = doc->logdata;
-  filter_iscanceledfunc_t iscanceled = doc->iscanceledfunc;
+  cf_filter_iscanceledfunc_t iscanceled = doc->iscanceledfunc;
   void          *icd = doc->iscanceleddata;
 
 
@@ -963,7 +963,7 @@ copy_dsc(pstops_doc_t *doc,         /* I - Document info */
   */
 
   if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-              "pstops: Before copy_comments - %s", line);
+              "cfFilterPSToPS: Before copy_comments - %s", line);
   linelen = copy_comments(doc, ppd, line, linelen, linesize);
 
  /*
@@ -971,7 +971,7 @@ copy_dsc(pstops_doc_t *doc,         /* I - Document info */
   */
 
   if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-              "pstops: Before copy_prolog - %s", line);
+              "cfFilterPSToPS: Before copy_prolog - %s", line);
   linelen = copy_prolog(doc, ppd, line, linelen, linesize);
 
  /*
@@ -979,7 +979,7 @@ copy_dsc(pstops_doc_t *doc,         /* I - Document info */
   */
 
   if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-              "pstops: Before copy_setup - %s", line);
+              "cfFilterPSToPS: Before copy_setup - %s", line);
   linelen = copy_setup(doc, ppd, line, linelen, linesize);
 
  /*
@@ -1001,13 +1001,13 @@ copy_dsc(pstops_doc_t *doc,             /* I - Document info */
   number = 0;
 
   if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-              "pstops: Before page loop - %s", line);
+              "cfFilterPSToPS: Before page loop - %s", line);
   while (!strncmp(line, "%%Page:", 7))
   {
     if (iscanceled && iscanceled(icd))
     {
       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                  "pstops: Job canceled");
+                  "cfFilterPSToPS: Job canceled");
       break;
     }
 
@@ -1016,13 +1016,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,
-                  "pstops: Copying page %d...", number);
+                  "cfFilterPSToPS: Copying page %d...", number);
       linelen = copy_page(doc, ppd, number, line, linelen, linesize);
     }
     else
     {
       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                  "pstops: Skipping page %d...", number);
+                  "cfFilterPSToPS: Skipping page %d...", number);
       linelen = skip_page(doc, line, linelen, linesize);
     }
   }
@@ -1104,7 +1104,7 @@ copy_dsc(pstops_doc_t *doc,               /* I - Document info */
       if (iscanceled && iscanceled(icd))
       {
        if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                    "pstops: Job canceled");
+                    "cfFilterPSToPS: Job canceled");
        break;
       }
 
@@ -1165,7 +1165,7 @@ copy_dsc(pstops_doc_t *doc,               /* I - Document info */
        if (iscanceled && iscanceled(icd))
          {
            if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                        "pstops: Job canceled");
+                        "cfFilterPSToPS: Job canceled");
            break;
          }
 
@@ -1233,7 +1233,7 @@ copy_non_dsc(pstops_doc_t *doc,           /* I - Document info */
   ssize_t      bytes;                  /* Number of bytes copied */
   filter_logfunc_t log = doc->logfunc;
   void          *ld = doc->logdata;
-  filter_iscanceledfunc_t iscanceled = doc->iscanceledfunc;
+  cf_filter_iscanceledfunc_t iscanceled = doc->iscanceledfunc;
   void          *icd = doc->iscanceleddata;
 
 
@@ -1245,7 +1245,7 @@ copy_non_dsc(pstops_doc_t *doc,           /* I - Document info */
   */
 
   if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-              "pstops: This document does not conform to the Adobe Document "
+              "cfFilterPSToPS: This document does not conform to the Adobe Document "
               "Structuring Conventions and may not print correctly.");
 
  /*
@@ -1372,7 +1372,7 @@ copy_non_dsc(pstops_doc_t *doc,           /* I - Document info */
       if (iscanceled && iscanceled(icd))
       {
        if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                    "pstops: Job canceled");
+                    "cfFilterPSToPS: Job canceled");
        break;
       }
 
@@ -1443,14 +1443,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,
-                "pstops: There was a bad %%Page: comment in the file.");
+                "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,
-                "pstops: There was a bad %%Page: comment in the file.");
+                "cfFilterPSToPS: There was a bad %%Page: comment in the file.");
     number = doc->page;
   }
 
@@ -1551,7 +1551,7 @@ copy_page(pstops_doc_t *doc,              /* I - Document info */
       {
        if (log)
          log(ld, FILTER_LOGLEVEL_DEBUG,
-             "pstops: There was a bad %%PageBoundingBox: comment in the "
+             "cfFilterPSToPS: There was a bad %%PageBoundingBox: comment in the "
              "file.");
         memcpy(bounding_box, doc->bounding_box,
               sizeof(bounding_box));
@@ -1566,13 +1566,13 @@ copy_page(pstops_doc_t *doc,            /* I - Document info */
        if (log)
        {
          log(ld, FILTER_LOGLEVEL_DEBUG,
-             "pstops: Orientation = %d", doc->Orientation);
+             "cfFilterPSToPS: Orientation = %d", doc->Orientation);
          log(ld, FILTER_LOGLEVEL_DEBUG,
-             "pstops: original bounding_box = [ %d %d %d %d ]",
+             "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,
-             "pstops: PageWidth = %.1f, PageLength = %.1f",
+             "cfFilterPSToPS: PageWidth = %.1f, PageLength = %.1f",
              doc->PageWidth, doc->PageLength);
        }
 
@@ -1601,7 +1601,7 @@ copy_page(pstops_doc_t *doc,              /* I - Document info */
        }
 
        if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                    "pstops: updated bounding_box = [ %d %d %d %d ]",
+                    "cfFilterPSToPS: updated bounding_box = [ %d %d %d %d ]",
                     bounding_box[0], bounding_box[1],
                     bounding_box[2], bounding_box[3]);
       }
@@ -1859,7 +1859,7 @@ copy_page(pstops_doc_t *doc,              /* I - Document info */
          line[0] = '\0';
          if (log)
            log(ld, FILTER_LOGLEVEL_ERROR,
-               "pstops: Early end-of-file while reading binary data: %s",
+               "cfFilterPSToPS: Early end-of-file while reading binary data: %s",
                strerror(errno));
          return (0);
        }
@@ -1937,7 +1937,7 @@ copy_prolog(pstops_doc_t *doc,            /* I - Document info */
       linelen = (ssize_t)cupsFileGetLine(doc->inputfp, line, linesize);
     else
       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                  "pstops: The %%EndProlog comment is missing.");
+                  "cfFilterPSToPS: The %%EndProlog comment is missing.");
   }
 
   doc_puts(doc, "%%EndProlog\n");
@@ -2011,7 +2011,7 @@ copy_setup(pstops_doc_t *doc,             /* I - Document info */
       linelen = (ssize_t)cupsFileGetLine(doc->inputfp, line, linesize);
     else
       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                  "pstops: The %%EndSetup comment is missing.");
+                  "cfFilterPSToPS: The %%EndSetup comment is missing.");
   }
 
   if (num_options > 0)
@@ -2066,7 +2066,7 @@ copy_trailer(pstops_doc_t *doc,           /* I - Document info */
   }
 
   if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-              "pstops: Wrote %d pages...", number);
+              "cfFilterPSToPS: Wrote %d pages...", number);
 
   fprintf(doc->outputfp, "%%%%Pages: %d\n", number);
   if (doc->number_up > 1 || doc->fit_to_page)
@@ -2254,7 +2254,7 @@ doc_printf(pstops_doc_t *doc,             /* I - Document information */
   if ((size_t)bytes > sizeof(buffer))
   {
     if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                "pstops: Buffer overflow detected, truncating.");
+                "cfFilterPSToPS: Buffer overflow detected, truncating.");
     bytes = sizeof(buffer);
   }
 
@@ -2388,7 +2388,7 @@ include_feature(
   if (sscanf(line + 17, "%254s%254s", name, value) != 2)
   {
     if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                "pstops: The %%IncludeFeature: comment is not valid.");
+                "cfFilterPSToPS: The %%IncludeFeature: comment is not valid.");
     return (num_options);
   }
 
@@ -2399,7 +2399,7 @@ include_feature(
   if ((option = ppdFindOption(ppd, name + 1)) == NULL)
   {
     if (log) log(ld, FILTER_LOGLEVEL_WARN,
-                "pstops: Unknown option \"%s\".", name + 1);
+                "cfFilterPSToPS: Unknown option \"%s\".", name + 1);
     return (num_options);
   }
 
@@ -2407,7 +2407,7 @@ include_feature(
       option->section == PPD_ORDER_JCL)
   {
     if (log) log(ld, FILTER_LOGLEVEL_WARN,
-                "pstops: Option \"%s\" cannot be included via "
+                "cfFilterPSToPS: Option \"%s\" cannot be included via "
                 "%%%%IncludeFeature.", name + 1);
     return (num_options);
   }
@@ -2415,7 +2415,7 @@ include_feature(
   if (!ppdFindChoice(option, value))
   {
     if (log) log(ld, FILTER_LOGLEVEL_WARN,
-                "pstops: Unknown choice \"%s\" for option \"%s\".",
+                "cfFilterPSToPS: Unknown choice \"%s\" for option \"%s\".",
                 value, name + 1);
     return (num_options);
   }
@@ -2535,7 +2535,7 @@ set_pstops_options(
                                               NULL for no logging */
     void *logdata,                      /* I - User data for logging function,
                                               can be NULL */
-    filter_iscanceledfunc_t iscanceledfunc, /* I - Function returning 1 when
+    cf_filter_iscanceledfunc_t iscanceledfunc, /* I - Function returning 1 when
                                               job is canceled, NULL for not
                                               supporting stop on cancel */
     void *iscanceleddata)               /* I - User data for is-canceled
@@ -2550,7 +2550,7 @@ set_pstops_options(
   int          max_copies;             /* Maximum number of copies supported */
   filter_logfunc_t log = logfunc;
   void          *ld = logdata;
-  filter_iscanceledfunc_t iscanceled = iscanceledfunc;
+  cf_filter_iscanceledfunc_t iscanceled = iscanceledfunc;
   void          *icd = iscanceleddata;
 
 
@@ -2577,7 +2577,7 @@ set_pstops_options(
   doc->iscanceleddata = icd;
 
   /* Set some common values */
-  filterSetCommonOptions(ppd, num_options, options, 1,
+  cfFilterSetCommonOptions(ppd, num_options, options, 1,
                         &doc->Orientation, &doc->Duplex,
                         &doc->LanguageLevel, &doc->ColorDevice,
                         &doc->PageLeft, &doc->PageRight,
@@ -2717,7 +2717,7 @@ set_pstops_options(
          break;
       default :
          if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                      "pstops: Unsupported number-up value %d, using "
+                      "cfFilterPSToPS: Unsupported number-up value %d, using "
                       "number-up=1.", intval);
           doc->number_up = 1;
          break;
@@ -2751,7 +2751,7 @@ set_pstops_options(
     else
     {
       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                  "pstops: Unsupported number-up-layout value %s, using "
+                  "cfFilterPSToPS: Unsupported number-up-layout value %s, using "
                   "number-up-layout=lrtb.", val);
       doc->number_up_layout = PSTOPS_LAYOUT_LRTB;
     }
@@ -2802,7 +2802,7 @@ set_pstops_options(
     else
     {
       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                  "pstops: Unsupported page-border value %s, using "
+                  "cfFilterPSToPS: Unsupported page-border value %s, using "
                   "page-border=none.", val);
       doc->page_border = PSTOPS_BORDERNONE;
     }
@@ -2914,7 +2914,7 @@ set_pstops_options(
                                    sizeof(doc->tempfile))) == NULL)
     {
       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                  "pstops: Unable to create temporary file: %s",
+                  "cfFilterPSToPS: Unable to create temporary file: %s",
                   strerror(errno));
       return (1);
     }
@@ -2935,7 +2935,7 @@ set_pstops_options(
   }
 
   if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-              "pstops: slow_collate=%d, slow_duplex=%d, slow_order=%d",
+              "cfFilterPSToPS: slow_collate=%d, slow_duplex=%d, slow_order=%d",
               doc->slow_collate, doc->slow_duplex, doc->slow_order);
 
   return(0);
@@ -2994,7 +2994,7 @@ skip_page(pstops_doc_t *doc,              /* I - Document information */
          line[0] = '\0';
          if (log)
            log(ld, FILTER_LOGLEVEL_ERROR,
-               "pstops: Early end-of-file while reading binary data: %s",
+               "cfFilterPSToPS: Early end-of-file while reading binary data: %s",
                strerror(errno));
          return (0);
        }
@@ -3058,18 +3058,18 @@ start_nup(pstops_doc_t *doc,            /* I - Document information */
   if (log)
   {
     log(ld, FILTER_LOGLEVEL_DEBUG,
-       "pstops: pagew = %.1f, pagel = %.1f", pagew, pagel);
+       "cfFilterPSToPS: pagew = %.1f, pagel = %.1f", pagew, pagel);
     log(ld, FILTER_LOGLEVEL_DEBUG,
-       "pstops: bboxx = %d, bboxy = %d, bboxw = %d, bboxl = %d",
+       "cfFilterPSToPS: bboxx = %d, bboxy = %d, bboxw = %d, bboxl = %d",
        bboxx, bboxy, bboxw, bboxl);
     log(ld, FILTER_LOGLEVEL_DEBUG,
-       "pstops: PageLeft = %.1f, PageRight = %.1f",
+       "cfFilterPSToPS: PageLeft = %.1f, PageRight = %.1f",
        doc->PageLeft, doc->PageRight);
     log(ld, FILTER_LOGLEVEL_DEBUG,
-       "pstops: PageTop = %.1f, PageBottom = %.1f",
+       "cfFilterPSToPS: PageTop = %.1f, PageBottom = %.1f",
        doc->PageTop, doc->PageBottom);
     log(ld, FILTER_LOGLEVEL_DEBUG,
-       "pstops: PageWidth = %.1f, PageLength = %.1f",
+       "cfFilterPSToPS: PageWidth = %.1f, PageLength = %.1f",
        doc->PageWidth, doc->PageLength);
   }
 
index 833b4f790ba6970a5c1b649ef56dffd54c32d1b4..c0f50cd5123ebfaec99711958e35640e8c459653 100644 (file)
@@ -286,8 +286,8 @@ static void  handleRequiresPageRegion(pwgtoraster_doc_t*doc) {
   }
 }
 
-static int parseOpts(filter_data_t *data,
-                    filter_out_format_t outformat,
+static int parseOpts(cf_filter_data_t *data,
+                    cf_filter_out_format_t outformat,
                     pwgtoraster_doc_t *doc)
 {
   int num_options = 0;
@@ -315,14 +315,14 @@ static int parseOpts(filter_data_t *data,
      cupsGetOption("media-col", num_options, options));
 
   // We can directly create CUPS Raster, PWG Raster, and Apple Raster but
-  // for PCLm we have to output CUPS Raster and feed it into rastertopdf()
+  // for PCLm we have to output CUPS Raster and feed it into cfFilterRasterToPDF()
   cupsRasterPrepareHeader(&(doc->outheader), data, outformat,
-                         outformat == OUTPUT_FORMAT_PCLM ?
-                         OUTPUT_FORMAT_CUPS_RASTER : outformat, 0, &cspace);
+                         outformat == CF_FILTER_OUT_FORMAT_PCLM ?
+                         CF_FILTER_OUT_FORMAT_CUPS_RASTER : outformat, 0, &cspace);
 
   if (doc->ppd) {
     if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                "pwgtoraster: Using PPD file: %s", doc->ppd->nickname);
+                "cfFilterPWGToRaster: Using PPD file: %s", doc->ppd->nickname);
     ppdMarkOptions(doc->ppd,num_options,options);
     handleRequiresPageRegion(doc);
     attr = ppdFindAttr(doc->ppd,"pwgtorasterRenderingIntent",NULL);
@@ -398,7 +398,7 @@ static int parseOpts(filter_data_t *data,
     }
   } else {
     if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-      "pwgtoraster: No PPD file is specified.");
+      "cfFilterPWGToRaster: No PPD file is specified.");
     if (strcasecmp(doc->outheader.cupsRenderingIntent, "Perceptual") == 0) {
       doc->color_profile.renderingIntent = INTENT_PERCEPTUAL;
     } else if (strcasecmp(doc->outheader.cupsRenderingIntent, "Relative") == 0) {
@@ -414,7 +414,7 @@ static int parseOpts(filter_data_t *data,
     doc->bi_level = 1;
 
   if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-              "pwgtoraster: Page size %s: %s",
+              "cfFilterPWGToRaster: Page size %s: %s",
               doc->page_size_requested ? "requested" : "default",
               doc->outheader.cupsPageSizeName);
 
@@ -1010,7 +1010,7 @@ static int selectConvertFunc(cups_raster_t *raster,
                            BYTES_SH(bytes),
                            doc->color_profile.renderingIntent,0)) == 0) {
       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                  "pwgtoraster: Can't create color transform.");
+                  "cfFilterPWGToRaster: Can't create color transform.");
       return (1);
     }
   } else {
@@ -1082,7 +1082,7 @@ static int selectConvertFunc(cups_raster_t *raster,
       break;
     default:
       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                  "pwgtoraster: Specified ColorSpace is not supported");
+                  "cfFilterPWGToRaster: Specified ColorSpace is not supported");
       return (1);
       break;
     }
@@ -1103,7 +1103,7 @@ static bool outPage(pwgtoraster_doc_t *doc,
                    conversion_function_t *convert,
                    filter_logfunc_t log,
                    void *ld,
-                   filter_iscanceledfunc_t iscanceled,
+                   cf_filter_iscanceledfunc_t iscanceled,
                    void *icd)
 {
   int i, j;
@@ -1136,7 +1136,7 @@ static bool outPage(pwgtoraster_doc_t *doc,
   {
     // Canceled
     log(ld, FILTER_LOGLEVEL_DEBUG,
-       "pwgtoraster: Job canceled on input page %d", pageNo);
+       "cfFilterPWGToRaster: Job canceled on input page %d", pageNo);
     return (false);
   }
 
@@ -1144,7 +1144,7 @@ static bool outPage(pwgtoraster_doc_t *doc,
   {
     // Done
     log(ld, FILTER_LOGLEVEL_DEBUG,
-       "pwgtoraster: Job completed");
+       "cfFilterPWGToRaster: Job completed");
     return (false);
   }
 
@@ -1159,37 +1159,37 @@ static bool outPage(pwgtoraster_doc_t *doc,
     // filter function) these values are all zero. With at least one not
     // zero we consider the input not supported.
     log(ld, FILTER_LOGLEVEL_ERROR,
-       "pwgtoraster: Input page %d is not PWG or Apple Raster", pageNo);
+       "cfFilterPWGToRaster: Input page %d is not PWG or Apple Raster", pageNo);
     return (false);
   }
   
   if (log) {
     log(ld, FILTER_LOGLEVEL_DEBUG,
-       "pwgtoraster: Input page %d", pageNo);
+       "cfFilterPWGToRaster: Input page %d", pageNo);
     log(ld, FILTER_LOGLEVEL_DEBUG,
-       "pwgtoraster:   HWResolution = [ %d %d ]",
+       "cfFilterPWGToRaster:   HWResolution = [ %d %d ]",
        doc->inheader.HWResolution[0], doc->inheader.HWResolution[1]);
     log(ld, FILTER_LOGLEVEL_DEBUG,
-       "pwgtoraster:   PageSize = [ %d %d ]",
+       "cfFilterPWGToRaster:   PageSize = [ %d %d ]",
        doc->inheader.PageSize[0], doc->inheader.PageSize[1]);
     log(ld, FILTER_LOGLEVEL_DEBUG,
-       "pwgtoraster:   cupsWidth = %d", doc->inheader.cupsWidth);
+       "cfFilterPWGToRaster:   cupsWidth = %d", doc->inheader.cupsWidth);
     log(ld, FILTER_LOGLEVEL_DEBUG,
-       "pwgtoraster:   cupsHeight = %d", doc->inheader.cupsHeight);
+       "cfFilterPWGToRaster:   cupsHeight = %d", doc->inheader.cupsHeight);
     log(ld, FILTER_LOGLEVEL_DEBUG,
-       "pwgtoraster:   cupsBitsPerColor = %d", doc->inheader.cupsBitsPerColor);
+       "cfFilterPWGToRaster:   cupsBitsPerColor = %d", doc->inheader.cupsBitsPerColor);
     log(ld, FILTER_LOGLEVEL_DEBUG,
-       "pwgtoraster:   cupsBitsPerPixel = %d", doc->inheader.cupsBitsPerPixel);
+       "cfFilterPWGToRaster:   cupsBitsPerPixel = %d", doc->inheader.cupsBitsPerPixel);
     log(ld, FILTER_LOGLEVEL_DEBUG,
-       "pwgtoraster:   cupsBytesPerLine = %d", doc->inheader.cupsBytesPerLine);
+       "cfFilterPWGToRaster:   cupsBytesPerLine = %d", doc->inheader.cupsBytesPerLine);
     log(ld, FILTER_LOGLEVEL_DEBUG,
-       "pwgtoraster:   cupsColorOrder = %d", doc->inheader.cupsColorOrder);
+       "cfFilterPWGToRaster:   cupsColorOrder = %d", doc->inheader.cupsColorOrder);
     log(ld, FILTER_LOGLEVEL_DEBUG,
-       "pwgtoraster:   cupsColorSpace = %d", doc->inheader.cupsColorSpace);
+       "cfFilterPWGToRaster:   cupsColorSpace = %d", doc->inheader.cupsColorSpace);
     log(ld, FILTER_LOGLEVEL_DEBUG,
-       "pwgtoraster:   cupsCompression = %d", doc->inheader.cupsCompression);
+       "cfFilterPWGToRaster:   cupsCompression = %d", doc->inheader.cupsCompression);
     log(ld, FILTER_LOGLEVEL_DEBUG,
-       "pwgtoraster:   cupsPageSizeName = %s", doc->inheader.cupsPageSizeName);
+       "cfFilterPWGToRaster:   cupsPageSizeName = %s", doc->inheader.cupsPageSizeName);
   }
 
   if (!doc->page_size_requested)
@@ -1277,66 +1277,66 @@ static bool outPage(pwgtoraster_doc_t *doc,
 
   if (!cupsRasterWriteHeader2(outras, &(doc->outheader))) {
     if (log) log(ld,FILTER_LOGLEVEL_ERROR,
-                "pwgtoraster: Can't write page %d header", pageNo);
+                "cfFilterPWGToRaster: Can't write page %d header", pageNo);
     return (false);
   }
 
   if (log) {
     log(ld, FILTER_LOGLEVEL_DEBUG,
-       "pwgtoraster: Output page %d", pageNo);
+       "cfFilterPWGToRaster: Output page %d", pageNo);
     if (doc->outheader.ImagingBoundingBox[3] > 0)
       log(ld, FILTER_LOGLEVEL_DEBUG,
-         "pwgtoraster:   Duplex = %d", doc->outheader.Duplex);
+         "cfFilterPWGToRaster:   Duplex = %d", doc->outheader.Duplex);
     log(ld, FILTER_LOGLEVEL_DEBUG,
-       "pwgtoraster:   HWResolution = [ %d %d ]",
+       "cfFilterPWGToRaster:   HWResolution = [ %d %d ]",
        doc->outheader.HWResolution[0], doc->outheader.HWResolution[1]);
     if (doc->outheader.ImagingBoundingBox[3] > 0)
     {
       log(ld, FILTER_LOGLEVEL_DEBUG,
-         "pwgtoraster:   ImagingBoundingBox = [ %d %d %d %d ]",
+         "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,
-         "pwgtoraster:   Margins = [ %d %d ]",
+         "cfFilterPWGToRaster:   Margins = [ %d %d ]",
          doc->outheader.Margins[0], doc->outheader.Margins[1]);
       log(ld, FILTER_LOGLEVEL_DEBUG,
-         "pwgtoraster:   ManualFeed = %d", doc->outheader.ManualFeed);
+         "cfFilterPWGToRaster:   ManualFeed = %d", doc->outheader.ManualFeed);
       log(ld, FILTER_LOGLEVEL_DEBUG,
-         "pwgtoraster:   MediaPosition = %d", doc->outheader.MediaPosition);
+         "cfFilterPWGToRaster:   MediaPosition = %d", doc->outheader.MediaPosition);
       log(ld, FILTER_LOGLEVEL_DEBUG,
-         "pwgtoraster:   NumCopies = %d", doc->outheader.NumCopies);
+         "cfFilterPWGToRaster:   NumCopies = %d", doc->outheader.NumCopies);
       log(ld, FILTER_LOGLEVEL_DEBUG,
-         "pwgtoraster:   Orientation = %d", doc->outheader.Orientation);
+         "cfFilterPWGToRaster:   Orientation = %d", doc->outheader.Orientation);
     }
     log(ld, FILTER_LOGLEVEL_DEBUG,
-       "pwgtoraster:   PageSize = [ %d %d ]",
+       "cfFilterPWGToRaster:   PageSize = [ %d %d ]",
        doc->outheader.PageSize[0], doc->outheader.PageSize[1]);
     log(ld, FILTER_LOGLEVEL_DEBUG,
-       "pwgtoraster:   cupsWidth = %d", doc->outheader.cupsWidth);
+       "cfFilterPWGToRaster:   cupsWidth = %d", doc->outheader.cupsWidth);
     log(ld, FILTER_LOGLEVEL_DEBUG,
-       "pwgtoraster:   cupsHeight = %d", doc->outheader.cupsHeight);
+       "cfFilterPWGToRaster:   cupsHeight = %d", doc->outheader.cupsHeight);
     if (doc->outheader.ImagingBoundingBox[3] > 0)
       log(ld, FILTER_LOGLEVEL_DEBUG,
-         "pwgtoraster:   cupsMediaType = %d", doc->outheader.cupsMediaType);
+         "cfFilterPWGToRaster:   cupsMediaType = %d", doc->outheader.cupsMediaType);
     log(ld, FILTER_LOGLEVEL_DEBUG,
-       "pwgtoraster:   cupsBitsPerColor = %d",
+       "cfFilterPWGToRaster:   cupsBitsPerColor = %d",
        doc->outheader.cupsBitsPerColor);
     log(ld, FILTER_LOGLEVEL_DEBUG,
-       "pwgtoraster:   cupsBitsPerPixel = %d",
+       "cfFilterPWGToRaster:   cupsBitsPerPixel = %d",
        doc->outheader.cupsBitsPerPixel);
     log(ld, FILTER_LOGLEVEL_DEBUG,
-       "pwgtoraster:   cupsBytesPerLine = %d",
+       "cfFilterPWGToRaster:   cupsBytesPerLine = %d",
        doc->outheader.cupsBytesPerLine);
     log(ld, FILTER_LOGLEVEL_DEBUG,
-       "pwgtoraster:   cupsColorOrder = %d", doc->outheader.cupsColorOrder);
+       "cfFilterPWGToRaster:   cupsColorOrder = %d", doc->outheader.cupsColorOrder);
     log(ld, FILTER_LOGLEVEL_DEBUG,
-       "pwgtoraster:   cupsColorSpace = %d", doc->outheader.cupsColorSpace);
+       "cfFilterPWGToRaster:   cupsColorSpace = %d", doc->outheader.cupsColorSpace);
     log(ld, FILTER_LOGLEVEL_DEBUG,
-       "pwgtoraster:   cupsCompression = %d", doc->outheader.cupsCompression);
+       "cfFilterPWGToRaster:   cupsCompression = %d", doc->outheader.cupsCompression);
     log(ld, FILTER_LOGLEVEL_DEBUG,
-       "pwgtoraster:   cupsPageSizeName = %s", doc->outheader.cupsPageSizeName);
+       "cfFilterPWGToRaster:   cupsPageSizeName = %s", doc->outheader.cupsPageSizeName);
   }
   
   // write page image
@@ -1377,7 +1377,7 @@ static bool outPage(pwgtoraster_doc_t *doc,
     if (doc->outheader.HWResolution[i] == doc->inheader.HWResolution[i])
     {
       log(ld, FILTER_LOGLEVEL_DEBUG,
-         "pwgtoraster: %s resolution: %d dpi",
+         "cfFilterPWGToRaster: %s resolution: %d dpi",
          i == 0 ? "Horizontal" : "Vertical", doc->inheader.HWResolution[i]);
       continue;
     }
@@ -1387,7 +1387,7 @@ static bool outPage(pwgtoraster_doc_t *doc,
       if (doc->outheader.HWResolution[i] % doc->inheader.HWResolution[i])
       {
        log(ld, FILTER_LOGLEVEL_ERROR,
-           "pwgtoraster: %s output resolution %d dpi is not an integer multiple of %s input resolution %d dpi",
+           "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]);
        return (false);
@@ -1397,7 +1397,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,
-           "pwgtoraster: %s input resolution: %d dpi; %s output resolution: %d dpi -> Raising by factor %d",
+           "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],
            res_up_factor[i]);
@@ -1408,7 +1408,7 @@ static bool outPage(pwgtoraster_doc_t *doc,
       if (doc->inheader.HWResolution[i] % doc->outheader.HWResolution[i])
       {
        log(ld, FILTER_LOGLEVEL_ERROR,
-           "pwgtoraster: %s input resolution %d dpi is not an integer multiple of %s output resolution %d dpi",
+           "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]);
        return (false);
@@ -1418,7 +1418,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,
-           "pwgtoraster: %s input resolution: %d dpi; %s output resolution: %d dpi -> Reducing by factor %d",
+           "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],
            res_down_factor[i]);
@@ -1450,7 +1450,7 @@ static bool outPage(pwgtoraster_doc_t *doc,
   else
   {
     if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                "pwgtoraster: Unsupported input color space: Number of colors: %d; Bits per color: %d.",
+                "cfFilterPWGToRaster: Unsupported input color space: Number of colors: %d; Bits per color: %d.",
                 doc->inheader.cupsNumColors, doc->inheader.cupsBitsPerColor);
     return false;
   }
@@ -1480,7 +1480,7 @@ static bool outPage(pwgtoraster_doc_t *doc,
   if (input_color_mode != color_mode_needed)
   {
     if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                "pwgtoraster: Need to pre-convert input from %s to %s",
+                "cfFilterPWGToRaster: Need to pre-convert input from %s to %s",
                 (input_color_mode == 0 ? "1-bit mono" :
                  (input_color_mode == 1 ? "8-bit gray" :
                   "8-bit RGB")),
@@ -1491,7 +1491,7 @@ static bool outPage(pwgtoraster_doc_t *doc,
   else
   {
     if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                "pwgtoraster: Input color mode: %s",
+                "cfFilterPWGToRaster: Input color mode: %s",
                 (input_color_mode == 0 ? "1-bit mono" :
                  (input_color_mode == 1 ? "8-bit gray" :
                   "8-bit RGB")));
@@ -1567,7 +1567,7 @@ static bool outPage(pwgtoraster_doc_t *doc,
        doc->outheader.PageSize[1] >= 2 * doc->inheader.PageSize[1])
     {
       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                  "pwgtoraster: Difference between input and output page dimensions too large, probably the input has a wrong page size");
+                  "cfFilterPWGToRaster: Difference between input and output page dimensions too large, probably the input has a wrong page size");
       goto out;
     }
 
@@ -1590,13 +1590,13 @@ static bool outPage(pwgtoraster_doc_t *doc,
         abs(doc->outheader.PageSize[1] - doc->inheader.PageSize[1]) > 2)
     {
       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                  "pwgtoraster: Output page dimensions are larger for borderless printing with overspray, inserting one extra pixel after each %d pixels",
+                  "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,
-                  "pwgtoraster: Output page dimensions are larger than input page dimensions due to rounding error, inserting one extra pixel after each %d pixels",
+                  "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);
     }
   }
@@ -1613,7 +1613,7 @@ static bool outPage(pwgtoraster_doc_t *doc,
              doc->inheader.cupsBytesPerLine)
          {
            if (log) log(ld,FILTER_LOGLEVEL_DEBUG,
-                        "pwgtoraster: Unable to read line %d for page %d.",
+                        "cfFilterPWGToRaster: Unable to read line %d for page %d.",
                         yin + 1, pageNo);
            ret = false;
            goto out;
@@ -1650,7 +1650,7 @@ static bool outPage(pwgtoraster_doc_t *doc,
                    doc->inheader.cupsBytesPerLine)
                {
                  if (log) log(ld,FILTER_LOGLEVEL_DEBUG,
-                              "pwgtoraster: Unable to read line %d for page %d.",
+                              "cfFilterPWGToRaster: Unable to read line %d for page %d.",
                               yin + 1, pageNo);
                  ret = false;
                  goto out;
@@ -1986,7 +1986,7 @@ static bool outPage(pwgtoraster_doc_t *doc,
        doc->inheader.cupsBytesPerLine)
     {
       if (log) log(ld,FILTER_LOGLEVEL_DEBUG,
-                  "pwgtoraster: Unable to read line %d for page %d.",
+                  "cfFilterPWGToRaster: Unable to read line %d for page %d.",
                   yin + 1, pageNo);
       ret = false;
       goto out;
@@ -2085,20 +2085,20 @@ static int setColorProfile(pwgtoraster_doc_t *doc, filter_logfunc_t log, void *l
     break;
   default:
     if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                "pwgtoraster: Specified ColorSpace is not supported");
+                "cfFilterPWGToRaster: Specified ColorSpace is not supported");
     return (1);
   }
 
   return (0);
 }
 
-int pwgtoraster(int inputfd,        /* I - File descriptor input stream */
+int cfFilterPWGToRaster(int inputfd,        /* I - File descriptor input stream */
                 int outputfd,       /* I - File descriptor output stream */
                 int inputseekable,  /* I - Is input stream seekable? (unused) */
-                filter_data_t *data,/* I - Job and printer data */
+                cf_filter_data_t *data,/* I - Job and printer data */
                 void *parameters)   /* I - Filter-specific parameters */
 {
-  filter_out_format_t outformat;
+  cf_filter_out_format_t outformat;
   pwgtoraster_doc_t doc;
   int i;
   cups_raster_t *inras = NULL,
@@ -2106,7 +2106,7 @@ int pwgtoraster(int inputfd,        /* I - File descriptor input stream */
   filter_logfunc_t     log = data->logfunc;
   void                 *ld = data->logdata;
   conversion_function_t convert;
-  filter_iscanceledfunc_t iscanceled = data->iscanceledfunc;
+  cf_filter_iscanceledfunc_t iscanceled = data->iscanceledfunc;
   void                    *icd = data->iscanceleddata;
   int ret = 0;
 
@@ -2114,20 +2114,20 @@ int pwgtoraster(int inputfd,        /* I - File descriptor input stream */
   (void)inputseekable;
 
   if (parameters) {
-    outformat = *(filter_out_format_t *)parameters;
-    if (outformat != OUTPUT_FORMAT_CUPS_RASTER &&
-       outformat != OUTPUT_FORMAT_PWG_RASTER &&
-       outformat != OUTPUT_FORMAT_APPLE_RASTER &&
-       outformat != OUTPUT_FORMAT_PCLM)
-      outformat = OUTPUT_FORMAT_CUPS_RASTER;
+    outformat = *(cf_filter_out_format_t *)parameters;
+    if (outformat != CF_FILTER_OUT_FORMAT_CUPS_RASTER &&
+       outformat != CF_FILTER_OUT_FORMAT_PWG_RASTER &&
+       outformat != CF_FILTER_OUT_FORMAT_APPLE_RASTER &&
+       outformat != CF_FILTER_OUT_FORMAT_PCLM)
+      outformat = CF_FILTER_OUT_FORMAT_CUPS_RASTER;
   } else
-    outformat = OUTPUT_FORMAT_CUPS_RASTER;
+    outformat = CF_FILTER_OUT_FORMAT_CUPS_RASTER;
 
   if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-              "pwgtoraster: Output format: %s",
-              (outformat == OUTPUT_FORMAT_CUPS_RASTER ? "CUPS Raster" :
-               (outformat == OUTPUT_FORMAT_PWG_RASTER ? "PWG Raster" :
-                (outformat == OUTPUT_FORMAT_APPLE_RASTER ? "Apple Raster" :
+              "cfFilterPWGToRaster: Output format: %s",
+              (outformat == CF_FILTER_OUT_FORMAT_CUPS_RASTER ? "CUPS Raster" :
+               (outformat == CF_FILTER_OUT_FORMAT_PWG_RASTER ? "PWG Raster" :
+                (outformat == CF_FILTER_OUT_FORMAT_APPLE_RASTER ? "Apple Raster" :
                  "PCLM"))));
 
   cmsSetLogErrorHandler(lcmsErrorHandler);
@@ -2141,7 +2141,7 @@ int pwgtoraster(int inputfd,        /* I - File descriptor input stream */
     if (!iscanceled || !iscanceled(icd))
     {
       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                  "pwgtoraster: Unable to open input data stream.");
+                  "cfFilterPWGToRaster: Unable to open input data stream.");
     }
 
     return (1);
@@ -2169,7 +2169,7 @@ int pwgtoraster(int inputfd,        /* I - File descriptor input stream */
      && doc.outheader.cupsBitsPerColor != 8
      && doc.outheader.cupsBitsPerColor != 16) {
     if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                  "pwgtoraster: Specified color format is not supported.");
+                  "cfFilterPWGToRaster: Specified color format is not supported.");
     ret = 1;
     goto out;
   }
@@ -2211,7 +2211,7 @@ int pwgtoraster(int inputfd,        /* I - File descriptor input stream */
        || (doc.outheader.cupsBitsPerColor != 8
           && doc.outheader.cupsBitsPerColor != 16)) {
       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                  "pwgtoraster: Specified color format is not supported.");
+                  "cfFilterPWGToRaster: Specified color format is not supported.");
       ret = 1;
       goto out;
     }
@@ -2241,14 +2241,14 @@ int pwgtoraster(int inputfd,        /* I - File descriptor input stream */
     break;
   default:
     if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                  "pwgtoraster: Specified ColorSpace is not supported.");
+                  "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,
-                  "pwgtoraster: Cannot set color profile.");
+                  "cfFilterPWGToRaster: Cannot set color profile.");
       ret = 1;
       goto out;
     }
@@ -2259,18 +2259,18 @@ int pwgtoraster(int inputfd,        /* I - File descriptor input stream */
   */
 
   if ((outras = cupsRasterOpen(outputfd, (outformat ==
-                                         OUTPUT_FORMAT_CUPS_RASTER ?
+                                         CF_FILTER_OUT_FORMAT_CUPS_RASTER ?
                                          CUPS_RASTER_WRITE :
                                          (outformat ==
-                                          OUTPUT_FORMAT_PWG_RASTER ?
+                                          CF_FILTER_OUT_FORMAT_PWG_RASTER ?
                                           CUPS_RASTER_WRITE_PWG :
                                           (outformat ==
-                                           OUTPUT_FORMAT_APPLE_RASTER ?
+                                           CF_FILTER_OUT_FORMAT_APPLE_RASTER ?
                                            CUPS_RASTER_WRITE_APPLE :
                                            CUPS_RASTER_WRITE))))) == 0)
   {
     if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                "pwgtoraster: Can't open output raster stream.");
+                "cfFilterPWGToRaster: Can't open output raster stream.");
     ret = 1;
     goto out;
   }
@@ -2283,67 +2283,67 @@ int pwgtoraster(int inputfd,        /* I - File descriptor input stream */
   if (selectConvertFunc(outras, &doc, &convert, log, ld) == 1)
   {
     if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                "pwgtoraster: Unable to select color conversion function.");
+                "cfFilterPWGToRaster: Unable to select color conversion function.");
     ret = 1;
     goto out;
   }
 
   if (log) {
     log(ld, FILTER_LOGLEVEL_DEBUG,
-       "pwgtoraster: Output page header");
+       "cfFilterPWGToRaster: Output page header");
     if (doc.outheader.ImagingBoundingBox[3] > 0)
       log(ld, FILTER_LOGLEVEL_DEBUG,
-         "pwgtoraster:   Duplex = %d", doc.outheader.Duplex);
+         "cfFilterPWGToRaster:   Duplex = %d", doc.outheader.Duplex);
     log(ld, FILTER_LOGLEVEL_DEBUG,
-       "pwgtoraster:   HWResolution = [ %d %d ]",
+       "cfFilterPWGToRaster:   HWResolution = [ %d %d ]",
        doc.outheader.HWResolution[0], doc.outheader.HWResolution[1]);
     if (doc.outheader.ImagingBoundingBox[3] > 0)
     {
       log(ld, FILTER_LOGLEVEL_DEBUG,
-         "pwgtoraster:   ImagingBoundingBox = [ %d %d %d %d ]",
+         "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,
-         "pwgtoraster:   Margins = [ %d %d ]",
+         "cfFilterPWGToRaster:   Margins = [ %d %d ]",
          doc.outheader.Margins[0], doc.outheader.Margins[1]);
       log(ld, FILTER_LOGLEVEL_DEBUG,
-         "pwgtoraster:   ManualFeed = %d", doc.outheader.ManualFeed);
+         "cfFilterPWGToRaster:   ManualFeed = %d", doc.outheader.ManualFeed);
       log(ld, FILTER_LOGLEVEL_DEBUG,
-         "pwgtoraster:   MediaPosition = %d", doc.outheader.MediaPosition);
+         "cfFilterPWGToRaster:   MediaPosition = %d", doc.outheader.MediaPosition);
       log(ld, FILTER_LOGLEVEL_DEBUG,
-         "pwgtoraster:   NumCopies = %d", doc.outheader.NumCopies);
+         "cfFilterPWGToRaster:   NumCopies = %d", doc.outheader.NumCopies);
       log(ld, FILTER_LOGLEVEL_DEBUG,
-         "pwgtoraster:   Orientation = %d", doc.outheader.Orientation);
+         "cfFilterPWGToRaster:   Orientation = %d", doc.outheader.Orientation);
     }
     log(ld, FILTER_LOGLEVEL_DEBUG,
-       "pwgtoraster:   PageSize = [ %d %d ]",
+       "cfFilterPWGToRaster:   PageSize = [ %d %d ]",
        doc.outheader.PageSize[0], doc.outheader.PageSize[1]);
     log(ld, FILTER_LOGLEVEL_DEBUG,
-       "pwgtoraster:   cupsWidth = %d", doc.outheader.cupsWidth);
+       "cfFilterPWGToRaster:   cupsWidth = %d", doc.outheader.cupsWidth);
     log(ld, FILTER_LOGLEVEL_DEBUG,
-       "pwgtoraster:   cupsHeight = %d", doc.outheader.cupsHeight);
+       "cfFilterPWGToRaster:   cupsHeight = %d", doc.outheader.cupsHeight);
     if (doc.outheader.ImagingBoundingBox[3] > 0)
       log(ld, FILTER_LOGLEVEL_DEBUG,
-         "pwgtoraster:   cupsMediaType = %d", doc.outheader.cupsMediaType);
+         "cfFilterPWGToRaster:   cupsMediaType = %d", doc.outheader.cupsMediaType);
     log(ld, FILTER_LOGLEVEL_DEBUG,
-       "pwgtoraster:   cupsBitsPerColor = %d",
+       "cfFilterPWGToRaster:   cupsBitsPerColor = %d",
        doc.outheader.cupsBitsPerColor);
     log(ld, FILTER_LOGLEVEL_DEBUG,
-       "pwgtoraster:   cupsBitsPerPixel = %d",
+       "cfFilterPWGToRaster:   cupsBitsPerPixel = %d",
        doc.outheader.cupsBitsPerPixel);
     log(ld, FILTER_LOGLEVEL_DEBUG,
-       "pwgtoraster:   cupsBytesPerLine = %d",
+       "cfFilterPWGToRaster:   cupsBytesPerLine = %d",
        doc.outheader.cupsBytesPerLine);
     log(ld, FILTER_LOGLEVEL_DEBUG,
-       "pwgtoraster:   cupsColorOrder = %d", doc.outheader.cupsColorOrder);
+       "cfFilterPWGToRaster:   cupsColorOrder = %d", doc.outheader.cupsColorOrder);
     log(ld, FILTER_LOGLEVEL_DEBUG,
-       "pwgtoraster:   cupsColorSpace = %d", doc.outheader.cupsColorSpace);
+       "cfFilterPWGToRaster:   cupsColorSpace = %d", doc.outheader.cupsColorSpace);
     log(ld, FILTER_LOGLEVEL_DEBUG,
-       "pwgtoraster:   cupsCompression = %d", doc.outheader.cupsCompression);
+       "cfFilterPWGToRaster:   cupsCompression = %d", doc.outheader.cupsCompression);
     log(ld, FILTER_LOGLEVEL_DEBUG,
-       "pwgtoraster:   cupsPageSizeName = %s", doc.outheader.cupsPageSizeName);
+       "cfFilterPWGToRaster:   cupsPageSizeName = %s", doc.outheader.cupsPageSizeName);
   }
 
  /*
@@ -2356,7 +2356,7 @@ int pwgtoraster(int inputfd,        /* I - File descriptor input stream */
     i ++;
   if (i == 0)
     if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                "pwgtoraster: No page printed, outputting empty file.");
+                "cfFilterPWGToRaster: No page printed, outputting empty file.");
 
  out:
 
index d93194cb2e56783282a2f2a2d85819663c50b224..a41fa58a3488546c4393766827ace03ccd9735e5 100644 (file)
@@ -74,7 +74,7 @@ _strlcpy(char       *dst,             /* O - Destination string */
 int 
 ippRasterMatchIPPSize(
     cups_page_header2_t *header,       /* I - Page header to match */
-    filter_data_t      *data,          /* I - printer-data file */
+    cf_filter_data_t   *data,          /* I - printer-data file */
     double             margins[4],     /* O - Margins of media in points */
     double             dimensions[2],  /* O - Width and Length of media in points */
     int                *image_fit,     /* O - Imageable Area Fit */
@@ -424,7 +424,7 @@ getBackSideAndHeaderDuplex(ipp_t *printer_attrs,    /* I - printer attributes using
 }
 
 int 
-getPrintRenderIntent(filter_data_t *data,
+getPrintRenderIntent(cf_filter_data_t *data,
                        cups_page_header2_t *header)
 {
   const char           *val;
@@ -532,12 +532,12 @@ getPrintRenderIntent(filter_data_t *data,
 int                                             /* O  - 0 on success,
                                                        -1 on error */
 cupsRasterPrepareHeader(cups_page_header2_t *h, /* I  - Raster header */
-                       filter_data_t *data,    /* I  - Job and printer data */
-                       filter_out_format_t final_outformat,
+                       cf_filter_data_t *data,    /* I  - Job and printer data */
+                       cf_filter_out_format_t final_outformat,
                                                 /* I  - Job output format 
                                                        (determines color space,
                                                         and resolution) */
-                       filter_out_format_t header_outformat,
+                       cf_filter_out_format_t header_outformat,
                                                 /* I  - This filter's output
                                                        format (determines
                                                        header format) */
@@ -574,17 +574,17 @@ cupsRasterPrepareHeader(cups_page_header2_t *h, /* I  - Raster header */
   double margins[4];
   double dimensions[2];
 
-  if (final_outformat == OUTPUT_FORMAT_PWG_RASTER)
+  if (final_outformat == CF_FILTER_OUT_FORMAT_PWG_RASTER)
     pwgraster = 1;
-  else if (final_outformat == OUTPUT_FORMAT_APPLE_RASTER)
+  else if (final_outformat == CF_FILTER_OUT_FORMAT_APPLE_RASTER)
     appleraster = 1;
-  else if (final_outformat == OUTPUT_FORMAT_PCLM)
+  else if (final_outformat == CF_FILTER_OUT_FORMAT_PCLM)
     pclm = 1;
   else
     cupsraster = 1;
 
-  if (header_outformat == OUTPUT_FORMAT_PWG_RASTER ||
-      header_outformat == OUTPUT_FORMAT_APPLE_RASTER)
+  if (header_outformat == CF_FILTER_OUT_FORMAT_PWG_RASTER ||
+      header_outformat == CF_FILTER_OUT_FORMAT_APPLE_RASTER)
     cupsrasterheader = 0;
 
   printer_attrs = data->printer_attrs;
@@ -1199,7 +1199,7 @@ cupsRasterSetColorSpace(cups_page_header2_t *h, /* I  - Raster header */
 
 int                                          /* O - -1 on error, 0 on success */
 cupsRasterParseIPPOptions(cups_page_header2_t *h, /* I - Raster header */
-                         filter_data_t *data,
+                         cf_filter_data_t *data,
                          int pwg_raster,         /* I - 1 if PWG Raster */
                          int set_defaults)       /* I - If 1, set default
                                                     values for all fields for
@@ -2328,7 +2328,7 @@ cupsRasterParseIPPOptions(cups_page_header2_t *h, /* I - Raster header */
 
 
 /*  Function for storing job-attrs in options */
-int joinJobOptionsAndAttrs(filter_data_t* data, int num_options, cups_option_t **options)
+int joinJobOptionsAndAttrs(cf_filter_data_t* data, int num_options, cups_option_t **options)
 {
   ipp_t *job_attrs = data->job_attrs;   /*  Job attributes  */
   ipp_attribute_t *ipp_attr;            /*  IPP attribute   */
index 4c94a23d6ace568af03bb7394a25d0b2e6feb159..335ced560c9f69d71b2c5edd15fa3a676e05fd58 100644 (file)
@@ -52,10 +52,10 @@ typedef enum backside_orient_e
  */
 
 extern int              cupsRasterPrepareHeader(cups_page_header2_t *h,
-                                               filter_data_t *data,
-                                               filter_out_format_t
+                                               cf_filter_data_t *data,
+                                               cf_filter_out_format_t
                                                final_outformat,
-                                               filter_out_format_t
+                                               cf_filter_out_format_t
                                                header_outformat,
                                                int no_hig_depth,
                                                cups_cspace_t *cspace);
@@ -65,14 +65,14 @@ extern int              cupsRasterSetColorSpace(cups_page_header2_t *h,
                                                cups_cspace_t *cspace,
                                                int *high_depth);
 extern int              cupsRasterParseIPPOptions(cups_page_header2_t *h,
-                                                 filter_data_t *data,
+                                                 cf_filter_data_t *data,
                                                  int pwg_raster,
                                                  int set_defaults);
-extern int             joinJobOptionsAndAttrs(filter_data_t *data,
+extern int             joinJobOptionsAndAttrs(cf_filter_data_t *data,
                                               int num_options,
                                               cups_option_t **options);
 extern int             ippRasterMatchIPPSize(cups_page_header2_t *header,
-                                             filter_data_t *data,
+                                             cf_filter_data_t *data,
                                              double margins[4],
                                              double dimensions[2],
                                              int *image_fit,
@@ -80,7 +80,7 @@ extern int            ippRasterMatchIPPSize(cups_page_header2_t *header,
 extern int             getBackSideAndHeaderDuplex(ipp_t *printer_attrs,
                                                  cups_page_header2_t *header);
 
-extern int             getPrintRenderIntent(filter_data_t *data,
+extern int             getPrintRenderIntent(cf_filter_data_t *data,
                                cups_page_header2_t *header);
 
 #  ifdef __cplusplus
index 7af7905ddeacfe52bf3d12f01fbb5b6cfda26f47..bd84fa3f9b3ecf6b14b92376e1de20094db21a05 100644 (file)
@@ -116,7 +116,7 @@ typedef struct                                 /**** Document information ****/
                                                  logging */
   void                *logdata;                /* User data for logging
                                                  function, can be NULL */
-  filter_iscanceledfunc_t iscanceledfunc;      /* Function returning 1 when
+  cf_filter_iscanceledfunc_t iscanceledfunc;      /* Function returning 1 when
                                                   job is canceled, NULL for not
                                                   supporting stop on cancel */
   void *iscanceleddata;                        /* User data for is-canceled
@@ -283,7 +283,7 @@ struct pdf_info
         render_intent(""),
         color_space(CUPS_CSPACE_K),
         page_width(0),page_height(0),
-        outformat(OUTPUT_FORMAT_PDF)
+        outformat(CF_FILTER_OUT_FORMAT_PDF)
     {
     }
 
@@ -308,11 +308,11 @@ struct pdf_info
     cups_cspace_t color_space;
     PointerHolder<Buffer> page_data;
     double page_width,page_height;
-    filter_out_format_t outformat;
+    cf_filter_out_format_t outformat;
 };
 
 int create_pdf_file(struct pdf_info * info,
-                   const filter_out_format_t &outformat)
+                   const cf_filter_out_format_t &outformat)
 {
     try {
         info->pdf.emptyPDF();
@@ -463,7 +463,7 @@ QPDFObjectHandle embedIccProfile(QPDF &pdf, rastertopdf_doc_t *doc)
         break;
       default:
         if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
-                     "rastertopdf: Failed to embed ICC Profile.");
+                     "cfFilterRasterToPDF: Failed to embed ICC Profile.");
         return QPDFObjectHandle::newNull();
     }
 
@@ -489,7 +489,7 @@ QPDFObjectHandle embedIccProfile(QPDF &pdf, rastertopdf_doc_t *doc)
 
     free(buff);
     if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
-                     "rastertopdf: ICC Profile embedded in PDF.");
+                     "cfFilterRasterToPDF: ICC Profile embedded in PDF.");
 
     return ret;
 }
@@ -650,7 +650,7 @@ makePclmStrips(QPDF &pdf, unsigned num_strips,
         break;
       default:
         if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
-                     "rastertopdf: Color space not supported.");
+                     "cfFilterRasterToPDF: Color space not supported.");
         return std::vector<QPDFObjectHandle>(num_strips, QPDFObjectHandle());
     }
 
@@ -809,7 +809,7 @@ QPDFObjectHandle makeImage(QPDF &pdf, PointerHolder<Buffer> page_data,
             default:
                 if (doc->logfunc)
                  doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
-                              "rastertopdf: Color space not supported.");
+                              "cfFilterRasterToPDF: Color space not supported.");
                 return QPDFObjectHandle();
         }
     } else if (doc->cm_disabled) {
@@ -844,7 +844,7 @@ QPDFObjectHandle makeImage(QPDF &pdf, PointerHolder<Buffer> page_data,
           default:
             if (doc->logfunc)
              doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
-                          "rastertopdf: Color space not supported.");
+                          "cfFilterRasterToPDF: Color space not supported.");
             return QPDFObjectHandle();
         }
     } else
@@ -874,7 +874,7 @@ QPDFObjectHandle makeImage(QPDF &pdf, PointerHolder<Buffer> page_data,
 
 int finish_page(struct pdf_info * info, rastertopdf_doc_t *doc)
 {
-    if (info->outformat == OUTPUT_FORMAT_PDF)
+    if (info->outformat == CF_FILTER_OUT_FORMAT_PDF)
     {
       // Finish previous PDF Page
       if(!info->page_data.getPointer())
@@ -888,14 +888,14 @@ int finish_page(struct pdf_info * info, rastertopdf_doc_t *doc)
       {
         if (doc->logfunc)
          doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
-                      "rastertopdf: Unable to load image data");
+                      "cfFilterRasterToPDF: Unable to load image data");
         return 1;
       }
 
       // add it
       info->page.getKey("/Resources").getKey("/XObject").replaceKey("/I",image);
     }
-    else if (info->outformat == OUTPUT_FORMAT_PCLM)
+    else if (info->outformat == CF_FILTER_OUT_FORMAT_PCLM)
     {
       // Finish previous PCLm page
       if (info->pclm_num_strips == 0)
@@ -915,7 +915,7 @@ int finish_page(struct pdf_info * info, rastertopdf_doc_t *doc)
         {
           if (doc->logfunc)
            doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
-                        "rastertopdf: Unable to load strip data");
+                        "cfFilterRasterToPDF: Unable to load strip data");
           return 1;
         }
 
@@ -929,13 +929,13 @@ int finish_page(struct pdf_info * info, rastertopdf_doc_t *doc)
 
     // draw it
     std::string content;
-    if (info->outformat == OUTPUT_FORMAT_PDF)
+    if (info->outformat == CF_FILTER_OUT_FORMAT_PDF)
     {
       content.append(QUtil::double_to_string(info->page_width) + " 0 0 " +
                      QUtil::double_to_string(info->page_height) + " 0 0 cm\n");
       content.append("/I Do\n");
     }
-    else if (info->outformat == OUTPUT_FORMAT_PCLM)
+    else if (info->outformat == CF_FILTER_OUT_FORMAT_PCLM)
     {
       std::string res = info->pclm_source_resolution_default;
 
@@ -961,10 +961,10 @@ int finish_page(struct pdf_info * info, rastertopdf_doc_t *doc)
     }
 
     QPDFObjectHandle page_contents = info->page.getKey("/Contents");
-    if (info->outformat == OUTPUT_FORMAT_PDF)
+    if (info->outformat == CF_FILTER_OUT_FORMAT_PDF)
       page_contents.replaceStreamData(content, QPDFObjectHandle::newNull(),
                                      QPDFObjectHandle::newNull());
-    else if (info->outformat == OUTPUT_FORMAT_PCLM)
+    else if (info->outformat == CF_FILTER_OUT_FORMAT_PCLM)
       page_contents.getArrayItem(0).replaceStreamData(content,
                                                   QPDFObjectHandle::newNull(),
                                                   QPDFObjectHandle::newNull());
@@ -1003,7 +1003,7 @@ int prepare_pdf_page(struct pdf_info * info, unsigned width, unsigned height,
     info->bpc = bpc;
     info->render_intent = render_intent;
     info->color_space = color_space;
-    if (info->outformat == OUTPUT_FORMAT_PCLM)
+    if (info->outformat == CF_FILTER_OUT_FORMAT_PCLM)
     {
       info->pclm_num_strips =
        (height / info->pclm_strip_height_preferred) +
@@ -1058,7 +1058,7 @@ int prepare_pdf_page(struct pdf_info * info, unsigned width, unsigned height,
         default:
           if (doc->logfunc)
            doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
-                        "rastertopdf: Unable to convert PDF from profile.");
+                        "cfFilterRasterToPDF: Unable to convert PDF from profile.");
           doc->colorProfile = NULL;
           error = 1;
       }
@@ -1122,7 +1122,7 @@ int prepare_pdf_page(struct pdf_info * info, unsigned width, unsigned height,
          default:
            if (doc->logfunc)
             doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
-                         "rastertopdf: Color space not supported.");
+                         "cfFilterRasterToPDF: Color space not supported.");
            error = 1;
            break;
       }
@@ -1150,13 +1150,13 @@ int add_pdf_page(struct pdf_info * info, int pagen, unsigned width,
                            info->line_bytes)) {
             if (doc->logfunc)
              doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
-                          "rastertopdf: Page too big");
+                          "cfFilterRasterToPDF: Page too big");
             return 1;
         }
-        if (info->outformat == OUTPUT_FORMAT_PDF)
+        if (info->outformat == CF_FILTER_OUT_FORMAT_PDF)
           info->page_data =
            PointerHolder<Buffer>(new Buffer(info->line_bytes * info->height));
-        else if (info->outformat == OUTPUT_FORMAT_PCLM)
+        else if (info->outformat == CF_FILTER_OUT_FORMAT_PCLM)
         {
           // reserve space for PCLm strips
           for (size_t i = 0; i < info->pclm_num_strips; i ++)
@@ -1178,14 +1178,14 @@ int add_pdf_page(struct pdf_info * info, int pagen, unsigned width,
         // Convert to pdf units
         info->page_width=((double)info->width/xdpi)*DEFAULT_PDF_UNIT;
         info->page_height=((double)info->height/ydpi)*DEFAULT_PDF_UNIT;
-        if (info->outformat == OUTPUT_FORMAT_PDF)
+        if (info->outformat == CF_FILTER_OUT_FORMAT_PDF)
         {
           page.replaceKey("/Contents",QPDFObjectHandle::newStream(&info->pdf));
                                          // data will be provided later
           page.replaceKey("/MediaBox",makeRealBox(0,0,info->page_width,
                                                  info->page_height));
         }
-        else if (info->outformat == OUTPUT_FORMAT_PCLM)
+        else if (info->outformat == CF_FILTER_OUT_FORMAT_PCLM)
         {
           page.replaceKey("/Contents",
             QPDFObjectHandle::newArray(std::vector<QPDFObjectHandle>
@@ -1204,7 +1204,7 @@ int add_pdf_page(struct pdf_info * info, int pagen, unsigned width,
     } catch (std::bad_alloc &ex) {
         if (doc->logfunc)
          doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
-                      "rastertopdf: Unable to allocate page data");
+                      "cfFilterRasterToPDF: Unable to allocate page data");
         return 1;
     } catch (...) {
         return 1;
@@ -1221,7 +1221,7 @@ int close_pdf_file(struct pdf_info * info, rastertopdf_doc_t *doc)
         QPDFWriter output(info->pdf,NULL);
         output.setOutputFile("pdf", doc->outputfp, false);
 //        output.setMinimumPDFVersion("1.4");
-        if (info->outformat == OUTPUT_FORMAT_PCLM)
+        if (info->outformat == CF_FILTER_OUT_FORMAT_PCLM)
           output.setPCLm(true);
         output.write();
     } catch (...) {
@@ -1238,11 +1238,11 @@ void pdf_set_line(struct pdf_info * info, unsigned line_n,
     {
         if (doc->logfunc)
          doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
-                      "rastertopdf: Bad line %d", line_n);
+                      "cfFilterRasterToPDF: Bad line %d", line_n);
         return;
     }
 
-    if (info->outformat == OUTPUT_FORMAT_PCLM) {
+    if (info->outformat == CF_FILTER_OUT_FORMAT_PCLM) {
       // copy line data into appropriate pclm strip
       size_t strip_num = line_n / info->pclm_strip_height_preferred;
       unsigned line_strip = line_n -
@@ -1312,13 +1312,13 @@ int setProfile(const char * path, rastertopdf_doc_t *doc)
     if (doc->colorProfile != NULL) {
       if (doc->logfunc)
        doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
-                    "rastertopdf: Load profile successful.");
+                    "cfFilterRasterToPDF: Load profile successful.");
       return 0;
     }
     else {
       if (doc->logfunc)
        doc->logfunc(doc->logdata, FILTER_LOGLEVEL_DEBUG,
-                    "rastertopdf: Unable to load profile.");
+                    "cfFilterRasterToPDF: Unable to load profile.");
       return 1;
     }
 }
@@ -1375,16 +1375,16 @@ const char * getIPPColorProfileName(const char * media_type, cups_cspace_t cs,
 }
 
 int                         /* O - Error status */
-rastertopdf(int inputfd,    /* I - File descriptor input stream */
+cfFilterRasterToPDF(int inputfd,    /* I - File descriptor input stream */
        int outputfd,        /* I - File descriptor output stream */
        int inputseekable,   /* I - Is input stream seekable? (unused) */
-       filter_data_t *data, /* I - Job and printer data */
+       cf_filter_data_t *data, /* I - Job and printer data */
        void *parameters)    /* I - Filter-specific parameters (outformat) */
 {
   int i;
   rastertopdf_doc_t    doc;            /* Document information */
   FILE          *outputfp;              /* Output data stream */
-  filter_out_format_t outformat; /* Output format */
+  cf_filter_out_format_t outformat; /* Output format */
   int Page, empty = 1;
   cf_cm_calibration_t    cm_calibrate;   /* Status of CUPS color management
                                         ("on" or "off") */
@@ -1397,7 +1397,7 @@ rastertopdf(int inputfd,    /* I - File descriptor input stream */
   const char*         profile_name = NULL;     /* IPP Profile Name */
   filter_logfunc_t log = data->logfunc;
   void          *ld = data->logdata;
-  filter_iscanceledfunc_t iscanceled = data->iscanceledfunc;
+  cf_filter_iscanceledfunc_t iscanceled = data->iscanceledfunc;
   void          *icd = data->iscanceleddata;
   int total_attrs;
   char buf[1024];
@@ -1408,15 +1408,15 @@ rastertopdf(int inputfd,    /* I - File descriptor input stream */
 
   if (parameters)
   {
-    outformat = *(filter_out_format_t *)parameters;
-    if (outformat != OUTPUT_FORMAT_PCLM)
-      outformat = OUTPUT_FORMAT_PDF;
+    outformat = *(cf_filter_out_format_t *)parameters;
+    if (outformat != CF_FILTER_OUT_FORMAT_PCLM)
+      outformat = CF_FILTER_OUT_FORMAT_PDF;
   }
   else
-    outformat = OUTPUT_FORMAT_PDF;
+    outformat = CF_FILTER_OUT_FORMAT_PDF;
   if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-              "rastertopdf: OUTFORMAT=\"%s\"",
-              outformat == OUTPUT_FORMAT_PDF ? "PDF" : "PCLM");
+              "cfFilterRasterToPDF: OUTFORMAT=\"%s\"",
+              outformat == CF_FILTER_OUT_FORMAT_PDF ? "PDF" : "PCLM");
 
  /*
   * Open the output data stream specified by the outputfd...
@@ -1427,7 +1427,7 @@ rastertopdf(int inputfd,    /* I - File descriptor input stream */
     if (!iscanceled || !iscanceled(icd))
     {
       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                  "rastertopdf: Unable to open output data stream.");
+                  "cfFilterRasterToPDF: Unable to open output data stream.");
     }
 
     return (1);
@@ -1444,17 +1444,17 @@ rastertopdf(int inputfd,    /* I - File descriptor input stream */
   /* support the CUPS "cm-calibration" option */ 
   cm_calibrate = cfCmGetCupsColorCalibrateMode(data, data->options, data->num_options);
 
-  if (outformat == OUTPUT_FORMAT_PCLM ||
+  if (outformat == CF_FILTER_OUT_FORMAT_PCLM ||
       cm_calibrate == CF_CM_CALIBRATION_ENABLED)
     doc.cm_disabled = 1;
   else
     doc.cm_disabled = cfCmIsPrinterCmDisabled(data);
 
-  if (outformat == OUTPUT_FORMAT_PCLM && data->ppd == NULL
+  if (outformat == CF_FILTER_OUT_FORMAT_PCLM && data->ppd == NULL
         && printer_attrs == NULL )
   {
     if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-      "rastertopdf: PCLm output:  Neither a PPD file nor printer IPP attributes are supplied, PCLm output not possible.");
+      "cfFilterRasterToPDF: PCLm output:  Neither a PPD file nor printer IPP attributes are supplied, PCLm output not possible.");
     return 1;
   }
 
@@ -1465,13 +1465,13 @@ rastertopdf(int inputfd,    /* I - File descriptor input stream */
   Page = 0;
 
   /* Get PCLm attributes from PPD */
-  if (data->ppd && outformat == OUTPUT_FORMAT_PCLM)
+  if (data->ppd && outformat == CF_FILTER_OUT_FORMAT_PCLM)
   {
     char *attr_name = (char *)"cupsPclmStripHeightPreferred";
     if ((attr = ppdFindAttr(data->ppd, attr_name, NULL)) != NULL)
     {
       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                  "rastertopdf: PPD PCLm attribute \"%s\" with value \"%s\"",
+                  "cfFilterRasterToPDF: PPD PCLm attribute \"%s\" with value \"%s\"",
                   attr_name, attr->value);
       pdf.pclm_strip_height_preferred = atoi(attr->value);
     }
@@ -1482,7 +1482,7 @@ rastertopdf(int inputfd,    /* I - File descriptor input stream */
     if ((attr = ppdFindAttr(data->ppd, attr_name, NULL)) != NULL)
     {
       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                  "rastertopdf: PPD PCLm attribute \"%s\" with value \"%s\"",
+                  "cfFilterRasterToPDF: PPD PCLm attribute \"%s\" with value \"%s\"",
                   attr_name, attr->value);
       pdf.pclm_strip_height_supported.clear();  // remove default value = 16
       std::vector<std::string> vec = split_strings(attr->value, ",");
@@ -1495,7 +1495,7 @@ rastertopdf(int inputfd,    /* I - File descriptor input stream */
     if ((attr = ppdFindAttr(data->ppd, attr_name, NULL)) != NULL)
     {
       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                  "rastertopdf: PPD PCLm attribute \"%s\" with value \"%s\"",
+                  "cfFilterRasterToPDF: PPD PCLm attribute \"%s\" with value \"%s\"",
                   attr_name, attr->value);
       pdf.pclm_raster_back_side = attr->value;
     }
@@ -1504,7 +1504,7 @@ rastertopdf(int inputfd,    /* I - File descriptor input stream */
     if ((attr = ppdFindAttr(data->ppd, attr_name, NULL)) != NULL)
     {
       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                  "rastertopdf: PPD PCLm attribute \"%s\" with value \"%s\"",
+                  "cfFilterRasterToPDF: PPD PCLm attribute \"%s\" with value \"%s\"",
                   attr_name, attr->value);
       pdf.pclm_source_resolution_supported = split_strings(attr->value, ",");
     }
@@ -1513,7 +1513,7 @@ rastertopdf(int inputfd,    /* I - File descriptor input stream */
     if ((attr = ppdFindAttr(data->ppd, attr_name, NULL)) != NULL)
     {
       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                  "rastertopdf: PPD PCLm attribute \"%s\" with value \"%s\"",
+                  "cfFilterRasterToPDF: PPD PCLm attribute \"%s\" with value \"%s\"",
                   attr_name, attr->value);
       pdf.pclm_source_resolution_default = attr->value;
     }
@@ -1522,13 +1522,13 @@ rastertopdf(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,
-                  "rastertopdf: PPD PCLm attribute \"%s\" missing, taking first item of \"cupsPclmSourceResolutionSupported\" as default resolution",
+                  "cfFilterRasterToPDF: PPD PCLm attribute \"%s\" missing, taking first item of \"cupsPclmSourceResolutionSupported\" as default resolution",
                   attr_name);
     }
     else
     {
       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                  "rastertopdf: PCLm output: PPD file does not contain printer resolution information for PCLm.");
+                  "cfFilterRasterToPDF: PCLm output: PPD file does not contain printer resolution information for PCLm.");
       return 1;
     }
 
@@ -1536,7 +1536,7 @@ rastertopdf(int inputfd,    /* I - File descriptor input stream */
     if ((attr = ppdFindAttr(data->ppd, attr_name, NULL)) != NULL)
     {
       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                  "rastertopdf: PPD PCLm attribute \"%s\" with value \"%s\"",
+                  "cfFilterRasterToPDF: PPD PCLm attribute \"%s\" with value \"%s\"",
                   attr_name, attr->value);
       std::vector<std::string> vec = split_strings(attr->value, ",");
 
@@ -1566,7 +1566,7 @@ rastertopdf(int inputfd,    /* I - File descriptor input stream */
       pdf.pclm_compression_method_preferred.push_back(FLATE_DECODE);
     }
   }
-  else if(outformat == OUTPUT_FORMAT_PCLM && printer_attrs)
+  else if(outformat == CF_FILTER_OUT_FORMAT_PCLM && printer_attrs)
   {
     if (log)
     {
@@ -1594,7 +1594,7 @@ rastertopdf(int inputfd,    /* I - File descriptor input stream */
     if ((ipp_attr = ippFindAttribute(printer_attrs, attr_name, IPP_TAG_ZERO)) != NULL)
     {
       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                 "rastertopdf: Printer PCLm attribute \"%s\" with value %d",
+                 "cfFilterRasterToPDF: Printer PCLm attribute \"%s\" with value %d",
                  attr_name, ippGetInteger(ipp_attr, 0));
       pdf.pclm_strip_height_preferred = ippGetInteger(ipp_attr, 0);
     }
@@ -1605,7 +1605,7 @@ rastertopdf(int inputfd,    /* I - File descriptor input stream */
     if ((ipp_attr = ippFindAttribute(printer_attrs, attr_name, IPP_TAG_ZERO)) != NULL)
     {
       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-      "rastertopdf: Printer PCLm attribute \"%s\"",
+      "cfFilterRasterToPDF: Printer PCLm attribute \"%s\"",
       attr_name);
       pdf.pclm_strip_height_supported.clear();  // remove default value = 16
       for (int i = 0; i < ippGetCount(ipp_attr); i ++)
@@ -1616,7 +1616,7 @@ rastertopdf(int inputfd,    /* I - File descriptor input stream */
     if ((ipp_attr = ippFindAttribute(printer_attrs, attr_name, IPP_TAG_ZERO)) != NULL)
     {
       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-      "rastertopdf: Printer PCLm attribute \"%s\" with value \"%s\"",
+      "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);
     }
@@ -1626,7 +1626,7 @@ rastertopdf(int inputfd,    /* I - File descriptor input stream */
     {
       ippAttributeString(ipp_attr, buf, sizeof(buf));
       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                  "rastertopdf: Printer PCLm attribute \"%s\" with value \"%s\"",
+                  "cfFilterRasterToPDF: Printer PCLm attribute \"%s\" with value \"%s\"",
                   attr_name, buf);
       pdf.pclm_source_resolution_supported = split_strings(buf, ",");
     }
@@ -1636,7 +1636,7 @@ rastertopdf(int inputfd,    /* I - File descriptor input stream */
     {
       ippAttributeString(ipp_attr, buf, sizeof(buf));
       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                  "rastertopdf: Printer PCLm attribute \"%s\" with value \"%s\"",
+                  "cfFilterRasterToPDF: Printer PCLm attribute \"%s\" with value \"%s\"",
                   attr_name, buf);
       pdf.pclm_source_resolution_default = buf;
     }
@@ -1645,13 +1645,13 @@ rastertopdf(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,
-                  "rastertopdf: Printer PCLm attribute \"%s\" missing, taking first item of \"pclm-source-resolution-supported\" as default resolution",
+                  "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,
-                  "rastertopdf: PCLm output: Printer IPP attributes do not contain printer resolution information for PCLm.");
+                  "cfFilterRasterToPDF: PCLm output: Printer IPP attributes do not contain printer resolution information for PCLm.");
       return 1;
     }
 
@@ -1660,7 +1660,7 @@ rastertopdf(int inputfd,    /* I - File descriptor input stream */
     {
       ippAttributeString(ipp_attr, buf, sizeof(buf));
       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                  "rastertopdf: Printer PCLm attribute \"%s\" with value \"%s\"",
+                  "cfFilterRasterToPDF: Printer PCLm attribute \"%s\" with value \"%s\"",
                   attr_name, buf);
       std::vector<std::string> vec = split_strings(buf, ",");
 
@@ -1696,7 +1696,7 @@ rastertopdf(int inputfd,    /* I - File descriptor input stream */
     if (iscanceled && iscanceled(icd))
     {
       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                  "rastertopdf: Job canceled");
+                  "cfFilterRasterToPDF: Job canceled");
       break;
     }
 
@@ -1707,7 +1707,7 @@ rastertopdf(int inputfd,    /* I - File descriptor input stream */
       if (create_pdf_file(&pdf, outformat) != 0)
       {
        if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                    "rastertopdf: Unable to create PDF file");
+                    "cfFilterRasterToPDF: Unable to create PDF file");
        return 1;
       }
     }
@@ -1715,11 +1715,11 @@ rastertopdf(int inputfd,    /* I - File descriptor input stream */
     // Write a status message with the page number
     Page ++;
     if (log) log(ld, FILTER_LOGLEVEL_INFO,
-                "rastertopdf: Starting page %d.", Page);
+                "cfFilterRasterToPDF: Starting page %d.", Page);
 
     // Use "profile=profile_name.icc" to embed 'profile_name.icc' into the PDF
     // for testing. Forces color management to enable.
-    if (outformat == OUTPUT_FORMAT_PDF &&
+    if (outformat == CF_FILTER_OUT_FORMAT_PDF &&
         (profile_name = cupsGetOption("profile", data->num_options,
                                      data->options)) != NULL) {
       setProfile(profile_name, &doc);
@@ -1727,7 +1727,7 @@ rastertopdf(int inputfd,    /* I - File descriptor input stream */
     }
     if (doc.colorProfile != NULL)       
       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                  "rastertopdf: TEST ICC Profile specified (color "
+                  "cfFilterRasterToPDF: TEST ICC Profile specified (color "
                   "management forced ON): \n[%s]", profile_name);
 
     // Add a new page to PDF file
@@ -1738,7 +1738,7 @@ rastertopdf(int inputfd,    /* I - File descriptor input stream */
           header.HWResolution[1], &doc) != 0)
     {
       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                   "rastertopdf: Unable to start new PDF page");
+                   "cfFilterRasterToPDF: Unable to start new PDF page");
       return 1;
     }
 
@@ -1748,7 +1748,7 @@ rastertopdf(int inputfd,    /* I - File descriptor input stream */
       &pdf, &doc) != 0)
     {
       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                  "rastertopdf: Failed to convert page bitmap");
+                  "cfFilterRasterToPDF: Failed to convert page bitmap");
       return 1;
     }
   }
@@ -1756,7 +1756,7 @@ rastertopdf(int inputfd,    /* I - File descriptor input stream */
   if (empty)
   {
     if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                "rastertopdf: Input is empty, outputting empty file.");
+                "cfFilterRasterToPDF: Input is empty, outputting empty file.");
     cupsRasterClose(ras);
     return 0;
   }
index e0c4f3064f73b600dcdff636e0e90ccb2c0fd416..b8a6a27de814449caaaee73a5f9f1b2404dda02d 100644 (file)
@@ -25,7 +25,7 @@ typedef struct {                /**** Document information ****/
                                             logging */
   void          *logdata;                 /* User data for logging function, can
                                             be NULL */
-  filter_iscanceledfunc_t iscanceledfunc; /* Function returning 1 when
+  cf_filter_iscanceledfunc_t iscanceledfunc; /* Function returning 1 when
                                             job is canceled, NULL for not
                                             supporting stop on cancel */
   void *iscanceleddata;                   /* User data for is-canceled
@@ -319,23 +319,23 @@ zerr(int ret, /* I - Return status of deflate */
   switch (ret) {
   case Z_ERRNO:
     if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_ERROR,
-                 "rastertops: zpipe - error in source data or output file");
+                 "cfFilterRasterToPS: zpipe - error in source data or output file");
     break;
   case Z_STREAM_ERROR:
     if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_ERROR,
-                 "rastertops: zpipe - invalid compression level");
+                 "cfFilterRasterToPS: zpipe - invalid compression level");
     break;
   case Z_DATA_ERROR:
     if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_ERROR,
-                 "rastertops: zpipe - invalid or incomplete deflate data");
+                 "cfFilterRasterToPS: zpipe - invalid or incomplete deflate data");
     break;
   case Z_MEM_ERROR:
     if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_ERROR,
-                 "rastertops: zpipe - out of memory");
+                 "cfFilterRasterToPS: zpipe - out of memory");
     break;
   case Z_VERSION_ERROR:
     if (doc->logfunc) doc->logfunc(doc->logdata, FILTER_LOGLEVEL_ERROR,
-                 "rastertops: zpipe - zlib version mismatch!");
+                 "cfFilterRasterToPS: zpipe - zlib version mismatch!");
   }
 }
 
@@ -365,15 +365,15 @@ writeTrailer(int  pages, /* I - Number of pages */
 }
 
 /*
- * 'rastertops()' - Filter function to convert PWG raster input
+ * 'cfFilterRasterToPS()' - Filter function to convert PWG raster input
  *                  to PostScript
  */
 
 int                         /* O - Error status */
-rastertops(int inputfd,         /* I - File descriptor input stream */
+cfFilterRasterToPS(int inputfd,         /* I - File descriptor input stream */
        int outputfd,        /* I - File descriptor output stream */
        int inputseekable,   /* I - Is input stream seekable? (unused) */
-       filter_data_t *data, /* I - Job and printer data */
+       cf_filter_data_t *data, /* I - Job and printer data */
        void *parameters)    /* I - Filter-specific parameters (unused) */
 {
   rastertops_doc_t     doc;         /* Document information */
@@ -386,7 +386,7 @@ rastertops(int inputfd,         /* I - File descriptor input stream */
                 ret;           /* Return value of deflate compression */
   filter_logfunc_t     log = data->logfunc;
   void                 *ld = data->logdata;
-  filter_iscanceledfunc_t iscanceled = data->iscanceledfunc;
+  cf_filter_iscanceledfunc_t iscanceled = data->iscanceledfunc;
   void                 *icd = data->iscanceleddata;
 
 
@@ -402,7 +402,7 @@ rastertops(int inputfd,         /* I - File descriptor input stream */
     if (!iscanceled || !iscanceled(icd))
     {
       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                  "rastertops: Unable to open input data stream.");
+                  "cfFilterRasterToPS: Unable to open input data stream.");
     }
 
     return (1);
@@ -417,7 +417,7 @@ rastertops(int inputfd,         /* I - File descriptor input stream */
     if (!iscanceled || !iscanceled(icd))
     {
       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                  "rastertops: Unable to open output data stream.");
+                  "cfFilterRasterToPS: Unable to open output data stream.");
     }
 
     cupsFileClose(inputfp);
@@ -447,7 +447,7 @@ rastertops(int inputfd,         /* I - File descriptor input stream */
     if (iscanceled && iscanceled(icd))
     {
       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                  "rastertops: Job canceled");
+                  "cfFilterRasterToPS: Job canceled");
       break;
     }
 
@@ -468,7 +468,7 @@ rastertops(int inputfd,         /* I - File descriptor input stream */
     Page ++;
 
     if (log) log(ld, FILTER_LOGLEVEL_INFO,
-     "rastertops: Starting page %d.", Page);
+     "cfFilterRasterToPS: Starting page %d.", Page);
 
    /*
     *  Write the starting of the page
@@ -493,7 +493,7 @@ rastertops(int inputfd,         /* I - File descriptor input stream */
   if (empty)
   {
      if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-      "rastertops: Input is empty, outputting empty file.");
+      "cfFilterRasterToPS: Input is empty, outputting empty file.");
      cupsRasterClose(ras);
      return 0;
   }
index d0d6861f3d239b523a505c165982e63aeba9c496..0ebf70196ee42b4b1b6d1ce54c70c4402ce40d07 100644 (file)
  */
 
 int                             /* O - Exit status */
-rastertopwg(int inputfd,         /* I - File descriptor input stream */
+cfFilterRasterToPWG(int inputfd,         /* I - File descriptor input stream */
             int outputfd,        /* I - File descriptor output stream */
             int inputseekable,   /* I - Is input stream seekable? (unused) */
-            filter_data_t *data, /* I - Job and printer data */
+            cf_filter_data_t *data, /* I - Job and printer data */
             void *parameters)    /* I - Filter-specific parameters (unused) */
 {                      /* I - Command-line arguments */
   cups_raster_t                *inras;         /* Input raster stream */
@@ -55,31 +55,31 @@ rastertopwg(int inputfd,         /* I - File descriptor input stream */
        /* Number of options */
   cups_option_t                *options = NULL;/* Options */
   const char           *val;           /* Option value */
-  filter_iscanceledfunc_t iscanceled = data->iscanceledfunc;
+  cf_filter_iscanceledfunc_t iscanceled = data->iscanceledfunc;
   void                 *icd = data->iscanceleddata;
   filter_logfunc_t     log = data->logfunc;
   void          *ld = data->logdata;
-  filter_out_format_t output_format;
+  cf_filter_out_format_t output_format;
 
 
   if (parameters)
   {
-    output_format = *(filter_out_format_t *)parameters;
-    if (output_format == OUTPUT_FORMAT_PWG_RASTER)
+    output_format = *(cf_filter_out_format_t *)parameters;
+    if (output_format == CF_FILTER_OUT_FORMAT_PWG_RASTER)
       outras = cupsRasterOpen(outputfd, CUPS_RASTER_WRITE_PWG);
-    if (output_format == OUTPUT_FORMAT_APPLE_RASTER)
+    if (output_format == CF_FILTER_OUT_FORMAT_APPLE_RASTER)
       outras = cupsRasterOpen(outputfd, CUPS_RASTER_WRITE_APPLE);
     else
     {
       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                  "rastertopwg: Invalid output format specified. Only PWG Raster and Apple Raster/URF are supported.");
+                  "cfFilterRasterToPWG: Invalid output format specified. Only PWG Raster and Apple Raster/URF are supported.");
       return (1);
     }
   }
   else
   {
     if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                "rastertopwg: Output format not specified.");
+                "cfFilterRasterToPWG: Output format not specified.");
     return (1);
   }
 
@@ -93,7 +93,7 @@ rastertopwg(int inputfd,         /* I - File descriptor input stream */
   if (!data->ppd)
   {
     if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-     "rastertopwg: PPD file is not specified.");
+     "cfFilterRasterToPWG: PPD file is not specified.");
   }
 
   cache = data->ppd ? data->ppd->cache : NULL;
@@ -104,58 +104,58 @@ rastertopwg(int inputfd,         /* I - File descriptor input stream */
     {
       /* Canceled */
       log(ld, FILTER_LOGLEVEL_DEBUG,
-         "rastertopwg: Job canceled on input page %d", page + 1);
+         "cfFilterRasterToPWG: Job canceled on input page %d", page + 1);
     }
     
    /*
     * Show page device dictionary...
     */
     if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                "rastertopwg: Duplex = %d", inheader.Duplex);
+                "cfFilterRasterToPWG: Duplex = %d", inheader.Duplex);
     if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                "rastertopwg: HWResolution = [ %d %d ]",
+                "cfFilterRasterToPWG: HWResolution = [ %d %d ]",
                 inheader.HWResolution[0], inheader.HWResolution[1]);
     if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                "rastertopwg: ImagingBoundingBox = [ %d %d %d %d ]",
+                "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,
-                "rastertopwg: Margins = [ %d %d ]",
+                "cfFilterRasterToPWG: Margins = [ %d %d ]",
                 inheader.Margins[0], inheader.Margins[1]);
     if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                "rastertopwg: ManualFeed = %d", inheader.ManualFeed);
+                "cfFilterRasterToPWG: ManualFeed = %d", inheader.ManualFeed);
     if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                "rastertopwg: MediaPosition = %d", inheader.MediaPosition);
+                "cfFilterRasterToPWG: MediaPosition = %d", inheader.MediaPosition);
     if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                "rastertopwg: NumCopies = %d", inheader.NumCopies);
+                "cfFilterRasterToPWG: NumCopies = %d", inheader.NumCopies);
     if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                "rastertopwg: Orientation = %d", inheader.Orientation);
+                "cfFilterRasterToPWG: Orientation = %d", inheader.Orientation);
     if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                "rastertopwg: PageSize = [ %d %d ]",
+                "cfFilterRasterToPWG: PageSize = [ %d %d ]",
                 inheader.PageSize[0], inheader.PageSize[1]);
     if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                "rastertopwg: cupsWidth = %d", inheader.cupsWidth);
+                "cfFilterRasterToPWG: cupsWidth = %d", inheader.cupsWidth);
     if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                "rastertopwg: cupsHeight = %d", inheader.cupsHeight);
+                "cfFilterRasterToPWG: cupsHeight = %d", inheader.cupsHeight);
     if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                "rastertopwg: cupsMediaType = %d", inheader.cupsMediaType);
+                "cfFilterRasterToPWG: cupsMediaType = %d", inheader.cupsMediaType);
     if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                "rastertopwg: cupsBitsPerColor = %d",
+                "cfFilterRasterToPWG: cupsBitsPerColor = %d",
                 inheader.cupsBitsPerColor);
     if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                "rastertopwg: cupsBitsPerPixel = %d",
+                "cfFilterRasterToPWG: cupsBitsPerPixel = %d",
                 inheader.cupsBitsPerPixel);
     if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                "rastertopwg: cupsBytesPerLine = %d",
+                "cfFilterRasterToPWG: cupsBytesPerLine = %d",
                 inheader.cupsBytesPerLine);
     if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                "rastertopwg: cupsColorOrder = %d", inheader.cupsColorOrder);
+                "cfFilterRasterToPWG: cupsColorOrder = %d", inheader.cupsColorOrder);
     if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                "rastertopwg: cupsColorSpace = %d", inheader.cupsColorSpace);
+                "cfFilterRasterToPWG: cupsColorSpace = %d", inheader.cupsColorSpace);
     if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                "rastertopwg: cupsCompression = %d", inheader.cupsCompression);
+                "cfFilterRasterToPWG: cupsCompression = %d", inheader.cupsCompression);
 
    /*
     * Compute the real raster size...
@@ -164,7 +164,7 @@ rastertopwg(int inputfd,         /* I - File descriptor input stream */
     page ++;
 
     if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                "rastertopwg: %d %d\n", page, inheader.NumCopies);
+                "cfFilterRasterToPWG: %d %d\n", page, inheader.NumCopies);
 
     page_width  = (unsigned)(inheader.cupsPageSize[0] *
                            inheader.HWResolution[0] / 72.0);
@@ -194,16 +194,16 @@ rastertopwg(int inputfd,         /* I - File descriptor input stream */
     lineoffset  = page_left * inheader.cupsBitsPerPixel / 8; /* Round down */
 
     if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                "rastertopwg: In pixels: Width: %u  Height: %u  Left: %u  Right:  %u  Top: %u  Bottom: %u",
+                "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,
-                  "rastertopwg: Unsupported raster data.");
+                  "cfFilterRasterToPWG: Unsupported raster data.");
       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                  "rastertopwg: Bad bottom/left/top margin on page %d.", page);
+                  "cfFilterRasterToPWG: Bad bottom/left/top margin on page %d.", page);
       return (1);
     }
 
@@ -239,9 +239,9 @@ rastertopwg(int inputfd,         /* I - File descriptor input stream */
 
       default :
        if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                   "rastertopwg: Unsupported raster data.");
+                   "cfFilterRasterToPWG: Unsupported raster data.");
        if (log) log(ld,FILTER_LOGLEVEL_DEBUG,
-                    "rastertopwg: Unsupported cupsColorSpace %d on page %d.",
+                    "cfFilterRasterToPWG: Unsupported cupsColorSpace %d on page %d.",
                     inheader.cupsColorSpace, page);
        return (1);
     }
@@ -249,9 +249,9 @@ rastertopwg(int inputfd,         /* I - File descriptor input stream */
     if (inheader.cupsColorOrder != CUPS_ORDER_CHUNKED)
     {
       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                  "rastertopwg: Unsupported raster data.");
+                  "cfFilterRasterToPWG: Unsupported raster data.");
       if (log) log(ld,FILTER_LOGLEVEL_DEBUG,
-                  "rastertopwg: Unsupported cupsColorOrder %d on page %d.",
+                  "cfFilterRasterToPWG: Unsupported cupsColorOrder %d on page %d.",
                   inheader.cupsColorOrder, page);
       return (1);
     }
@@ -260,9 +260,9 @@ rastertopwg(int inputfd,         /* I - File descriptor input stream */
         inheader.cupsBitsPerColor != 8 && inheader.cupsBitsPerColor != 16)
     {
       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                  "rastertopwg: Unsupported raster data.");
+                  "cfFilterRasterToPWG: Unsupported raster data.");
       if (log) log(ld,FILTER_LOGLEVEL_DEBUG,
-                  "rastertopwg: Unsupported cupsBitsPerColor %d on page %d.",
+                  "cfFilterRasterToPWG: Unsupported cupsBitsPerColor %d on page %d.",
                   inheader.cupsBitsPerColor, page);
       return (1);
     }
@@ -295,7 +295,7 @@ rastertopwg(int inputfd,         /* I - File descriptor input stream */
       else
       {
         if (log) log(ld,FILTER_LOGLEVEL_DEBUG,
-                    "rastertopwg: Unsupported print-content-optimize value.");
+                    "cfFilterRasterToPWG: Unsupported print-content-optimize value.");
         outheader.OutputType[0] = '\0';
       }
     }
@@ -310,7 +310,7 @@ rastertopwg(int inputfd,         /* I - File descriptor input stream */
       else
       {
        if (log) log(ld,FILTER_LOGLEVEL_DEBUG,
-                    "rastertopwg: Unsupported print-quality %d.", quality);
+                    "cfFilterRasterToPWG: Unsupported print-quality %d.", quality);
        outheader.cupsInteger[8] = 0;
       }
     }
@@ -339,7 +339,7 @@ rastertopwg(int inputfd,         /* I - File descriptor input stream */
       else
       {
         if (log) log(ld,FILTER_LOGLEVEL_DEBUG,
-                    "rastertopwg: Unsupported print-rendering-intent value.");
+                    "cfFilterRasterToPWG: Unsupported print-rendering-intent value.");
         outheader.cupsRenderingIntent[0] = '\0';
       }
     }
@@ -364,7 +364,7 @@ rastertopwg(int inputfd,         /* I - File descriptor input stream */
       else
       {
         if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                    "rastertopwg: Unsupported PageSize %.2fx%.2f.",
+                    "cfFilterRasterToPWG: Unsupported PageSize %.2fx%.2f.",
                     inheader.cupsPageSize[0], inheader.cupsPageSize[1]);
         outheader.cupsPageSizeName[0] = '\0';
       }
@@ -474,7 +474,7 @@ rastertopwg(int inputfd,         /* I - File descriptor input stream */
         */
 
         if (log) log(ld,FILTER_LOGLEVEL_DEBUG,
-                    "rastertopwg: Unsupported cupsBackSide value.");
+                    "cfFilterRasterToPWG: Unsupported cupsBackSide value.");
 
        outheader.cupsInteger[1] = 1;   /* CrossFeedTransform */
        outheader.cupsInteger[2] = 1;   /* FeedTransform */
@@ -507,9 +507,9 @@ rastertopwg(int inputfd,         /* I - File descriptor input stream */
     if (!cupsRasterWriteHeader2(outras, &outheader))
     {
       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                  "rastertopwg: Error sending raster data.");
+                  "cfFilterRasterToPWG: Error sending raster data.");
       if (log) log(ld,FILTER_LOGLEVEL_DEBUG,
-                  "rastertopwg: Unable to write header for page %d.", page);
+                  "cfFilterRasterToPWG: Unable to write header for page %d.", page);
       return (1);
     }
 
@@ -530,9 +530,9 @@ rastertopwg(int inputfd,         /* I - File descriptor input stream */
       if (!cupsRasterWritePixels(outras, line, outheader.cupsBytesPerLine))
       {
        if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                    "rastertopwg: Error sending raster data.");
+                    "cfFilterRasterToPWG: Error sending raster data.");
        if (log) log(ld,FILTER_LOGLEVEL_DEBUG,
-                    "rastertopwg: Unable to write line %d for page %d.",
+                    "cfFilterRasterToPWG: Unable to write line %d for page %d.",
                     page_top - y + 1, page);
        return (1);
       }
@@ -544,9 +544,9 @@ rastertopwg(int inputfd,         /* I - File descriptor input stream */
          inheader.cupsBytesPerLine)
       {
        if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                    "rastertopwg: Error sending raster data.");
+                    "cfFilterRasterToPWG: Error sending raster data.");
        if (log) log(ld,FILTER_LOGLEVEL_DEBUG,
-                    "rastertopwg: Unable to read line %d for page %d.",
+                    "cfFilterRasterToPWG: Unable to read line %d for page %d.",
                     inheader.cupsHeight - y + page_top + 1, page);
        return (1);
       }
@@ -554,9 +554,9 @@ rastertopwg(int inputfd,         /* I - File descriptor input stream */
       if (!cupsRasterWritePixels(outras, line, outheader.cupsBytesPerLine))
       {
        if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                    "rastertopwg: Error sending raster data.");
+                    "cfFilterRasterToPWG: Error sending raster data.");
        if (log) log(ld,FILTER_LOGLEVEL_DEBUG,
-                    "rastertopwg: Unable to write line %d for page %d.",
+                    "cfFilterRasterToPWG: Unable to write line %d for page %d.",
                     inheader.cupsHeight - y + page_top + 1, page);
        return (1);
       }
@@ -567,9 +567,9 @@ rastertopwg(int inputfd,         /* I - File descriptor input stream */
       if (!cupsRasterWritePixels(outras, line, outheader.cupsBytesPerLine))
       {
        if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                    "rastertopwg: Error sending raster data.");
+                    "cfFilterRasterToPWG: Error sending raster data.");
        if (log) log(ld,FILTER_LOGLEVEL_DEBUG,
-                    "rastertopwg: Unable to write line %d for page %d.",
+                    "cfFilterRasterToPWG: Unable to write line %d for page %d.",
                     page_bottom - y + page_top + inheader.cupsHeight + 1,
                     page);
        return (1);
index ecef8656dc89e39f21c63c0a5d78db0b70f9a62d..6f534808d0591312256b815fbc325843ee9f2d53 100644 (file)
@@ -26,7 +26,7 @@
 #include "driver.h"
 #include <sys/stat.h>
 
-filter_logfunc_t logfunc = cups_logfunc;    /* Log function */
+filter_logfunc_t logfunc = cfCUPSLogFunc;    /* Log function */
 void             *ld = NULL;                /* Log function data */
 
 void   test_gray(int num_comps, const char *basename);
index f6c590de69357486f61fa076714e3dfaf635b37a..5726f704f06184127a558c4332bdb3ca9f49d586 100644 (file)
@@ -33,7 +33,7 @@
 #include <string.h>
 #include <ctype.h>
 
-filter_logfunc_t logfunc = cups_logfunc;    /* Log function */
+filter_logfunc_t logfunc = cfCUPSLogFunc;    /* Log function */
 void             *ld = NULL;                /* Log function data */
 
 
index 8ba38bb29ed59aa6e40154f1578baf94a9533c83..1070b0c029e0e58690deb3091d5e9c57084ca365 100644 (file)
@@ -12,7 +12,7 @@
  *
  * Contents:
  *
- *   texttopdf()     - Main entry for text to PDF filter.
+ *   cfFilterTextToPDF()     - Main entry for text to PDF filter.
  *   WriteEpilogue() - Write the PDF file epilogue.
  *   WritePage()     - Write a page of text.
  *   WriteProlog()   - Write the PDF file prolog with options.
@@ -497,7 +497,7 @@ typedef struct texttopdf_doc_s
   cups_page_header2_t h;        /* CUPS Raster page header, to */
                                 /* accommodate results of command */
                                 /* line parsing for PPD-less queue */
-  texttopdf_parameter_t env_vars;
+  cf_filter_texttopdf_parameter_t env_vars;
   int          NumKeywords;
   float                PageLeft,       /* Left margin */
                PageRight,      /* Right margin */
@@ -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,"texttopdf: No viable font found.");
+    if(log) log(ld, FILTER_LOGLEVEL_ERROR,"cfFilterTextToPDF: No viable font found.");
     return NULL;
   }
 
@@ -735,14 +735,14 @@ void            WriteEpilogue(texttopdf_doc_t *doc);
 
 
 /*
- * 'texttopdf()' - Main entry for text to PDF filter.
+ * 'cfFilterTextToPDF()' - Main entry for text to PDF filter.
  */
 
 int                            /* O - Exit status */
-texttopdf(int inputfd,         /* I - File descriptor input stream */
+cfFilterTextToPDF(int inputfd,         /* I - File descriptor input stream */
          int outputfd,         /* I - File descriptor output stream */
          int inputseekable,    /* I - Is input stream seekable? (unused) */
-         filter_data_t *data,  /* I - Job and printer data */
+         cf_filter_data_t *data,       /* I - Job and printer data */
          void *parameters)     /* I - Filter-specific parameters (unused) */
 {
   texttopdf_doc_t doc;
@@ -766,7 +766,7 @@ texttopdf(int inputfd,      /* I - File descriptor input stream */
 
   filter_logfunc_t log = data->logfunc;
   void         *ld = data->logdata;
-  filter_iscanceledfunc_t iscanceled = data->iscanceledfunc;
+  cf_filter_iscanceledfunc_t iscanceled = data->iscanceledfunc;
   void         *icd = data->iscanceleddata;
   FILE         *fp;            /* Print file */
   int          stdoutbackupfd; /* The "real" stdout is backupped here while */
@@ -808,7 +808,7 @@ texttopdf(int inputfd,      /* I - File descriptor input stream */
   doc.pdf = NULL;
 
   if (parameters) {
-    doc.env_vars = *((texttopdf_parameter_t *)parameters);
+    doc.env_vars = *((cf_filter_texttopdf_parameter_t *)parameters);
   } else {
     doc.env_vars.data_dir = CUPS_DATADIR;
     doc.env_vars.char_set = NULL;
@@ -903,7 +903,7 @@ texttopdf(int inputfd,      /* I - File descriptor input stream */
     }
   }
 
-  filterSetCommonOptions(data->ppd, data->num_options, data->options, 1,
+  cfFilterSetCommonOptions(data->ppd, data->num_options, data->options, 1,
                         &(doc.Orientation), &(doc.Duplex),
                         &(doc.LanguageLevel), &(doc.ColorDevice),
                         &(doc.PageLeft), &(doc.PageRight), &(doc.PageTop),
@@ -944,7 +944,7 @@ texttopdf(int inputfd,      /* I - File descriptor input stream */
     if (doc.PageColumns < 1)
     {
       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                  "texttopdf: Bad columns value %d", doc.PageColumns);
+                  "cfFilterTextToPDF: Bad columns value %d", doc.PageColumns);
       ret = 1;
       goto out;
     }
@@ -957,7 +957,7 @@ texttopdf(int inputfd,      /* I - File descriptor input stream */
     if (doc.CharsPerInch <= 0.0)
     {
       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                  "texttopdf: Bad cpi value %f", doc.CharsPerInch);
+                  "cfFilterTextToPDF: Bad cpi value %f", doc.CharsPerInch);
       ret = 1;
       goto out;
     }
@@ -970,7 +970,7 @@ texttopdf(int inputfd,      /* I - File descriptor input stream */
     if (doc.LinesPerInch <= 0.0)
     {
       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                  "texttopdf: Bad lpi value %f", doc.LinesPerInch);
+                  "cfFilterTextToPDF: Bad lpi value %f", doc.LinesPerInch);
       ret = 1;
       goto out;
     }
@@ -996,7 +996,7 @@ texttopdf(int inputfd,      /* I - File descriptor input stream */
 
   if (doc.SizeLines >= INT_MAX / doc.SizeColumns / sizeof(lchar_t))
   {
-    if (log) log(ld, FILTER_LOGLEVEL_ERROR, "texttopdf: Bad page size");
+    if (log) log(ld, FILTER_LOGLEVEL_ERROR, "cfFilterTextToPDF: Bad page size");
     ret = 1;
     goto out;
   }
@@ -1005,7 +1005,7 @@ texttopdf(int inputfd,    /* I - File descriptor input stream */
   if (!doc.Page)
   {
     if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                "texttopdf: cannot allocate memory for page");
+                "cfFilterTextToPDF: cannot allocate memory for page");
     ret = 1;
     goto out;
   }
@@ -1015,7 +1015,7 @@ texttopdf(int inputfd,    /* I - File descriptor input stream */
   {
     free(doc.Page);
     if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                "texttopdf: cannot allocate memory for page");
+                "cfFilterTextToPDF: cannot allocate memory for page");
     ret = 1;
     goto out;
   }
@@ -1816,7 +1816,7 @@ WriteProlog(const char *title,            /* I - Title of job */
       */
 
       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                  "texttopdf: Unable to open %s: %s",
+                  "cfFilterTextToPDF: Unable to open %s: %s",
                   filename, strerror(errno));
       return (1);
     }
@@ -1833,7 +1833,7 @@ WriteProlog(const char *title,            /* I - Title of job */
 
       fclose(fp);
       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                  "texttopdf: Bad charset file %s", filename);
+                  "cfFilterTextToPDF: Bad charset file %s", filename);
       return (1);
     }
 
@@ -1845,7 +1845,7 @@ WriteProlog(const char *title,            /* I - Title of job */
 
       fclose(fp);
       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                  "texttopdf: Bad charset file %s", filename);
+                  "cfFilterTextToPDF: Bad charset file %s", filename);
       return (1);
     }
 
@@ -1909,7 +1909,7 @@ WriteProlog(const char *title,            /* I - Title of job */
          */
 
          if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                      "texttopdf: Bad font description line: %s", valptr);
+                      "cfFilterTextToPDF: Bad font description line: %s", valptr);
          return (1);
        }
 
@@ -1922,7 +1922,7 @@ WriteProlog(const char *title,            /* I - Title of job */
        else
        {
          if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                      "texttopdf: Bad text direction %s", valptr);
+                      "cfFilterTextToPDF: Bad text direction %s", valptr);
          return (1);
        }
 
@@ -1945,7 +1945,7 @@ WriteProlog(const char *title,            /* I - Title of job */
          */
 
          if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                      "texttopdf: Bad font description line: %s", valptr);
+                      "cfFilterTextToPDF: Bad font description line: %s", valptr);
          return (1);
        }
 
@@ -1958,7 +1958,7 @@ WriteProlog(const char *title,            /* I - Title of job */
        else 
        {
          if(log) log(ld, FILTER_LOGLEVEL_ERROR,
-                     "texttopdf: Bad text width %s", valptr);
+                     "cfFilterTextToPDF: Bad text width %s", valptr);
          return (1);
        }
 
@@ -1996,7 +1996,7 @@ WriteProlog(const char *title,            /* I - Title of job */
               if (!fonts[num_fonts]) // font missing/corrupt, replace by first
              {
                 if(log) log(ld, FILTER_LOGLEVEL_WARN,
-                           "texttopdf: Ignored bad font \"%s\"",valptr);
+                           "cfFilterTextToPDF: Ignored bad font \"%s\"",valptr);
                 break;
               }
               fontnames[num_fonts++] = strdup(valptr);
@@ -2100,7 +2100,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,
-                      "texttopdf: Bad font description line: %s", valptr);
+                      "cfFilterTextToPDF: Bad font description line: %s", valptr);
          return (1);
        }
 
@@ -2113,7 +2113,7 @@ WriteProlog(const char *title,            /* I - Title of job */
        else
        {
          if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                      "texttopdf: Bad text direction %s", valptr);
+                      "cfFilterTextToPDF: Bad text direction %s", valptr);
          return (1);
        }
 
@@ -2135,7 +2135,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,
-                      "texttopdf: Bad font description line: %s", valptr);
+                      "cfFilterTextToPDF: Bad font description line: %s", valptr);
          return (1);
        }
 
@@ -2148,7 +2148,7 @@ WriteProlog(const char *title,            /* I - Title of job */
        else 
        {
          if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                      "texttopdf: Bad text width %s", valptr);
+                      "cfFilterTextToPDF: Bad text width %s", valptr);
          return (1);
        }
 
@@ -2186,7 +2186,7 @@ WriteProlog(const char *title,            /* I - Title of job */
               if (!fonts[num_fonts]) // font missing/corrupt, replace by first
              {
                 if(log) log(ld, FILTER_LOGLEVEL_WARN,
-                           "texttopdf: Ignored bad font \"%s\"",valptr);
+                           "cfFilterTextToPDF: Ignored bad font \"%s\"",valptr);
                 break;
               }
               fontnames[num_fonts++] = strdup(valptr);
@@ -2230,7 +2230,7 @@ WriteProlog(const char *title,            /* I - Title of job */
     else // {{{
     {
       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                  "texttopdf: Bad charset type %s", lineptr);
+                  "cfFilterTextToPDF: Bad charset type %s", lineptr);
       return (1);
     } // }}}
   } // }}}
@@ -2265,7 +2265,7 @@ WriteProlog(const char *title,            /* I - Title of job */
 
   if (doc->NumFonts == 0) {
     if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                "texttopdf:No usable font available");
+                "cfFilterTextToPDF:No usable font available");
     return (1);
   }
 
index 1f952c2d0e1a8527dfea73418aade8bfe59ec129..2f3f78f431df4b725ef67cea5dc5f82c79b9b16c 100644 (file)
@@ -59,10 +59,10 @@ static int              is_false(const char *value);
 static int             check_range(char *page_ranges, int even_pages,
                                    int odd_pages, int page);
 
-int texttotext(int inputfd,         /* I - File descriptor input stream */
+int cfFilterTextToText(int inputfd,         /* I - File descriptor input stream */
        int outputfd,                 /* I - File descriptor output stream */
        int inputseekable,            /* I - Is input stream seekable? (unused)*/
-       filter_data_t *data,          /* I - Job and printer data */
+       cf_filter_data_t *data,          /* I - Job and printer data */
        void *parameters)             /* I - Filter-specific parameters */
 {
   int          i, j;                   /* Looping vars */
@@ -160,7 +160,7 @@ int texttotext(int inputfd,         /* I - File descriptor input stream */
   filter_logfunc_t     log = data->logfunc;
   void          *ld = data->logdata;
 
-  filter_iscanceledfunc_t iscanceled = data->iscanceledfunc;
+  cf_filter_iscanceledfunc_t iscanceled = data->iscanceledfunc;
   void                 *icd = data->iscanceleddata;
   cups_file_t *outputfp;
 
@@ -176,7 +176,7 @@ int texttotext(int inputfd,         /* I - File descriptor input stream */
     if (!iscanceled || !iscanceled(icd))
     {
       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                    "bannertopdf: Unable to open output data stream.");
+                    "cfFilterBannerToPDF: Unable to open output data stream.");
     }
     return (1);
   }
@@ -241,8 +241,8 @@ int texttotext(int inputfd,         /* I - File descriptor input stream */
       }
       num_chars_per_inch = atoi(val);
     }
-    if(log) log(ld, FILTER_LOGLEVEL_DEBUG,"texttotext: num of lines per inch = %d",num_lines_per_inch);
-    if(log) log(ld, FILTER_LOGLEVEL_DEBUG,"texttotext: num of chars per inch = %d",num_chars_per_inch);
+    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);
 
   /* 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 texttotext(int inputfd,         /* I - File descriptor input stream */
     if(val==NULL)
       val = ppd_attr->value;
 
-    if(log) log(ld, FILTER_LOGLEVEL_DEBUG,"texttotext: PageSize: %s", val);
+    if(log) log(ld, FILTER_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,"texttotext: Invalid number of lines %d, using default: 66",
+      if(log) log(ld, FILTER_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,"texttotext: Invalid number of columns %d, using default: 80",
+      if(log) log(ld, FILTER_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,"texttotext: Invalid number of lines %d, using default: 66",
+    if(log) log(ld, FILTER_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,"texttotext: Invalid number of columns %d, using default: 80",
+    if(log) log(ld, FILTER_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, "texttotext: Invalid number of lines %d, using default value: %d",
+      if(log) log(ld, FILTER_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, "texttotext: Invalid number of columns %d, using default value: %d",
+      if(log) log(ld, FILTER_LOGLEVEL_DEBUG, "cfFilterTextToText: Invalid number of columns %d, using default value: %d",
              i, num_columns);
   }
 
-  if(log) log(ld, FILTER_LOGLEVEL_DEBUG, "texttotext: Lines per page: %d; Characters per line: %d",
+  if(log) log(ld, FILTER_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, "texttotext: Invalid left margin %d, setting to 0",
+      if(log) log(ld, FILTER_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, "texttotext: Invalid right margin %d, setting to 0",
+      if(log) log(ld, FILTER_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, "texttotext: Invalid top margin %d, setting to 0",
+      if(log) log(ld, FILTER_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, "texttotext: Invalid bottom margin %d, setting to 0",
+      if(log) log(ld, FILTER_LOGLEVEL_DEBUG, "cfFilterTextToText: Invalid bottom margin %d, setting to 0",
              page_bottom);
       page_bottom = 0;
     }
   }
-  if(log) log(ld, FILTER_LOGLEVEL_DEBUG, "texttotext: Margins: Left (Columns): %d; Right (Columns): %d; Top (Lines): %d; Bottom (Lines): %d",
+  if(log) log(ld, FILTER_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, "texttotext: Text area: Lines per page: %d; Characters per line: %d",
+  if(log) log(ld, FILTER_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, "texttotext: Output encoding: %s", encoding);
+  if(log) log(ld, FILTER_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, "texttotext: Invalid value for OverlongLines: %s, using default value",
+      if(log) log(ld, FILTER_LOGLEVEL_DEBUG, "cfFilterTextToText: Invalid value for OverlongLines: %s, using default value",
              val);
   }
-  if(log) log(ld, FILTER_LOGLEVEL_DEBUG, "texttotext: Handling of overlong lines: %s",
+  if(log) log(ld, FILTER_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, "texttotext: Invalid tab width %d, using default value: %d",
+      if(log) log(ld, FILTER_LOGLEVEL_DEBUG, "cfFilterTextToText: Invalid tab width %d, using default value: %d",
              i, tab_width);
   }
-  if(log) log(ld, FILTER_LOGLEVEL_DEBUG, "texttotext: Tab width: %d", tab_width);
+  if(log) log(ld, FILTER_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, "texttotext: Invalid value for Pagination: %s, using default value",
+      if(log) log(ld, FILTER_LOGLEVEL_DEBUG, "cfFilterTextToText: Invalid value for Pagination: %s, using default value",
              val);
   }
-  if(log) log(ld, FILTER_LOGLEVEL_DEBUG, "texttotext: Pagination (Print in defined pages): %s",
+  if(log) log(ld, FILTER_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, "texttotext: Invalid value for SendFF: %s, using default value",
+      if(log) log(ld, FILTER_LOGLEVEL_DEBUG, "cfFilterTextToText: Invalid value for SendFF: %s, using default value",
              val);
   }
-  if(log) log(ld, FILTER_LOGLEVEL_DEBUG, "texttotext: Send Form Feed character at end of page: %s",
+  if(log) log(ld, FILTER_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, "texttotext: Invalid value for NewlineCharacters: %s, using default value",
+      if(log) log(ld, FILTER_LOGLEVEL_DEBUG, "cfFilterTextToText: Invalid value for NewlineCharacters: %s, using default value",
              val);
   }
-  if(log) log(ld, FILTER_LOGLEVEL_DEBUG, "texttotext: Characters sent to make printer start a new line: %s",
+  if(log) log(ld, FILTER_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, "texttotext: Page selection: %s", page_ranges);
+    if(log) log(ld, FILTER_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, "texttotext: Invalid value for page-set: %s, using default value",
+      if(log) log(ld, FILTER_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, "texttotext: Print %s",
+    if(log) log(ld, FILTER_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, "texttotext: Invalid value for OutputOrder: %s, using default value",
+      if(log) log(ld, FILTER_LOGLEVEL_DEBUG, "cfFilterTextToText: Invalid value for OutputOrder: %s, using default value",
              val);
   }
-  if(log) log(ld, FILTER_LOGLEVEL_DEBUG, "texttotext: Print pages in reverse order: %s",
+  if(log) log(ld, FILTER_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, "texttotext: Invalid value for Collate: %s, using default value",
+      if(log) log(ld, FILTER_LOGLEVEL_DEBUG, "cfFilterTextToText: Invalid value for Collate: %s, using default value",
              val);
   }
-  if(log) log(ld, FILTER_LOGLEVEL_DEBUG, "texttotext: Collate copies: %s",
+  if(log) log(ld, FILTER_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, "texttotext: Conversion from UTF-8 to %s not available",
+      if(log) log(ld, FILTER_LOGLEVEL_ERROR, "cfFilterTextToText: Conversion from UTF-8 to %s not available",
              encoding);
     }else
     {
-      if(log) log(ld, FILTER_LOGLEVEL_ERROR, "texttotext: Error setting up conversion from UTF-8 to %s",
+      if(log) log(ld, FILTER_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, "texttotext: Unable to open input text file");
+    if(log) log(ld, FILTER_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, "texttotext: Input text file ends with incomplete UTF-8 character sequence, file possibly incomplete, but printing the successfully read part anyway");
+             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");
       }
 
       /* 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, "texttotext: Illegal UTF-8 sequence found. Input file perhaps not UTF-8-encoded");
+         if(log) log(ld, FILTER_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, "texttotext: 1 1");
+            if(log) log(ld, FILTER_LOGLEVEL_INFO, "cfFilterTextToText: 1 1");
       }
          } else if ((num_copies == 1 || !collate) && !reverse_order) {
       
            /* Log the page output */
-           if(log) log(ld, FILTER_LOGLEVEL_INFO, "texttotext: %d %d", num_pages, num_copies);
+           if(log) log(ld, FILTER_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, "texttotext: Error closing iconv encoding conversion session");
+    if(log) log(ld, FILTER_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, "texttotext: %d %d", page, (collate ? 1 : num_copies));
+       if(log) log(ld, FILTER_LOGLEVEL_INFO, "cfFilterTextToText: %d %d", page, (collate ? 1 : num_copies));
       }
     /* Clean up */
     for (page = 0; page < num_pages; page ++) {
index 1504b0419bdfd99d2e669ff84bb8a96a6aa88f8b..e82559f7af199837e1071446afeac982edaa64d4 100644 (file)
 #include <ppd/ppd.h>
 
 int                            /* O - Error status */
-universal(int inputfd,         /* I - File descriptor input stream */
+cfFilterUniversal(int inputfd,         /* I - File descriptor input stream */
          int outputfd,        /* I - File descriptor output stream */
          int inputseekable,   /* I - Is input stream seekable? */
-         filter_data_t *data, /* I - Job and printer data */
+         cf_filter_data_t *data, /* I - Job and printer data */
          void *parameters)    /* I - Filter-specific parameters
                                      (input/output format) */
 {
@@ -28,28 +28,28 @@ universal(int inputfd,         /* I - File descriptor input stream */
   char input_type[256];
   char output_super[16];
   char output_type[256];
-  filter_out_format_t *outformat;
-  filter_filter_in_chain_t *filter, *next;
-  universal_parameter_t universal_parameters;
+  cf_filter_out_format_t *outformat;
+  cf_filter_filter_in_chain_t *filter, *next;
+  cf_filter_universal_parameter_t universal_parameters;
   ppd_file_t *ppd;
   ppd_cache_t *cache;
   filter_logfunc_t log = data->logfunc;
   void *ld = data->logdata;
   int ret = 0;
 
-  universal_parameters = *(universal_parameter_t *)parameters;
+  universal_parameters = *(cf_filter_universal_parameter_t *)parameters;
   input = universal_parameters.input_format;
   if (input == NULL)
   {
     if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                "universal: No input data format supplied.");
+                "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,
-                "universal: No output data format supplied.");
+                "cfFilterUniversal: No output data format supplied.");
     return (1);
   }
   strncpy(output, final_output, sizeof(output) - 1);
@@ -91,7 +91,7 @@ universal(int inputfd,         /* I - File descriptor input stream */
     char *filter;
 
     if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                "universal: \"*cupsFilter(2): ...\" lines in the PPD file:");
+                "cfFilterUniversal: \"*cupsFilter(2): ...\" lines in the PPD file:");
 
     for (filter = (char *)cupsArrayFirst(cache->filters);
         filter;
@@ -105,7 +105,7 @@ universal(int inputfd,         /* I - File descriptor input stream */
       int cost;
 
       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                  "universal:    %s", filter);
+                  "cfFilterUniversal:    %s", filter);
 
       /* String of the "*cupsfilter:" or "*cupsfilter2:" line */
       strncpy(buf, filter, sizeof(buf) - 1);
@@ -151,7 +151,7 @@ universal(int inputfd,         /* I - File descriptor input stream */
           strcasecmp(in, "application/postscript") == 0))
       {
        if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                    "universal:       --> Selecting this line");
+                    "cfFilterUniversal:       --> Selecting this line");
        /* Take the input format of the line as output format for us */
        strncpy(output, in, sizeof(output));
        /* Update the minimum cost found */
@@ -160,7 +160,7 @@ universal(int inputfd,         /* I - File descriptor input stream */
        if (lowest_cost == 0)
        {
          if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                      "universal:    Cost value is down to zero, stopping reading further lines");
+                      "cfFilterUniversal:    Cost value is down to zero, stopping reading further lines");
          break;
        }
       }
@@ -171,11 +171,11 @@ universal(int inputfd,         /* I - File descriptor input stream */
       if (lowest_cost == INT_MAX && coststr)
       {
        if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                    "universal: PPD uses \"*cupsFilter: ...\" lines, so we always convert to format given by FINAL_CONTENT_TYPE");
+                    "cfFilterUniversal: PPD uses \"*cupsFilter: ...\" lines, so we always convert to format given by FINAL_CONTENT_TYPE");
        break;
       }
       if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                  "universal: Invalid \"*cupsFilter2: ...\" line in PPD: %s",
+                  "cfFilterUniversal: Invalid \"*cupsFilter2: ...\" line in PPD: %s",
                   filter);
     }
 
@@ -184,13 +184,13 @@ universal(int inputfd,         /* I - File descriptor input stream */
   if (strcasecmp(output, final_output) != 0)
   {
     if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                "universal: Converting from %s to %s, final output will be %s",
+                "cfFilterUniversal: Converting from %s to %s, final output will be %s",
                 input, output, final_output);
   }
   else
   {
     if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                "universal: Converting from %s to %s", input, output);
+                "cfFilterUniversal: Converting from %s to %s", input, output);
   }
 
   sscanf(input, "%15[^/]/%255s", input_super, input_type);
@@ -207,176 +207,176 @@ universal(int inputfd,         /* I - File descriptor input stream */
        !strcmp(output_type, "pwg-raster") ||
        !strcmp(output_type, "PCLm"))
     {
-      outformat = malloc(sizeof(filter_out_format_t));
-      *outformat = OUTPUT_FORMAT_CUPS_RASTER;
+      outformat = malloc(sizeof(cf_filter_out_format_t));
+      *outformat = CF_FILTER_OUT_FORMAT_CUPS_RASTER;
       if (!strcmp(output_type, "pwg-raster") ||
          (!strcmp(output_type, "vnd.cups-raster") &&
           !strcmp(final_output, "image/pwg-raster")))
-       *outformat = OUTPUT_FORMAT_PWG_RASTER;
+       *outformat = CF_FILTER_OUT_FORMAT_PWG_RASTER;
       else if (!strcmp(output_type, "urf") ||
               (!strcmp(output_type, "vnd.cups-raster") &&
                !strcmp(final_output, "image/urf")))
-       *outformat = OUTPUT_FORMAT_APPLE_RASTER;
+       *outformat = CF_FILTER_OUT_FORMAT_APPLE_RASTER;
       else if (!strcmp(output_type, "PCLm") ||
               (!strcmp(output_type, "vnd.cups-raster") &&
                !strcmp(final_output, "applicationn/PCLm")))
-       *outformat = OUTPUT_FORMAT_PCLM;
-      filter = malloc(sizeof(filter_filter_in_chain_t));
-      filter->function = imagetoraster;
+       *outformat = CF_FILTER_OUT_FORMAT_PCLM;
+      filter = malloc(sizeof(cf_filter_filter_in_chain_t));
+      filter->function = cfFilterImageToRaster;
       filter->parameters = outformat;
       filter->name = "imagetoraster";
       cupsArrayAdd(filter_chain, filter);
       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                  "universal: Adding %s to chain", filter->name);
+                  "cfFilterUniversal: Adding %s to chain", filter->name);
 
       if (!strcmp(output, "image/pwg-raster"))
       {
-       filter = malloc(sizeof(filter_filter_in_chain_t));
-       outformat = malloc(sizeof(filter_out_format_t));
-       *outformat = OUTPUT_FORMAT_PWG_RASTER;
-       filter->function = rastertopwg;
+       filter = malloc(sizeof(cf_filter_filter_in_chain_t));
+       outformat = malloc(sizeof(cf_filter_out_format_t));
+       *outformat = CF_FILTER_OUT_FORMAT_PWG_RASTER;
+       filter->function = cfFilterRasterToPWG;
        filter->parameters = outformat;
        filter->name = "rastertopwg";
        cupsArrayAdd(filter_chain, filter);
        if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                    "universal: Adding %s to chain", filter->name);
+                    "cfFilterUniversal: Adding %s to chain", filter->name);
       }
       else if (!strcmp(output, "application/PCLm"))
       {
-       outformat = malloc(sizeof(filter_out_format_t));
-       *outformat = OUTPUT_FORMAT_PCLM;
-       filter = malloc(sizeof(filter_filter_in_chain_t));
-       filter->function = rastertopdf;
+       outformat = malloc(sizeof(cf_filter_out_format_t));
+       *outformat = CF_FILTER_OUT_FORMAT_PCLM;
+       filter = malloc(sizeof(cf_filter_filter_in_chain_t));
+       filter->function = cfFilterRasterToPDF;
        filter->parameters = outformat;
        filter->name = "rastertopclm";
        cupsArrayAdd(filter_chain, filter);
        if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                    "universal: Adding %s to chain", filter->name);
+                    "cfFilterUniversal: Adding %s to chain", filter->name);
       }
       else if (!strcmp(output, "image/urf"))
       {
-       filter = malloc(sizeof(filter_filter_in_chain_t));
-       outformat = malloc(sizeof(filter_out_format_t));
-       *outformat = OUTPUT_FORMAT_APPLE_RASTER;
-       filter->function = rastertopwg;
+       filter = malloc(sizeof(cf_filter_filter_in_chain_t));
+       outformat = malloc(sizeof(cf_filter_out_format_t));
+       *outformat = CF_FILTER_OUT_FORMAT_APPLE_RASTER;
+       filter->function = cfFilterRasterToPWG;
        filter->parameters = outformat;
        filter->name = "rastertopwg";
        cupsArrayAdd(filter_chain, filter);
        if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                    "universal: Adding %s to chain", filter->name);
+                    "cfFilterUniversal: Adding %s to chain", filter->name);
       }
     }
     else
     {
-      filter = malloc(sizeof(filter_filter_in_chain_t));
-      filter->function = imagetopdf;
+      filter = malloc(sizeof(cf_filter_filter_in_chain_t));
+      filter->function = cfFilterImageToPDF;
       filter->parameters = NULL;
       filter->name = "imagetopdf";
       cupsArrayAdd(filter_chain, filter);
       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                  "universal: Adding %s to chain", filter->name);
+                  "cfFilterUniversal: Adding %s to chain", filter->name);
     }
   }
   else
   {
     if (!strcmp(input, "application/postscript"))
     {
-      outformat = malloc(sizeof(filter_out_format_t));
-      *outformat = OUTPUT_FORMAT_PDF;
-      filter = malloc(sizeof(filter_filter_in_chain_t));
-      filter->function = ghostscript;
+      outformat = malloc(sizeof(cf_filter_out_format_t));
+      *outformat = CF_FILTER_OUT_FORMAT_PDF;
+      filter = malloc(sizeof(cf_filter_filter_in_chain_t));
+      filter->function = cfFilterGhostscript;
       filter->parameters = outformat;
       filter->name = "ghostscript";
       cupsArrayAdd(filter_chain, filter);
       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                  "universal: Adding %s to chain", filter->name);
+                  "cfFilterUniversal: Adding %s to chain", filter->name);
     }
     else if (!strcmp(input_super, "text") ||
             (!strcmp(input_super, "application") && input_type[0] == 'x'))
     {
-      filter = malloc(sizeof(filter_filter_in_chain_t));
-      texttopdf_parameter_t* parameters =
-       (texttopdf_parameter_t *) malloc(sizeof(texttopdf_parameter_t));
+      filter = malloc(sizeof(cf_filter_filter_in_chain_t));
+      cf_filter_texttopdf_parameter_t* parameters =
+       (cf_filter_texttopdf_parameter_t *) malloc(sizeof(cf_filter_texttopdf_parameter_t));
       *parameters = universal_parameters.texttopdf_params;
-      filter->function = texttopdf;
+      filter->function = cfFilterTextToPDF;
       filter->parameters = parameters;
       filter->name = "texttopdf";
       cupsArrayAdd(filter_chain, filter);
       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                  "universal: Adding %s to chain",
+                  "cfFilterUniversal: Adding %s to chain",
                   filter->name);
     }
     else if (!strcmp(input, "image/urf") ||
             !strcmp(input, "image/pwg-raster") ||
             !strcmp(input, "application/vnd.cups-raster"))
     {
-      outformat = malloc(sizeof(filter_out_format_t));
-      *outformat = OUTPUT_FORMAT_PDF;
-      filter = malloc(sizeof(filter_filter_in_chain_t));
-      filter->function = rastertopdf;
+      outformat = malloc(sizeof(cf_filter_out_format_t));
+      *outformat = CF_FILTER_OUT_FORMAT_PDF;
+      filter = malloc(sizeof(cf_filter_filter_in_chain_t));
+      filter->function = cfFilterRasterToPDF;
       filter->parameters = outformat;
       filter->name = "rastertopdf";
       cupsArrayAdd(filter_chain, filter);
       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                  "universal: Adding %s to chain", filter->name);
+                  "cfFilterUniversal: Adding %s to chain", filter->name);
     }
     else if (!strcmp(input_type, "vnd.adobe-reader-postscript"))
     {
-      outformat = malloc(sizeof(filter_out_format_t));
-      *outformat = OUTPUT_FORMAT_CUPS_RASTER;
+      outformat = malloc(sizeof(cf_filter_out_format_t));
+      *outformat = CF_FILTER_OUT_FORMAT_CUPS_RASTER;
       if (!strcmp(output_type, "pwg-raster"))
-       *outformat = OUTPUT_FORMAT_PWG_RASTER;
+       *outformat = CF_FILTER_OUT_FORMAT_PWG_RASTER;
       else if(!strcmp(output_type, "urf") ||
              (!strcmp(output_type, "vnd.cups-raster") &&
               !strcmp(final_output, "image/urf")))
-       *outformat = OUTPUT_FORMAT_APPLE_RASTER;
+       *outformat = CF_FILTER_OUT_FORMAT_APPLE_RASTER;
       else if(!strcmp(output_type, "PCLm"))
-       *outformat = OUTPUT_FORMAT_PCLM;
-      filter = malloc(sizeof(filter_filter_in_chain_t));
-      filter->function = ghostscript;
+       *outformat = CF_FILTER_OUT_FORMAT_PCLM;
+      filter = malloc(sizeof(cf_filter_filter_in_chain_t));
+      filter->function = cfFilterGhostscript;
       filter->parameters = outformat;
       filter->name = "ghostscript";
       cupsArrayAdd(filter_chain, filter);
       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                  "universal: Adding %s to chain", filter->name);
+                  "cfFilterUniversal: Adding %s to chain", filter->name);
 
       if (!strcmp(output, "image/urf"))
       {
-       filter = malloc(sizeof(filter_filter_in_chain_t));
-       outformat = malloc(sizeof(filter_out_format_t));
-       *outformat = OUTPUT_FORMAT_APPLE_RASTER;
-       filter->function = rastertopwg;
+       filter = malloc(sizeof(cf_filter_filter_in_chain_t));
+       outformat = malloc(sizeof(cf_filter_out_format_t));
+       *outformat = CF_FILTER_OUT_FORMAT_APPLE_RASTER;
+       filter->function = cfFilterRasterToPWG;
        filter->parameters = outformat;
        filter->name = "rastertopwg";
        cupsArrayAdd(filter_chain, filter);
        if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                    "universal: Adding %s to chain",
+                    "cfFilterUniversal: Adding %s to chain",
                     filter->name);
       }
       else if (strcmp(output_type, "pwg-raster") &&
               strcmp(output_type, "vnd.cups-raster") &&
               strcmp(output_type, "PCLm"))
       {
-       outformat = malloc(sizeof(filter_out_format_t));
-       *outformat = OUTPUT_FORMAT_PDF;
-       filter = malloc(sizeof(filter_filter_in_chain_t));
-       filter->function = rastertopdf;
+       outformat = malloc(sizeof(cf_filter_out_format_t));
+       *outformat = CF_FILTER_OUT_FORMAT_PDF;
+       filter = malloc(sizeof(cf_filter_filter_in_chain_t));
+       filter->function = cfFilterRasterToPDF;
        filter->parameters = outformat;
        filter->name = "rastertopdf";
        cupsArrayAdd(filter_chain, filter);
        if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                    "universal: Adding %s to chain", filter->name);
+                    "cfFilterUniversal: Adding %s to chain", filter->name);
       }
     }
     else if (!strcmp(input, "application/vnd.cups-pdf-banner"))
     {
-      filter = malloc(sizeof(filter_filter_in_chain_t));
-      filter->function = bannertopdf;
+      filter = malloc(sizeof(cf_filter_filter_in_chain_t));
+      filter->function = cfFilterBannerToPDF;
       filter->parameters = NULL;
       filter->name = "bannertopdf";
       cupsArrayAdd(filter_chain, filter);
       if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                  "universal: Adding %s to chain", filter->name);
+                  "cfFilterUniversal: Adding %s to chain", filter->name);
     }
     else if (!strstr(input_type, "pdf"))
     {
@@ -396,13 +396,13 @@ universal(int inputfd,         /* I - File descriptor input stream */
     if (strcmp(output_type, "pdf")) {
       if (strcmp(input_type, "vnd.cups-pdf"))
       {
-       filter = malloc(sizeof(filter_filter_in_chain_t));
-       filter->function = pdftopdf;
+       filter = malloc(sizeof(cf_filter_filter_in_chain_t));
+       filter->function = cfFilterPDFToPDF;
        filter->parameters = strdup(output);
        filter->name = "pdftopdf";
        cupsArrayAdd(filter_chain, filter);
        if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                    "universal: Adding %s to chain", filter->name);
+                    "cfFilterUniversal: Adding %s to chain", filter->name);
       }
 
       if (strcmp(output_type, "vnd.cups-pdf"))
@@ -412,48 +412,48 @@ universal(int inputfd,         /* I - File descriptor input stream */
            !strcmp(output_type, "pwg-raster") ||
            !strcmp(output_type, "PCLm"))
        {
-         outformat = malloc(sizeof(filter_out_format_t));
-         *outformat = OUTPUT_FORMAT_CUPS_RASTER;
+         outformat = malloc(sizeof(cf_filter_out_format_t));
+         *outformat = CF_FILTER_OUT_FORMAT_CUPS_RASTER;
          if (!strcmp(output_type, "pwg-raster"))
-           *outformat = OUTPUT_FORMAT_PWG_RASTER;
+           *outformat = CF_FILTER_OUT_FORMAT_PWG_RASTER;
          else if (!strcmp(output_type, "urf") ||
                   (!strcmp(output_type, "vnd.cups-raster") &&
                    !strcmp(final_output, "image/urf")))
-           *outformat = OUTPUT_FORMAT_APPLE_RASTER;
+           *outformat = CF_FILTER_OUT_FORMAT_APPLE_RASTER;
          else if(!strcmp(output_type, "PCLm"))
-           *outformat = OUTPUT_FORMAT_PCLM;
-         filter = malloc(sizeof(filter_filter_in_chain_t));
-         filter->function = ghostscript;
+           *outformat = CF_FILTER_OUT_FORMAT_PCLM;
+         filter = malloc(sizeof(cf_filter_filter_in_chain_t));
+         filter->function = cfFilterGhostscript;
          filter->parameters = outformat;
          filter->name = "ghostscript";
          cupsArrayAdd(filter_chain, filter);
          if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                      "universal: Adding %s to chain",
+                      "cfFilterUniversal: Adding %s to chain",
                       filter->name);
 
          if (!strcmp(output, "image/urf"))
          {
-           filter = malloc(sizeof(filter_filter_in_chain_t));
-           outformat = malloc(sizeof(filter_out_format_t));
-           *outformat = OUTPUT_FORMAT_APPLE_RASTER;
-           filter->function = rastertopwg;
+           filter = malloc(sizeof(cf_filter_filter_in_chain_t));
+           outformat = malloc(sizeof(cf_filter_out_format_t));
+           *outformat = CF_FILTER_OUT_FORMAT_APPLE_RASTER;
+           filter->function = cfFilterRasterToPWG;
            filter->parameters = outformat;
            filter->name = "rastertopwg";
            cupsArrayAdd(filter_chain, filter);
            if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                        "universal: Adding %s to chain",
+                        "cfFilterUniversal: Adding %s to chain",
                         filter->name);
          }
        }
        else if(!strcmp(output, "application/postscript") ||
                !strcmp(output, "application/vnd.cups-postscript"))
        {
-         filter = malloc(sizeof(filter_filter_in_chain_t));
-         filter->function = pdftops;
+         filter = malloc(sizeof(cf_filter_filter_in_chain_t));
+         filter->function = cfFilterPDFToPS;
          filter->parameters = NULL;
          filter->name = "pdftops";
          if (log) log(ld, FILTER_LOGLEVEL_DEBUG,
-                      "universal: Adding %s to chain", filter->name);
+                      "cfFilterUniversal: Adding %s to chain", filter->name);
          cupsArrayAdd(filter_chain, filter);
        }
        else
@@ -470,17 +470,17 @@ universal(int inputfd,         /* I - File descriptor input stream */
 
   if (ret) {
     if (log) log(ld, FILTER_LOGLEVEL_ERROR,
-                "universal: Unsupported combination of input and output formats: %s -> %s",
+                "cfFilterUniversal: Unsupported combination of input and output formats: %s -> %s",
                 input, output);
   }
   else
     /* Do the dirty work ... */
-    ret = filterChain(inputfd, outputfd, inputseekable, data, filter_chain);
+    ret = cfFilterChain(inputfd, outputfd, inputseekable, data, filter_chain);
 
-  for (filter = (filter_filter_in_chain_t *)cupsArrayFirst(filter_chain);
+  for (filter = (cf_filter_filter_in_chain_t *)cupsArrayFirst(filter_chain);
        filter; filter = next)
   {
-    next = (filter_filter_in_chain_t *)cupsArrayNext(filter_chain);
+    next = (cf_filter_filter_in_chain_t *)cupsArrayNext(filter_chain);
     free(filter->parameters);
     free(filter);
   }
index 087646fa3c3fedfbdf9cd93023224c953a2afb8b..d5cb23f7fe9aa8827ccb54568e1fbfcea6838f78 100644 (file)
@@ -50,7 +50,7 @@ main(int  argc,          /* I - Number of command-line arguments */
 #endif /* HAVE_SIGSET */
 
  /*
-  * Fire up the pdftoraster() filter function
+  * Fire up the cfFilterPDFToRaster() filter function
   */
 
   char buf[1024];
@@ -59,7 +59,7 @@ main(int  argc,          /* I - Number of command-line arguments */
     datadir = CUPS_DATADIR;
   snprintf(buf, sizeof(buf), "%s/data", datadir);
 
-  ret = filterCUPSWrapper(argc, argv, bannertopdf, buf, &JobCanceled);
+  ret = cfFilterCUPSWrapper(argc, argv, cfFilterBannerToPDF, buf, &JobCanceled);
 
   if (ret)
     fprintf(stderr, "ERROR: bannertopdf filter function failed.\n");
index b1de607cfceb317f34e332f0a490eb3c3168732c..9fed656a553dcc49fdfbc5eff9d816838cd75ef9 100644 (file)
@@ -764,10 +764,10 @@ int main(int argc, char** argv)
     int havefilter, havegstoraster;
     dstr_t *filelist;
     list_t * arglist;
-    filter_data_t temp;
-    filter_data_t *data = &temp;
+    cf_filter_data_t temp;
+    cf_filter_data_t *data = &temp;
     data->logdata = NULL;
-    data->logfunc = cups_logfunc;
+    data->logfunc = cfCUPSLogFunc;
     arglist = list_create_from_array(argc -1, (void**)&argv[1]);
 
     if (argc == 2 && (arglist_find(arglist, "--version") || arglist_find(arglist, "--help") ||
index 1e3d148a38ff5925f38e8f5eea7a397f34721be1..57d118f1596cb24260a14462747464de0e80da73 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * PostScript to PDF filter (based on ghostscript() filter function).
+ * PostScript to PDF filter (based on cfFilterGhostscript() filter function).
  */
 
 
@@ -54,11 +54,12 @@ main(int  argc,                             /* I - Number of command-line args */
 #endif /* HAVE_SIGSET */
 
   /*
-   * Fire up the ghostscript() filter function.
+   * Fire up the cfFilterGhostscript() filter function.
    */
 
-  filter_out_format_t outformat = OUTPUT_FORMAT_PDF;
-  ret = filterCUPSWrapper(argc, argv, ghostscript, &outformat, &JobCanceled);
+  cf_filter_out_format_t outformat = CF_FILTER_OUT_FORMAT_PDF;
+  ret = cfFilterCUPSWrapper(argc, argv, cfFilterGhostscript, &outformat,
+                           &JobCanceled);
 
   if (ret)
     fprintf(stderr, "ERROR: gstopdf filter failed.\n");
index 40ec43a97a682b55caf97c4fb94861ecb1eb7016..cdbecf55ada0dfc5227c72fd23f042b69c88a185 100644 (file)
@@ -1,5 +1,6 @@
 /*
- * PostScript/PDF to PCL-XL filter (based on ghostscript() filter function).
+ * PostScript/PDF to PCL-XL filter (based on cfFilterGhostscript() filter
+ * function).
  */
 
 
@@ -54,11 +55,12 @@ main(int  argc,                             /* I - Number of command-line args */
 #endif /* HAVE_SIGSET */
 
   /*
-   * Fire up the ghostscript() filter function.
+   * Fire up the cfFilterGhostscript() filter function.
    */
 
-  filter_out_format_t outformat = OUTPUT_FORMAT_PXL;
-  ret = filterCUPSWrapper(argc, argv, ghostscript, &outformat, &JobCanceled);
+  cf_filter_out_format_t outformat = CF_FILTER_OUT_FORMAT_PXL;
+  ret = cfFilterCUPSWrapper(argc, argv, cfFilterGhostscript, &outformat,
+                           &JobCanceled);
 
   if (ret)
     fprintf(stderr, "ERROR: gstopxl filter failed.\n");
index 75d804353547835a2ad2d6c5cd3507a73322ca21..46322a0b7ee270fafd4b00167c44874d6c23dc0d 100644 (file)
@@ -1,5 +1,6 @@
 /*
- * PostScript/PDF to Raster filter (based on ghostscript() filter function).
+ * PostScript/PDF to Raster filter (based on cfFilterGhostscript() filter
+ * function).
  */
 
 
@@ -54,21 +55,22 @@ main(int  argc,                             /* I - Number of command-line args */
 #endif /* HAVE_SIGSET */
 
   /*
-   * Fire up the ghostscript() filter function.
+   * Fire up the cfFilterGhostscript() filter function.
    */
 
-  filter_out_format_t outformat = OUTPUT_FORMAT_CUPS_RASTER;
+  cf_filter_out_format_t outformat = CF_FILTER_OUT_FORMAT_CUPS_RASTER;
   char *t = getenv("FINAL_CONTENT_TYPE");
   if (t) {
     if (strcasestr(t, "pwg"))
-      outformat = OUTPUT_FORMAT_PWG_RASTER;
+      outformat = CF_FILTER_OUT_FORMAT_PWG_RASTER;
     else if (strcasestr(t, "urf"))
-      outformat = OUTPUT_FORMAT_APPLE_RASTER;
+      outformat = CF_FILTER_OUT_FORMAT_APPLE_RASTER;
     else if (strcasestr(t, "pclm"))
-      outformat = OUTPUT_FORMAT_PCLM;
+      outformat = CF_FILTER_OUT_FORMAT_PCLM;
   }
 
-  ret = filterCUPSWrapper(argc, argv, ghostscript, &outformat, &JobCanceled);
+  ret = cfFilterCUPSWrapper(argc, argv, cfFilterGhostscript, &outformat,
+                           &JobCanceled);
 
   if (ret)
     fprintf(stderr, "ERROR: gstoraster filter failed.\n");
index 6992d06e60b5bc9580a79145f096cb394fd20ab1..a208f63b17a3d6f837e37b60c2d3ce81d55ba268 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Image-to-PDF filter for CUPS (based on imagetopdf() filter function).
+ * Image-to-PDF filter for CUPS (based on cfFilterImageToPDF() filter function).
  *
  * Copyright © 2020 by Till Kamppeter
  * Copyright © 2007-2018 by Apple Inc.
@@ -61,10 +61,10 @@ main(int  argc,                             /* I - Number of command-line args */
 #endif /* HAVE_SIGSET */
 
  /*
-  * Fire up the imagetopdf() filter function
+  * Fire up the cfFilterImageToPDF() filter function
   */
 
-  ret = filterCUPSWrapper(argc, argv, imagetopdf, NULL, &JobCanceled);
+  ret = cfFilterCUPSWrapper(argc, argv, cfFilterImageToPDF, NULL, &JobCanceled);
 
   if (ret)
     fprintf(stderr, "ERROR: imagetopdf filter function failed.\n");
index cd58aba1af54f17b0a9a937b346acdf60ec9c337..e373b4f56b9c22c50fe3824e4cf9465237cd6198 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Image-to-PostScript filter for CUPS (based on imagetops() filter function)
+ * Image-to-PostScript filter for CUPS (based on cfFilterImageToPS() filter function)
  *
  * Copyright © 2020 by Till Kamppeter
  * Copyright © 2007-2018 by Apple Inc.
@@ -61,10 +61,10 @@ main(int  argc,                             /* I - Number of command-line args */
 #endif /* HAVE_SIGSET */
 
  /*
-  * Fire up the imagetops() filter function
+  * Fire up the cfFilterImageToPS() filter function
   */
 
-  ret = filterCUPSWrapper(argc, argv, imagetops, NULL, &JobCanceled);
+  ret = cfFilterCUPSWrapper(argc, argv, cfFilterImageToPS, NULL, &JobCanceled);
 
   if (ret)
     fprintf(stderr, "ERROR: imagetops filter function failed.\n");
index 80d13888d5b40b7c334f3b2f4f3dcf34997ec72a..9e60fb901dbd3dfcecef90cd8e9a805349e33887 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Image-to-Raster filter for CUPS (based on imagetoraster() filter function).
+ * Image-to-Raster filter for CUPS (based on cfFilterImageToRaster() filter function).
  *
  * Copyright © 2020 by Till Kamppeter
  * Copyright © 2007-2018 by Apple Inc.
@@ -61,21 +61,21 @@ main(int  argc,                             /* I - Number of command-line args */
 #endif /* HAVE_SIGSET */
 
  /*
-  * Fire up the imagetoraster() filter function
+  * Fire up the cfFilterImageToRaster() filter function
   */
 
-  filter_out_format_t outformat = OUTPUT_FORMAT_CUPS_RASTER;
+  cf_filter_out_format_t outformat = CF_FILTER_OUT_FORMAT_CUPS_RASTER;
   char *t = getenv("FINAL_CONTENT_TYPE");
   if (t) {
     if (strcasestr(t, "pwg"))
-      outformat = OUTPUT_FORMAT_PWG_RASTER;
+      outformat = CF_FILTER_OUT_FORMAT_PWG_RASTER;
     else if (strcasestr(t, "urf"))
-      outformat = OUTPUT_FORMAT_APPLE_RASTER;
+      outformat = CF_FILTER_OUT_FORMAT_APPLE_RASTER;
     else if (strcasestr(t, "pclm"))
-      outformat = OUTPUT_FORMAT_PCLM;
+      outformat = CF_FILTER_OUT_FORMAT_PCLM;
   }
 
-  ret = filterCUPSWrapper(argc, argv, imagetoraster, &outformat, &JobCanceled);
+  ret = cfFilterCUPSWrapper(argc, argv, cfFilterImageToRaster, &outformat, &JobCanceled);
 
   if (ret)
     fprintf(stderr, "ERROR: imagetoraster filter function failed.\n");
index 398ab7f2c02cd69b00aa6cbac4c2de79c5651cca..eff52b3a65cdbf09de9835af6900767142ddfd6b 100644 (file)
@@ -50,21 +50,21 @@ main(int  argc,        /* I - Number of command-line arguments */
 #endif /* HAVE_SIGSET */
 
  /*
-  * Fire up the mupdftopwg() filter function
+  * Fire up the cfFilterMuPDFToPWG() filter function
   */
   
-  filter_out_format_t outformat = OUTPUT_FORMAT_CUPS_RASTER;
+  cf_filter_out_format_t outformat = CF_FILTER_OUT_FORMAT_CUPS_RASTER;
   char *t = getenv("FINAL_CONTENT_TYPE");
   if (t) {
     if (strcasestr(t, "pwg"))
-      outformat = OUTPUT_FORMAT_PWG_RASTER;
+      outformat = CF_FILTER_OUT_FORMAT_PWG_RASTER;
     else if (strcasestr(t, "urf"))
-      outformat = OUTPUT_FORMAT_APPLE_RASTER;
+      outformat = CF_FILTER_OUT_FORMAT_APPLE_RASTER;
     else if (strcasestr(t, "pclm"))
-      outformat = OUTPUT_FORMAT_PCLM;
+      outformat = CF_FILTER_OUT_FORMAT_PCLM;
   }
 
-  ret = filterCUPSWrapper(argc, argv, mupdftopwg, &outformat, &JobCanceled);
+  ret = cfFilterCUPSWrapper(argc, argv, cfFilterMuPDFToPWG, &outformat, &JobCanceled);
 
   if (ret)
     fprintf(stderr, "ERROR: mupdftopwg filter function failed.\n");
index 25cf24ff2b881a48bd159bd505183157c55f96c6..f773a50bd036e47691347d9034811280c6c6f8e7 100644 (file)
@@ -34,19 +34,19 @@ int main(int argc, char **argv)
   int ret;
 
  /*
-  * Fire up the pclmtoraster() filter function
+  * Fire up the cfFilterPCLmToRaster() filter function
   */
 
-  filter_out_format_t outformat = OUTPUT_FORMAT_PWG_RASTER;
+  cf_filter_out_format_t outformat = CF_FILTER_OUT_FORMAT_PWG_RASTER;
   char *t = getenv("FINAL_CONTENT_TYPE");
   if (t) {
     if (strcasestr(t, "urf"))
-      outformat = OUTPUT_FORMAT_APPLE_RASTER;
+      outformat = CF_FILTER_OUT_FORMAT_APPLE_RASTER;
     else if (strcasestr(t, "cups-raster"))
-      outformat = OUTPUT_FORMAT_CUPS_RASTER;
+      outformat = CF_FILTER_OUT_FORMAT_CUPS_RASTER;
   }
 
-  ret = filterCUPSWrapper(argc, argv, pclmtoraster, &outformat, &JobCanceled);
+  ret = cfFilterCUPSWrapper(argc, argv, cfFilterPCLmToRaster, &outformat, &JobCanceled);
 
   if (ret)
     fprintf(stderr, "ERROR: pclmtoraster filter function failed.\n");
index 73a6dffc35b3c24fafaca552e9f5664e2bb79ceb..b84e41c8c917e04d39707493a831623165d22d4a 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Pdf to pdf filter based on pdftopdf() filter function.
+ * Pdf to pdf filter based on cfFilterPDFToPDF() filter function.
  */
 
 
@@ -53,7 +53,7 @@ main(int  argc,                               /* I - Number of command-line args */
   signal(SIGTERM, cancel_job);
 #endif /* HAVE_SIGSET */
   char *t = getenv("FINAL_CONTENT_TYPE");
-  ret = filterCUPSWrapper(argc, argv, pdftopdf, t, &JobCanceled);
+  ret = cfFilterCUPSWrapper(argc, argv, cfFilterPDFToPDF, t, &JobCanceled);
   if (ret)
     fprintf(stderr, "ERROR: pdftopdf filter function failed.\n");
 
index bbf9e26500825cad9a7c68a4e14e79d9681c9ebe..2774d346f3c5aae19377c9b34eba4b2465a8181e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * PDF-to-PostScript filter for CUPS (based on pdftops() filter function).
+ * PDF-to-PostScript filter for CUPS (based on cfFilterPDFToPS() filter function).
  *
  * Copyright © 2020 by Till Kamppeter
  * Copyright © 2007-2018 by Apple Inc.
@@ -61,10 +61,10 @@ main(int  argc,                             /* I - Number of command-line args */
 #endif /* HAVE_SIGSET */
 
  /*
-  * Fire up the pstops() filter function
+  * Fire up the cfFilterPSToPS() filter function
   */
 
-  ret = filterCUPSWrapper(argc, argv, pdftops, NULL, &JobCanceled);
+  ret = cfFilterCUPSWrapper(argc, argv, cfFilterPDFToPS, NULL, &JobCanceled);
 
   if (ret)
     fprintf(stderr, "ERROR: pdftops filter function failed.\n");
index bd17814e7a37328ff6531477525d8b2d546062d4..a059460e1e4a3707955722df72065d725c0487d4 100644 (file)
@@ -49,23 +49,23 @@ main(int  argc,        /* I - Number of command-line arguments */
 #endif /* HAVE_SIGSET */
 
  /*
-  * Fire up the pdftoraster() filter function
+  * Fire up the cfFilterPDFToRaster() filter function
   */
 
-  filter_out_format_t outformat = OUTPUT_FORMAT_CUPS_RASTER;
+  cf_filter_out_format_t outformat = CF_FILTER_OUT_FORMAT_CUPS_RASTER;
   char *t = getenv("FINAL_CONTENT_TYPE");
   if (t) {
     if (strcasestr(t, "pwg"))
-      outformat = OUTPUT_FORMAT_PWG_RASTER;
+      outformat = CF_FILTER_OUT_FORMAT_PWG_RASTER;
     else if (strcasestr(t, "cups"))
-      outformat = OUTPUT_FORMAT_CUPS_RASTER;
+      outformat = CF_FILTER_OUT_FORMAT_CUPS_RASTER;
     else if (strcasestr(t, "urf"))
-      outformat = OUTPUT_FORMAT_APPLE_RASTER;
+      outformat = CF_FILTER_OUT_FORMAT_APPLE_RASTER;
     else if (strcasestr(t, "pclm"))
-      outformat = OUTPUT_FORMAT_PCLM;
+      outformat = CF_FILTER_OUT_FORMAT_PCLM;
   }
 
-  ret = filterCUPSWrapper(argc, argv, pdftoraster, &outformat, &JobCanceled);
+  ret = cfFilterCUPSWrapper(argc, argv, cfFilterPDFToRaster, &outformat, &JobCanceled);
 
   if (ret)
     fprintf(stderr, "ERROR: pdftoraster filter function failed.\n");
index 632c771a84441585b22a63fb09c24d0e2549429f..8c42eb7934793d0ba39240f547c9458551fb2e18 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * PostScript filter for CUPS (based on pstops() filter function).
+ * PostScript filter for CUPS (based on cfFilterPSToPS() filter function).
  *
  * Copyright © 2020 by Till Kamppeter
  * Copyright © 2007-2018 by Apple Inc.
@@ -61,10 +61,10 @@ main(int  argc,                             /* I - Number of command-line args */
 #endif /* HAVE_SIGSET */
 
  /*
-  * Fire up the pstops() filter function
+  * Fire up the cfFilterPSToPS() filter function
   */
 
-  ret = filterCUPSWrapper(argc, argv, pstops, NULL, &JobCanceled);
+  ret = cfFilterCUPSWrapper(argc, argv, cfFilterPSToPS, NULL, &JobCanceled);
 
   if (ret)
     fprintf(stderr, "ERROR: pstops filter function failed.\n");
index 20d2a641ead69e99b45b04684ef3c7d5797b18f3..c630ec06f72e2ca9bbe0b6d214ab8ff9f6a8faa2 100644 (file)
@@ -49,21 +49,21 @@ main(int  argc,        /* I - Number of command-line arguments */
 #endif /* HAVE_SIGSET */
 
  /*
-  * Fire up the pdftoraster() filter function
+  * Fire up the cfFilterPDFToRaster() filter function
   */
 
-  filter_out_format_t outformat = OUTPUT_FORMAT_CUPS_RASTER;
+  cf_filter_out_format_t outformat = CF_FILTER_OUT_FORMAT_CUPS_RASTER;
   char *t = getenv("FINAL_CONTENT_TYPE");
   if (t) {
     if (strcasestr(t, "pwg"))
-      outformat = OUTPUT_FORMAT_PWG_RASTER;
+      outformat = CF_FILTER_OUT_FORMAT_PWG_RASTER;
     else if (strcasestr(t, "urf"))
-      outformat = OUTPUT_FORMAT_APPLE_RASTER;
+      outformat = CF_FILTER_OUT_FORMAT_APPLE_RASTER;
     else if (strcasestr(t, "pclm"))
-      outformat = OUTPUT_FORMAT_PCLM;
+      outformat = CF_FILTER_OUT_FORMAT_PCLM;
   }
 
-  ret = filterCUPSWrapper(argc, argv, pwgtoraster, &outformat, &JobCanceled);
+  ret = cfFilterCUPSWrapper(argc, argv, cfFilterPWGToRaster, &outformat, &JobCanceled);
 
   if (ret)
     fprintf(stderr, "ERROR: pwgtoraster filter function failed.\n");
index a34830468a4d6baadae9a93e16aa5a6c044dc9ec..2a6c18984cb88a9eb765d5e4dae46add68f80d95 100644 (file)
@@ -1768,7 +1768,7 @@ main(int  argc,                           /* I - Number of command-line arguments */
   * Log function for the library functions, standard CUPS logging to stderr...
   */
 
-  logfunc = cups_logfunc;
+  logfunc = cfCUPSLogFunc;
   ld = NULL;
 
  /*
index 284743d72a4d14f32a5c2320beb40626f0116fd1..8174149d64f152d58989564a5dc00864f1cc0a30 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Raster to pclm filter(based on rastertopdf() filter function).
+ * Raster to pclm filter(based on cfFilterRasterToPDF() filter function).
  */
 
 
@@ -54,11 +54,11 @@ main(int  argc,                             /* I - Number of command-line args */
 #endif /* HAVE_SIGSET */
 
   /*
-   * Fire up the rastertopdf() filter function.
+   * Fire up the cfFilterRasterToPDF() filter function.
    */
 
-  filter_out_format_t outformat = OUTPUT_FORMAT_PCLM;
-  ret = filterCUPSWrapper(argc, argv, rastertopdf, &outformat, &JobCanceled);
+  cf_filter_out_format_t outformat = CF_FILTER_OUT_FORMAT_PCLM;
+  ret = cfFilterCUPSWrapper(argc, argv, cfFilterRasterToPDF, &outformat, &JobCanceled);
 
   if (ret)
     fprintf(stderr, "ERROR: rastertopclm filter failed.\n");
index b5a15eb02e6f39b1cf5c9c47ce110c53a8d19455..bb70e4a8f6b668edfb27edf254a5abe4044707a9 100644 (file)
@@ -88,7 +88,7 @@ void            *ld;                    /* Log function data */
  * Prototypes...
  */
 
-void   StartPage(filter_data_t *data, ppd_file_t *ppd, cups_page_header2_t *header, int job_id,
+void   StartPage(cf_filter_data_t *data, ppd_file_t *ppd, cups_page_header2_t *header, int job_id,
                  const char *user, const char *title, int num_options,
                  cups_option_t *options);
 void   EndPage(ppd_file_t *ppd, cups_page_header2_t *header);
@@ -107,7 +107,7 @@ int ReadLine(cups_raster_t *ras, cups_page_header2_t *header);
  */
 
 void
-StartPage(filter_data_t      *data,    /* I - filter data */
+StartPage(cf_filter_data_t      *data, /* I - filter data */
          ppd_file_t         *ppd,      /* I - PPD file */
           cups_page_header2_t *header, /* I - Page header */
          int                job_id,    /* I - Job ID */
@@ -1817,7 +1817,7 @@ main(int  argc,                           /* I - Number of command-line arguments */
   * Log function for the library functions, standard CUPS logging to stderr...
   */
 
-  logfunc = cups_logfunc;
+  logfunc = cfCUPSLogFunc;
   ld = NULL;
 
  /*
@@ -1829,11 +1829,11 @@ main(int  argc,                         /* I - Number of command-line arguments */
  /*
   * Check command-line...
   */
-  filter_data_t temp;
-  filter_data_t *data = &temp;
+  cf_filter_data_t temp;
+  cf_filter_data_t *data = &temp;
   data->printer = getenv("PRINTER");
   data->logdata = NULL;
-  data->logfunc = cups_logfunc;
+  data->logfunc = cfCUPSLogFunc;
   if (argc < 6 || argc > 7)
   {
     fprintf(stderr, "Usage: %s job-id user title copies options [file]\n",
index 4c97994fb59ff6d269be8da2a09b4b6788c9d973..12cde08f9e4c00bb22c9dca2deb46fa6f10ff2e3 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Raster to pdf filter(based on rastertopdf() filter function).
+ * Raster to pdf filter(based on cfFilterRasterToPDF() filter function).
  */
 
 
@@ -54,11 +54,11 @@ main(int  argc,                             /* I - Number of command-line args */
 #endif /* HAVE_SIGSET */
 
   /*
-   * Fire up the rastertopdf() filter function.
+   * Fire up the cfFilterRasterToPDF() filter function.
    */
 
-  filter_out_format_t outformat = OUTPUT_FORMAT_PDF;
-  ret = filterCUPSWrapper(argc, argv, rastertopdf, &outformat, &JobCanceled);
+  cf_filter_out_format_t outformat = CF_FILTER_OUT_FORMAT_PDF;
+  ret = cfFilterCUPSWrapper(argc, argv, cfFilterRasterToPDF, &outformat, &JobCanceled);
 
   if (ret)
     fprintf(stderr, "ERROR: rastertopdf filter failed.\n");
index 29c3d45f6e52c464cbdcfecf7cc4998fe6541c86..a72553a8e780f1c6469c3e27796999cfd7df9efe 100644 (file)
@@ -71,10 +71,10 @@ main(int  argc,        /* I - Number of command-line arguments */
 #endif /* HAVE_SIGSET */
 
  /*
-  * Fire up the rastertops() filter function
+  * Fire up the cfFilterRasterToPS() filter function
   */
 
-  ret = filterCUPSWrapper(argc, argv, rastertops, NULL, &JobCanceled);
+  ret = cfFilterCUPSWrapper(argc, argv, cfFilterRasterToPS, NULL, &JobCanceled);
 
   if (ret)
     fprintf(stderr, "ERROR: rastertops filter function failed.\n");
index 1b8f6fad1c20e59e8c8a753029b1128d8885ce90..125ce97440a53e4f18108ef2f48cb5ccd65fac71 100644 (file)
@@ -49,17 +49,17 @@ main(int  argc,        /* I - Number of command-line arguments */
 #endif /* HAVE_SIGSET */
 
  /*
-  * Fire up the pdftoraster() filter function
+  * Fire up the cfFilterPDFToRaster() filter function
   */
-  filter_out_format_t outformat = OUTPUT_FORMAT_PWG_RASTER;
+  cf_filter_out_format_t outformat = CF_FILTER_OUT_FORMAT_PWG_RASTER;
   char *t = getenv("FINAL_CONTENT_TYPE");
   if (t) {
     if (strcasestr(t, "pwg"))
-      outformat = OUTPUT_FORMAT_PWG_RASTER;
+      outformat = CF_FILTER_OUT_FORMAT_PWG_RASTER;
     else if (strcasestr(t, "urf"))
-      outformat = OUTPUT_FORMAT_APPLE_RASTER;
+      outformat = CF_FILTER_OUT_FORMAT_APPLE_RASTER;
   }
-  ret = filterCUPSWrapper(argc, argv, rastertopwg, &outformat, &JobCanceled);
+  ret = cfFilterCUPSWrapper(argc, argv, cfFilterRasterToPWG, &outformat, &JobCanceled);
 
   if (ret)
     fprintf(stderr, "ERROR: rastertopwg filter function failed.\n");
index 14cac562fd7426afb7d609daf9a0391cd92140be..4c3ac47c2414855da72b28cb139c6152831d61d4 100644 (file)
@@ -50,9 +50,9 @@ main(int  argc,          /* I - Number of command-line arguments */
 #endif /* HAVE_SIGSET */
 
  /*
-  * Fire up the texttopdf() filter function
+  * Fire up the cfFilterTextToPDF() filter function
   */
- texttopdf_parameter_t parameters;
cf_filter_texttopdf_parameter_t parameters;
  char *p;
 
  if ((p = getenv("CUPS_DATADIR")) != NULL)
@@ -72,7 +72,7 @@ main(int  argc,          /* I - Number of command-line arguments */
  else
    parameters.classification = NULL;
 
-  ret = filterCUPSWrapper(argc, argv, texttopdf, &parameters, &JobCanceled);
+  ret = cfFilterCUPSWrapper(argc, argv, cfFilterTextToPDF, &parameters, &JobCanceled);
 
   if (ret)
     fprintf(stderr, "ERROR: texttopdf filter function failed.\n");
index 00d2b1cf2cfb0b53210ebb2ab20bb5c2f5bd2570..72a8ff86cc9c7087d88ff4e0dd53ca7880943175 100644 (file)
@@ -49,11 +49,11 @@ main(int  argc,        /* I - Number of command-line arguments */
 #endif /* HAVE_SIGSET */
 
  /*
-  * Fire up the texttotext() filter function
+  * Fire up the cfFilterTextToText() filter function
   */
 
 
-  ret = filterCUPSWrapper(argc, argv, texttotext, NULL, &JobCanceled);
+  ret = cfFilterCUPSWrapper(argc, argv, cfFilterTextToText, NULL, &JobCanceled);
 
   if (ret)
     fprintf(stderr, "ERROR: texttotext filter function failed.\n");
index 2ca02c44f90ebfae14171ff96aab041f8e3079ef..44ace59847711c6454814074eef0710bdedda076 100644 (file)
@@ -31,7 +31,7 @@ main(int  argc,                               /* I - Number of command-line args */
 {
   int           ret;
   char          *p;
-  universal_parameter_t universal_parameters;
+  cf_filter_universal_parameter_t universal_parameters;
 #if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)
   struct sigaction action;             /* Actions for POSIX signals */
 #endif /* HAVE_SIGACTION && !HAVE_SIGSET */
@@ -80,7 +80,7 @@ main(int  argc,                               /* I - Number of command-line args */
   else
     universal_parameters.texttopdf_params.classification = NULL;
 
-  ret = filterCUPSWrapper(argc, argv, universal, &universal_parameters,
+  ret = cfFilterCUPSWrapper(argc, argv, cfFilterUniversal, &universal_parameters,
                          &JobCanceled);
 
   if (ret)