]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - ppdc/ppdc-source.cxx
Merge branch 'master' of https://github.com/apple/cups
[thirdparty/cups.git] / ppdc / ppdc-source.cxx
index 3fa7c2e2b2ea2a722c85705c3c683e6c68ea4f9a..c25d49668e4a883a94ee26fc2cfdf3e70e0ee979 100644 (file)
@@ -1,59 +1,11 @@
 //
-// "$Id$"
-//
-//   Source class for the CUPS PPD Compiler.
-//
-//   Copyright 2007-2010 by Apple Inc.
-//   Copyright 2002-2007 by Easy Software Products.
-//
-//   These coded instructions, statements, and computer programs are the
-//   property of Apple Inc. and are protected by Federal copyright
-//   law.  Distribution and use rights are outlined in the file "LICENSE.txt"
-//   which should have been included with this file.  If this file is
-//   file is missing or damaged, see the license at "http://www.cups.org/".
-//
-// Contents:
-//
-//   ppdcSource::ppdcSource()         - Load a driver source file.
-//   ppdcSource::~ppdcSource()        - Free a driver source file.
-//   ppdcSource::add_include()        - Add an include directory.
-//   ppdcSource::find_driver()        - Find a driver.
-//   ppdcSource::find_include()       - Find an include file.
-//   ppdcSource::find_po()            - Find a message catalog for the given
-//                                      locale...
-//   ppdcSource::find_size()          - Find a media size.
-//   ppdcSource::find_variable()      - Find a variable.
-//   ppdcSource::get_attr()           - Get an attribute.
-//   ppdcSource::get_boolean()        - Get a boolean value.
-//   ppdcSource::get_choice()         - Get a choice.
-//   ppdcSource::get_color_model()    - Get an old-style color model option.
-//   ppdcSource::get_color_order()    - Get an old-style color order value.
-//   ppdcSource::get_color_profile()  - Get a color profile definition.
-//   ppdcSource::get_color_space()    - Get an old-style colorspace value.
-//   ppdcSource::get_constraint()     - Get a constraint.
-//   ppdcSource::get_custom_size()    - Get a custom media size definition from
-//                                      a file.
-//   ppdcSource::get_duplex()         - Get a duplex option.
-//   ppdcSource::get_filter()         - Get a filter.
-//   ppdcSource::get_float()          - Get a single floating-point number.
-//   ppdcSource::get_font()           - Get a font definition.
-//   ppdcSource::get_generic()        - Get a generic old-style option.
-//   ppdcSource::get_group()          - Get an option group.
-//   ppdcSource::get_installable()    - Get an installable option.
-//   ppdcSource::get_integer()        - Get an integer value from a file.
-//   ppdcSource::get_measurement()    - Get a measurement value.
-//   ppdcSource::get_option()         - Get an option definition.
-//   ppdcSource::get_po()             - Get a message catalog.
-//   ppdcSource::get_resolution()     - Get an old-style resolution option.
-//   ppdcSource::get_simple_profile() - Get a simple color profile definition.
-//   ppdcSource::get_size()           - Get a media size definition from a file.
-//   ppdcSource::get_token()          - Get a token from a file.
-//   ppdcSource::get_variable()       - Get a variable definition.
-//   ppdcSource::quotef()             - Write a formatted, quoted string...
-//   ppdcSource::read_file()          - Read a driver source file.
-//   ppdcSource::scan_file()          - Scan a driver source file.
-//   ppdcSource::set_variable()       - Set a variable.
-//   ppdcSource::write_file()         - Write the current source data to a file.
+// Source class for the CUPS PPD Compiler.
+//
+// Copyright 2007-2018 by Apple Inc.
+// Copyright 2002-2007 by Easy Software Products.
+//
+// Licensed under Apache License v2.0.  See the file "LICENSE" for more
+// information.
 //
 
 //
 #include <unistd.h>
 #include <cups/raster.h>
 #include "data/epson.h"
-#include "data/escp.h"
 #include "data/hp.h"
 #include "data/label.h"
-#include "data/pcl.h"
-#ifndef WIN32
+#ifndef _WIN32
 #  include <sys/utsname.h>
-#endif // !WIN32
+#endif // !_WIN32
 
 
 //
@@ -120,7 +70,7 @@ ppdcSource::ppdcSource(const char  *f,       // I - File to read
   vars->add(new ppdcVariable("CUPS_VERSION_MINOR", MAKE_STRING(CUPS_VERSION_MINOR)));
   vars->add(new ppdcVariable("CUPS_VERSION_PATCH", MAKE_STRING(CUPS_VERSION_PATCH)));
 
-#ifdef WIN32
+#ifdef _WIN32
   vars->add(new ppdcVariable("PLATFORM_NAME", "Windows"));
   vars->add(new ppdcVariable("PLATFORM_ARCH", "X86"));
 
@@ -137,7 +87,7 @@ ppdcSource::ppdcSource(const char  *f,       // I - File to read
     vars->add(new ppdcVariable("PLATFORM_NAME", "unknown"));
     vars->add(new ppdcVariable("PLATFORM_ARCH", "unknown"));
   }
-#endif // WIN32
+#endif // _WIN32
 
   if (f)
     read_file(f, ffp);
@@ -189,7 +139,7 @@ ppdcSource::find_driver(const char *f)      // I - Driver file name
 
 
   for (d = (ppdcDriver *)drivers->first(); d; d = (ppdcDriver *)drivers->next())
-    if (!strcasecmp(f, d->pc_file_name->value))
+    if (!_cups_strcasecmp(f, d->pc_file_name->value))
       return (d);
 
   return (NULL);
@@ -237,9 +187,9 @@ ppdcSource::find_include(
   {
     // Check for the local file relative to the current directory...
     if (base && *base && f[0] != '/')
-      snprintf(n, nlen, "%s/%s", base, f);
+      snprintf(n, (size_t)nlen, "%s/%s", base, f);
     else
-      strlcpy(n, f, nlen);
+      strlcpy(n, f, (size_t)nlen);
 
     if (!access(n, 0))
       return (n);
@@ -255,7 +205,7 @@ ppdcSource::find_include(
   {
     for (dir = (ppdcString *)includes->first(); dir; dir = (ppdcString *)includes->next())
     {
-      snprintf(n, nlen, "%s/%s", dir->value, f);
+      snprintf(n, (size_t)nlen, "%s/%s", dir->value, f);
       if (!access(n, 0))
         return (n);
     }
@@ -264,11 +214,11 @@ ppdcSource::find_include(
   // Search the standard include directories...
   _cups_globals_t *cg = _cupsGlobals();        // Global data
 
-  snprintf(n, nlen, "%s/ppdc/%s", cg->cups_datadir, f);
+  snprintf(n, (size_t)nlen, "%s/ppdc/%s", cg->cups_datadir, f);
   if (!access(n, 0))
     return (n);
 
-  snprintf(n, nlen, "%s/po/%s", cg->cups_datadir, f);
+  snprintf(n, (size_t)nlen, "%s/po/%s", cg->cups_datadir, f);
   if (!access(n, 0))
     return (n);
   else
@@ -277,7 +227,7 @@ ppdcSource::find_include(
 
 
 //
-// 'ppdcSource::find_po()' - Find a message catalog for the given locale...
+// 'ppdcSource::find_po()' - Find a message catalog for the given locale.
 //
 
 ppdcCatalog *                          // O - Message catalog or NULL
@@ -289,7 +239,7 @@ ppdcSource::find_po(const char *l)  // I - Locale name
   for (cat = (ppdcCatalog *)po_files->first();
        cat;
        cat = (ppdcCatalog *)po_files->next())
-    if (!strcasecmp(l, cat->locale->value))
+    if (!_cups_strcasecmp(l, cat->locale->value))
       return (cat);
 
   return (NULL);
@@ -307,7 +257,7 @@ ppdcSource::find_size(const char *s)        // I - Size name
 
 
   for (m = (ppdcMediaSize *)sizes->first(); m; m = (ppdcMediaSize *)sizes->next())
-    if (!strcasecmp(s, m->name->value))
+    if (!_cups_strcasecmp(s, m->name->value))
       return (m);
 
   return (NULL);
@@ -325,7 +275,7 @@ ppdcSource::find_variable(const char *n)// I - Variable name
 
 
   for (v = (ppdcVariable *)vars->first(); v; v = (ppdcVariable *)vars->next())
-    if (!strcasecmp(n, v->name->value))
+    if (!_cups_strcasecmp(n, v->name->value))
       return (v);
 
   return (NULL);
@@ -398,13 +348,13 @@ ppdcSource::get_boolean(ppdcFile *fp)     // I - File to read
     return (-1);
   }
 
-  if (!strcasecmp(buffer, "on") ||
-      !strcasecmp(buffer, "yes") ||
-      !strcasecmp(buffer, "true"))
+  if (!_cups_strcasecmp(buffer, "on") ||
+      !_cups_strcasecmp(buffer, "yes") ||
+      !_cups_strcasecmp(buffer, "true"))
     return (1);
-  else if (!strcasecmp(buffer, "off") ||
-          !strcasecmp(buffer, "no") ||
-          !strcasecmp(buffer, "false"))
+  else if (!_cups_strcasecmp(buffer, "off") ||
+          !_cups_strcasecmp(buffer, "no") ||
+          !_cups_strcasecmp(buffer, "false"))
     return (0);
   else
   {
@@ -537,12 +487,12 @@ int                                       // O - Color order value
 ppdcSource::get_color_order(
     const char *co)                    // I - Color order string
 {
-  if (!strcasecmp(co, "chunked") ||
-      !strcasecmp(co, "chunky"))
+  if (!_cups_strcasecmp(co, "chunked") ||
+      !_cups_strcasecmp(co, "chunky"))
     return (CUPS_ORDER_CHUNKED);
-  else if (!strcasecmp(co, "banded"))
+  else if (!_cups_strcasecmp(co, "banded"))
     return (CUPS_ORDER_BANDED);
-  else if (!strcasecmp(co, "planar"))
+  else if (!_cups_strcasecmp(co, "planar"))
     return (CUPS_ORDER_PLANAR);
   else
     return (-1);
@@ -599,71 +549,71 @@ int                                       // O - Colorspace value
 ppdcSource::get_color_space(
     const char *cs)                    // I - Colorspace string
 {
-  if (!strcasecmp(cs, "w"))
+  if (!_cups_strcasecmp(cs, "w"))
     return (CUPS_CSPACE_W);
-  else if (!strcasecmp(cs, "rgb"))
+  else if (!_cups_strcasecmp(cs, "rgb"))
     return (CUPS_CSPACE_RGB);
-  else if (!strcasecmp(cs, "rgba"))
+  else if (!_cups_strcasecmp(cs, "rgba"))
     return (CUPS_CSPACE_RGBA);
-  else if (!strcasecmp(cs, "k"))
+  else if (!_cups_strcasecmp(cs, "k"))
     return (CUPS_CSPACE_K);
-  else if (!strcasecmp(cs, "cmy"))
+  else if (!_cups_strcasecmp(cs, "cmy"))
     return (CUPS_CSPACE_CMY);
-  else if (!strcasecmp(cs, "ymc"))
+  else if (!_cups_strcasecmp(cs, "ymc"))
     return (CUPS_CSPACE_YMC);
-  else if (!strcasecmp(cs, "cmyk"))
+  else if (!_cups_strcasecmp(cs, "cmyk"))
     return (CUPS_CSPACE_CMYK);
-  else if (!strcasecmp(cs, "ymck"))
+  else if (!_cups_strcasecmp(cs, "ymck"))
     return (CUPS_CSPACE_YMCK);
-  else if (!strcasecmp(cs, "kcmy"))
+  else if (!_cups_strcasecmp(cs, "kcmy"))
     return (CUPS_CSPACE_KCMY);
-  else if (!strcasecmp(cs, "kcmycm"))
+  else if (!_cups_strcasecmp(cs, "kcmycm"))
     return (CUPS_CSPACE_KCMYcm);
-  else if (!strcasecmp(cs, "gmck"))
+  else if (!_cups_strcasecmp(cs, "gmck"))
     return (CUPS_CSPACE_GMCK);
-  else if (!strcasecmp(cs, "gmcs"))
+  else if (!_cups_strcasecmp(cs, "gmcs"))
     return (CUPS_CSPACE_GMCS);
-  else if (!strcasecmp(cs, "white"))
+  else if (!_cups_strcasecmp(cs, "white"))
     return (CUPS_CSPACE_WHITE);
-  else if (!strcasecmp(cs, "gold"))
+  else if (!_cups_strcasecmp(cs, "gold"))
     return (CUPS_CSPACE_GOLD);
-  else if (!strcasecmp(cs, "silver"))
+  else if (!_cups_strcasecmp(cs, "silver"))
     return (CUPS_CSPACE_SILVER);
-  else if (!strcasecmp(cs, "CIEXYZ"))
+  else if (!_cups_strcasecmp(cs, "CIEXYZ"))
     return (CUPS_CSPACE_CIEXYZ);
-  else if (!strcasecmp(cs, "CIELab"))
+  else if (!_cups_strcasecmp(cs, "CIELab"))
     return (CUPS_CSPACE_CIELab);
-  else if (!strcasecmp(cs, "RGBW"))
+  else if (!_cups_strcasecmp(cs, "RGBW"))
     return (CUPS_CSPACE_RGBW);
-  else if (!strcasecmp(cs, "ICC1"))
+  else if (!_cups_strcasecmp(cs, "ICC1"))
     return (CUPS_CSPACE_ICC1);
-  else if (!strcasecmp(cs, "ICC2"))
+  else if (!_cups_strcasecmp(cs, "ICC2"))
     return (CUPS_CSPACE_ICC2);
-  else if (!strcasecmp(cs, "ICC3"))
+  else if (!_cups_strcasecmp(cs, "ICC3"))
     return (CUPS_CSPACE_ICC3);
-  else if (!strcasecmp(cs, "ICC4"))
+  else if (!_cups_strcasecmp(cs, "ICC4"))
     return (CUPS_CSPACE_ICC4);
-  else if (!strcasecmp(cs, "ICC5"))
+  else if (!_cups_strcasecmp(cs, "ICC5"))
     return (CUPS_CSPACE_ICC5);
-  else if (!strcasecmp(cs, "ICC6"))
+  else if (!_cups_strcasecmp(cs, "ICC6"))
     return (CUPS_CSPACE_ICC6);
-  else if (!strcasecmp(cs, "ICC7"))
+  else if (!_cups_strcasecmp(cs, "ICC7"))
     return (CUPS_CSPACE_ICC7);
-  else if (!strcasecmp(cs, "ICC8"))
+  else if (!_cups_strcasecmp(cs, "ICC8"))
     return (CUPS_CSPACE_ICC8);
-  else if (!strcasecmp(cs, "ICC9"))
+  else if (!_cups_strcasecmp(cs, "ICC9"))
     return (CUPS_CSPACE_ICC9);
-  else if (!strcasecmp(cs, "ICCA"))
+  else if (!_cups_strcasecmp(cs, "ICCA"))
     return (CUPS_CSPACE_ICCA);
-  else if (!strcasecmp(cs, "ICCB"))
+  else if (!_cups_strcasecmp(cs, "ICCB"))
     return (CUPS_CSPACE_ICCB);
-  else if (!strcasecmp(cs, "ICCC"))
+  else if (!_cups_strcasecmp(cs, "ICCC"))
     return (CUPS_CSPACE_ICCC);
-  else if (!strcasecmp(cs, "ICCD"))
+  else if (!_cups_strcasecmp(cs, "ICCD"))
     return (CUPS_CSPACE_ICCD);
-  else if (!strcasecmp(cs, "ICCE"))
+  else if (!_cups_strcasecmp(cs, "ICCE"))
     return (CUPS_CSPACE_ICCE);
-  else if (!strcasecmp(cs, "ICCF"))
+  else if (!_cups_strcasecmp(cs, "ICCF"))
     return (CUPS_CSPACE_ICCF);
   else
     return (-1);
@@ -833,8 +783,8 @@ ppdcSource::get_duplex(ppdcFile   *fp,      // I - File to read from
   if (cond_state)
     return;
 
-  if (!strcasecmp(temp, "none") || !strcasecmp(temp, "false") ||
-      !strcasecmp(temp, "no") || !strcasecmp(temp, "off"))
+  if (!_cups_strcasecmp(temp, "none") || !_cups_strcasecmp(temp, "false") ||
+      !_cups_strcasecmp(temp, "no") || !_cups_strcasecmp(temp, "off"))
   {
     g = d->find_group("General");
     if ((o = g->find_option("Duplex")) != NULL)
@@ -849,10 +799,10 @@ ppdcSource::get_duplex(ppdcFile   *fp,    // I - File to read from
        break;
       }
   }
-  else if (!strcasecmp(temp, "normal") || !strcasecmp(temp, "true") ||
-          !strcasecmp(temp, "yes") || !strcasecmp(temp, "on") ||
-          !strcasecmp(temp, "flip") || !strcasecmp(temp, "rotated") ||
-          !strcasecmp(temp, "manualtumble"))
+  else if (!_cups_strcasecmp(temp, "normal") || !_cups_strcasecmp(temp, "true") ||
+          !_cups_strcasecmp(temp, "yes") || !_cups_strcasecmp(temp, "on") ||
+          !_cups_strcasecmp(temp, "flip") || !_cups_strcasecmp(temp, "rotated") ||
+          !_cups_strcasecmp(temp, "manualtumble"))
   {
     g = d->find_group("General");
     o = g->find_option("Duplex");
@@ -860,7 +810,7 @@ ppdcSource::get_duplex(ppdcFile   *fp,      // I - File to read from
     if (!o)
     {
       o = new ppdcOption(PPDC_PICKONE, "Duplex", "2-Sided Printing",
-                        !strcasecmp(temp, "flip") ? PPDC_SECTION_PAGE :
+                        !_cups_strcasecmp(temp, "flip") ? PPDC_SECTION_PAGE :
                                                     PPDC_SECTION_ANY, 10.0f);
       o->add_choice(new ppdcChoice("None", "Off (1-Sided)",
                                   "<</Duplex false>>setpagedevice"));
@@ -877,12 +827,12 @@ ppdcSource::get_duplex(ppdcFile   *fp,    // I - File to read from
         attr = (ppdcAttr *)d->attrs->next())
       if (!strcmp(attr->name->value, "cupsFlipDuplex"))
       {
-        if (strcasecmp(temp, "flip"))
+        if (_cups_strcasecmp(temp, "flip"))
           d->attrs->remove(attr);
        break;
       }
 
-    if (!strcasecmp(temp, "flip") && !attr)
+    if (!_cups_strcasecmp(temp, "flip") && !attr)
       d->add_attr(new ppdcAttr("cupsFlipDuplex", NULL, NULL, "true"));
 
     for (attr = (ppdcAttr *)d->attrs->first();
@@ -894,11 +844,11 @@ ppdcSource::get_duplex(ppdcFile   *fp,    // I - File to read from
        break;
       }
 
-    if (!strcasecmp(temp, "flip"))
+    if (!_cups_strcasecmp(temp, "flip"))
       d->add_attr(new ppdcAttr("cupsBackSide", NULL, NULL, "Flipped"));
-    else if (!strcasecmp(temp, "rotated"))
+    else if (!_cups_strcasecmp(temp, "rotated"))
       d->add_attr(new ppdcAttr("cupsBackSide", NULL, NULL, "Rotated"));
-    else if (!strcasecmp(temp, "manualtumble"))
+    else if (!_cups_strcasecmp(temp, "manualtumble"))
       d->add_attr(new ppdcAttr("cupsBackSide", NULL, NULL, "ManualTumble"));
     else
       d->add_attr(new ppdcAttr("cupsBackSide", NULL, NULL, "Normal"));
@@ -945,7 +895,7 @@ ppdcSource::get_filter(ppdcFile *fp)        // I - File to read
     while (isspace(*ptr))
       ptr ++;
 
-    strcpy(program, ptr);
+    strlcpy(program, ptr, sizeof(program));
   }
   else
   {
@@ -1105,9 +1055,9 @@ ppdcSource::get_font(ppdcFile *fp)        // I - File to read
       return (0);
     }
 
-    if (!strcasecmp(temp, "ROM"))
+    if (!_cups_strcasecmp(temp, "ROM"))
       status = PPDC_FONT_ROM;
-    else if (!strcasecmp(temp, "Disk"))
+    else if (!_cups_strcasecmp(temp, "Disk"))
       status = PPDC_FONT_DISK;
     else
     {
@@ -1340,7 +1290,8 @@ ppdcSource::get_integer(const char *v)    // I - Value string
         // NAME logicop value
        for (newv = (char *)v + 1;
             *newv && (isalnum(*newv & 255) || *newv == '_');
-            newv ++);
+            newv ++)
+         /* do nothing */;
 
         ch    = *newv;
        *newv = '\0';
@@ -1530,17 +1481,17 @@ ppdcSource::get_measurement(ppdcFile *fp)
   val = (float)strtod(buffer, &ptr);
 
   // Check for a trailing unit specifier...
-  if (!strcasecmp(ptr, "mm"))
+  if (!_cups_strcasecmp(ptr, "mm"))
     val *= 72.0f / 25.4f;
-  else if (!strcasecmp(ptr, "cm"))
+  else if (!_cups_strcasecmp(ptr, "cm"))
     val *= 72.0f / 2.54f;
-  else if (!strcasecmp(ptr, "m"))
+  else if (!_cups_strcasecmp(ptr, "m"))
     val *= 72.0f / 0.0254f;
-  else if (!strcasecmp(ptr, "in"))
+  else if (!_cups_strcasecmp(ptr, "in"))
     val *= 72.0f;
-  else if (!strcasecmp(ptr, "ft"))
+  else if (!_cups_strcasecmp(ptr, "ft"))
     val *= 72.0f * 12.0f;
-  else if (strcasecmp(ptr, "pt") && *ptr)
+  else if (_cups_strcasecmp(ptr, "pt") && *ptr)
     return (-1.0f);
 
   return (val);
@@ -1589,11 +1540,11 @@ ppdcSource::get_option(ppdcFile   *fp,  // I - File to read
     return (NULL);
   }
 
-  if (!strcasecmp(type, "boolean"))
+  if (!_cups_strcasecmp(type, "boolean"))
     ot = PPDC_BOOLEAN;
-  else if (!strcasecmp(type, "pickone"))
+  else if (!_cups_strcasecmp(type, "pickone"))
     ot = PPDC_PICKONE;
-  else if (!strcasecmp(type, "pickmany"))
+  else if (!_cups_strcasecmp(type, "pickmany"))
     ot = PPDC_PICKMANY;
   else
   {
@@ -1611,17 +1562,17 @@ ppdcSource::get_option(ppdcFile   *fp,  // I - File to read
     return (NULL);
   }
 
-  if (!strcasecmp(type, "AnySetup"))
+  if (!_cups_strcasecmp(type, "AnySetup"))
     section = PPDC_SECTION_ANY;
-  else if (!strcasecmp(type, "DocumentSetup"))
+  else if (!_cups_strcasecmp(type, "DocumentSetup"))
     section = PPDC_SECTION_DOCUMENT;
-  else if (!strcasecmp(type, "ExitServer"))
+  else if (!_cups_strcasecmp(type, "ExitServer"))
     section = PPDC_SECTION_EXIT;
-  else if (!strcasecmp(type, "JCLSetup"))
+  else if (!_cups_strcasecmp(type, "JCLSetup"))
     section = PPDC_SECTION_JCL;
-  else if (!strcasecmp(type, "PageSetup"))
+  else if (!_cups_strcasecmp(type, "PageSetup"))
     section = PPDC_SECTION_PAGE;
-  else if (!strcasecmp(type, "Prolog"))
+  else if (!_cups_strcasecmp(type, "Prolog"))
     section = PPDC_SECTION_PROLOG;
   else
   {
@@ -1707,7 +1658,7 @@ ppdcSource::get_po(ppdcFile *fp)  // I - File to read
   if ((baseptr = strrchr(basedir, '/')) != NULL)
     *baseptr = '\0';
   else
-    strcpy(basedir, ".");
+    strlcpy(basedir, ".", sizeof(basedir));
 
   // Find the po file...
   pofilename[0] = '\0';
@@ -1811,26 +1762,26 @@ ppdcSource::get_resolution(ppdcFile *fp)// I - File to read
 
   if (color_order >= 0)
   {
-    snprintf(commptr, sizeof(command) - (commptr - command),
+    snprintf(commptr, sizeof(command) - (size_t)(commptr - command),
              "/cupsColorOrder %d", color_order);
     commptr += strlen(commptr);
   }
 
   if (color_space >= 0)
   {
-    snprintf(commptr, sizeof(command) - (commptr - command),
+    snprintf(commptr, sizeof(command) - (size_t)(commptr - command),
              "/cupsColorSpace %d", color_space);
     commptr += strlen(commptr);
   }
 
   if (compression >= 0)
   {
-    snprintf(commptr, sizeof(command) - (commptr - command),
+    snprintf(commptr, sizeof(command) - (size_t)(commptr - command),
              "/cupsCompression %d", compression);
     commptr += strlen(commptr);
   }
 
-  snprintf(commptr, sizeof(command) - (commptr - command), ">>setpagedevice");
+  snprintf(commptr, sizeof(command) - (size_t)(commptr - command), ">>setpagedevice");
 
   // Return the new choice...
   return (new ppdcChoice(name, text, command));
@@ -2015,7 +1966,7 @@ ppdcSource::get_token(ppdcFile *fp,       // I - File to read
         if (!isalnum(ch) && ch != '_')
          break;
        else if (nameptr < (name + sizeof(name) - 1))
-         *nameptr++ = fp->get();
+         *nameptr++ = (char)fp->get();
       }
 
       if (nameptr == name)
@@ -2025,7 +1976,7 @@ ppdcSource::get_token(ppdcFile *fp,       // I - File to read
        {
          // $$ = $
          if (bufptr < bufend)
-           *bufptr++ = fp->get();
+           *bufptr++ = (char)fp->get();
        }
        else
        {
@@ -2045,7 +1996,7 @@ ppdcSource::get_token(ppdcFile *fp,       // I - File to read
        var = find_variable(name);
        if (var)
        {
-         strlcpy(bufptr, var->value->value, bufend - bufptr + 1);
+         strlcpy(bufptr, var->value->value, (size_t)(bufend - bufptr + 1));
          bufptr += strlen(bufptr);
        }
        else
@@ -2055,7 +2006,7 @@ ppdcSource::get_token(ppdcFile *fp,       // I - File to read
                            _("ppdc: Undefined variable (%s) on line %d of "
                              "%s."), name, fp->line, fp->filename);
 
-         snprintf(bufptr, bufend - bufptr + 1, "$%s", name);
+         snprintf(bufptr, (size_t)(bufend - bufptr + 1), "$%s", name);
          bufptr += strlen(bufptr);
        }
       }
@@ -2097,7 +2048,7 @@ ppdcSource::get_token(ppdcFile *fp,       // I - File to read
         empty = 0;
 
        if (bufptr < bufend)
-         *bufptr++ = ch;
+         *bufptr++ = (char)ch;
       }
     }
     else if (ch == '\'' || ch == '\"')
@@ -2113,7 +2064,7 @@ ppdcSource::get_token(ppdcFile *fp,       // I - File to read
       {
         // Insert the opposing quote char...
        if (bufptr < bufend)
-          *bufptr++ = ch;
+          *bufptr++ = (char)ch;
       }
       else
       {
@@ -2129,14 +2080,14 @@ ppdcSource::get_token(ppdcFile *fp,     // I - File to read
       startline = fp->line;
 
       if (bufptr < bufend)
-       *bufptr++ = ch;
+       *bufptr++ = (char)ch;
     }
     else if ((ch == ')' && quote == '(') || (ch == '>' && quote == '<'))
     {
       quote = 0;
 
       if (bufptr < bufend)
-       *bufptr++ = ch;
+       *bufptr++ = (char)ch;
     }
     else if (ch == '\\')
     {
@@ -2146,13 +2097,13 @@ ppdcSource::get_token(ppdcFile *fp,     // I - File to read
         break;
 
       if (bufptr < bufend)
-        *bufptr++ = ch;
+        *bufptr++ = (char)ch;
     }
     else if (bufptr < bufend)
     {
       empty = 0;
 
-      *bufptr++ = ch;
+      *bufptr++ = (char)ch;
 
       if ((ch == '{' || ch == '}') && !quote)
         break;
@@ -2172,7 +2123,6 @@ ppdcSource::get_token(ppdcFile *fp,       // I - File to read
   else
   {
     *bufptr = '\0';
-//    puts(buffer);
     return (buffer);
   }
 }
@@ -2275,6 +2225,8 @@ ppdcSource::quotef(cups_file_t *fp,       // I - File to write to
       }
       else if (*format == 'h' || *format == 'l' || *format == 'L')
         size = *format++;
+      else
+        size = '\0';
 
       if (!*format)
         break;
@@ -2291,7 +2243,7 @@ ppdcSource::quotef(cups_file_t *fp,       // I - File to write to
            if ((format - bufformat + 1) > (int)sizeof(tformat))
              break;
 
-           strncpy(tformat, bufformat, format - bufformat);
+           memcpy(tformat, bufformat, (size_t)(format - bufformat));
            tformat[format - bufformat] = '\0';
 
            bytes += cupsFilePrintf(fp, tformat, va_arg(ap, double));
@@ -2308,17 +2260,25 @@ ppdcSource::quotef(cups_file_t *fp,     // I - File to write to
            if ((format - bufformat + 1) > (int)sizeof(tformat))
              break;
 
-           strncpy(tformat, bufformat, format - bufformat);
+           memcpy(tformat, bufformat, (size_t)(format - bufformat));
            tformat[format - bufformat] = '\0';
 
-           bytes += cupsFilePrintf(fp, tformat, va_arg(ap, int));
+#  ifdef HAVE_LONG_LONG
+            if (size == 'L')
+             bytes += cupsFilePrintf(fp, tformat, va_arg(ap, long long));
+           else
+#  endif /* HAVE_LONG_LONG */
+            if (size == 'l')
+             bytes += cupsFilePrintf(fp, tformat, va_arg(ap, long));
+           else
+             bytes += cupsFilePrintf(fp, tformat, va_arg(ap, int));
            break;
-           
+
        case 'p' : // Pointer value
            if ((format - bufformat + 1) > (int)sizeof(tformat))
              break;
 
-           strncpy(tformat, bufformat, format - bufformat);
+           memcpy(tformat, bufformat, (size_t)(format - bufformat));
            tformat[format - bufformat] = '\0';
 
            bytes += cupsFilePrintf(fp, tformat, va_arg(ap, void *));
@@ -2332,7 +2292,7 @@ ppdcSource::quotef(cups_file_t *fp,       // I - File to write to
            }
            else
            {
-             cupsFileWrite(fp, va_arg(ap, char *), width);
+             cupsFileWrite(fp, va_arg(ap, char *), (size_t)width);
              bytes += width;
            }
            break;
@@ -2341,7 +2301,7 @@ ppdcSource::quotef(cups_file_t *fp,       // I - File to write to
            if ((s = va_arg(ap, char *)) == NULL)
              s = (char *)"(nil)";
 
-           slen = strlen(s);
+           slen = (int)strlen(s);
            if (slen > width && prec != width)
              width = slen;
 
@@ -2468,17 +2428,17 @@ ppdcSource::scan_file(ppdcFile   *fp,   // I - File to read
       isdefault = 0;
     }
 
-    if (!strcasecmp(temp, "}"))
+    if (!_cups_strcasecmp(temp, "}"))
     {
       // Close this one out...
       break;
     }
-    else if (!strcasecmp(temp, "{"))
+    else if (!_cups_strcasecmp(temp, "{"))
     {
       // Open a new child...
       scan_file(fp, d);
     }
-    else if (!strcasecmp(temp, "#if"))
+    else if (!_cups_strcasecmp(temp, "#if"))
     {
       if ((cond_current - cond_stack) >= 100)
       {
@@ -2497,7 +2457,7 @@ ppdcSource::scan_file(ppdcFile   *fp,     // I - File to read
        cond_state    |= PPDC_COND_SKIP;
       }
     }
-    else if (!strcasecmp(temp, "#elif"))
+    else if (!_cups_strcasecmp(temp, "#elif"))
     {
       if (cond_current == cond_stack)
       {
@@ -2532,7 +2492,7 @@ ppdcSource::scan_file(ppdcFile   *fp,     // I - File to read
        else
          cond_temp --;
     }
-    else if (!strcasecmp(temp, "#else"))
+    else if (!_cups_strcasecmp(temp, "#else"))
     {
       if (cond_current == cond_stack)
       {
@@ -2562,7 +2522,7 @@ ppdcSource::scan_file(ppdcFile   *fp,     // I - File to read
        else
          cond_temp --;
     }
-    else if (!strcasecmp(temp, "#endif"))
+    else if (!_cups_strcasecmp(temp, "#endif"))
     {
       if (cond_current == cond_stack)
       {
@@ -2586,12 +2546,12 @@ ppdcSource::scan_file(ppdcFile   *fp,   // I - File to read
        else
          cond_temp --;
     }
-    else if (!strcasecmp(temp, "#define"))
+    else if (!_cups_strcasecmp(temp, "#define"))
     {
       // Get the variable...
       get_variable(fp);
     }
-    else if (!strcasecmp(temp, "#include"))
+    else if (!_cups_strcasecmp(temp, "#include"))
     {
       // #include filename
       char     basedir[1024],          // Base directory
@@ -2621,7 +2581,7 @@ ppdcSource::scan_file(ppdcFile   *fp,     // I - File to read
       if ((baseptr = strrchr(basedir, '/')) != NULL)
        *baseptr = '\0';
       else
-       strcpy(basedir, ".");
+       strlcpy(basedir, ".", sizeof(basedir));
 
       // Find the include file...
       if (find_include(inctemp, basedir, incname, sizeof(incname)))
@@ -2644,7 +2604,7 @@ ppdcSource::scan_file(ppdcFile   *fp,     // I - File to read
        break;
       }
     }
-    else if (!strcasecmp(temp, "#media"))
+    else if (!_cups_strcasecmp(temp, "#media"))
     {
       ppdcMediaSize    *m;             // Media size
 
@@ -2659,7 +2619,7 @@ ppdcSource::scan_file(ppdcFile   *fp,     // I - File to read
           sizes->add(m);
       }
     }
-    else if (!strcasecmp(temp, "#po"))
+    else if (!_cups_strcasecmp(temp, "#po"))
     {
       ppdcCatalog      *cat;           // Message catalog
 
@@ -2674,14 +2634,14 @@ ppdcSource::scan_file(ppdcFile   *fp,   // I - File to read
          po_files->add(cat);
       }
     }
-    else if (!strcasecmp(temp, "Attribute") ||
-             !strcasecmp(temp, "LocAttribute"))
+    else if (!_cups_strcasecmp(temp, "Attribute") ||
+             !_cups_strcasecmp(temp, "LocAttribute"))
     {
       ppdcAttr *a;                     // Attribute
 
 
       // Get an attribute...
-      a = get_attr(fp, !strcasecmp(temp, "LocAttribute"));
+      a = get_attr(fp, !_cups_strcasecmp(temp, "LocAttribute"));
       if (a)
       {
         if (cond_state)
@@ -2690,7 +2650,7 @@ ppdcSource::scan_file(ppdcFile   *fp,     // I - File to read
           d->add_attr(a);
       }
     }
-    else if (!strcasecmp(temp, "Choice"))
+    else if (!_cups_strcasecmp(temp, "Choice"))
     {
       // Get a choice...
       c = get_choice(fp);
@@ -2706,6 +2666,7 @@ ppdcSource::scan_file(ppdcFile   *fp,     // I - File to read
       // Add it to the current option...
       if (!o)
       {
+        c->release();
         _cupsLangPrintf(stderr,
                        _("ppdc: Choice found on line %d of %s with no "
                          "Option."), fp->line, fp->filename);
@@ -2717,7 +2678,7 @@ ppdcSource::scan_file(ppdcFile   *fp,     // I - File to read
       if (isdefault)
         o->set_defchoice(c);
     }
-    else if (!strcasecmp(temp, "ColorDevice"))
+    else if (!_cups_strcasecmp(temp, "ColorDevice"))
     {
       // ColorDevice boolean
       if (cond_state)
@@ -2725,7 +2686,7 @@ ppdcSource::scan_file(ppdcFile   *fp,     // I - File to read
       else
         d->color_device = get_boolean(fp);
     }
-    else if (!strcasecmp(temp, "ColorModel"))
+    else if (!_cups_strcasecmp(temp, "ColorModel"))
     {
       // Get the color model
       c = get_color_model(fp);
@@ -2754,7 +2715,7 @@ ppdcSource::scan_file(ppdcFile   *fp,     // I - File to read
 
       o = NULL;
     }
-    else if (!strcasecmp(temp, "ColorProfile"))
+    else if (!_cups_strcasecmp(temp, "ColorProfile"))
     {
       ppdcProfile      *p;             // Color profile
 
@@ -2770,7 +2731,7 @@ ppdcSource::scan_file(ppdcFile   *fp,     // I - File to read
           d->profiles->add(p);
       }
     }
-    else if (!strcasecmp(temp, "Copyright"))
+    else if (!_cups_strcasecmp(temp, "Copyright"))
     {
       // Copyright string
       char     copytemp[8192],         // Copyright string
@@ -2799,7 +2760,7 @@ ppdcSource::scan_file(ppdcFile   *fp,     // I - File to read
         d->copyright->add(new ppdcString(copyptr));
       }
     }
-    else if (!strcasecmp(temp, "CustomMedia"))
+    else if (!_cups_strcasecmp(temp, "CustomMedia"))
     {
       ppdcMediaSize    *m;             // Media size
 
@@ -2819,7 +2780,7 @@ ppdcSource::scan_file(ppdcFile   *fp,     // I - File to read
       if (isdefault)
         d->set_default_size(m);
     }
-    else if (!strcasecmp(temp, "Cutter"))
+    else if (!_cups_strcasecmp(temp, "Cutter"))
     {
       // Cutter boolean
       int      have_cutter;            // Have a paper cutter?
@@ -2846,7 +2807,7 @@ ppdcSource::scan_file(ppdcFile   *fp,     // I - File to read
 
       o = NULL;
     }
-    else if (!strcasecmp(temp, "Darkness"))
+    else if (!_cups_strcasecmp(temp, "Darkness"))
     {
       // Get the darkness choice...
       c = get_generic(fp, "Darkness", NULL, "cupsCompression");
@@ -2884,7 +2845,7 @@ ppdcSource::scan_file(ppdcFile   *fp,     // I - File to read
 
       o = NULL;
     }
-    else if (!strcasecmp(temp, "DriverType"))
+    else if (!_cups_strcasecmp(temp, "DriverType"))
     {
       int      i;                      // Looping var
 
@@ -2903,21 +2864,21 @@ ppdcSource::scan_file(ppdcFile   *fp,   // I - File to read
         continue;
 
       for (i = 0; i < (int)(sizeof(driver_types) / sizeof(driver_types[0])); i ++)
-        if (!strcasecmp(temp, driver_types[i]))
+        if (!_cups_strcasecmp(temp, driver_types[i]))
          break;
 
       if (i < (int)(sizeof(driver_types) / sizeof(driver_types[0])))
         d->type = (ppdcDrvType)i;
-      else if (!strcasecmp(temp, "dymo"))
+      else if (!_cups_strcasecmp(temp, "dymo"))
         d->type = PPDC_DRIVER_LABEL;
       else
         _cupsLangPrintf(stderr,
                        _("ppdc: Unknown driver type %s on line %d of %s."),
                        temp, fp->line, fp->filename);
     }
-    else if (!strcasecmp(temp, "Duplex"))
+    else if (!_cups_strcasecmp(temp, "Duplex"))
       get_duplex(fp, d);
-    else if (!strcasecmp(temp, "Filter"))
+    else if (!_cups_strcasecmp(temp, "Filter"))
     {
       ppdcFilter       *f;             // Filter
 
@@ -2932,7 +2893,7 @@ ppdcSource::scan_file(ppdcFile   *fp,     // I - File to read
           d->filters->add(f);
       }
     }
-    else if (!strcasecmp(temp, "Finishing"))
+    else if (!_cups_strcasecmp(temp, "Finishing"))
     {
       // Get the finishing choice...
       c = get_generic(fp, "Finishing", "OutputType", NULL);
@@ -2970,8 +2931,8 @@ ppdcSource::scan_file(ppdcFile   *fp,     // I - File to read
 
       o = NULL;
     }
-    else if (!strcasecmp(temp, "Font") ||
-             !strcasecmp(temp, "#font"))
+    else if (!_cups_strcasecmp(temp, "Font") ||
+             !_cups_strcasecmp(temp, "#font"))
     {
       ppdcFont *f;                     // Font
 
@@ -2984,7 +2945,7 @@ ppdcSource::scan_file(ppdcFile   *fp,     // I - File to read
          f->release();
        else
        {
-         if (!strcasecmp(temp, "#font"))
+         if (!_cups_strcasecmp(temp, "#font"))
            base_fonts->add(f);
          else
            d->add_font(f);
@@ -2994,7 +2955,7 @@ ppdcSource::scan_file(ppdcFile   *fp,     // I - File to read
        }
       }
     }
-    else if (!strcasecmp(temp, "Group"))
+    else if (!_cups_strcasecmp(temp, "Group"))
     {
       // Get a group...
       ppdcGroup *tempg = get_group(fp, d);
@@ -3015,7 +2976,7 @@ ppdcSource::scan_file(ppdcFile   *fp,     // I - File to read
         g = tempg;
       }
     }
-    else if (!strcasecmp(temp, "HWMargins"))
+    else if (!_cups_strcasecmp(temp, "HWMargins"))
     {
       // HWMargins left bottom right top
       d->left_margin   = get_measurement(fp);
@@ -3023,7 +2984,7 @@ ppdcSource::scan_file(ppdcFile   *fp,     // I - File to read
       d->right_margin  = get_measurement(fp);
       d->top_margin    = get_measurement(fp);
     }
-    else if (!strcasecmp(temp, "InputSlot"))
+    else if (!_cups_strcasecmp(temp, "InputSlot"))
     {
       // Get the input slot choice...
       c = get_generic(fp, "InputSlot", NULL, "MediaPosition");
@@ -3037,7 +2998,7 @@ ppdcSource::scan_file(ppdcFile   *fp,     // I - File to read
       }
 
       // Add the choice to the InputSlot option...
-      
+
       if ((o = d->find_option_group("InputSlot", &mg)) == NULL)
       {
        // Create the InputSlot option...
@@ -3063,7 +3024,7 @@ ppdcSource::scan_file(ppdcFile   *fp,     // I - File to read
 
       o = NULL;
     }
-    else if (!strcasecmp(temp, "Installable"))
+    else if (!_cups_strcasecmp(temp, "Installable"))
     {
       // Get the installable option...
       o = get_installable(fp);
@@ -3079,7 +3040,7 @@ ppdcSource::scan_file(ppdcFile   *fp,     // I - File to read
         o = NULL;
       }
     }
-    else if (!strcasecmp(temp, "ManualCopies"))
+    else if (!_cups_strcasecmp(temp, "ManualCopies"))
     {
       // ManualCopies boolean
       if (cond_state)
@@ -3087,7 +3048,7 @@ ppdcSource::scan_file(ppdcFile   *fp,     // I - File to read
       else
         d->manual_copies = get_boolean(fp);
     }
-    else if (!strcasecmp(temp, "Manufacturer"))
+    else if (!_cups_strcasecmp(temp, "Manufacturer"))
     {
       // Manufacturer name
       char     name[256];              // Model name string
@@ -3104,7 +3065,7 @@ ppdcSource::scan_file(ppdcFile   *fp,     // I - File to read
       if (!cond_state)
         d->set_manufacturer(name);
     }
-    else if (!strcasecmp(temp, "MaxSize"))
+    else if (!_cups_strcasecmp(temp, "MaxSize"))
     {
       // MaxSize width length
       if (cond_state)
@@ -3118,7 +3079,7 @@ ppdcSource::scan_file(ppdcFile   *fp,     // I - File to read
        d->max_length = get_measurement(fp);
       }
     }
-    else if (!strcasecmp(temp, "MediaSize"))
+    else if (!_cups_strcasecmp(temp, "MediaSize"))
     {
       // MediaSize keyword
       char             name[41];       // Media size name
@@ -3157,7 +3118,7 @@ ppdcSource::scan_file(ppdcFile   *fp,     // I - File to read
       if (isdefault)
         d->set_default_size(dm);
     }
-    else if (!strcasecmp(temp, "MediaType"))
+    else if (!_cups_strcasecmp(temp, "MediaType"))
     {
       // Get the media type choice...
       c = get_generic(fp, "MediaType", "MediaType", "cupsMediaType");
@@ -3196,7 +3157,7 @@ ppdcSource::scan_file(ppdcFile   *fp,     // I - File to read
 
       o = NULL;
     }
-    else if (!strcasecmp(temp, "MinSize"))
+    else if (!_cups_strcasecmp(temp, "MinSize"))
     {
       // MinSize width length
       if (cond_state)
@@ -3210,7 +3171,7 @@ ppdcSource::scan_file(ppdcFile   *fp,     // I - File to read
        d->min_length = get_measurement(fp);
       }
     }
-    else if (!strcasecmp(temp, "ModelName"))
+    else if (!_cups_strcasecmp(temp, "ModelName"))
     {
       // ModelName name
       char     name[256];              // Model name string
@@ -3227,7 +3188,7 @@ ppdcSource::scan_file(ppdcFile   *fp,     // I - File to read
       if (!cond_state)
         d->set_model_name(name);
     }
-    else if (!strcasecmp(temp, "ModelNumber"))
+    else if (!_cups_strcasecmp(temp, "ModelNumber"))
     {
       // ModelNumber number
       if (cond_state)
@@ -3235,7 +3196,7 @@ ppdcSource::scan_file(ppdcFile   *fp,     // I - File to read
       else
         d->model_number = get_integer(fp);
     }
-    else if (!strcasecmp(temp, "Option"))
+    else if (!_cups_strcasecmp(temp, "Option"))
     {
       // Get an option...
       ppdcOption *tempo = get_option(fp, d, g);
@@ -3256,7 +3217,7 @@ ppdcSource::scan_file(ppdcFile   *fp,     // I - File to read
         o = tempo;
       }
     }
-    else if (!strcasecmp(temp, "FileName"))
+    else if (!_cups_strcasecmp(temp, "FileName"))
     {
       // FileName name
       char     name[256];              // Filename string
@@ -3273,7 +3234,7 @@ ppdcSource::scan_file(ppdcFile   *fp,     // I - File to read
       if (!cond_state)
         d->set_file_name(name);
     }
-    else if (!strcasecmp(temp, "PCFileName"))
+    else if (!_cups_strcasecmp(temp, "PCFileName"))
     {
       // PCFileName name
       char     name[256];              // PC filename string
@@ -3290,7 +3251,7 @@ ppdcSource::scan_file(ppdcFile   *fp,     // I - File to read
       if (!cond_state)
         d->set_pc_file_name(name);
     }
-    else if (!strcasecmp(temp, "Resolution"))
+    else if (!_cups_strcasecmp(temp, "Resolution"))
     {
       // Get the resolution choice...
       c = get_resolution(fp);
@@ -3329,7 +3290,7 @@ ppdcSource::scan_file(ppdcFile   *fp,     // I - File to read
 
       o = NULL;
     }
-    else if (!strcasecmp(temp, "SimpleColorProfile"))
+    else if (!_cups_strcasecmp(temp, "SimpleColorProfile"))
     {
       ppdcProfile      *p;             // Color profile
 
@@ -3345,7 +3306,7 @@ ppdcSource::scan_file(ppdcFile   *fp,     // I - File to read
           d->profiles->add(p);
       }
     }
-    else if (!strcasecmp(temp, "Throughput"))
+    else if (!_cups_strcasecmp(temp, "Throughput"))
     {
       // Throughput number
       if (cond_state)
@@ -3353,7 +3314,7 @@ ppdcSource::scan_file(ppdcFile   *fp,     // I - File to read
       else
         d->throughput = get_integer(fp);
     }
-    else if (!strcasecmp(temp, "UIConstraints"))
+    else if (!_cups_strcasecmp(temp, "UIConstraints"))
     {
       ppdcConstraint   *con;           // Constraint
 
@@ -3368,7 +3329,7 @@ ppdcSource::scan_file(ppdcFile   *fp,     // I - File to read
          d->constraints->add(con);
       }
     }
-    else if (!strcasecmp(temp, "VariablePaperSize"))
+    else if (!_cups_strcasecmp(temp, "VariablePaperSize"))
     {
       // VariablePaperSize boolean
       if (cond_state)
@@ -3376,7 +3337,7 @@ ppdcSource::scan_file(ppdcFile   *fp,     // I - File to read
       else
        d->variable_paper_size = get_boolean(fp);
     }
-    else if (!strcasecmp(temp, "Version"))
+    else if (!_cups_strcasecmp(temp, "Version"))
     {
       // Version string
       char     name[256];              // Model name string
@@ -3541,64 +3502,6 @@ ppdcSource::write_file(const char *f)    // I - File to write
     {
       switch (d->type)
       {
-        case PPDC_DRIVER_ESCP :
-           cupsFilePuts(fp, "  ModelNumber (");
-
-           if (d->model_number & ESCP_DOTMATRIX)
-             cupsFilePuts(fp, " $ESCP_DOTMATRIX");
-           if (d->model_number & ESCP_MICROWEAVE)
-             cupsFilePuts(fp, " $ESCP_MICROWEAVE");
-           if (d->model_number & ESCP_STAGGER)
-             cupsFilePuts(fp, " $ESCP_STAGGER");
-           if (d->model_number & ESCP_ESCK)
-             cupsFilePuts(fp, " $ESCP_ESCK");
-           if (d->model_number & ESCP_EXT_UNITS)
-             cupsFilePuts(fp, " $ESCP_EXT_UNITS");
-           if (d->model_number & ESCP_EXT_MARGINS)
-             cupsFilePuts(fp, " $ESCP_EXT_MARGINS");
-           if (d->model_number & ESCP_USB)
-             cupsFilePuts(fp, " $ESCP_USB");
-           if (d->model_number & ESCP_PAGE_SIZE)
-             cupsFilePuts(fp, " $ESCP_PAGE_SIZE");
-           if (d->model_number & ESCP_RASTER_ESCI)
-             cupsFilePuts(fp, " $ESCP_RASTER_ESCI");
-           if (d->model_number & ESCP_REMOTE)
-             cupsFilePuts(fp, " $ESCP_REMOTE");
-
-           cupsFilePuts(fp, ")\n");
-           break;
-
-       case PPDC_DRIVER_PCL :
-           cupsFilePuts(fp, "  ModelNumber (");
-
-           if (d->model_number & PCL_PAPER_SIZE)
-             cupsFilePuts(fp, " $PCL_PAPER_SIZE");
-           if (d->model_number & PCL_INKJET)
-             cupsFilePuts(fp, " $PCL_INKJET");
-           if (d->model_number & PCL_RASTER_END_COLOR)
-             cupsFilePuts(fp, " $PCL_RASTER_END_COLOR");
-           if (d->model_number & PCL_RASTER_CID)
-             cupsFilePuts(fp, " $PCL_RASTER_CID");
-           if (d->model_number & PCL_RASTER_CRD)
-             cupsFilePuts(fp, " $PCL_RASTER_CRD");
-           if (d->model_number & PCL_RASTER_SIMPLE)
-             cupsFilePuts(fp, " $PCL_RASTER_SIMPLE");
-           if (d->model_number & PCL_RASTER_RGB24)
-             cupsFilePuts(fp, " $PCL_RASTER_RGB24");
-           if (d->model_number & PCL_PJL)
-             cupsFilePuts(fp, " $PCL_PJL");
-           if (d->model_number & PCL_PJL_PAPERWIDTH)
-             cupsFilePuts(fp, " $PCL_PJL_PAPERWIDTH");
-           if (d->model_number & PCL_PJL_HPGL2)
-             cupsFilePuts(fp, " $PCL_PJL_HPGL2");
-           if (d->model_number & PCL_PJL_PCL3GUI)
-             cupsFilePuts(fp, " $PCL_PJL_PCL3GUI");
-           if (d->model_number & PCL_PJL_RESOLUTION)
-             cupsFilePuts(fp, " $PCL_PJL_RESOLUTION");
-
-           cupsFilePuts(fp, ")\n");
-           break;
-
        case PPDC_DRIVER_LABEL :
            cupsFilePuts(fp, "  ModelNumber ");
 
@@ -3893,8 +3796,3 @@ ppdcSource::write_file(const char *f)     // I - File to write
 
   return (0);
 }
-
-
-//
-// End of "$Id$".
-//