]> git.ipfire.org Git - thirdparty/cups-filters.git/commitdiff
libppd: Renamed 4 public API functions from "cups..." to "ppd..."
authorTill Kamppeter <till.kamppeter@gmail.com>
Thu, 2 Jul 2020 16:28:34 +0000 (18:28 +0200)
committerTill Kamppeter <till.kamppeter@gmail.com>
Thu, 2 Jul 2020 16:28:34 +0000 (18:28 +0200)
22 files changed:
Makefile.am
filter/bannertopdf.c
filter/common.c
filter/gstoraster.c
filter/imagetoraster.c
filter/mupdftoraster.c
filter/pclmtoraster.cxx
filter/pdftopdf/pdftopdf.cc
filter/pdftops.c
filter/pdftoraster.cxx
filter/rastertoescpx.c
filter/rastertopclx.c
filter/rastertopdf.cpp
filter/rastertops.c
filter/texttotext.c
ppd/ppd-conflicts.c
ppd/ppd-mark.c
ppd/ppd.h
ppd/raster-interpret.c
ppd/raster-interstub.c
ppd/testppd.c
utils/cups-browsed.c

index b23ec66b7e183bce414aaf79291b6180e643929a..8ed615fa374fc80dd72aa95c3f07a3e205139abe 100644 (file)
@@ -167,7 +167,7 @@ EXTRA_DIST += $(pkgcharset_DATA)
 # ==========================
 pkgppdincludedir = $(includedir)/ppd
 pkgppdinclude_DATA = \
-        ppd/ppd.h
+       ppd/ppd.h
 
 lib_LTLIBRARIES = libppd.la
 
@@ -196,7 +196,6 @@ libppd_la_SOURCES = \
        ppd/language.c \
        ppd/language-private.h \
        ppd/raster-interpret.c \
-       ppd/raster-interstub.c \
        ppd/raster-error.c \
        ppd/raster-private.h \
        ppd/string.c \
@@ -514,11 +513,11 @@ endif
 # =================
 pkgfontembedincludedir = $(includedir)/fontembed
 pkgfontembedinclude_DATA = \
-        fontembed/bitset.h \
-        fontembed/embed.h \
-        fontembed/fontfile.h \
-        fontembed/iofn.h \
-        fontembed/sfnt.h
+       fontembed/bitset.h \
+       fontembed/embed.h \
+       fontembed/fontfile.h \
+       fontembed/iofn.h \
+       fontembed/sfnt.h
 
 lib_LTLIBRARIES += libfontembed.la
 
@@ -795,11 +794,13 @@ gstoraster_SOURCES = \
 gstoraster_CFLAGS = \
        $(CUPS_CFLAGS) \
        $(LIBQPDF_CFLAGS) \
-       -I$(srcdir)/cupsfilters/
+       -I$(srcdir)/cupsfilters/ \
+       -I$(srcdir)/ppd/
 gstoraster_LDADD = \
        $(CUPS_LIBS) \
        $(LIBQPDF_LIBS) \
-       libcupsfilters.la
+       libcupsfilters.la \
+       libppd.la
 
 imagetopdf_SOURCES = \
        cupsfilters/image.h \
@@ -867,31 +868,37 @@ rastertopdf_CXXFLAGS = \
        $(CUPS_CFLAGS) \
        $(LCMS_CFLAGS) \
        $(LIBQPDF_CFLAGS) \
-       -I$(srcdir)/cupsfilters/
+       -I$(srcdir)/cupsfilters/ \
+       -I$(srcdir)/ppd/
 rastertopdf_LDADD = \
        $(CUPS_LIBS) \
        $(LCMS_LIBS) \
        $(LIBQPDF_LIBS) \
-       libcupsfilters.la
+       libcupsfilters.la \
+       libppd.la
 
 mupdftoraster_SOURCES = \
-        filter/mupdftoraster.c
+       filter/mupdftoraster.c
 mupdftoraster_CFLAGS = \
-        $(CUPS_CFLAGS) \
-        -I$(srcdir)/cupsfilters/
+       $(CUPS_CFLAGS) \
+       -I$(srcdir)/cupsfilters/ \
+       -I$(srcdir)/ppd/
 mupdftoraster_LDADD = \
-        $(CUPS_LIBS) \
-        libcupsfilters.la
+       $(CUPS_LIBS) \
+       libcupsfilters.la \
+       libppd.la
 
 rastertops_SOURCES = \
        filter/rastertops.c
 rastertops_CFLAGS = \
        $(CUPS_CFLAGS) \
-       -I$(srcdir)/cupsfilters/
+       -I$(srcdir)/cupsfilters/ \
+       -I$(srcdir)/ppd/
 rastertops_LDADD = \
        $(CUPS_LIBS) \
        -lz \
-       libcupsfilters.la
+       libcupsfilters.la \
+       libppd.la
 
 sys5ippprinter_SOURCES = \
        filter/common.c \
@@ -966,10 +973,12 @@ rastertoescpx_SOURCES = \
        filter/rastertoescpx.c
 rastertoescpx_CFLAGS = \
        $(CUPS_CFLAGS) \
-       -I$(srcdir)/cupsfilters/
+       -I$(srcdir)/cupsfilters/ \
+       -I$(srcdir)/ppd/
 rastertoescpx_LDADD = \
        $(CUPS_LIBS) \
-       libcupsfilters.la
+       libcupsfilters.la \
+       libppd.la
 
 rastertopclx_SOURCES = \
        cupsfilters/driver.h \
@@ -980,11 +989,13 @@ rastertopclx_SOURCES = \
 rastertopclx_CFLAGS = \
        $(CUPS_CFLAGS) \
        $(LIBPNG_CFLAGS) \
-       -I$(srcdir)/cupsfilters/
+       -I$(srcdir)/cupsfilters/ \
+       -I$(srcdir)/ppd/
 rastertopclx_LDADD = \
        $(CUPS_LIBS) \
        $(LIBPNG_LIBS) \
-       libcupsfilters.la
+       libcupsfilters.la \
+       libppd.la
 
 test_pdf1_SOURCES = \
        filter/pdfutils.c \
index 470fbe363d7a26e15b645274a358e78e2a1d874b..109a80512c87e1b1d0794a2ed859a215a3b7410b 100644 (file)
@@ -551,7 +551,7 @@ int main(int argc, char *argv[])
     noptions = cupsParseOptions(argv[5], 0, &options);
     if (ppd) {
       ppdMarkDefaults(ppd);
-      cupsMarkOptions(ppd, noptions, options);
+      ppdMarkOptions(ppd, noptions, options);
     }
 
     banner = banner_new_from_file(argc == 7 ? argv[6] : "-", &noptions, &options);
index 87b953f0c7ea9901b0c83e6d80fda5c1cb03b1ac..d7ef72ecf8469c79def7d9bae537dd7656916f8f 100644 (file)
@@ -67,7 +67,7 @@ SetCommonOptions(
   ppd = ppdOpenFile(getenv("PPD"));
 
   ppdMarkDefaults(ppd);
-  cupsMarkOptions(ppd, num_options, options);
+  ppdMarkOptions(ppd, num_options, options);
 
   if ((pagesize = ppdPageSize(ppd, NULL)) != NULL)
   {
index e053c5742a54b4a29ae9633b6f7b0e695771aed8..7f03d9acc0ef6f443512be518c4e103a3a44badd 100644 (file)
@@ -654,7 +654,7 @@ main (int argc, char **argv, char *envp[])
       
   if (ppd) {
     ppdMarkDefaults (ppd);
-    cupsMarkOptions (ppd, num_options, options);
+    ppdMarkOptions (ppd, num_options, options);
   }
 
   if (argc == 6) {
@@ -864,7 +864,7 @@ main (int argc, char **argv, char *envp[])
     
   if (ppd)
   {
-    cupsRasterInterpretPPD(&h,ppd,num_options,options,0);
+    ppdRasterInterpretPPD(&h,ppd,num_options,options,0);
 #ifdef HAVE_CUPS_1_7
     if (outformat == OUTPUT_FORMAT_RASTER)
     {
index f5aef765163b61eb03c5c34f8b841f90ba05052f..1d2b86128c88adc6a8b7096877a1fff2c544b425 100644 (file)
@@ -390,7 +390,7 @@ main(int  argc,                             /* I - Number of command-line arguments */
   * Set the needed options in the page header...
   */
 
-  if (cupsRasterInterpretPPD(&header, ppd, num_options, options, raster_cb))
+  if (ppdRasterInterpretPPD(&header, ppd, num_options, options, raster_cb))
   {
     fputs("ERROR: The page setup information was not valid.\n", stderr);
     fprintf(stderr, "DEBUG: %s\n", cupsRasterErrorString());
index 09c66c00d7dce6d5d1c8de3bc21af6faf51e0c40..d2e8873629b169a8e4815df28a6c0aaa91a22f09 100644 (file)
@@ -276,7 +276,7 @@ main (int argc, char **argv, char *envp[])
 
   if (ppd) {
     ppdMarkDefaults (ppd);
-    cupsMarkOptions (ppd, num_options, options);
+    ppdMarkOptions (ppd, num_options, options);
   }
 
   if (argc == 6) {
@@ -355,10 +355,10 @@ main (int argc, char **argv, char *envp[])
      calls.
      Make also sure that the width and height of the page in pixels is
      the size of the full page (as PWG Raster and MuPDF require it) and not
-     only the printable area (as cupsRasterInterpretPPD() sets, to fulfill
+     only the printable area (as ppdRasterInterpretPPD() sets, to fulfill
      CUPS Raster standard) */
   if (ppd) {
-    cupsRasterInterpretPPD(&h, ppd, num_options, options, 0);
+    ppdRasterInterpretPPD(&h, ppd, num_options, options, 0);
     h.cupsWidth = h.HWResolution[0] * h.PageSize[0] / 72;
     h.cupsHeight = h.HWResolution[1] * h.PageSize[1] / 72;
 #ifdef HAVE_CUPS_1_7
index fc23aefdc2b337c94faf6139d0033e2e23506a5e..dd02ae7013fd9371e6317830bf52285cff70b7c5 100644 (file)
@@ -149,9 +149,9 @@ static void parseOpts(int argc, char **argv)
   num_options = cupsParseOptions(argv[5],0,&options);
   if (ppd) {
     ppdMarkDefaults(ppd);
-    cupsMarkOptions(ppd,num_options,options);
+    ppdMarkOptions(ppd,num_options,options);
 //     handleRqeuiresPageRegion();
-    cupsRasterInterpretPPD(&header,ppd,num_options,options,0);
+    ppdRasterInterpretPPD(&header,ppd,num_options,options,0);
     if (header.Duplex) {
       /* analyze options relevant to Duplex */
       const char *backside = "";
index 249071dfceb3608760205be24073f3f16f3b6bbe..ad59b6d6190c7616b9d48f50ac17518ca0f1a056 100644 (file)
@@ -1104,7 +1104,7 @@ int main(int argc,char **argv)
     ppd=ppdOpenFile(getenv("PPD")); // getenv (and thus ppd) may be null. This will not cause problems.
     ppdMarkDefaults(ppd);
 
-    cupsMarkOptions(ppd,num_options,options);
+    ppdMarkOptions(ppd,num_options,options);
 
     getParameters(ppd,num_options,options,param);
     calculate(ppd,param);
index 2bee1dd7f6733729f5b2f564cebf548fa5d2d70e..2dd2b5aa9867be92a87361c3b85eeffe7ddcdb02 100644 (file)
@@ -443,7 +443,7 @@ main(int  argc,                             /* I - Number of command-line args */
   if (ppd)
   {
     ppdMarkDefaults(ppd);
-    cupsMarkOptions(ppd, num_options, options);
+    ppdMarkOptions(ppd, num_options, options);
   }
 
   if ((val = cupsGetOption("make-and-model", num_options, options)) != NULL)
@@ -803,9 +803,9 @@ main(int  argc,                             /* I - Number of command-line args */
 
   if (ppd)
   {
-    /* Ignore error exits of cupsRasterInterpretPPD(), if it found a resolution
+    /* Ignore error exits of ppdRasterInterpretPPD(), if it found a resolution
        setting before erroring it is OK for us */
-    cupsRasterInterpretPPD(&header, ppd, num_options, options, NULL);
+    ppdRasterInterpretPPD(&header, ppd, num_options, options, NULL);
     /* 100 dpi is default, this means that if we have 100 dpi here this
        method failed to find the printing resolution */
     if (header.HWResolution[0] > 100 && header.HWResolution[1] > 100)
index 058c2efb754749c69a64d006417678537d8a741e..9878e853185f6f990756d87be33d1cc988eed3fc 100644 (file)
@@ -359,9 +359,9 @@ static void parseOpts(int argc, char **argv)
   options = NULL;
   num_options = cupsParseOptions(argv[5],0,&options);
   if (ppd) {
-    cupsMarkOptions(ppd,num_options,options);
+    ppdMarkOptions(ppd,num_options,options);
     handleRqeuiresPageRegion();
-    cupsRasterInterpretPPD(&header,ppd,num_options,options,0);
+    ppdRasterInterpretPPD(&header,ppd,num_options,options,0);
     attr = ppdFindAttr(ppd,"pdftorasterRenderingIntent",NULL);
     if (attr != NULL && attr->value != NULL) {
       if (strcasecmp(attr->value,"PERCEPTUAL") != 0) {
index 7da25a51c20530f54ac027f5db3a8112e4b34cef..cbc50e9a2a00d81c89a3d69bcc303505706f40f3 100644 (file)
@@ -1800,7 +1800,7 @@ main(int  argc,                           /* I - Number of command-line arguments */
   }
 
   ppdMarkDefaults(ppd);
-  cupsMarkOptions(ppd, num_options, options);
+  ppdMarkOptions(ppd, num_options, options);
 
  /*
   * Open the page stream...
index 3e7c129daef203d9f826325136f940bc59e6b5cc..99390867bd9ce204f26fff6243916df1a803b593 100644 (file)
@@ -1836,7 +1836,7 @@ main(int  argc,                           /* I - Number of command-line arguments */
   if (ppd)
   {
     ppdMarkDefaults(ppd);
-    cupsMarkOptions(ppd, num_options, options);
+    ppdMarkOptions(ppd, num_options, options);
   }
   else
   {
index e5c719ceae0c2817032029a2e68bab4c272c641f..9ee3323fd74371a5094f2f8b96698c4ed747f0c6 100644 (file)
@@ -1363,7 +1363,7 @@ int main(int argc, char **argv)
     if (ppd)
     {
       ppdMarkDefaults(ppd);
-      cupsMarkOptions(ppd, num_options, options);
+      ppdMarkOptions(ppd, num_options, options);
     }
     else
     {
index 791ba7b4dc23f87e8a98e91a3c2171027f434d49..cef529c1d983464cb0de052085869e206189df21 100644 (file)
@@ -400,7 +400,7 @@ main(int  argc,        /* I - Number of command-line arguments */
   if (ppd)
   {
     ppdMarkDefaults(ppd);
-    cupsMarkOptions(ppd, num_options, options);
+    ppdMarkOptions(ppd, num_options, options);
   }
   else
   {
index de99df2b4e6911986d30cde349d29e9d18fe5071..eca4154ec5c709636b8e697875bb99fd921fdda8 100644 (file)
@@ -261,7 +261,7 @@ main(int  argc,                             /* I - Number of command-line args */
   if (ppd)
   {
     ppdMarkDefaults(ppd);
-    cupsMarkOptions(ppd, num_options, options);
+    ppdMarkOptions(ppd, num_options, options);
   }
 
  /*
index ee0e9e8b6fc2ae33a6e8c33b451ec2e0695e7305..29c0737a61a342baf69c104fc32fd6cf2031452a 100644 (file)
@@ -47,7 +47,7 @@ static cups_array_t   *ppd_test_constraints(ppd_file_t *ppd,
 
 
 /*
- * 'cupsGetConflicts()' - Get a list of conflicting options in a marked PPD.
+ * 'ppdGetConflicts()' - Get a list of conflicting options in a marked PPD.
  *
  * This function gets a list of options that would conflict if "option" and
  * "choice" were marked in the PPD.  You would typically call this function
@@ -62,7 +62,7 @@ static cups_array_t   *ppd_test_constraints(ppd_file_t *ppd,
  */
 
 int                                    /* O - Number of conflicting options */
-cupsGetConflicts(
+ppdGetConflicts(
     ppd_file_t    *ppd,                        /* I - PPD file */
     const char    *option,             /* I - Option to test */
     const char    *choice,             /* I - Choice to test */
@@ -124,7 +124,7 @@ cupsGetConflicts(
 
 
 /*
- * 'cupsResolveConflicts()' - Resolve conflicts in a marked PPD.
+ * 'ppdResolveConflicts()' - Resolve conflicts in a marked PPD.
  *
  * This function attempts to resolve any conflicts in a marked PPD, returning
  * a list of option changes that are required to resolve them.  On input,
@@ -139,14 +139,14 @@ cupsGetConflicts(
  * If option conflicts cannot be resolved, "num_options" and "options" are not
  * changed and 0 is returned.
  *
- * When resolving conflicts, @code cupsResolveConflicts@ does not consider
+ * When resolving conflicts, @code ppdResolveConflicts@ does not consider
  * changes to the current page size (@code media@, @code PageSize@, and
  * @code PageRegion@) or to the most recent option specified in "option".
  * Thus, if the only way to resolve a conflict is to change the page size
- * or the option the user most recently changed, @code cupsResolveConflicts@
+ * or the option the user most recently changed, @code ppdResolveConflicts@
  * will return 0 to indicate it was unable to resolve the conflicts.
  *
- * The @code cupsResolveConflicts@ function uses one of two sources of option
+ * The @code ppdResolveConflicts@ function uses one of two sources of option
  * constraint information.  The preferred constraint information is defined by
  * @code cupsUIConstraints@ and @code cupsUIResolver@ attributes - in this
  * case, the PPD file provides constraint resolution actions.
@@ -161,7 +161,7 @@ cupsGetConflicts(
  */
 
 int                                    /* O  - 1 on success, 0 on failure */
-cupsResolveConflicts(
+ppdResolveConflicts(
     ppd_file_t    *ppd,                        /* I  - PPD file */
     const char    *option,             /* I  - Newly selected option or @code NULL@ for none */
     const char    *choice,             /* I  - Newly selected choice or @code NULL@ for none */
@@ -249,7 +249,7 @@ cupsResolveConflicts(
          * Resolver loop!
          */
 
-         DEBUG_printf(("1cupsResolveConflicts: Resolver loop with %s!",
+         DEBUG_printf(("1ppdResolveConflicts: Resolver loop with %s!",
                        consts->resolver));
           goto error;
        }
@@ -257,14 +257,14 @@ cupsResolveConflicts(
         if ((resolver = ppdFindAttr(ppd, "cupsUIResolver",
                                    consts->resolver)) == NULL)
         {
-         DEBUG_printf(("1cupsResolveConflicts: Resolver %s not found!",
+         DEBUG_printf(("1ppdResolveConflicts: Resolver %s not found!",
                        consts->resolver));
          goto error;
        }
 
         if (!resolver->value)
        {
-         DEBUG_printf(("1cupsResolveConflicts: Resolver %s has no value!",
+         DEBUG_printf(("1ppdResolveConflicts: Resolver %s has no value!",
                        consts->resolver));
          goto error;
        }
@@ -486,7 +486,7 @@ cupsResolveConflicts(
 
     if (!changed)
     {
-      DEBUG_puts("1cupsResolveConflicts: Unable to automatically resolve "
+      DEBUG_puts("1ppdResolveConflicts: Unable to automatically resolve "
                 "constraint!");
       goto error;
     }
@@ -528,10 +528,10 @@ cupsResolveConflicts(
 
   cupsArrayRestore(ppd->sorted_attrs);
 
-  DEBUG_printf(("1cupsResolveConflicts: Returning %d options:", num_newopts));
+  DEBUG_printf(("1ppdResolveConflicts: Returning %d options:", num_newopts));
 #ifdef DEBUG
   for (i = 0; i < num_newopts; i ++)
-    DEBUG_printf(("1cupsResolveConflicts: options[%d]: %s=%s", i,
+    DEBUG_printf(("1ppdResolveConflicts: options[%d]: %s=%s", i,
                   newopts[i].name, newopts[i].value));
 #endif /* DEBUG */
 
@@ -551,7 +551,7 @@ cupsResolveConflicts(
 
   cupsArrayRestore(ppd->sorted_attrs);
 
-  DEBUG_puts("1cupsResolveConflicts: Unable to resolve conflicts!");
+  DEBUG_puts("1ppdResolveConflicts: Unable to resolve conflicts!");
 
   return (0);
 }
index d9905f47b49db1d692741739cbcf9d714ebfd911..c33075b83db0bb8874b9509ba9ce7ad40337dda6 100644 (file)
@@ -35,7 +35,7 @@ static void   ppd_mark_option(ppd_file_t *ppd, const char *option,
 
 
 /*
- * 'cupsMarkOptions()' - Mark command-line options in a PPD file.
+ * 'ppdMarkOptions()' - Mark command-line options in a PPD file.
  *
  * This function maps the IPP "finishings", "media", "mirror",
  * "multiple-document-handling", "output-bin", "print-color-mode",
@@ -44,7 +44,7 @@ static void   ppd_mark_option(ppd_file_t *ppd, const char *option,
  */
 
 int                                    /* O - 1 if conflicts exist, 0 otherwise */
-cupsMarkOptions(
+ppdMarkOptions(
     ppd_file_t    *ppd,                        /* I - PPD file */
     int           num_options,         /* I - Number of options */
     cups_option_t *options)            /* I - Options */
@@ -700,12 +700,12 @@ ppd_debug_marked(ppd_file_t *ppd,         /* I - PPD file data */
   ppd_choice_t *c;                     /* Current choice */
 
 
-  DEBUG_printf(("2cupsMarkOptions: %s", title));
+  DEBUG_printf(("2ppdMarkOptions: %s", title));
 
   for (c = (ppd_choice_t *)cupsArrayFirst(ppd->marked);
        c;
        c = (ppd_choice_t *)cupsArrayNext(ppd->marked))
-    DEBUG_printf(("2cupsMarkOptions: %s=%s", c->option->keyword, c->choice));
+    DEBUG_printf(("2ppdMarkOptions: %s=%s", c->option->keyword, c->choice));
 }
 #endif /* DEBUG */
 
index 91c3dee345dc85c30ddae50ced135ac619599505..8b84cdb033ead6ca184dbf579cca8606fa34bb7f 100644 (file)
--- a/ppd/ppd.h
+++ b/ppd/ppd.h
@@ -466,7 +466,11 @@ typedef struct ppd_file_s          /**** PPD File ****/
  * Prototypes...
  */
 
-extern int             cupsMarkOptions(ppd_file_t *ppd, int num_options, cups_option_t *options);
+/* cupsMarkOptions replaced by ppdMarkOptions in libppd */
+/* extern int          cupsMarkOptions(ppd_file_t *ppd, int num_options,
+                                        cups_option_t *options); */
+/* Definition for backward compatibility, will be removed soon */
+#define cupsMarkOptions cupsMarkOptions_USE_ppdMarkOptions_INSTEAD
 
 extern void            ppdClose(ppd_file_t *ppd);
 extern int             ppdCollect(ppd_file_t *ppd, ppd_section_t section,
@@ -506,11 +510,15 @@ extern ppd_status_t       ppdLastError(int *line);
 extern void            ppdSetConformance(ppd_conform_t c);
 
 /**** New in CUPS 1.2 ****/
-extern int             cupsRasterInterpretPPD(cups_page_header2_t *h,
+/* cupsRasterInterpretPPD replaced by ppdRasterInterpretPPD in libppd */
+/* extern int          cupsRasterInterpretPPD(cups_page_header2_t *h,
                                               ppd_file_t *ppd,
                                               int num_options,
                                               cups_option_t *options,
-                                              cups_interpret_cb_t func);
+                                              cups_interpret_cb_t func); */
+/* Definition for backward compatibility, will be removed soon */
+#define cupsRasterInterpretPPD cupsRasterInterpretPPD_USE_ppdRasterInterpretPPD_INSTEAD
+
 extern int             ppdCollect2(ppd_file_t *ppd, ppd_section_t section,
                                    float min_order, ppd_choice_t  ***choices);
 extern int             ppdEmitAfterOrder(ppd_file_t *ppd, FILE *fp,
@@ -538,14 +546,22 @@ extern const char *ppdLocalizeIPPReason(ppd_file_t *ppd,
                                              size_t bufsize);
 
 /**** New in CUPS 1.4/macOS 10.6 ****/
-extern int             cupsGetConflicts(ppd_file_t *ppd, const char *option,
+/* cupsGetConflicts replaced by ppdGetConflicts in libppd */
+/* extern int          cupsGetConflicts(ppd_file_t *ppd, const char *option,
                                         const char *choice,
-                                        cups_option_t **options);
-extern int             cupsResolveConflicts(ppd_file_t *ppd,
+                                        cups_option_t **options); */
+/* Definition for backward compatibility, will be removed soon */
+#define cupsGetConflicts cupsGetConflicts_USE_ppdGetConflicts_INSTEAD
+
+/* cupsResolveConflicts replaced by ppdResolveConflicts in libppd */
+/* extern int          cupsResolveConflicts(ppd_file_t *ppd,
                                             const char *option,
                                             const char *choice,
                                             int *num_options,
-                                            cups_option_t **options);
+                                            cups_option_t **options); */
+/* Definition for backward compatibility, will be removed soon */
+#define cupsResolveConflicts cupsResolveConflicts_USE_ppdResolveConflicts_INSTEAD
+
 extern int             ppdInstallableConflict(ppd_file_t *ppd,
                                               const char *option,
                                               const char *choice);
@@ -559,7 +575,23 @@ extern int         ppdPageSizeLimits(ppd_file_t *ppd,
 
 /**** New in libppd (cups-filters) ****/
 
-/**** New in cups-filters 1.0.28 ****/
+/**** New in cups-filters 1.0.28: Renamed functions from original CUPS API ****/
+extern int             ppdMarkOptions(ppd_file_t *ppd, int num_options, cups_option_t *options);
+extern int             ppdRasterInterpretPPD(cups_page_header2_t *h,
+                                              ppd_file_t *ppd,
+                                              int num_options,
+                                              cups_option_t *options,
+                                              cups_interpret_cb_t func);
+extern int             ppdGetConflicts(ppd_file_t *ppd, const char *option,
+                                        const char *choice,
+                                        cups_option_t **options);
+extern int             ppdResolveConflicts(ppd_file_t *ppd,
+                                            const char *option,
+                                            const char *choice,
+                                            int *num_options,
+                                            cups_option_t **options);
+
+/**** New in cups-filters 1.0.28: Formerly CUPS-private functions ****/
 extern int             ppdConvertOptions(ipp_t *request, ppd_file_t *ppd, ppd_cache_t *pc, ipp_attribute_t *media_col_sup, ipp_attribute_t *doc_handling_sup, ipp_attribute_t *print_color_mode_sup, const char *user, const char *format, int copies, int num_options, cups_option_t *options);
 extern int             ppdRasterExecPS(cups_page_header2_t *h, int *preferred_bits, const char *code);
 extern int             ppdRasterInterpretPPD(cups_page_header2_t *h, ppd_file_t *ppd, int num_options, cups_option_t *options, cups_interpret_cb_t func);
index e929fcc08ad3b5c5fd0188d4df7fd9dbe576c327..88d2b4e502f93f04b0d3412735e863ff37dfd364 100644 (file)
@@ -100,9 +100,9 @@ static void         ppd_DEBUG_stack(const char *prefix, _ppd_ps_stack_t *st);
  * raster data.
  *
  *
- * @code cupsRasterInterpretPPD@ does not mark the options in the PPD using
+ * @code ppdRasterInterpretPPD@ does not mark the options in the PPD using
  * the "num_options" and "options" arguments.  Instead, mark the options with
- * @code cupsMarkOptions@ and @code ppdMarkOption@ prior to calling it -
+ * @code ppdMarkOptions@ and @code ppdMarkOption@ prior to calling it -
  * this allows for per-page options without manipulating the options array.
  *
  * The "func" argument specifies an optional callback function that is
@@ -112,7 +112,7 @@ static void         ppd_DEBUG_stack(const char *prefix, _ppd_ps_stack_t *st);
  * requested attributes cannot be supported.
  *
  *
- * @code cupsRasterInterpretPPD@ supports a subset of the PostScript language.
+ * @code ppdRasterInterpretPPD@ supports a subset of the PostScript language.
  * Currently only the @code [@, @code ]@, @code <<@, @code >>@, @code {@,
  * @code }@, @code cleartomark@, @code copy@, @code dup@, @code index@,
  * @code pop@, @code roll@, @code setpagedevice@, and @code stopped@ operators
index 804411df54eac43e31d366791df27c74e1ed9897..64318bdec8369c389fac4b69785a030069dba4d1 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * cupsRasterInterpretPPD stub for libppd.
+ * ppdRasterInterpretPPD stub for libppd.
  *
  * Copyright © 2018 by Apple Inc.
  *
@@ -22,7 +22,7 @@
 
 
 /*
- * 'cupsRasterInterpretPPD()' - Interpret PPD commands to create a page header.
+ * 'ppdRasterInterpretPPD()' - Interpret PPD commands to create a page header.
  *
  * This function is used by raster image processing (RIP) filters like
  * cgpdftoraster and imagetoraster when writing CUPS raster data for a page.
@@ -30,9 +30,9 @@
  * raster data.
  *
  *
- * @code cupsRasterInterpretPPD@ does not mark the options in the PPD using
+ * @code ppdRasterInterpretPPD@ does not mark the options in the PPD using
  * the "num_options" and "options" arguments.  Instead, mark the options with
- * @code cupsMarkOptions@ and @code ppdMarkOption@ prior to calling it -
+ * @code ppdMarkOptions@ and @code ppdMarkOption@ prior to calling it -
  * this allows for per-page options without manipulating the options array.
  *
  * The "func" argument specifies an optional callback function that is
@@ -42,7 +42,7 @@
  * requested attributes cannot be supported.
  *
  *
- * @code cupsRasterInterpretPPD@ supports a subset of the PostScript language.
+ * @code ppdRasterInterpretPPD@ supports a subset of the PostScript language.
  * Currently only the @code [@, @code ]@, @code <<@, @code >>@, @code {@,
  * @code }@, @code cleartomark@, @code copy@, @code dup@, @code index@,
  * @code pop@, @code roll@, @code setpagedevice@, and @code stopped@ operators
@@ -52,7 +52,7 @@
  */
 
 int                                    /* O - 0 on success, -1 on failure */
-cupsRasterInterpretPPD(
+ppdRasterInterpretPPD(
     cups_page_header2_t *h,            /* O - Page header to create */
     ppd_file_t          *ppd,          /* I - PPD file */
     int                 num_options,   /* I - Number of options */
index 21fa70abf2b4d957c5a5278329882c311138b8eb..2f586303490292dccfe5fd759e4d3cbfde9f0bc9 100644 (file)
@@ -539,10 +539,10 @@ main(int  argc,                           /* I - Number of command-line arguments */
     * Test constraints...
     */
 
-    fputs("cupsGetConflicts(InputSlot=Envelope): ", stdout);
+    fputs("ppdGetConflicts(InputSlot=Envelope): ", stdout);
     ppdMarkOption(ppd, "PageSize", "Letter");
 
-    num_options = cupsGetConflicts(ppd, "InputSlot", "Envelope", &options);
+    num_options = ppdGetConflicts(ppd, "InputSlot", "Envelope", &options);
     if (num_options != 2 ||
         (val = cupsGetOption("PageRegion", num_options, options)) == NULL ||
        _ppd_strcasecmp(val, "Letter") ||
@@ -569,10 +569,10 @@ main(int  argc,                           /* I - Number of command-line arguments */
       status ++;
     }
 
-    fputs("cupsResolveConflicts(InputSlot=Envelope): ", stdout);
+    fputs("ppdResolveConflicts(InputSlot=Envelope): ", stdout);
     num_options = 0;
     options     = NULL;
-    if (!cupsResolveConflicts(ppd, "InputSlot", "Envelope", &num_options,
+    if (!ppdResolveConflicts(ppd, "InputSlot", "Envelope", &num_options,
                              &options))
     {
       puts("FAIL (Unable to resolve)");
@@ -592,10 +592,10 @@ main(int  argc,                           /* I - Number of command-line arguments */
 
     cupsFreeOptions(num_options, options);
 
-    fputs("cupsResolveConflicts(No option/choice): ", stdout);
+    fputs("ppdResolveConflicts(No option/choice): ", stdout);
     num_options = 0;
     options     = NULL;
-    if (cupsResolveConflicts(ppd, NULL, NULL, &num_options, &options) &&
+    if (ppdResolveConflicts(ppd, NULL, NULL, &num_options, &options) &&
         num_options == 1 && !_ppd_strcasecmp(options[0].name, "InputSlot") &&
        !_ppd_strcasecmp(options[0].value, "Tray"))
       puts("PASS (Resolved by changing InputSlot)");
@@ -654,12 +654,12 @@ main(int  argc,                           /* I - Number of command-line arguments */
     }
 
    /*
-    * cupsMarkOptions with PWG and IPP size names.
+    * ppdMarkOptions with PWG and IPP size names.
     */
 
-    fputs("cupsMarkOptions(media=iso-a4): ", stdout);
+    fputs("ppdMarkOptions(media=iso-a4): ", stdout);
     num_options = cupsAddOption("media", "iso-a4", 0, &options);
-    cupsMarkOptions(ppd, num_options, options);
+    ppdMarkOptions(ppd, num_options, options);
     cupsFreeOptions(num_options, options);
 
     size = ppdPageSize(ppd, NULL);
@@ -671,9 +671,9 @@ main(int  argc,                             /* I - Number of command-line arguments */
     else
       puts("PASS");
 
-    fputs("cupsMarkOptions(media=na_letter_8.5x11in): ", stdout);
+    fputs("ppdMarkOptions(media=na_letter_8.5x11in): ", stdout);
     num_options = cupsAddOption("media", "na_letter_8.5x11in", 0, &options);
-    cupsMarkOptions(ppd, num_options, options);
+    ppdMarkOptions(ppd, num_options, options);
     cupsFreeOptions(num_options, options);
 
     size = ppdPageSize(ppd, NULL);
@@ -685,10 +685,10 @@ main(int  argc,                           /* I - Number of command-line arguments */
     else
       puts("PASS");
 
-    fputs("cupsMarkOptions(media=oe_letter-fullbleed_8.5x11in): ", stdout);
+    fputs("ppdMarkOptions(media=oe_letter-fullbleed_8.5x11in): ", stdout);
     num_options = cupsAddOption("media", "oe_letter-fullbleed_8.5x11in", 0,
                                 &options);
-    cupsMarkOptions(ppd, num_options, options);
+    ppdMarkOptions(ppd, num_options, options);
     cupsFreeOptions(num_options, options);
 
     size = ppdPageSize(ppd, NULL);
@@ -700,9 +700,9 @@ main(int  argc,                             /* I - Number of command-line arguments */
     else
       puts("PASS");
 
-    fputs("cupsMarkOptions(media=A4): ", stdout);
+    fputs("ppdMarkOptions(media=A4): ", stdout);
     num_options = cupsAddOption("media", "A4", 0, &options);
-    cupsMarkOptions(ppd, num_options, options);
+    ppdMarkOptions(ppd, num_options, options);
     cupsFreeOptions(num_options, options);
 
     size = ppdPageSize(ppd, NULL);
@@ -718,9 +718,9 @@ main(int  argc,                             /* I - Number of command-line arguments */
     * Custom sizes...
     */
 
-    fputs("cupsMarkOptions(media=Custom.8x10in): ", stdout);
+    fputs("ppdMarkOptions(media=Custom.8x10in): ", stdout);
     num_options = cupsAddOption("media", "Custom.8x10in", 0, &options);
-    cupsMarkOptions(ppd, num_options, options);
+    ppdMarkOptions(ppd, num_options, options);
     cupsFreeOptions(num_options, options);
 
     size = ppdPageSize(ppd, NULL);
@@ -935,10 +935,10 @@ main(int  argc,                           /* I - Number of command-line arguments */
       status ++;
     }
 
-    fputs("cupsResolveConflicts(Quality=Photo): ", stdout);
+    fputs("ppdResolveConflicts(Quality=Photo): ", stdout);
     num_options = 0;
     options     = NULL;
-    if (cupsResolveConflicts(ppd, "Quality", "Photo", &num_options,
+    if (ppdResolveConflicts(ppd, "Quality", "Photo", &num_options,
                              &options))
     {
       printf("FAIL (%d options:", num_options);
@@ -951,10 +951,10 @@ main(int  argc,                           /* I - Number of command-line arguments */
       puts("PASS (Unable to resolve)");
     cupsFreeOptions(num_options, options);
 
-    fputs("cupsResolveConflicts(No option/choice): ", stdout);
+    fputs("ppdResolveConflicts(No option/choice): ", stdout);
     num_options = 0;
     options     = NULL;
-    if (cupsResolveConflicts(ppd, NULL, NULL, &num_options, &options) &&
+    if (ppdResolveConflicts(ppd, NULL, NULL, &num_options, &options) &&
         num_options == 1 && !_ppd_strcasecmp(options->name, "Quality") &&
        !_ppd_strcasecmp(options->value, "Normal"))
       puts("PASS");
@@ -973,13 +973,13 @@ main(int  argc,                           /* I - Number of command-line arguments */
     }
     cupsFreeOptions(num_options, options);
 
-    fputs("cupsResolveConflicts(loop test): ", stdout);
+    fputs("ppdResolveConflicts(loop test): ", stdout);
     ppdMarkOption(ppd, "PageSize", "A4");
     ppdMarkOption(ppd, "InputSlot", "Tray");
     ppdMarkOption(ppd, "Quality", "Photo");
     num_options = 0;
     options     = NULL;
-    if (!cupsResolveConflicts(ppd, NULL, NULL, &num_options, &options))
+    if (!ppdResolveConflicts(ppd, NULL, NULL, &num_options, &options))
       puts("PASS");
     else if (num_options > 0)
     {
@@ -1445,9 +1445,9 @@ do_ppd_tests(const char    *filename,     /* I - PPD file */
   }
 
   ppdMarkDefaults(ppd);
-  cupsMarkOptions(ppd, num_options, options);
+  ppdMarkOptions(ppd, num_options, options);
 
-  if (cupsRasterInterpretPPD(&header, ppd, 0, NULL, NULL))
+  if (ppdRasterInterpretPPD(&header, ppd, 0, NULL, NULL))
   {
     puts("FAIL (error from function)");
     puts(_ppdRasterErrorString());
index dc73bbb6dba81e79f7e0e08396950436fe870628..0e3a0bb0c051be3e6e7371e7072f314277ca3734 100644 (file)
@@ -8416,7 +8416,7 @@ gboolean update_cups_queues(gpointer unused) {
          break;
        }
        ppdMarkDefaults(ppd);
-       cupsMarkOptions(ppd, p->num_options, p->options);
+       ppdMarkOptions(ppd, p->num_options, p->options);
        if ((out = cupsTempFile2(buf, sizeof(buf))) == NULL) {
          debug_printf("Unable to create temporary file!\n");
           current_time = time(NULL);