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

14 files changed:
cupsfilters/bannertopdf.c
cupsfilters/ghostscript.c
cupsfilters/imagetopdf.c
cupsfilters/imagetops.c
cupsfilters/imagetoraster.c
cupsfilters/mupdftopwg.c
cupsfilters/pclmtoraster.cxx
cupsfilters/pdftopdf/pdftopdf.cc
cupsfilters/pdftops.c
cupsfilters/pdftoraster.cxx
cupsfilters/pwgtoraster.c
cupsfilters/raster.c
cupsfilters/raster.h
cupsfilters/texttopdf.c

index 8ed496524fd76c5118a506a0a7ee290de2fc0a37..5fdcff0abcfb95b05eef91148a5f60db6b284a81 100644 (file)
@@ -1027,7 +1027,7 @@ int cfFilterBannerToPDF(int inputfd,         /* I - File descriptor input stream
     void *icd = data->iscanceleddata;
     char jobid[50];
 
-    num_options = joinJobOptionsAndAttrs(data, num_options, &options);
+    num_options = cfJoinJobOptionsAndAttrs(data, num_options, &options);
 
    /*
     * Open the input data stream specified by the inputfd...
index ec1a71deabac2d8cf4bd99ec9ba05e37f615e1dc..e7b176ad8dbb5380897d9853cb736065931f3f1c 100644 (file)
@@ -970,7 +970,7 @@ cfFilterGhostscript(int inputfd,            /* I - File descriptor input
   }
 
   /* Find print-rendering-intent */
-  getPrintRenderIntent(data, &h);
+  cfGetPrintRenderIntent(data, &h);
   if(log) log(ld, CF_LOGLEVEL_DEBUG,
              "Print rendering intent = %s", h.cupsRenderingIntent);
 
@@ -1066,7 +1066,7 @@ cfFilterGhostscript(int inputfd,            /* I - File descriptor input
   }
 
   cspace = icc_profile ? CUPS_CSPACE_RGB : -1;
-  cupsRasterPrepareHeader(&h, data, outformat,
+  cfRasterPrepareHeader(&h, data, outformat,
                          (outformat != CF_FILTER_OUT_FORMAT_APPLE_RASTER ?
                           outformat : CF_FILTER_OUT_FORMAT_CUPS_RASTER), 0,
                          &cspace);
index e21b396fdc477bc89e5e81bb148888e8aabe3f9f..261c24a751b09fd018ba59826790a7d6b181ea01 100644 (file)
@@ -863,7 +863,7 @@ cfFilterImageToPDF(int inputfd,         /* I - File descriptor input stream */
   * Also add job-attrs in options list itself. 
   */
 
-  num_options = joinJobOptionsAndAttrs(data, num_options, &options);
+  num_options = cfJoinJobOptionsAndAttrs(data, num_options, &options);
 
  /* 
   * Compute custom margins and min_width and min_length of the page... 
@@ -897,11 +897,11 @@ cfFilterImageToPDF(int inputfd,         /* I - File descriptor input stream */
   /* 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);
+  cfRasterParseIPPOptions(&h, data, 0, 1);
   if (doc.Color)
     doc.Color = h.cupsNumColors <= 1 ? 0 : 1;
   if (!doc.ppd) {
-    /* Without PPD use also the other findings of cupsRasterParseIPPOptions() */
+    /* Without PPD use also the other findings of cfRasterParseIPPOptions() */
     doc.Orientation = h.Orientation;
     doc.Duplex = h.Duplex;
     doc.PageWidth = h.cupsPageSize[0] != 0.0 ? h.cupsPageSize[0] :
index a93a424bcade1225bb37775466c91cc8962aab76..aec05d0aac073004fce68ba44a9a0847d6d72796 100644 (file)
@@ -278,11 +278,11 @@ cfFilterImageToPS(int inputfd,         /* I - File descriptor input stream */
   /* 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);
+  cfRasterParseIPPOptions(&h, data, 0, 1);
   if (doc.Color)
     doc.Color = h.cupsNumColors <= 1 ? 0 : 1;
   if (!ppd) {
-    /* Without PPD use also the other findings of cupsRasterParseIPPOptions() */
+    /* Without PPD use also the other findings of cfRasterParseIPPOptions() */
     doc.Orientation = h.Orientation;
     doc.Duplex = h.Duplex;
     doc.LanguageLevel = 2;
index 04847a8688de58fa620494deef1b8b7316241e8e..2c7ceab96417ef1b15de8dc211c1692ce07a18e4 100644 (file)
@@ -336,7 +336,7 @@ cfFilterImageToRaster(int inputfd,         /* I - File descriptor input stream *
   * Option list...
   */
 
-  num_options = joinJobOptionsAndAttrs(data, num_options, &options);
+  num_options = cfJoinJobOptionsAndAttrs(data, num_options, &options);
 
  /*
   * Open the input data stream specified by the inputfd ...
@@ -412,7 +412,7 @@ cfFilterImageToRaster(int inputfd,         /* I - File descriptor input stream *
   * Process job options...
   */
 
-  cupsRasterPrepareHeader(&header, data, outformat,
+  cfRasterPrepareHeader(&header, data, outformat,
                          CF_FILTER_OUT_FORMAT_CUPS_RASTER, 1, &cspace);
   ppd = data->ppd;
   doc.Orientation = header.Orientation;
@@ -462,7 +462,7 @@ cfFilterImageToRaster(int inputfd,         /* I - File descriptor input stream *
 
   /*  Find print-rendering-intent */
 
-  getPrintRenderIntent(data, &header);
+  cfGetPrintRenderIntent(data, &header);
   if(log) log(ld, CF_LOGLEVEL_DEBUG,
              "cfFilterImageToRaster: Print rendering intent = %s",
              header.cupsRenderingIntent);
index 477ad451bb57c45e99de2d3757aba773e665b4d8..1e6846471f0cb8dcec2a1c608c3a69a922476a48 100644 (file)
@@ -509,7 +509,7 @@ cfFilterMuPDFToPWG(int inputfd,         /* I - File descriptor input stream */
 
 /*  Find print-rendering-intent */
 
-    getPrintRenderIntent(data, &h);
+    cfGetPrintRenderIntent(data, &h);
     if(log) log(ld, CF_LOGLEVEL_DEBUG,
        "Print rendering intent = %s", h.cupsRenderingIntent);
 
@@ -534,12 +534,12 @@ cfFilterMuPDFToPWG(int inputfd,         /* I - File descriptor input stream */
   cupsArrayAdd(mupdf_args, strdup("-Fpwg"));
 
   /* Note that MuPDF only creates PWG Raster and never CUPS Raster,
-     so we set the PWG Raster flag in the  cupsRasterPrepareHeader() call.
+     so we set the PWG Raster flag in the  cfRasterPrepareHeader() call.
      This function takes care of generating a completely consistent PWG
      Raster header then, no extra manipulation needed.
      From the header h only cupsWidth/cupsHeight (dimensions in pixels),
      resolution, and color space are used here. */
-  cupsRasterPrepareHeader(&h, data, outformat,
+  cfRasterPrepareHeader(&h, data, outformat,
                          CF_FILTER_OUT_FORMAT_PWG_RASTER, 1, &cspace);
 
   if ((h.HWResolution[0] == 100) && (h.HWResolution[1] == 100)) {
index dbddc20c69965f759cd0cb80af9dea22e9c99ade..8498b8cd84dfe2b3c27c14c0c5ac1b5913a68d01 100644 (file)
@@ -101,7 +101,7 @@ parseOpts(cf_filter_data_t *data, cf_filter_out_format_t outformat,
   * CUPS option list
   */
 
-  num_options = joinJobOptionsAndAttrs(data, num_options, &options);
+  num_options = cfJoinJobOptionsAndAttrs(data, num_options, &options);
 
   if (data->ppd)
     ppd = data->ppd;
@@ -132,7 +132,7 @@ parseOpts(cf_filter_data_t *data, cf_filter_out_format_t outformat,
     }
   }
 
-  cupsRasterPrepareHeader(header, data, outformat, outformat, 0, &cspace);
+  cfRasterPrepareHeader(header, data, outformat, outformat, 0, &cspace);
 
   if (ppd)
   {
@@ -210,7 +210,7 @@ parseOpts(cf_filter_data_t *data, cf_filter_out_format_t outformat,
       }
     }
   } else {
-    int backside = getBackSideAndHeaderDuplex(printer_attrs, header);
+    int backside = cfGetBackSideAndHeaderDuplex(printer_attrs, header);
     if(header->Duplex){
       /* analyze options relevant to Duplex */
       /* APDuplexRequiresFlippedMargin */
@@ -218,7 +218,7 @@ parseOpts(cf_filter_data_t *data, cf_filter_out_format_t outformat,
         FM_NO, FM_FALSE, FM_TRUE
       } flippedMargin = FM_NO;
 
-      if (backside==BACKSIDE_MANUAL_TUMBLE && header->Tumble)
+      if (backside==CF_BACKSIDE_MANUAL_TUMBLE && header->Tumble)
       {
         pclmtoraster_data->swap_image_x = pclmtoraster_data->swap_image_y =
          true;
@@ -229,7 +229,7 @@ parseOpts(cf_filter_data_t *data, cf_filter_out_format_t outformat,
           pclmtoraster_data->swap_margin_y = false;
         }
       }
-      else if (backside==BACKSIDE_ROTATED && !header->Tumble)
+      else if (backside==CF_BACKSIDE_ROTATED && !header->Tumble)
       {
         pclmtoraster_data->swap_image_x = pclmtoraster_data->swap_image_y =
          true;
@@ -240,7 +240,7 @@ parseOpts(cf_filter_data_t *data, cf_filter_out_format_t outformat,
           pclmtoraster_data->swap_margin_y = false;
         }
       }
-      else if (backside==BACKSIDE_FLIPPED)
+      else if (backside==CF_BACKSIDE_FLIPPED)
       {
         if (header->Tumble)
        {
@@ -895,7 +895,7 @@ outPage(cups_raster_t*       raster,        /* I - Raster stream */
   }
   else if(filter_data!=NULL &&(filter_data->printer_attrs)!=NULL)
   {
-    ippRasterMatchIPPSize(&(data->header), filter_data, margins, paperdimensions, NULL, NULL);
+    cfRasterMatchIPPSize(&(data->header), filter_data, margins, paperdimensions, NULL, NULL);
     if (data->outformat != CF_FILTER_OUT_FORMAT_CUPS_RASTER)
       memset(margins, 0, sizeof(margins));
   }
index 6b166055dceb0717955591ce7ec8b80a1aedacda..3bbe3eb46c236e92773599f9aa5ec046925cc481 100644 (file)
@@ -901,7 +901,7 @@ void calculate(cf_filter_data_t *data,ProcessingParameters &param,char *final_co
   ppd_file_t *ppd = data->ppd;
   int num_options = 0;
   cups_option_t *options = NULL;
-  num_options = joinJobOptionsAndAttrs(data, num_options, &options);
+  num_options = cfJoinJobOptionsAndAttrs(data, num_options, &options);
   if (param.reverse)
     // Enable evenDuplex or the first page may be empty.
     param.evenDuplex=true; // disabled later, if non-duplex
@@ -1054,7 +1054,7 @@ cfFilterPDFToPDF(int inputfd,         /* I - File descriptor input stream */
   void               *icd = data->iscanceleddata;
   int num_options = 0;
   cups_option_t *options = NULL;
-  num_options = joinJobOptionsAndAttrs(data, num_options, &options);
+  num_options = cfJoinJobOptionsAndAttrs(data, num_options, &options);
 
   if (parameters)
     final_content_type = (char *)parameters;
index bd03ad7ea2558d790bf038c0e3f862a66347db27..0a68339a98a59072df9660f2e86bd4e7e545d199 100644 (file)
@@ -385,7 +385,7 @@ cfFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
   * CUPS option list
   */
 
-  num_options = joinJobOptionsAndAttrs(data, num_options, &options);
+  num_options = cfJoinJobOptionsAndAttrs(data, num_options, &options);
   
 
   ppd = data->ppd;
@@ -840,7 +840,7 @@ cfFilterPDFToPS(int inputfd,         /* I - File descriptor input stream */
                   "cfFilterPDFToPS: No resolution information found in the PPD file.");
   }
   else{
-    cupsRasterParseIPPOptions(&header, data, 0, 1);
+    cfRasterParseIPPOptions(&header, data, 0, 1);
     if (header.HWResolution[0] > 100 && header.HWResolution[1] > 100)
     {
       xres = header.HWResolution[0];
index e333c01cbafe724d2cb02d84505f2f380e05313d..3e89fd157bbc4eef185a4a1f0b01287ba1464ff1 100644 (file)
@@ -341,7 +341,7 @@ static int parseOpts(cf_filter_data_t *data,
   if (outformat == CF_FILTER_OUT_FORMAT_PWG_RASTER)
     doc->pwgraster = 1;
 
-  num_options = joinJobOptionsAndAttrs(data, num_options, &options);
+  num_options = cfJoinJobOptionsAndAttrs(data, num_options, &options);
 
   if (data->ppd)
     doc->ppd = data->ppd;
@@ -355,7 +355,7 @@ static int parseOpts(cf_filter_data_t *data,
     if (log) log(ld, CF_LOGLEVEL_DEBUG,
       "cfFilterPDFToRaster: PPD file is not specified.");
 
-  cupsRasterPrepareHeader(&(doc->header), data, outformat,
+  cfRasterPrepareHeader(&(doc->header), data, outformat,
                          (outformat == CF_FILTER_OUT_FORMAT_PWG_RASTER ?
                           outformat : CF_FILTER_OUT_FORMAT_CUPS_RASTER), 0,
                          &cspace);
@@ -455,7 +455,7 @@ static int parseOpts(cf_filter_data_t *data,
       else
        doc->pwgraster = 0;
     }
-    getPrintRenderIntent(data, &(doc->header));
+    cfGetPrintRenderIntent(data, &(doc->header));
     if(strcasecmp(doc->header.cupsRenderingIntent, "PERCEPTUAL")==0){
        doc->colour_profile.renderingIntent = INTENT_PERCEPTUAL;
     } else if (strcasecmp(doc->header.cupsRenderingIntent,"RELATIVE") == 0) {
@@ -468,7 +468,7 @@ static int parseOpts(cf_filter_data_t *data,
     if(log) log(ld, CF_LOGLEVEL_DEBUG,
        "Print rendering intent = %s", doc->header.cupsRenderingIntent);
     
-    int backside = getBackSideAndHeaderDuplex(printer_attrs, &(doc->header));
+    int backside = cfGetBackSideAndHeaderDuplex(printer_attrs, &(doc->header));
     if (doc->header.Duplex) {
       /* analyze options relevant to Duplex */
       /* APDuplexRequiresFlippedMargin */
@@ -476,19 +476,19 @@ static int parseOpts(cf_filter_data_t *data,
        FM_NO, FM_FALSE, FM_TRUE
       } flippedMargin = FM_NO;
 
-      if (backside == BACKSIDE_MANUAL_TUMBLE && doc->header.Tumble) {
+      if (backside == CF_BACKSIDE_MANUAL_TUMBLE && doc->header.Tumble) {
        doc->swap_image_x = doc->swap_image_y = true;
        doc->swap_margin_x = doc->swap_margin_y = true;
        if (flippedMargin == FM_TRUE) {
          doc->swap_margin_y = false;
        }
-      } else if (backside==BACKSIDE_ROTATED && !doc->header.Tumble) {
+      } else if (backside==CF_BACKSIDE_ROTATED && !doc->header.Tumble) {
        doc->swap_image_x = doc->swap_image_y = true;
        doc->swap_margin_x = doc->swap_margin_y = true;
        if (flippedMargin == FM_TRUE) {
          doc->swap_margin_y = false;
        }
-      } else if (backside==BACKSIDE_FLIPPED) {
+      } else if (backside==CF_BACKSIDE_FLIPPED) {
        if (doc->header.Tumble) {
          doc->swap_image_x = true;
          doc->swap_margin_x = doc->swap_margin_y = true;
@@ -1410,7 +1410,7 @@ static int outPage(pdftoraster_doc_t *doc, int pageNo, cf_filter_data_t *data,
     if (doc->pwgraster == 1)
       memset(margins, 0, sizeof(margins));
   } else if(data!=NULL && (data->printer_attrs)!=NULL) {
-       ippRasterMatchIPPSize(&(doc->header), data, margins, paperdimensions, &imageable_area_fit, NULL);
+       cfRasterMatchIPPSize(&(doc->header), data, margins, paperdimensions, &imageable_area_fit, NULL);
        if(doc->pwgraster==1){
          memset(margins, 0, sizeof(margins));
        }
index 031378c8b0ee39e48c4f43812d52fbde374085e8..1e4dea172d84b6f917dcfc5ec2e03dacdeb38ba7 100644 (file)
@@ -299,7 +299,7 @@ static int parseOpts(cf_filter_data_t *data,
   void *ld = data ->logdata;
   cups_cspace_t         cspace = (cups_cspace_t)(-1);
 
-  num_options = joinJobOptionsAndAttrs(data, num_options, &options);
+  num_options = cfJoinJobOptionsAndAttrs(data, num_options, &options);
   
   if (data->ppd)
     doc->ppd = data->ppd;
@@ -316,7 +316,7 @@ static int parseOpts(cf_filter_data_t *data,
 
   // We can directly create CUPS Raster, PWG Raster, and Apple Raster but
   // for PCLm we have to output CUPS Raster and feed it into cfFilterRasterToPDF()
-  cupsRasterPrepareHeader(&(doc->outheader), data, outformat,
+  cfRasterPrepareHeader(&(doc->outheader), data, outformat,
                          outformat == CF_FILTER_OUT_FORMAT_PCLM ?
                          CF_FILTER_OUT_FORMAT_CUPS_RASTER : outformat, 0, &cspace);
 
index 6232c3f81470af990e5b27e7056dde03547d0d2b..7ad6f20f4272944abc3563be0fd00d9d52ab923a 100644 (file)
@@ -8,7 +8,7 @@
  *
  * Contents:
  *
- *   cupsRasterParseIPPOptions() - Parse IPP options from the command line
+ *   cfRasterParseIPPOptions() - Parse IPP options from the command line
  *                                 and apply them to the CUPS Raster header.
  */
 
@@ -68,11 +68,11 @@ _strlcpy(char       *dst,           /* O - Destination string */
 
 
 /*
- * 'ippRasterMatchIPPSize()' - Match IPP page size to header page size.
+ * 'cfRasterMatchIPPSize()' - Match IPP page size to header page size.
  */
 
 int 
-ippRasterMatchIPPSize(
+cfRasterMatchIPPSize(
     cups_page_header2_t *header,       /* I - Page header to match */
     cf_filter_data_t   *data,          /* I - printer-data file */
     double             margins[4],     /* O - Margins of media in points */
@@ -331,7 +331,7 @@ ippRasterMatchIPPSize(
 }
 
 /*
- *  'getBackSideAndHeaderDuplex()' - 
+ *  'cfGetBackSideAndHeaderDuplex()' - 
  *                             This functions returns the cupsBackSide using 
  *                             printer attributes.
  *                             meaning and reason for backside orientation:-
@@ -370,7 +370,7 @@ ippRasterMatchIPPSize(
  */
 
 int                                                    /* O - Backside obtained using printer attributes */
-getBackSideAndHeaderDuplex(ipp_t *printer_attrs,       /* I - printer attributes using filter data */
+cfGetBackSideAndHeaderDuplex(ipp_t *printer_attrs,     /* I - printer attributes using filter data */
                        cups_page_header2_t *header)    /* O - header */
 {
     ipp_attribute_t *ipp_attr; /* IPP attribute */
@@ -385,19 +385,19 @@ getBackSideAndHeaderDuplex(ipp_t *printer_attrs,  /* I - printer attributes using
                for(i = 0, count = ippGetCount(ipp_attr); i<count;i++){
                    const char *dm = ippGetString(ipp_attr, i, NULL); /* DM value */
                    if(!strcasecmp(dm, "DM1")){
-                       backside = BACKSIDE_NORMAL;
+                       backside = CF_BACKSIDE_NORMAL;
                        break;
                    }
                    if(!strcasecmp(dm, "DM2")){
-                       backside = BACKSIDE_FLIPPED;
+                       backside = CF_BACKSIDE_FLIPPED;
                        break;
                    }
                    if(!strcasecmp(dm, "DM3")){
-                       backside = BACKSIDE_ROTATED;
+                       backside = CF_BACKSIDE_ROTATED;
                        break;
                    }
                    if(!strcasecmp(dm, "DM4")){
-                       backside = BACKSIDE_MANUAL_TUMBLE;
+                       backside = CF_BACKSIDE_MANUAL_TUMBLE;
                        break;
                    }
                }
@@ -407,24 +407,24 @@ getBackSideAndHeaderDuplex(ipp_t *printer_attrs,  /* I - printer attributes using
                const char *keyword;
                keyword = ippGetString(ipp_attr, 0, NULL);
                if (!strcmp(keyword, "flipped"))
-                   backside = BACKSIDE_FLIPPED;
+                   backside = CF_BACKSIDE_FLIPPED;
                else if (!strcmp(keyword, "manual-tumble"))
-                   backside = BACKSIDE_MANUAL_TUMBLE;
+                   backside = CF_BACKSIDE_MANUAL_TUMBLE;
                else if (!strcmp(keyword, "normal"))
-                   backside = BACKSIDE_NORMAL;
+                   backside = CF_BACKSIDE_NORMAL;
                else
-                   backside = BACKSIDE_ROTATED;                
+                   backside = CF_BACKSIDE_ROTATED;             
            }
        }
     }
     
-    if(header && header->Duplex==1 && backside==-1) backside = BACKSIDE_NORMAL;
+    if(header && header->Duplex==1 && backside==-1) backside = CF_BACKSIDE_NORMAL;
     return backside;
     
 }
 
 int 
-getPrintRenderIntent(cf_filter_data_t *data,
+cfGetPrintRenderIntent(cf_filter_data_t *data,
                        cups_page_header2_t *header)
 {
   const char           *val;
@@ -435,7 +435,7 @@ getPrintRenderIntent(cf_filter_data_t *data,
   cf_logfunc_t         log = data->logfunc;
   void                  *ld = data->logdata;
   int                  i;
-  num_options = joinJobOptionsAndAttrs(data, num_options, &options);
+  num_options = cfJoinJobOptionsAndAttrs(data, num_options, &options);
 
   if ((val = cupsGetOption("print-rendering-intent", num_options,
                           options)) != NULL ||
@@ -508,7 +508,7 @@ getPrintRenderIntent(cf_filter_data_t *data,
 }
 
 /*
- * 'cupsRasterPrepareHeader() - This function creates a CUPS/PWG
+ * 'cfRasterPrepareHeader() - This function creates a CUPS/PWG
  *                              Raster header for Raster output based
  *                              on the printer and job properties
  *                              supplied to the calling filter
@@ -531,7 +531,7 @@ getPrintRenderIntent(cf_filter_data_t *data,
 
 int                                             /* O  - 0 on success,
                                                        -1 on error */
-cupsRasterPrepareHeader(cups_page_header2_t *h, /* I  - Raster header */
+cfRasterPrepareHeader(cups_page_header2_t *h, /* I  - Raster header */
                        cf_filter_data_t *data,    /* I  - Job and printer data */
                        cf_filter_out_format_t final_outformat,
                                                 /* I  - Job output format 
@@ -590,7 +590,7 @@ cupsRasterPrepareHeader(cups_page_header2_t *h, /* I  - Raster header */
   printer_attrs = data->printer_attrs;
   job_attrs = data->job_attrs;
 
-  num_options = joinJobOptionsAndAttrs(data, num_options, &options);
+  num_options = cfJoinJobOptionsAndAttrs(data, num_options, &options);
   ppd = data->ppd;
   printer_attrs = data->printer_attrs;
   job_attrs = data->job_attrs;
@@ -734,7 +734,7 @@ cupsRasterPrepareHeader(cups_page_header2_t *h, /* I  - Raster header */
            log(ld, CF_LOGLEVEL_DEBUG,
                "Determining best color space/depth ...");
          }
-         res = cupsRasterSetColorSpace(h, cspaces_available, color_mode,
+         res = cfRasterSetColorSpace(h, cspaces_available, color_mode,
                                        cspace, &hi_depth);
        }
       }
@@ -754,7 +754,7 @@ cupsRasterPrepareHeader(cups_page_header2_t *h, /* I  - Raster header */
        if (log)
          log(ld, CF_LOGLEVEL_DEBUG,
              "For PCLm color mode is always SRGB/SGray 8-bit.");
-       res = cupsRasterSetColorSpace(h, cspaces_available, color_mode,
+       res = cfRasterSetColorSpace(h, cspaces_available, color_mode,
                                      cspace, &hi_depth);
       }
     }
@@ -791,8 +791,8 @@ cupsRasterPrepareHeader(cups_page_header2_t *h, /* I  - Raster header */
          pwgraster = 0;
       }
     }
-    cupsRasterParseIPPOptions(h, data, 1 - cupsrasterheader, 1);
-    if (ippRasterMatchIPPSize(h, data, margins, dimensions, NULL, NULL) < 0) {
+    cfRasterParseIPPOptions(h, data, 1 - cupsrasterheader, 1);
+    if (cfRasterMatchIPPSize(h, data, margins, dimensions, NULL, NULL) < 0) {
       for (i = 0; i < 2; i ++)
        dimensions[i] = h->PageSize[i];
       memset(margins, 0, sizeof(margins));
@@ -829,7 +829,7 @@ cupsRasterPrepareHeader(cups_page_header2_t *h, /* I  - Raster header */
        log(ld, CF_LOGLEVEL_DEBUG,
            "Determining best color space/depth ...");
       }
-      res = cupsRasterSetColorSpace(h, cspaces_available, color_mode,
+      res = cfRasterSetColorSpace(h, cspaces_available, color_mode,
                                    cspace, &hi_depth);
     }
     else if (pclm)
@@ -844,13 +844,13 @@ cupsRasterPrepareHeader(cups_page_header2_t *h, /* I  - Raster header */
       if (log)
        log(ld, CF_LOGLEVEL_DEBUG,
            "For PCLm color mode is always SRGB/SGray 8-bit.");
-      res = cupsRasterSetColorSpace(h, cspaces_available, color_mode,
+      res = cfRasterSetColorSpace(h, cspaces_available, color_mode,
                                    cspace, &hi_depth);
     }
   }
 
   if (res != 1) {
-    /* cupsRasterSetColorSpace() was called */
+    /* cfRasterSetColorSpace() was called */
     if (res < 0) {
       /* failed */
       if (log) {
@@ -950,7 +950,7 @@ cupsRasterPrepareHeader(cups_page_header2_t *h, /* I  - Raster header */
 
 
 /*
- * 'cupsRasterSetColorSpace() - Update a given CUPS/PWG Raster header to
+ * 'cfRasterSetColorSpace() - Update a given CUPS/PWG Raster header to
  *                              the desired color mode, color space, and
  *                              color depth. We supply one of the printer
  *                              IPP attributes urf-supported or
@@ -972,7 +972,7 @@ cupsRasterPrepareHeader(cups_page_header2_t *h, /* I  - Raster header */
 
 int                                             /* O  - 0 on success,
                                                        -1 on error */
-cupsRasterSetColorSpace(cups_page_header2_t *h, /* I  - Raster header */
+cfRasterSetColorSpace(cups_page_header2_t *h, /* I  - Raster header */
                        const char *available,  /* I  - Available color spaces
                                                        IPP attribute
                                                        urf-supported or
@@ -1193,12 +1193,12 @@ cupsRasterSetColorSpace(cups_page_header2_t *h, /* I  - Raster header */
 
 
 /*
- * 'cupsRasterParseIPPOptions()' - Parse IPP options from the command line
+ * 'cfRasterParseIPPOptions()' - Parse IPP options from the command line
  *                                 and apply them to the CUPS Raster header.
  */
 
 int                                          /* O - -1 on error, 0 on success */
-cupsRasterParseIPPOptions(cups_page_header2_t *h, /* I - Raster header */
+cfRasterParseIPPOptions(cups_page_header2_t *h, /* I - Raster header */
                          cf_filter_data_t *data,
                          int pwg_raster,         /* I - 1 if PWG Raster */
                          int set_defaults)       /* I - If 1, set default
@@ -1232,7 +1232,7 @@ cupsRasterParseIPPOptions(cups_page_header2_t *h, /* I - Raster header */
  /*
   * Join the IPP attributes and the CUPS options in a single list
   */
-  num_options = joinJobOptionsAndAttrs(data, num_options, &options);
+  num_options = cfJoinJobOptionsAndAttrs(data, num_options, &options);
 
  /*
   * If we have a PPD file in the filter data, take it into account, by
@@ -2328,7 +2328,7 @@ cupsRasterParseIPPOptions(cups_page_header2_t *h, /* I - Raster header */
 
 
 /*  Function for storing job-attrs in options */
-int joinJobOptionsAndAttrs(cf_filter_data_t* data, int num_options, cups_option_t **options)
+int cfJoinJobOptionsAndAttrs(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 335ced560c9f69d71b2c5edd15fa3a676e05fd58..2122dfaf34c2fe1cb5c13b29268a81723e30dbb1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *   CUPS/PWG Raster utilities header file for CUPS.
+ *   CUPS/PWG Raster utilities header file for cups-filters.
  *
  *   Copyright 2013 by Till Kamppeter.
  *
@@ -38,50 +38,50 @@ extern "C" {
  * Types
  */
 
-typedef enum backside_orient_e
+typedef enum cf_backside_orient_e
 {
-  BACKSIDE_MANUAL_TUMBLE,
-  BACKSIDE_ROTATED,
-  BACKSIDE_FLIPPED,
-  BACKSIDE_NORMAL
-} backside_orient_t;
+  CF_BACKSIDE_MANUAL_TUMBLE,
+  CF_BACKSIDE_ROTATED,
+  CF_BACKSIDE_FLIPPED,
+  CF_BACKSIDE_NORMAL
+} cf_backside_orient_t;
 
 
 /*
  * Prototypes...
  */
 
-extern int              cupsRasterPrepareHeader(cups_page_header2_t *h,
-                                               cf_filter_data_t *data,
-                                               cf_filter_out_format_t
-                                               final_outformat,
-                                               cf_filter_out_format_t
-                                               header_outformat,
-                                               int no_hig_depth,
-                                               cups_cspace_t *cspace);
-extern int              cupsRasterSetColorSpace(cups_page_header2_t *h,
-                                               const char *available,
-                                               const char *color_mode,
-                                               cups_cspace_t *cspace,
-                                               int *high_depth);
-extern int              cupsRasterParseIPPOptions(cups_page_header2_t *h,
-                                                 cf_filter_data_t *data,
-                                                 int pwg_raster,
-                                                 int set_defaults);
-extern int             joinJobOptionsAndAttrs(cf_filter_data_t *data,
-                                              int num_options,
-                                              cups_option_t **options);
-extern int             ippRasterMatchIPPSize(cups_page_header2_t *header,
+extern int              cfRasterPrepareHeader(cups_page_header2_t *h,
                                              cf_filter_data_t *data,
-                                             double margins[4],
-                                             double dimensions[2],
-                                             int *image_fit,
-                                             int *landscape);
-extern int             getBackSideAndHeaderDuplex(ipp_t *printer_attrs,
-                                                 cups_page_header2_t *header);
-
-extern int             getPrintRenderIntent(cf_filter_data_t *data,
-                               cups_page_header2_t *header);
+                                             cf_filter_out_format_t
+                                             final_outformat,
+                                             cf_filter_out_format_t
+                                             header_outformat,
+                                             int no_hig_depth,
+                                             cups_cspace_t *cspace);
+extern int              cfRasterSetColorSpace(cups_page_header2_t *h,
+                                             const char *available,
+                                             const char *color_mode,
+                                             cups_cspace_t *cspace,
+                                             int *high_depth);
+extern int              cfRasterParseIPPOptions(cups_page_header2_t *h,
+                                               cf_filter_data_t *data,
+                                               int pwg_raster,
+                                               int set_defaults);
+extern int             cfJoinJobOptionsAndAttrs(cf_filter_data_t *data,
+                                                int num_options,
+                                                cups_option_t **options);
+extern int             cfRasterMatchIPPSize(cups_page_header2_t *header,
+                                            cf_filter_data_t *data,
+                                            double margins[4],
+                                            double dimensions[2],
+                                            int *image_fit,
+                                            int *landscape);
+extern int             cfGetBackSideAndHeaderDuplex(ipp_t *printer_attrs,
+                                                    cups_page_header2_t
+                                                    *header);
+extern int             cfGetPrintRenderIntent(cf_filter_data_t *data,
+                                              cups_page_header2_t *header);
 
 #  ifdef __cplusplus
 }
@@ -92,4 +92,3 @@ extern int            getPrintRenderIntent(cf_filter_data_t *data,
 /*
  * End
  */
-
index 57e12806bb543efed4a686aa9afb11fd202f8fca..869cfad0184559232a5af97cfd97982195b710d3 100644 (file)
@@ -911,7 +911,7 @@ cfFilterTextToPDF(int inputfd,      /* I - File descriptor input stream */
                         log, ld);
 
   if (!data->ppd) {
-    cupsRasterParseIPPOptions(&(doc.h), data, 0, 1);
+    cfRasterParseIPPOptions(&(doc.h), data, 0, 1);
     doc.Orientation = doc.h.Orientation;
     doc.Duplex = doc.h.Duplex;
     doc.ColorDevice = doc.h.cupsNumColors <= 1 ? 0 : 1;