]> git.ipfire.org Git - thirdparty/cups.git/blobdiff - ppdc/ppdc-source.cxx
Merge changes from CUPS 1.6svn-r9939.
[thirdparty/cups.git] / ppdc / ppdc-source.cxx
index 5069a877704565288d18a912d85ee2e921d9dbe2..2e4934a6330208ddafd8751be93fa32d3ecdf5b5 100644 (file)
@@ -3,7 +3,7 @@
 //
 //   Source class for the CUPS PPD Compiler.
 //
-//   Copyright 2007-2009 by Apple Inc.
+//   Copyright 2007-2011 by Apple Inc.
 //   Copyright 2002-2007 by Easy Software Products.
 //
 //   These coded instructions, statements, and computer programs are the
 //
 
 #include "ppdc-private.h"
-#include <cups/globals.h>
 #include <limits.h>
 #include <math.h>
 #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
 #  include <sys/utsname.h>
 #endif // !WIN32
@@ -190,7 +187,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);
@@ -227,7 +224,7 @@ ppdcSource::find_include(
     if (*ptr != '>')
     {
       _cupsLangPrintf(stderr,
-                      _("ppdc: Invalid #include/#po filename \"%s\"\n"), n);
+                      _("ppdc: Invalid #include/#po filename \"%s\"."), n);
       return (0);
     }
 
@@ -290,7 +287,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);
@@ -308,7 +305,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);
@@ -326,7 +323,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);
@@ -353,7 +350,7 @@ ppdcSource::get_attr(ppdcFile *fp,  // I - File to read
   if (!get_token(fp, name, sizeof(name)))
   {
     _cupsLangPrintf(stderr,
-                    _("ppdc: Expected name after %s on line %d of %s\n"),
+                    _("ppdc: Expected name after %s on line %d of %s."),
                    loc ? "LocAttribute" : "Attribute", fp->line, fp->filename);
     return (0);
   }
@@ -361,7 +358,7 @@ ppdcSource::get_attr(ppdcFile *fp,  // I - File to read
   if (!get_token(fp, selector, sizeof(selector)))
   {
     _cupsLangPrintf(stderr,
-                    _("ppdc: Expected selector after %s on line %d of %s\n"),
+                    _("ppdc: Expected selector after %s on line %d of %s."),
                    loc ? "LocAttribute" : "Attribute", fp->line, fp->filename);
     return (0);
   }
@@ -372,7 +369,7 @@ ppdcSource::get_attr(ppdcFile *fp,  // I - File to read
   if (!get_token(fp, value, sizeof(value)))
   {
     _cupsLangPrintf(stderr,
-                    _("ppdc: Expected value after %s on line %d of %s\n"),
+                    _("ppdc: Expected value after %s on line %d of %s."),
                    loc ? "LocAttribute" : "Attribute", fp->line, fp->filename);
     return (0);
   }
@@ -394,23 +391,23 @@ ppdcSource::get_boolean(ppdcFile *fp)     // I - File to read
   if (!get_token(fp, buffer, sizeof(buffer)))
   {
     _cupsLangPrintf(stderr,
-                    _("ppdc: Expected boolean value on line %d of %s.\n"),
+                    _("ppdc: Expected boolean value on line %d of %s."),
                    fp->line, fp->filename);
     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
   {
     _cupsLangPrintf(stderr,
-                    _("ppdc: Bad boolean value (%s) on line %d of %s.\n"),
+                    _("ppdc: Bad boolean value (%s) on line %d of %s."),
                    buffer, fp->line, fp->filename);
     return (-1);
   }
@@ -435,7 +432,7 @@ ppdcSource::get_choice(ppdcFile *fp)        // I - File to read
   if (!get_token(fp, name, sizeof(name)))
   {
     _cupsLangPrintf(stderr,
-                    _("ppdc: Expected choice name/text on line %d of %s.\n"),
+                    _("ppdc: Expected choice name/text on line %d of %s."),
                    fp->line, fp->filename);
     return (NULL);
   }
@@ -447,7 +444,7 @@ ppdcSource::get_choice(ppdcFile *fp)        // I - File to read
 
   if (!get_token(fp, code, sizeof(code)))
   {
-    _cupsLangPrintf(stderr, _("ppdc: Expected choice code on line %d of %s.\n"),
+    _cupsLangPrintf(stderr, _("ppdc: Expected choice code on line %d of %s."),
                    fp->line, fp->filename);
     return (NULL);
   }
@@ -480,7 +477,7 @@ ppdcSource::get_color_model(ppdcFile *fp)
   {
     _cupsLangPrintf(stderr,
                     _("ppdc: Expected name/text combination for ColorModel on "
-                     "line %d of %s\n"), fp->line, fp->filename);
+                     "line %d of %s."), fp->line, fp->filename);
     return (NULL);
   }
 
@@ -493,7 +490,7 @@ ppdcSource::get_color_model(ppdcFile *fp)
   {
     _cupsLangPrintf(stderr,
                     _("ppdc: Expected colorspace for ColorModel on line %d of "
-                     "%s\n"), fp->line, fp->filename);
+                     "%s."), fp->line, fp->filename);
     return (NULL);
   }
 
@@ -504,7 +501,7 @@ ppdcSource::get_color_model(ppdcFile *fp)
   {
     _cupsLangPrintf(stderr,
                     _("ppdc: Expected color order for ColorModel on line %d of "
-                     "%s\n"), fp->line, fp->filename);
+                     "%s."), fp->line, fp->filename);
     return (NULL);
   }
 
@@ -515,7 +512,7 @@ ppdcSource::get_color_model(ppdcFile *fp)
   {
     _cupsLangPrintf(stderr,
                     _("ppdc: Expected compression for ColorModel on line %d of "
-                     "%s\n"), fp->line, fp->filename);
+                     "%s."), fp->line, fp->filename);
     return (NULL);
   }
 
@@ -538,12 +535,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);
@@ -573,7 +570,7 @@ ppdcSource::get_color_profile(
   {
     _cupsLangPrintf(stderr,
                     _("ppdc: Expected resolution/mediatype following "
-                     "ColorProfile on line %d of %s\n"),
+                     "ColorProfile on line %d of %s."),
                    fp->line, fp->filename);
     return (NULL);
   }
@@ -600,71 +597,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);
@@ -696,7 +693,7 @@ ppdcSource::get_constraint(ppdcFile *fp)// I - File to read
   {
     _cupsLangPrintf(stderr,
                     _("ppdc: Expected constraints string for UIConstraints on "
-                     "line %d of %s\n"), fp->line, fp->filename);
+                     "line %d of %s."), fp->line, fp->filename);
     return (NULL);
   }
 
@@ -705,7 +702,7 @@ ppdcSource::get_constraint(ppdcFile *fp)// I - File to read
   if (*ptr != '*')
   {
     _cupsLangPrintf(stderr,
-                    _("ppdc: Option constraint must *name on line %d of %s\n"),
+                    _("ppdc: Option constraint must *name on line %d of %s."),
                    fp->line, fp->filename);
     return (NULL);
   }
@@ -728,7 +725,7 @@ ppdcSource::get_constraint(ppdcFile *fp)// I - File to read
   if (*ptr != '*')
   {
     _cupsLangPrintf(stderr,
-                    _("ppdc: Expected two option names on line %d of %s\n"),
+                    _("ppdc: Expected two option names on line %d of %s."),
                    fp->line, fp->filename);
     return (NULL);
   }
@@ -827,15 +824,15 @@ ppdcSource::get_duplex(ppdcFile   *fp,    // I - File to read from
   {
     _cupsLangPrintf(stderr,
                     _("ppdc: Expected duplex type after Duplex on line %d of "
-                     "%s\n"), fp->line, fp->filename);
+                     "%s."), fp->line, fp->filename);
     return;
   }
 
   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)
@@ -850,10 +847,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");
@@ -861,7 +858,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"));
@@ -878,12 +875,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();
@@ -895,18 +892,18 @@ 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"));
   }
   else
     _cupsLangPrintf(stderr,
-                    _("ppdc: Unknown duplex type \"%s\" on line %d of %s\n"),
+                    _("ppdc: Unknown duplex type \"%s\" on line %d of %s."),
                    temp, fp->line, fp->filename);
 }
 
@@ -932,7 +929,7 @@ ppdcSource::get_filter(ppdcFile *fp)        // I - File to read
   if (!get_token(fp, type, sizeof(type)))
   {
     _cupsLangPrintf(stderr,
-                    _("ppdc: Expected a filter definition on line %d of %s\n"),
+                    _("ppdc: Expected a filter definition on line %d of %s."),
                    fp->line, fp->filename);
     return (NULL);
   }
@@ -955,7 +952,7 @@ ppdcSource::get_filter(ppdcFile *fp)        // I - File to read
     if (!get_token(fp, program, sizeof(program)))
     {
       _cupsLangPrintf(stderr,
-                      _("ppdc: Expected a program name on line %d of %s\n"),
+                      _("ppdc: Expected a program name on line %d of %s."),
                      fp->line, fp->filename);
       return (NULL);
     }
@@ -965,14 +962,14 @@ ppdcSource::get_filter(ppdcFile *fp)      // I - File to read
   {
     _cupsLangPrintf(stderr,
                     _("ppdc: Invalid empty MIME type for filter on line %d of "
-                     "%s\n"), fp->line, fp->filename);
+                     "%s."), fp->line, fp->filename);
     return (NULL);
   }
 
   if (cost < 0 || cost > 200)
   {
     _cupsLangPrintf(stderr,
-                    _("ppdc: Invalid cost for filter on line %d of %s\n"),
+                    _("ppdc: Invalid cost for filter on line %d of %s."),
                    fp->line, fp->filename);
     return (NULL);
   }
@@ -981,7 +978,7 @@ ppdcSource::get_filter(ppdcFile *fp)        // I - File to read
   {
     _cupsLangPrintf(stderr,
                     _("ppdc: Invalid empty program name for filter on line %d "
-                     "of %s\n"), fp->line, fp->filename);
+                     "of %s."), fp->line, fp->filename);
     return (NULL);
   }
 
@@ -1004,7 +1001,7 @@ ppdcSource::get_float(ppdcFile *fp)       // I - File to read
   // Get the number from the file and range-check...
   if (!get_token(fp, temp, sizeof(temp)))
   {
-    _cupsLangPrintf(stderr, _("ppdc: Expected real number on line %d of %s\n"),
+    _cupsLangPrintf(stderr, _("ppdc: Expected real number on line %d of %s."),
                    fp->line, fp->filename);
     return (-1.0f);
   }
@@ -1015,7 +1012,7 @@ ppdcSource::get_float(ppdcFile *fp)       // I - File to read
   {
     _cupsLangPrintf(stderr,
                     _("ppdc: Unknown trailing characters in real number \"%s\" "
-                     "on line %d of %s\n"), temp, fp->line, fp->filename);
+                     "on line %d of %s."), temp, fp->line, fp->filename);
     return (-1.0f);
   }
   else
@@ -1058,7 +1055,7 @@ ppdcSource::get_font(ppdcFile *fp)        // I - File to read
   if (!get_token(fp, name, sizeof(name)))
   {
     _cupsLangPrintf(stderr,
-                    _("ppdc: Expected name after Font on line %d of %s\n"),
+                    _("ppdc: Expected name after Font on line %d of %s."),
                    fp->line, fp->filename);
     return (0);
   }
@@ -1078,7 +1075,7 @@ ppdcSource::get_font(ppdcFile *fp)        // I - File to read
     {
       _cupsLangPrintf(stderr,
                       _("ppdc: Expected encoding after Font on line %d of "
-                       "%s\n"), fp->line, fp->filename);
+                       "%s."), fp->line, fp->filename);
       return (0);
     }
 
@@ -1086,7 +1083,7 @@ ppdcSource::get_font(ppdcFile *fp)        // I - File to read
     {
       _cupsLangPrintf(stderr,
                       _("ppdc: Expected version after Font on line %d of "
-                       "%s\n"), fp->line, fp->filename);
+                       "%s."), fp->line, fp->filename);
       return (0);
     }
 
@@ -1094,26 +1091,26 @@ ppdcSource::get_font(ppdcFile *fp)      // I - File to read
     {
       _cupsLangPrintf(stderr,
                       _("ppdc: Expected charset after Font on line %d of "
-                       "%s\n"), fp->line, fp->filename);
+                       "%s."), fp->line, fp->filename);
       return (0);
     }
 
     if (!get_token(fp, temp, sizeof(temp)))
     {
       _cupsLangPrintf(stderr,
-                      _("ppdc: Expected status after Font on line %d of %s\n"),
+                      _("ppdc: Expected status after Font on line %d of %s."),
                      fp->line, fp->filename);
       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
     {
       _cupsLangPrintf(stderr,
-                      _("ppdc: Bad status keyword %s on line %d of %s\n"),
+                      _("ppdc: Bad status keyword %s on line %d of %s."),
                      temp, fp->line, fp->filename);
       return (0);
     }
@@ -1156,7 +1153,7 @@ ppdcSource::get_generic(ppdcFile   *fp,   // I - File to read
   if (!get_token(fp, name, sizeof(name)))
   {
     _cupsLangPrintf(stderr,
-                    _("ppdc: Expected name/text after %s on line %d of %s\n"),
+                    _("ppdc: Expected name/text after %s on line %d of %s."),
                    keyword, fp->line, fp->filename);
     return (NULL);
   }
@@ -1205,7 +1202,7 @@ ppdcSource::get_group(ppdcFile   *fp,     // I - File to read
   if (!get_token(fp, name, sizeof(name)))
   {
     _cupsLangPrintf(stderr,
-                    _("ppdc: Expected group name/text on line %d of %s\n"),
+                    _("ppdc: Expected group name/text on line %d of %s."),
                    fp->line, fp->filename);
     return (NULL);
   }
@@ -1246,7 +1243,7 @@ ppdcSource::get_installable(ppdcFile *fp)
   {
     _cupsLangPrintf(stderr,
                     _("ppdc: Expected name/text after Installable on line %d "
-                     "of %s\n"), fp->line, fp->filename);
+                     "of %s."), fp->line, fp->filename);
     return (NULL);
   }
 
@@ -1364,17 +1361,17 @@ ppdcSource::get_integer(const char *v)  // I - Value string
        while (isspace(*newv & 255))
          newv ++;
 
-        if (strncmp(newv, "==", 2))
+        if (!strncmp(newv, "==", 2))
        {
          compop = PPDC_EQ;
          newv += 2;
        }
-        else if (strncmp(newv, "!=", 2))
+        else if (!strncmp(newv, "!=", 2))
         {
          compop = PPDC_NE;
          newv += 2;
        }
-        else if (strncmp(newv, "<=", 2))
+        else if (!strncmp(newv, "<=", 2))
         {
          compop = PPDC_LE;
          newv += 2;
@@ -1384,7 +1381,7 @@ ppdcSource::get_integer(const char *v)    // I - Value string
          compop = PPDC_LT;
          newv ++;
        }
-        else if (strncmp(newv, ">=", 2))
+        else if (!strncmp(newv, ">=", 2))
         {
          compop = PPDC_GE;
          newv += 2;
@@ -1405,7 +1402,7 @@ ppdcSource::get_integer(const char *v)    // I - Value string
           if (*newv == ')' || !*newv)
            return (-1);
 
-         if (isdigit(*v & 255) || *v == '-' || *v == '+')
+         if (isdigit(*newv & 255) || *newv == '-' || *newv == '+')
          {
            // Get the second number...
            temp2 = strtol(newv, &newv, 0);
@@ -1501,7 +1498,7 @@ ppdcSource::get_integer(ppdcFile *fp)     // I - File to read
 
   if (!get_token(fp, temp, sizeof(temp)))
   {
-    _cupsLangPrintf(stderr, _("ppdc: Expected integer on line %d of %s\n"),
+    _cupsLangPrintf(stderr, _("ppdc: Expected integer on line %d of %s."),
                    fp->line, fp->filename);
     return (-1);
   }
@@ -1531,17 +1528,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);
@@ -1573,7 +1570,7 @@ ppdcSource::get_option(ppdcFile   *fp,    // I - File to read
   if (!get_token(fp, name, sizeof(name)))
   {
     _cupsLangPrintf(stderr,
-                    _("ppdc: Expected option name/text on line %d of %s\n"),
+                    _("ppdc: Expected option name/text on line %d of %s."),
                    fp->line, fp->filename);
     return (NULL);
   }
@@ -1585,21 +1582,21 @@ ppdcSource::get_option(ppdcFile   *fp,  // I - File to read
 
   if (!get_token(fp, type, sizeof(type)))
   {
-    _cupsLangPrintf(stderr, _("ppdc: Expected option type on line %d of %s\n"),
+    _cupsLangPrintf(stderr, _("ppdc: Expected option type on line %d of %s."),
                    fp->line, fp->filename);
     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
   {
     _cupsLangPrintf(stderr,
-                    _("ppdc: Invalid option type \"%s\" on line %d of %s\n"),
+                    _("ppdc: Invalid option type \"%s\" on line %d of %s."),
                    type, fp->line, fp->filename);
     return (NULL);
   }
@@ -1607,28 +1604,28 @@ ppdcSource::get_option(ppdcFile   *fp,  // I - File to read
   if (!get_token(fp, type, sizeof(type)))
   {
     _cupsLangPrintf(stderr,
-                    _("ppdc: Expected option section on line %d of %s\n"),
+                    _("ppdc: Expected option section on line %d of %s."),
                    fp->line, fp->filename);
     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
   {
     _cupsLangPrintf(stderr,
                     _("ppdc: Invalid option section \"%s\" on line %d of "
-                     "%s\n"), type, fp->line, fp->filename);
+                     "%s."), type, fp->line, fp->filename);
     return (NULL);
   }
 
@@ -1644,14 +1641,14 @@ ppdcSource::get_option(ppdcFile   *fp,  // I - File to read
   {
     _cupsLangPrintf(stderr,
                     _("ppdc: Option %s redefined with a different type on line "
-                     "%d of %s\n"), name, fp->line, fp->filename);
+                     "%d of %s."), name, fp->line, fp->filename);
     return (NULL);
   }
   else if (g != mg)
   {
     _cupsLangPrintf(stderr,
                     _("ppdc: Option %s defined in two different groups on line "
-                     "%d of %s\n"), name, fp->line, fp->filename);
+                     "%d of %s."), name, fp->line, fp->filename);
     return (NULL);
   }
 
@@ -1680,7 +1677,7 @@ ppdcSource::get_po(ppdcFile *fp)  // I - File to read
   if (!get_token(fp, locale, sizeof(locale)))
   {
     _cupsLangPrintf(stderr,
-                    _("ppdc: Expected locale after #po on line %d of %s\n"),
+                    _("ppdc: Expected locale after #po on line %d of %s."),
                    fp->line, fp->filename);
     return (NULL);
   }
@@ -1689,7 +1686,7 @@ ppdcSource::get_po(ppdcFile *fp)  // I - File to read
   {
     _cupsLangPrintf(stderr,
                     _("ppdc: Expected filename after #po %s on line %d of "
-                     "%s\n"), locale, fp->line, fp->filename);
+                     "%s."), locale, fp->line, fp->filename);
     return (NULL);
   }
 
@@ -1697,7 +1694,7 @@ ppdcSource::get_po(ppdcFile *fp)  // I - File to read
   if (find_po(locale))
   {
     _cupsLangPrintf(stderr,
-                    _("ppdc: Duplicate #po for locale %s on line %d of %s\n"),
+                    _("ppdc: Duplicate #po for locale %s on line %d of %s."),
                    locale, fp->line, fp->filename);
     return (NULL);
   }
@@ -1729,7 +1726,7 @@ ppdcSource::get_po(ppdcFile *fp)  // I - File to read
   else
   {
     _cupsLangPrintf(stderr,
-                    _("ppdc: Unable to find #po file %s on line %d of %s\n"),
+                    _("ppdc: Unable to find #po file %s on line %d of %s."),
                    poname, fp->line, fp->filename);
     return (NULL);
   }
@@ -1765,7 +1762,7 @@ ppdcSource::get_resolution(ppdcFile *fp)// I - File to read
   {
     _cupsLangPrintf(stderr,
                     _("ppdc: Expected override field after Resolution on line "
-                     "%d of %s\n"), fp->line, fp->filename);
+                     "%d of %s."), fp->line, fp->filename);
     return (NULL);
   }
 
@@ -1782,7 +1779,7 @@ ppdcSource::get_resolution(ppdcFile *fp)// I - File to read
   {
     _cupsLangPrintf(stderr,
                    _("ppdc: Expected name/text after Resolution on line %d of "
-                     "%s\n"), fp->line, fp->filename);
+                     "%s."), fp->line, fp->filename);
     return (NULL);
   }
 
@@ -1796,7 +1793,7 @@ ppdcSource::get_resolution(ppdcFile *fp)// I - File to read
     case 0 :
         _cupsLangPrintf(stderr,
                        _("ppdc: Bad resolution name \"%s\" on line %d of "
-                         "%s\n"), name, fp->line, fp->filename);
+                         "%s."), name, fp->line, fp->filename);
         break;
     case 1 :
         ydpi = xdpi;
@@ -1863,7 +1860,7 @@ ppdcSource::get_simple_profile(ppdcFile *fp)
   {
     _cupsLangPrintf(stderr,
                     _("ppdc: Expected resolution/mediatype following "
-                     "SimpleColorProfile on line %d of %s\n"),
+                     "SimpleColorProfile on line %d of %s."),
                    fp->line, fp->filename);
     return (NULL);
   }
@@ -2033,7 +2030,7 @@ ppdcSource::get_token(ppdcFile *fp,       // I - File to read
          // $ch = $ch
           _cupsLangPrintf(stderr,
                          _("ppdc: Bad variable substitution ($%c) on line %d "
-                           "of %s.\n"), ch, fp->line, fp->filename);
+                           "of %s."), ch, fp->line, fp->filename);
 
          if (bufptr < bufend)
            *bufptr++ = '$';
@@ -2046,18 +2043,18 @@ ppdcSource::get_token(ppdcFile *fp,     // I - File to read
        var = find_variable(name);
        if (var)
        {
-         strncpy(bufptr, var->value->value, bufend - bufptr);
-         bufptr += strlen(var->value->value);
+         strlcpy(bufptr, var->value->value, bufend - bufptr + 1);
+         bufptr += strlen(bufptr);
        }
        else
        {
          if (!(cond_state & PPDC_COND_SKIP))
            _cupsLangPrintf(stderr,
                            _("ppdc: Undefined variable (%s) on line %d of "
-                             "%s.\n"), name, fp->line, fp->filename);
+                             "%s."), name, fp->line, fp->filename);
 
          snprintf(bufptr, bufend - bufptr + 1, "$%s", name);
-         bufptr += strlen(name) + 1;
+         bufptr += strlen(bufptr);
        }
       }
     }
@@ -2164,7 +2161,7 @@ ppdcSource::get_token(ppdcFile *fp,       // I - File to read
   {
     _cupsLangPrintf(stderr,
                     _("ppdc: Unterminated string starting with %c on line %d "
-                     "of %s\n"), quote, startline, fp->filename);
+                     "of %s."), quote, startline, fp->filename);
     return (NULL);
   }
 
@@ -2314,7 +2311,7 @@ ppdcSource::quotef(cups_file_t *fp,       // I - File to write to
 
            bytes += cupsFilePrintf(fp, tformat, va_arg(ap, int));
            break;
-           
+
        case 'p' : // Pointer value
            if ((format - bufformat + 1) > (int)sizeof(tformat))
              break;
@@ -2401,7 +2398,7 @@ ppdcSource::read_file(const char  *f,     // I - File to read
   delete fp;
 
   if (cond_current != cond_stack)
-    _cupsLangPrintf(stderr, _("ppdc: Missing #endif at end of \"%s\"\n"), f);
+    _cupsLangPrintf(stderr, _("ppdc: Missing #endif at end of \"%s\"."), f);
 }
 
 
@@ -2469,22 +2466,22 @@ 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)
       {
         _cupsLangPrintf(stderr,
-                       _("ppdc: Too many nested #if's on line %d of %s\n"),
+                       _("ppdc: Too many nested #if's on line %d of %s."),
                        fp->line, fp->filename);
        break;
       }
@@ -2498,11 +2495,11 @@ 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)
       {
-        _cupsLangPrintf(stderr, _("ppdc: Missing #if on line %d of %s\n"),
+        _cupsLangPrintf(stderr, _("ppdc: Missing #if on line %d of %s."),
                        fp->line, fp->filename);
         break;
       }
@@ -2533,11 +2530,11 @@ 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)
       {
-        _cupsLangPrintf(stderr, _("ppdc: Missing #if on line %d of %s\n"),
+        _cupsLangPrintf(stderr, _("ppdc: Missing #if on line %d of %s."),
                        fp->line, fp->filename);
         break;
       }
@@ -2563,11 +2560,11 @@ 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)
       {
-        _cupsLangPrintf(stderr, _("ppdc: Missing #if on line %d of %s\n"),
+        _cupsLangPrintf(stderr, _("ppdc: Missing #if on line %d of %s."),
                        fp->line, fp->filename);
         break;
       }
@@ -2587,12 +2584,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
@@ -2609,7 +2606,7 @@ ppdcSource::scan_file(ppdcFile   *fp,     // I - File to read
       {
         _cupsLangPrintf(stderr,
                        _("ppdc: Expected include filename on line %d of "
-                         "%s\n"), fp->line, fp->filename);
+                         "%s."), fp->line, fp->filename);
         break;
       }
 
@@ -2633,7 +2630,7 @@ ppdcSource::scan_file(ppdcFile   *fp,     // I - File to read
        delete incfile;
 
        if (cond_current != old_current)
-         _cupsLangPrintf(stderr, _("ppdc: Missing #endif at end of \"%s\"\n"),
+         _cupsLangPrintf(stderr, _("ppdc: Missing #endif at end of \"%s\"."),
                          incname);
       }
       else
@@ -2641,11 +2638,11 @@ ppdcSource::scan_file(ppdcFile   *fp,   // I - File to read
        // Can't find it!
        _cupsLangPrintf(stderr,
                        _("ppdc: Unable to find include file \"%s\" on line %d "
-                         "of %s\n"), inctemp, fp->line, fp->filename);
+                         "of %s."), inctemp, fp->line, fp->filename);
        break;
       }
     }
-    else if (!strcasecmp(temp, "#media"))
+    else if (!_cups_strcasecmp(temp, "#media"))
     {
       ppdcMediaSize    *m;             // Media size
 
@@ -2660,7 +2657,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
 
@@ -2675,14 +2672,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)
@@ -2691,7 +2688,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);
@@ -2709,7 +2706,7 @@ ppdcSource::scan_file(ppdcFile   *fp,     // I - File to read
       {
         _cupsLangPrintf(stderr,
                        _("ppdc: Choice found on line %d of %s with no "
-                         "Option\n"), fp->line, fp->filename);
+                         "Option."), fp->line, fp->filename);
         break;
       }
 
@@ -2718,7 +2715,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)
@@ -2726,7 +2723,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);
@@ -2755,7 +2752,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
 
@@ -2771,7 +2768,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
@@ -2784,7 +2781,7 @@ ppdcSource::scan_file(ppdcFile   *fp,     // I - File to read
       {
         _cupsLangPrintf(stderr,
                        _("ppdc: Expected string after Copyright on line %d "
-                         "of %s\n"), fp->line, fp->filename);
+                         "of %s."), fp->line, fp->filename);
        break;
       }
 
@@ -2800,7 +2797,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
 
@@ -2820,7 +2817,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?
@@ -2847,7 +2844,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");
@@ -2872,7 +2869,7 @@ ppdcSource::scan_file(ppdcFile   *fp,     // I - File to read
       {
        _cupsLangPrintf(stderr,
                        _("ppdc: Option %s defined in two different groups on "
-                         "line %d of %s\n"), "cupsDarkness", fp->line,
+                         "line %d of %s."), "cupsDarkness", fp->line,
                        fp->filename);
        c->release();
        continue;
@@ -2885,7 +2882,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
 
@@ -2895,7 +2892,7 @@ ppdcSource::scan_file(ppdcFile   *fp,     // I - File to read
       {
         _cupsLangPrintf(stderr,
                        _("ppdc: Expected driver type keyword following "
-                         "DriverType on line %d of %s\n"),
+                         "DriverType on line %d of %s."),
                        fp->line, fp->filename);
         continue;
       }
@@ -2904,21 +2901,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\n"),
+                       _("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
 
@@ -2933,7 +2930,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);
@@ -2958,7 +2955,7 @@ ppdcSource::scan_file(ppdcFile   *fp,     // I - File to read
       {
        _cupsLangPrintf(stderr,
                        _("ppdc: Option %s defined in two different groups on "
-                         "line %d of %s\n"), "cupsFinishing", fp->line,
+                         "line %d of %s."), "cupsFinishing", fp->line,
                        fp->filename);
        c->release();
        continue;
@@ -2971,8 +2968,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
 
@@ -2985,7 +2982,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);
@@ -2995,7 +2992,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);
@@ -3016,7 +3013,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);
@@ -3024,7 +3021,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");
@@ -3038,7 +3035,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...
@@ -3051,7 +3048,7 @@ ppdcSource::scan_file(ppdcFile   *fp,     // I - File to read
       {
        _cupsLangPrintf(stderr,
                        _("ppdc: Option %s defined in two different groups on "
-                         "line %d of %s\n"), "InputSlot", fp->line,
+                         "line %d of %s."), "InputSlot", fp->line,
                        fp->filename);
        c->release();
        continue;
@@ -3064,7 +3061,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);
@@ -3080,7 +3077,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)
@@ -3088,7 +3085,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
@@ -3098,14 +3095,14 @@ ppdcSource::scan_file(ppdcFile   *fp,   // I - File to read
       {
         _cupsLangPrintf(stderr,
                        _("ppdc: Expected name after Manufacturer on line %d "
-                         "of %s\n"), fp->line, fp->filename);
+                         "of %s."), fp->line, fp->filename);
        break;
       }
 
       if (!cond_state)
         d->set_manufacturer(name);
     }
-    else if (!strcasecmp(temp, "MaxSize"))
+    else if (!_cups_strcasecmp(temp, "MaxSize"))
     {
       // MaxSize width length
       if (cond_state)
@@ -3119,7 +3116,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
@@ -3131,7 +3128,7 @@ ppdcSource::scan_file(ppdcFile   *fp,     // I - File to read
       {
         _cupsLangPrintf(stderr,
                        _("ppdc: Expected name after MediaSize on line %d of "
-                         "%s\n"), fp->line, fp->filename);
+                         "%s."), fp->line, fp->filename);
        break;
       }
 
@@ -3144,7 +3141,7 @@ ppdcSource::scan_file(ppdcFile   *fp,     // I - File to read
       {
         _cupsLangPrintf(stderr,
                        _("ppdc: Unknown media size \"%s\" on line %d of "
-                         "%s\n"), name, fp->line, fp->filename);
+                         "%s."), name, fp->line, fp->filename);
        break;
       }
 
@@ -3158,7 +3155,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");
@@ -3184,7 +3181,7 @@ ppdcSource::scan_file(ppdcFile   *fp,     // I - File to read
       {
        _cupsLangPrintf(stderr,
                        _("ppdc: Option %s defined in two different groups on "
-                         "line %d of %s\n"), "MediaType", fp->line,
+                         "line %d of %s."), "MediaType", fp->line,
                        fp->filename);
        c->release();
        continue;
@@ -3197,7 +3194,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)
@@ -3211,7 +3208,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
@@ -3221,14 +3218,14 @@ ppdcSource::scan_file(ppdcFile   *fp,   // I - File to read
       {
         _cupsLangPrintf(stderr,
                        _("ppdc: Expected name after ModelName on line %d of "
-                         "%s\n"), fp->line, fp->filename);
+                         "%s."), fp->line, fp->filename);
        break;
       }
 
       if (!cond_state)
         d->set_model_name(name);
     }
-    else if (!strcasecmp(temp, "ModelNumber"))
+    else if (!_cups_strcasecmp(temp, "ModelNumber"))
     {
       // ModelNumber number
       if (cond_state)
@@ -3236,7 +3233,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);
@@ -3257,7 +3254,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
@@ -3267,14 +3264,14 @@ ppdcSource::scan_file(ppdcFile   *fp,   // I - File to read
       {
         _cupsLangPrintf(stderr,
                        _("ppdc: Expected name after FileName on line %d of "
-                         "%s\n"), fp->line, fp->filename);
+                         "%s."), fp->line, fp->filename);
        break;
       }
 
       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
@@ -3284,14 +3281,14 @@ ppdcSource::scan_file(ppdcFile   *fp,   // I - File to read
       {
         _cupsLangPrintf(stderr,
                        _("ppdc: Expected name after PCFileName on line %d of "
-                         "%s\n"), fp->line, fp->filename);
+                         "%s."), fp->line, fp->filename);
        break;
       }
 
       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);
@@ -3317,7 +3314,7 @@ ppdcSource::scan_file(ppdcFile   *fp,     // I - File to read
       {
        _cupsLangPrintf(stderr,
                        _("ppdc: Option %s defined in two different groups on "
-                         "line %d of %s\n"), "Resolution", fp->line,
+                         "line %d of %s."), "Resolution", fp->line,
                        fp->filename);
        c->release();
        continue;
@@ -3330,7 +3327,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
 
@@ -3346,7 +3343,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)
@@ -3354,7 +3351,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
 
@@ -3369,7 +3366,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)
@@ -3377,7 +3374,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
@@ -3387,7 +3384,7 @@ ppdcSource::scan_file(ppdcFile   *fp,     // I - File to read
       {
         _cupsLangPrintf(stderr,
                        _("ppdc: Expected string after Version on line %d of "
-                         "%s\n"), fp->line, fp->filename);
+                         "%s."), fp->line, fp->filename);
        break;
       }
 
@@ -3397,7 +3394,7 @@ ppdcSource::scan_file(ppdcFile   *fp,     // I - File to read
     else
     {
       _cupsLangPrintf(stderr,
-                      _("ppdc: Unknown token \"%s\" seen on line %d of %s\n"),
+                      _("ppdc: Unknown token \"%s\" seen on line %d of %s."),
                      temp, fp->line, fp->filename);
       break;
     }
@@ -3514,7 +3511,8 @@ ppdcSource::write_file(const char *f)     // I - File to write
   for (d = (ppdcDriver *)drivers->first(); d; d = (ppdcDriver *)drivers->next())
   {
     // Start the driver...
-    cupsFilePrintf(fp, "\n// %s %s\n", d->manufacturer->value, d->model_name->value);
+    cupsFilePrintf(fp, "\n// %s %s\n", d->manufacturer->value,
+                   d->model_name->value);
     cupsFilePuts(fp, "{\n");
 
     // Write the copyright stings...
@@ -3541,64 +3539,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 ");