~ubuntu-branches/ubuntu/oneiric/cups/oneiric-proposed

« back to all changes in this revision

Viewing changes to ppdc/ppdc-source.cxx

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt, Till Kamppeter, Martin Pitt
  • Date: 2011-08-07 12:53:12 UTC
  • mfrom: (1.2.13 upstream)
  • Revision ID: james.westby@ubuntu.com-20110807125312-s323cyb3oqaxaemo
Tags: 1.5.0-1
[ Till Kamppeter ]
* New upstream release
* debian/patches/usb-backend-no-segfault-on-bad-device-id.patch,
  debian/patches/usb-backend-accept-old-usblp-uris.patch,
  debian/patches/use-ps2write-ghostscript-device-for-pdftops-filter.patch:
  Removed, included upstream.
* debian/patches/poppler-based-pdftops-fixes.patch,
  debian/patches/do-not-emit-ps-level-3-with-poppler.patch: Replaced patch
  by a new one only containing the parts which remain after removing the
  parts included upstream.
* debian/patches/pidfile.patch,
  debian/patches/ppd-poll-with-client-conf.patch,
  debian/patches/cups-avahi.patch,
  debian/patches/drop_unnecessary_dependencies.patch,
  debian/patches/do-not-broadcast-with-hostnames.patch,
  debian/patches/ppdc-dynamic-linking.patch,
  debian/patches/pstops-based-workflow-only-for-printing-ps-on-a-ps-printer.patch:
  Manually regenerated to adapt to upstream changes.
* debian/patches/manpage-translations.patch,
  debian/patches/rootbackends-worldreadable.patch,
  debian/patches/no-conffile-timestamp.patch,
  debian/patches/read-embedded-options-from-incoming-postscript-and-add-to-ipp-attrs.patch,
  debian/patches/cups-snmp-oids-device-id-hp-ricoh.patch,
  debian/patches/configure-default-browse-protocols.patch,
  debian/patches/logfiles_adm_readable.patch,
  debian/patches/confdirperms.patch,
  debian/patches/printer-filtering.patch,
  debian/patches/show-compile-command-lines.patch,
  debian/patches/log-debug-history-nearly-unlimited.patch:
  Refreshed using quilt.
* debian/patches/default-ripcache-size-auto.patch: Dropped, as once,
  Ghostscript 9.04 is ignoring the cache size value as it crashes easily
  otherwise (Ghostscript upstream bug #691586) and second, CUPS defaults to
  more reasonable 128 MB (now only used for imagetops).
* debian/patches/support-gzipped-charmaps.patch: Dropped, as the SBCS and
  VBCS character maps are not used any more by CUPS.
* debian/rules: Enable threads in the ./configure command line, as otherwise
  CUPS 1.5.0 does not build at all.
* debian/local/filters/pdf-filters/filter/pdftoijs.cxx,
  debian/local/filters/pdf-filters/filter/pdftoraster.cxx,
  debian/local/filters/pdf-filters/pdftoopvp/pdftoopvp.cxx,
  debian/local/filters/pdf-filters/pdftopdf/pdftopdf.cxx: Under CUPS 1.5.x.
  all programs using the PPD API of CUPS need to explicitly include
  "<cups/ppd.h>". Updated the PDF filter add-on package.
* debian/local/filters/pdf-filters/addtocups: Make the addition of the
  pdftopdf and pdftoopvp directories also work with CUPS 1.5.x.
* debian/local/filters/pdf-filters/addtocups,
  debian/local/filters/pdf-filters/removefromcups: Added a symbolic link
  cups/i18n.h, so that texttopdf builds.
* debian/cups-client.install: Install the new ipptool and its sample
  files and manpages.
* debian/cups-client.install: Commented out lines for dropped man page
  translations: ipptool, lppasswd, client.conf, ipptoolfile, cupsenable,
  lpadmin, lpinfo, cupsreject, cupsdisable, cupsaccept
* debian/cups-common.install, debian/rules: The /usr/share/cups/charmaps
  directory got removed from CUPS.
* debian/libcups2-dev.install: cups/i18n.h got renamed to
  cups/language-private.h. Install this as /usr/include/cups/i18n.h.
* debian/libcups2.symbols, debian/libcupsmime1.symbols: Updated.
* debian/cups.lintian-overrides, debian/cups.postinst, debian/cups.prerm,
  debian/cups.templates, debian/local/apparmor-profile: The "scsi"
  CUPS backend got dropped upstream, removed its treatment from these files.

[ Martin Pitt ]
* Add Serbian (Cyrillic) debconf translations, thanks Zlatan Todoric.
  (Closes: #635105)
* Add Serbian (Latin) debconf translations, thanks Zlatan Todoric.
  (Closes: #635108)
* debian/local/apparmor-profile: Allow access to serial printers on USB
  adapters. (LP: #677432)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
//
2
 
// "$Id: ppdc-source.cxx 9189 2010-06-25 19:23:10Z mike $"
 
2
// "$Id: ppdc-source.cxx 9793 2011-05-20 03:49:49Z mike $"
3
3
//
4
4
//   Source class for the CUPS PPD Compiler.
5
5
//
6
 
//   Copyright 2007-2010 by Apple Inc.
 
6
//   Copyright 2007-2011 by Apple Inc.
7
7
//   Copyright 2002-2007 by Easy Software Products.
8
8
//
9
9
//   These coded instructions, statements, and computer programs are the
61
61
//
62
62
 
63
63
#include "ppdc-private.h"
64
 
#include <cups/globals.h>
65
64
#include <limits.h>
66
65
#include <math.h>
67
66
#include <unistd.h>
190
189
 
191
190
 
192
191
  for (d = (ppdcDriver *)drivers->first(); d; d = (ppdcDriver *)drivers->next())
193
 
    if (!strcasecmp(f, d->pc_file_name->value))
 
192
    if (!_cups_strcasecmp(f, d->pc_file_name->value))
194
193
      return (d);
195
194
 
196
195
  return (NULL);
227
226
    if (*ptr != '>')
228
227
    {
229
228
      _cupsLangPrintf(stderr,
230
 
                      _("ppdc: Invalid #include/#po filename \"%s\"!\n"), n);
 
229
                      _("ppdc: Invalid #include/#po filename \"%s\"."), n);
231
230
      return (0);
232
231
    }
233
232
 
290
289
  for (cat = (ppdcCatalog *)po_files->first();
291
290
       cat;
292
291
       cat = (ppdcCatalog *)po_files->next())
293
 
    if (!strcasecmp(l, cat->locale->value))
 
292
    if (!_cups_strcasecmp(l, cat->locale->value))
294
293
      return (cat);
295
294
 
296
295
  return (NULL);
308
307
 
309
308
 
310
309
  for (m = (ppdcMediaSize *)sizes->first(); m; m = (ppdcMediaSize *)sizes->next())
311
 
    if (!strcasecmp(s, m->name->value))
 
310
    if (!_cups_strcasecmp(s, m->name->value))
312
311
      return (m);
313
312
 
314
313
  return (NULL);
326
325
 
327
326
 
328
327
  for (v = (ppdcVariable *)vars->first(); v; v = (ppdcVariable *)vars->next())
329
 
    if (!strcasecmp(n, v->name->value))
 
328
    if (!_cups_strcasecmp(n, v->name->value))
330
329
      return (v);
331
330
 
332
331
  return (NULL);
353
352
  if (!get_token(fp, name, sizeof(name)))
354
353
  {
355
354
    _cupsLangPrintf(stderr,
356
 
                    _("ppdc: Expected name after %s on line %d of %s!\n"),
 
355
                    _("ppdc: Expected name after %s on line %d of %s."),
357
356
                    loc ? "LocAttribute" : "Attribute", fp->line, fp->filename);
358
357
    return (0);
359
358
  }
361
360
  if (!get_token(fp, selector, sizeof(selector)))
362
361
  {
363
362
    _cupsLangPrintf(stderr,
364
 
                    _("ppdc: Expected selector after %s on line %d of %s!\n"),
 
363
                    _("ppdc: Expected selector after %s on line %d of %s."),
365
364
                    loc ? "LocAttribute" : "Attribute", fp->line, fp->filename);
366
365
    return (0);
367
366
  }
372
371
  if (!get_token(fp, value, sizeof(value)))
373
372
  {
374
373
    _cupsLangPrintf(stderr,
375
 
                    _("ppdc: Expected value after %s on line %d of %s!\n"),
 
374
                    _("ppdc: Expected value after %s on line %d of %s."),
376
375
                    loc ? "LocAttribute" : "Attribute", fp->line, fp->filename);
377
376
    return (0);
378
377
  }
394
393
  if (!get_token(fp, buffer, sizeof(buffer)))
395
394
  {
396
395
    _cupsLangPrintf(stderr,
397
 
                    _("ppdc: Expected boolean value on line %d of %s.\n"),
 
396
                    _("ppdc: Expected boolean value on line %d of %s."),
398
397
                    fp->line, fp->filename);
399
398
    return (-1);
400
399
  }
401
400
 
402
 
  if (!strcasecmp(buffer, "on") ||
403
 
      !strcasecmp(buffer, "yes") ||
404
 
      !strcasecmp(buffer, "true"))
 
401
  if (!_cups_strcasecmp(buffer, "on") ||
 
402
      !_cups_strcasecmp(buffer, "yes") ||
 
403
      !_cups_strcasecmp(buffer, "true"))
405
404
    return (1);
406
 
  else if (!strcasecmp(buffer, "off") ||
407
 
           !strcasecmp(buffer, "no") ||
408
 
           !strcasecmp(buffer, "false"))
 
405
  else if (!_cups_strcasecmp(buffer, "off") ||
 
406
           !_cups_strcasecmp(buffer, "no") ||
 
407
           !_cups_strcasecmp(buffer, "false"))
409
408
    return (0);
410
409
  else
411
410
  {
412
411
    _cupsLangPrintf(stderr,
413
 
                    _("ppdc: Bad boolean value (%s) on line %d of %s.\n"),
 
412
                    _("ppdc: Bad boolean value (%s) on line %d of %s."),
414
413
                    buffer, fp->line, fp->filename);
415
414
    return (-1);
416
415
  }
435
434
  if (!get_token(fp, name, sizeof(name)))
436
435
  {
437
436
    _cupsLangPrintf(stderr,
438
 
                    _("ppdc: Expected choice name/text on line %d of %s.\n"),
 
437
                    _("ppdc: Expected choice name/text on line %d of %s."),
439
438
                    fp->line, fp->filename);
440
439
    return (NULL);
441
440
  }
447
446
 
448
447
  if (!get_token(fp, code, sizeof(code)))
449
448
  {
450
 
    _cupsLangPrintf(stderr, _("ppdc: Expected choice code on line %d of %s.\n"),
 
449
    _cupsLangPrintf(stderr, _("ppdc: Expected choice code on line %d of %s."),
451
450
                    fp->line, fp->filename);
452
451
    return (NULL);
453
452
  }
480
479
  {
481
480
    _cupsLangPrintf(stderr,
482
481
                    _("ppdc: Expected name/text combination for ColorModel on "
483
 
                      "line %d of %s!\n"), fp->line, fp->filename);
 
482
                      "line %d of %s."), fp->line, fp->filename);
484
483
    return (NULL);
485
484
  }
486
485
 
493
492
  {
494
493
    _cupsLangPrintf(stderr,
495
494
                    _("ppdc: Expected colorspace for ColorModel on line %d of "
496
 
                      "%s!\n"), fp->line, fp->filename);
 
495
                      "%s."), fp->line, fp->filename);
497
496
    return (NULL);
498
497
  }
499
498
 
504
503
  {
505
504
    _cupsLangPrintf(stderr,
506
505
                    _("ppdc: Expected color order for ColorModel on line %d of "
507
 
                      "%s!\n"), fp->line, fp->filename);
 
506
                      "%s."), fp->line, fp->filename);
508
507
    return (NULL);
509
508
  }
510
509
 
515
514
  {
516
515
    _cupsLangPrintf(stderr,
517
516
                    _("ppdc: Expected compression for ColorModel on line %d of "
518
 
                      "%s!\n"), fp->line, fp->filename);
 
517
                      "%s."), fp->line, fp->filename);
519
518
    return (NULL);
520
519
  }
521
520
 
538
537
ppdcSource::get_color_order(
539
538
    const char *co)                     // I - Color order string
540
539
{
541
 
  if (!strcasecmp(co, "chunked") ||
542
 
      !strcasecmp(co, "chunky"))
 
540
  if (!_cups_strcasecmp(co, "chunked") ||
 
541
      !_cups_strcasecmp(co, "chunky"))
543
542
    return (CUPS_ORDER_CHUNKED);
544
 
  else if (!strcasecmp(co, "banded"))
 
543
  else if (!_cups_strcasecmp(co, "banded"))
545
544
    return (CUPS_ORDER_BANDED);
546
 
  else if (!strcasecmp(co, "planar"))
 
545
  else if (!_cups_strcasecmp(co, "planar"))
547
546
    return (CUPS_ORDER_PLANAR);
548
547
  else
549
548
    return (-1);
573
572
  {
574
573
    _cupsLangPrintf(stderr,
575
574
                    _("ppdc: Expected resolution/mediatype following "
576
 
                      "ColorProfile on line %d of %s!\n"),
 
575
                      "ColorProfile on line %d of %s."),
577
576
                    fp->line, fp->filename);
578
577
    return (NULL);
579
578
  }
600
599
ppdcSource::get_color_space(
601
600
    const char *cs)                     // I - Colorspace string
602
601
{
603
 
  if (!strcasecmp(cs, "w"))
 
602
  if (!_cups_strcasecmp(cs, "w"))
604
603
    return (CUPS_CSPACE_W);
605
 
  else if (!strcasecmp(cs, "rgb"))
 
604
  else if (!_cups_strcasecmp(cs, "rgb"))
606
605
    return (CUPS_CSPACE_RGB);
607
 
  else if (!strcasecmp(cs, "rgba"))
 
606
  else if (!_cups_strcasecmp(cs, "rgba"))
608
607
    return (CUPS_CSPACE_RGBA);
609
 
  else if (!strcasecmp(cs, "k"))
 
608
  else if (!_cups_strcasecmp(cs, "k"))
610
609
    return (CUPS_CSPACE_K);
611
 
  else if (!strcasecmp(cs, "cmy"))
 
610
  else if (!_cups_strcasecmp(cs, "cmy"))
612
611
    return (CUPS_CSPACE_CMY);
613
 
  else if (!strcasecmp(cs, "ymc"))
 
612
  else if (!_cups_strcasecmp(cs, "ymc"))
614
613
    return (CUPS_CSPACE_YMC);
615
 
  else if (!strcasecmp(cs, "cmyk"))
 
614
  else if (!_cups_strcasecmp(cs, "cmyk"))
616
615
    return (CUPS_CSPACE_CMYK);
617
 
  else if (!strcasecmp(cs, "ymck"))
 
616
  else if (!_cups_strcasecmp(cs, "ymck"))
618
617
    return (CUPS_CSPACE_YMCK);
619
 
  else if (!strcasecmp(cs, "kcmy"))
 
618
  else if (!_cups_strcasecmp(cs, "kcmy"))
620
619
    return (CUPS_CSPACE_KCMY);
621
 
  else if (!strcasecmp(cs, "kcmycm"))
 
620
  else if (!_cups_strcasecmp(cs, "kcmycm"))
622
621
    return (CUPS_CSPACE_KCMYcm);
623
 
  else if (!strcasecmp(cs, "gmck"))
 
622
  else if (!_cups_strcasecmp(cs, "gmck"))
624
623
    return (CUPS_CSPACE_GMCK);
625
 
  else if (!strcasecmp(cs, "gmcs"))
 
624
  else if (!_cups_strcasecmp(cs, "gmcs"))
626
625
    return (CUPS_CSPACE_GMCS);
627
 
  else if (!strcasecmp(cs, "white"))
 
626
  else if (!_cups_strcasecmp(cs, "white"))
628
627
    return (CUPS_CSPACE_WHITE);
629
 
  else if (!strcasecmp(cs, "gold"))
 
628
  else if (!_cups_strcasecmp(cs, "gold"))
630
629
    return (CUPS_CSPACE_GOLD);
631
 
  else if (!strcasecmp(cs, "silver"))
 
630
  else if (!_cups_strcasecmp(cs, "silver"))
632
631
    return (CUPS_CSPACE_SILVER);
633
 
  else if (!strcasecmp(cs, "CIEXYZ"))
 
632
  else if (!_cups_strcasecmp(cs, "CIEXYZ"))
634
633
    return (CUPS_CSPACE_CIEXYZ);
635
 
  else if (!strcasecmp(cs, "CIELab"))
 
634
  else if (!_cups_strcasecmp(cs, "CIELab"))
636
635
    return (CUPS_CSPACE_CIELab);
637
 
  else if (!strcasecmp(cs, "RGBW"))
 
636
  else if (!_cups_strcasecmp(cs, "RGBW"))
638
637
    return (CUPS_CSPACE_RGBW);
639
 
  else if (!strcasecmp(cs, "ICC1"))
 
638
  else if (!_cups_strcasecmp(cs, "ICC1"))
640
639
    return (CUPS_CSPACE_ICC1);
641
 
  else if (!strcasecmp(cs, "ICC2"))
 
640
  else if (!_cups_strcasecmp(cs, "ICC2"))
642
641
    return (CUPS_CSPACE_ICC2);
643
 
  else if (!strcasecmp(cs, "ICC3"))
 
642
  else if (!_cups_strcasecmp(cs, "ICC3"))
644
643
    return (CUPS_CSPACE_ICC3);
645
 
  else if (!strcasecmp(cs, "ICC4"))
 
644
  else if (!_cups_strcasecmp(cs, "ICC4"))
646
645
    return (CUPS_CSPACE_ICC4);
647
 
  else if (!strcasecmp(cs, "ICC5"))
 
646
  else if (!_cups_strcasecmp(cs, "ICC5"))
648
647
    return (CUPS_CSPACE_ICC5);
649
 
  else if (!strcasecmp(cs, "ICC6"))
 
648
  else if (!_cups_strcasecmp(cs, "ICC6"))
650
649
    return (CUPS_CSPACE_ICC6);
651
 
  else if (!strcasecmp(cs, "ICC7"))
 
650
  else if (!_cups_strcasecmp(cs, "ICC7"))
652
651
    return (CUPS_CSPACE_ICC7);
653
 
  else if (!strcasecmp(cs, "ICC8"))
 
652
  else if (!_cups_strcasecmp(cs, "ICC8"))
654
653
    return (CUPS_CSPACE_ICC8);
655
 
  else if (!strcasecmp(cs, "ICC9"))
 
654
  else if (!_cups_strcasecmp(cs, "ICC9"))
656
655
    return (CUPS_CSPACE_ICC9);
657
 
  else if (!strcasecmp(cs, "ICCA"))
 
656
  else if (!_cups_strcasecmp(cs, "ICCA"))
658
657
    return (CUPS_CSPACE_ICCA);
659
 
  else if (!strcasecmp(cs, "ICCB"))
 
658
  else if (!_cups_strcasecmp(cs, "ICCB"))
660
659
    return (CUPS_CSPACE_ICCB);
661
 
  else if (!strcasecmp(cs, "ICCC"))
 
660
  else if (!_cups_strcasecmp(cs, "ICCC"))
662
661
    return (CUPS_CSPACE_ICCC);
663
 
  else if (!strcasecmp(cs, "ICCD"))
 
662
  else if (!_cups_strcasecmp(cs, "ICCD"))
664
663
    return (CUPS_CSPACE_ICCD);
665
 
  else if (!strcasecmp(cs, "ICCE"))
 
664
  else if (!_cups_strcasecmp(cs, "ICCE"))
666
665
    return (CUPS_CSPACE_ICCE);
667
 
  else if (!strcasecmp(cs, "ICCF"))
 
666
  else if (!_cups_strcasecmp(cs, "ICCF"))
668
667
    return (CUPS_CSPACE_ICCF);
669
668
  else
670
669
    return (-1);
696
695
  {
697
696
    _cupsLangPrintf(stderr,
698
697
                    _("ppdc: Expected constraints string for UIConstraints on "
699
 
                      "line %d of %s!\n"), fp->line, fp->filename);
 
698
                      "line %d of %s."), fp->line, fp->filename);
700
699
    return (NULL);
701
700
  }
702
701
 
705
704
  if (*ptr != '*')
706
705
  {
707
706
    _cupsLangPrintf(stderr,
708
 
                    _("ppdc: Option constraint must *name on line %d of %s!\n"),
 
707
                    _("ppdc: Option constraint must *name on line %d of %s."),
709
708
                    fp->line, fp->filename);
710
709
    return (NULL);
711
710
  }
728
727
  if (*ptr != '*')
729
728
  {
730
729
    _cupsLangPrintf(stderr,
731
 
                    _("ppdc: Expected two option names on line %d of %s!\n"),
 
730
                    _("ppdc: Expected two option names on line %d of %s."),
732
731
                    fp->line, fp->filename);
733
732
    return (NULL);
734
733
  }
827
826
  {
828
827
    _cupsLangPrintf(stderr,
829
828
                    _("ppdc: Expected duplex type after Duplex on line %d of "
830
 
                      "%s!\n"), fp->line, fp->filename);
 
829
                      "%s."), fp->line, fp->filename);
831
830
    return;
832
831
  }
833
832
 
834
833
  if (cond_state)
835
834
    return;
836
835
 
837
 
  if (!strcasecmp(temp, "none") || !strcasecmp(temp, "false") ||
838
 
      !strcasecmp(temp, "no") || !strcasecmp(temp, "off"))
 
836
  if (!_cups_strcasecmp(temp, "none") || !_cups_strcasecmp(temp, "false") ||
 
837
      !_cups_strcasecmp(temp, "no") || !_cups_strcasecmp(temp, "off"))
839
838
  {
840
839
    g = d->find_group("General");
841
840
    if ((o = g->find_option("Duplex")) != NULL)
850
849
        break;
851
850
      }
852
851
  }
853
 
  else if (!strcasecmp(temp, "normal") || !strcasecmp(temp, "true") ||
854
 
           !strcasecmp(temp, "yes") || !strcasecmp(temp, "on") ||
855
 
           !strcasecmp(temp, "flip") || !strcasecmp(temp, "rotated") ||
856
 
           !strcasecmp(temp, "manualtumble"))
 
852
  else if (!_cups_strcasecmp(temp, "normal") || !_cups_strcasecmp(temp, "true") ||
 
853
           !_cups_strcasecmp(temp, "yes") || !_cups_strcasecmp(temp, "on") ||
 
854
           !_cups_strcasecmp(temp, "flip") || !_cups_strcasecmp(temp, "rotated") ||
 
855
           !_cups_strcasecmp(temp, "manualtumble"))
857
856
  {
858
857
    g = d->find_group("General");
859
858
    o = g->find_option("Duplex");
861
860
    if (!o)
862
861
    {
863
862
      o = new ppdcOption(PPDC_PICKONE, "Duplex", "2-Sided Printing",
864
 
                         !strcasecmp(temp, "flip") ? PPDC_SECTION_PAGE :
 
863
                         !_cups_strcasecmp(temp, "flip") ? PPDC_SECTION_PAGE :
865
864
                                                     PPDC_SECTION_ANY, 10.0f);
866
865
      o->add_choice(new ppdcChoice("None", "Off (1-Sided)",
867
866
                                   "<</Duplex false>>setpagedevice"));
878
877
         attr = (ppdcAttr *)d->attrs->next())
879
878
      if (!strcmp(attr->name->value, "cupsFlipDuplex"))
880
879
      {
881
 
        if (strcasecmp(temp, "flip"))
 
880
        if (_cups_strcasecmp(temp, "flip"))
882
881
          d->attrs->remove(attr);
883
882
        break;
884
883
      }
885
884
 
886
 
    if (!strcasecmp(temp, "flip") && !attr)
 
885
    if (!_cups_strcasecmp(temp, "flip") && !attr)
887
886
      d->add_attr(new ppdcAttr("cupsFlipDuplex", NULL, NULL, "true"));
888
887
 
889
888
    for (attr = (ppdcAttr *)d->attrs->first();
895
894
        break;
896
895
      }
897
896
 
898
 
    if (!strcasecmp(temp, "flip"))
 
897
    if (!_cups_strcasecmp(temp, "flip"))
899
898
      d->add_attr(new ppdcAttr("cupsBackSide", NULL, NULL, "Flipped"));
900
 
    else if (!strcasecmp(temp, "rotated"))
 
899
    else if (!_cups_strcasecmp(temp, "rotated"))
901
900
      d->add_attr(new ppdcAttr("cupsBackSide", NULL, NULL, "Rotated"));
902
 
    else if (!strcasecmp(temp, "manualtumble"))
 
901
    else if (!_cups_strcasecmp(temp, "manualtumble"))
903
902
      d->add_attr(new ppdcAttr("cupsBackSide", NULL, NULL, "ManualTumble"));
904
903
    else
905
904
      d->add_attr(new ppdcAttr("cupsBackSide", NULL, NULL, "Normal"));
906
905
  }
907
906
  else
908
907
    _cupsLangPrintf(stderr,
909
 
                    _("ppdc: Unknown duplex type \"%s\" on line %d of %s!\n"),
 
908
                    _("ppdc: Unknown duplex type \"%s\" on line %d of %s."),
910
909
                    temp, fp->line, fp->filename);
911
910
}
912
911
 
932
931
  if (!get_token(fp, type, sizeof(type)))
933
932
  {
934
933
    _cupsLangPrintf(stderr,
935
 
                    _("ppdc: Expected a filter definition on line %d of %s!\n"),
 
934
                    _("ppdc: Expected a filter definition on line %d of %s."),
936
935
                    fp->line, fp->filename);
937
936
    return (NULL);
938
937
  }
955
954
    if (!get_token(fp, program, sizeof(program)))
956
955
    {
957
956
      _cupsLangPrintf(stderr,
958
 
                      _("ppdc: Expected a program name on line %d of %s!\n"),
 
957
                      _("ppdc: Expected a program name on line %d of %s."),
959
958
                      fp->line, fp->filename);
960
959
      return (NULL);
961
960
    }
965
964
  {
966
965
    _cupsLangPrintf(stderr,
967
966
                    _("ppdc: Invalid empty MIME type for filter on line %d of "
968
 
                      "%s!\n"), fp->line, fp->filename);
 
967
                      "%s."), fp->line, fp->filename);
969
968
    return (NULL);
970
969
  }
971
970
 
972
971
  if (cost < 0 || cost > 200)
973
972
  {
974
973
    _cupsLangPrintf(stderr,
975
 
                    _("ppdc: Invalid cost for filter on line %d of %s!\n"),
 
974
                    _("ppdc: Invalid cost for filter on line %d of %s."),
976
975
                    fp->line, fp->filename);
977
976
    return (NULL);
978
977
  }
981
980
  {
982
981
    _cupsLangPrintf(stderr,
983
982
                    _("ppdc: Invalid empty program name for filter on line %d "
984
 
                      "of %s!\n"), fp->line, fp->filename);
 
983
                      "of %s."), fp->line, fp->filename);
985
984
    return (NULL);
986
985
  }
987
986
 
1004
1003
  // Get the number from the file and range-check...
1005
1004
  if (!get_token(fp, temp, sizeof(temp)))
1006
1005
  {
1007
 
    _cupsLangPrintf(stderr, _("ppdc: Expected real number on line %d of %s!\n"),
 
1006
    _cupsLangPrintf(stderr, _("ppdc: Expected real number on line %d of %s."),
1008
1007
                    fp->line, fp->filename);
1009
1008
    return (-1.0f);
1010
1009
  }
1015
1014
  {
1016
1015
    _cupsLangPrintf(stderr,
1017
1016
                    _("ppdc: Unknown trailing characters in real number \"%s\" "
1018
 
                      "on line %d of %s!\n"), temp, fp->line, fp->filename);
 
1017
                      "on line %d of %s."), temp, fp->line, fp->filename);
1019
1018
    return (-1.0f);
1020
1019
  }
1021
1020
  else
1058
1057
  if (!get_token(fp, name, sizeof(name)))
1059
1058
  {
1060
1059
    _cupsLangPrintf(stderr,
1061
 
                    _("ppdc: Expected name after Font on line %d of %s!\n"),
 
1060
                    _("ppdc: Expected name after Font on line %d of %s."),
1062
1061
                    fp->line, fp->filename);
1063
1062
    return (0);
1064
1063
  }
1078
1077
    {
1079
1078
      _cupsLangPrintf(stderr,
1080
1079
                      _("ppdc: Expected encoding after Font on line %d of "
1081
 
                        "%s!\n"), fp->line, fp->filename);
 
1080
                        "%s."), fp->line, fp->filename);
1082
1081
      return (0);
1083
1082
    }
1084
1083
 
1086
1085
    {
1087
1086
      _cupsLangPrintf(stderr,
1088
1087
                      _("ppdc: Expected version after Font on line %d of "
1089
 
                        "%s!\n"), fp->line, fp->filename);
 
1088
                        "%s."), fp->line, fp->filename);
1090
1089
      return (0);
1091
1090
    }
1092
1091
 
1094
1093
    {
1095
1094
      _cupsLangPrintf(stderr,
1096
1095
                      _("ppdc: Expected charset after Font on line %d of "
1097
 
                        "%s!\n"), fp->line, fp->filename);
 
1096
                        "%s."), fp->line, fp->filename);
1098
1097
      return (0);
1099
1098
    }
1100
1099
 
1101
1100
    if (!get_token(fp, temp, sizeof(temp)))
1102
1101
    {
1103
1102
      _cupsLangPrintf(stderr,
1104
 
                      _("ppdc: Expected status after Font on line %d of %s!\n"),
 
1103
                      _("ppdc: Expected status after Font on line %d of %s."),
1105
1104
                      fp->line, fp->filename);
1106
1105
      return (0);
1107
1106
    }
1108
1107
 
1109
 
    if (!strcasecmp(temp, "ROM"))
 
1108
    if (!_cups_strcasecmp(temp, "ROM"))
1110
1109
      status = PPDC_FONT_ROM;
1111
 
    else if (!strcasecmp(temp, "Disk"))
 
1110
    else if (!_cups_strcasecmp(temp, "Disk"))
1112
1111
      status = PPDC_FONT_DISK;
1113
1112
    else
1114
1113
    {
1115
1114
      _cupsLangPrintf(stderr,
1116
 
                      _("ppdc: Bad status keyword %s on line %d of %s!\n"),
 
1115
                      _("ppdc: Bad status keyword %s on line %d of %s."),
1117
1116
                      temp, fp->line, fp->filename);
1118
1117
      return (0);
1119
1118
    }
1156
1155
  if (!get_token(fp, name, sizeof(name)))
1157
1156
  {
1158
1157
    _cupsLangPrintf(stderr,
1159
 
                    _("ppdc: Expected name/text after %s on line %d of %s!\n"),
 
1158
                    _("ppdc: Expected name/text after %s on line %d of %s."),
1160
1159
                    keyword, fp->line, fp->filename);
1161
1160
    return (NULL);
1162
1161
  }
1205
1204
  if (!get_token(fp, name, sizeof(name)))
1206
1205
  {
1207
1206
    _cupsLangPrintf(stderr,
1208
 
                    _("ppdc: Expected group name/text on line %d of %s!\n"),
 
1207
                    _("ppdc: Expected group name/text on line %d of %s."),
1209
1208
                    fp->line, fp->filename);
1210
1209
    return (NULL);
1211
1210
  }
1246
1245
  {
1247
1246
    _cupsLangPrintf(stderr,
1248
1247
                    _("ppdc: Expected name/text after Installable on line %d "
1249
 
                      "of %s!\n"), fp->line, fp->filename);
 
1248
                      "of %s."), fp->line, fp->filename);
1250
1249
    return (NULL);
1251
1250
  }
1252
1251
 
1501
1500
 
1502
1501
  if (!get_token(fp, temp, sizeof(temp)))
1503
1502
  {
1504
 
    _cupsLangPrintf(stderr, _("ppdc: Expected integer on line %d of %s!\n"),
 
1503
    _cupsLangPrintf(stderr, _("ppdc: Expected integer on line %d of %s."),
1505
1504
                    fp->line, fp->filename);
1506
1505
    return (-1);
1507
1506
  }
1531
1530
  val = (float)strtod(buffer, &ptr);
1532
1531
 
1533
1532
  // Check for a trailing unit specifier...
1534
 
  if (!strcasecmp(ptr, "mm"))
 
1533
  if (!_cups_strcasecmp(ptr, "mm"))
1535
1534
    val *= 72.0f / 25.4f;
1536
 
  else if (!strcasecmp(ptr, "cm"))
 
1535
  else if (!_cups_strcasecmp(ptr, "cm"))
1537
1536
    val *= 72.0f / 2.54f;
1538
 
  else if (!strcasecmp(ptr, "m"))
 
1537
  else if (!_cups_strcasecmp(ptr, "m"))
1539
1538
    val *= 72.0f / 0.0254f;
1540
 
  else if (!strcasecmp(ptr, "in"))
 
1539
  else if (!_cups_strcasecmp(ptr, "in"))
1541
1540
    val *= 72.0f;
1542
 
  else if (!strcasecmp(ptr, "ft"))
 
1541
  else if (!_cups_strcasecmp(ptr, "ft"))
1543
1542
    val *= 72.0f * 12.0f;
1544
 
  else if (strcasecmp(ptr, "pt") && *ptr)
 
1543
  else if (_cups_strcasecmp(ptr, "pt") && *ptr)
1545
1544
    return (-1.0f);
1546
1545
 
1547
1546
  return (val);
1573
1572
  if (!get_token(fp, name, sizeof(name)))
1574
1573
  {
1575
1574
    _cupsLangPrintf(stderr,
1576
 
                    _("ppdc: Expected option name/text on line %d of %s!\n"),
 
1575
                    _("ppdc: Expected option name/text on line %d of %s."),
1577
1576
                    fp->line, fp->filename);
1578
1577
    return (NULL);
1579
1578
  }
1585
1584
 
1586
1585
  if (!get_token(fp, type, sizeof(type)))
1587
1586
  {
1588
 
    _cupsLangPrintf(stderr, _("ppdc: Expected option type on line %d of %s!\n"),
 
1587
    _cupsLangPrintf(stderr, _("ppdc: Expected option type on line %d of %s."),
1589
1588
                    fp->line, fp->filename);
1590
1589
    return (NULL);
1591
1590
  }
1592
1591
 
1593
 
  if (!strcasecmp(type, "boolean"))
 
1592
  if (!_cups_strcasecmp(type, "boolean"))
1594
1593
    ot = PPDC_BOOLEAN;
1595
 
  else if (!strcasecmp(type, "pickone"))
 
1594
  else if (!_cups_strcasecmp(type, "pickone"))
1596
1595
    ot = PPDC_PICKONE;
1597
 
  else if (!strcasecmp(type, "pickmany"))
 
1596
  else if (!_cups_strcasecmp(type, "pickmany"))
1598
1597
    ot = PPDC_PICKMANY;
1599
1598
  else
1600
1599
  {
1601
1600
    _cupsLangPrintf(stderr,
1602
 
                    _("ppdc: Invalid option type \"%s\" on line %d of %s!\n"),
 
1601
                    _("ppdc: Invalid option type \"%s\" on line %d of %s."),
1603
1602
                    type, fp->line, fp->filename);
1604
1603
    return (NULL);
1605
1604
  }
1607
1606
  if (!get_token(fp, type, sizeof(type)))
1608
1607
  {
1609
1608
    _cupsLangPrintf(stderr,
1610
 
                    _("ppdc: Expected option section on line %d of %s!\n"),
 
1609
                    _("ppdc: Expected option section on line %d of %s."),
1611
1610
                    fp->line, fp->filename);
1612
1611
    return (NULL);
1613
1612
  }
1614
1613
 
1615
 
  if (!strcasecmp(type, "AnySetup"))
 
1614
  if (!_cups_strcasecmp(type, "AnySetup"))
1616
1615
    section = PPDC_SECTION_ANY;
1617
 
  else if (!strcasecmp(type, "DocumentSetup"))
 
1616
  else if (!_cups_strcasecmp(type, "DocumentSetup"))
1618
1617
    section = PPDC_SECTION_DOCUMENT;
1619
 
  else if (!strcasecmp(type, "ExitServer"))
 
1618
  else if (!_cups_strcasecmp(type, "ExitServer"))
1620
1619
    section = PPDC_SECTION_EXIT;
1621
 
  else if (!strcasecmp(type, "JCLSetup"))
 
1620
  else if (!_cups_strcasecmp(type, "JCLSetup"))
1622
1621
    section = PPDC_SECTION_JCL;
1623
 
  else if (!strcasecmp(type, "PageSetup"))
 
1622
  else if (!_cups_strcasecmp(type, "PageSetup"))
1624
1623
    section = PPDC_SECTION_PAGE;
1625
 
  else if (!strcasecmp(type, "Prolog"))
 
1624
  else if (!_cups_strcasecmp(type, "Prolog"))
1626
1625
    section = PPDC_SECTION_PROLOG;
1627
1626
  else
1628
1627
  {
1629
1628
    _cupsLangPrintf(stderr,
1630
1629
                    _("ppdc: Invalid option section \"%s\" on line %d of "
1631
 
                      "%s!\n"), type, fp->line, fp->filename);
 
1630
                      "%s."), type, fp->line, fp->filename);
1632
1631
    return (NULL);
1633
1632
  }
1634
1633
 
1644
1643
  {
1645
1644
    _cupsLangPrintf(stderr,
1646
1645
                    _("ppdc: Option %s redefined with a different type on line "
1647
 
                      "%d of %s!\n"), name, fp->line, fp->filename);
 
1646
                      "%d of %s."), name, fp->line, fp->filename);
1648
1647
    return (NULL);
1649
1648
  }
1650
1649
  else if (g != mg)
1651
1650
  {
1652
1651
    _cupsLangPrintf(stderr,
1653
1652
                    _("ppdc: Option %s defined in two different groups on line "
1654
 
                      "%d of %s!\n"), name, fp->line, fp->filename);
 
1653
                      "%d of %s."), name, fp->line, fp->filename);
1655
1654
    return (NULL);
1656
1655
  }
1657
1656
 
1680
1679
  if (!get_token(fp, locale, sizeof(locale)))
1681
1680
  {
1682
1681
    _cupsLangPrintf(stderr,
1683
 
                    _("ppdc: Expected locale after #po on line %d of %s!\n"),
 
1682
                    _("ppdc: Expected locale after #po on line %d of %s."),
1684
1683
                    fp->line, fp->filename);
1685
1684
    return (NULL);
1686
1685
  }
1689
1688
  {
1690
1689
    _cupsLangPrintf(stderr,
1691
1690
                    _("ppdc: Expected filename after #po %s on line %d of "
1692
 
                      "%s!\n"), locale, fp->line, fp->filename);
 
1691
                      "%s."), locale, fp->line, fp->filename);
1693
1692
    return (NULL);
1694
1693
  }
1695
1694
 
1697
1696
  if (find_po(locale))
1698
1697
  {
1699
1698
    _cupsLangPrintf(stderr,
1700
 
                    _("ppdc: Duplicate #po for locale %s on line %d of %s!\n"),
 
1699
                    _("ppdc: Duplicate #po for locale %s on line %d of %s."),
1701
1700
                    locale, fp->line, fp->filename);
1702
1701
    return (NULL);
1703
1702
  }
1729
1728
  else
1730
1729
  {
1731
1730
    _cupsLangPrintf(stderr,
1732
 
                    _("ppdc: Unable to find #po file %s on line %d of %s!\n"),
 
1731
                    _("ppdc: Unable to find #po file %s on line %d of %s."),
1733
1732
                    poname, fp->line, fp->filename);
1734
1733
    return (NULL);
1735
1734
  }
1765
1764
  {
1766
1765
    _cupsLangPrintf(stderr,
1767
1766
                    _("ppdc: Expected override field after Resolution on line "
1768
 
                      "%d of %s!\n"), fp->line, fp->filename);
 
1767
                      "%d of %s."), fp->line, fp->filename);
1769
1768
    return (NULL);
1770
1769
  }
1771
1770
 
1782
1781
  {
1783
1782
    _cupsLangPrintf(stderr,
1784
1783
                    _("ppdc: Expected name/text after Resolution on line %d of "
1785
 
                      "%s!\n"), fp->line, fp->filename);
 
1784
                      "%s."), fp->line, fp->filename);
1786
1785
    return (NULL);
1787
1786
  }
1788
1787
 
1796
1795
    case 0 :
1797
1796
        _cupsLangPrintf(stderr,
1798
1797
                        _("ppdc: Bad resolution name \"%s\" on line %d of "
1799
 
                          "%s!\n"), name, fp->line, fp->filename);
 
1798
                          "%s."), name, fp->line, fp->filename);
1800
1799
        break;
1801
1800
    case 1 :
1802
1801
        ydpi = xdpi;
1863
1862
  {
1864
1863
    _cupsLangPrintf(stderr,
1865
1864
                    _("ppdc: Expected resolution/mediatype following "
1866
 
                      "SimpleColorProfile on line %d of %s!\n"),
 
1865
                      "SimpleColorProfile on line %d of %s."),
1867
1866
                    fp->line, fp->filename);
1868
1867
    return (NULL);
1869
1868
  }
2033
2032
          // $ch = $ch
2034
2033
          _cupsLangPrintf(stderr,
2035
2034
                          _("ppdc: Bad variable substitution ($%c) on line %d "
2036
 
                            "of %s.\n"), ch, fp->line, fp->filename);
 
2035
                            "of %s."), ch, fp->line, fp->filename);
2037
2036
 
2038
2037
          if (bufptr < bufend)
2039
2038
            *bufptr++ = '$';
2054
2053
          if (!(cond_state & PPDC_COND_SKIP))
2055
2054
            _cupsLangPrintf(stderr,
2056
2055
                            _("ppdc: Undefined variable (%s) on line %d of "
2057
 
                              "%s.\n"), name, fp->line, fp->filename);
 
2056
                              "%s."), name, fp->line, fp->filename);
2058
2057
 
2059
2058
          snprintf(bufptr, bufend - bufptr + 1, "$%s", name);
2060
2059
          bufptr += strlen(bufptr);
2164
2163
  {
2165
2164
    _cupsLangPrintf(stderr,
2166
2165
                    _("ppdc: Unterminated string starting with %c on line %d "
2167
 
                      "of %s!\n"), quote, startline, fp->filename);
 
2166
                      "of %s."), quote, startline, fp->filename);
2168
2167
    return (NULL);
2169
2168
  }
2170
2169
 
2314
2313
 
2315
2314
            bytes += cupsFilePrintf(fp, tformat, va_arg(ap, int));
2316
2315
            break;
2317
 
            
 
2316
 
2318
2317
        case 'p' : // Pointer value
2319
2318
            if ((format - bufformat + 1) > (int)sizeof(tformat))
2320
2319
              break;
2401
2400
  delete fp;
2402
2401
 
2403
2402
  if (cond_current != cond_stack)
2404
 
    _cupsLangPrintf(stderr, _("ppdc: Missing #endif at end of \"%s\"!\n"), f);
 
2403
    _cupsLangPrintf(stderr, _("ppdc: Missing #endif at end of \"%s\"."), f);
2405
2404
}
2406
2405
 
2407
2406
 
2469
2468
      isdefault = 0;
2470
2469
    }
2471
2470
 
2472
 
    if (!strcasecmp(temp, "}"))
 
2471
    if (!_cups_strcasecmp(temp, "}"))
2473
2472
    {
2474
2473
      // Close this one out...
2475
2474
      break;
2476
2475
    }
2477
 
    else if (!strcasecmp(temp, "{"))
 
2476
    else if (!_cups_strcasecmp(temp, "{"))
2478
2477
    {
2479
2478
      // Open a new child...
2480
2479
      scan_file(fp, d);
2481
2480
    }
2482
 
    else if (!strcasecmp(temp, "#if"))
 
2481
    else if (!_cups_strcasecmp(temp, "#if"))
2483
2482
    {
2484
2483
      if ((cond_current - cond_stack) >= 100)
2485
2484
      {
2486
2485
        _cupsLangPrintf(stderr,
2487
 
                        _("ppdc: Too many nested #if's on line %d of %s!\n"),
 
2486
                        _("ppdc: Too many nested #if's on line %d of %s."),
2488
2487
                        fp->line, fp->filename);
2489
2488
        break;
2490
2489
      }
2498
2497
        cond_state    |= PPDC_COND_SKIP;
2499
2498
      }
2500
2499
    }
2501
 
    else if (!strcasecmp(temp, "#elif"))
 
2500
    else if (!_cups_strcasecmp(temp, "#elif"))
2502
2501
    {
2503
2502
      if (cond_current == cond_stack)
2504
2503
      {
2505
 
        _cupsLangPrintf(stderr, _("ppdc: Missing #if on line %d of %s!\n"),
 
2504
        _cupsLangPrintf(stderr, _("ppdc: Missing #if on line %d of %s."),
2506
2505
                        fp->line, fp->filename);
2507
2506
        break;
2508
2507
      }
2533
2532
        else
2534
2533
          cond_temp --;
2535
2534
    }
2536
 
    else if (!strcasecmp(temp, "#else"))
 
2535
    else if (!_cups_strcasecmp(temp, "#else"))
2537
2536
    {
2538
2537
      if (cond_current == cond_stack)
2539
2538
      {
2540
 
        _cupsLangPrintf(stderr, _("ppdc: Missing #if on line %d of %s!\n"),
 
2539
        _cupsLangPrintf(stderr, _("ppdc: Missing #if on line %d of %s."),
2541
2540
                        fp->line, fp->filename);
2542
2541
        break;
2543
2542
      }
2563
2562
        else
2564
2563
          cond_temp --;
2565
2564
    }
2566
 
    else if (!strcasecmp(temp, "#endif"))
 
2565
    else if (!_cups_strcasecmp(temp, "#endif"))
2567
2566
    {
2568
2567
      if (cond_current == cond_stack)
2569
2568
      {
2570
 
        _cupsLangPrintf(stderr, _("ppdc: Missing #if on line %d of %s!\n"),
 
2569
        _cupsLangPrintf(stderr, _("ppdc: Missing #if on line %d of %s."),
2571
2570
                        fp->line, fp->filename);
2572
2571
        break;
2573
2572
      }
2587
2586
        else
2588
2587
          cond_temp --;
2589
2588
    }
2590
 
    else if (!strcasecmp(temp, "#define"))
 
2589
    else if (!_cups_strcasecmp(temp, "#define"))
2591
2590
    {
2592
2591
      // Get the variable...
2593
2592
      get_variable(fp);
2594
2593
    }
2595
 
    else if (!strcasecmp(temp, "#include"))
 
2594
    else if (!_cups_strcasecmp(temp, "#include"))
2596
2595
    {
2597
2596
      // #include filename
2598
2597
      char      basedir[1024],          // Base directory
2609
2608
      {
2610
2609
        _cupsLangPrintf(stderr,
2611
2610
                        _("ppdc: Expected include filename on line %d of "
2612
 
                          "%s!\n"), fp->line, fp->filename);
 
2611
                          "%s."), fp->line, fp->filename);
2613
2612
        break;
2614
2613
      }
2615
2614
 
2633
2632
        delete incfile;
2634
2633
 
2635
2634
        if (cond_current != old_current)
2636
 
          _cupsLangPrintf(stderr, _("ppdc: Missing #endif at end of \"%s\"!\n"),
 
2635
          _cupsLangPrintf(stderr, _("ppdc: Missing #endif at end of \"%s\"."),
2637
2636
                          incname);
2638
2637
      }
2639
2638
      else
2641
2640
        // Can't find it!
2642
2641
        _cupsLangPrintf(stderr,
2643
2642
                        _("ppdc: Unable to find include file \"%s\" on line %d "
2644
 
                          "of %s!\n"), inctemp, fp->line, fp->filename);
 
2643
                          "of %s."), inctemp, fp->line, fp->filename);
2645
2644
        break;
2646
2645
      }
2647
2646
    }
2648
 
    else if (!strcasecmp(temp, "#media"))
 
2647
    else if (!_cups_strcasecmp(temp, "#media"))
2649
2648
    {
2650
2649
      ppdcMediaSize     *m;             // Media size
2651
2650
 
2660
2659
          sizes->add(m);
2661
2660
      }
2662
2661
    }
2663
 
    else if (!strcasecmp(temp, "#po"))
 
2662
    else if (!_cups_strcasecmp(temp, "#po"))
2664
2663
    {
2665
2664
      ppdcCatalog       *cat;           // Message catalog
2666
2665
 
2675
2674
          po_files->add(cat);
2676
2675
      }
2677
2676
    }
2678
 
    else if (!strcasecmp(temp, "Attribute") ||
2679
 
             !strcasecmp(temp, "LocAttribute"))
 
2677
    else if (!_cups_strcasecmp(temp, "Attribute") ||
 
2678
             !_cups_strcasecmp(temp, "LocAttribute"))
2680
2679
    {
2681
2680
      ppdcAttr  *a;                     // Attribute
2682
2681
 
2683
2682
 
2684
2683
      // Get an attribute...
2685
 
      a = get_attr(fp, !strcasecmp(temp, "LocAttribute"));
 
2684
      a = get_attr(fp, !_cups_strcasecmp(temp, "LocAttribute"));
2686
2685
      if (a)
2687
2686
      {
2688
2687
        if (cond_state)
2691
2690
          d->add_attr(a);
2692
2691
      }
2693
2692
    }
2694
 
    else if (!strcasecmp(temp, "Choice"))
 
2693
    else if (!_cups_strcasecmp(temp, "Choice"))
2695
2694
    {
2696
2695
      // Get a choice...
2697
2696
      c = get_choice(fp);
2709
2708
      {
2710
2709
        _cupsLangPrintf(stderr,
2711
2710
                        _("ppdc: Choice found on line %d of %s with no "
2712
 
                          "Option!\n"), fp->line, fp->filename);
 
2711
                          "Option."), fp->line, fp->filename);
2713
2712
        break;
2714
2713
      }
2715
2714
 
2718
2717
      if (isdefault)
2719
2718
        o->set_defchoice(c);
2720
2719
    }
2721
 
    else if (!strcasecmp(temp, "ColorDevice"))
 
2720
    else if (!_cups_strcasecmp(temp, "ColorDevice"))
2722
2721
    {
2723
2722
      // ColorDevice boolean
2724
2723
      if (cond_state)
2726
2725
      else
2727
2726
        d->color_device = get_boolean(fp);
2728
2727
    }
2729
 
    else if (!strcasecmp(temp, "ColorModel"))
 
2728
    else if (!_cups_strcasecmp(temp, "ColorModel"))
2730
2729
    {
2731
2730
      // Get the color model
2732
2731
      c = get_color_model(fp);
2755
2754
 
2756
2755
      o = NULL;
2757
2756
    }
2758
 
    else if (!strcasecmp(temp, "ColorProfile"))
 
2757
    else if (!_cups_strcasecmp(temp, "ColorProfile"))
2759
2758
    {
2760
2759
      ppdcProfile       *p;             // Color profile
2761
2760
 
2771
2770
          d->profiles->add(p);
2772
2771
      }
2773
2772
    }
2774
 
    else if (!strcasecmp(temp, "Copyright"))
 
2773
    else if (!_cups_strcasecmp(temp, "Copyright"))
2775
2774
    {
2776
2775
      // Copyright string
2777
2776
      char      copytemp[8192],         // Copyright string
2784
2783
      {
2785
2784
        _cupsLangPrintf(stderr,
2786
2785
                        _("ppdc: Expected string after Copyright on line %d "
2787
 
                          "of %s!\n"), fp->line, fp->filename);
 
2786
                          "of %s."), fp->line, fp->filename);
2788
2787
        break;
2789
2788
      }
2790
2789
 
2800
2799
        d->copyright->add(new ppdcString(copyptr));
2801
2800
      }
2802
2801
    }
2803
 
    else if (!strcasecmp(temp, "CustomMedia"))
 
2802
    else if (!_cups_strcasecmp(temp, "CustomMedia"))
2804
2803
    {
2805
2804
      ppdcMediaSize     *m;             // Media size
2806
2805
 
2820
2819
      if (isdefault)
2821
2820
        d->set_default_size(m);
2822
2821
    }
2823
 
    else if (!strcasecmp(temp, "Cutter"))
 
2822
    else if (!_cups_strcasecmp(temp, "Cutter"))
2824
2823
    {
2825
2824
      // Cutter boolean
2826
2825
      int       have_cutter;            // Have a paper cutter?
2847
2846
 
2848
2847
      o = NULL;
2849
2848
    }
2850
 
    else if (!strcasecmp(temp, "Darkness"))
 
2849
    else if (!_cups_strcasecmp(temp, "Darkness"))
2851
2850
    {
2852
2851
      // Get the darkness choice...
2853
2852
      c = get_generic(fp, "Darkness", NULL, "cupsCompression");
2872
2871
      {
2873
2872
        _cupsLangPrintf(stderr,
2874
2873
                        _("ppdc: Option %s defined in two different groups on "
2875
 
                          "line %d of %s!\n"), "cupsDarkness", fp->line,
 
2874
                          "line %d of %s."), "cupsDarkness", fp->line,
2876
2875
                        fp->filename);
2877
2876
        c->release();
2878
2877
        continue;
2885
2884
 
2886
2885
      o = NULL;
2887
2886
    }
2888
 
    else if (!strcasecmp(temp, "DriverType"))
 
2887
    else if (!_cups_strcasecmp(temp, "DriverType"))
2889
2888
    {
2890
2889
      int       i;                      // Looping var
2891
2890
 
2895
2894
      {
2896
2895
        _cupsLangPrintf(stderr,
2897
2896
                        _("ppdc: Expected driver type keyword following "
2898
 
                          "DriverType on line %d of %s!\n"),
 
2897
                          "DriverType on line %d of %s."),
2899
2898
                        fp->line, fp->filename);
2900
2899
        continue;
2901
2900
      }
2904
2903
        continue;
2905
2904
 
2906
2905
      for (i = 0; i < (int)(sizeof(driver_types) / sizeof(driver_types[0])); i ++)
2907
 
        if (!strcasecmp(temp, driver_types[i]))
 
2906
        if (!_cups_strcasecmp(temp, driver_types[i]))
2908
2907
          break;
2909
2908
 
2910
2909
      if (i < (int)(sizeof(driver_types) / sizeof(driver_types[0])))
2911
2910
        d->type = (ppdcDrvType)i;
2912
 
      else if (!strcasecmp(temp, "dymo"))
 
2911
      else if (!_cups_strcasecmp(temp, "dymo"))
2913
2912
        d->type = PPDC_DRIVER_LABEL;
2914
2913
      else
2915
2914
        _cupsLangPrintf(stderr,
2916
 
                        _("ppdc: Unknown driver type %s on line %d of %s!\n"),
 
2915
                        _("ppdc: Unknown driver type %s on line %d of %s."),
2917
2916
                        temp, fp->line, fp->filename);
2918
2917
    }
2919
 
    else if (!strcasecmp(temp, "Duplex"))
 
2918
    else if (!_cups_strcasecmp(temp, "Duplex"))
2920
2919
      get_duplex(fp, d);
2921
 
    else if (!strcasecmp(temp, "Filter"))
 
2920
    else if (!_cups_strcasecmp(temp, "Filter"))
2922
2921
    {
2923
2922
      ppdcFilter        *f;             // Filter
2924
2923
 
2933
2932
          d->filters->add(f);
2934
2933
      }
2935
2934
    }
2936
 
    else if (!strcasecmp(temp, "Finishing"))
 
2935
    else if (!_cups_strcasecmp(temp, "Finishing"))
2937
2936
    {
2938
2937
      // Get the finishing choice...
2939
2938
      c = get_generic(fp, "Finishing", "OutputType", NULL);
2958
2957
      {
2959
2958
        _cupsLangPrintf(stderr,
2960
2959
                        _("ppdc: Option %s defined in two different groups on "
2961
 
                          "line %d of %s!\n"), "cupsFinishing", fp->line,
 
2960
                          "line %d of %s."), "cupsFinishing", fp->line,
2962
2961
                        fp->filename);
2963
2962
        c->release();
2964
2963
        continue;
2971
2970
 
2972
2971
      o = NULL;
2973
2972
    }
2974
 
    else if (!strcasecmp(temp, "Font") ||
2975
 
             !strcasecmp(temp, "#font"))
 
2973
    else if (!_cups_strcasecmp(temp, "Font") ||
 
2974
             !_cups_strcasecmp(temp, "#font"))
2976
2975
    {
2977
2976
      ppdcFont  *f;                     // Font
2978
2977
 
2985
2984
          f->release();
2986
2985
        else
2987
2986
        {
2988
 
          if (!strcasecmp(temp, "#font"))
 
2987
          if (!_cups_strcasecmp(temp, "#font"))
2989
2988
            base_fonts->add(f);
2990
2989
          else
2991
2990
            d->add_font(f);
2995
2994
        }
2996
2995
      }
2997
2996
    }
2998
 
    else if (!strcasecmp(temp, "Group"))
 
2997
    else if (!_cups_strcasecmp(temp, "Group"))
2999
2998
    {
3000
2999
      // Get a group...
3001
3000
      ppdcGroup *tempg = get_group(fp, d);
3016
3015
        g = tempg;
3017
3016
      }
3018
3017
    }
3019
 
    else if (!strcasecmp(temp, "HWMargins"))
 
3018
    else if (!_cups_strcasecmp(temp, "HWMargins"))
3020
3019
    {
3021
3020
      // HWMargins left bottom right top
3022
3021
      d->left_margin   = get_measurement(fp);
3024
3023
      d->right_margin  = get_measurement(fp);
3025
3024
      d->top_margin    = get_measurement(fp);
3026
3025
    }
3027
 
    else if (!strcasecmp(temp, "InputSlot"))
 
3026
    else if (!_cups_strcasecmp(temp, "InputSlot"))
3028
3027
    {
3029
3028
      // Get the input slot choice...
3030
3029
      c = get_generic(fp, "InputSlot", NULL, "MediaPosition");
3038
3037
      }
3039
3038
 
3040
3039
      // Add the choice to the InputSlot option...
3041
 
      
 
3040
 
3042
3041
      if ((o = d->find_option_group("InputSlot", &mg)) == NULL)
3043
3042
      {
3044
3043
        // Create the InputSlot option...
3051
3050
      {
3052
3051
        _cupsLangPrintf(stderr,
3053
3052
                        _("ppdc: Option %s defined in two different groups on "
3054
 
                          "line %d of %s!\n"), "InputSlot", fp->line,
 
3053
                          "line %d of %s."), "InputSlot", fp->line,
3055
3054
                        fp->filename);
3056
3055
        c->release();
3057
3056
        continue;
3064
3063
 
3065
3064
      o = NULL;
3066
3065
    }
3067
 
    else if (!strcasecmp(temp, "Installable"))
 
3066
    else if (!_cups_strcasecmp(temp, "Installable"))
3068
3067
    {
3069
3068
      // Get the installable option...
3070
3069
      o = get_installable(fp);
3080
3079
        o = NULL;
3081
3080
      }
3082
3081
    }
3083
 
    else if (!strcasecmp(temp, "ManualCopies"))
 
3082
    else if (!_cups_strcasecmp(temp, "ManualCopies"))
3084
3083
    {
3085
3084
      // ManualCopies boolean
3086
3085
      if (cond_state)
3088
3087
      else
3089
3088
        d->manual_copies = get_boolean(fp);
3090
3089
    }
3091
 
    else if (!strcasecmp(temp, "Manufacturer"))
 
3090
    else if (!_cups_strcasecmp(temp, "Manufacturer"))
3092
3091
    {
3093
3092
      // Manufacturer name
3094
3093
      char      name[256];              // Model name string
3098
3097
      {
3099
3098
        _cupsLangPrintf(stderr,
3100
3099
                        _("ppdc: Expected name after Manufacturer on line %d "
3101
 
                          "of %s!\n"), fp->line, fp->filename);
 
3100
                          "of %s."), fp->line, fp->filename);
3102
3101
        break;
3103
3102
      }
3104
3103
 
3105
3104
      if (!cond_state)
3106
3105
        d->set_manufacturer(name);
3107
3106
    }
3108
 
    else if (!strcasecmp(temp, "MaxSize"))
 
3107
    else if (!_cups_strcasecmp(temp, "MaxSize"))
3109
3108
    {
3110
3109
      // MaxSize width length
3111
3110
      if (cond_state)
3119
3118
        d->max_length = get_measurement(fp);
3120
3119
      }
3121
3120
    }
3122
 
    else if (!strcasecmp(temp, "MediaSize"))
 
3121
    else if (!_cups_strcasecmp(temp, "MediaSize"))
3123
3122
    {
3124
3123
      // MediaSize keyword
3125
3124
      char              name[41];       // Media size name
3131
3130
      {
3132
3131
        _cupsLangPrintf(stderr,
3133
3132
                        _("ppdc: Expected name after MediaSize on line %d of "
3134
 
                          "%s!\n"), fp->line, fp->filename);
 
3133
                          "%s."), fp->line, fp->filename);
3135
3134
        break;
3136
3135
      }
3137
3136
 
3144
3143
      {
3145
3144
        _cupsLangPrintf(stderr,
3146
3145
                        _("ppdc: Unknown media size \"%s\" on line %d of "
3147
 
                          "%s!\n"), name, fp->line, fp->filename);
 
3146
                          "%s."), name, fp->line, fp->filename);
3148
3147
        break;
3149
3148
      }
3150
3149
 
3158
3157
      if (isdefault)
3159
3158
        d->set_default_size(dm);
3160
3159
    }
3161
 
    else if (!strcasecmp(temp, "MediaType"))
 
3160
    else if (!_cups_strcasecmp(temp, "MediaType"))
3162
3161
    {
3163
3162
      // Get the media type choice...
3164
3163
      c = get_generic(fp, "MediaType", "MediaType", "cupsMediaType");
3184
3183
      {
3185
3184
        _cupsLangPrintf(stderr,
3186
3185
                        _("ppdc: Option %s defined in two different groups on "
3187
 
                          "line %d of %s!\n"), "MediaType", fp->line,
 
3186
                          "line %d of %s."), "MediaType", fp->line,
3188
3187
                        fp->filename);
3189
3188
        c->release();
3190
3189
        continue;
3197
3196
 
3198
3197
      o = NULL;
3199
3198
    }
3200
 
    else if (!strcasecmp(temp, "MinSize"))
 
3199
    else if (!_cups_strcasecmp(temp, "MinSize"))
3201
3200
    {
3202
3201
      // MinSize width length
3203
3202
      if (cond_state)
3211
3210
        d->min_length = get_measurement(fp);
3212
3211
      }
3213
3212
    }
3214
 
    else if (!strcasecmp(temp, "ModelName"))
 
3213
    else if (!_cups_strcasecmp(temp, "ModelName"))
3215
3214
    {
3216
3215
      // ModelName name
3217
3216
      char      name[256];              // Model name string
3221
3220
      {
3222
3221
        _cupsLangPrintf(stderr,
3223
3222
                        _("ppdc: Expected name after ModelName on line %d of "
3224
 
                          "%s!\n"), fp->line, fp->filename);
 
3223
                          "%s."), fp->line, fp->filename);
3225
3224
        break;
3226
3225
      }
3227
3226
 
3228
3227
      if (!cond_state)
3229
3228
        d->set_model_name(name);
3230
3229
    }
3231
 
    else if (!strcasecmp(temp, "ModelNumber"))
 
3230
    else if (!_cups_strcasecmp(temp, "ModelNumber"))
3232
3231
    {
3233
3232
      // ModelNumber number
3234
3233
      if (cond_state)
3236
3235
      else
3237
3236
        d->model_number = get_integer(fp);
3238
3237
    }
3239
 
    else if (!strcasecmp(temp, "Option"))
 
3238
    else if (!_cups_strcasecmp(temp, "Option"))
3240
3239
    {
3241
3240
      // Get an option...
3242
3241
      ppdcOption *tempo = get_option(fp, d, g);
3257
3256
        o = tempo;
3258
3257
      }
3259
3258
    }
3260
 
    else if (!strcasecmp(temp, "FileName"))
 
3259
    else if (!_cups_strcasecmp(temp, "FileName"))
3261
3260
    {
3262
3261
      // FileName name
3263
3262
      char      name[256];              // Filename string
3267
3266
      {
3268
3267
        _cupsLangPrintf(stderr,
3269
3268
                        _("ppdc: Expected name after FileName on line %d of "
3270
 
                          "%s!\n"), fp->line, fp->filename);
 
3269
                          "%s."), fp->line, fp->filename);
3271
3270
        break;
3272
3271
      }
3273
3272
 
3274
3273
      if (!cond_state)
3275
3274
        d->set_file_name(name);
3276
3275
    }
3277
 
    else if (!strcasecmp(temp, "PCFileName"))
 
3276
    else if (!_cups_strcasecmp(temp, "PCFileName"))
3278
3277
    {
3279
3278
      // PCFileName name
3280
3279
      char      name[256];              // PC filename string
3284
3283
      {
3285
3284
        _cupsLangPrintf(stderr,
3286
3285
                        _("ppdc: Expected name after PCFileName on line %d of "
3287
 
                          "%s!\n"), fp->line, fp->filename);
 
3286
                          "%s."), fp->line, fp->filename);
3288
3287
        break;
3289
3288
      }
3290
3289
 
3291
3290
      if (!cond_state)
3292
3291
        d->set_pc_file_name(name);
3293
3292
    }
3294
 
    else if (!strcasecmp(temp, "Resolution"))
 
3293
    else if (!_cups_strcasecmp(temp, "Resolution"))
3295
3294
    {
3296
3295
      // Get the resolution choice...
3297
3296
      c = get_resolution(fp);
3317
3316
      {
3318
3317
        _cupsLangPrintf(stderr,
3319
3318
                        _("ppdc: Option %s defined in two different groups on "
3320
 
                          "line %d of %s!\n"), "Resolution", fp->line,
 
3319
                          "line %d of %s."), "Resolution", fp->line,
3321
3320
                        fp->filename);
3322
3321
        c->release();
3323
3322
        continue;
3330
3329
 
3331
3330
      o = NULL;
3332
3331
    }
3333
 
    else if (!strcasecmp(temp, "SimpleColorProfile"))
 
3332
    else if (!_cups_strcasecmp(temp, "SimpleColorProfile"))
3334
3333
    {
3335
3334
      ppdcProfile       *p;             // Color profile
3336
3335
 
3346
3345
          d->profiles->add(p);
3347
3346
      }
3348
3347
    }
3349
 
    else if (!strcasecmp(temp, "Throughput"))
 
3348
    else if (!_cups_strcasecmp(temp, "Throughput"))
3350
3349
    {
3351
3350
      // Throughput number
3352
3351
      if (cond_state)
3354
3353
      else
3355
3354
        d->throughput = get_integer(fp);
3356
3355
    }
3357
 
    else if (!strcasecmp(temp, "UIConstraints"))
 
3356
    else if (!_cups_strcasecmp(temp, "UIConstraints"))
3358
3357
    {
3359
3358
      ppdcConstraint    *con;           // Constraint
3360
3359
 
3369
3368
          d->constraints->add(con);
3370
3369
      }
3371
3370
    }
3372
 
    else if (!strcasecmp(temp, "VariablePaperSize"))
 
3371
    else if (!_cups_strcasecmp(temp, "VariablePaperSize"))
3373
3372
    {
3374
3373
      // VariablePaperSize boolean
3375
3374
      if (cond_state)
3377
3376
      else
3378
3377
        d->variable_paper_size = get_boolean(fp);
3379
3378
    }
3380
 
    else if (!strcasecmp(temp, "Version"))
 
3379
    else if (!_cups_strcasecmp(temp, "Version"))
3381
3380
    {
3382
3381
      // Version string
3383
3382
      char      name[256];              // Model name string
3387
3386
      {
3388
3387
        _cupsLangPrintf(stderr,
3389
3388
                        _("ppdc: Expected string after Version on line %d of "
3390
 
                          "%s!\n"), fp->line, fp->filename);
 
3389
                          "%s."), fp->line, fp->filename);
3391
3390
        break;
3392
3391
      }
3393
3392
 
3397
3396
    else
3398
3397
    {
3399
3398
      _cupsLangPrintf(stderr,
3400
 
                      _("ppdc: Unknown token \"%s\" seen on line %d of %s!\n"),
 
3399
                      _("ppdc: Unknown token \"%s\" seen on line %d of %s."),
3401
3400
                      temp, fp->line, fp->filename);
3402
3401
      break;
3403
3402
    }
3897
3896
 
3898
3897
 
3899
3898
//
3900
 
// End of "$Id: ppdc-source.cxx 9189 2010-06-25 19:23:10Z mike $".
 
3899
// End of "$Id: ppdc-source.cxx 9793 2011-05-20 03:49:49Z mike $".
3901
3900
//