From cda0fb3b8a7cb56045b24fd0af0ed36591b5d7eb Mon Sep 17 00:00:00 2001 From: Roger Leigh Date: Sun, 26 Oct 2008 16:17:32 +0000 Subject: Imported Upstream version 5.0.1 --- src/Makefile.in | 46 +- src/cups/Makefile.am | 38 +- src/cups/Makefile.in | 205 +- src/cups/canon.c | 155 +- src/cups/cups-genppdconfig.in | 4 +- src/cups/cups-genppdupdate.in | 253 ++- src/cups/epson.c | 159 +- src/cups/genppd.c | 1207 +++++++---- src/cups/rastertoprinter.c | 125 +- src/escputil/Makefile.in | 71 +- src/escputil/escputil.c | 4 +- src/foomatic/Makefile.in | 74 +- src/foomatic/foomatic-generator.in | 58 +- src/foomatic/foomatic-printermap | 71 +- src/foomatic/gutenprint-version.c | 4 +- src/foomatic/mk_printerlist.in | 2 +- src/foomatic/paper_sizes.c | 4 +- src/foomatic/printer_margins.c | 22 +- src/foomatic/printer_options.c | 225 +- src/foomatic/printers.c | 4 +- src/ghost/Makefile.in | 70 +- src/gimp/Makefile.in | 71 +- src/gimp2/Makefile.in | 73 +- src/gutenprintui/Makefile.in | 111 +- src/gutenprintui/gutenprintui-internal.h | 4 +- src/gutenprintui/panel.c | 99 +- src/gutenprintui/plist.c | 49 +- src/gutenprintui/printrcl.c | 1341 ++++++------ src/gutenprintui/printrcy.c | 1421 ++++++++----- src/gutenprintui/printrcy.h | 33 +- src/gutenprintui/printrcy.y | 209 +- src/gutenprintui2/Makefile.in | 132 +- src/gutenprintui2/panel.c | 104 +- src/gutenprintui2/plist.c | 65 +- src/gutenprintui2/printrcy.c | 1421 ++++++++----- src/gutenprintui2/printrcy.h | 33 +- src/gutenprintui2/printrcy.y | 209 +- src/main/Makefile.am | 12 +- src/main/Makefile.in | 155 +- src/main/bit-ops.c | 242 ++- src/main/buffer-image.c | 153 ++ src/main/canon-inks.h | 420 ++++ src/main/canon-media.h | 146 ++ src/main/canon-modes.h | 285 +++ src/main/canon-printers.h | 519 +++++ src/main/curve.c | 12 +- src/main/escp2-channels.c | 448 +++- src/main/escp2-driver.c | 45 +- src/main/escp2-inks.c | 160 +- src/main/escp2-papers.c | 585 +++++- src/main/escp2-resolutions.c | 323 ++- src/main/papers.xml | 15 +- src/main/print-canon.c | 3369 +++++++++--------------------- src/main/print-canon.h | 138 ++ src/main/print-color.c | 4 +- src/main/print-escp2-data.c | 1922 ++++++++--------- src/main/print-escp2.c | 410 +++- src/main/print-escp2.h | 175 +- src/main/print-olympus.c | 1921 ++++++++++------- src/main/print-pcl.c | 7 +- src/main/print-ps.c | 177 +- src/main/print-util.c | 30 +- src/main/print-vars.c | 315 +-- src/main/print-weave.c | 6 +- src/main/printers.c | 69 +- src/main/printers.xml | 140 +- src/main/sequence.c | 8 +- src/main/util.h | 7 +- src/main/xml.c | 27 +- src/testpattern/Makefile.in | 74 +- src/testpattern/printer_options.c | 20 +- src/testpattern/printers.c | 4 +- src/testpattern/run-testpattern-2.in | 122 +- src/testpattern/testpatterny.c | 1673 +++++++++------ src/testpattern/testpatterny.h | 33 +- src/testpattern/testpatterny.y | 14 +- 76 files changed, 13825 insertions(+), 8536 deletions(-) create mode 100644 src/main/buffer-image.c create mode 100644 src/main/canon-inks.h create mode 100644 src/main/canon-media.h create mode 100644 src/main/canon-modes.h create mode 100644 src/main/canon-printers.h create mode 100644 src/main/print-canon.h (limited to 'src') diff --git a/src/Makefile.in b/src/Makefile.in index fed1cfc..ba6f519 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -46,18 +46,17 @@ subdir = src ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ $(top_srcdir)/m4/gimp.m4 $(top_srcdir)/m4/iconv.m4 \ - $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ - $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/progtest.m4 \ - $(top_srcdir)/m4/stp.m4 $(top_srcdir)/m4/stp_cups.m4 \ - $(top_srcdir)/m4/stp_gimp.m4 $(top_srcdir)/m4/stp_option.m4 \ - $(top_srcdir)/m4/stp_release.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/isc-posix.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/stp.m4 \ + $(top_srcdir)/m4/stp_cups.m4 $(top_srcdir)/m4/stp_gimp.m4 \ + $(top_srcdir)/m4/stp_option.m4 $(top_srcdir)/m4/stp_release.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/scripts/mkinstalldirs CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = -depcomp = -am__depfiles_maybe = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ @@ -72,13 +71,18 @@ DIST_SUBDIRS = $(SUBDIRS) DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ +BUILD_CUPS_1_2_FALSE = @BUILD_CUPS_1_2_FALSE@ +BUILD_CUPS_1_2_TRUE = @BUILD_CUPS_1_2_TRUE@ BUILD_CUPS_FALSE = @BUILD_CUPS_FALSE@ +BUILD_CUPS_PPDS = @BUILD_CUPS_PPDS@ BUILD_CUPS_PPDS_FALSE = @BUILD_CUPS_PPDS_FALSE@ BUILD_CUPS_PPDS_TRUE = @BUILD_CUPS_PPDS_TRUE@ BUILD_CUPS_TRUE = @BUILD_CUPS_TRUE@ @@ -104,6 +108,8 @@ BUILD_LIBGUTENPRINTUI_FALSE = @BUILD_LIBGUTENPRINTUI_FALSE@ BUILD_LIBGUTENPRINTUI_TRUE = @BUILD_LIBGUTENPRINTUI_TRUE@ BUILD_MODULES_FALSE = @BUILD_MODULES_FALSE@ BUILD_MODULES_TRUE = @BUILD_MODULES_TRUE@ +BUILD_SIMPLIFIED_CUPS_PPDS_FALSE = @BUILD_SIMPLIFIED_CUPS_PPDS_FALSE@ +BUILD_SIMPLIFIED_CUPS_PPDS_TRUE = @BUILD_SIMPLIFIED_CUPS_PPDS_TRUE@ BUILD_TESTPATTERN_FALSE = @BUILD_TESTPATTERN_FALSE@ BUILD_TESTPATTERN_TRUE = @BUILD_TESTPATTERN_TRUE@ BUILD_TEST_FALSE = @BUILD_TEST_FALSE@ @@ -111,6 +117,7 @@ BUILD_TEST_TRUE = @BUILD_TEST_TRUE@ BUILD_TRANSLATED_CUPS_PPDS_FALSE = @BUILD_TRANSLATED_CUPS_PPDS_FALSE@ BUILD_TRANSLATED_CUPS_PPDS_TRUE = @BUILD_TRANSLATED_CUPS_PPDS_TRUE@ CC = @CC@ +CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CONVERT = @CONVERT@ CPP = @CPP@ @@ -123,12 +130,14 @@ CUPS_PPDS_AT_TOP_LEVEL_TRUE = @CUPS_PPDS_AT_TOP_LEVEL_TRUE@ CUPS_PPD_PS_LEVEL = @CUPS_PPD_PS_LEVEL@ CXX = @CXX@ CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DB2HTML = @DB2HTML@ DB2PDF = @DB2PDF@ DB2PS = @DB2PS@ DEFS = @DEFS@ +DEPDIR = @DEPDIR@ DIALOG = @DIALOG@ DOXYGEN = @DOXYGEN@ DVIPDF = @DVIPDF@ @@ -163,6 +172,7 @@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GMSGFMT = @GMSGFMT@ GNUCFLAGS = @GNUCFLAGS@ +GREP = @GREP@ GTK2_CFLAGS = @GTK2_CFLAGS@ GTK2_LIBS = @GTK2_LIBS@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -258,14 +268,17 @@ VERSION = @VERSION@ WHICH_PPDS = @WHICH_PPDS@ XGETTEXT = @XGETTEXT@ YACC = @YACC@ -ac_ct_AR = @ac_ct_AR@ +YFLAGS = @YFLAGS@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ @@ -282,6 +295,9 @@ cups_exec_prefix = @cups_exec_prefix@ cups_prefix = @cups_prefix@ cups_sbindir = @cups_sbindir@ datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ exec_prefix = @exec_prefix@ gimp2_plug_indir = @gimp2_plug_indir@ gimp_plug_indir = @gimp_plug_indir@ @@ -299,17 +315,21 @@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ +htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ +localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ +psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ @@ -340,9 +360,9 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu --ignore-deps src/Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \ cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu --ignore-deps src/Makefile + $(AUTOMAKE) --gnu src/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ diff --git a/src/cups/Makefile.am b/src/cups/Makefile.am index 011bd07..8b99888 100644 --- a/src/cups/Makefile.am +++ b/src/cups/Makefile.am @@ -1,4 +1,4 @@ -## $Id: Makefile.am,v 1.87 2006/05/14 16:46:03 rlk Exp $ +## $Id: Makefile.am,v 1.87.8.2 2007/05/29 01:47:26 rlk Exp $ ## Copyright (C) 2000 Roger Leigh ## ## This program is free software; you can redistribute it and/or modify @@ -35,6 +35,7 @@ pkglibdir = $(cups_conf_serverbin) pkgsysconfdir = $(cups_conf_serverroot) cupsexec_backenddir = $(pkglibdir)/backend +cupsexec_driverdir = $(pkglibdir)/driver cupsexec_filterdir = $(pkglibdir)/filter if CUPS_PPDS_AT_TOP_LEVEL cups_modeldir = $(pkgdatadir)/model/ @@ -51,6 +52,20 @@ TESTS= test-ppds ## Programs +if BUILD_TRANSLATED_CUPS_PPDS +PPD_NLS = $(PPD_NLS_1) +LINGUAS = $(ALL_LINGUAS) +TRANSLATE_PPDS = -DCUPS_TRANSLATED_PPDS +endif + +if BUILD_SIMPLIFIED_CUPS_PPDS +BUILD_SIMPLE_PPDS=-DGENERATE_SIMPLIFIED_PPDS +endif + +if BUILD_CUPS_1_2 +cupsexec_driver_PROGRAMS = gutenprint.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@ +endif + if BUILD_CUPS bin_PROGRAMS = cups-calibrate sbin_PROGRAMS = cups-genppd.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@ @@ -66,6 +81,9 @@ endif cups_calibrate_SOURCES = cups-calibrate.c cups_calibrate_LDADD = -lm +commandtocanon_SOURCES = commandtocanon.c +commandtocanon_LDADD = $(CUPS_LIBS) + commandtoepson_SOURCES = commandtoepson.c commandtoepson_LDADD = $(CUPS_LIBS) @@ -76,9 +94,15 @@ epson_SOURCES = epson.c epson_LDADD = $(CUPS_LIBS) cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_SOURCES = genppd.c +cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_CFLAGS = -DALL_LINGUAS='"@ALL_LINGUAS@"' $(BUILD_SIMPLE_PPDS) $(TRANSLATE_PPDS) cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_LDADD = $(CUPS_LIBS) $(GENPPD_LIBS) $(GUTENPRINT_LIBS) cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_LDFLAGS = $(STATIC_LDOPTS) +gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_SOURCES = genppd.c +gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_CFLAGS = -DCUPS_DRIVER_INTERFACE -DALL_LINGUAS='"@ALL_LINGUAS@"' $(BUILD_SIMPLE_PPDS) $(TRANSLATE_PPDS) +gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_LDADD = $(CUPS_LIBS) $(GUTENPRINT_LIBS) +gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_LDFLAGS = $(STATIC_LDOPTS) + rastertogutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_SOURCES = rastertoprinter.c rastertogutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_LDADD = $(CUPS_LIBS) $(GUTENPRINT_LIBS) rastertogutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_LDFLAGS = $(STATIC_LDOPTS) @@ -104,11 +128,6 @@ if BUILD_CUPS_PPDS INSTALL_DATA_LOCAL_DEPS = ppd-stamp endif -if BUILD_TRANSLATED_CUPS_PPDS -PPD_NLS = $(PPD_NLS_1) -LINGUAS = $(ALL_LINGUAS) -endif - if USE_NLS PPD_NLS_1 = ppd-nls endif @@ -117,7 +136,7 @@ endif ## Rules install-data-local: $(INSTALL_DATA_LOCAL_DEPS) - if test -n "$(INSTALL_DATA_LOCAL_DEPS)" ; then \ + if test -n "$(CUPS_PKG)" -a -n "$(INSTALL_DATA_LOCAL_DEPS)" ; then \ $(mkdir_p) $(DESTDIR)$(cups_modeldir); \ cd ppd ; \ for language in * ; do \ @@ -146,6 +165,7 @@ install-data-hook: -rmdir $(DESTDIR)$(cups_modeldir) -rmdir $(DESTDIR)$(pkgdatadir) -rmdir $(DESTDIR)$(cupsexec_backenddir) + -rmdir $(DESTDIR)$(cupsexec_driverdir) -rmdir $(DESTDIR)$(cupsexec_filterdir) -rmdir $(DESTDIR)$(bindir) -rmdir $(DESTDIR)$(pkglibdir) @@ -174,7 +194,7 @@ ppd-nonls: cups-genppd.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@ for language in C ; do \ mkdir ppd/$$language ; \ echo "$$language:" ; \ - LANGUAGE=$$language $(STP_ENV) ./cups-genppd.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@ @WHICH_PPDS@ -p ppd/$$language ; \ + LC_ALL=$$language LANG=$$language LANGUAGE=$$language $(STP_ENV) ./cups-genppd.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@ @WHICH_PPDS@ -p ppd/$$language ; \ done ppd-nls: cups-genppd.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@ @@ -185,7 +205,7 @@ ppd-nls: cups-genppd.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@ for language in `$(STP_ENV) ./cups-genppd.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@ -L -c \`pwd\`/catalog/share/locale` ; do \ mkdir ppd/$$language ; \ echo "$$language:" ; \ - LANGUAGE=$$language $(STP_ENV) ./cups-genppd.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@ @WHICH_PPDS@ -p ppd/$$language -c `pwd`/catalog/share/locale ; \ + LC_ALL=$$language LANG=$$language LANGUAGE=$$language $(STP_ENV) ./cups-genppd.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@ @WHICH_PPDS@ -l $$language -p ppd/$$language -c `pwd`/catalog/share/locale ; \ done $(RM) -r catalog diff --git a/src/cups/Makefile.in b/src/cups/Makefile.in index 848dee5..e1f7f29 100644 --- a/src/cups/Makefile.in +++ b/src/cups/Makefile.in @@ -44,6 +44,7 @@ host_triplet = @host@ DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/cups-genppdconfig.in $(srcdir)/cups-genppdupdate.in \ $(top_srcdir)/scripts/global.mk COPYING +@BUILD_CUPS_1_2_TRUE@cupsexec_driver_PROGRAMS = gutenprint.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@$(EXEEXT) @BUILD_CUPS_TRUE@bin_PROGRAMS = cups-calibrate$(EXEEXT) @BUILD_CUPS_TRUE@sbin_PROGRAMS = cups-genppd.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@$(EXEEXT) @BUILD_CUPS_TRUE@cupsexec_backend_PROGRAMS = epson$(EXEEXT) \ @@ -55,11 +56,12 @@ subdir = src/cups ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ $(top_srcdir)/m4/gimp.m4 $(top_srcdir)/m4/iconv.m4 \ - $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ - $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/progtest.m4 \ - $(top_srcdir)/m4/stp.m4 $(top_srcdir)/m4/stp_cups.m4 \ - $(top_srcdir)/m4/stp_gimp.m4 $(top_srcdir)/m4/stp_option.m4 \ - $(top_srcdir)/m4/stp_release.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/isc-posix.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/stp.m4 \ + $(top_srcdir)/m4/stp_cups.m4 $(top_srcdir)/m4/stp_gimp.m4 \ + $(top_srcdir)/m4/stp_option.m4 $(top_srcdir)/m4/stp_release.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/scripts/mkinstalldirs @@ -67,30 +69,32 @@ CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = cups-genppdconfig cups-genppdupdate am__installdirs = "$(DESTDIR)$(bindir)" \ "$(DESTDIR)$(cupsexec_backenddir)" \ + "$(DESTDIR)$(cupsexec_driverdir)" \ "$(DESTDIR)$(cupsexec_filterdir)" "$(DESTDIR)$(sbindir)" \ "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(pkgdatadir)" \ "$(DESTDIR)$(pkgsysconfdir)" binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) cupsexec_backendPROGRAMS_INSTALL = $(INSTALL_PROGRAM) +cupsexec_driverPROGRAMS_INSTALL = $(INSTALL_PROGRAM) cupsexec_filterPROGRAMS_INSTALL = $(INSTALL_PROGRAM) sbinPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(bin_PROGRAMS) $(cupsexec_backend_PROGRAMS) \ - $(cupsexec_filter_PROGRAMS) $(sbin_PROGRAMS) + $(cupsexec_driver_PROGRAMS) $(cupsexec_filter_PROGRAMS) \ + $(sbin_PROGRAMS) am_canon_OBJECTS = canon.$(OBJEXT) canon_OBJECTS = $(am_canon_OBJECTS) am__DEPENDENCIES_1 = canon_DEPENDENCIES = $(am__DEPENDENCIES_1) -commandtocanon_SOURCES = commandtocanon.c -commandtocanon_OBJECTS = commandtocanon.$(OBJEXT) -commandtocanon_LDADD = $(LDADD) +am_commandtocanon_OBJECTS = commandtocanon.$(OBJEXT) +commandtocanon_OBJECTS = $(am_commandtocanon_OBJECTS) +commandtocanon_DEPENDENCIES = $(am__DEPENDENCIES_1) am_commandtoepson_OBJECTS = commandtoepson.$(OBJEXT) commandtoepson_OBJECTS = $(am_commandtoepson_OBJECTS) commandtoepson_DEPENDENCIES = $(am__DEPENDENCIES_1) am_cups_calibrate_OBJECTS = cups-calibrate.$(OBJEXT) cups_calibrate_OBJECTS = $(am_cups_calibrate_OBJECTS) cups_calibrate_DEPENDENCIES = -am_cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_OBJECTS = \ - genppd.$(OBJEXT) +am_cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_OBJECTS = cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-genppd.$(OBJEXT) cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_OBJECTS = $(am_cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_OBJECTS) am__DEPENDENCIES_2 = $(top_builddir)/src/main/libgutenprint.la cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_DEPENDENCIES = \ @@ -99,6 +103,10 @@ cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_DEPENDENCIES = am_epson_OBJECTS = epson.$(OBJEXT) epson_OBJECTS = $(am_epson_OBJECTS) epson_DEPENDENCIES = $(am__DEPENDENCIES_1) +am_gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_OBJECTS = gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-genppd.$(OBJEXT) +gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_OBJECTS = $(am_gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_OBJECTS) +gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_DEPENDENCIES = \ + $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) am_rastertogutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_OBJECTS = \ rastertoprinter.$(OBJEXT) rastertogutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_OBJECTS = $(am_rastertogutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_OBJECTS) @@ -107,8 +115,8 @@ rastertogutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_DEPENDE sbinSCRIPT_INSTALL = $(INSTALL_SCRIPT) SCRIPTS = $(sbin_SCRIPTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -depcomp = -am__depfiles_maybe = +depcomp = $(SHELL) $(top_srcdir)/scripts/depcomp +am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ @@ -117,15 +125,17 @@ LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ -SOURCES = $(canon_SOURCES) commandtocanon.c $(commandtoepson_SOURCES) \ - $(cups_calibrate_SOURCES) \ +SOURCES = $(canon_SOURCES) $(commandtocanon_SOURCES) \ + $(commandtoepson_SOURCES) $(cups_calibrate_SOURCES) \ $(cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_SOURCES) \ $(epson_SOURCES) \ + $(gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_SOURCES) \ $(rastertogutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_SOURCES) -DIST_SOURCES = $(canon_SOURCES) commandtocanon.c \ +DIST_SOURCES = $(canon_SOURCES) $(commandtocanon_SOURCES) \ $(commandtoepson_SOURCES) $(cups_calibrate_SOURCES) \ $(cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_SOURCES) \ $(epson_SOURCES) \ + $(gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_SOURCES) \ $(rastertogutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_SOURCES) am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ @@ -143,13 +153,18 @@ pkgdatadir = $(cups_conf_datadir) pkglibdir = $(cups_conf_serverbin) ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ +BUILD_CUPS_1_2_FALSE = @BUILD_CUPS_1_2_FALSE@ +BUILD_CUPS_1_2_TRUE = @BUILD_CUPS_1_2_TRUE@ BUILD_CUPS_FALSE = @BUILD_CUPS_FALSE@ +BUILD_CUPS_PPDS = @BUILD_CUPS_PPDS@ BUILD_CUPS_PPDS_FALSE = @BUILD_CUPS_PPDS_FALSE@ BUILD_CUPS_PPDS_TRUE = @BUILD_CUPS_PPDS_TRUE@ BUILD_CUPS_TRUE = @BUILD_CUPS_TRUE@ @@ -175,6 +190,8 @@ BUILD_LIBGUTENPRINTUI_FALSE = @BUILD_LIBGUTENPRINTUI_FALSE@ BUILD_LIBGUTENPRINTUI_TRUE = @BUILD_LIBGUTENPRINTUI_TRUE@ BUILD_MODULES_FALSE = @BUILD_MODULES_FALSE@ BUILD_MODULES_TRUE = @BUILD_MODULES_TRUE@ +BUILD_SIMPLIFIED_CUPS_PPDS_FALSE = @BUILD_SIMPLIFIED_CUPS_PPDS_FALSE@ +BUILD_SIMPLIFIED_CUPS_PPDS_TRUE = @BUILD_SIMPLIFIED_CUPS_PPDS_TRUE@ BUILD_TESTPATTERN_FALSE = @BUILD_TESTPATTERN_FALSE@ BUILD_TESTPATTERN_TRUE = @BUILD_TESTPATTERN_TRUE@ BUILD_TEST_FALSE = @BUILD_TEST_FALSE@ @@ -182,6 +199,7 @@ BUILD_TEST_TRUE = @BUILD_TEST_TRUE@ BUILD_TRANSLATED_CUPS_PPDS_FALSE = @BUILD_TRANSLATED_CUPS_PPDS_FALSE@ BUILD_TRANSLATED_CUPS_PPDS_TRUE = @BUILD_TRANSLATED_CUPS_PPDS_TRUE@ CC = @CC@ +CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CONVERT = @CONVERT@ CPP = @CPP@ @@ -194,12 +212,14 @@ CUPS_PPDS_AT_TOP_LEVEL_TRUE = @CUPS_PPDS_AT_TOP_LEVEL_TRUE@ CUPS_PPD_PS_LEVEL = @CUPS_PPD_PS_LEVEL@ CXX = @CXX@ CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DB2HTML = @DB2HTML@ DB2PDF = @DB2PDF@ DB2PS = @DB2PS@ DEFS = @DEFS@ +DEPDIR = @DEPDIR@ DIALOG = @DIALOG@ DOXYGEN = @DOXYGEN@ DVIPDF = @DVIPDF@ @@ -234,6 +254,7 @@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GMSGFMT = @GMSGFMT@ GNUCFLAGS = @GNUCFLAGS@ +GREP = @GREP@ GTK2_CFLAGS = @GTK2_CFLAGS@ GTK2_LIBS = @GTK2_LIBS@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -329,14 +350,17 @@ VERSION = @VERSION@ WHICH_PPDS = @WHICH_PPDS@ XGETTEXT = @XGETTEXT@ YACC = @YACC@ -ac_ct_AR = @ac_ct_AR@ +YFLAGS = @YFLAGS@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @cups_bindir@ @@ -353,6 +377,9 @@ cups_exec_prefix = @cups_exec_prefix@ cups_prefix = @cups_prefix@ cups_sbindir = @cups_sbindir@ datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ exec_prefix = @exec_prefix@ gimp2_plug_indir = @gimp2_plug_indir@ gimp_plug_indir = @gimp_plug_indir@ @@ -370,17 +397,21 @@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ +htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ +localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ +psdir = @psdir@ sbindir = @cups_sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ @@ -389,6 +420,7 @@ AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include $(LOCAL_CPPFLAGS empty = pkgsysconfdir = $(cups_conf_serverroot) cupsexec_backenddir = $(pkglibdir)/backend +cupsexec_driverdir = $(pkglibdir)/driver cupsexec_filterdir = $(pkglibdir)/filter @CUPS_PPDS_AT_TOP_LEVEL_FALSE@cups_modeldir = $(pkgdatadir)/model/gutenprint/@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@/ @CUPS_PPDS_AT_TOP_LEVEL_TRUE@cups_modeldir = $(pkgdatadir)/model/ @@ -396,10 +428,16 @@ cupsexec_filterdir = $(pkglibdir)/filter LOCAL_CPPFLAGS = $(GUTENPRINT_CFLAGS) $(CUPS_CFLAGS) STP_ENV = STP_MODULE_PATH=$(top_builddir)/src/main/.libs:$(top_builddir)/src/main STP_DATA_PATH=$(top_srcdir)/src/main TESTS = test-ppds +@BUILD_TRANSLATED_CUPS_PPDS_TRUE@PPD_NLS = $(PPD_NLS_1) +@BUILD_TRANSLATED_CUPS_PPDS_TRUE@LINGUAS = $(ALL_LINGUAS) +@BUILD_TRANSLATED_CUPS_PPDS_TRUE@TRANSLATE_PPDS = -DCUPS_TRANSLATED_PPDS +@BUILD_SIMPLIFIED_CUPS_PPDS_TRUE@BUILD_SIMPLE_PPDS = -DGENERATE_SIMPLIFIED_PPDS @BUILD_CUPS_TRUE@sbin_SCRIPTS = cups-genppdconfig.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@ cups-genppdupdate.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@ @BUILD_GENPPD_STATIC_TRUE@STATIC_LDOPTS = -static -export-dynamic cups_calibrate_SOURCES = cups-calibrate.c cups_calibrate_LDADD = -lm +commandtocanon_SOURCES = commandtocanon.c +commandtocanon_LDADD = $(CUPS_LIBS) commandtoepson_SOURCES = commandtoepson.c commandtoepson_LDADD = $(CUPS_LIBS) canon_SOURCES = canon.c @@ -407,8 +445,13 @@ canon_LDADD = $(CUPS_LIBS) epson_SOURCES = epson.c epson_LDADD = $(CUPS_LIBS) cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_SOURCES = genppd.c +cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_CFLAGS = -DALL_LINGUAS='"@ALL_LINGUAS@"' $(BUILD_SIMPLE_PPDS) $(TRANSLATE_PPDS) cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_LDADD = $(CUPS_LIBS) $(GENPPD_LIBS) $(GUTENPRINT_LIBS) cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_LDFLAGS = $(STATIC_LDOPTS) +gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_SOURCES = genppd.c +gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_CFLAGS = -DCUPS_DRIVER_INTERFACE -DALL_LINGUAS='"@ALL_LINGUAS@"' $(BUILD_SIMPLE_PPDS) $(TRANSLATE_PPDS) +gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_LDADD = $(CUPS_LIBS) $(GUTENPRINT_LIBS) +gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_LDFLAGS = $(STATIC_LDOPTS) rastertogutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_SOURCES = rastertoprinter.c rastertogutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_LDADD = $(CUPS_LIBS) $(GUTENPRINT_LIBS) rastertogutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_LDFLAGS = $(STATIC_LDOPTS) @@ -417,8 +460,6 @@ rastertogutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_LDFLAGS pkgdata_DATA = $(CUPS_PKG) pkgsysconf_DATA = $(CUPS_CONF) @BUILD_CUPS_PPDS_TRUE@INSTALL_DATA_LOCAL_DEPS = ppd-stamp -@BUILD_TRANSLATED_CUPS_PPDS_TRUE@PPD_NLS = $(PPD_NLS_1) -@BUILD_TRANSLATED_CUPS_PPDS_TRUE@LINGUAS = $(ALL_LINGUAS) @USE_NLS_TRUE@PPD_NLS_1 = ppd-nls CLEANFILES = ppd-stamp DISTCLEANFILES = cups-genppdconfig.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@ cups-genppdupdate.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@ @@ -444,9 +485,9 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu --ignore-deps src/cups/Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/cups/Makefile'; \ cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu --ignore-deps src/cups/Makefile + $(AUTOMAKE) --gnu src/cups/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ @@ -524,6 +565,34 @@ clean-cupsexec_backendPROGRAMS: echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done +install-cupsexec_driverPROGRAMS: $(cupsexec_driver_PROGRAMS) + @$(NORMAL_INSTALL) + test -z "$(cupsexec_driverdir)" || $(mkdir_p) "$(DESTDIR)$(cupsexec_driverdir)" + @list='$(cupsexec_driver_PROGRAMS)'; for p in $$list; do \ + p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + if test -f $$p \ + || test -f $$p1 \ + ; then \ + f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(cupsexec_driverPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(cupsexec_driverdir)/$$f'"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(cupsexec_driverPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(cupsexec_driverdir)/$$f" || exit 1; \ + else :; fi; \ + done + +uninstall-cupsexec_driverPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(cupsexec_driver_PROGRAMS)'; for p in $$list; do \ + f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ + echo " rm -f '$(DESTDIR)$(cupsexec_driverdir)/$$f'"; \ + rm -f "$(DESTDIR)$(cupsexec_driverdir)/$$f"; \ + done + +clean-cupsexec_driverPROGRAMS: + @list='$(cupsexec_driver_PROGRAMS)'; for p in $$list; do \ + f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f $$p $$f"; \ + rm -f $$p $$f ; \ + done install-cupsexec_filterPROGRAMS: $(cupsexec_filter_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(cupsexec_filterdir)" || $(mkdir_p) "$(DESTDIR)$(cupsexec_filterdir)" @@ -598,6 +667,9 @@ cups-genppd.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@$(EXEEXT): $(cu epson$(EXEEXT): $(epson_OBJECTS) $(epson_DEPENDENCIES) @rm -f epson$(EXEEXT) $(LINK) $(epson_LDFLAGS) $(epson_OBJECTS) $(epson_LDADD) $(LIBS) +gutenprint.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@$(EXEEXT): $(gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_OBJECTS) $(gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_DEPENDENCIES) + @rm -f gutenprint.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@$(EXEEXT) + $(LINK) $(gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_LDFLAGS) $(gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_OBJECTS) $(gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_LDADD) $(LIBS) rastertogutenprint.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@$(EXEEXT): $(rastertogutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_OBJECTS) $(rastertogutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_DEPENDENCIES) @rm -f rastertogutenprint.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@$(EXEEXT) $(LINK) $(rastertogutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_LDFLAGS) $(rastertogutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_OBJECTS) $(rastertogutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_LDADD) $(LIBS) @@ -627,14 +699,63 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/canon.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/commandtocanon.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/commandtoepson.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cups-calibrate.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-genppd.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/epson.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-genppd.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/rastertoprinter.Po@am__quote@ + .c.o: - $(COMPILE) -c $< +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: - $(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: - $(LTCOMPILE) -c -o $@ $< +@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< + +cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-genppd.o: genppd.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_CFLAGS) $(CFLAGS) -MT cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-genppd.o -MD -MP -MF "$(DEPDIR)/cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-genppd.Tpo" -c -o cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-genppd.o `test -f 'genppd.c' || echo '$(srcdir)/'`genppd.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-genppd.Tpo" "$(DEPDIR)/cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-genppd.Po"; else rm -f "$(DEPDIR)/cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-genppd.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='genppd.c' object='cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-genppd.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_CFLAGS) $(CFLAGS) -c -o cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-genppd.o `test -f 'genppd.c' || echo '$(srcdir)/'`genppd.c + +cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-genppd.obj: genppd.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_CFLAGS) $(CFLAGS) -MT cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-genppd.obj -MD -MP -MF "$(DEPDIR)/cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-genppd.Tpo" -c -o cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-genppd.obj `if test -f 'genppd.c'; then $(CYGPATH_W) 'genppd.c'; else $(CYGPATH_W) '$(srcdir)/genppd.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-genppd.Tpo" "$(DEPDIR)/cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-genppd.Po"; else rm -f "$(DEPDIR)/cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-genppd.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='genppd.c' object='cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-genppd.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_CFLAGS) $(CFLAGS) -c -o cups_genppd_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-genppd.obj `if test -f 'genppd.c'; then $(CYGPATH_W) 'genppd.c'; else $(CYGPATH_W) '$(srcdir)/genppd.c'; fi` + +gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-genppd.o: genppd.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_CFLAGS) $(CFLAGS) -MT gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-genppd.o -MD -MP -MF "$(DEPDIR)/gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-genppd.Tpo" -c -o gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-genppd.o `test -f 'genppd.c' || echo '$(srcdir)/'`genppd.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-genppd.Tpo" "$(DEPDIR)/gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-genppd.Po"; else rm -f "$(DEPDIR)/gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-genppd.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='genppd.c' object='gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-genppd.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_CFLAGS) $(CFLAGS) -c -o gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-genppd.o `test -f 'genppd.c' || echo '$(srcdir)/'`genppd.c + +gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-genppd.obj: genppd.c +@am__fastdepCC_TRUE@ if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_CFLAGS) $(CFLAGS) -MT gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-genppd.obj -MD -MP -MF "$(DEPDIR)/gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-genppd.Tpo" -c -o gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-genppd.obj `if test -f 'genppd.c'; then $(CYGPATH_W) 'genppd.c'; else $(CYGPATH_W) '$(srcdir)/genppd.c'; fi`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-genppd.Tpo" "$(DEPDIR)/gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-genppd.Po"; else rm -f "$(DEPDIR)/gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-genppd.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='genppd.c' object='gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-genppd.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@_CFLAGS) $(CFLAGS) -c -o gutenprint_@GUTENPRINT_MAJOR_VERSION@_@GUTENPRINT_MINOR_VERSION@-genppd.obj `if test -f 'genppd.c'; then $(CYGPATH_W) 'genppd.c'; else $(CYGPATH_W) '$(srcdir)/genppd.c'; fi` mostlyclean-libtool: -rm -f *.lo @@ -837,7 +958,7 @@ check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) $(SCRIPTS) $(DATA) all-local installdirs: - for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(cupsexec_backenddir)" "$(DESTDIR)$(cupsexec_filterdir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(pkgdatadir)" "$(DESTDIR)$(pkgsysconfdir)"; do \ + for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(cupsexec_backenddir)" "$(DESTDIR)$(cupsexec_driverdir)" "$(DESTDIR)$(cupsexec_filterdir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(pkgdatadir)" "$(DESTDIR)$(pkgsysconfdir)"; do \ test -z "$$dir" || $(mkdir_p) "$$dir"; \ done install: install-am @@ -870,10 +991,12 @@ maintainer-clean-generic: clean: clean-am clean-am: clean-binPROGRAMS clean-cupsexec_backendPROGRAMS \ - clean-cupsexec_filterPROGRAMS clean-generic clean-libtool \ - clean-local clean-sbinPROGRAMS mostlyclean-am + clean-cupsexec_driverPROGRAMS clean-cupsexec_filterPROGRAMS \ + clean-generic clean-libtool clean-local clean-sbinPROGRAMS \ + mostlyclean-am distclean: distclean-am + -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags @@ -894,6 +1017,7 @@ install-data-am: install-data-local install-pkgdataDATA \ $(MAKE) $(AM_MAKEFLAGS) install-data-hook install-exec-am: install-binPROGRAMS install-cupsexec_backendPROGRAMS \ + install-cupsexec_driverPROGRAMS \ install-cupsexec_filterPROGRAMS install-sbinPROGRAMS \ install-sbinSCRIPTS @@ -904,6 +1028,7 @@ install-man: installcheck-am: maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic @@ -921,18 +1046,20 @@ ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-cupsexec_backendPROGRAMS \ + uninstall-cupsexec_driverPROGRAMS \ uninstall-cupsexec_filterPROGRAMS uninstall-info-am \ uninstall-local uninstall-pkgdataDATA uninstall-pkgsysconfDATA \ uninstall-sbinPROGRAMS uninstall-sbinSCRIPTS .PHONY: CTAGS GTAGS all all-am all-local check check-TESTS check-am \ clean clean-binPROGRAMS clean-cupsexec_backendPROGRAMS \ - clean-cupsexec_filterPROGRAMS clean-generic clean-libtool \ - clean-local clean-sbinPROGRAMS ctags dist-hook distclean \ - distclean-compile distclean-generic distclean-libtool \ - distclean-tags distdir dvi dvi-am html html-am info info-am \ - install install-am install-binPROGRAMS \ + clean-cupsexec_driverPROGRAMS clean-cupsexec_filterPROGRAMS \ + clean-generic clean-libtool clean-local clean-sbinPROGRAMS \ + ctags dist-hook distclean distclean-compile distclean-generic \ + distclean-libtool distclean-tags distdir dvi dvi-am html \ + html-am info info-am install install-am install-binPROGRAMS \ install-cupsexec_backendPROGRAMS \ + install-cupsexec_driverPROGRAMS \ install-cupsexec_filterPROGRAMS install-data install-data-am \ install-data-hook install-data-local install-exec \ install-exec-am install-info install-info-am install-man \ @@ -943,6 +1070,7 @@ uninstall-am: uninstall-binPROGRAMS uninstall-cupsexec_backendPROGRAMS \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ tags uninstall uninstall-am uninstall-binPROGRAMS \ uninstall-cupsexec_backendPROGRAMS \ + uninstall-cupsexec_driverPROGRAMS \ uninstall-cupsexec_filterPROGRAMS uninstall-info-am \ uninstall-local uninstall-pkgdataDATA uninstall-pkgsysconfDATA \ uninstall-sbinPROGRAMS uninstall-sbinSCRIPTS @@ -970,7 +1098,7 @@ cups-genppdupdate.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@: $(top_b cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/cups-genppdupdate install-data-local: $(INSTALL_DATA_LOCAL_DEPS) - if test -n "$(INSTALL_DATA_LOCAL_DEPS)" ; then \ + if test -n "$(CUPS_PKG)" -a -n "$(INSTALL_DATA_LOCAL_DEPS)" ; then \ $(mkdir_p) $(DESTDIR)$(cups_modeldir); \ cd ppd ; \ for language in * ; do \ @@ -999,6 +1127,7 @@ install-data-hook: -rmdir $(DESTDIR)$(cups_modeldir) -rmdir $(DESTDIR)$(pkgdatadir) -rmdir $(DESTDIR)$(cupsexec_backenddir) + -rmdir $(DESTDIR)$(cupsexec_driverdir) -rmdir $(DESTDIR)$(cupsexec_filterdir) -rmdir $(DESTDIR)$(bindir) -rmdir $(DESTDIR)$(pkglibdir) @@ -1027,7 +1156,7 @@ ppd-nonls: cups-genppd.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@ for language in C ; do \ mkdir ppd/$$language ; \ echo "$$language:" ; \ - LANGUAGE=$$language $(STP_ENV) ./cups-genppd.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@ @WHICH_PPDS@ -p ppd/$$language ; \ + LC_ALL=$$language LANG=$$language LANGUAGE=$$language $(STP_ENV) ./cups-genppd.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@ @WHICH_PPDS@ -p ppd/$$language ; \ done ppd-nls: cups-genppd.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@ @@ -1038,7 +1167,7 @@ ppd-nls: cups-genppd.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@ for language in `$(STP_ENV) ./cups-genppd.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@ -L -c \`pwd\`/catalog/share/locale` ; do \ mkdir ppd/$$language ; \ echo "$$language:" ; \ - LANGUAGE=$$language $(STP_ENV) ./cups-genppd.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@ @WHICH_PPDS@ -p ppd/$$language -c `pwd`/catalog/share/locale ; \ + LC_ALL=$$language LANG=$$language LANGUAGE=$$language $(STP_ENV) ./cups-genppd.@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@ @WHICH_PPDS@ -l $$language -p ppd/$$language -c `pwd`/catalog/share/locale ; \ done $(RM) -r catalog diff --git a/src/cups/canon.c b/src/cups/canon.c index 963d446..25c235e 100644 --- a/src/cups/canon.c +++ b/src/cups/canon.c @@ -35,6 +35,14 @@ # include #endif /* WIN32 || __EMX__ */ +#ifdef __linux +# include +# include +# include +# include +# include +#endif /* __linux */ + #ifdef __sgi # include # ifndef INV_EPP_ECP_PLP @@ -439,6 +447,7 @@ list_devices(void) int fd; /* File descriptor */ char device[255]; /* Device filename */ FILE *probe; /* /proc/parport/n/autoprobe file */ + DIR *dirprobe; /* scan /sys/bus/usb/drivers/usblp */ char line[1024], /* Line from file */ *delim, /* Delimiter in file */ make[IPP_MAX_NAME], /* Make from file */ @@ -451,12 +460,17 @@ list_devices(void) for (i = 0; i < 4; i ++) { - sprintf(device, "/proc/parport/%d/autoprobe", i); - if ((probe = fopen(device, "r")) != NULL) + sprintf(device, "/proc/sys/dev/parport/parport%d/autoprobe", i); + probe = fopen(device, "r"); + if ( probe == NULL ) /* older kernel versions */ + { + sprintf(device, "/proc/parport/%d/autoprobe", i); + probe = fopen(device, "r"); + } + if ( probe != NULL ) { memset(make, 0, sizeof(make)); memset(model, 0, sizeof(model)); - strcpy(model, "CANON"); while (fgets(line, sizeof(line), probe) != NULL) { @@ -474,17 +488,17 @@ list_devices(void) */ if (strncmp(line, "MODEL:", 6) == 0 && - strncmp(line, "MODEL:CANON", 13) != 0) + strncmp(line, "MODEL:Unknown", 13) != 0) strncpy(model, line + 6, sizeof(model) - 1); else if (strncmp(line, "MANUFACTURER:", 13) == 0 && - strncmp(line, "MANUFACTURER:CANON", 20) != 0) + strncmp(line, "MANUFACTURER:Unknown", 20) != 0) strncpy(make, line + 13, sizeof(make) - 1); } fclose(probe); - if (strcmp(make, "CANON") == 0) - printf("direct canon:/dev/lp%d \"%s %s\" \"Parallel Port #%d\"\n", + if (strcasecmp(make, "CANON") == 0) + printf("direct canon:/dev/lp%d \"%s %s\" \"Gutenprint Parallel Port #%d\"\n", i, make, model, i + 1); } else @@ -493,7 +507,7 @@ list_devices(void) if ((fd = open(device, O_RDWR)) >= 0) { close(fd); - printf("direct canon:%s \"CANON\" \"Parallel Port #%d\"\n", device, i + 1); + printf("direct canon:%s \"CANON\" \"Gutenprint Parallel Port #%d\"\n", device, i + 1); } } } @@ -502,7 +516,110 @@ list_devices(void) * Probe for USB devices... */ - if ((probe = fopen("/proc/bus/usb/devices", "r")) != NULL) + if ((dirprobe = opendir("/sys/class/usb")) != NULL) /* SYSFS in kernel 2.6 */ + { + struct dirent *dirent; /* directory entries */ + struct stat statbuf; /* file stat */ + char entry[MAXPATHLEN]; /* pathname to usb entries */ + char link[MAXPATHLEN]; /* linkname of usb entries */ + char *cptr; /* multi used character pointer */ + FILE *file; /* read printer specific info from */ + + i = 0; + /* scan the directory entries */ + while((dirent = readdir(dirprobe)) != 0) + { + /* skip "." and ".." */ + if (dirent->d_name[0] != 'l' || dirent->d_name[1] != 'p') + continue; + + /* generate path to work with */ + snprintf(entry, MAXPATHLEN, "/sys/class/usb/%s/device", dirent->d_name); + + /* look, if we have a pointer */ + if(lstat(entry, &statbuf) < 0) + { + perror(entry); + continue; + } + + if (S_ISLNK(statbuf.st_mode)) + { + /* get the path to the link */ + if (readlink(entry, link, MAXPATHLEN) < 0) + continue; + + /* find right occurance of '/' */ + if ((cptr = strrchr(link, '/')) == NULL) + { + continue; + } + + /* + * and truncate path: cut away everything after the '/', + * because parallel directory contains the information we need + */ + *cptr = '\0'; + + memset(make, 0, sizeof(make)); + memset(model, 0, sizeof(model)); + /* read manufacturer */ + snprintf(entry, MAXPATHLEN, "/sys/class/usb/%s/%s/manufacturer", + dirent->d_name, link); + + if ((file = fopen(entry, "r")) == NULL) + { + /* skip this entry, there is no file "manufacturer" */ + continue; + } + /* read data in */ + fread(make, sizeof(make)-1, sizeof(char), file); + fclose(file); + + /* beautify "make" - strip newline away */ + if ((cptr = strrchr(make, '\n')) != NULL) + { + *cptr = '\0'; + } + + /* next entry, if manufacturer is not CANON */ + if (strcasecmp(make, "CANON") != 0) + continue; + + /* read product name */ + snprintf(entry, MAXPATHLEN, "/sys/class/usb/%s/%s/product", + dirent->d_name, link); + + if ((file = fopen(entry, "r")) == NULL) + { + /* skip this entry, there is no file "product" */ + continue; + } + /* read data in */ + fread(model, sizeof(model)-1, sizeof(char), file); + fclose(file); + + /* beautify "model" - strip away newline */ + if ((cptr = strrchr(model, '\n')) != NULL) + { + *cptr = '\0'; + } + sprintf(device, "/dev/usb/%s", dirent->d_name); + if (access(device, 0)) + { + sprintf(device, "/dev/usb/usb%s", dirent->d_name); + + if (access(device, 0)) + sprintf(device, "/dev/usb%s", dirent->d_name); + } + + printf("direct canon:%s \"%s %s\" \"Gutenprint USB Printer #%d\"\n", + device, make, model, ++i); + } + } + closedir(dirprobe); + } + else if ((probe = fopen("/proc/bus/usb/devices", "r")) != NULL) { i = 0; @@ -556,7 +673,7 @@ list_devices(void) sprintf(device, "/dev/usblp%d", i); } - printf("direct canon:%s \"%s %s\" \"USB Printer #%d\"\n", + printf("direct canon:%s \"%s %s\" \"Gutenprint USB Printer #%d\"\n", device, make, model, i + 1); } @@ -577,21 +694,21 @@ list_devices(void) if ((fd = open(device, O_RDWR)) >= 0) { close(fd); - printf("direct canon:%s \"CANON\" \"USB Printer #%d\"\n", device, i + 1); + printf("direct canon:%s \"CANON\" \"Gutenprint USB Printer #%d\"\n", device, i + 1); } sprintf(device, "/dev/usb/usblp%d", i); if ((fd = open(device, O_RDWR)) >= 0) { close(fd); - printf("direct canon:%s \"CANON\" \"USB Printer #%d\"\n", device, i + 1); + printf("direct canon:%s \"CANON\" \"Gutenprint USB Printer #%d\"\n", device, i + 1); } sprintf(device, "/dev/usblp%d", i); if ((fd = open(device, O_RDWR)) >= 0) { close(fd); - printf("direct canon:%s \"CANON\" \"USB Printer #%d\"\n", device, i + 1); + printf("direct canon:%s \"CANON\" \"Gutenprint USB Printer #%d\"\n", device, i + 1); } } } @@ -615,7 +732,7 @@ list_devices(void) * Standard parallel port... */ - puts("direct canon:/dev/plpbi \"CANON\" \"Onboard Parallel Port\""); + puts("direct canon:/dev/plpbi \"CANON\" \"Gutenprint Onboard Parallel Port\""); } } @@ -633,7 +750,7 @@ list_devices(void) { sprintf(device, "/dev/ecpp%d", i); if (access(device, 0) == 0) - printf("direct canon:%s \"CANON\" \"Sun IEEE-1284 Parallel Port #%d\"\n", + printf("direct canon:%s \"CANON\" \"Gutenprint Sun IEEE-1284 Parallel Port #%d\"\n", device, i + 1); } @@ -642,7 +759,7 @@ list_devices(void) sprintf(device, "/dev/lp%d", i); if (access(device, 0) == 0) - printf("direct canon:%s \"CANON\" \"PC Parallel Port #%d\"\n", + printf("direct canon:%s \"CANON\" \"Gutenprint PC Parallel Port #%d\"\n", device, i + 1); } #elif defined(FreeBSD) || defined(OpenBSD) || defined(NetBSD) @@ -661,14 +778,14 @@ list_devices(void) if ((fd = open(device, O_RDWR)) >= 0) { close(fd); - printf("direct canon:%s \"CANON\" \"Parallel Port #%d (interrupt-driven)\"\n", device, i + 1); + printf("direct canon:%s \"CANON\" \"Gutenprint Parallel Port #%d (interrupt-driven)\"\n", device, i + 1); } sprintf(device, "/dev/lpa%d", i); if ((fd = open(device, O_RDWR)) >= 0) { close(fd); - printf("direct canon:%s \"CANON\" \"Parallel Port #%d (polled)\"\n", device, i + 1); + printf("direct canon:%s \"CANON\" \"Gutenprint Parallel Port #%d (polled)\"\n", device, i + 1); } } @@ -682,7 +799,7 @@ list_devices(void) if ((fd = open(device, O_RDWR)) >= 0) { close(fd); - printf("direct canon:%s \"CANON\" \"USB Port #%d\"\n", device, i + 1); + printf("direct canon:%s \"CANON\" \"Gutenprint USB Port #%d\"\n", device, i + 1); } } #endif diff --git a/src/cups/cups-genppdconfig.in b/src/cups/cups-genppdconfig.in index 26ae5e7..aa80920 100644 --- a/src/cups/cups-genppdconfig.in +++ b/src/cups/cups-genppdconfig.in @@ -1,5 +1,5 @@ #! @PERL@ -w -# $Id: cups-genppdconfig.in,v 1.13 2006/05/30 19:25:36 rleigh Exp $ +# $Id: cups-genppdconfig.in,v 1.13.8.1 2007/05/29 01:47:26 rlk Exp $ # A user-friendly dialog-based wrapper for cups-genppd(8). # Copyright (C) 2002 Roger Leigh # @@ -396,7 +396,7 @@ sub create_ppds { $count = 0; foreach $language (@chosen_languages) { # loop through languages open GENPPD, - "LANGUAGE=$language cups-genppd.$version -v -p $chosen_location/$language $printers 2>&1 |" + "LC_ALL=$language LANG=$language LANGUAGE=$language cups-genppd.$version -v -p $chosen_location/$language $printers 2>&1 |" or die "can't fork cups-genppd: $!"; $file = ""; while ( defined($file = )) { # dump genppd stats into guage diff --git a/src/cups/cups-genppdupdate.in b/src/cups/cups-genppdupdate.in index 1a1a8f4..ee49a0b 100644 --- a/src/cups/cups-genppdupdate.in +++ b/src/cups/cups-genppdupdate.in @@ -1,5 +1,5 @@ #! @PERL@ -w -# $Id: cups-genppdupdate.in,v 1.25 2006/05/22 20:25:51 rleigh Exp $ +# $Id: cups-genppdupdate.in,v 1.25.8.2 2007/05/29 01:47:26 rlk Exp $ # Update CUPS PPDs for Gutenprint queues. # Copyright (C) 2002-2003 Roger Leigh (rleigh@debian.org) # @@ -25,6 +25,7 @@ use File::Copy qw(mv); sub parse_options (); sub update_ppd ($); # Original PPD filename +sub get_ppd_contents ($$$$$); # Return contents of desired PPD sub find_ppd ($$$$); # Gutenprint Filename, driver, language (e.g. en, sv), # region (e.g. GB, DE) sub get_default_types (*); # Source PPD FH @@ -49,6 +50,8 @@ my $quiet = 0; # No output my $no_action = 0; # Don't output files my $reset_defaults = 0; # Reset options to default settings my $version = "@GUTENPRINT_MAJOR_VERSION@.@GUTENPRINT_MINOR_VERSION@"; +my $micro_version = "@GUTENPRINT_VERSION@"; +my $use_static_ppd = "@BUILD_CUPS_PPDS@"; my $ppd_dir = "@cups_conf_serverroot@/ppd"; # Location of in-use CUPS PPDs my $ppd_root_dir = "@cups_conf_datadir@/model"; @@ -56,6 +59,11 @@ my $ppd_base_dir = "$ppd_root_dir/gutenprint/$version"; # Available PPDs my $ppd_out_dir = ""; # By default output into source directory my $gzext = ".gz"; my $updated_ppd_count = 0; +my $exit_after_parse_args = 0; + +my $serverdir = "@cups_conf_serverbin@"; + +$Getopt::Std::STANDARD_HELP_VERSION = 1; my @ppd_files; # A list of in-use Gutenprint PPD files @@ -166,21 +174,53 @@ if (!$quiet || $verbose) { print STDOUT "Updated $updated_ppd_count PPD file${plural}. Restart cupsd for the changes to take effect.\n"; exit (0); } else { - print STDOUT "Failed to update any PPD files\n"; + if ($no_action) { + print STDOUT "Did not update any PPD files\n"; + } else { + print STDOUT "Failed to update any PPD files\n"; + } exit (0); } } +sub HELP_MESSAGE($;$$$) { + my ($fh) = @_; + print $fh "Usage: $0 [OPTION]... [PPD_FILE]...\n"; + print $fh "Update CUPS+Gutenprint PPD files.\n\n"; + print $fh " -d flags Enable debugging\n"; + print $fh " -h Display this help text\n"; + print $fh " -n No-action. Don't overwrite any PPD files.\n"; + print $fh " -q Quiet mode. No messages except errors.\n"; + print $fh " -s ppd_dir Use ppd_dir as the source PPD directory.\n"; + print $fh " -v Verbose messages.\n"; + print $fh " -N Reset options to defaults.\n"; + print $fh " -o out_dir Output PPD files to out_dir.\n"; + exit(0); +} +# Getopt::Std calls VERSION_MESSAGE followed by HELP_MESSAGE if --help +# is passed. If --version is passed, it calls only VERSION_MESSAGE. +# So we have to make sure to exit, but we want to allow --help to +# print out the help message. +sub VERSION_MESSAGE($;$$$) { + my ($fh) = @_; + print "cups-genppdupdate from Gutenprint $micro_version\n"; + $exit_after_parse_args = 1; +} -sub parse_options () { - getopts("dhnqs:vNo:"); +sub help() { + HELP_MESSAGE(\*STDOUT); +} +sub parse_options () { + if (!getopts('d:hnqs:vNo:')) { + help(); + } if ($opt_n) { $no_action = 1; } if ($opt_d) { - $debug = 1; + $debug = $opt_d; } if ($opt_s) { if (-d $opt_s) { @@ -210,20 +250,81 @@ sub parse_options () { } } if ($opt_h) { - print "Usage: $0 [OPTION]... [PPD_FILE]...\n"; - print "Update CUPS+Gutenprint PPD files.\n\n"; - print " -d Enable debugging\n"; - print " -h Display this help text\n"; - print " -n No-action. Don't overwrite any PPD files.\n"; - print " -q Quiet mode. No messages except errors.\n"; - print " -s ppd_dir Use ppd_dir as the source PPD directory.\n"; - print " -v Verbose messages.\n"; - print " -N Reset options to defaults.\n"; - print " -o out_dir Output PPD files to out_dir.\n"; - exit (0); + help(); + } + if ($exit_after_parse_args) { + exit(0); } } +sub get_ppd_contents($$$$$) { + my ($ppd_source_filename, $filename, $driver, $locale, $region) = @_; + + my $source_data; + my ($new_ppd_filename); + + if ($use_static_ppd eq "no") { + my ($driver_bin) = "$serverdir/driver/gutenprint.$version"; + my ($driver_version) = `$driver_bin VERSION`; + chomp $driver_version; + if ($driver_version eq "@VERSION@") { + my ($simplified); + if ($filename =~ m,.*/([^/]*)(.sim)(.ppd)?(.gz)?$,) { + $simplified = "simple"; + } else { + $simplified = "expert"; + } + my ($url); + foreach $url ("gutenprint.$version://$driver/$simplified/${locale}_${region}", + "gutenprint.$version://$driver/$simplified/${locale}", + "gutenprint.$version://$driver/$simplified") { + $new_ppd_filename = $url; + if (open PPD, "$driver_bin cat $url 2>/dev/null |") { + while () { + $source_data .= $_; + } + close PPD; + if ($source_data) { + return ( $new_ppd_filename, $source_data ); + } + } + } + } + # Otherwise fall through and try to find a static PPD + } + + # Search for a PPD matching our criteria... + + $new_ppd_filename = find_ppd($filename, $driver, $locale, $region); + if (!defined($new_ppd_filename)) { + # There wasn't a valid source PPD file, so give up. + print STDERR "$ppd_source_filename: no valid candidate for replacement. Skipping\n"; + print STDERR "$ppd_source_filename: please upgrade this PPD manually\n"; + return ("", 0); + } + if ($debug & 1) { + print "Candidate PPD: $new_ppd_filename\n"; + } + + my $suffix = "\\" . $gzext; # Add '\', so m// matches the '.'. + if ($new_ppd_filename =~ m/.gz$/) { # Decompress input buffer + open GZIN, "gunzip -c $new_ppd_filename |" + or die "$_: can't open for decompression: $!"; + while () { + $source_data .= $_; + } + close GZIN; + } else { + open SOURCE, $new_ppd_filename + or die "$new_ppd_filename: can't open source file: $!"; + binmode SOURCE; + my $source_size = (stat(SOURCE))[7]; + read (SOURCE, $source_data, $source_size) + or die "$new_ppd_filename: error reading source: $!"; + close SOURCE or die "$new_ppd_filename: can't close file: $!"; + } + return ( $new_ppd_filename, $source_data ); +} # Update the named PPD file. sub update_ppd ($) { @@ -237,7 +338,7 @@ sub update_ppd ($) { open ORIG, $_ or die "$_: can't open PPD file: $!"; seek (ORIG, 0, 0) or die "can't seek to start of PPD file"; my @orig_metadata = stat(ORIG); - if ($debug) { + if ($debug & 1) { print "Source Filename: $ppd_source_filename\n"; } my ($filename) = ""; @@ -274,7 +375,7 @@ sub update_ppd ($) { print STDERR "$ppd_source_filename: this PPD file cannot be upgraded automatically (only files based on Gutenprint 4.3.21 and newer can be)\n"; return 0; } - if ($debug) { + if ($debug & 2) { print "Gutenprint Filename: $filename\n"; print "Locale: $locale\n"; print "Language: $lingo\n"; @@ -295,46 +396,19 @@ sub update_ppd ($) { if (! defined($region)) { $region = ""; } - if ($debug) { - print "Locale: $locale\n"; + if ($debug & 2) { + print "Base Locale: $locale\n"; print "Region: $region\n"; } - # Search for a PPD matching our criteria... - - my $source = find_ppd($filename, $driver, $locale, $region); - if (!defined($source)) { - # There wasn't a valid source PPD file, so give up. - print STDERR "$ppd_source_filename: no valid candidate for replacement. Skipping\n"; - print STDERR "$ppd_source_filename: please upgrade this PPD manually\n"; - return 0; - } - if ($debug) { - print "Candidate PPD: $source\n"; - } - - # Read in the new PPD, decompressing it if needed... - my $source_data; + my ($new_ppd_filename, $source_data) = + get_ppd_contents($ppd_source_filename, $filename, + $driver, $locale, $region); - my $suffix = "\\" . $gzext; # Add '\', so m// matches the '.'. - if ($source =~ m/.gz$/) { # Decompress input buffer - open GZIN, "gunzip -c $source |" - or die "$_: can't open for decompression: $!"; - while () { - $source_data .= $_; - } - close GZIN; - } - else { - open SOURCE, $source - or die "$source: can't open source file: $!"; - binmode SOURCE; - my $source_size = (stat(SOURCE))[7]; - read (SOURCE, $source_data, $source_size) - or die "$source: error reading source: $!"; - close SOURCE or die "$source: can't close file: $!"; + if (! $source_data) { + die "Unable to retrieve PPD file!\n"; } # Save new PPD in a temporary file, for processing... @@ -360,30 +434,55 @@ sub update_ppd ($) { close $tmpfile or die "can't close temporary file $tmpfile: $!"; - if ($debug) { - print "Original Default Types:\n"; - foreach (sort keys %orig_default_types) { - print " $_: $orig_default_types{$_}\n"; - } - print "New Default Types:\n"; - foreach (sort keys %new_default_types) { - print " $_: $new_default_types{$_}\n"; - } - print "Defaults:\n"; - foreach (sort keys %defaults) { - print " $_: $defaults{$_}\n"; - } - print "Options:\n"; + if ($debug & 4) { + print "Options (Old->New Default Type):\n"; foreach (sort keys %options) { - print " $_: "; + my ($old_type) = $orig_default_types{$_}; + my ($new_type) = $new_default_types{$_}; + if (! defined($old_type)) { + $old_type = '(New)'; + } + if ($old_type ne $new_type) { + print " $_ ($old_type -> $new_type) : "; + } else { + print " $_ ($new_type) : "; + } + my ($def) = $defaults{"Default$_"}; foreach my $opt (@{$options{$_}}) { + if (defined $def && $def eq $opt) { + print "*"; + } print "$opt "; } print "\n"; } - + print "Non-UI Defaults:\n"; + foreach (sort keys %defaults) { + my ($xkey) = $_; + $xkey =~ s/^Default//; + if (! defined ($options{$xkey})) { + print " $_: $defaults{$_}\n"; + } + } + print "Default Types of dropped options:\n"; + foreach (sort keys %orig_default_types) { + if (! defined($options{$_})) { + print " $_: $orig_default_types{$_}\n"; + } + } } + if ($no_action) { + if (!$quiet || $verbose) { + if ($ppd_dest_filename eq $ppd_source_filename) { + print STDOUT "Would update $ppd_source_filename using $new_ppd_filename\n"; + } else { + print STDOUT "Would update $ppd_source_filename to $ppd_dest_filename using $new_ppd_filename\n"; + } + } + return 0; + } + if (! $reset_defaults) { # Update source buffer with old defaults... @@ -412,12 +511,10 @@ default_loop: next default_loop; } } - printf STDERR - "$ppd_source_filename: Invalid option: *$default_option: $defaults{$default_option}. Skipped.\n"; + warn "Warning: $ppd_source_filename: Invalid option: *$default_option: $defaults{$default_option}. Using default setting.\n"; next; } - print STDERR - "$ppd_source_filename: PPD OpenUI method $new_default_types{$_} not understood. Skipped\n"; + warn "Warning: $ppd_source_filename: PPD OpenUI method $new_default_types{$_} not understood.\n"; } } @@ -445,9 +542,9 @@ default_loop: if (!$quiet || $verbose) { if ($ppd_dest_filename eq $ppd_source_filename) { - print STDOUT "Updated $ppd_source_filename using $source\n"; + print STDOUT "Updated $ppd_source_filename using $new_ppd_filename\n"; } else { - print STDOUT "Updated $ppd_source_filename to $ppd_dest_filename using $source\n"; + print STDOUT "Updated $ppd_source_filename to $ppd_dest_filename using $new_ppd_filename\n"; } } return 1; @@ -492,7 +589,7 @@ sub find_ppd ($$$$) { $ppd_root_dir) { if (! $basedir || ! $base) { next; } my ($fn) = "$basedir/$lingo$base$suffix"; - if ($debug) { + if ($debug & 8) { print "Trying $fn for $gutenprintfilename, $lang, $region\n"; } # Check that it is a regular file, owned by root.root, not writable @@ -508,17 +605,17 @@ sub find_ppd ($$$$) { $file_version = `cat $fn | grep '$key'`; } if ($file_version ne "") { - if ($debug) { + if ($debug & 8) { print " Format valid: time $sb[9] best $current_best_time prev $current_best_file cur $fn!\n"; } if ($sb[9] > $current_best_time) { $current_best_time = $sb[9]; $current_best_file = $fn; - if ($debug) { + if ($debug & 8) { print STDERR "***current_best_file is $fn\n"; } } - } elsif ($debug) { + } elsif ($debug & 8) { print " Format invalid\n"; } } diff --git a/src/cups/epson.c b/src/cups/epson.c index 38fec8c..e1e14c4 100644 --- a/src/cups/epson.c +++ b/src/cups/epson.c @@ -1,5 +1,5 @@ /* - * "$Id: epson.c,v 1.7 2006/03/18 23:54:49 rlk Exp $" + * "$Id: epson.c,v 1.7.8.1 2007/05/12 19:32:08 faust3 Exp $" * * EPSON backend for the Common UNIX Printing System. * @@ -66,6 +66,14 @@ # include #endif /* WIN32 || __EMX__ */ +#ifdef __linux +# include +# include +# include +# include +# include +#endif /* __linux */ + #ifdef __sgi # include # ifndef INV_EPP_ECP_PLP @@ -515,6 +523,7 @@ list_devices(void) int fd; /* File descriptor */ char device[255]; /* Device filename */ FILE *probe; /* /proc/parport/n/autoprobe file */ + DIR *dirprobe; /* scan /sys/bus/usb/drivers/usblp */ char line[1024], /* Line from file */ *delim, /* Delimiter in file */ make[IPP_MAX_NAME], /* Make from file */ @@ -527,12 +536,17 @@ list_devices(void) for (i = 0; i < 4; i ++) { - sprintf(device, "/proc/parport/%d/autoprobe", i); - if ((probe = fopen(device, "r")) != NULL) + sprintf(device, "/proc/sys/dev/parport/parport%d/autoprobe", i); + probe = fopen(device, "r"); + if ( probe == NULL ) /* older kernel versions */ + { + sprintf(device, "/proc/parport/%d/autoprobe", i); + probe = fopen(device, "r"); + } + if ( probe != NULL ) { memset(make, 0, sizeof(make)); memset(model, 0, sizeof(model)); - strcpy(model, "EPSON"); while (fgets(line, sizeof(line), probe) != NULL) { @@ -550,17 +564,17 @@ list_devices(void) */ if (strncmp(line, "MODEL:", 6) == 0 && - strncmp(line, "MODEL:EPSON", 13) != 0) + strncmp(line, "MODEL:Unknown", 13) != 0) strncpy(model, line + 6, sizeof(model) - 1); else if (strncmp(line, "MANUFACTURER:", 13) == 0 && - strncmp(line, "MANUFACTURER:EPSON", 20) != 0) + strncmp(line, "MANUFACTURER:Unknown", 20) != 0) strncpy(make, line + 13, sizeof(make) - 1); } fclose(probe); - if (strcmp(make, "EPSON") == 0) - printf("direct epson:/dev/lp%d \"%s %s\" \"Parallel Port #%d\"\n", + if (strcasecmp(make, "EPSON") == 0) + printf("direct epson:/dev/lp%d \"%s %s\" \"Gutenprint Parallel Port #%d\"\n", i, make, model, i + 1); } else @@ -569,7 +583,7 @@ list_devices(void) if ((fd = open(device, O_RDWR)) >= 0) { close(fd); - printf("direct epson:%s \"EPSON\" \"Parallel Port #%d\"\n", device, i + 1); + printf("direct epson:%s \"EPSON\" \"Gutenprint Parallel Port #%d\"\n", device, i + 1); } } } @@ -578,7 +592,110 @@ list_devices(void) * Probe for USB devices... */ - if ((probe = fopen("/proc/bus/usb/devices", "r")) != NULL) + if ((dirprobe = opendir("/sys/class/usb")) != NULL) /* SYSFS in kernel 2.6 */ + { + struct dirent *dirent; /* directory entries */ + struct stat statbuf; /* file stat */ + char entry[MAXPATHLEN]; /* pathname to usb entries */ + char link[MAXPATHLEN]; /* linkname of usb entries */ + char *cptr; /* multi used character pointer */ + FILE *file; /* read printer specific info from */ + + i = 0; + /* scan the directory entries */ + while((dirent = readdir(dirprobe)) != 0) + { + /* skip "." and ".." */ + if (dirent->d_name[0] != 'l' || dirent->d_name[1] != 'p') + continue; + + /* generate path to work with */ + snprintf(entry, MAXPATHLEN, "/sys/class/usb/%s/device", dirent->d_name); + + /* look, if we have a pointer */ + if(lstat(entry, &statbuf) < 0) + { + perror(entry); + continue; + } + + if (S_ISLNK(statbuf.st_mode)) + { + /* get the path to the link */ + if (readlink(entry, link, MAXPATHLEN) < 0) + continue; + + /* find right occurance of '/' */ + if ((cptr = strrchr(link, '/')) == NULL) + { + continue; + } + + /* + * and truncate path: cut away everything after the '/', + * because parallel directory contains the information we need + */ + *cptr = '\0'; + + memset(make, 0, sizeof(make)); + memset(model, 0, sizeof(model)); + /* read manufacturer */ + snprintf(entry, MAXPATHLEN, "/sys/class/usb/%s/%s/manufacturer", + dirent->d_name, link); + + if ((file = fopen(entry, "r")) == NULL) + { + /* skip this entry, there is no file "manufacturer" */ + continue; + } + /* read data in */ + fread(make, sizeof(make)-1, sizeof(char), file); + fclose(file); + + /* beautify "make" - strip newline away */ + if ((cptr = strrchr(make, '\n')) != NULL) + { + *cptr = '\0'; + } + + /* next entry, if manufacturer is not EPSON */ + if (strcasecmp(make, "EPSON") != 0) + continue; + + /* read product name */ + snprintf(entry, MAXPATHLEN, "/sys/class/usb/%s/%s/product", + dirent->d_name, link); + + if ((file = fopen(entry, "r")) == NULL) + { + /* skip this entry, there is no file "product" */ + continue; + } + /* read data in */ + fread(model, sizeof(model)-1, sizeof(char), file); + fclose(file); + + /* beautify "model" - strip away newline */ + if ((cptr = strrchr(model, '\n')) != NULL) + { + *cptr = '\0'; + } + sprintf(device, "/dev/usb/%s", dirent->d_name); + if (access(device, 0)) + { + sprintf(device, "/dev/usb/usb%s", dirent->d_name); + + if (access(device, 0)) + sprintf(device, "/dev/usb%s", dirent->d_name); + } + + printf("direct epson:%s \"%s %s\" \"Gutenprint USB Printer #%d\"\n", + device, make, model, ++i); + } + } + closedir(dirprobe); + } + else if ((probe = fopen("/proc/bus/usb/devices", "r")) != NULL) { i = 0; @@ -632,7 +749,7 @@ list_devices(void) sprintf(device, "/dev/usblp%d", i); } - printf("direct epson:%s \"%s %s\" \"USB Printer #%d\"\n", + printf("direct epson:%s \"%s %s\" \"Gutenprint USB Printer #%d\"\n", device, make, model, i + 1); } @@ -653,21 +770,21 @@ list_devices(void) if ((fd = open(device, O_RDWR)) >= 0) { close(fd); - printf("direct epson:%s \"EPSON\" \"USB Printer #%d\"\n", device, i + 1); + printf("direct epson:%s \"EPSON\" \"Gutenprint USB Printer #%d\"\n", device, i + 1); } sprintf(device, "/dev/usb/usblp%d", i); if ((fd = open(device, O_RDWR)) >= 0) { close(fd); - printf("direct epson:%s \"EPSON\" \"USB Printer #%d\"\n", device, i + 1); + printf("direct epson:%s \"EPSON\" \"Gutenprint USB Printer #%d\"\n", device, i + 1); } sprintf(device, "/dev/usblp%d", i); if ((fd = open(device, O_RDWR)) >= 0) { close(fd); - printf("direct epson:%s \"EPSON\" \"USB Printer #%d\"\n", device, i + 1); + printf("direct epson:%s \"EPSON\" \"Gutenprint USB Printer #%d\"\n", device, i + 1); } } } @@ -691,7 +808,7 @@ list_devices(void) * Standard parallel port... */ - puts("direct epson:/dev/plpbi \"EPSON\" \"Onboard Parallel Port\""); + puts("direct epson:/dev/plpbi \"EPSON\" \"Gutenprint Onboard Parallel Port\""); } } @@ -709,7 +826,7 @@ list_devices(void) { sprintf(device, "/dev/ecpp%d", i); if (access(device, 0) == 0) - printf("direct epson:%s \"EPSON\" \"Sun IEEE-1284 Parallel Port #%d\"\n", + printf("direct epson:%s \"EPSON\" \"Gutenprint Sun IEEE-1284 Parallel Port #%d\"\n", device, i + 1); } @@ -718,7 +835,7 @@ list_devices(void) sprintf(device, "/dev/lp%d", i); if (access(device, 0) == 0) - printf("direct epson:%s \"EPSON\" \"PC Parallel Port #%d\"\n", + printf("direct epson:%s \"EPSON\" \"Gutenprint PC Parallel Port #%d\"\n", device, i + 1); } #elif defined(FreeBSD) || defined(OpenBSD) || defined(NetBSD) @@ -737,14 +854,14 @@ list_devices(void) if ((fd = open(device, O_RDWR)) >= 0) { close(fd); - printf("direct epson:%s \"EPSON\" \"Parallel Port #%d (interrupt-driven)\"\n", device, i + 1); + printf("direct epson:%s \"EPSON\" \"Gutenprint Parallel Port #%d (interrupt-driven)\"\n", device, i + 1); } sprintf(device, "/dev/lpa%d", i); if ((fd = open(device, O_RDWR)) >= 0) { close(fd); - printf("direct epson:%s \"EPSON\" \"Parallel Port #%d (polled)\"\n", device, i + 1); + printf("direct epson:%s \"EPSON\" \"Gutenprint Parallel Port #%d (polled)\"\n", device, i + 1); } } @@ -758,7 +875,7 @@ list_devices(void) if ((fd = open(device, O_RDWR)) >= 0) { close(fd); - printf("direct epson:%s \"EPSON\" \"USB Port #%d\"\n", device, i + 1); + printf("direct epson:%s \"EPSON\" \"Gutenprint USB Port #%d\"\n", device, i + 1); } } #endif @@ -766,5 +883,5 @@ list_devices(void) /* - * End of "$Id: epson.c,v 1.7 2006/03/18 23:54:49 rlk Exp $". + * End of "$Id: epson.c,v 1.7.8.1 2007/05/12 19:32:08 faust3 Exp $". */ diff --git a/src/cups/genppd.c b/src/cups/genppd.c index 6f77c62..4b49ba6 100644 --- a/src/cups/genppd.c +++ b/src/cups/genppd.c @@ -1,9 +1,9 @@ /* - * "$Id: genppd.c,v 1.118 2006/05/28 16:59:03 rlk Exp $" + * "$Id: genppd.c,v 1.119.2.3 2007/05/29 01:47:26 rlk Exp $" * * PPD file generation program for the CUPS drivers. * - * Copyright 1993-2005 by Easy Software Products and Robert Krawitz. + * Copyright 1993-2007 by Easy Software Products and Robert Krawitz. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License, @@ -21,7 +21,7 @@ * Attn: CUPS Licensing Information * Easy Software Products * 44141 Airport View Drive, Suite 204 - * Hollywood, Maryland 20636-3111 USA + * Hollywood, Maryland 20636 USA * * Voice: (301) 373-9603 * EMail: cups-info@cups.org @@ -29,14 +29,20 @@ * * Contents: * - * main() - Process files on the command-line... - * usage() - Show program usage. - * help() - Show detailed program usage. - * getlangs() - Get available translations. - * printlangs() - Show available translations. - * printmodels() - Show available printer models. - * checkcat() - Check message catalogue exists. - * write_ppd() - Write a PPD file. + * main() - Process files on the command-line... + * cat_ppd() - Copy the named PPD to stdout. + * generate_ppd() - Generate a PPD file. + * getlangs() - Get a list of available translations. + * help() - Show detailed help. + * is_special_option() - Determine if an option should be grouped. + * list_ppds() - List the available drivers. + * print_group_close() - Close a UI group. + * print_group_open() - Open a new UI group. + * printlangs() - Print list of available translations. + * printmodels() - Print a list of available models. + * set_language() - Set the current translation language. + * usage() - Show program usage. + * write_ppd() - Write a PPD file. */ /* @@ -57,8 +63,26 @@ #include #include #include +#include + +#ifdef CUPS_DRIVER_INTERFACE +# ifdef HAVE_LIBZ +# undef HAVE_LIBZ +# endif /* HAVE_LIBZ */ +#endif /* CUPS_DRIVER_INTERFACE */ + +static const char *cups_modeldir = CUPS_MODELDIR; + #ifdef HAVE_LIBZ #include +static const char *gzext = ".gz"; +#else +static const char *gzext = ""; +# define gzopen fopen +# define gzclose fclose +# define gzFile FILE * +# define gzprintf fprintf +# define gzputs(f,s) fputs((s),(f)) #endif #include @@ -67,6 +91,17 @@ #include #include +/* + * Some of the Gutenprint resolution names are not PPD-compliant. + * In Gutenprint 5.0, use the legacy names with the CUPS 1.1 interface + * for back compatibility. With CUPS 1.2, or Gutenprint 5.1 or above, + * generate compliant names. + */ + +#if defined(CUPS_DRIVER_INTERFACE) || (STP_MAJOR_VERSION > 5) || (STP_MAJOR_VERSION == 5 && STP_MINOR_VERSION > 0) +#define USE_COMPLIANT_RESOLUTIONS 1 +#endif + /* * Note: * @@ -76,33 +111,11 @@ int cups_ppd_ps_level = CUPS_PPD_PS_LEVEL; -static const char *cups_modeldir = CUPS_MODELDIR; - /* * File handling stuff... */ static const char *ppdext = ".ppd"; -#ifdef HAVE_LIBZ -static const char *gzext = ".gz"; -#else -static const char *gzext = ""; -# define gzFile FILE * -# define gzopen fopen -# define gzclose fclose -# define gzprintf fprintf -# define gzputs(f,s) fputs((s),(f)) -# define gzputc(f,c) putc((c),(f)) -#endif /* HAVE_LIBZ */ - - -/* - * Size data... - */ - -#define DEFAULT_SIZE "Letter" -/*#define DEFAULT_SIZE "A4"*/ -#define CATALOG "LC_MESSAGES/gutenprint.mo" typedef struct /**** Media size values ****/ { @@ -149,55 +162,271 @@ const char *parameter_level_names[] = * Local functions... */ -void usage(void); -void help(void); -char ** getlangs(void); -static int stpi_scandir (const char *dir, - struct dirent ***namelist, - int (*sel) (const struct dirent *), - int (*cmp) (const void *, const void *)); -int checkcat (const struct dirent *localedir); -void printlangs(char** langs); -void printmodels(int verbose); -int write_ppd(const stp_printer_t *p, const char *prefix, - const char *language, int verbose, int simplified); +#ifdef CUPS_DRIVER_INTERFACE +static int cat_ppd(int argc, char **argv); +static int list_ppds(const char *argv0); +#else /* !CUPS_DRIVER_INTERFACE */ +static int generate_ppd(const char *prefix, int verbose, + const stp_printer_t *p, const char *language, + int simplified); +static void help(void); +static void printlangs(char** langs); +static void printmodels(int verbose); +static void usage(void); +#endif /* !CUPS_DRIVER_INTERFACE */ +#ifdef ENABLE_NLS +static char **getlangs(void); +static void set_language(const char *lang); +#endif /* ENABLE_NLS */ +static int is_special_option(const char *name); +static void print_group_close(gzFile fp, stp_parameter_class_t p_class, + stp_parameter_level_t p_level); +static void print_group_open(gzFile fp, stp_parameter_class_t p_class, + stp_parameter_level_t p_level); +static int write_ppd(gzFile fp, const stp_printer_t *p, + const char *language, const char *ppd_location, + int simplified); + +#ifdef ENABLE_NLS +typedef struct { + const char *lang; + const char *mapping; +} locale_map; + +static const locale_map lang_mappings[] = + { + { "cs", "CS_CZ" }, + { "da", "da_DK" }, + { "de", "de_DE" }, + { "el", "el_GR" }, + { "es", "es_ES" }, + { "fr", "fr_FR" }, + { "hu", "hu_HU" }, + { "ja", "ja_JP" }, + { "nb", "nb_NO" }, + { "nl", "nl_NL" }, + { "pl", "pl_PL" }, + { "pt", "pt_PT" }, + { "sk", "sk_SK" }, + { "sv", "sv_SE" }, + }; +static int lang_map_count = sizeof(lang_mappings) / sizeof(locale_map); + +static const char *baselocaledir = PACKAGE_LOCALE_DIR; +#endif /* * Global variables... */ -const char *baselocaledir = PACKAGE_LOCALE_DIR; -static int -is_special_option(const char *name) + +#ifdef CUPS_DRIVER_INTERFACE + +/* + * 'main()' - Process files on the command-line... + */ + +int /* O - Exit status */ +main(int argc, /* I - Number of command-line arguments */ + char *argv[]) /* I - Command-line arguments */ { - int i = 0; - while (special_options[i]) + + /* + * Initialise libgutenprint + */ + + stp_init(); + + /* + * Process command-line... + */ + + if (argc == 2 && !strcmp(argv[1], "list")) + return (list_ppds(argv[0])); + else if (argc == 3 && !strcmp(argv[1], "cat")) + return (cat_ppd(argc, argv)); + else if (argc == 2 && !strcmp(argv[1], "VERSION")) { - if (strcmp(name, special_options[i]) == 0) - return 1; - i++; + printf("%s\n", VERSION); + return (0); } - return 0; + else + { + fprintf(stderr, "Usage: %s list\n", argv[0]); + fprintf(stderr, " %s cat URI\n", argv[0]); + return (1); + } } -static void -print_group_open(FILE *fp, stp_parameter_class_t p_class, - stp_parameter_level_t p_level) + +/* + * 'cat_ppd()' - Copy the named PPD to stdout. + */ + +static int /* O - Exit status */ +cat_ppd(int argc, char **argv) /* I - Driver URI */ { - gzprintf(fp, "*OpenGroup: %s %s\n\n", - gettext(parameter_class_names[p_class]), - gettext(parameter_level_names[p_level])); + const char *uri = argv[2]; + char scheme[64], /* URI scheme */ + userpass[32], /* URI user/pass (unused) */ + hostname[32], /* URI hostname */ + resource[1024]; /* URI resource */ + int port; /* URI port (unused) */ + http_uri_status_t status; /* URI decode status */ + const stp_printer_t *p; /* Printer driver */ + const char *lang = "C"; + char *s; +#ifdef ENABLE_NLS + char **all_langs = getlangs(); +#endif + char filename[1024], /* Filename */ + ppd_location[1024]; /* Installed location */ + + if ((status = httpSeparateURI(HTTP_URI_CODING_ALL, uri, + scheme, sizeof(scheme), + userpass, sizeof(userpass), + hostname, sizeof(hostname), + &port, resource, sizeof(resource))) + < HTTP_URI_OK) + { + fprintf(stderr, "ERROR: Bad ppd-name \"%s\" (%d)!\n", uri, status); + return (1); + } + + s = strchr(resource + 1, '/'); + if (s) + { + lang = s + 1; + *s = '\0'; + } + +#ifdef ENABLE_NLS + if (!lang || strcmp(lang, "C") != 0) + { + while (*all_langs) + { + if (!strcmp(lang, *all_langs)) + break; + all_langs++; + } + if (! *all_langs) + { + fprintf(stderr, "ERROR: Unable to find language \"%s\"!\n", lang); + return (1); + } + } + set_language(lang); +#endif + + if ((p = stp_get_printer_by_driver(hostname)) == NULL) + { + fprintf(stderr, "ERROR: Unable to find driver \"%s\"!\n", hostname); + return (1); + } + + /* + * This isn't really the right thing to do. We really shouldn't + * be embedding filenames in automatically generated PPD files, but + * if the user ever decides to go back from generated PPD files to + * static PPD files we'll need to have this for genppdupdate to work. + */ + snprintf(filename, sizeof(filename) - 1, "%s/stp-%s.%s%s%s%s", + "ppd", hostname, GUTENPRINT_RELEASE_VERSION, + strcmp(resource + 1, "simple") ? "" : ".sim", ppdext, gzext); + snprintf(ppd_location, sizeof(ppd_location) - 1, "%s%s%s/%s", + cups_modeldir, + cups_modeldir[strlen(cups_modeldir) - 1] == '/' ? "" : "/", + lang ? lang : "C", + filename); + + return (write_ppd(stdout, p, lang, ppd_location, + !strcmp(resource + 1, "simple"))); } -static void -print_group_close(FILE *fp, stp_parameter_class_t p_class, - stp_parameter_level_t p_level) +/* + * 'list_ppds()' - List the available drivers. + */ + +static int /* O - Exit status */ +list_ppds(const char *argv0) /* I - Name of program */ { - gzprintf(fp, "*CloseGroup: %s %s\n\n", - gettext(parameter_class_names[p_class]), - gettext(parameter_level_names[p_level])); + const char *scheme; /* URI scheme */ + int i; /* Looping var */ + const stp_printer_t *printer; /* Pointer to printer driver */ +#if defined(ENABLE_NLS) && defined(CUPS_TRANSLATED_PPDS) + char **langs = getlangs(); + char **langptr; +#endif + + if ((scheme = strrchr(argv0, '/')) != NULL) + scheme ++; + else + scheme = argv0; + + for (i = 0; i < stp_printer_model_count(); i++) + if ((printer = stp_get_printer_by_index(i)) != NULL) + { + if (!strcmp(stp_printer_get_family(printer), "ps") || + !strcmp(stp_printer_get_family(printer), "raw")) + continue; + + printf("\"%s://%s/expert/%s\" " + "%s " + "\"%s\" " + "\"%s" CUPS_PPD_NICKNAME_STRING VERSION "\" " + "\"\"\n", /* No IEEE-1284 Device ID yet */ + scheme, stp_printer_get_driver(printer), "C", + "en", + stp_printer_get_manufacturer(printer), + stp_printer_get_long_name(printer)); + +#ifdef GENERATE_SIMPLIFIED_PPDS + printf("\"%s://%s/simple/%s\" " + "%s " + "\"%s\" " + "\"%s" CUPS_PPD_NICKNAME_STRING VERSION " Simplified\" " + "\"\"\n", /* No IEEE-1284 Device ID yet */ + scheme, stp_printer_get_driver(printer), "C", + "en", + stp_printer_get_manufacturer(printer), + stp_printer_get_long_name(printer)); +#endif +#if defined(ENABLE_NLS) && defined(CUPS_TRANSLATED_PPDS) + langptr = langs; + while (*langptr != 0 && strcmp(*langptr, "") != 0) + { + printf("\"%s://%s/expert/%s\" " + "%s " + "\"%s\" " + "\"%s" CUPS_PPD_NICKNAME_STRING VERSION "\" " + "\"\"\n", /* No IEEE-1284 Device ID yet */ + scheme, stp_printer_get_driver(printer), *langptr, + *langptr, + stp_printer_get_manufacturer(printer), + stp_printer_get_long_name(printer)); + +#ifdef GENERATE_SIMPLIFIED_PPDS + printf("\"%s://%s/simple/%s\" " + "%s " + "\"%s\" " + "\"%s" CUPS_PPD_NICKNAME_STRING VERSION " Simplified\" " + "\"\"\n", /* No IEEE-1284 Device ID yet */ + scheme, stp_printer_get_driver(printer), *langptr, + *langptr, + stp_printer_get_manufacturer(printer), + stp_printer_get_long_name(printer)); +#endif + langptr++; + } +#endif + } + + return (0); } +#endif /* CUPS_DRIVER_INTERFACE */ + +#ifndef CUPS_DRIVER_INTERFACE /* * 'main()' - Process files on the command-line... @@ -239,6 +468,7 @@ main(int argc, /* I - Number of command-line arguments */ break; case 'h': help(); + exit(EXIT_SUCCESS); break; case 'v': verbose = 1; @@ -247,16 +477,18 @@ main(int argc, /* I - Number of command-line arguments */ verbose = 0; break; case 'c': +# ifdef ENABLE_NLS baselocaledir = optarg; -#ifdef DEBUG - fprintf (stderr, "DEBUG: baselocaledir: %s\n", baselocaledir); -#endif +# ifdef DEBUG + fprintf(stderr, "DEBUG: baselocaledir: %s\n", baselocaledir); +# endif +# endif break; case 'p': prefix = optarg; -#ifdef DEBUG - fprintf (stderr, "DEBUG: prefix: %s\n", prefix); -#endif +# ifdef DEBUG + fprintf(stderr, "DEBUG: prefix: %s\n", prefix); +# endif break; case 'l': language = optarg; @@ -278,7 +510,7 @@ main(int argc, /* I - Number of command-line arguments */ break; case 'V': printf("cups-genppd version %s, " - "Copyright (c) 1993-2005 by Easy Software Products and Robert Krawitz.\n\n", + "Copyright 1993-2006 by Easy Software Products and Robert Krawitz.\n\n", VERSION); printf("Default CUPS PPD PostScript Level: %d\n", cups_ppd_ps_level); printf("Default PPD location (prefix): %s\n", CUPS_MODELDIR); @@ -291,8 +523,8 @@ main(int argc, /* I - Number of command-line arguments */ "but WITHOUT ANY WARRANTY; without even the implied warranty of\n" "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n" "GNU General Public License for more details.\n" - "\n" - "You should have received a copy of the GNU General Public License\n" + "\n"); + puts("You should have received a copy of the GNU General Public License\n" "along with this program; if not, please contact Easy Software\n" "Products at:\n" "\n" @@ -304,11 +536,11 @@ main(int argc, /* I - Number of command-line arguments */ " Voice: (301) 373-9603\n" " EMail: cups-info@cups.org\n" " WWW: http://www.cups.org\n"); - exit (EXIT_SUCCESS); + exit(EXIT_SUCCESS); break; default: usage(); - exit (EXIT_FAILURE); + exit(EXIT_FAILURE); break; } } @@ -320,15 +552,11 @@ main(int argc, /* I - Number of command-line arguments */ { models[n] = argv[optind+n]; } - models[numargs] = (char*) NULL; + models[numargs] = (char*)NULL; n=0; } -#ifdef ENABLE_NLS - langs = getlangs(); -#endif - /* * Initialise libgutenprint */ @@ -339,68 +567,27 @@ main(int argc, /* I - Number of command-line arguments */ * Set the language... */ - if (language) - { - unsetenv("LC_CTYPE"); - unsetenv("LC_COLLATE"); - unsetenv("LC_TIME"); - unsetenv("LC_NUMERIC"); - unsetenv("LC_MONETARY"); - unsetenv("LC_MESSAGES"); - unsetenv("LC_ALL"); - unsetenv("LANG"); - setenv("LC_ALL", language, 1); - setenv("LANG", language, 1); - } - setlocale(LC_ALL, ""); +# ifdef ENABLE_NLS + langs = getlangs(); -#ifdef LC_NUMERIC - setlocale(LC_NUMERIC, "C"); -#endif /* LC_NUMERIC */ + if (language) + set_language(language); +# endif /* ENABLE_NLS */ /* - * Set up the catalog + * Print lists */ -#ifdef ENABLE_NLS - if (baselocaledir) - { - if ((bindtextdomain(PACKAGE, baselocaledir)) == NULL) - { - fprintf(stderr, "cups-genppd: cannot load message catalog %s under %s: %s\n", - PACKAGE, baselocaledir, strerror(errno)); - exit(EXIT_FAILURE); - } -#ifdef DEBUG - fprintf (stderr, "DEBUG: bound textdomain: %s under %s\n", - PACKAGE, baselocaledir); -#endif - if ((textdomain(PACKAGE)) == NULL) - { - fprintf(stderr, "cups-genppd: cannot select message catalog %s under %s: %s\n", - PACKAGE, baselocaledir, strerror(errno)); - exit(EXIT_FAILURE); - } -#ifdef DEBUG - fprintf (stderr, "DEBUG: textdomain set: %s\n", PACKAGE); -#endif - } -#endif - - /* - * Print lists - */ - if (opt_printlangs) { printlangs(langs); - exit (EXIT_SUCCESS); + exit(EXIT_SUCCESS); } if (opt_printmodels) { printmodels(verbose); - exit (EXIT_SUCCESS); + exit(EXIT_SUCCESS); } /* @@ -419,11 +606,11 @@ main(int argc, /* I - Number of command-line arguments */ if (printer) { if ((which_ppds & 1) && - write_ppd(printer, prefix, language, verbose, 1)) - return 1; + generate_ppd(prefix, verbose, printer, language, 1)) + return (1); if ((which_ppds & 2) && - write_ppd(printer, prefix, language, verbose, 0)) - return 1; + generate_ppd(prefix, verbose, printer, language, 0)) + return (1); } else { @@ -442,45 +629,109 @@ main(int argc, /* I - Number of command-line arguments */ if (printer) { if ((which_ppds & 1) && - write_ppd(printer, prefix, language, verbose, 1)) + generate_ppd(prefix, verbose, printer, language, 1)) return (1); if ((which_ppds & 2) && - write_ppd(printer, prefix, language, verbose, 0)) + generate_ppd(prefix, verbose, printer, language, 0)) return (1); } } } if (!verbose) fprintf(stderr, " done.\n"); - if (langs) - { - char **langs_tmp = langs; - while (*langs_tmp) - { - stp_free(*langs_tmp); - langs_tmp++; - } - stp_free(langs); - } return (0); } /* - * 'usage()' - Show program usage... + * 'generate_ppd()' - Generate a PPD file. */ -void -usage(void) +static int /* O - Exit status */ +generate_ppd( + const char *prefix, /* I - PPD directory prefix */ + int verbose, /* I - Verbosity level */ + const stp_printer_t *p, /* I - Driver */ + const char *language, /* I - Primary language */ + int simplified) /* I - 1 = simplified options */ { - puts("Usage: cups-genppd [-c localedir] " - "[-l locale] [-p prefix] [-s | -a] [-q] [-v] models...\n" - " cups-genppd -L [-c localedir]\n" - " cups-genppd -M [-v]\n" - " cups-genppd -h\n" - " cups-genppd -V\n"); + int status; /* Exit status */ + gzFile fp; /* File to write to */ + char filename[1024], /* Filename */ + ppd_location[1024]; /* Installed location */ + struct stat dir; /* Prefix dir status */ + + + /* + * Skip the PostScript drivers... + */ + + if (!strcmp(stp_printer_get_family(p), "ps") || + !strcmp(stp_printer_get_family(p), "raw")) + return (0); + + /* + * Make sure the destination directory exists... + */ + + if (stat(prefix, &dir) && !S_ISDIR(dir.st_mode)) + { + if (mkdir(prefix, 0777)) + { + printf("cups-genppd: Cannot create directory %s: %s\n", + prefix, strerror(errno)); + exit(EXIT_FAILURE); + } + } + + /* + * The files will be named stp-...ppd, for + * example: + * + * stp-escp2-ex.5.0.ppd + * + * or + * + * stp-escp2-ex.5.0.ppd.gz + */ + + snprintf(filename, sizeof(filename) - 1, "%s/stp-%s.%s%s%s%s", + prefix, stp_printer_get_driver(p), GUTENPRINT_RELEASE_VERSION, + simplified ? ".sim" : "", ppdext, gzext); + + /* + * Open the PPD file... + */ + + if ((fp = gzopen(filename, "wb")) == NULL) + { + fprintf(stderr, "cups-genppd: Unable to create file \"%s\" - %s.\n", + filename, strerror(errno)); + return (2); + } + + if (verbose) + fprintf(stderr, "Writing %s...\n", filename); + else + fprintf(stderr, "."); + + snprintf(ppd_location, sizeof(ppd_location), "%s%s%s/%s", + cups_modeldir, + cups_modeldir[strlen(cups_modeldir) - 1] == '/' ? "" : "/", + language ? language : "C", + basename(filename)); + + status = write_ppd(fp, p, language, ppd_location, simplified); + + gzclose(fp); + + return (status); } +/* + * 'help()' - Show detailed help. + */ + void help(void) { @@ -494,8 +745,8 @@ help(void) " -L List available translations (message catalogs).\n" " -M List available printer models.\n" " -V Show version information and defaults.\n" - " The default is to output PPDs.\n" - "Options:\n" + " The default is to output PPDs.\n"); + puts("Options:\n" " -c localedir Use localedir as the base directory for locale data.\n" " -l locale Output PPDs translated with messages for locale.\n" " -p prefix Output PPDs in directory prefix.\n" @@ -509,72 +760,46 @@ help(void) } /* - * 'dirent_sort()' - sort directory entries + * 'usage()' - Show program usage. */ -static int -dirent_sort(const void *a, - const void *b) -{ - return strcoll ((*(const struct dirent *const *) a)->d_name, - (*(const struct dirent *const *) b)->d_name); -} -/* - * 'getlangs()' - Get a list of available translations - */ - -char ** -getlangs(void) +void +usage(void) { - struct dirent** langdirs = NULL; - int n; - char **langs; - - n = stpi_scandir (baselocaledir, &langdirs, checkcat, dirent_sort); - if (n >= 0) - { - int idx; - langs = stp_malloc((n+1) * sizeof(char*)); - for (idx = 0; idx < n; ++idx) - { - langs[idx] = (char*) stp_malloc((strlen(langdirs[idx]->d_name)+1) * sizeof(char)); - strcpy(langs[idx], langdirs[idx]->d_name); - free (langdirs[idx]); /* Must use plain free() */ - } - langs[n] = NULL; - free (langdirs); /* Must use plain free() */ - } - else - return NULL; - - return langs; + puts("Usage: cups-genppd [-c localedir] " + "[-l locale] [-p prefix] [-s | -a] [-q] [-v] models...\n" + " cups-genppd -L [-c localedir]\n" + " cups-genppd -M [-v]\n" + " cups-genppd -h\n" + " cups-genppd -V\n"); } - /* - * 'printlangs()' - Print list of available translations + * 'printlangs()' - Print list of available translations. */ -void printlangs(char **langs) +void +printlangs(char **langs) /* I - Languages */ { if (langs) { int n = 0; while (langs && langs[n]) { - printf("%s\n", langs[n]); + puts(langs[n]); n++; } } - exit (EXIT_SUCCESS); + exit(EXIT_SUCCESS); } /* - * 'printmodels' - Print a list of available models + * 'printmodels()' - Print a list of available models. */ -void printmodels(int verbose) +void +printmodels(int verbose) /* I - Verbosity level */ { const stp_printer_t *p; int i; @@ -593,182 +818,177 @@ void printmodels(int verbose) printf("%s\n", stp_printer_get_driver(p)); } } - exit (EXIT_SUCCESS); + exit(EXIT_SUCCESS); } -/* Adapted from GNU libc - These macros extract size information from a `struct dirent *'. - They may evaluate their argument multiple times, so it must not - have side effects. Each of these may involve a relatively costly - call to `strlen' on some systems, so these values should be cached. - - _D_EXACT_NAMLEN (DP) returns the length of DP->d_name, not including - its terminating null character. +#endif /* !CUPS_DRIVER_INTERFACE */ - _D_ALLOC_NAMLEN (DP) returns a size at least (_D_EXACT_NAMLEN (DP) + 1); - that is, the allocation size needed to hold the DP->d_name string. - Use this macro when you don't need the exact length, just an upper bound. - This macro is less likely to require calling `strlen' than _D_EXACT_NAMLEN. - */ - -#ifdef _DIRENT_HAVE_D_NAMLEN -# ifndef _D_EXACT_NAMLEN -# define _D_EXACT_NAMLEN(d) ((d)->d_namlen) -# endif -# ifndef _D_ALLOC_NAMLEN -# define _D_ALLOC_NAMLEN(d) (_D_EXACT_NAMLEN (d) + 1) -# endif -#else -# ifndef _D_EXACT_NAMLEN -# define _D_EXACT_NAMLEN(d) (strlen ((d)->d_name)) -# endif -# ifndef _D_ALLOC_NAMLEN -# ifdef _DIRENT_HAVE_D_RECLEN -# define _D_ALLOC_NAMLEN(d) (((char *) (d) + (d)->d_reclen) - &(d)->d_name[0]) -# else -# define _D_ALLOC_NAMLEN(d) (sizeof (d)->d_name > 1 ? sizeof (d)->d_name : \ - _D_EXACT_NAMLEN (d) + 1) -# endif -# endif -#endif /* - * 'stpi_scandir()' - BSD scandir() replacement. + * 'getlangs()' - Get a list of available translations. */ -static int -stpi_scandir (const char *dir, - struct dirent ***namelist, - int (*sel) (const struct dirent *), - int (*cmp) (const void *, const void *)) +#ifdef ENABLE_NLS +char ** /* O - Array of languages */ +getlangs(void) { - DIR *dp = opendir (dir); - struct dirent **v = NULL; - size_t vsize = 0, i; - struct dirent *d; - int save; + int i; /* Looping var */ + char *ptr; /* Pointer into string */ + static char all_linguas[] = ALL_LINGUAS; + /* List of languages from configure.ac */ + static char **langs = NULL; /* Array of languages */ - if (dp == NULL) - return -1; - save = errno; - errno = 0; + if (!langs) + { + /* + * Create the langs array... + */ - i = 0; - while ((d = readdir (dp)) != NULL) - if (sel == NULL || (*sel) (d)) - { - struct dirent *vnew; - size_t dsize; - - /* Ignore errors from sel or readdir */ - errno = 0; - - if (i == vsize) - { - struct dirent **new; - if (vsize == 0) - vsize = 10; - else - vsize *= 2; - new = (struct dirent **) realloc (v, vsize * sizeof (*v)); - if (new == NULL) - break; - v = new; - } - - dsize = &d->d_name[_D_ALLOC_NAMLEN (d)] - (char *) d; - vnew = (struct dirent *) malloc (dsize); - if (vnew == NULL) - break; - - v[i++] = (struct dirent *) memcpy (vnew, d, dsize); - } + for (i = 1, ptr = strchr(all_linguas, ' '); ptr; ptr = strchr(ptr + 1, ' ')) + i ++; + + langs = calloc(i + 1, sizeof(char *)); - if (errno != 0) + langs[0] = all_linguas; + for (i = 1, ptr = strchr(all_linguas, ' '); ptr; ptr = strchr(ptr + 1, ' ')) { - save = errno; + *ptr = '\0'; + langs[i] = ptr + 1; + i ++; + } + } - while (i > 0) - free (v[--i]); - free (v); + return (langs); +} - i = -1; - } - else +/* + * 'set_language()' - Set the current translation language. + */ + +static void +set_language(const char *lang) /* I - Locale name */ +{ + char *l = setlocale(LC_ALL, lang ? lang : ""); + + /* Make sure the locale we tried to set was accepted! */ + if (lang && !l) { - /* Sort the list if we have a comparison function to sort with. */ - if (cmp != NULL) - qsort (v, i, sizeof (*v), cmp); + int i; + for (i = 0; i < lang_map_count; i++) + { + const locale_map *lm = &(lang_mappings[i]); + if (!strcmp(lang, lm->lang)) + { + l = setlocale(LC_ALL, lm->mapping); + if (l) + break; + } + } + } - *namelist = v; +# ifdef LC_CTYPE + setlocale(LC_CTYPE, l ? l : ""); +# endif /* LC_CTYPE */ +# ifdef LC_NUMERIC + setlocale(LC_NUMERIC, "C"); +# endif /* LC_NUMERIC */ + + /* + * Set up the catalog + */ + + if (baselocaledir) + { + if ((bindtextdomain(PACKAGE, baselocaledir)) == NULL) + { + fprintf(stderr, "cups-genppd: cannot load message catalog %s under %s: %s\n", + PACKAGE, baselocaledir, strerror(errno)); + exit(EXIT_FAILURE); } - (void) closedir (dp); - errno = save; +# ifdef DEBUG + fprintf(stderr, "DEBUG: bound textdomain: %s under %s\n", + PACKAGE, baselocaledir); +# endif /* DEBUG */ - return i; + if ((textdomain(PACKAGE)) == NULL) + { + fprintf(stderr, + "cups-genppd: cannot select message catalog %s under %s: %s\n", + PACKAGE, baselocaledir, strerror(errno)); + exit(EXIT_FAILURE); + } +# ifdef DEBUG + fprintf(stderr, "DEBUG: textdomain set: %s\n", PACKAGE); +# endif /* DEBUG */ + } } +#endif /* ENABLE_NLS */ /* - * 'checkcat()' - A callback for stpi_scandir() to check - * if a message catalogue exists + * 'is_special_option()' - Determine if an option should be grouped. */ -int -checkcat (const struct dirent *localedir) +static int /* O - 1 if non-grouped, 0 otherwise */ +is_special_option(const char *name) /* I - Option name */ { - char* catpath; - int catlen, status = 0, savederr; - struct stat catstat; - - savederr = errno; /* since we are a callback, preserve stpi_scandir() state */ - - /* LOCALEDIR / LANG / LC_MESSAGES/CATALOG */ - /* Add 3, for two '/' separators and '\0' */ - catlen = strlen(baselocaledir) + strlen(localedir->d_name) + strlen(CATALOG) + 3; - catpath = (char*) stp_malloc(catlen * sizeof(char)); - - strncpy (catpath, baselocaledir, strlen(baselocaledir)); - catlen = strlen(baselocaledir); - *(catpath+catlen) = '/'; - catlen++; - strncpy (catpath+catlen, localedir->d_name, strlen(localedir->d_name)); - catlen += strlen(localedir->d_name); - *(catpath+catlen) = '/'; - catlen++; - strncpy (catpath+catlen, CATALOG, strlen(CATALOG)); - catlen += strlen(CATALOG); - *(catpath+catlen) = '\0'; - - if (!stat (catpath, &catstat)) + int i = 0; + while (special_options[i]) { - if (S_ISREG(catstat.st_mode)) - { - status = 1; - } - } + if (strcmp(name, special_options[i]) == 0) + return 1; + i++; + } + return 0; +} + + +/* + * 'print_group_close()' - Close a UI group. + */ + +static void +print_group_close( + gzFile fp, /* I - File to write to */ + stp_parameter_class_t p_class, /* I - Option class */ + stp_parameter_level_t p_level) /* I - Option level */ +{ + gzprintf(fp, "*CloseGroup: %s %s\n\n", + gettext(parameter_class_names[p_class]), + gettext(parameter_level_names[p_level])); +} - stp_free (catpath); - errno = savederr; - return status; +/* + * 'print_group_open()' - Open a new UI group. + */ + +static void +print_group_open( + gzFile fp, /* I - File to write to */ + stp_parameter_class_t p_class, /* I - Option class */ + stp_parameter_level_t p_level) /* I - Option level */ +{ + gzprintf(fp, "*OpenGroup: %s %s\n\n", + gettext(parameter_class_names[p_class]), + gettext(parameter_level_names[p_level])); } + /* * 'write_ppd()' - Write a PPD file. */ int /* O - Exit status */ -write_ppd(const stp_printer_t *p, /* I - Printer driver */ - const char *prefix, /* I - Prefix (directory) for PPD files */ - const char *language, - int verbose, - int simplified) +write_ppd( + gzFile fp, /* I - File to write to */ + const stp_printer_t *p, /* I - Printer driver */ + const char *language, /* I - Primary language */ + const char *ppd_location, /* I - Location of PPD file */ + int simplified) /* I - 1 = simplified options */ { int i, j, k, l; /* Looping vars */ - gzFile fp; /* File to write to */ - char filename[1024]; /* Filename */ int num_opts; /* Number of printer options */ int xdpi, ydpi; /* Resolution info */ stp_vars_t *v; /* Variable info */ @@ -778,10 +998,9 @@ write_ppd(const stp_printer_t *p, /* I - Printer driver */ const char *driver; /* Driver name */ const char *long_name; /* Driver long name */ const char *manufacturer; /* Manufacturer of printer */ - const stp_vars_t *printvars; /* Printer option names */ + const stp_vars_t *printvars; /* Printer option names */ paper_t *the_papers; /* Media sizes */ int cur_opt; /* Current option */ - struct stat dir; /* prefix dir status */ int variable_sizes; /* Does the driver support variable sizes? */ int min_width, /* Min/max custom size */ min_height, @@ -795,6 +1014,7 @@ write_ppd(const stp_printer_t *p, /* I - Printer driver */ int maximum_level = simplified ? STP_PARAMETER_LEVEL_BASIC : STP_PARAMETER_LEVEL_ADVANCED4; + /* * Initialize driver-specific variables... */ @@ -806,78 +1026,25 @@ write_ppd(const stp_printer_t *p, /* I - Printer driver */ the_papers = NULL; cur_opt = 0; - /* - * Skip the PostScript drivers... - */ - - if (strcmp(stp_printer_get_family(p), "ps") == 0 || - strcmp(stp_printer_get_family(p), "raw") == 0) - return (0); - - /* - * Make sure the destination directory exists... - */ - - - if (stat(prefix, &dir) && !S_ISDIR(dir.st_mode)) - { - if (mkdir(prefix, 0777)) - { - printf("cups-genppd: Cannot create directory %s: %s\n", - prefix, strerror(errno)); - exit (EXIT_FAILURE); - } - } - - /* - * The files will be named stp-...ppd, for - * example: - * - * stp-escp2-ex.5.0.ppd - * - * or - * - * stp-escp2-ex.5.0.ppd.gz - */ - snprintf(filename, sizeof(filename) - 1, "%s/stp-%s.%s%s%s%s", - prefix, driver, GUTENPRINT_RELEASE_VERSION, - simplified ? ".sim" : "", ppdext, gzext); - - /* - * Open the PPD file... - */ - - if ((fp = gzopen(filename, "wb")) == NULL) - { - fprintf(stderr, "cups-genppd: Unable to create file \"%s\" - %s.\n", - filename, strerror(errno)); - return (2); - } - /* * Write a standard header... */ - if (verbose) - fprintf(stderr, "Writing %s...\n", filename); - else - fprintf(stderr, "."); - gzputs(fp, "*PPD-Adobe: \"4.3\"\n"); - gzputs(fp, "*%PPD file for CUPS/Gutenprint.\n"); - gzputs(fp, "*%Copyright 1993-2005 by Easy Software Products and Robert Krawitz.\n"); - gzputs(fp, "*%This program is free software; you can redistribute it and/or\n"); - gzputs(fp, "*%modify it under the terms of the GNU General Public License,\n"); - gzputs(fp, "*%version 2, as published by the Free Software Foundation.\n"); + gzputs(fp, "*% PPD file for CUPS/Gutenprint.\n"); + gzputs(fp, "*% Copyright 1993-2006 by Easy Software Products and Robert Krawitz.\n"); + gzputs(fp, "*% This program is free software; you can redistribute it and/or\n"); + gzputs(fp, "*% modify it under the terms of the GNU General Public License,\n"); + gzputs(fp, "*% version 2, as published by the Free Software Foundation.\n"); gzputs(fp, "*%\n"); - gzputs(fp, "*%This program is distributed in the hope that it will be useful, but\n"); - gzputs(fp, "*%WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\n"); - gzputs(fp, "*%or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License\n"); - gzputs(fp, "*%for more details.\n"); + gzputs(fp, "*% This program is distributed in the hope that it will be useful, but\n"); + gzputs(fp, "*% WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY\n"); + gzputs(fp, "*% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License\n"); + gzputs(fp, "*% for more details.\n"); gzputs(fp, "*%\n"); - gzputs(fp, "*%You should have received a copy of the GNU General Public License\n"); - gzputs(fp, "*%along with this program; if not, write to the Free Software\n"); - gzputs(fp, "*%Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n"); + gzputs(fp, "*% You should have received a copy of the GNU General Public License\n"); + gzputs(fp, "*% along with this program; if not, write to the Free Software\n"); + gzputs(fp, "*% Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.\n"); gzputs(fp, "*%\n"); gzputs(fp, "*FormatVersion: \"4.3\"\n"); gzputs(fp, "*FileVersion: \"" VERSION "\"\n"); @@ -925,11 +1092,11 @@ write_ppd(const stp_printer_t *p, /* I - Printer driver */ * with commas. Now use a dash instead... */ - /* - * NOTE - code in rastertoprinter looks for this version string. - * If this is changed, the corresponding change must be made in - * rastertoprinter.c. Look for "ppd->nickname" - */ + /* + * NOTE - code in rastertoprinter looks for this version string. + * If this is changed, the corresponding change must be made in + * rastertoprinter.c. Look for "ppd->nickname" + */ gzprintf(fp, "*NickName: \"%s%s%s%s\"\n", long_name, CUPS_PPD_NICKNAME_STRING, VERSION, simplified ? " Simplified" : ""); @@ -987,16 +1154,8 @@ write_ppd(const stp_printer_t *p, /* I - Printer driver */ gzputs(fp, "*cupsFilter: \"application/vnd.cups-command 33 commandtoepson\"\n"); gzputs(fp, "\n"); gzprintf(fp, "*StpDriverName: \"%s\"\n", driver); - gzprintf(fp, "*StpPPDLocation: \"%s%s%s/stp-%s.%s%s%s%s\"\n", - cups_modeldir, - cups_modeldir[strlen(cups_modeldir) - 1] == '/' ? "" : "/", - language ? language : "C", - driver, - GUTENPRINT_RELEASE_VERSION, - simplified ? ".sim" : "", - ppdext, - gzext); - gzprintf(fp, "*StpLocale: \"%s\"\n", language ? language : "C"); + gzprintf(fp, "*StpPPDLocation: \"%s\"\n", ppd_location); + gzprintf(fp, "*StpLocale: \"%s\"\n", language ? language : "C"); /* * Get the page sizes from the driver... @@ -1064,6 +1223,7 @@ write_ppd(const stp_printer_t *p, /* I - Printer driver */ the_papers[cur_opt].top = height - top; cur_opt++; + stp_clear_string_parameter(v, "PageSize"); } /* @@ -1076,6 +1236,7 @@ write_ppd(const stp_printer_t *p, /* I - Printer driver */ gzputs(fp, "*OpenUI *PageSize: PickOne\n"); gzputs(fp, "*OrderDependency: 10 AnySetup *PageSize\n"); gzprintf(fp, "*DefaultPageSize: %s\n", desc.deflt.str); + gzprintf(fp, "*StpDefaultPageSize: %s\n", desc.deflt.str); for (i = 0; i < cur_opt; i ++) { gzprintf(fp, "*PageSize %s", the_papers[i].name); @@ -1087,6 +1248,7 @@ write_ppd(const stp_printer_t *p, /* I - Printer driver */ gzputs(fp, "*OpenUI *PageRegion: PickOne\n"); gzputs(fp, "*OrderDependency: 10 AnySetup *PageRegion\n"); gzprintf(fp, "*DefaultPageRegion: %s\n", desc.deflt.str); + gzprintf(fp, "*StpDefaultPageRegion: %s\n", desc.deflt.str); for (i = 0; i < cur_opt; i ++) { gzprintf(fp, "*PageRegion %s", the_papers[i].name); @@ -1096,6 +1258,7 @@ write_ppd(const stp_printer_t *p, /* I - Printer driver */ gzputs(fp, "*CloseUI: *PageRegion\n\n"); gzprintf(fp, "*DefaultImageableArea: %s\n", desc.deflt.str); + gzprintf(fp, "*StpDefaultImageableArea: %s\n", desc.deflt.str); for (i = 0; i < cur_opt; i ++) { gzprintf(fp, "*ImageableArea %s", the_papers[i].name); @@ -1106,6 +1269,7 @@ write_ppd(const stp_printer_t *p, /* I - Printer driver */ gzputs(fp, "\n"); gzprintf(fp, "*DefaultPaperDimension: %s\n", desc.deflt.str); + gzprintf(fp, "*StpDefaultPaperDimension: %s\n", desc.deflt.str); for (i = 0; i < cur_opt; i ++) { @@ -1143,6 +1307,7 @@ write_ppd(const stp_printer_t *p, /* I - Printer driver */ gzputs(fp, "*ParamCustomPageSize WidthOffset: 3 points 0 0\n"); gzputs(fp, "*ParamCustomPageSize HeightOffset: 4 points 0 0\n"); gzputs(fp, "*ParamCustomPageSize Orientation: 5 int 0 0\n\n"); + stp_clear_string_parameter(v, "PageSize"); } stp_parameter_description_destroy(&desc); @@ -1157,9 +1322,15 @@ write_ppd(const stp_printer_t *p, /* I - Printer driver */ gzputs(fp, "*OrderDependency: 10 AnySetup *ColorModel\n"); if (printer_is_color) - gzputs(fp, "*DefaultColorModel: RGB\n"); + { + gzputs(fp, "*DefaultColorModel: RGB\n"); + gzputs(fp, "*StpDefaultColorModel: RGB\n"); + } else - gzputs(fp, "*DefaultColorModel: Gray\n"); + { + gzputs(fp, "*DefaultColorModel: Gray\n"); + gzputs(fp, "*StpDefaultColorModel: Gray\n"); + } gzprintf(fp, "*ColorModel Gray/Grayscale:\t\"<<" "/cupsColorSpace %d" @@ -1218,6 +1389,7 @@ write_ppd(const stp_printer_t *p, /* I - Printer driver */ gzputs(fp, "*OpenUI *StpColorPrecision/Color Precision: PickOne\n"); gzputs(fp, "*OrderDependency: 10 AnySetup *StpColorPrecision\n"); gzputs(fp, "*DefaultStpColorPrecision: Normal\n"); + gzputs(fp, "*StpDefaultStpColorPrecision: Normal\n"); gzputs(fp, "*StpColorPrecision Normal/Normal:\t\"<<" "/cupsBitsPerColor 8>>setpagedevice\"\n"); gzputs(fp, "*StpColorPrecision Best/Best:\t\"<<" @@ -1238,6 +1410,7 @@ write_ppd(const stp_printer_t *p, /* I - Printer driver */ gzprintf(fp, "*OpenUI *MediaType/%s: PickOne\n", _("Media Type")); gzputs(fp, "*OrderDependency: 10 AnySetup *MediaType\n"); gzprintf(fp, "*DefaultMediaType: %s\n", desc.deflt.str); + gzprintf(fp, "*StpDefaultMediaType: %s\n", desc.deflt.str); for (i = 0; i < num_opts; i ++) { @@ -1262,6 +1435,7 @@ write_ppd(const stp_printer_t *p, /* I - Printer driver */ gzprintf(fp, "*OpenUI *InputSlot/%s: PickOne\n", _("Media Source")); gzputs(fp, "*OrderDependency: 10 AnySetup *InputSlot\n"); gzprintf(fp, "*DefaultInputSlot: %s\n", desc.deflt.str); + gzprintf(fp, "*StpDefaultInputSlot: %s\n", desc.deflt.str); for (i = 0; i < num_opts; i ++) { @@ -1284,8 +1458,9 @@ write_ppd(const stp_printer_t *p, /* I - Printer driver */ stp_clear_string_parameter(v, "Resolution"); has_quality_parameter = 1; gzprintf(fp, "*OpenUI *StpQuality/%s: PickOne\n", gettext(desc.text)); - gzputs(fp, "*OrderDependency: 5 AnySetup *StpQuality\n"); + gzputs(fp, "*OrderDependency: 10 AnySetup *StpQuality\n"); gzprintf(fp, "*DefaultStpQuality: %s\n", desc.deflt.str); + gzprintf(fp, "*StpDefaultStpQuality: %s\n", desc.deflt.str); num_opts = stp_string_list_count(desc.bounds.str); for (i = 0; i < num_opts; i++) { @@ -1319,12 +1494,43 @@ write_ppd(const stp_printer_t *p, /* I - Printer driver */ if (!simplified || desc.p_level == STP_PARAMETER_LEVEL_BASIC) { +#ifdef USE_COMPLIANT_RESOLUTIONS + stp_string_list_t *res_list = stp_string_list_create(); + char res_name[64]; /* Plenty long enough for XXXxYYYdpi */ + int resolution_ok; + int tmp_xdpi, tmp_ydpi; +#endif + gzprintf(fp, "*OpenUI *Resolution/%s: PickOne\n", _("Resolution")); - gzputs(fp, "*OrderDependency: 20 AnySetup *Resolution\n"); + gzputs(fp, "*OrderDependency: 10 AnySetup *Resolution\n"); if (has_quality_parameter) - gzprintf(fp, "*DefaultResolution: None\n"); + { + gzprintf(fp, "*DefaultResolution: None\n"); + gzprintf(fp, "*StpDefaultResolution: None\n"); + } else + { +#ifdef USE_COMPLIANT_RESOLUTIONS + stp_set_string_parameter(v, "Resolution", desc.deflt.str); + stp_describe_resolution(v, &xdpi, &ydpi); + + if (xdpi == ydpi) + (void) snprintf(res_name, 63, "%ddpi", xdpi); + else + (void) snprintf(res_name, 63, "%dx%ddpi", xdpi, ydpi); + gzprintf(fp, "*DefaultResolution: %s\n", res_name); + gzprintf(fp, "*StpDefaultResolution: %s\n", res_name); + /* + * We need to add this to the resolution list here so that + * some non-default resolution won't wind up with the + * default resolution name + */ + stp_string_list_add_string(res_list, res_name, res_name); +#else /* !USE_COMPLIANT_RESOLUTIONS */ gzprintf(fp, "*DefaultResolution: %s\n", desc.deflt.str); + gzprintf(fp, "*StpDefaultResolution: %s\n", desc.deflt.str); +#endif /* USE_COMPLIANT_RESOLUTIONS */ + } stp_clear_string_parameter(v, "Quality"); if (has_quality_parameter) @@ -1342,14 +1548,38 @@ write_ppd(const stp_printer_t *p, /* I - Printer driver */ if (xdpi == -1 || ydpi == -1) continue; - /* - * Write the resolution option... - */ - +#ifdef USE_COMPLIANT_RESOLUTIONS + resolution_ok = 0; + tmp_xdpi = xdpi; + tmp_ydpi = ydpi; + do + { + if (tmp_xdpi == tmp_ydpi) + (void) snprintf(res_name, 63, "%ddpi", tmp_xdpi); + else + (void) snprintf(res_name, 63, "%dx%ddpi", tmp_xdpi, tmp_ydpi); + if (strcmp(opt->name, desc.deflt.str) == 0 || + !stp_string_list_is_present(res_list, res_name)) + { + resolution_ok = 1; + stp_string_list_add_string(res_list, res_name, res_name); + } + else if (tmp_ydpi > tmp_xdpi) + tmp_ydpi++; + else + tmp_xdpi++; + } while (!resolution_ok); + gzprintf(fp, "*Resolution %s/%s:\t\"<>setpagedevice\"\n", + res_name, opt->text, xdpi, ydpi, i + 1); +#else /* !USE_COMPLIANT_RESOLUTIONS */ gzprintf(fp, "*Resolution %s/%s:\t\"<>setpagedevice\"\n", opt->name, opt->text, xdpi, ydpi, i + 1); +#endif /* USE_COMPLIANT_RESOLUTIONS */ } +#ifdef USE_COMPLIANT_RESOLUTIONS + stp_string_list_destroy(res_list); +#endif gzputs(fp, "*CloseUI: *Resolution\n\n"); } @@ -1361,13 +1591,14 @@ write_ppd(const stp_printer_t *p, /* I - Printer driver */ gzputs(fp, "*OpenUI *OutputOrder: PickOne\n"); gzputs(fp, "*OrderDependency: 10 AnySetup *OutputOrder\n"); gzprintf(fp, "*DefaultOutputOrder: %s\n", desc.deflt.str); + gzprintf(fp, "*StpDefaultOutputOrder: %s\n", desc.deflt.str); gzputs(fp, "*OutputOrder Normal/Normal: \"\"\n"); gzputs(fp, "*OutputOrder Reverse/Reverse: \"\"\n"); gzputs(fp, "*CloseUI: *OutputOrder\n\n"); } stp_parameter_description_destroy(&desc); - /* + /* * Duplex * Note that the opt->name strings MUST match those in the printer driver(s) * else the PPD files will not be generated correctly @@ -1379,9 +1610,10 @@ write_ppd(const stp_printer_t *p, /* I - Printer driver */ num_opts = stp_string_list_count(desc.bounds.str); if (num_opts > 0) { - gzputs(fp, "*OpenUI *Duplex/Double-Sided Printing: PickOne\n"); - gzputs(fp, "*OrderDependency: 20 AnySetup *Duplex\n"); + gzprintf(fp, "*OpenUI *Duplex/%s: PickOne\n", _("2-Sided Printing")); + gzputs(fp, "*OrderDependency: 10 AnySetup *Duplex\n"); gzprintf(fp, "*DefaultDuplex: %s\n", desc.deflt.str); + gzprintf(fp, "*StpDefaultDuplex: %s\n", desc.deflt.str); for (i = 0; i < num_opts; i++) { @@ -1398,6 +1630,16 @@ write_ppd(const stp_printer_t *p, /* I - Printer driver */ } stp_parameter_description_destroy(&desc); + gzprintf(fp, "*OpenUI *StpiShrinkOutput/%s: PickOne\n", + _("Shrink Page If Necessary to Fit Borders")); + gzputs(fp, "*OrderDependency: 10 AnySetup *StpiShrinkOutput\n"); + gzputs(fp, "*DefaultStpiShrinkOutput: Shrink\n"); + gzputs(fp, "*StpDefaultStpiShrinkOutput: Shrink\n"); + gzprintf(fp, "*StpiShrinkOutput %s/%s: \"\"\n", "Shrink", _("Shrink (print the whole page)")); + gzprintf(fp, "*StpiShrinkOutput %s/%s: \"\"\n", "Crop", _("Crop (preserve dimensions)")); + gzprintf(fp, "*StpiShrinkOutput %s/%s: \"\"\n", "Expand", _("Expand (use maximum page area)")); + gzputs(fp, "*CloseUI: *StpiShrinkOutput\n\n"); + param_list = stp_get_parameter_list(v); for (j = 0; j <= STP_PARAMETER_CLASS_OUTPUT; j++) @@ -1429,23 +1671,25 @@ write_ppd(const stp_printer_t *p, /* I - Printer driver */ } gzprintf(fp, "*OpenUI *Stp%s/%s: PickOne\n", desc.name, gettext(desc.text)); -#if 0 - gzprintf(fp, "*OrderDependency: %d AnySetup *Stp%s\n", - (100 + l + (j * param_count) + - (k * STP_PARAMETER_LEVEL_INTERNAL * param_count)), + gzprintf(fp, "*OrderDependency: 10 AnySetup *Stp%s\n", desc.name); -#endif - if (!desc.is_mandatory) - gzprintf(fp, "*DefaultStp%s: None\n", desc.name); switch (desc.p_type) { case STP_PARAMETER_TYPE_STRING_LIST: if (desc.is_mandatory) - gzprintf(fp, "*DefaultStp%s: %s\n", - desc.name, desc.deflt.str); + { + gzprintf(fp, "*DefaultStp%s: %s\n", + desc.name, desc.deflt.str); + gzprintf(fp, "*StpDefaultStp%s: %s\n", + desc.name, desc.deflt.str); + } else - gzprintf(fp, "*Stp%s %s/%s: \"\"\n", desc.name, - "None", _("None")); + { + gzprintf(fp, "*DefaultStp%s: None\n", desc.name); + gzprintf(fp, "*StpDefaultStp%s: None\n", desc.name); + gzprintf(fp, "*Stp%s %s/%s: \"\"\n", desc.name, + "None", _("None")); + } num_opts = stp_string_list_count(desc.bounds.str); for (i = 0; i < num_opts; i++) { @@ -1456,21 +1700,27 @@ write_ppd(const stp_printer_t *p, /* I - Printer driver */ break; case STP_PARAMETER_TYPE_BOOLEAN: if (desc.is_mandatory) - gzprintf(fp, "*DefaultStp%s: %s\n", desc.name, - desc.deflt.boolean ? "True" : "False"); + { + gzprintf(fp, "*DefaultStp%s: %s\n", desc.name, + desc.deflt.boolean ? "True" : "False"); + gzprintf(fp, "*StpDefaultStp%s: %s\n", desc.name, + desc.deflt.boolean ? "True" : "False"); + } else - gzprintf(fp, "*Stp%s %s/%s: \"\"\n", desc.name, - "None", _("None")); + { + gzprintf(fp, "*DefaultStp%s: None\n", desc.name); + gzprintf(fp, "*StpDefaultStp%s: None\n", desc.name); + gzprintf(fp, "*Stp%s %s/%s: \"\"\n", desc.name, + "None", _("None")); + } gzprintf(fp, "*Stp%s %s/%s: \"\"\n", desc.name, "False", _("No")); gzprintf(fp, "*Stp%s %s/%s: \"\"\n", desc.name, "True", _("Yes")); break; case STP_PARAMETER_TYPE_DOUBLE: - if (desc.is_mandatory) - { - gzprintf(fp, "*DefaultStp%s: None\n", desc.name); - } + gzprintf(fp, "*DefaultStp%s: None\n", desc.name); + gzprintf(fp, "*StpDefaultStp%s: None\n", desc.name); for (i = desc.bounds.dbl.lower * 1000; i <= desc.bounds.dbl.upper * 1000 ; i += 100) { @@ -1491,11 +1741,21 @@ write_ppd(const stp_printer_t *p, /* I - Printer driver */ gzprintf(fp, "*Stp%s None/%.3f: \"\"\n", desc.name, desc.deflt.dbl); gzprintf(fp, "*CloseUI: *Stp%s\n\n", desc.name); + + /* + * Add custom option code and value parameter... + */ + + gzprintf(fp, "*CustomStp%s True: \"pop\"\n", desc.name); + gzprintf(fp, "*ParamCustomStp%s Value/%s: 1 real %.3f %.3f\n\n", + desc.name, _("Value"), desc.bounds.dbl.lower, + desc.bounds.dbl.upper); if (!simplified) { gzprintf(fp, "*OpenUI *StpFine%s/%s %s: PickOne\n", desc.name, gettext(desc.text), _("Fine Adjustment")); gzprintf(fp, "*DefaultStpFine%s:None\n", desc.name); + gzprintf(fp, "*StpDefaultStpFine%s:None\n", desc.name); gzprintf(fp, "*StpFine%s None/0.000: \"\"\n", desc.name); for (i = 0; i < 100; i += 5) gzprintf(fp, "*StpFine%s %d/%.3f: \"\"\n", @@ -1503,15 +1763,23 @@ write_ppd(const stp_printer_t *p, /* I - Printer driver */ gzprintf(fp, "*CloseUI: *StpFine%s\n\n", desc.name); } print_close_ui = 0; - + break; case STP_PARAMETER_TYPE_DIMENSION: if (desc.is_mandatory) - gzprintf(fp, "*DefaultStp%s: %d\n", - desc.name, desc.deflt.dimension); + { + gzprintf(fp, "*DefaultStp%s: %d\n", + desc.name, desc.deflt.dimension); + gzprintf(fp, "*StpDefaultStp%s: %d\n", + desc.name, desc.deflt.dimension); + } else - gzprintf(fp, "*Stp%s %s/%s: \"\"\n", desc.name, - "None", _("None")); + { + gzprintf(fp, "*DefaultStp%s: None\n", desc.name); + gzprintf(fp, "*StpDefaultStp%s: None\n", desc.name); + gzprintf(fp, "*Stp%s %s/%s: \"\"\n", desc.name, + "None", _("None")); + } for (i = desc.bounds.dimension.lower; i <= desc.bounds.dimension.upper; i++) { @@ -1523,6 +1791,20 @@ write_ppd(const stp_printer_t *p, /* I - Printer driver */ gzprintf(fp, "*Stp%s %d/%.1f mm: \"\"\n", desc.name, i, ((double) i) * 25.4 / 72); } + + print_close_ui = 0; + gzprintf(fp, "*CloseUI: *Stp%s\n\n", desc.name); + + /* + * Add custom option code and value parameter... + */ + + gzprintf(fp, "*CustomStp%s True: \"pop\"\n", desc.name); + gzprintf(fp, "*ParamCustomStp%s Value/%s: 1 points %d %d\n\n", + desc.name, _("Value"), + desc.bounds.dimension.lower, + desc.bounds.dimension.upper); + break; default: break; @@ -1579,12 +1861,9 @@ write_ppd(const stp_printer_t *p, /* I - Printer driver */ gzputs(fp, "*Font ZapfChancery-MediumItalic: Standard \"(001.007S)\" Standard ROM\n"); gzputs(fp, "*Font ZapfDingbats: Special \"(001.004S)\" Standard ROM\n"); - gzprintf(fp, "\n*%%End of stp-%s.%s%s\n", - driver, - GUTENPRINT_RELEASE_VERSION, - ppdext); - - gzclose(fp); + gzprintf(fp, "\n*%% End of stp-%s.%s%s%s\n", + driver, GUTENPRINT_RELEASE_VERSION, simplified ? ".sim" : "", + ppdext); stp_vars_destroy(v); return (0); @@ -1592,5 +1871,5 @@ write_ppd(const stp_printer_t *p, /* I - Printer driver */ /* - * End of "$Id: genppd.c,v 1.118 2006/05/28 16:59:03 rlk Exp $". + * End of "$Id: genppd.c,v 1.119.2.3 2007/05/29 01:47:26 rlk Exp $". */ diff --git a/src/cups/rastertoprinter.c b/src/cups/rastertoprinter.c index 626fcf9..52d3592 100644 --- a/src/cups/rastertoprinter.c +++ b/src/cups/rastertoprinter.c @@ -1,9 +1,9 @@ /* - * "$Id: rastertoprinter.c,v 1.104 2006/07/04 02:19:14 rlk Exp $" + * "$Id: rastertoprinter.c,v 1.105.2.1 2007/03/02 12:01:16 rlk Exp $" * * Gutenprint based raster filter for the Common UNIX Printing System. * - * Copyright 1993-2003 by Easy Software Products. + * Copyright 1993-2007 by Easy Software Products. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License, @@ -89,6 +89,7 @@ typedef struct int adjusted_width; int adjusted_height; int last_percent; + int shrink_to_fit; cups_page_header_t header; /* Page header from file */ } cups_image_t; @@ -219,6 +220,7 @@ print_debug_block(const stp_vars_t *v, const cups_image_t *cups) fprintf(stderr, "DEBUG: Gutenprint stp_get_top(v) |%d|\n", stp_get_top(v)); fprintf(stderr, "DEBUG: Gutenprint stp_get_page_width(v) |%d|\n", stp_get_page_width(v)); fprintf(stderr, "DEBUG: Gutenprint stp_get_page_height(v) |%d|\n", stp_get_page_height(v)); + fprintf(stderr, "DEBUG: Gutenprint shrink page to fit %d\n", cups->shrink_to_fit); params = stp_get_parameter_list(v); nparams = stp_parameter_list_count(params); for (i = 0; i < nparams; i++) @@ -347,13 +349,13 @@ initialize_page(cups_image_t *cups, const stp_vars_t *default_settings) switch (cups->header.cupsColorSpace) { case CUPS_CSPACE_W : - /* Olympus photo printers don't support black & white ink! */ + /* DyeSub photo printers don't support black & white ink! */ if (printer_supports_bw(v)) set_string_parameter(v, "PrintingMode", "BW"); set_string_parameter(v, "InputImageType", "Whitescale"); break; case CUPS_CSPACE_K : - /* Olympus photo printers don't support black & white ink! */ + /* DyeSub photo printers don't support black & white ink! */ if (printer_supports_bw(v)) set_string_parameter(v, "PrintingMode", "BW"); set_string_parameter(v, "InputImageType", "Grayscale"); @@ -413,6 +415,8 @@ initialize_page(cups_image_t *cups, const stp_vars_t *default_settings) set_string_parameter(v, "Duplex", "DuplexNoTumble"); } + cups->shrink_to_fit = stp_get_int_parameter(v, "CUPSShrinkPage"); + set_string_parameter(v, "JobMode", "Job"); validate_options(v, cups); stp_get_media_size(v, &(cups->width), &(cups->height)); @@ -437,9 +441,14 @@ initialize_page(cups_image_t *cups, const stp_vars_t *default_settings) tmp_height = cups->bottom - cups->top; if (tmp_left < cups->left) { - cups->left_trim = cups->left - tmp_left; + if (cups->shrink_to_fit != 1) + { + cups->left_trim = cups->left - tmp_left; + tmp_left = cups->left; + } + else + cups->left_trim = 0; fprintf(stderr, "DEBUG: Gutenprint left margin %d\n", cups->left_trim); - tmp_left = cups->left; } else { @@ -450,9 +459,14 @@ initialize_page(cups_image_t *cups, const stp_vars_t *default_settings) } if (tmp_right > cups->right) { - cups->right_trim = tmp_right - cups->right; + if (cups->shrink_to_fit != 1) + { + cups->right_trim = tmp_right - cups->right; + tmp_right = cups->right; + } + else + cups->right_trim = 0; fprintf(stderr, "DEBUG: Gutenprint right margin %d\n", cups->right_trim); - tmp_right = cups->right; } else { @@ -463,9 +477,14 @@ initialize_page(cups_image_t *cups, const stp_vars_t *default_settings) } if (tmp_top < cups->top) { - cups->top_trim = cups->top - tmp_top; + if (cups->shrink_to_fit != 1) + { + cups->top_trim = cups->top - tmp_top; + tmp_top = cups->top; + } + else + cups->top_trim = 0; fprintf(stderr, "DEBUG: Gutenprint top margin %d\n", cups->top_trim); - tmp_top = cups->top; } else { @@ -476,9 +495,14 @@ initialize_page(cups_image_t *cups, const stp_vars_t *default_settings) } if (tmp_bottom > cups->bottom) { - cups->bottom_trim = tmp_bottom - cups->bottom; + if (cups->shrink_to_fit != 1) + { + cups->bottom_trim = tmp_bottom - cups->bottom; + tmp_bottom = cups->bottom; + } + else + cups->bottom_trim = 0; fprintf(stderr, "DEBUG: Gutenprint bottom margin %d\n", cups->bottom_trim); - tmp_bottom = cups->bottom; } else { @@ -488,13 +512,28 @@ initialize_page(cups_image_t *cups, const stp_vars_t *default_settings) cups->bottom = tmp_bottom; } - stp_set_width(v, cups->right - cups->left); - stp_set_height(v, cups->bottom - cups->top); - stp_set_left(v, cups->left); - stp_set_top(v, cups->top); + if (cups->shrink_to_fit == 2) + { + int t_left, t_right, t_bottom, t_top; + stp_get_imageable_area(v, &(t_left), &(t_right), &(t_bottom), &(t_top)); + stp_set_width(v, t_right - t_left); + stp_set_height(v, t_bottom - t_top); + stp_set_left(v, t_left); + stp_set_top(v, t_top); + } + else + { + stp_set_width(v, cups->right - cups->left); + stp_set_height(v, cups->bottom - cups->top); + stp_set_left(v, cups->left); + stp_set_top(v, cups->top); + } cups->right = cups->width - cups->right; - cups->width = cups->width - cups->left - cups->right; + if (cups->shrink_to_fit == 1) + cups->width = tmp_right - tmp_left; + else + cups->width = cups->width - cups->left - cups->right; cups->width = cups->header.HWResolution[0] * cups->width / 72; cups->left = cups->header.HWResolution[0] * cups->left / 72; cups->right = cups->header.HWResolution[0] * cups->right / 72; @@ -505,7 +544,10 @@ initialize_page(cups_image_t *cups, const stp_vars_t *default_settings) cups->adjusted_width = cups->header.cupsWidth; cups->bottom = cups->height - cups->bottom; - cups->height = cups->height - cups->top - cups->bottom; + if (cups->shrink_to_fit == 1) + cups->height = tmp_bottom - tmp_top; + else + cups->height = cups->height - cups->top - cups->bottom; cups->height = cups->header.HWResolution[1] * cups->height / 72; cups->top = cups->header.HWResolution[1] * cups->top / 72; cups->bottom = cups->header.HWResolution[1] * cups->bottom / 72; @@ -546,14 +588,32 @@ set_all_options(stp_vars_t *v, cups_option_t *options, int num_options, stp_parameter_list_t params = stp_get_parameter_list(v); int nparams = stp_parameter_list_count(params); int i; + const char *val; /* CUPS option value */ + ppd_option_t *ppd_option; + val = cupsGetOption("StpiShrinkOutput", num_options, options); + if (!val) + { + ppd_option = ppdFindOption(ppd, "StpiShrinkOutput"); + if (ppd_option) + val = ppd_option->defchoice; + } + if (val) + { + if (!strcasecmp(val, "crop")) + stp_set_int_parameter(v, "CUPSShrinkPage", 0); + else if (!strcasecmp(val, "expand")) + stp_set_int_parameter(v, "CUPSShrinkPage", 2); + else + stp_set_int_parameter(v, "CUPSShrinkPage", 1); + } + else + stp_set_int_parameter(v, "CUPSShrinkPage", 1); for (i = 0; i < nparams; i++) { const stp_parameter_t *param = stp_parameter_list_param(params, i); stp_parameter_t desc; char *ppd_option_name = stp_malloc(strlen(param->name) + 8); /* StpFineFOO\0 */ - const char *val; /* CUPS option value */ - ppd_option_t *ppd_option; stp_describe_parameter(v, param->name, &desc); if (desc.p_type == STP_PARAMETER_TYPE_DOUBLE) { @@ -565,7 +625,17 @@ set_all_options(stp_vars_t *v, cups_option_t *options, int num_options, if (ppd_option) val = ppd_option->defchoice; } - if (val && strlen(val) > 0 && strcmp(val, "None") != 0) + if (val && !strncasecmp(val, "Custom.", 7)) + { + double dval = atof(val + 7); + + fprintf(stderr, "DEBUG: Gutenprint set float %s to %f\n", + desc.name, dval); + if (dval > desc.bounds.dbl.upper) + dval = desc.bounds.dbl.upper; + stp_set_float_parameter(v, desc.name, dval); + } + else if (val && strlen(val) > 0 && strcmp(val, "None") != 0) { double coarse_val = atof(val) * 0.001; double fine_val = 0; @@ -608,13 +678,20 @@ set_all_options(stp_vars_t *v, cups_option_t *options, int num_options, set_string_parameter(v, desc.name, val); break; case STP_PARAMETER_TYPE_INT: + if (!strncasecmp(val, "Custom.", 7)) + val += 7; + fprintf(stderr, "DEBUG: Gutenprint set int %s to %s\n", desc.name, val); stp_set_int_parameter(v, desc.name, atoi(val)); break; case STP_PARAMETER_TYPE_DIMENSION: + if (!strncasecmp(val, "Custom.", 7)) + val += 7; + fprintf(stderr, "DEBUG: Gutenprint set dimension %s to %s\n", desc.name, val); + stp_set_dimension_parameter(v, desc.name, atoi(val)); break; case STP_PARAMETER_TYPE_BOOLEAN: @@ -979,7 +1056,7 @@ cups_errfunc(void *file, const char *buf, size_t bytes) * 'cancel_job()' - Cancel the current job... */ -void +static void cancel_job(int sig) /* I - Signal */ { (void)sig; @@ -1018,7 +1095,7 @@ throwaway_data(int amount, cups_image_t *cups) cupsRasterReadPixels(cups->ras, trash, leftover); } -stp_image_status_t +static stp_image_status_t Image_get_row(stp_image_t *image, /* I - Image */ unsigned char *data, /* O - Row */ size_t byte_limit, /* I - how many bytes in data */ @@ -1201,5 +1278,5 @@ Image_width(stp_image_t *image) /* I - Image */ /* - * End of "$Id: rastertoprinter.c,v 1.104 2006/07/04 02:19:14 rlk Exp $". + * End of "$Id: rastertoprinter.c,v 1.105.2.1 2007/03/02 12:01:16 rlk Exp $". */ diff --git a/src/escputil/Makefile.in b/src/escputil/Makefile.in index b07898b..95fee43 100644 --- a/src/escputil/Makefile.in +++ b/src/escputil/Makefile.in @@ -48,11 +48,12 @@ subdir = src/escputil ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ $(top_srcdir)/m4/gimp.m4 $(top_srcdir)/m4/iconv.m4 \ - $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ - $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/progtest.m4 \ - $(top_srcdir)/m4/stp.m4 $(top_srcdir)/m4/stp_cups.m4 \ - $(top_srcdir)/m4/stp_gimp.m4 $(top_srcdir)/m4/stp_option.m4 \ - $(top_srcdir)/m4/stp_release.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/isc-posix.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/stp.m4 \ + $(top_srcdir)/m4/stp_cups.m4 $(top_srcdir)/m4/stp_gimp.m4 \ + $(top_srcdir)/m4/stp_option.m4 $(top_srcdir)/m4/stp_release.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/scripts/mkinstalldirs @@ -67,8 +68,8 @@ am__DEPENDENCIES_1 = $(top_builddir)/src/main/libgutenprint.la am__DEPENDENCIES_2 = escputil_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -depcomp = -am__depfiles_maybe = +depcomp = $(SHELL) $(top_srcdir)/scripts/depcomp +am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ @@ -84,13 +85,18 @@ CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ +BUILD_CUPS_1_2_FALSE = @BUILD_CUPS_1_2_FALSE@ +BUILD_CUPS_1_2_TRUE = @BUILD_CUPS_1_2_TRUE@ BUILD_CUPS_FALSE = @BUILD_CUPS_FALSE@ +BUILD_CUPS_PPDS = @BUILD_CUPS_PPDS@ BUILD_CUPS_PPDS_FALSE = @BUILD_CUPS_PPDS_FALSE@ BUILD_CUPS_PPDS_TRUE = @BUILD_CUPS_PPDS_TRUE@ BUILD_CUPS_TRUE = @BUILD_CUPS_TRUE@ @@ -116,6 +122,8 @@ BUILD_LIBGUTENPRINTUI_FALSE = @BUILD_LIBGUTENPRINTUI_FALSE@ BUILD_LIBGUTENPRINTUI_TRUE = @BUILD_LIBGUTENPRINTUI_TRUE@ BUILD_MODULES_FALSE = @BUILD_MODULES_FALSE@ BUILD_MODULES_TRUE = @BUILD_MODULES_TRUE@ +BUILD_SIMPLIFIED_CUPS_PPDS_FALSE = @BUILD_SIMPLIFIED_CUPS_PPDS_FALSE@ +BUILD_SIMPLIFIED_CUPS_PPDS_TRUE = @BUILD_SIMPLIFIED_CUPS_PPDS_TRUE@ BUILD_TESTPATTERN_FALSE = @BUILD_TESTPATTERN_FALSE@ BUILD_TESTPATTERN_TRUE = @BUILD_TESTPATTERN_TRUE@ BUILD_TEST_FALSE = @BUILD_TEST_FALSE@ @@ -123,6 +131,7 @@ BUILD_TEST_TRUE = @BUILD_TEST_TRUE@ BUILD_TRANSLATED_CUPS_PPDS_FALSE = @BUILD_TRANSLATED_CUPS_PPDS_FALSE@ BUILD_TRANSLATED_CUPS_PPDS_TRUE = @BUILD_TRANSLATED_CUPS_PPDS_TRUE@ CC = @CC@ +CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CONVERT = @CONVERT@ CPP = @CPP@ @@ -135,12 +144,14 @@ CUPS_PPDS_AT_TOP_LEVEL_TRUE = @CUPS_PPDS_AT_TOP_LEVEL_TRUE@ CUPS_PPD_PS_LEVEL = @CUPS_PPD_PS_LEVEL@ CXX = @CXX@ CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DB2HTML = @DB2HTML@ DB2PDF = @DB2PDF@ DB2PS = @DB2PS@ DEFS = @DEFS@ +DEPDIR = @DEPDIR@ DIALOG = @DIALOG@ DOXYGEN = @DOXYGEN@ DVIPDF = @DVIPDF@ @@ -175,6 +186,7 @@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GMSGFMT = @GMSGFMT@ GNUCFLAGS = @GNUCFLAGS@ +GREP = @GREP@ GTK2_CFLAGS = @GTK2_CFLAGS@ GTK2_LIBS = @GTK2_LIBS@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -270,14 +282,17 @@ VERSION = @VERSION@ WHICH_PPDS = @WHICH_PPDS@ XGETTEXT = @XGETTEXT@ YACC = @YACC@ -ac_ct_AR = @ac_ct_AR@ +YFLAGS = @YFLAGS@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ @@ -294,6 +309,9 @@ cups_exec_prefix = @cups_exec_prefix@ cups_prefix = @cups_prefix@ cups_sbindir = @cups_sbindir@ datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ exec_prefix = @exec_prefix@ gimp2_plug_indir = @gimp2_plug_indir@ gimp_plug_indir = @gimp_plug_indir@ @@ -311,17 +329,21 @@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ +htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ +localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ +psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ @@ -343,9 +365,9 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu --ignore-deps src/escputil/Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/escputil/Makefile'; \ cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu --ignore-deps src/escputil/Makefile + $(AUTOMAKE) --gnu src/escputil/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ @@ -401,14 +423,29 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/d4lib.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/escputil.Po@am__quote@ + .c.o: - $(COMPILE) -c $< +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: - $(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: - $(LTCOMPILE) -c -o $@ $< +@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo @@ -533,6 +570,7 @@ clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am + -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags @@ -558,6 +596,7 @@ install-man: installcheck-am: maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic diff --git a/src/escputil/escputil.c b/src/escputil/escputil.c index ffaacec..5394b77 100644 --- a/src/escputil/escputil.c +++ b/src/escputil/escputil.c @@ -1,5 +1,5 @@ /* - * "$Id: escputil.c,v 1.87 2006/05/31 08:31:59 rleigh Exp $" + * "$Id: escputil.c,v 1.87.8.1 2007/05/29 01:47:27 rlk Exp $" * * Printer maintenance utility for EPSON Stylus (R) printers * @@ -285,7 +285,7 @@ main(int argc, char **argv) int c; /* Set up gettext */ -#ifdef ENABLE_NLS +#ifdef HAVE_LOCALE_H setlocale (LC_ALL, ""); bindtextdomain (PACKAGE, PACKAGE_LOCALE_DIR); #endif diff --git a/src/foomatic/Makefile.in b/src/foomatic/Makefile.in index 897cfb3..830736e 100644 --- a/src/foomatic/Makefile.in +++ b/src/foomatic/Makefile.in @@ -53,11 +53,12 @@ subdir = src/foomatic ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ $(top_srcdir)/m4/gimp.m4 $(top_srcdir)/m4/iconv.m4 \ - $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ - $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/progtest.m4 \ - $(top_srcdir)/m4/stp.m4 $(top_srcdir)/m4/stp_cups.m4 \ - $(top_srcdir)/m4/stp_gimp.m4 $(top_srcdir)/m4/stp_option.m4 \ - $(top_srcdir)/m4/stp_release.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/isc-posix.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/stp.m4 \ + $(top_srcdir)/m4/stp_cups.m4 $(top_srcdir)/m4/stp_gimp.m4 \ + $(top_srcdir)/m4/stp_option.m4 $(top_srcdir)/m4/stp_release.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/scripts/mkinstalldirs @@ -81,8 +82,8 @@ am_printers_OBJECTS = printers.$(OBJEXT) printers_OBJECTS = $(am_printers_OBJECTS) printers_DEPENDENCIES = $(am__DEPENDENCIES_1) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -depcomp = -am__depfiles_maybe = +depcomp = $(SHELL) $(top_srcdir)/scripts/depcomp +am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ @@ -102,13 +103,18 @@ CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ +BUILD_CUPS_1_2_FALSE = @BUILD_CUPS_1_2_FALSE@ +BUILD_CUPS_1_2_TRUE = @BUILD_CUPS_1_2_TRUE@ BUILD_CUPS_FALSE = @BUILD_CUPS_FALSE@ +BUILD_CUPS_PPDS = @BUILD_CUPS_PPDS@ BUILD_CUPS_PPDS_FALSE = @BUILD_CUPS_PPDS_FALSE@ BUILD_CUPS_PPDS_TRUE = @BUILD_CUPS_PPDS_TRUE@ BUILD_CUPS_TRUE = @BUILD_CUPS_TRUE@ @@ -134,6 +140,8 @@ BUILD_LIBGUTENPRINTUI_FALSE = @BUILD_LIBGUTENPRINTUI_FALSE@ BUILD_LIBGUTENPRINTUI_TRUE = @BUILD_LIBGUTENPRINTUI_TRUE@ BUILD_MODULES_FALSE = @BUILD_MODULES_FALSE@ BUILD_MODULES_TRUE = @BUILD_MODULES_TRUE@ +BUILD_SIMPLIFIED_CUPS_PPDS_FALSE = @BUILD_SIMPLIFIED_CUPS_PPDS_FALSE@ +BUILD_SIMPLIFIED_CUPS_PPDS_TRUE = @BUILD_SIMPLIFIED_CUPS_PPDS_TRUE@ BUILD_TESTPATTERN_FALSE = @BUILD_TESTPATTERN_FALSE@ BUILD_TESTPATTERN_TRUE = @BUILD_TESTPATTERN_TRUE@ BUILD_TEST_FALSE = @BUILD_TEST_FALSE@ @@ -141,6 +149,7 @@ BUILD_TEST_TRUE = @BUILD_TEST_TRUE@ BUILD_TRANSLATED_CUPS_PPDS_FALSE = @BUILD_TRANSLATED_CUPS_PPDS_FALSE@ BUILD_TRANSLATED_CUPS_PPDS_TRUE = @BUILD_TRANSLATED_CUPS_PPDS_TRUE@ CC = @CC@ +CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CONVERT = @CONVERT@ CPP = @CPP@ @@ -153,12 +162,14 @@ CUPS_PPDS_AT_TOP_LEVEL_TRUE = @CUPS_PPDS_AT_TOP_LEVEL_TRUE@ CUPS_PPD_PS_LEVEL = @CUPS_PPD_PS_LEVEL@ CXX = @CXX@ CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DB2HTML = @DB2HTML@ DB2PDF = @DB2PDF@ DB2PS = @DB2PS@ DEFS = @DEFS@ +DEPDIR = @DEPDIR@ DIALOG = @DIALOG@ DOXYGEN = @DOXYGEN@ DVIPDF = @DVIPDF@ @@ -193,6 +204,7 @@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GMSGFMT = @GMSGFMT@ GNUCFLAGS = @GNUCFLAGS@ +GREP = @GREP@ GTK2_CFLAGS = @GTK2_CFLAGS@ GTK2_LIBS = @GTK2_LIBS@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -288,14 +300,17 @@ VERSION = @VERSION@ WHICH_PPDS = @WHICH_PPDS@ XGETTEXT = @XGETTEXT@ YACC = @YACC@ -ac_ct_AR = @ac_ct_AR@ +YFLAGS = @YFLAGS@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ @@ -312,6 +327,9 @@ cups_exec_prefix = @cups_exec_prefix@ cups_prefix = @cups_prefix@ cups_sbindir = @cups_sbindir@ datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ exec_prefix = @exec_prefix@ gimp2_plug_indir = @gimp2_plug_indir@ gimp_plug_indir = @gimp_plug_indir@ @@ -329,17 +347,21 @@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ +htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ +localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ +psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ @@ -381,9 +403,9 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu --ignore-deps src/foomatic/Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/foomatic/Makefile'; \ cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu --ignore-deps src/foomatic/Makefile + $(AUTOMAKE) --gnu src/foomatic/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ @@ -434,14 +456,32 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gutenprint-version.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/paper_sizes.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printer_margins.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printer_options.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printers.Po@am__quote@ + .c.o: - $(COMPILE) -c $< +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: - $(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: - $(LTCOMPILE) -c -o $@ $< +@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo @@ -568,6 +608,7 @@ clean-am: clean-generic clean-libtool clean-local clean-noinstPROGRAMS \ mostlyclean-am distclean: distclean-am + -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags @@ -593,6 +634,7 @@ install-man: installcheck-am: maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic diff --git a/src/foomatic/foomatic-generator.in b/src/foomatic/foomatic-generator.in index 02a863c..c72679d 100644 --- a/src/foomatic/foomatic-generator.in +++ b/src/foomatic/foomatic-generator.in @@ -110,10 +110,12 @@ print STDERR "done.\n"; if ($foomatic3) { open PIPE, "./printer_margins $simplified_subopt|" or die "Cannot run printer_margins: $!\n"; print STDERR "Loading margins from ./printer_margins $simplified_subopt..."; - $code = join('', ); - #print $code; + while() { + #print $_; + next if m!^#!; + eval $_; + } close PIPE or die "Cannot run printer_margins: $!\n"; - eval $code or die "Cannot run printer_margins: $!\n"; print STDERR "done.\n"; } @@ -223,11 +225,11 @@ if ($foomatic3) { # for each value range. Therefore the filenames of numerical options # are numbered (eg. Contrast-1.xml). for $a (keys(%stp_float_values)) { - for $vtmp (keys %{$stp_float_values{$a}}) { - for $otmp (keys %{$stp_float_values{$a}{$vtmp}}) { - my $min = $stp_float_values{$a}{'MINVAL'}{$otmp}; - my $max = $stp_float_values{$a}{'MAXVAL'}{$otmp}; - my $def = $stp_float_values{$a}{'DEFVAL'}{$otmp}; + for $otmp (keys %{$stp_float_values{$a}}) { + for $vtmp (keys %{$stp_float_values{$a}{$otmp}}) { + my $min = $stp_float_values{$a}{$otmp}{'MINVAL'}; + my $max = $stp_float_values{$a}{$otmp}{'MAXVAL'}; + my $def = $stp_float_values{$a}{$otmp}{'DEFVAL'}; # Skip options with invalid values, the library contains such # options in the case when only one constant value is allowed next if (($min >= $max) || ($def < $min) || ($def > $max)); @@ -245,11 +247,11 @@ for $a (keys(%stp_float_values)) { } } for $a (keys(%stp_int_values)) { - for $vtmp (keys %{$stp_int_values{$a}}) { - for $otmp (keys %{$stp_int_values{$a}{$vtmp}}) { - my $min = $stp_int_values{$a}{'MINVAL'}{$otmp}; - my $max = $stp_int_values{$a}{'MAXVAL'}{$otmp}; - my $def = $stp_int_values{$a}{'DEFVAL'}{$otmp}; + for $otmp (keys %{$stp_int_values{$a}}) { + for $vtmp (keys %{$stp_int_values{$a}{$otmp}}) { + my $min = $stp_int_values{$a}{$otmp}{'MINVAL'}; + my $max = $stp_int_values{$a}{$otmp}{'MAXVAL'}; + my $def = $stp_int_values{$a}{$otmp}{'DEFVAL'}; # Skip options with invalid values, the library contains such # options in the case when only one constant value is allowed next if (($min >= $max) || ($def < $min) || ($def > $max)); @@ -268,11 +270,11 @@ for $a (keys(%stp_int_values)) { } for $a (keys(%stp_dimension_values)) { - for $vtmp (keys %{$stp_dimension_values{$a}}) { - for $otmp (keys %{$stp_dimension_values{$a}{$vtmp}}) { - my $min = $stp_dimension_values{$a}{'MINVAL'}{$otmp}; - my $max = $stp_dimension_values{$a}{'MAXVAL'}{$otmp}; - my $def = $stp_dimension_values{$a}{'DEFVAL'}{$otmp}; + for $otmp (keys %{$stp_dimension_values{$a}}) { + for $vtmp (keys %{$stp_dimension_values{$a}{$otmp}}) { + my $min = $stp_dimension_values{$a}{$otmp}{'MINVAL'}; + my $max = $stp_dimension_values{$a}{$otmp}{'MAXVAL'}; + my $def = $stp_dimension_values{$a}{$otmp}{'DEFVAL'}; # Skip options with invalid values, the library contains such # options in the case when only one constant value is allowed next if (($min >= $max) || ($def < $min) || ($def > $max)); @@ -844,22 +846,22 @@ sub build_num_cons { # this option and a default value for it. my $stpdef; if ((defined($stpdef = - $stp_float_values{$stpname}{"DEFVAL"}{$stpopt})) || + $stp_float_values{$stpname}{$stpopt}{"DEFVAL"})) || (defined($stpdef = - $stp_int_values{$stpname}{"DEFVAL"}{$stpopt})) || + $stp_int_values{$stpname}{$stpopt}{"DEFVAL"})) || (defined($stpdef = - $stp_dimension_values{$stpname}{"DEFVAL"}{$stpopt}))) { + $stp_dimension_values{$stpname}{$stpopt}{"DEFVAL"}))) { # Find minimum and maximum my ($min, $max); if ($type eq "float") { - $min = $stp_float_values{$stpname}{"MINVAL"}{$stpopt}; - $max = $stp_float_values{$stpname}{"MAXVAL"}{$stpopt}; + $min = $stp_float_values{$stpname}{$stpopt}{"MINVAL"}; + $max = $stp_float_values{$stpname}{$stpopt}{"MAXVAL"}; } elsif ($type eq "dimension") { - $min = $stp_dimension_values{$stpname}{"MINVAL"}{$stpopt}; - $max = $stp_dimension_values{$stpname}{"MAXVAL"}{$stpopt}; + $min = $stp_dimension_values{$stpname}{$stpopt}{"MINVAL"}; + $max = $stp_dimension_values{$stpname}{$stpopt}{"MAXVAL"}; } else { - $min = $stp_int_values{$stpname}{"MINVAL"}{$stpopt}; - $max = $stp_int_values{$stpname}{"MAXVAL"}{$stpopt}; + $min = $stp_int_values{$stpname}{$stpopt}{"MINVAL"}; + $max = $stp_int_values{$stpname}{$stpopt}{"MAXVAL"}; } # Does the range of this option with this printer match # the Foomatic option entry we are building currently? @@ -1314,6 +1316,8 @@ sub qualityorder { "oov", # Canon "dmt", + "dpi_high", + "dpi_draft" ); my ($a, $b) = @_; # Bring the suffixes to lower case diff --git a/src/foomatic/foomatic-printermap b/src/foomatic/foomatic-printermap index 38758a3..bb0df69 100644 --- a/src/foomatic/foomatic-printermap +++ b/src/foomatic/foomatic-printermap @@ -57,6 +57,7 @@ #gptofoo bjc-80 printer/Canon-BJC-80 #gptofoo bjc-8200 printer/Canon-BJC-8200 #gptofoo bjc-85 printer/Canon-BJC-85 +#gptofoo canon-cp10 printer/Canon-CP-10 #gptofoo canon-cp100 printer/Canon-CP-100 #gptofoo canon-cp200 printer/Canon-CP-200 #gptofoo canon-cp220 printer/Canon-CP-220 @@ -83,9 +84,35 @@ #gptofoo canon-cp510 printer/Canon-SELPHY-CP-510 #gptofoo canon-cp600 printer/Canon-SELPHY-CP-600 #gptofoo canon-cp710 printer/Canon-SELPHY-CP-710 +#gptofoo bjc-PIXMA-iP2000 printer/Canon-PIXMA-iP2000 +#gptofoo bjc-PIXMA-iP3000 printer/Canon-PIXMA-iP3000 +#gptofoo bjc-PIXMA-iP3100 printer/Canon-PIXMA-iP3100 #gptofoo bjc-iP4000 printer/Canon-iP4000 +#gptofoo bjc-PIXMA-iP4100 printer/Canon-PIXMA-iP4100 +#gptofoo bjc-PIXMA-iP4200 printer/Canon-PIXMA-iP4200 +#gptofoo bjc-PIXMA-iP4300 printer/Canon-PIXMA-iP4300 +#gptofoo bjc-PIXMA-iP5000 printer/Canon-PIXMA-iP5000 +#gptofoo bjc-PIXMA-iP5200 printer/Canon-PIXMA-iP5200 +#gptofoo bjc-PIXMA-iP6700 printer/Canon-PIXMA-iP6700 +#gptofoo bjc-MULTIPASS-MP150 printer/Canon-MULTIPASS-MP150 +#gptofoo bjc-MULTIPASS-MP500 printer/Canon-MULTIPASS-MP500 +#gptofoo bjc-MULTIPASS-MP700 printer/Canon-MULTIPASS-MP700 +#gptofoo bjc-MULTIPASS-MP730 printer/Canon-MULTIPASS-MP730 +#gptofoo bjc-MULTIPASS-MP750 printer/Canon-MULTIPASS-MP750 +#gptofoo bjc-MULTIPASS-MP760 printer/Canon-MULTIPASS-MP760 +#gptofoo bjc-MULTIPASS-MP770 printer/Canon-MULTIPASS-MP770 +#gptofoo bjc-MULTIPASS-MP780 printer/Canon-MULTIPASS-MP780 +#gptofoo bjc-MULTIPASS-MP790 printer/Canon-MULTIPASS-MP790 +#gptofoo bjc-MULTIPASS-MP830 printer/Canon-MULTIPASS-MP830 +#gptofoo bjc-PIXUS-iP3100 printer/Canon-PIXUS-iP3100 +#gptofoo bjc-PIXUS-iP4100 printer/Canon-PIXUS-iP4100 +#gptofoo bjc-i560 printer/Canon-i560 +#gptofoo bjc-i850 printer/Canon-i850 +#gptofoo bjc-i860 printer/Canon-i860 +#gptofoo bjc-i865 printer/Canon-i865 #gptofoo canon-ir_330s printer/Canon-imageRunner_330s #gptofoo citizen-projet_ii printer/Citizen-ProJet_II +#gptofoo compaq-ij1200 printer/Compaq-IJ1200 #gptofoo dec-1800 printer/DEC-1800 #gptofoo dec-ln17 printer/DEC-LN17 #gptofoo epson-actl_1100 printer/Epson-ActionLaser_1100 @@ -154,6 +181,7 @@ #gptofoo escp2-pm980c printer/Epson-PM_980C #gptofoo escp2-pma650 printer/Epson-PM_A650 #gptofoo escp2-pma750 printer/Epson-PM_A750 +#gptofoo escp2-pma820 printer/Epson-PM_A820 #gptofoo escp2-pma890 printer/Epson-PM_A890 #gptofoo escp2-pma900 printer/Epson-PM_A900 #gptofoo escp2-pma950 printer/Epson-PM_A950 @@ -162,11 +190,14 @@ #gptofoo escp2-pmd750 printer/Epson-PM_D750 #gptofoo escp2-pmd770 printer/Epson-PM_D770 #gptofoo escp2-pmd800 printer/Epson-PM_D800 +#gptofoo escp2-pmd870 printer/Epson-PM_D870 #gptofoo escp2-pmg700 printer/Epson-PM_G700 #gptofoo escp2-pmg720 printer/Epson-PM_G720 #gptofoo escp2-pmg730 printer/Epson-PM_G730 #gptofoo escp2-pmg800 printer/Epson-PM_G800 #gptofoo escp2-pmg820 printer/Epson-PM_G820 +#gptofoo escp2-pmg850 printer/Epson-PM_G850 +#gptofoo escp2-pmg4500 printer/Epson-PM_G4500 #gptofoo escp2-px5500 printer/Epson-PX_5500 #gptofoo escp2-px7000 printer/Epson-PX_7000 #gptofoo escp2-px9000 printer/Epson-PX_9000 @@ -179,6 +210,14 @@ #gptofoo escp2-pxv630 printer/Epson-PX_V630 #gptofoo escp2-picmate printer/Epson-PictureMate #gptofoo escp2-picmated printer/Epson-PictureMate_Deluxe +#gptofoo escp2-picmateflash printer/Epson-PictureMate_Flash +#gptofoo escp2-picmatepal printer/Epson-PictureMate_Pal +#gptofoo escp2-picmatesnap printer/Epson-PictureMate_Snap +#gptofoo escp2-picmate200 printer/Epson-PictureMate_200 +#gptofoo escp2-picmate210 printer/Epson-PictureMate_210 +#gptofoo escp2-picmate240 printer/Epson-PictureMate_240 +#gptofoo escp2-picmate250 printer/Epson-PictureMate_250 +#gptofoo escp2-picmate280 printer/Epson-PictureMate_280 #gptofoo escp2-c20 printer/Epson-Stylus_C20 #gptofoo escp2-c20sx printer/Epson-Stylus_C20SX #gptofoo escp2-c20ux printer/Epson-Stylus_C20UX @@ -210,12 +249,14 @@ #gptofoo escp2-c66 printer/Epson-Stylus_C66 #gptofoo escp2-c68 printer/Epson-Stylus_C68 #gptofoo escp2-c70 printer/Epson-Stylus_C70 +#gptofoo escp2-c79 printer/Epson-Stylus_C79 #gptofoo escp2-c80 printer/Epson-Stylus_C80 #gptofoo escp2-c82 printer/Epson-Stylus_C82 #gptofoo escp2-c83 printer/Epson-Stylus_C83 #gptofoo escp2-c84 printer/Epson-Stylus_C84 #gptofoo escp2-c85 printer/Epson-Stylus_C85 #gptofoo escp2-c86 printer/Epson-Stylus_C86 +#gptofoo escp2-c87 printer/Epson-Stylus_C87 #gptofoo escp2-c88 printer/Epson-Stylus_C88 #gptofoo escp2-cx1500 printer/Epson-Stylus_CX1500 #gptofoo escp2-cx3100 printer/Epson-Stylus_CX3100 @@ -233,16 +274,20 @@ #gptofoo escp2-cx4600 printer/Epson-Stylus_CX4600 #gptofoo escp2-cx4700 printer/Epson-Stylus_CX4700 #gptofoo escp2-cx4800 printer/Epson-Stylus_CX4800 +#gptofoo escp2-cx5000 printer/Epson-Stylus_CX5000 +#gptofoo escp2-cx5000f printer/Epson-Stylus_CX5000F #gptofoo escp2-cx5100 printer/Epson-Stylus_CX5100 #gptofoo escp2-cx5200 printer/Epson-Stylus_CX5200 #gptofoo escp2-cx5300 printer/Epson-Stylus_CX5300 #gptofoo escp2-cx5400 printer/Epson-Stylus_CX5400 #gptofoo escp2-cx5700 printer/Epson-Stylus_CX5700 #gptofoo escp2-cx5800 printer/Epson-Stylus_CX5800 +#gptofoo escp2-cx6000 printer/Epson-Stylus_CX6000 #gptofoo escp2-cx6300 printer/Epson-Stylus_CX6300 #gptofoo escp2-cx6400 printer/Epson-Stylus_CX6400 #gptofoo escp2-cx6500 printer/Epson-Stylus_CX6500 #gptofoo escp2-cx6600 printer/Epson-Stylus_CX6600 +#gptofoo escp2-cx7000f printer/Epson-Stylus_CX7000F #gptofoo escp2-cx7700 printer/Epson-Stylus_CX7700 #gptofoo escp2-cx7800 printer/Epson-Stylus_CX7800 #gptofoo escp2-cx8300 printer/Epson-Stylus_CX8300 @@ -289,6 +334,8 @@ #gptofoo escp2-1270 printer/Epson-Stylus_Photo_1270 #gptofoo escp2-1280 printer/Epson-Stylus_Photo_1280 #gptofoo escp2-1290 printer/Epson-Stylus_Photo_1290 +#gptofoo escp2-1400 printer/Epson-Stylus_Photo_1400 +#gptofoo escp2-1410 printer/Epson-Stylus_Photo_1410 #gptofoo escp2-2000 printer/Epson-Stylus_Photo_2000P #gptofoo escp2-2100 printer/Epson-Stylus_Photo_2100 #gptofoo escp2-2200 printer/Epson-Stylus_Photo_2200 @@ -316,14 +363,24 @@ #gptofoo escp2-ex printer/Epson-Stylus_Photo_EX #gptofoo escp2-ex3 printer/Epson-Stylus_Photo_EX3 #gptofoo escp2-r1800 printer/Epson-Stylus_Photo_R1800 +#gptofoo escp2-r2400 printer/Epson-Stylus_Photo_R2400 #gptofoo escp2-r200 printer/Epson-Stylus_Photo_R200 #gptofoo escp2-r210 printer/Epson-Stylus_Photo_R210 #gptofoo escp2-r220 printer/Epson-Stylus_Photo_R220 -#gptofoo escp2-r2400 printer/Epson-Stylus_Photo_R2400 +#gptofoo escp2-r230 printer/Epson-Stylus_Photo_R230 +#gptofoo escp2-r240 printer/Epson-Stylus_Photo_R240 +#gptofoo escp2-r245 printer/Epson-Stylus_Photo_R245 +#gptofoo escp2-r260 printer/Epson-Stylus_Photo_R260 +#gptofoo escp2-r265 printer/Epson-Stylus_Photo_R265 +#gptofoo escp2-r270 printer/Epson-Stylus_Photo_R270 #gptofoo escp2-r300 printer/Epson-Stylus_Photo_R300 #gptofoo escp2-r310 printer/Epson-Stylus_Photo_R310 #gptofoo escp2-r320 printer/Epson-Stylus_Photo_R320 #gptofoo escp2-r340 printer/Epson-Stylus_Photo_R340 +#gptofoo escp2-r350 printer/Epson-Stylus_Photo_R350 +#gptofoo escp2-r360 printer/Epson-Stylus_Photo_R360 +#gptofoo escp2-r380 printer/Epson-Stylus_Photo_R380 +#gptofoo escp2-r390 printer/Epson-Stylus_Photo_R390 #gptofoo escp2-r800 printer/Epson-Stylus_Photo_R800 #gptofoo escp2-rx400 printer/Epson-Stylus_Photo_RX400 #gptofoo escp2-rx420 printer/Epson-Stylus_Photo_RX420 @@ -331,9 +388,13 @@ #gptofoo escp2-rx430 printer/Epson-Stylus_Photo_RX430 #gptofoo escp2-rx500 printer/Epson-Stylus_Photo_RX500 #gptofoo escp2-rx510 printer/Epson-Stylus_Photo_RX510 +#gptofoo escp2-rx560 printer/Epson-Stylus_Photo_RX560 +#gptofoo escp2-rx580 printer/Epson-Stylus_Photo_RX580 +#gptofoo escp2-rx590 printer/Epson-Stylus_Photo_RX590 #gptofoo escp2-rx600 printer/Epson-Stylus_Photo_RX600 #gptofoo escp2-rx620 printer/Epson-Stylus_Photo_RX620 #gptofoo escp2-rx630 printer/Epson-Stylus_Photo_RX630 +#gptofoo escp2-rx640 printer/Epson-Stylus_Photo_RX640 #gptofoo escp2-rx700 printer/Epson-Stylus_Photo_RX700 #gptofoo escp2-10000 printer/Epson-Stylus_Pro_10000 #gptofoo escp2-5000 printer/Epson-Stylus_Pro_5000 @@ -349,6 +410,7 @@ #gptofoo escp2-scan2500 printer/Epson-Stylus_Scan_2500 #gptofoo fujifilm-cx400 printer/Fujifilm-Printpix-CX-400 #gptofoo fujifilm-cx550 printer/Fujifilm-Printpix-CX-550 +#gptofoo fujifilm-nx500 printer/Fujifilm-FinePix-NX-500 #gptofoo fujitsu-pp_10v printer/Fujitsu-PrintPartner_10V #gptofoo fujitsu-pp_16dv printer/Fujitsu-PrintPartner_16DV #gptofoo fujitsu-pp_20w printer/Fujitsu-PrintPartner_20W @@ -613,6 +675,7 @@ #gptofoo ibm-infoprint_12 printer/IBM-Infoprint_12 #gptofoo ibm-pp_3112 printer/IBM-Page_Printer_3112 #gptofoo infotec-4651_mf printer/Infotec-4651_MF +#gptofoo kodak-dock printer/Kodak-Easyshare-Printer-Dock #gptofoo kyocera-f-1010 printer/Kyocera-F-1010 #gptofoo kyocera-fs-1000 printer/Kyocera-FS-1000 #gptofoo kyocera-fs-1000plus printer/Kyocera-FS-1000plus @@ -662,7 +725,9 @@ #gptofoo lexmark-4076 printer/Lexmark-4076 #gptofoo lexmark-optra_e printer/Lexmark-Optra_E #gptofoo lexmark-optra_eplus printer/Lexmark-Optra_Eplus +#gptofoo lexmark-optra_e220 printer/Lexmark-Optra_E220 #gptofoo lexmark-vw_300 printer/Lexmark-Valuewriter_300 +#gptofoo lexmark-x73 printer/Lexmark-X73 #gptofoo lexmark-z42 printer/Lexmark-Z42 #gptofoo lexmark-z43 printer/Lexmark-Z43 #gptofoo lexmark-z52 printer/Lexmark-Z52 @@ -706,6 +771,7 @@ #gptofoo olympus-p330ne printer/Olympus-P-330NE #gptofoo olympus-p400 printer/Olympus-P-400 #gptofoo olympus-p440 printer/Olympus-P-440 +#gptofoo olympus-ps100 printer/Olympus-P-S100 #gptofoo pcpi-1030 printer/PCPI-1030 #gptofoo panasonic-kx-p4410 printer/Panasonic-KX-P4410 #gptofoo panasonic-kx-p4450 printer/Panasonic-KX-P4450 @@ -729,7 +795,9 @@ #gptofoo seiko-sj_200 printer/Seiko-SpeedJET_200 #gptofoo sharp-ar-161 printer/Sharp-AR-161 #gptofoo sony-ijp-v100 printer/Sony-IJP-V100 +#gptofoo sony-dppex5 printer/Sony-DPP-EX5 #gptofoo sony-updp10 printer/Sony-UP-DP10 +#gptofoo sony-updr100 printer/Sony-UP-DR100 #gptofoo sony-updr150 printer/Sony-UP-DR150 #gptofoo star-ls-04 printer/Star-LS-04 #gptofoo star-lp_8 printer/Star-LaserPrinter_8 @@ -743,3 +811,4 @@ #gptofoo xerox-dp_p1202 printer/Xerox-DocuPrint_P1202 #gptofoo xerox-dp_p8e printer/Xerox-DocuPrint_P8e #gptofoo xerox-dc_400 printer/Xerox-Document_Centre_400 +#gptofoo xerox-wc_m118 printer/Xerox-Work_Centre_M118 diff --git a/src/foomatic/gutenprint-version.c b/src/foomatic/gutenprint-version.c index 786dfe6..16c248a 100644 --- a/src/foomatic/gutenprint-version.c +++ b/src/foomatic/gutenprint-version.c @@ -1,7 +1,7 @@ /* - * "$Id: gutenprint-version.c,v 1.2 2005/04/12 00:45:10 rlk Exp $" + * "$Id: gutenprint-version.c,v 1.2.18.1 2007/03/04 23:57:48 tillkamppeter Exp $" * - * Dump the per-printer options for Grant Taylor's *-omatic database + * Dump the per-printer options for the OpenPrinting database * * Copyright 2000 Robert Krawitz (rlk@alum.mit.edu) * diff --git a/src/foomatic/mk_printerlist.in b/src/foomatic/mk_printerlist.in index a8f516f..da669ad 100644 --- a/src/foomatic/mk_printerlist.in +++ b/src/foomatic/mk_printerlist.in @@ -5,7 +5,7 @@ eval `./printers`; -open PRINTERS, "(wget -q -O - http://www.linuxprinting.org/printer_list.cgi; cat foomatic-printermap) |" or die "Can't get print list: $!"; +open PRINTERS, "(wget -q -O - http://www.openprinting.org/printer_list.cgi; cat foomatic-printermap) |" or die "Can't get print list: $!"; while () { if (/make ==/) { diff --git a/src/foomatic/paper_sizes.c b/src/foomatic/paper_sizes.c index e22f5fd..7b12fe1 100644 --- a/src/foomatic/paper_sizes.c +++ b/src/foomatic/paper_sizes.c @@ -1,7 +1,7 @@ /* - * "$Id: paper_sizes.c,v 1.8 2004/09/17 18:38:12 rleigh Exp $" + * "$Id: paper_sizes.c,v 1.8.18.1 2007/03/04 23:57:48 tillkamppeter Exp $" * - * Dump the per-printer options for Grant Taylor's *-omatic database + * Dump the per-printer options for the OpenPrinting database * * Copyright 2000 Robert Krawitz (rlk@alum.mit.edu) * diff --git a/src/foomatic/printer_margins.c b/src/foomatic/printer_margins.c index 89c68ed..11c50ad 100644 --- a/src/foomatic/printer_margins.c +++ b/src/foomatic/printer_margins.c @@ -1,10 +1,10 @@ /* - * "$Id: printer_margins.c,v 1.17 2006/04/17 02:06:18 rlk Exp $" + * "$Id: printer_margins.c,v 1.17.8.2 2007/05/29 01:47:27 rlk Exp $" * - * Dump the per-printer margins for Grant Taylor's *-omatic database + * Dump the per-printer margins for the OpenPrinting database * * Copyright 2000, 2003 Robert Krawitz (rlk@alum.mit.edu) and - * Till Kamppeter (till.kamppeter@gmx.net) + * Till Kamppeter (till.kamppeter@gmail.com) * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free @@ -107,16 +107,16 @@ main(int argc, char **argv) { height = 0; } - printf("$stpdata{'%s'}{'PageSize'}{'%s'} = '%s';\n", + printf("$stpdata{'%s'}{'PageSize'}{'%s'} = '%s';", driver, opt->name, opt->text); - printf("$imageableareas{'%s'}{'%s'} = {\n", + printf("$imageableareas{'%s'}{'%s'} = {", driver, opt->name); - printf(" 'left' => '%d',\n", left); - printf(" 'right' => '%d',\n", right); - printf(" 'top' => '%d',\n", top); - printf(" 'bottom' => '%d',\n", bottom); - printf(" 'width' => '%d',\n", width); - printf(" 'height' => '%d'\n", height); + printf(" 'left' => '%d',", left); + printf(" 'right' => '%d',", right); + printf(" 'top' => '%d',", top); + printf(" 'bottom' => '%d',", bottom); + printf(" 'width' => '%d',", width); + printf(" 'height' => '%d'", height); printf("};\n"); } stp_parameter_description_destroy(&desc); diff --git a/src/foomatic/printer_options.c b/src/foomatic/printer_options.c index d3a3b42..6848354 100644 --- a/src/foomatic/printer_options.c +++ b/src/foomatic/printer_options.c @@ -1,7 +1,7 @@ /* - * "$Id: printer_options.c,v 1.50 2006/05/28 16:59:03 rlk Exp $" + * "$Id: printer_options.c,v 1.50.8.2 2007/05/29 01:47:27 rlk Exp $" * - * Dump the per-printer options for Grant Taylor's *-omatic database + * Dump the per-printer options for the OpenPrinting database * * Copyright 2000 Robert Krawitz (rlk@alum.mit.edu) * @@ -33,10 +33,12 @@ main(int argc, char **argv) { int i, j, k; stp_parameter_level_t max_level = STP_PARAMETER_LEVEL_ADVANCED4; + stp_string_list_t *params_seen; if (argc > 1 && !strcmp(argv[1], "-s")) max_level = STP_PARAMETER_LEVEL_BASIC; stp_init(); + params_seen = stp_string_list_create(); for (i = 0; i < stp_printer_model_count(); i++) { stp_parameter_list_t params; @@ -83,65 +85,96 @@ main(int argc, char **argv) stp_describe_parameter(pv, p->name, &desc); if (desc.is_active) { + char buf[1024]; + sprintf(buf, "STP_%s", desc.name); + if (!stp_string_list_find(params_seen, buf)) + { + stp_string_list_add_string(params_seen, buf, buf); + if ((desc.p_type == STP_PARAMETER_TYPE_DOUBLE || + desc.p_type == STP_PARAMETER_TYPE_DIMENSION || + desc.p_type == STP_PARAMETER_TYPE_INT) && + !desc.is_mandatory) + { + sprintf(buf, "STP_Enable%s", desc.name); + if (!stp_string_list_find(params_seen, buf)) + { + stp_string_list_add_string(params_seen, buf, buf); + /* + * Create a dummy option that enables or disables + * the option as appropriate. The long name ends in + * enable, rather than starts with enable, because + * CUPS has this nasty habit of sorting options + * alphabetically rather than leaving them in the + * order listed. This ensures that the enable + * option is adjacent to the value it controls. + */ + printf("$longnames{'STP_Enable%s'} = '%s Enable';", + desc.name, desc.text); + printf("$param_classes{'STP_Enable%s'} = %d;", + desc.name, desc.p_class); + printf("$param_levels{'STP_Enable%s'} = %d;", + desc.name, desc.p_level); + printf("$longnames{'STP_%s'} = '%s Value';", + desc.name, desc.text); + } + } + else + printf("$longnames{'STP_%s'} = '%s';", + desc.name, desc.text); + printf("$param_classes{'STP_%s'} = %d;", + desc.name, desc.p_class); + printf("$param_levels{'STP_%s'} = %d;", + desc.name, desc.p_level); + } if ((desc.p_type == STP_PARAMETER_TYPE_DOUBLE || desc.p_type == STP_PARAMETER_TYPE_DIMENSION || desc.p_type == STP_PARAMETER_TYPE_INT) && !desc.is_mandatory) { - /* - * Create a dummy option that enables or disables - * the option as appropriate. The long name ends in - * enable, rather than starts with enable, because - * CUPS has this nasty habit of sorting options - * alphabetically rather than leaving them in the - * order listed. This ensures that the enable - * option is adjacent to the value it controls. - */ - printf("$longnames{'STP_Enable%s'} = '%s Enable';\n", - desc.name, desc.text); - printf("$param_classes{'STP_Enable%s'} = %d;\n", - desc.name, desc.p_class); - printf("$param_levels{'STP_Enable%s'} = %d;\n", - desc.name, desc.p_level); - printf("$defaults{'%s'}{'STP_Enable%s'} = 'Disabled';\n", + printf("$defaults{'%s'}{'STP_Enable%s'} = 'Disabled';", driver, desc.name); - printf("$stpdata{'%s'}{'STP_Enable%s'}{'Disabled'} = 'Disabled';\n", + printf("$stpdata{'%s'}{'STP_Enable%s'}{'Disabled'} = 'Disabled';", driver, desc.name); - printf("$stpdata{'%s'}{'STP_Enable%s'}{'Enabled'} = 'Enabled';\n", + printf("$stpdata{'%s'}{'STP_Enable%s'}{'Enabled'} = 'Enabled';", driver, desc.name); - printf("$longnames{'STP_%s'} = '%s Value';\n", - desc.name, desc.text); } - else - printf("$longnames{'STP_%s'} = '%s';\n", - desc.name, desc.text); - printf("$param_classes{'STP_%s'} = %d;\n", - desc.name, desc.p_class); - printf("$param_levels{'STP_%s'} = %d;\n", - desc.name, desc.p_level); if (desc.p_type == STP_PARAMETER_TYPE_STRING_LIST) { count = stp_string_list_count(desc.bounds.str); if (count > 0) { + printf("{ $stpdata{'%s'}{'STP_%s'} = {};", + driver, desc.name); + printf("my $tmp = $stpdata{'%s'}{'STP_%s'};", + driver, desc.name); + if (strcmp(desc.name, "Resolution") == 0) + { + printf("$stpdata{'%s'}{'x_resolution'} = {};", + driver); + printf("my $x_t = $stpdata{'%s'}{'x_resolution'};", + driver); + printf("$stpdata{'%s'}{'y_resolution'} = {};", + driver); + printf("my $y_t = $stpdata{'%s'}{'y_resolution'};", + driver); + } if (desc.is_mandatory) { - printf("$defaults{'%s'}{'STP_%s'} = '%s';\n", + printf("$defaults{'%s'}{'STP_%s'} = '%s';", driver, desc.name, desc.deflt.str); } else { - printf("$defaults{'%s'}{'STP_%s'} = '%s';\n", + printf("$defaults{'%s'}{'STP_%s'} = '%s';", driver, desc.name, "None"); - printf("$stpdata{'%s'}{'STP_%s'}{'%s'} = '%s';\n", - driver, desc.name, "None", "None"); + printf("$$tmp{'%s'} = '%s';", "None", "None"); } for (j = 0; j < count; j++) { const stp_param_string_t *param = stp_string_list_param(desc.bounds.str, j); - printf("$stpdata{'%s'}{'STP_%s'}{'%s'} = '%s';\n", - driver, desc.name, param->name, param->text); + printf("$$tmp{'%s'} = '%s';", + param->name, param->text); if (strcmp(desc.name, "Resolution") == 0) { int x, y; @@ -150,31 +183,30 @@ main(int argc, char **argv) stp_describe_resolution(pv, &x, &y); if (x > 0 && y > 0) { - printf("$stpdata{'%s'}{'%s'}{'%s'} = '%d';\n", - driver, "x_resolution", param->name, x); - printf("$stpdata{'%s'}{'%s'}{'%s'} = '%d';\n", - driver, "y_resolution", param->name, y); + printf("$$x_t{'%s'} = '%d';",param->name, x); + printf("$$y_t{'%s'} = '%d';",param->name, y); } } } + printf("}\n"); } } else if (desc.p_type == STP_PARAMETER_TYPE_BOOLEAN) { if (desc.is_mandatory) { - printf("$defaults{'%s'}{'STP_%s'} = '%d';\n", + printf("$defaults{'%s'}{'STP_%s'} = '%d';", driver, desc.name, desc.deflt.boolean); } else { - printf("$defaults{'%s'}{'STP_%s'} = '%s';\n", + printf("$defaults{'%s'}{'STP_%s'} = '%s';", driver, desc.name, "None"); - printf("$stpdata{'%s'}{'STP_%s'}{'%s'} = '%s';\n", + printf("$stpdata{'%s'}{'STP_%s'}{'%s'} = '%s';", driver, desc.name, "None", "None"); } - printf("$stpdata{'%s'}{'STP_%s'}{'False'} = 'False';\n", + printf("$stpdata{'%s'}{'STP_%s'}{'False'} = 'False';", driver, desc.name); printf("$stpdata{'%s'}{'STP_%s'}{'True'} = 'True';\n", driver, desc.name); @@ -184,20 +216,25 @@ main(int argc, char **argv) if (desc.bounds.dbl.lower <= desc.deflt.dbl && desc.bounds.dbl.upper >= desc.deflt.dbl) { - printf("$stp_float_values{'%s'}{'MINVAL'}{'STP_%s'} = %.3f;\n", - driver, desc.name, desc.bounds.dbl.lower); - printf("$stp_float_values{'%s'}{'MAXVAL'}{'STP_%s'} = %.3f;\n", - driver, desc.name, desc.bounds.dbl.upper); - printf("$stp_float_values{'%s'}{'DEFVAL'}{'STP_%s'} = %.3f;\n", - driver, desc.name, desc.deflt.dbl); - /* printf("$stp_float_values{'%s'}{'LONG_NAME'}{'STP_%s'} = '%s';\n", - driver, desc.name, gettext(desc.text)); */ - printf("$stp_float_values{'%s'}{'CATEGORY'}{'STP_%s'} = '%s';\n", - driver, desc.name, gettext(desc.category)); - printf("$stp_float_values{'%s'}{'HELP'}{'STP_%s'} = q(%s);\n", - driver, desc.name, (desc.help ? gettext(desc.help) : "''")); - printf("$stp_float_values{'%s'}{'MANDATORY'}{'STP_%s'} = q(%d);\n", - driver, desc.name, desc.is_mandatory); + printf("{ $stp_float_values{'%s'}{'STP_%s'} = {};", + driver, desc.name); + printf("my $tmp = $stp_float_values{'%s'}{'STP_%s'};", + driver, desc.name); + printf("$$tmp{'MINVAL'} = %.3f;", + desc.bounds.dbl.lower); + printf("$$tmp{'MAXVAL'} = %.3f;", + desc.bounds.dbl.upper); + printf("$$tmp{'DEFVAL'} = %.3f;", + desc.deflt.dbl); + /* printf("$$tmp{'LONG_NAME'} = '%s';", + gettext(desc.text)); */ + printf("$$tmp{'CATEGORY'} = '%s';", + gettext(desc.category)); + printf("$$tmp{'HELP'} = q(%s);", + (desc.help ? gettext(desc.help) : "''")); + printf("$$tmp{'MANDATORY'} = q(%d);", + desc.is_mandatory); + printf("}\n"); } } else if (desc.p_type == STP_PARAMETER_TYPE_INT) @@ -205,20 +242,25 @@ main(int argc, char **argv) if (desc.bounds.integer.lower <= desc.deflt.integer && desc.bounds.integer.upper >= desc.deflt.integer) { - printf("$stp_int_values{'%s'}{'MINVAL'}{'STP_%s'} = %d;\n", - driver, desc.name, desc.bounds.integer.lower); - printf("$stp_int_values{'%s'}{'MAXVAL'}{'STP_%s'} = %d;\n", - driver, desc.name, desc.bounds.integer.upper); - printf("$stp_int_values{'%s'}{'DEFVAL'}{'STP_%s'} = %d;\n", - driver, desc.name, desc.deflt.integer); - /* printf("$stp_int_values{'%s'}{'LONG_NAME'}{'STP_%s'} = '%s';\n", - driver, desc.name, gettext(desc.text)); */ - printf("$stp_int_values{'%s'}{'CATEGORY'}{'STP_%s'} = '%s';\n", - driver, desc.name, gettext(desc.category)); - printf("$stp_int_values{'%s'}{'HELP'}{'STP_%s'} = q(%s);\n", - driver, desc.name, (desc.help ? gettext(desc.help) : "''")); - printf("$stp_int_values{'%s'}{'MANDATORY'}{'STP_%s'} = q(%d);\n", - driver, desc.name, desc.is_mandatory); + printf("{ $stp_int_values{'%s'}{'STP_%s'} = {};", + driver, desc.name); + printf("my $tmp = $stp_int_values{'%s'}{'STP_%s'};", + driver, desc.name); + printf("$$tmp{'MINVAL'} = %d;", + desc.bounds.integer.lower); + printf("$$tmp{'MAXVAL'} = %d;", + desc.bounds.integer.upper); + printf("$$tmp{'DEFVAL'} = %d;", + desc.deflt.integer); + /* printf("$$tmp{'LONG_NAME'} = '%s';", + gettext(desc.text)); */ + printf("$$tmp{'CATEGORY'} = '%s';", + gettext(desc.category)); + printf("$$tmp{'HELP'} = q(%s);", + (desc.help ? gettext(desc.help) : "''")); + printf("$$tmp{'MANDATORY'} = q(%d);", + desc.is_mandatory); + printf("}\n"); } } else if (desc.p_type == STP_PARAMETER_TYPE_DIMENSION) @@ -226,20 +268,25 @@ main(int argc, char **argv) if (desc.bounds.dimension.lower <= desc.deflt.dimension && desc.bounds.dimension.upper >= desc.deflt.dimension) { - printf("$stp_dimension_values{'%s'}{'MINVAL'}{'STP_%s'} = %d;\n", - driver, desc.name, desc.bounds.dimension.lower); - printf("$stp_dimension_values{'%s'}{'MAXVAL'}{'STP_%s'} = %d;\n", - driver, desc.name, desc.bounds.dimension.upper); - printf("$stp_dimension_values{'%s'}{'DEFVAL'}{'STP_%s'} = %d;\n", - driver, desc.name, desc.deflt.dimension); - /* printf("$stp_dimension_values{'%s'}{'LONG_NAME'}{'STP_%s'} = '%s';\n", - driver, desc.name, gettext(desc.text)); */ - printf("$stp_dimension_values{'%s'}{'CATEGORY'}{'STP_%s'} = '%s';\n", - driver, desc.name, gettext(desc.category)); - printf("$stp_dimension_values{'%s'}{'HELP'}{'STP_%s'} = q(%s);\n", - driver, desc.name, (desc.help ? gettext(desc.help) : "''")); - printf("$stp_dimension_values{'%s'}{'MANDATORY'}{'STP_%s'} = q(%d);\n", - driver, desc.name, desc.is_mandatory); + printf("{ $stp_dimension_values{'%s'}{'STP_%s'} = {};", + driver, desc.name); + printf("my $tmp = $stp_dimension_values{'%s'}{'STP_%s'};", + driver, desc.name); + printf("$$tmp{'MINVAL'} = %d;", + desc.bounds.dimension.lower); + printf("$$tmp{'MAXVAL'} = %d;", + desc.bounds.dimension.upper); + printf("$$tmp{'DEFVAL'} = %d;", + desc.deflt.dimension); + /* printf("$$tmp{'LONG_NAME'} = '%s';", + gettext(desc.text)); */ + printf("$$tmp{'CATEGORY'} = '%s';", + gettext(desc.category)); + printf("$$tmp{'HELP'} = q(%s);", + (desc.help ? gettext(desc.help) : "''")); + printf("$$tmp{'MANDATORY'} = q(%d);", + desc.is_mandatory); + printf("}\n"); } } tcount += count; @@ -251,17 +298,17 @@ main(int argc, char **argv) { if (printer_is_color) { - printf("$defaults{'%s'}{'%s'} = '%s';\n", + printf("$defaults{'%s'}{'%s'} = '%s';", driver, "Color", "Color"); - printf("$stpdata{'%s'}{'%s'}{'%s'} = '%s';\n", + printf("$stpdata{'%s'}{'%s'}{'%s'} = '%s';", driver, "Color", "Color", "Color"); printf("$stpdata{'%s'}{'%s'}{'%s'} = '%s';\n", driver, "Color", "RawCMYK", "Raw CMYK"); } else - printf("$defaults{'%s'}{'%s'} = '%s';\n", + printf("$defaults{'%s'}{'%s'} = '%s';", driver, "Color", "Grayscale"); - printf("$stpdata{'%s'}{'%s'}{'%s'} = '%s';\n", + printf("$stpdata{'%s'}{'%s'}{'%s'} = '%s';", driver, "Color", "Grayscale", "Gray Scale"); printf("$stpdata{'%s'}{'%s'}{'%s'} = '%s';\n", driver, "Color", "BlackAndWhite", "Black and White"); diff --git a/src/foomatic/printers.c b/src/foomatic/printers.c index 112abf0..9eb34ce 100644 --- a/src/foomatic/printers.c +++ b/src/foomatic/printers.c @@ -1,7 +1,7 @@ /* - * "$Id: printers.c,v 1.10 2004/09/17 18:38:12 rleigh Exp $" + * "$Id: printers.c,v 1.10.18.1 2007/03/04 23:57:48 tillkamppeter Exp $" * - * Dump the per-printer options for Grant Taylor's *-omatic database + * Dump the per-printer options for the OpenPrinting database * * Copyright 2000 Robert Krawitz (rlk@alum.mit.edu) * diff --git a/src/ghost/Makefile.in b/src/ghost/Makefile.in index 4d1902e..da11a47 100644 --- a/src/ghost/Makefile.in +++ b/src/ghost/Makefile.in @@ -48,11 +48,12 @@ subdir = src/ghost ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ $(top_srcdir)/m4/gimp.m4 $(top_srcdir)/m4/iconv.m4 \ - $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ - $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/progtest.m4 \ - $(top_srcdir)/m4/stp.m4 $(top_srcdir)/m4/stp_cups.m4 \ - $(top_srcdir)/m4/stp_gimp.m4 $(top_srcdir)/m4/stp_option.m4 \ - $(top_srcdir)/m4/stp_release.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/isc-posix.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/stp.m4 \ + $(top_srcdir)/m4/stp_cups.m4 $(top_srcdir)/m4/stp_gimp.m4 \ + $(top_srcdir)/m4/stp_option.m4 $(top_srcdir)/m4/stp_release.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/scripts/mkinstalldirs @@ -72,8 +73,8 @@ am__DEPENDENCIES_2 = @BUILD_GHOSTSCRIPT_TRUE@ $(am__DEPENDENCIES_1) \ @BUILD_GHOSTSCRIPT_TRUE@ $(am__DEPENDENCIES_2) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -depcomp = -am__depfiles_maybe = +depcomp = $(SHELL) $(top_srcdir)/scripts/depcomp +am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ @@ -89,13 +90,18 @@ CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ +BUILD_CUPS_1_2_FALSE = @BUILD_CUPS_1_2_FALSE@ +BUILD_CUPS_1_2_TRUE = @BUILD_CUPS_1_2_TRUE@ BUILD_CUPS_FALSE = @BUILD_CUPS_FALSE@ +BUILD_CUPS_PPDS = @BUILD_CUPS_PPDS@ BUILD_CUPS_PPDS_FALSE = @BUILD_CUPS_PPDS_FALSE@ BUILD_CUPS_PPDS_TRUE = @BUILD_CUPS_PPDS_TRUE@ BUILD_CUPS_TRUE = @BUILD_CUPS_TRUE@ @@ -121,6 +127,8 @@ BUILD_LIBGUTENPRINTUI_FALSE = @BUILD_LIBGUTENPRINTUI_FALSE@ BUILD_LIBGUTENPRINTUI_TRUE = @BUILD_LIBGUTENPRINTUI_TRUE@ BUILD_MODULES_FALSE = @BUILD_MODULES_FALSE@ BUILD_MODULES_TRUE = @BUILD_MODULES_TRUE@ +BUILD_SIMPLIFIED_CUPS_PPDS_FALSE = @BUILD_SIMPLIFIED_CUPS_PPDS_FALSE@ +BUILD_SIMPLIFIED_CUPS_PPDS_TRUE = @BUILD_SIMPLIFIED_CUPS_PPDS_TRUE@ BUILD_TESTPATTERN_FALSE = @BUILD_TESTPATTERN_FALSE@ BUILD_TESTPATTERN_TRUE = @BUILD_TESTPATTERN_TRUE@ BUILD_TEST_FALSE = @BUILD_TEST_FALSE@ @@ -128,6 +136,7 @@ BUILD_TEST_TRUE = @BUILD_TEST_TRUE@ BUILD_TRANSLATED_CUPS_PPDS_FALSE = @BUILD_TRANSLATED_CUPS_PPDS_FALSE@ BUILD_TRANSLATED_CUPS_PPDS_TRUE = @BUILD_TRANSLATED_CUPS_PPDS_TRUE@ CC = @CC@ +CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CONVERT = @CONVERT@ CPP = @CPP@ @@ -140,12 +149,14 @@ CUPS_PPDS_AT_TOP_LEVEL_TRUE = @CUPS_PPDS_AT_TOP_LEVEL_TRUE@ CUPS_PPD_PS_LEVEL = @CUPS_PPD_PS_LEVEL@ CXX = @CXX@ CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DB2HTML = @DB2HTML@ DB2PDF = @DB2PDF@ DB2PS = @DB2PS@ DEFS = @DEFS@ +DEPDIR = @DEPDIR@ DIALOG = @DIALOG@ DOXYGEN = @DOXYGEN@ DVIPDF = @DVIPDF@ @@ -180,6 +191,7 @@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GMSGFMT = @GMSGFMT@ GNUCFLAGS = @GNUCFLAGS@ +GREP = @GREP@ GTK2_CFLAGS = @GTK2_CFLAGS@ GTK2_LIBS = @GTK2_LIBS@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -275,14 +287,17 @@ VERSION = @VERSION@ WHICH_PPDS = @WHICH_PPDS@ XGETTEXT = @XGETTEXT@ YACC = @YACC@ -ac_ct_AR = @ac_ct_AR@ +YFLAGS = @YFLAGS@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ @@ -299,6 +314,9 @@ cups_exec_prefix = @cups_exec_prefix@ cups_prefix = @cups_prefix@ cups_sbindir = @cups_sbindir@ datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ exec_prefix = @exec_prefix@ gimp2_plug_indir = @gimp2_plug_indir@ gimp_plug_indir = @gimp_plug_indir@ @@ -316,17 +334,21 @@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ +htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ +localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ +psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ @@ -350,9 +372,9 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu --ignore-deps src/ghost/Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/ghost/Makefile'; \ cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu --ignore-deps src/ghost/Makefile + $(AUTOMAKE) --gnu src/ghost/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ @@ -408,14 +430,28 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ijsgutenprint.Po@am__quote@ + .c.o: - $(COMPILE) -c $< +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: - $(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: - $(LTCOMPILE) -c -o $@ $< +@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo @@ -540,6 +576,7 @@ clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am distclean: distclean-am + -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags @@ -565,6 +602,7 @@ install-man: installcheck-am: maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic diff --git a/src/gimp/Makefile.in b/src/gimp/Makefile.in index 6038199..83fc3fd 100644 --- a/src/gimp/Makefile.in +++ b/src/gimp/Makefile.in @@ -48,11 +48,12 @@ subdir = src/gimp ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ $(top_srcdir)/m4/gimp.m4 $(top_srcdir)/m4/iconv.m4 \ - $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ - $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/progtest.m4 \ - $(top_srcdir)/m4/stp.m4 $(top_srcdir)/m4/stp_cups.m4 \ - $(top_srcdir)/m4/stp_gimp.m4 $(top_srcdir)/m4/stp_option.m4 \ - $(top_srcdir)/m4/stp_release.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/isc-posix.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/stp.m4 \ + $(top_srcdir)/m4/stp_cups.m4 $(top_srcdir)/m4/stp_gimp.m4 \ + $(top_srcdir)/m4/stp_option.m4 $(top_srcdir)/m4/stp_release.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/scripts/mkinstalldirs @@ -67,8 +68,8 @@ am__DEPENDENCIES_1 = am__DEPENDENCIES_2 = \ $(top_builddir)/src/gutenprintui/libgutenprintui.la DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -depcomp = -am__depfiles_maybe = +depcomp = $(SHELL) $(top_srcdir)/scripts/depcomp +am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ @@ -84,13 +85,18 @@ CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ +BUILD_CUPS_1_2_FALSE = @BUILD_CUPS_1_2_FALSE@ +BUILD_CUPS_1_2_TRUE = @BUILD_CUPS_1_2_TRUE@ BUILD_CUPS_FALSE = @BUILD_CUPS_FALSE@ +BUILD_CUPS_PPDS = @BUILD_CUPS_PPDS@ BUILD_CUPS_PPDS_FALSE = @BUILD_CUPS_PPDS_FALSE@ BUILD_CUPS_PPDS_TRUE = @BUILD_CUPS_PPDS_TRUE@ BUILD_CUPS_TRUE = @BUILD_CUPS_TRUE@ @@ -116,6 +122,8 @@ BUILD_LIBGUTENPRINTUI_FALSE = @BUILD_LIBGUTENPRINTUI_FALSE@ BUILD_LIBGUTENPRINTUI_TRUE = @BUILD_LIBGUTENPRINTUI_TRUE@ BUILD_MODULES_FALSE = @BUILD_MODULES_FALSE@ BUILD_MODULES_TRUE = @BUILD_MODULES_TRUE@ +BUILD_SIMPLIFIED_CUPS_PPDS_FALSE = @BUILD_SIMPLIFIED_CUPS_PPDS_FALSE@ +BUILD_SIMPLIFIED_CUPS_PPDS_TRUE = @BUILD_SIMPLIFIED_CUPS_PPDS_TRUE@ BUILD_TESTPATTERN_FALSE = @BUILD_TESTPATTERN_FALSE@ BUILD_TESTPATTERN_TRUE = @BUILD_TESTPATTERN_TRUE@ BUILD_TEST_FALSE = @BUILD_TEST_FALSE@ @@ -123,6 +131,7 @@ BUILD_TEST_TRUE = @BUILD_TEST_TRUE@ BUILD_TRANSLATED_CUPS_PPDS_FALSE = @BUILD_TRANSLATED_CUPS_PPDS_FALSE@ BUILD_TRANSLATED_CUPS_PPDS_TRUE = @BUILD_TRANSLATED_CUPS_PPDS_TRUE@ CC = @CC@ +CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CONVERT = @CONVERT@ CPP = @CPP@ @@ -135,12 +144,14 @@ CUPS_PPDS_AT_TOP_LEVEL_TRUE = @CUPS_PPDS_AT_TOP_LEVEL_TRUE@ CUPS_PPD_PS_LEVEL = @CUPS_PPD_PS_LEVEL@ CXX = @CXX@ CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DB2HTML = @DB2HTML@ DB2PDF = @DB2PDF@ DB2PS = @DB2PS@ DEFS = @DEFS@ +DEPDIR = @DEPDIR@ DIALOG = @DIALOG@ DOXYGEN = @DOXYGEN@ DVIPDF = @DVIPDF@ @@ -175,6 +186,7 @@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GMSGFMT = @GMSGFMT@ GNUCFLAGS = @GNUCFLAGS@ +GREP = @GREP@ GTK2_CFLAGS = @GTK2_CFLAGS@ GTK2_LIBS = @GTK2_LIBS@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -270,14 +282,17 @@ VERSION = @VERSION@ WHICH_PPDS = @WHICH_PPDS@ XGETTEXT = @XGETTEXT@ YACC = @YACC@ -ac_ct_AR = @ac_ct_AR@ +YFLAGS = @YFLAGS@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ @@ -294,6 +309,9 @@ cups_exec_prefix = @cups_exec_prefix@ cups_prefix = @cups_prefix@ cups_sbindir = @cups_sbindir@ datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ exec_prefix = @exec_prefix@ gimp2_plug_indir = @gimp2_plug_indir@ gimp_plug_indir = @gimp_plug_indir@ @@ -311,17 +329,21 @@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ +htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ +localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ +psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ @@ -350,9 +372,9 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu --ignore-deps src/gimp/Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/gimp/Makefile'; \ cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu --ignore-deps src/gimp/Makefile + $(AUTOMAKE) --gnu src/gimp/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ @@ -408,14 +430,29 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/print-image-gimp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/print.Po@am__quote@ + .c.o: - $(COMPILE) -c $< +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: - $(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: - $(LTCOMPILE) -c -o $@ $< +@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo @@ -541,6 +578,7 @@ clean-am: clean-generic clean-gimp_plug_inPROGRAMS clean-libtool \ mostlyclean-am distclean: distclean-am + -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags @@ -566,6 +604,7 @@ install-man: installcheck-am: maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic diff --git a/src/gimp2/Makefile.in b/src/gimp2/Makefile.in index d051d04..0f31ca7 100644 --- a/src/gimp2/Makefile.in +++ b/src/gimp2/Makefile.in @@ -49,11 +49,12 @@ subdir = src/gimp2 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ $(top_srcdir)/m4/gimp.m4 $(top_srcdir)/m4/iconv.m4 \ - $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ - $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/progtest.m4 \ - $(top_srcdir)/m4/stp.m4 $(top_srcdir)/m4/stp_cups.m4 \ - $(top_srcdir)/m4/stp_gimp.m4 $(top_srcdir)/m4/stp_option.m4 \ - $(top_srcdir)/m4/stp_release.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/isc-posix.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/stp.m4 \ + $(top_srcdir)/m4/stp_cups.m4 $(top_srcdir)/m4/stp_gimp.m4 \ + $(top_srcdir)/m4/stp_option.m4 $(top_srcdir)/m4/stp_release.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/scripts/mkinstalldirs @@ -72,8 +73,8 @@ am__DEPENDENCIES_3 = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) am_print_OBJECTS = $(am__objects_1) print-print.$(OBJEXT) print_OBJECTS = $(am_print_OBJECTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -depcomp = -am__depfiles_maybe = +depcomp = $(SHELL) $(top_srcdir)/scripts/depcomp +am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ @@ -89,13 +90,18 @@ CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ +BUILD_CUPS_1_2_FALSE = @BUILD_CUPS_1_2_FALSE@ +BUILD_CUPS_1_2_TRUE = @BUILD_CUPS_1_2_TRUE@ BUILD_CUPS_FALSE = @BUILD_CUPS_FALSE@ +BUILD_CUPS_PPDS = @BUILD_CUPS_PPDS@ BUILD_CUPS_PPDS_FALSE = @BUILD_CUPS_PPDS_FALSE@ BUILD_CUPS_PPDS_TRUE = @BUILD_CUPS_PPDS_TRUE@ BUILD_CUPS_TRUE = @BUILD_CUPS_TRUE@ @@ -121,6 +127,8 @@ BUILD_LIBGUTENPRINTUI_FALSE = @BUILD_LIBGUTENPRINTUI_FALSE@ BUILD_LIBGUTENPRINTUI_TRUE = @BUILD_LIBGUTENPRINTUI_TRUE@ BUILD_MODULES_FALSE = @BUILD_MODULES_FALSE@ BUILD_MODULES_TRUE = @BUILD_MODULES_TRUE@ +BUILD_SIMPLIFIED_CUPS_PPDS_FALSE = @BUILD_SIMPLIFIED_CUPS_PPDS_FALSE@ +BUILD_SIMPLIFIED_CUPS_PPDS_TRUE = @BUILD_SIMPLIFIED_CUPS_PPDS_TRUE@ BUILD_TESTPATTERN_FALSE = @BUILD_TESTPATTERN_FALSE@ BUILD_TESTPATTERN_TRUE = @BUILD_TESTPATTERN_TRUE@ BUILD_TEST_FALSE = @BUILD_TEST_FALSE@ @@ -128,6 +136,7 @@ BUILD_TEST_TRUE = @BUILD_TEST_TRUE@ BUILD_TRANSLATED_CUPS_PPDS_FALSE = @BUILD_TRANSLATED_CUPS_PPDS_FALSE@ BUILD_TRANSLATED_CUPS_PPDS_TRUE = @BUILD_TRANSLATED_CUPS_PPDS_TRUE@ CC = @CC@ +CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CONVERT = @CONVERT@ CPP = @CPP@ @@ -140,12 +149,14 @@ CUPS_PPDS_AT_TOP_LEVEL_TRUE = @CUPS_PPDS_AT_TOP_LEVEL_TRUE@ CUPS_PPD_PS_LEVEL = @CUPS_PPD_PS_LEVEL@ CXX = @CXX@ CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DB2HTML = @DB2HTML@ DB2PDF = @DB2PDF@ DB2PS = @DB2PS@ DEFS = @DEFS@ +DEPDIR = @DEPDIR@ DIALOG = @DIALOG@ DOXYGEN = @DOXYGEN@ DVIPDF = @DVIPDF@ @@ -180,6 +191,7 @@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GMSGFMT = @GMSGFMT@ GNUCFLAGS = @GNUCFLAGS@ +GREP = @GREP@ GTK2_CFLAGS = @GTK2_CFLAGS@ GTK2_LIBS = @GTK2_LIBS@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -275,14 +287,17 @@ VERSION = @VERSION@ WHICH_PPDS = @WHICH_PPDS@ XGETTEXT = @XGETTEXT@ YACC = @YACC@ -ac_ct_AR = @ac_ct_AR@ +YFLAGS = @YFLAGS@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ @@ -299,6 +314,9 @@ cups_exec_prefix = @cups_exec_prefix@ cups_prefix = @cups_prefix@ cups_sbindir = @cups_sbindir@ datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ exec_prefix = @exec_prefix@ gimp2_plug_indir = @gimp2_plug_indir@ gimp_plug_indir = @gimp_plug_indir@ @@ -316,17 +334,21 @@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ +htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ +localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ +psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ @@ -360,9 +382,9 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu --ignore-deps src/gimp2/Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/gimp2/Makefile'; \ cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu --ignore-deps src/gimp2/Makefile + $(AUTOMAKE) --gnu src/gimp2/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ @@ -421,14 +443,31 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/print-gutenprint.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/print-image-gimp.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/print-print.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/print.Po@am__quote@ + .c.o: - $(COMPILE) -c $< +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: - $(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: - $(LTCOMPILE) -c -o $@ $< +@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo @@ -555,6 +594,7 @@ clean-am: clean-generic clean-gimp2_plug_inPROGRAMS clean-libtool \ mostlyclean-am distclean: distclean-am + -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags @@ -580,6 +620,7 @@ install-man: installcheck-am: maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic diff --git a/src/gutenprintui/Makefile.in b/src/gutenprintui/Makefile.in index 96534d5..2da21b8 100644 --- a/src/gutenprintui/Makefile.in +++ b/src/gutenprintui/Makefile.in @@ -49,11 +49,12 @@ subdir = src/gutenprintui ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ $(top_srcdir)/m4/gimp.m4 $(top_srcdir)/m4/iconv.m4 \ - $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ - $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/progtest.m4 \ - $(top_srcdir)/m4/stp.m4 $(top_srcdir)/m4/stp_cups.m4 \ - $(top_srcdir)/m4/stp_gimp.m4 $(top_srcdir)/m4/stp_option.m4 \ - $(top_srcdir)/m4/stp_release.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/isc-posix.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/stp.m4 \ + $(top_srcdir)/m4/stp_cups.m4 $(top_srcdir)/m4/stp_gimp.m4 \ + $(top_srcdir)/m4/stp_option.m4 $(top_srcdir)/m4/stp_release.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/scripts/mkinstalldirs @@ -79,8 +80,8 @@ libgutenprintui_la_OBJECTS = $(am_libgutenprintui_la_OBJECTS) @BUILD_LIBGUTENPRINTUI_TRUE@am_libgutenprintui_la_rpath = -rpath \ @BUILD_LIBGUTENPRINTUI_TRUE@ $(libdir) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -depcomp = -am__depfiles_maybe = +depcomp = $(SHELL) $(top_srcdir)/scripts/depcomp +am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ @@ -103,13 +104,18 @@ CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ +BUILD_CUPS_1_2_FALSE = @BUILD_CUPS_1_2_FALSE@ +BUILD_CUPS_1_2_TRUE = @BUILD_CUPS_1_2_TRUE@ BUILD_CUPS_FALSE = @BUILD_CUPS_FALSE@ +BUILD_CUPS_PPDS = @BUILD_CUPS_PPDS@ BUILD_CUPS_PPDS_FALSE = @BUILD_CUPS_PPDS_FALSE@ BUILD_CUPS_PPDS_TRUE = @BUILD_CUPS_PPDS_TRUE@ BUILD_CUPS_TRUE = @BUILD_CUPS_TRUE@ @@ -135,6 +141,8 @@ BUILD_LIBGUTENPRINTUI_FALSE = @BUILD_LIBGUTENPRINTUI_FALSE@ BUILD_LIBGUTENPRINTUI_TRUE = @BUILD_LIBGUTENPRINTUI_TRUE@ BUILD_MODULES_FALSE = @BUILD_MODULES_FALSE@ BUILD_MODULES_TRUE = @BUILD_MODULES_TRUE@ +BUILD_SIMPLIFIED_CUPS_PPDS_FALSE = @BUILD_SIMPLIFIED_CUPS_PPDS_FALSE@ +BUILD_SIMPLIFIED_CUPS_PPDS_TRUE = @BUILD_SIMPLIFIED_CUPS_PPDS_TRUE@ BUILD_TESTPATTERN_FALSE = @BUILD_TESTPATTERN_FALSE@ BUILD_TESTPATTERN_TRUE = @BUILD_TESTPATTERN_TRUE@ BUILD_TEST_FALSE = @BUILD_TEST_FALSE@ @@ -142,6 +150,7 @@ BUILD_TEST_TRUE = @BUILD_TEST_TRUE@ BUILD_TRANSLATED_CUPS_PPDS_FALSE = @BUILD_TRANSLATED_CUPS_PPDS_FALSE@ BUILD_TRANSLATED_CUPS_PPDS_TRUE = @BUILD_TRANSLATED_CUPS_PPDS_TRUE@ CC = @CC@ +CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CONVERT = @CONVERT@ CPP = @CPP@ @@ -154,12 +163,14 @@ CUPS_PPDS_AT_TOP_LEVEL_TRUE = @CUPS_PPDS_AT_TOP_LEVEL_TRUE@ CUPS_PPD_PS_LEVEL = @CUPS_PPD_PS_LEVEL@ CXX = @CXX@ CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DB2HTML = @DB2HTML@ DB2PDF = @DB2PDF@ DB2PS = @DB2PS@ DEFS = @DEFS@ +DEPDIR = @DEPDIR@ DIALOG = @DIALOG@ DOXYGEN = @DOXYGEN@ DVIPDF = @DVIPDF@ @@ -194,6 +205,7 @@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GMSGFMT = @GMSGFMT@ GNUCFLAGS = @GNUCFLAGS@ +GREP = @GREP@ GTK2_CFLAGS = @GTK2_CFLAGS@ GTK2_LIBS = @GTK2_LIBS@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -289,14 +301,17 @@ VERSION = @VERSION@ WHICH_PPDS = @WHICH_PPDS@ XGETTEXT = @XGETTEXT@ YACC = @YACC@ -ac_ct_AR = @ac_ct_AR@ +YFLAGS = @YFLAGS@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ @@ -313,6 +328,9 @@ cups_exec_prefix = @cups_exec_prefix@ cups_prefix = @cups_prefix@ cups_sbindir = @cups_sbindir@ datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ exec_prefix = @exec_prefix@ gimp2_plug_indir = @gimp2_plug_indir@ gimp_plug_indir = @gimp_plug_indir@ @@ -330,17 +348,21 @@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ +htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ +localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ +psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ @@ -386,9 +408,9 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu --ignore-deps src/gutenprintui/Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/gutenprintui/Makefile'; \ cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu --ignore-deps src/gutenprintui/Makefile + $(AUTOMAKE) --gnu src/gutenprintui/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ @@ -449,32 +471,75 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgutenprintui_la-panel.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgutenprintui_la-plist.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgutenprintui_la-print-image-thumbnail.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgutenprintui_la-printrcl.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgutenprintui_la-printrcy.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgutenprintui_la-ui-utils.Plo@am__quote@ + .c.o: - $(COMPILE) -c $< +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: - $(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: - $(LTCOMPILE) -c -o $@ $< +@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< libgutenprintui_la-printrcy.lo: printrcy.c - $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgutenprintui_la_CFLAGS) $(CFLAGS) -c -o libgutenprintui_la-printrcy.lo `test -f 'printrcy.c' || echo '$(srcdir)/'`printrcy.c +@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgutenprintui_la_CFLAGS) $(CFLAGS) -MT libgutenprintui_la-printrcy.lo -MD -MP -MF "$(DEPDIR)/libgutenprintui_la-printrcy.Tpo" -c -o libgutenprintui_la-printrcy.lo `test -f 'printrcy.c' || echo '$(srcdir)/'`printrcy.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libgutenprintui_la-printrcy.Tpo" "$(DEPDIR)/libgutenprintui_la-printrcy.Plo"; else rm -f "$(DEPDIR)/libgutenprintui_la-printrcy.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='printrcy.c' object='libgutenprintui_la-printrcy.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgutenprintui_la_CFLAGS) $(CFLAGS) -c -o libgutenprintui_la-printrcy.lo `test -f 'printrcy.c' || echo '$(srcdir)/'`printrcy.c libgutenprintui_la-printrcl.lo: printrcl.c - $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgutenprintui_la_CFLAGS) $(CFLAGS) -c -o libgutenprintui_la-printrcl.lo `test -f 'printrcl.c' || echo '$(srcdir)/'`printrcl.c +@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgutenprintui_la_CFLAGS) $(CFLAGS) -MT libgutenprintui_la-printrcl.lo -MD -MP -MF "$(DEPDIR)/libgutenprintui_la-printrcl.Tpo" -c -o libgutenprintui_la-printrcl.lo `test -f 'printrcl.c' || echo '$(srcdir)/'`printrcl.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libgutenprintui_la-printrcl.Tpo" "$(DEPDIR)/libgutenprintui_la-printrcl.Plo"; else rm -f "$(DEPDIR)/libgutenprintui_la-printrcl.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='printrcl.c' object='libgutenprintui_la-printrcl.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgutenprintui_la_CFLAGS) $(CFLAGS) -c -o libgutenprintui_la-printrcl.lo `test -f 'printrcl.c' || echo '$(srcdir)/'`printrcl.c libgutenprintui_la-plist.lo: plist.c - $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgutenprintui_la_CFLAGS) $(CFLAGS) -c -o libgutenprintui_la-plist.lo `test -f 'plist.c' || echo '$(srcdir)/'`plist.c +@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgutenprintui_la_CFLAGS) $(CFLAGS) -MT libgutenprintui_la-plist.lo -MD -MP -MF "$(DEPDIR)/libgutenprintui_la-plist.Tpo" -c -o libgutenprintui_la-plist.lo `test -f 'plist.c' || echo '$(srcdir)/'`plist.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libgutenprintui_la-plist.Tpo" "$(DEPDIR)/libgutenprintui_la-plist.Plo"; else rm -f "$(DEPDIR)/libgutenprintui_la-plist.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='plist.c' object='libgutenprintui_la-plist.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgutenprintui_la_CFLAGS) $(CFLAGS) -c -o libgutenprintui_la-plist.lo `test -f 'plist.c' || echo '$(srcdir)/'`plist.c libgutenprintui_la-panel.lo: panel.c - $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgutenprintui_la_CFLAGS) $(CFLAGS) -c -o libgutenprintui_la-panel.lo `test -f 'panel.c' || echo '$(srcdir)/'`panel.c +@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgutenprintui_la_CFLAGS) $(CFLAGS) -MT libgutenprintui_la-panel.lo -MD -MP -MF "$(DEPDIR)/libgutenprintui_la-panel.Tpo" -c -o libgutenprintui_la-panel.lo `test -f 'panel.c' || echo '$(srcdir)/'`panel.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libgutenprintui_la-panel.Tpo" "$(DEPDIR)/libgutenprintui_la-panel.Plo"; else rm -f "$(DEPDIR)/libgutenprintui_la-panel.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='panel.c' object='libgutenprintui_la-panel.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgutenprintui_la_CFLAGS) $(CFLAGS) -c -o libgutenprintui_la-panel.lo `test -f 'panel.c' || echo '$(srcdir)/'`panel.c libgutenprintui_la-ui-utils.lo: ui-utils.c - $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgutenprintui_la_CFLAGS) $(CFLAGS) -c -o libgutenprintui_la-ui-utils.lo `test -f 'ui-utils.c' || echo '$(srcdir)/'`ui-utils.c +@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgutenprintui_la_CFLAGS) $(CFLAGS) -MT libgutenprintui_la-ui-utils.lo -MD -MP -MF "$(DEPDIR)/libgutenprintui_la-ui-utils.Tpo" -c -o libgutenprintui_la-ui-utils.lo `test -f 'ui-utils.c' || echo '$(srcdir)/'`ui-utils.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libgutenprintui_la-ui-utils.Tpo" "$(DEPDIR)/libgutenprintui_la-ui-utils.Plo"; else rm -f "$(DEPDIR)/libgutenprintui_la-ui-utils.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ui-utils.c' object='libgutenprintui_la-ui-utils.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgutenprintui_la_CFLAGS) $(CFLAGS) -c -o libgutenprintui_la-ui-utils.lo `test -f 'ui-utils.c' || echo '$(srcdir)/'`ui-utils.c libgutenprintui_la-print-image-thumbnail.lo: print-image-thumbnail.c - $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgutenprintui_la_CFLAGS) $(CFLAGS) -c -o libgutenprintui_la-print-image-thumbnail.lo `test -f 'print-image-thumbnail.c' || echo '$(srcdir)/'`print-image-thumbnail.c +@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgutenprintui_la_CFLAGS) $(CFLAGS) -MT libgutenprintui_la-print-image-thumbnail.lo -MD -MP -MF "$(DEPDIR)/libgutenprintui_la-print-image-thumbnail.Tpo" -c -o libgutenprintui_la-print-image-thumbnail.lo `test -f 'print-image-thumbnail.c' || echo '$(srcdir)/'`print-image-thumbnail.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libgutenprintui_la-print-image-thumbnail.Tpo" "$(DEPDIR)/libgutenprintui_la-print-image-thumbnail.Plo"; else rm -f "$(DEPDIR)/libgutenprintui_la-print-image-thumbnail.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='print-image-thumbnail.c' object='libgutenprintui_la-print-image-thumbnail.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgutenprintui_la_CFLAGS) $(CFLAGS) -c -o libgutenprintui_la-print-image-thumbnail.lo `test -f 'print-image-thumbnail.c' || echo '$(srcdir)/'`print-image-thumbnail.c .l.c: $(LEXCOMPILE) $< @@ -646,6 +711,7 @@ clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am + -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags @@ -671,6 +737,7 @@ install-man: installcheck-am: maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic diff --git a/src/gutenprintui/gutenprintui-internal.h b/src/gutenprintui/gutenprintui-internal.h index 3eb98d8..7c4547d 100644 --- a/src/gutenprintui/gutenprintui-internal.h +++ b/src/gutenprintui/gutenprintui-internal.h @@ -1,5 +1,5 @@ /* - * "$Id: gutenprintui-internal.h,v 1.2 2005/09/17 21:54:33 rlk Exp $" + * "$Id: gutenprintui-internal.h,v 1.2.12.1 2007/03/02 12:01:17 rlk Exp $" * * Print plug-in for the GIMP. * @@ -139,7 +139,7 @@ typedef struct extern gint stpui_plist_count; /* Number of system printers */ extern gint stpui_plist_current; /* Current system printer */ extern stpui_plist_t *stpui_plist; /* System printers */ -extern const char *stpui_printrc_current_printer; +extern char *stpui_printrc_current_printer; extern int stpui_show_all_paper_sizes; extern stp_string_list_t *stpui_system_print_queues; diff --git a/src/gutenprintui/panel.c b/src/gutenprintui/panel.c index ea8eb70..a8b1858 100644 --- a/src/gutenprintui/panel.c +++ b/src/gutenprintui/panel.c @@ -1,5 +1,5 @@ /* - * "$Id: panel.c,v 1.9 2006/07/16 21:02:22 rlk Exp $" + * "$Id: panel.c,v 1.9.6.1 2007/03/02 12:01:17 rlk Exp $" * * Main window code for Print plug-in for the GIMP. * @@ -120,6 +120,8 @@ static GtkWidget *ppd_box; static GtkWidget *ppd_label; /* PPD file entry */ static GtkWidget *ppd_button; /* PPD file browse button */ static GtkWidget *ppd_browser; /* File selection dialog for PPDs */ +static GtkWidget *ppd_model_label; /* PPD file entry */ +static GtkWidget *ppd_model; /* PPD file entry */ static GtkWidget *new_printer_dialog; /* New printer dialog window */ static GtkWidget *new_printer_entry; /* New printer text entry */ static GtkWidget *file_button; /* PPD file browse button */ @@ -192,6 +194,7 @@ static void combo_callback (GtkWidget *widget, gpointer data); static void output_type_callback (GtkWidget *widget, gpointer data); static void unit_callback (GtkWidget *widget, gpointer data); static void orientation_callback (GtkWidget *widget, gpointer data); +static void ppd_file_callback (GtkWidget *widget, gpointer data); static void printandsave_callback (void); static void about_callback (void); static void print_callback (void); @@ -1647,6 +1650,8 @@ create_printer_dialog (void) GTK_FILL, GTK_FILL, 0, 0); ppd_file = gtk_entry_new (); + gtk_signal_connect(GTK_OBJECT(ppd_file), "activate", + GTK_SIGNAL_FUNC(ppd_file_callback), NULL); gtk_box_pack_start (GTK_BOX (ppd_box), ppd_file, TRUE, TRUE, 0); gtk_widget_show (ppd_file); @@ -1663,6 +1668,19 @@ create_printer_dialog (void) gtk_signal_connect (GTK_OBJECT (ppd_button), "clicked", GTK_SIGNAL_FUNC (ppd_browse_callback), NULL); + ppd_model_label = gtk_label_new (_("Printer Model:")); + gtk_misc_set_alignment (GTK_MISC (ppd_model_label), 1.0, 0.5); + gtk_table_attach (GTK_TABLE (table), ppd_model_label, 1, 2, 4, 5, + GTK_FILL, GTK_FILL, 0, 0); + gtk_widget_show (ppd_model_label); + + ppd_model = gtk_label_new (""); + gtk_misc_set_alignment (GTK_MISC (ppd_model), 0.0, 0.5); + gtk_table_attach (GTK_TABLE (table), ppd_model, 2, 7, 4, 5, + GTK_FILL, GTK_FILL, 0, 0); + gtk_widget_show (ppd_model); + + /* * Print command. */ @@ -1670,11 +1688,11 @@ create_printer_dialog (void) group = NULL; for (i = 0; i < command_options_count; i++) group = stpui_create_radio_button(&(command_options[i]), group, table, - 0, i > 0 ? i + 5 : i + 4, + 0, i > 0 ? i + 6 : i + 5, command_type_callback); standard_cmd_entry = gtk_entry_new(); - gtk_table_attach (GTK_TABLE (table), standard_cmd_entry, 2, 7, 5, 6, + gtk_table_attach (GTK_TABLE (table), standard_cmd_entry, 2, 7, 6, 7, GTK_FILL, GTK_FILL, 0, 0); gtk_entry_set_editable(GTK_ENTRY(standard_cmd_entry), FALSE); gtk_widget_set_sensitive(standard_cmd_entry, FALSE); @@ -1692,13 +1710,13 @@ create_printer_dialog (void) "or model, of printer) that you wish to print to")); label = gtk_label_new(_("Printer Queue:")); gtk_widget_show(label); - gtk_table_attach (GTK_TABLE (table), label, 2, 3, 4, 5, + gtk_table_attach (GTK_TABLE (table), label, 2, 3, 5, 6, GTK_FILL, GTK_FILL, 0, 0); - gtk_table_attach (GTK_TABLE (table), event_box, 3, 7, 4, 5, + gtk_table_attach (GTK_TABLE (table), event_box, 3, 7, 5, 6, GTK_FILL, GTK_FILL, 0, 0); custom_command_entry = gtk_entry_new (); - gtk_table_attach (GTK_TABLE (table), custom_command_entry, 2, 7, 6, 7, + gtk_table_attach (GTK_TABLE (table), custom_command_entry, 2, 7, 7, 8, GTK_FILL, GTK_FILL, 0, 0); gtk_signal_connect(GTK_OBJECT(custom_command_entry), "activate", GTK_SIGNAL_FUNC(setup_callback), NULL); @@ -1709,7 +1727,7 @@ create_printer_dialog (void) (custom_command_entry, _("Enter the correct command to print to your printer. ")); file_entry = gtk_entry_new (); - gtk_table_attach (GTK_TABLE (table), file_entry, 2, 6, 7, 8, + gtk_table_attach (GTK_TABLE (table), file_entry, 2, 6, 8, 9, GTK_FILL, GTK_FILL, 0, 0); gtk_signal_connect(GTK_OBJECT(file_entry), "activate", GTK_SIGNAL_FUNC(setup_callback), NULL); @@ -1721,7 +1739,7 @@ create_printer_dialog (void) file_button = gtk_button_new_with_label (_("Browse")); - gtk_table_attach (GTK_TABLE (table), file_button, 6, 7, 7, 8, + gtk_table_attach (GTK_TABLE (table), file_button, 6, 7, 8, 9, GTK_FILL, GTK_FILL, 0, 0); gtk_widget_show (file_button); @@ -2597,9 +2615,10 @@ plist_build_combo (GtkWidget *combo, /* I - Combo widget */ gtk_combo_set_popdown_strings (GTK_COMBO (combo), list); - for (i = 0; i < num_items; i ++) - if (strcmp(stp_string_list_param(items, i)->name, cur_item) == 0) - break; + if (cur_item) + for (i = 0; i < num_items; i ++) + if (strcmp(stp_string_list_param(items, i)->name, cur_item) == 0) + break; if (i >= num_items && def_value) for (i = 0; i < num_items; i ++) @@ -3564,6 +3583,7 @@ setup_update (void) gint idx = 0; gint i; gchar *tmp; + stp_parameter_t desc; const char *ppd_file_name = stp_get_file_parameter(pv->v, "PPDFile"); for (i = 0; i < GTK_CLIST(manufacturer_clist)->rows; i++) @@ -3586,23 +3606,49 @@ setup_update (void) idx = 0; */ gtk_clist_select_row (GTK_CLIST (printer_driver), idx, 0); - gtk_label_set_text (GTK_LABEL (printer_model_label), - gettext (stp_printer_get_long_name (tmp_printer))); + stp_describe_parameter(pv->v, "ModelName", &desc); + if (desc.p_type == STP_PARAMETER_TYPE_STRING_LIST && desc.is_active && + desc.deflt.str) + { + const char *extra_printer_model = desc.deflt.str; + char *label_text = + g_malloc(strlen(gettext (stp_printer_get_long_name (tmp_printer))) + + 2 + /* " (" */ + strlen(extra_printer_model) + + 2); /* ")" + null terminator */ + strcpy(label_text, extra_printer_model); + strcat(label_text, " ("); + strcat(label_text, gettext (stp_printer_get_long_name (tmp_printer))); + strcat(label_text, ")"); + gtk_label_set_text (GTK_LABEL (printer_model_label), label_text); + g_free(label_text); + } + else + { + gtk_label_set_text (GTK_LABEL (printer_model_label), + gettext (stp_printer_get_long_name (tmp_printer))); + } + stp_parameter_description_destroy(&desc); if (ppd_file_name) gtk_entry_set_text (GTK_ENTRY (ppd_file), ppd_file_name); else gtk_entry_set_text (GTK_ENTRY (ppd_file), ""); + ppd_file_callback(ppd_file, NULL); if (stp_parameter_find_in_settings(pv->v, "PPDFile")) { gtk_widget_show (ppd_box); gtk_widget_show (ppd_label); + gtk_widget_show (ppd_model_label); + gtk_widget_show (ppd_model); } else { gtk_widget_hide (ppd_box); gtk_widget_hide (ppd_label); + gtk_widget_hide (ppd_model_label); + gtk_widget_hide (ppd_model); } gtk_entry_set_text (GTK_ENTRY (custom_command_entry), stpui_plist_get_custom_command (pv)); @@ -3619,6 +3665,27 @@ setup_update (void) TRUE); } +static void +ppd_file_callback(GtkWidget *widget, gpointer data) +{ + const gchar *name = gtk_entry_get_text(GTK_ENTRY(widget)); + if (name && pv && pv->v) + { + stp_parameter_t desc; + stp_vars_t *v = stp_vars_create_copy(pv->v); + stp_set_file_parameter(v, "PPDFile", name); + stp_describe_parameter(v, "ModelName", &desc); + if (desc.is_active) + gtk_label_set_text(GTK_LABEL(ppd_model), desc.deflt.str); + else + gtk_label_set_text(GTK_LABEL(ppd_model), ""); + stp_parameter_description_destroy(&desc); + stp_vars_destroy(v); + } + else + gtk_label_set_text(GTK_LABEL(ppd_model), ""); +} + /* * setup_open_callback() - */ @@ -3739,11 +3806,15 @@ pop_ppd_box(void) { gtk_widget_show (ppd_label); gtk_widget_show (ppd_box); + gtk_widget_show (ppd_model_label); + gtk_widget_show (ppd_model); } else { gtk_widget_hide (ppd_label); gtk_widget_hide (ppd_box); + gtk_widget_hide (ppd_model_label); + gtk_widget_hide (ppd_model); } } @@ -3847,6 +3918,8 @@ ppd_ok_callback (void) gtk_entry_set_text (GTK_ENTRY (ppd_file), gtk_file_selection_get_filename (GTK_FILE_SELECTION (ppd_browser))); + ppd_file_callback(ppd_file, NULL); + update_options(); } /* diff --git a/src/gutenprintui/plist.c b/src/gutenprintui/plist.c index cea5a43..3809eeb 100644 --- a/src/gutenprintui/plist.c +++ b/src/gutenprintui/plist.c @@ -1,5 +1,5 @@ /* - * "$Id: plist.c,v 1.3 2006/07/16 23:07:32 rlk Exp $" + * "$Id: plist.c,v 1.3.6.1 2007/03/02 12:01:18 rlk Exp $" * * Print plug-in for the GIMP. * @@ -315,6 +315,19 @@ stpui_set_image_channel_depth(gint depth) image_channel_depth = depth; } +static void +writefunc(void *file, const char *buf, size_t bytes) +{ + FILE *prn = (FILE *)file; + fwrite(buf, 1, bytes, prn); +} + +static void +stpui_errfunc(void *file, const char *buf, size_t bytes) +{ + g_message(buf); +} + void stpui_printer_initialize(stpui_plist_t *printer) { @@ -331,6 +344,8 @@ stpui_printer_initialize(stpui_plist_t *printer) printer->auto_size_roll_feed_paper = 0; printer->unit = 0; printer->v = stp_vars_create(); + stp_set_errfunc(printer->v, writefunc); + stp_set_errdata(printer->v, stderr); stpui_plist_set_copy_count(printer, 1); stp_set_string_parameter(printer->v, "InputImageType", image_type); if (image_raw_channels) @@ -566,11 +581,11 @@ do { \ } while (0) static void * -psearch(const void *key, const void *base, size_t nmemb, size_t size, +psearch(const void *key, void *base, size_t nmemb, size_t size, int (*compar)(const void *, const void *)) { int i; - const char *cbase = (const char *) base; + char *cbase = (char *) base; for (i = 0; i < nmemb; i++) { if ((*compar)(key, (const void *) cbase) == 0) @@ -613,6 +628,8 @@ stpui_plist_add(const stpui_plist_t *key, int add_only) * always first in the list, else call psearch. */ stpui_plist_t *p; + if (!stp_get_printer(key->v)) + stp_set_driver(key->v, "ps2"); if (stp_get_printer(key->v)) { p = psearch(key, stpui_plist, stpui_plist_count, @@ -642,8 +659,13 @@ stpui_plist_add(const stpui_plist_t *key, int add_only) #endif stpui_plist_copy(p, key); } + return 1; + } + else + { + fprintf(stderr, "No printer found!\n"); + return 0; } - return 1; } static void @@ -910,7 +932,7 @@ stpui_printrc_load_v1(FILE *fp) } } -const char *stpui_printrc_current_printer = NULL; +char *stpui_printrc_current_printer = NULL; extern FILE *yyin; extern int yyparse(void); @@ -921,7 +943,9 @@ stpui_printrc_load_v2(FILE *fp) yyin = fp; stpui_printrc_current_printer = NULL; + setlocale(LC_ALL, "C"); retval = yyparse(); + setlocale(LC_ALL, ""); if (stpui_printrc_current_printer) { int i; @@ -1232,19 +1256,6 @@ usr1_handler (int sig) usr1_interrupt = 1; } -static void -writefunc(void *file, const char *buf, size_t bytes) -{ - FILE *prn = (FILE *)file; - fwrite(buf, 1, bytes, prn); -} - -static void -stpui_errfunc(void *file, const char *buf, size_t bytes) -{ - g_message(buf); -} - /* * * Process control for actually printing. Documented 20040821 @@ -1751,5 +1762,5 @@ stpui_print(const stpui_plist_t *printer, stpui_image_t *image) } /* - * End of "$Id: plist.c,v 1.3 2006/07/16 23:07:32 rlk Exp $". + * End of "$Id: plist.c,v 1.3.6.1 2007/03/02 12:01:18 rlk Exp $". */ diff --git a/src/gutenprintui/printrcl.c b/src/gutenprintui/printrcl.c index e1718e4..f4490d4 100644 --- a/src/gutenprintui/printrcl.c +++ b/src/gutenprintui/printrcl.c @@ -1,31 +1,92 @@ -/* A lexical scanner generated by flex */ -/* Scanner skeleton version: - * $Header: /home/daffy/u0/vern/flex/RCS/flex.skl,v 2.91 96/09/10 16:58:48 vern Exp $ - */ +#line 3 "printrcl.c" + +#define YY_INT_ALIGNED short int + +/* A lexical scanner generated by flex */ #define FLEX_SCANNER #define YY_FLEX_MAJOR_VERSION 2 #define YY_FLEX_MINOR_VERSION 5 +#define YY_FLEX_SUBMINOR_VERSION 33 +#if YY_FLEX_SUBMINOR_VERSION > 0 +#define FLEX_BETA +#endif +/* First, we deal with platform-specific or compiler-specific issues. */ + +/* begin standard C headers. */ #include +#include +#include +#include +/* end standard C headers. */ -/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */ -#ifdef c_plusplus -#ifndef __cplusplus -#define __cplusplus -#endif +/* flex integer type definitions */ + +#ifndef FLEXINT_H +#define FLEXINT_H + +/* C99 systems have . Non-C99 systems may or may not. */ + +#if __STDC_VERSION__ >= 199901L + +/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h, + * if you want the limit (max/min) macros for int types. + */ +#ifndef __STDC_LIMIT_MACROS +#define __STDC_LIMIT_MACROS 1 #endif +#include +typedef int8_t flex_int8_t; +typedef uint8_t flex_uint8_t; +typedef int16_t flex_int16_t; +typedef uint16_t flex_uint16_t; +typedef int32_t flex_int32_t; +typedef uint32_t flex_uint32_t; +#else +typedef signed char flex_int8_t; +typedef short int flex_int16_t; +typedef int flex_int32_t; +typedef unsigned char flex_uint8_t; +typedef unsigned short int flex_uint16_t; +typedef unsigned int flex_uint32_t; +#endif /* ! C99 */ -#ifdef __cplusplus +/* Limits of integral types. */ +#ifndef INT8_MIN +#define INT8_MIN (-128) +#endif +#ifndef INT16_MIN +#define INT16_MIN (-32767-1) +#endif +#ifndef INT32_MIN +#define INT32_MIN (-2147483647-1) +#endif +#ifndef INT8_MAX +#define INT8_MAX (127) +#endif +#ifndef INT16_MAX +#define INT16_MAX (32767) +#endif +#ifndef INT32_MAX +#define INT32_MAX (2147483647) +#endif +#ifndef UINT8_MAX +#define UINT8_MAX (255U) +#endif +#ifndef UINT16_MAX +#define UINT16_MAX (65535U) +#endif +#ifndef UINT32_MAX +#define UINT32_MAX (4294967295U) +#endif -#include -#include +#endif /* ! FLEXINT_H */ -/* Use prototypes in function declarations. */ -#define YY_USE_PROTOS +#ifdef __cplusplus /* The "const" storage-class-modifier is valid. */ #define YY_USE_CONST @@ -34,34 +95,17 @@ #if __STDC__ -#define YY_USE_PROTOS #define YY_USE_CONST #endif /* __STDC__ */ #endif /* ! __cplusplus */ -#ifdef __TURBOC__ - #pragma warn -rch - #pragma warn -use -#include -#include -#define YY_USE_CONST -#define YY_USE_PROTOS -#endif - #ifdef YY_USE_CONST #define yyconst const #else #define yyconst #endif - -#ifdef YY_USE_PROTOS -#define YY_PROTO(proto) proto -#else -#define YY_PROTO(proto) () -#endif - /* Returned upon end-of-file. */ #define YY_NULL 0 @@ -76,71 +120,75 @@ * but we do it the disgusting crufty way forced on us by the ()-less * definition of BEGIN. */ -#define BEGIN yy_start = 1 + 2 * +#define BEGIN (yy_start) = 1 + 2 * /* Translate the current start state into a value that can be later handed * to BEGIN to return to the state. The YYSTATE alias is for lex * compatibility. */ -#define YY_START ((yy_start - 1) / 2) +#define YY_START (((yy_start) - 1) / 2) #define YYSTATE YY_START /* Action number for EOF rule of a given start state. */ #define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1) /* Special action meaning "start processing a new file". */ -#define YY_NEW_FILE yyrestart( yyin ) +#define YY_NEW_FILE yyrestart(yyin ) #define YY_END_OF_BUFFER_CHAR 0 /* Size of default input buffer. */ +#ifndef YY_BUF_SIZE #define YY_BUF_SIZE 16384 +#endif +/* The state buf must be large enough to hold one state per character in the main buffer. + */ +#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type)) + +#ifndef YY_TYPEDEF_YY_BUFFER_STATE +#define YY_TYPEDEF_YY_BUFFER_STATE typedef struct yy_buffer_state *YY_BUFFER_STATE; +#endif extern int yyleng; + extern FILE *yyin, *yyout; #define EOB_ACT_CONTINUE_SCAN 0 #define EOB_ACT_END_OF_FILE 1 #define EOB_ACT_LAST_MATCH 2 -/* The funky do-while in the following #define is used to turn the definition - * int a single C statement (which needs a semi-colon terminator). This - * avoids problems with code like: - * - * if ( condition_holds ) - * yyless( 5 ); - * else - * do_something_else(); - * - * Prior to using the do-while the compiler would get upset at the - * "else" because it interpreted the "if" statement as being all - * done when it reached the ';' after the yyless() call. - */ - -/* Return all but the first 'n' matched characters back to the input stream. */ - + #define YY_LESS_LINENO(n) + +/* Return all but the first "n" matched characters back to the input stream. */ #define yyless(n) \ do \ { \ /* Undo effects of setting up yytext. */ \ - *yy_cp = yy_hold_char; \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + *yy_cp = (yy_hold_char); \ YY_RESTORE_YY_MORE_OFFSET \ - yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \ + (yy_c_buf_p) = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \ YY_DO_BEFORE_ACTION; /* set up yytext again */ \ } \ while ( 0 ) -#define unput(c) yyunput( c, yytext_ptr ) +#define unput(c) yyunput( c, (yytext_ptr) ) /* The following is because we cannot portably get our hands on size_t * (without autoconf's help, which isn't available because we want * flex-generated scanners to compile on their own). */ -typedef unsigned int yy_size_t; +#ifndef YY_TYPEDEF_YY_SIZE_T +#define YY_TYPEDEF_YY_SIZE_T +typedef unsigned int yy_size_t; +#endif +#ifndef YY_STRUCT_YY_BUFFER_STATE +#define YY_STRUCT_YY_BUFFER_STATE struct yy_buffer_state { FILE *yy_input_file; @@ -177,12 +225,16 @@ struct yy_buffer_state */ int yy_at_bol; + int yy_bs_lineno; /**< The line count. */ + int yy_bs_column; /**< The column count. */ + /* Whether to try to fill the input buffer when we reach the * end of it. */ int yy_fill_buffer; int yy_buffer_status; + #define YY_BUFFER_NEW 0 #define YY_BUFFER_NORMAL 1 /* When an EOF's been seen but there's still some text to process @@ -196,28 +248,38 @@ struct yy_buffer_state * just pointing yyin at a new input file. */ #define YY_BUFFER_EOF_PENDING 2 + }; +#endif /* !YY_STRUCT_YY_BUFFER_STATE */ -static YY_BUFFER_STATE yy_current_buffer = 0; +/* Stack of input buffers. */ +static size_t yy_buffer_stack_top = 0; /**< index of top of stack. */ +static size_t yy_buffer_stack_max = 0; /**< capacity of stack. */ +static YY_BUFFER_STATE * yy_buffer_stack = 0; /**< Stack as an array. */ /* We provide macros for accessing buffer states in case in the * future we want to put the buffer states in a more general * "scanner state". + * + * Returns the top of the stack, or NULL. */ -#define YY_CURRENT_BUFFER yy_current_buffer +#define YY_CURRENT_BUFFER ( (yy_buffer_stack) \ + ? (yy_buffer_stack)[(yy_buffer_stack_top)] \ + : NULL) +/* Same as previous macro, but useful when we know that the buffer stack is not + * NULL or when we need an lvalue. For internal use only. + */ +#define YY_CURRENT_BUFFER_LVALUE (yy_buffer_stack)[(yy_buffer_stack_top)] /* yy_hold_char holds the character lost when yytext is formed. */ static char yy_hold_char; - static int yy_n_chars; /* number of characters read into yy_ch_buf */ - - int yyleng; /* Points to current character in buffer. */ static char *yy_c_buf_p = (char *) 0; -static int yy_init = 1; /* whether we need to initialize */ +static int yy_init = 0; /* whether we need to initialize */ static int yy_start = 0; /* start state number */ /* Flag which is used to allow yywrap()'s to do buffer switches @@ -225,69 +287,90 @@ static int yy_start = 0; /* start state number */ */ static int yy_did_buffer_switch_on_eof; -void yyrestart YY_PROTO(( FILE *input_file )); +void yyrestart (FILE *input_file ); +void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ); +YY_BUFFER_STATE yy_create_buffer (FILE *file,int size ); +void yy_delete_buffer (YY_BUFFER_STATE b ); +void yy_flush_buffer (YY_BUFFER_STATE b ); +void yypush_buffer_state (YY_BUFFER_STATE new_buffer ); +void yypop_buffer_state (void ); + +static void yyensure_buffer_stack (void ); +static void yy_load_buffer_state (void ); +static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ); -void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer )); -void yy_load_buffer_state YY_PROTO(( void )); -YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size )); -void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b )); -void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file )); -void yy_flush_buffer YY_PROTO(( YY_BUFFER_STATE b )); -#define YY_FLUSH_BUFFER yy_flush_buffer( yy_current_buffer ) +#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER ) -YY_BUFFER_STATE yy_scan_buffer YY_PROTO(( char *base, yy_size_t size )); -YY_BUFFER_STATE yy_scan_string YY_PROTO(( yyconst char *yy_str )); -YY_BUFFER_STATE yy_scan_bytes YY_PROTO(( yyconst char *bytes, int len )); +YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ); +YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ); +YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len ); -static void *yy_flex_alloc YY_PROTO(( yy_size_t )); -static void *yy_flex_realloc YY_PROTO(( void *, yy_size_t )); -static void yy_flex_free YY_PROTO(( void * )); +void *yyalloc (yy_size_t ); +void *yyrealloc (void *,yy_size_t ); +void yyfree (void * ); #define yy_new_buffer yy_create_buffer #define yy_set_interactive(is_interactive) \ { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ - yy_current_buffer->yy_is_interactive = is_interactive; \ + if ( ! YY_CURRENT_BUFFER ){ \ + yyensure_buffer_stack (); \ + YY_CURRENT_BUFFER_LVALUE = \ + yy_create_buffer(yyin,YY_BUF_SIZE ); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \ } #define yy_set_bol(at_bol) \ { \ - if ( ! yy_current_buffer ) \ - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); \ - yy_current_buffer->yy_at_bol = at_bol; \ + if ( ! YY_CURRENT_BUFFER ){\ + yyensure_buffer_stack (); \ + YY_CURRENT_BUFFER_LVALUE = \ + yy_create_buffer(yyin,YY_BUF_SIZE ); \ + } \ + YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \ } -#define YY_AT_BOL() (yy_current_buffer->yy_at_bol) - +#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol) -#define yywrap() 1 +#define yywrap(n) 1 #define YY_SKIP_YYWRAP + typedef unsigned char YY_CHAR; + FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0; + typedef int yy_state_type; + +extern int yylineno; extern char *yytext; #define yytext_ptr yytext -static yy_state_type yy_get_previous_state YY_PROTO(( void )); -static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state )); -static int yy_get_next_buffer YY_PROTO(( void )); -static void yy_fatal_error YY_PROTO(( yyconst char msg[] )); +static yy_state_type yy_get_previous_state (void ); +static yy_state_type yy_try_NUL_trans (yy_state_type current_state ); +static int yy_get_next_buffer (void ); +static void yy_fatal_error (yyconst char msg[] ); /* Done after the current pattern has been matched and before the * corresponding action - sets up yytext. */ #define YY_DO_BEFORE_ACTION \ - yytext_ptr = yy_bp; \ - yyleng = (int) (yy_cp - yy_bp); \ - yy_hold_char = *yy_cp; \ + (yytext_ptr) = yy_bp; \ + yyleng = (size_t) (yy_cp - yy_bp); \ + (yy_hold_char) = *yy_cp; \ *yy_cp = '\0'; \ - yy_c_buf_p = yy_cp; + (yy_c_buf_p) = yy_cp; #define YY_NUM_RULES 40 #define YY_END_OF_BUFFER 41 -static yyconst short int yy_accept[335] = +/* This struct is not used in this scanner, + but its presence is necessary. */ +struct yy_trans_info + { + flex_int32_t yy_verify; + flex_int32_t yy_nxt; + }; +static yyconst flex_int16_t yy_accept[335] = { 0, 0, 0, 41, 40, 37, 39, 40, 38, 40, 40, 31, 35, 35, 35, 35, 35, 35, 35, 35, 35, @@ -328,7 +411,7 @@ static yyconst short int yy_accept[335] = 0, 2, 18, 0 } ; -static yyconst int yy_ec[256] = +static yyconst flex_int32_t yy_ec[256] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -360,7 +443,7 @@ static yyconst int yy_ec[256] = 1, 1, 1, 1, 1 } ; -static yyconst int yy_meta[39] = +static yyconst flex_int32_t yy_meta[39] = { 0, 1, 1, 2, 1, 1, 1, 1, 1, 1, 3, 3, 1, 3, 3, 3, 3, 3, 3, 3, 3, @@ -368,7 +451,7 @@ static yyconst int yy_meta[39] = 3, 3, 3, 3, 3, 3, 3, 3 } ; -static yyconst short int yy_base[340] = +static yyconst flex_int16_t yy_base[340] = { 0, 0, 0, 374, 375, 371, 375, 368, 343, 364, 29, 32, 336, 341, 18, 26, 21, 32, 343, 0, 340, @@ -409,7 +492,7 @@ static yyconst short int yy_base[340] = 81, 375, 375, 375, 94, 97, 100, 89, 103 } ; -static yyconst short int yy_def[340] = +static yyconst flex_int16_t yy_def[340] = { 0, 334, 1, 334, 334, 334, 334, 335, 336, 337, 334, 334, 338, 338, 338, 338, 338, 338, 338, 338, 338, @@ -450,7 +533,7 @@ static yyconst short int yy_def[340] = 334, 334, 334, 0, 334, 334, 334, 334, 334 } ; -static yyconst short int yy_nxt[414] = +static yyconst flex_int16_t yy_nxt[414] = { 0, 4, 5, 6, 7, 8, 9, 10, 10, 4, 11, 11, 4, 4, 12, 13, 14, 15, 16, 17, 18, @@ -500,7 +583,7 @@ static yyconst short int yy_nxt[414] = 334, 334, 334 } ; -static yyconst short int yy_chk[414] = +static yyconst flex_int16_t yy_chk[414] = { 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -553,6 +636,9 @@ static yyconst short int yy_chk[414] = static yy_state_type yy_last_accepting_state; static char *yy_last_accepting_cpos; +extern int yy_flex_debug; +int yy_flex_debug = 0; + /* The intent behind this definition is that it'll catch * any uses of REJECT which flex missed. */ @@ -562,7 +648,6 @@ static char *yy_last_accepting_cpos; #define YY_RESTORE_YY_MORE_OFFSET char *yytext; #line 1 "printrcl.l" -#define INITIAL 0 /* -*-Mode: C-*- * "$Id: printrcl.l,v 1.1 2004/09/17 18:38:14 rleigh Exp $" * @@ -621,7 +706,23 @@ q_strdup(const char *s) return g_strndup(s + 1, strlen(s) - 2); } -#line 625 "printrcl.c" +#line 710 "printrcl.c" + +#define INITIAL 0 + +#ifndef YY_NO_UNISTD_H +/* Special case for "unistd.h", since it is non-ANSI. We include it way + * down here because we want the user's section 1 to have been scanned first. + * The user has a chance to override it with an option. + */ +#include +#endif + +#ifndef YY_EXTRA_TYPE +#define YY_EXTRA_TYPE void * +#endif + +static int yy_init_globals (void ); /* Macros after this point can all be overridden by user definitions in * section 1. @@ -629,65 +730,30 @@ q_strdup(const char *s) #ifndef YY_SKIP_YYWRAP #ifdef __cplusplus -extern "C" int yywrap YY_PROTO(( void )); +extern "C" int yywrap (void ); #else -extern int yywrap YY_PROTO(( void )); -#endif +extern int yywrap (void ); #endif - -#ifndef YY_NO_UNPUT -static void yyunput YY_PROTO(( int c, char *buf_ptr )); #endif + static void yyunput (int c,char *buf_ptr ); + #ifndef yytext_ptr -static void yy_flex_strncpy YY_PROTO(( char *, yyconst char *, int )); +static void yy_flex_strncpy (char *,yyconst char *,int ); #endif #ifdef YY_NEED_STRLEN -static int yy_flex_strlen YY_PROTO(( yyconst char * )); +static int yy_flex_strlen (yyconst char * ); #endif #ifndef YY_NO_INPUT -#ifdef __cplusplus -static int yyinput YY_PROTO(( void )); -#else -static int input YY_PROTO(( void )); -#endif -#endif - -#if YY_STACK_USED -static int yy_start_stack_ptr = 0; -static int yy_start_stack_depth = 0; -static int *yy_start_stack = 0; -#ifndef YY_NO_PUSH_STATE -static void yy_push_state YY_PROTO(( int new_state )); -#endif -#ifndef YY_NO_POP_STATE -static void yy_pop_state YY_PROTO(( void )); -#endif -#ifndef YY_NO_TOP_STATE -static int yy_top_state YY_PROTO(( void )); -#endif +#ifdef __cplusplus +static int yyinput (void ); #else -#define YY_NO_PUSH_STATE 1 -#define YY_NO_POP_STATE 1 -#define YY_NO_TOP_STATE 1 +static int input (void ); #endif -#ifdef YY_MALLOC_DECL -YY_MALLOC_DECL -#else -#if __STDC__ -#ifndef __cplusplus -#include -#endif -#else -/* Just try to get by without declaring the routines. This will fail - * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int) - * or sizeof(void*) != sizeof(int). - */ -#endif #endif /* Amount of stuff to slurp up with each read. */ @@ -696,7 +762,6 @@ YY_MALLOC_DECL #endif /* Copy whatever the last rule matched to the standard output. */ - #ifndef ECHO /* This used to be an fputs(), but since the string might contain NUL's, * we now use fwrite(). @@ -709,9 +774,10 @@ YY_MALLOC_DECL */ #ifndef YY_INPUT #define YY_INPUT(buf,result,max_size) \ - if ( yy_current_buffer->yy_is_interactive ) \ + if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \ { \ - int c = '*', n; \ + int c = '*'; \ + size_t n; \ for ( n = 0; n < max_size && \ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \ buf[n] = (char) c; \ @@ -721,9 +787,22 @@ YY_MALLOC_DECL YY_FATAL_ERROR( "input in flex scanner failed" ); \ result = n; \ } \ - else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \ - && ferror( yyin ) ) \ - YY_FATAL_ERROR( "input in flex scanner failed" ); + else \ + { \ + errno=0; \ + while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \ + { \ + if( errno != EINTR) \ + { \ + YY_FATAL_ERROR( "input in flex scanner failed" ); \ + break; \ + } \ + errno=0; \ + clearerr(yyin); \ + } \ + }\ +\ + #endif /* No semi-colon after return; correct usage is to write "yyterminate();" - @@ -744,12 +823,18 @@ YY_MALLOC_DECL #define YY_FATAL_ERROR(msg) yy_fatal_error( msg ) #endif +/* end tables serialization structures and prototypes */ + /* Default declaration of generated scanner - a define so the user can * easily add parameters. */ #ifndef YY_DECL -#define YY_DECL int yylex YY_PROTO(( void )) -#endif +#define YY_DECL_IS_OURS 1 + +extern int yylex (void); + +#define YY_DECL int yylex (void) +#endif /* !YY_DECL */ /* Code executed at the beginning of each rule, after yytext and yyleng * have been set up. @@ -766,27 +851,29 @@ YY_MALLOC_DECL #define YY_RULE_SETUP \ YY_USER_ACTION +/** The main scanner function which does all the work. + */ YY_DECL - { +{ register yy_state_type yy_current_state; register char *yy_cp, *yy_bp; register int yy_act; - + #line 73 "printrcl.l" -#line 779 "printrcl.c" +#line 866 "printrcl.c" - if ( yy_init ) + if ( !(yy_init) ) { - yy_init = 0; + (yy_init) = 1; #ifdef YY_USER_INIT YY_USER_INIT; #endif - if ( ! yy_start ) - yy_start = 1; /* first start state */ + if ( ! (yy_start) ) + (yy_start) = 1; /* first start state */ if ( ! yyin ) yyin = stdin; @@ -794,34 +881,36 @@ YY_DECL if ( ! yyout ) yyout = stdout; - if ( ! yy_current_buffer ) - yy_current_buffer = - yy_create_buffer( yyin, YY_BUF_SIZE ); + if ( ! YY_CURRENT_BUFFER ) { + yyensure_buffer_stack (); + YY_CURRENT_BUFFER_LVALUE = + yy_create_buffer(yyin,YY_BUF_SIZE ); + } - yy_load_buffer_state(); + yy_load_buffer_state( ); } while ( 1 ) /* loops until end-of-file is reached */ { - yy_cp = yy_c_buf_p; + yy_cp = (yy_c_buf_p); /* Support of yytext. */ - *yy_cp = yy_hold_char; + *yy_cp = (yy_hold_char); /* yy_bp points to the position in yy_ch_buf of the start of * the current run. */ yy_bp = yy_cp; - yy_current_state = yy_start; + yy_current_state = (yy_start); yy_match: do { register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)]; if ( yy_accept[yy_current_state] ) { - yy_last_accepting_state = yy_current_state; - yy_last_accepting_cpos = yy_cp; + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { @@ -838,24 +927,22 @@ yy_find_action: yy_act = yy_accept[yy_current_state]; if ( yy_act == 0 ) { /* have to back up */ - yy_cp = yy_last_accepting_cpos; - yy_current_state = yy_last_accepting_state; + yy_cp = (yy_last_accepting_cpos); + yy_current_state = (yy_last_accepting_state); yy_act = yy_accept[yy_current_state]; } YY_DO_BEFORE_ACTION; - do_action: /* This label is used only to access EOF actions. */ - switch ( yy_act ) { /* beginning of action switch */ case 0: /* must back up */ /* undo the effects of YY_DO_BEFORE_ACTION */ - *yy_cp = yy_hold_char; - yy_cp = yy_last_accepting_cpos; - yy_current_state = yy_last_accepting_state; + *yy_cp = (yy_hold_char); + yy_cp = (yy_last_accepting_cpos); + yy_current_state = (yy_last_accepting_state); goto yy_find_action; case 1: @@ -1019,6 +1106,7 @@ YY_RULE_SETUP yylval.dval = strtod(yytext, NULL); DBG(tDOUBLE); return tDOUBLE; YY_BREAK case 33: +/* rule 33 can match eol */ YY_RULE_SETUP #line 109 "printrcl.l" yylval.sval = q_strdup(yytext); DBG(tSTRING); return tSTRING; @@ -1034,6 +1122,7 @@ YY_RULE_SETUP yylval.sval = g_strdup(yytext); DBG(tWORD); return tWORD; YY_BREAK case 36: +/* rule 36 can match eol */ YY_RULE_SETUP #line 112 "printrcl.l" DBG(PRINTRC_HDR); return PRINTRC_HDR; @@ -1049,6 +1138,7 @@ YY_RULE_SETUP DBG(comment1); /* Skip comments */ YY_BREAK case 39: +/* rule 39 can match eol */ YY_RULE_SETUP #line 115 "printrcl.l" DBG(newline); mylineno++; @@ -1058,33 +1148,33 @@ YY_RULE_SETUP #line 116 "printrcl.l" ECHO; YY_BREAK -#line 1062 "printrcl.c" +#line 1152 "printrcl.c" case YY_STATE_EOF(INITIAL): yyterminate(); case YY_END_OF_BUFFER: { /* Amount of text matched not including the EOB char. */ - int yy_amount_of_matched_text = (int) (yy_cp - yytext_ptr) - 1; + int yy_amount_of_matched_text = (int) (yy_cp - (yytext_ptr)) - 1; /* Undo the effects of YY_DO_BEFORE_ACTION. */ - *yy_cp = yy_hold_char; + *yy_cp = (yy_hold_char); YY_RESTORE_YY_MORE_OFFSET - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW ) + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW ) { /* We're scanning a new file or input source. It's * possible that this happened because the user * just pointed yyin at a new source and called * yylex(). If so, then we have to assure - * consistency between yy_current_buffer and our + * consistency between YY_CURRENT_BUFFER and our * globals. Here is the right place to do so, because * this is the first action (other than possibly a * back-up) that will match for the new input source. */ - yy_n_chars = yy_current_buffer->yy_n_chars; - yy_current_buffer->yy_input_file = yyin; - yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL; + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin; + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL; } /* Note that here we test for yy_c_buf_p "<=" to the position @@ -1094,13 +1184,13 @@ case YY_STATE_EOF(INITIAL): * end-of-buffer state). Contrast this with the test * in input(). */ - if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] ) + if ( (yy_c_buf_p) <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) { /* This was really a NUL. */ yy_state_type yy_next_state; - yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text; + (yy_c_buf_p) = (yytext_ptr) + yy_amount_of_matched_text; - yy_current_state = yy_get_previous_state(); + yy_current_state = yy_get_previous_state( ); /* Okay, we're now positioned to make the NUL * transition. We couldn't have @@ -1113,30 +1203,30 @@ case YY_STATE_EOF(INITIAL): yy_next_state = yy_try_NUL_trans( yy_current_state ); - yy_bp = yytext_ptr + YY_MORE_ADJ; + yy_bp = (yytext_ptr) + YY_MORE_ADJ; if ( yy_next_state ) { /* Consume the NUL. */ - yy_cp = ++yy_c_buf_p; + yy_cp = ++(yy_c_buf_p); yy_current_state = yy_next_state; goto yy_match; } else { - yy_cp = yy_c_buf_p; + yy_cp = (yy_c_buf_p); goto yy_find_action; } } - else switch ( yy_get_next_buffer() ) + else switch ( yy_get_next_buffer( ) ) { case EOB_ACT_END_OF_FILE: { - yy_did_buffer_switch_on_eof = 0; + (yy_did_buffer_switch_on_eof) = 0; - if ( yywrap() ) + if ( yywrap( ) ) { /* Note: because we've taken care in * yy_get_next_buffer() to have set up @@ -1147,7 +1237,7 @@ case YY_STATE_EOF(INITIAL): * YY_NULL, it'll still work - another * YY_NULL will get returned. */ - yy_c_buf_p = yytext_ptr + YY_MORE_ADJ; + (yy_c_buf_p) = (yytext_ptr) + YY_MORE_ADJ; yy_act = YY_STATE_EOF(YY_START); goto do_action; @@ -1155,30 +1245,30 @@ case YY_STATE_EOF(INITIAL): else { - if ( ! yy_did_buffer_switch_on_eof ) + if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; } break; } case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = - yytext_ptr + yy_amount_of_matched_text; + (yy_c_buf_p) = + (yytext_ptr) + yy_amount_of_matched_text; - yy_current_state = yy_get_previous_state(); + yy_current_state = yy_get_previous_state( ); - yy_cp = yy_c_buf_p; - yy_bp = yytext_ptr + YY_MORE_ADJ; + yy_cp = (yy_c_buf_p); + yy_bp = (yytext_ptr) + YY_MORE_ADJ; goto yy_match; case EOB_ACT_LAST_MATCH: - yy_c_buf_p = - &yy_current_buffer->yy_ch_buf[yy_n_chars]; + (yy_c_buf_p) = + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)]; - yy_current_state = yy_get_previous_state(); + yy_current_state = yy_get_previous_state( ); - yy_cp = yy_c_buf_p; - yy_bp = yytext_ptr + YY_MORE_ADJ; + yy_cp = (yy_c_buf_p); + yy_bp = (yytext_ptr) + YY_MORE_ADJ; goto yy_find_action; } break; @@ -1189,8 +1279,7 @@ case YY_STATE_EOF(INITIAL): "fatal flex scanner internal error--no action found" ); } /* end of action switch */ } /* end of scanning one token */ - } /* end of yylex */ - +} /* end of yylex */ /* yy_get_next_buffer - try to read in a new buffer * @@ -1199,21 +1288,20 @@ case YY_STATE_EOF(INITIAL): * EOB_ACT_CONTINUE_SCAN - continue scanning from current position * EOB_ACT_END_OF_FILE - end of file */ - -static int yy_get_next_buffer() - { - register char *dest = yy_current_buffer->yy_ch_buf; - register char *source = yytext_ptr; +static int yy_get_next_buffer (void) +{ + register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf; + register char *source = (yytext_ptr); register int number_to_move, i; int ret_val; - if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] ) + if ( (yy_c_buf_p) > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] ) YY_FATAL_ERROR( "fatal flex scanner internal error--end of buffer missed" ); - if ( yy_current_buffer->yy_fill_buffer == 0 ) + if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 ) { /* Don't try to fill the buffer, so this is an EOF. */ - if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 ) + if ( (yy_c_buf_p) - (yytext_ptr) - YY_MORE_ADJ == 1 ) { /* We matched a single character, the EOB, so * treat this as a final EOF. @@ -1233,34 +1321,30 @@ static int yy_get_next_buffer() /* Try to read more data. */ /* First move last chars to start of buffer. */ - number_to_move = (int) (yy_c_buf_p - yytext_ptr) - 1; + number_to_move = (int) ((yy_c_buf_p) - (yytext_ptr)) - 1; for ( i = 0; i < number_to_move; ++i ) *(dest++) = *(source++); - if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING ) + if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING ) /* don't do the read, it's not guaranteed to return an EOF, * just force an EOF */ - yy_current_buffer->yy_n_chars = yy_n_chars = 0; + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars) = 0; else { - int num_to_read = - yy_current_buffer->yy_buf_size - number_to_move - 1; + int num_to_read = + YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; while ( num_to_read <= 0 ) { /* Not enough room in the buffer - grow it. */ -#ifdef YY_USES_REJECT - YY_FATAL_ERROR( -"input buffer overflow, can't enlarge buffer because scanner uses REJECT" ); -#else /* just a shorter name for the current buffer */ - YY_BUFFER_STATE b = yy_current_buffer; + YY_BUFFER_STATE b = YY_CURRENT_BUFFER; int yy_c_buf_p_offset = - (int) (yy_c_buf_p - b->yy_ch_buf); + (int) ((yy_c_buf_p) - b->yy_ch_buf); if ( b->yy_is_our_buffer ) { @@ -1273,8 +1357,7 @@ static int yy_get_next_buffer() b->yy_ch_buf = (char *) /* Include room in for 2 EOB chars. */ - yy_flex_realloc( (void *) b->yy_ch_buf, - b->yy_buf_size + 2 ); + yyrealloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ); } else /* Can't grow it, we don't own it. */ @@ -1284,35 +1367,35 @@ static int yy_get_next_buffer() YY_FATAL_ERROR( "fatal error - scanner input buffer overflow" ); - yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset]; + (yy_c_buf_p) = &b->yy_ch_buf[yy_c_buf_p_offset]; - num_to_read = yy_current_buffer->yy_buf_size - + num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1; -#endif + } if ( num_to_read > YY_READ_BUF_SIZE ) num_to_read = YY_READ_BUF_SIZE; /* Read in more data. */ - YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]), - yy_n_chars, num_to_read ); + YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]), + (yy_n_chars), num_to_read ); - yy_current_buffer->yy_n_chars = yy_n_chars; + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } - if ( yy_n_chars == 0 ) + if ( (yy_n_chars) == 0 ) { if ( number_to_move == YY_MORE_ADJ ) { ret_val = EOB_ACT_END_OF_FILE; - yyrestart( yyin ); + yyrestart(yyin ); } else { ret_val = EOB_ACT_LAST_MATCH; - yy_current_buffer->yy_buffer_status = + YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_EOF_PENDING; } } @@ -1320,32 +1403,31 @@ static int yy_get_next_buffer() else ret_val = EOB_ACT_CONTINUE_SCAN; - yy_n_chars += number_to_move; - yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR; - yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR; + (yy_n_chars) += number_to_move; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] = YY_END_OF_BUFFER_CHAR; + YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars) + 1] = YY_END_OF_BUFFER_CHAR; - yytext_ptr = &yy_current_buffer->yy_ch_buf[0]; + (yytext_ptr) = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0]; return ret_val; - } - +} /* yy_get_previous_state - get the state just before the EOB char was reached */ -static yy_state_type yy_get_previous_state() - { + static yy_state_type yy_get_previous_state (void) +{ register yy_state_type yy_current_state; register char *yy_cp; + + yy_current_state = (yy_start); - yy_current_state = yy_start; - - for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp ) + for ( yy_cp = (yytext_ptr) + YY_MORE_ADJ; yy_cp < (yy_c_buf_p); ++yy_cp ) { register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1); if ( yy_accept[yy_current_state] ) { - yy_last_accepting_state = yy_current_state; - yy_last_accepting_cpos = yy_cp; + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { @@ -1357,30 +1439,23 @@ static yy_state_type yy_get_previous_state() } return yy_current_state; - } - +} /* yy_try_NUL_trans - try to make a transition on the NUL character * * synopsis * next_state = yy_try_NUL_trans( current_state ); */ - -#ifdef YY_USE_PROTOS -static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state ) -#else -static yy_state_type yy_try_NUL_trans( yy_current_state ) -yy_state_type yy_current_state; -#endif - { + static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state ) +{ register int yy_is_jam; - register char *yy_cp = yy_c_buf_p; + register char *yy_cp = (yy_c_buf_p); register YY_CHAR yy_c = 1; if ( yy_accept[yy_current_state] ) { - yy_last_accepting_state = yy_current_state; - yy_last_accepting_cpos = yy_cp; + (yy_last_accepting_state) = yy_current_state; + (yy_last_accepting_cpos) = yy_cp; } while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state ) { @@ -1392,80 +1467,73 @@ yy_state_type yy_current_state; yy_is_jam = (yy_current_state == 334); return yy_is_jam ? 0 : yy_current_state; - } - +} -#ifndef YY_NO_UNPUT -#ifdef YY_USE_PROTOS -static void yyunput( int c, register char *yy_bp ) -#else -static void yyunput( c, yy_bp ) -int c; -register char *yy_bp; -#endif - { - register char *yy_cp = yy_c_buf_p; + static void yyunput (int c, register char * yy_bp ) +{ + register char *yy_cp; + + yy_cp = (yy_c_buf_p); /* undo effects of setting up yytext */ - *yy_cp = yy_hold_char; + *yy_cp = (yy_hold_char); - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) + if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) { /* need to shift things up to make room */ /* +2 for EOB chars. */ - register int number_to_move = yy_n_chars + 2; - register char *dest = &yy_current_buffer->yy_ch_buf[ - yy_current_buffer->yy_buf_size + 2]; + register int number_to_move = (yy_n_chars) + 2; + register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[ + YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2]; register char *source = - &yy_current_buffer->yy_ch_buf[number_to_move]; + &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]; - while ( source > yy_current_buffer->yy_ch_buf ) + while ( source > YY_CURRENT_BUFFER_LVALUE->yy_ch_buf ) *--dest = *--source; yy_cp += (int) (dest - source); yy_bp += (int) (dest - source); - yy_current_buffer->yy_n_chars = - yy_n_chars = yy_current_buffer->yy_buf_size; + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_buf_size; - if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 ) + if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 ) YY_FATAL_ERROR( "flex scanner push-back overflow" ); } *--yy_cp = (char) c; + (yytext_ptr) = yy_bp; + (yy_hold_char) = *yy_cp; + (yy_c_buf_p) = yy_cp; +} - yytext_ptr = yy_bp; - yy_hold_char = *yy_cp; - yy_c_buf_p = yy_cp; - } -#endif /* ifndef YY_NO_UNPUT */ - - +#ifndef YY_NO_INPUT #ifdef __cplusplus -static int yyinput() + static int yyinput (void) #else -static int input() + static int input (void) #endif - { - int c; - *yy_c_buf_p = yy_hold_char; +{ + int c; + + *(yy_c_buf_p) = (yy_hold_char); - if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR ) + if ( *(yy_c_buf_p) == YY_END_OF_BUFFER_CHAR ) { /* yy_c_buf_p now points to the character we want to return. * If this occurs *before* the EOB characters, then it's a * valid NUL; if not, then we've hit the end of the buffer. */ - if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] ) + if ( (yy_c_buf_p) < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[(yy_n_chars)] ) /* This was really a NUL. */ - *yy_c_buf_p = '\0'; + *(yy_c_buf_p) = '\0'; else { /* need more input */ - int offset = yy_c_buf_p - yytext_ptr; - ++yy_c_buf_p; + int offset = (yy_c_buf_p) - (yytext_ptr); + ++(yy_c_buf_p); - switch ( yy_get_next_buffer() ) + switch ( yy_get_next_buffer( ) ) { case EOB_ACT_LAST_MATCH: /* This happens because yy_g_n_b() @@ -1479,16 +1547,16 @@ static int input() */ /* Reset buffer status. */ - yyrestart( yyin ); + yyrestart(yyin ); - /* fall through */ + /*FALLTHROUGH*/ case EOB_ACT_END_OF_FILE: { - if ( yywrap() ) + if ( yywrap( ) ) return EOF; - if ( ! yy_did_buffer_switch_on_eof ) + if ( ! (yy_did_buffer_switch_on_eof) ) YY_NEW_FILE; #ifdef __cplusplus return yyinput(); @@ -1498,90 +1566,92 @@ static int input() } case EOB_ACT_CONTINUE_SCAN: - yy_c_buf_p = yytext_ptr + offset; + (yy_c_buf_p) = (yytext_ptr) + offset; break; } } } - c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */ - *yy_c_buf_p = '\0'; /* preserve yytext */ - yy_hold_char = *++yy_c_buf_p; - + c = *(unsigned char *) (yy_c_buf_p); /* cast for 8-bit char's */ + *(yy_c_buf_p) = '\0'; /* preserve yytext */ + (yy_hold_char) = *++(yy_c_buf_p); return c; - } - - -#ifdef YY_USE_PROTOS -void yyrestart( FILE *input_file ) -#else -void yyrestart( input_file ) -FILE *input_file; -#endif - { - if ( ! yy_current_buffer ) - yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE ); +} +#endif /* ifndef YY_NO_INPUT */ - yy_init_buffer( yy_current_buffer, input_file ); - yy_load_buffer_state(); +/** Immediately switch to a different input stream. + * @param input_file A readable stream. + * + * @note This function does not reset the start condition to @c INITIAL . + */ + void yyrestart (FILE * input_file ) +{ + + if ( ! YY_CURRENT_BUFFER ){ + yyensure_buffer_stack (); + YY_CURRENT_BUFFER_LVALUE = + yy_create_buffer(yyin,YY_BUF_SIZE ); } + yy_init_buffer(YY_CURRENT_BUFFER,input_file ); + yy_load_buffer_state( ); +} -#ifdef YY_USE_PROTOS -void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer ) -#else -void yy_switch_to_buffer( new_buffer ) -YY_BUFFER_STATE new_buffer; -#endif - { - if ( yy_current_buffer == new_buffer ) +/** Switch to a different input buffer. + * @param new_buffer The new input buffer. + * + */ + void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ) +{ + + /* TODO. We should be able to replace this entire function body + * with + * yypop_buffer_state(); + * yypush_buffer_state(new_buffer); + */ + yyensure_buffer_stack (); + if ( YY_CURRENT_BUFFER == new_buffer ) return; - if ( yy_current_buffer ) + if ( YY_CURRENT_BUFFER ) { /* Flush out information for old buffer. */ - *yy_c_buf_p = yy_hold_char; - yy_current_buffer->yy_buf_pos = yy_c_buf_p; - yy_current_buffer->yy_n_chars = yy_n_chars; + *(yy_c_buf_p) = (yy_hold_char); + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); } - yy_current_buffer = new_buffer; - yy_load_buffer_state(); + YY_CURRENT_BUFFER_LVALUE = new_buffer; + yy_load_buffer_state( ); /* We don't actually know whether we did this switch during * EOF (yywrap()) processing, but the only time this flag * is looked at is after yywrap() is called, so it's safe * to go ahead and always set it. */ - yy_did_buffer_switch_on_eof = 1; - } - - -#ifdef YY_USE_PROTOS -void yy_load_buffer_state( void ) -#else -void yy_load_buffer_state() -#endif - { - yy_n_chars = yy_current_buffer->yy_n_chars; - yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos; - yyin = yy_current_buffer->yy_input_file; - yy_hold_char = *yy_c_buf_p; - } + (yy_did_buffer_switch_on_eof) = 1; +} +static void yy_load_buffer_state (void) +{ + (yy_n_chars) = YY_CURRENT_BUFFER_LVALUE->yy_n_chars; + (yytext_ptr) = (yy_c_buf_p) = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos; + yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file; + (yy_hold_char) = *(yy_c_buf_p); +} -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_create_buffer( FILE *file, int size ) -#else -YY_BUFFER_STATE yy_create_buffer( file, size ) -FILE *file; -int size; -#endif - { +/** Allocate and initialize an input buffer state. + * @param file A readable stream. + * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE. + * + * @return the allocated buffer state. + */ + YY_BUFFER_STATE yy_create_buffer (FILE * file, int size ) +{ YY_BUFFER_STATE b; - - b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); + + b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); @@ -1590,80 +1660,75 @@ int size; /* yy_ch_buf has to be 2 characters longer than the size given because * we need to put in 2 end-of-buffer characters. */ - b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 ); + b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 ); if ( ! b->yy_ch_buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" ); b->yy_is_our_buffer = 1; - yy_init_buffer( b, file ); + yy_init_buffer(b,file ); return b; - } - +} -#ifdef YY_USE_PROTOS -void yy_delete_buffer( YY_BUFFER_STATE b ) -#else -void yy_delete_buffer( b ) -YY_BUFFER_STATE b; -#endif - { +/** Destroy the buffer. + * @param b a buffer created with yy_create_buffer() + * + */ + void yy_delete_buffer (YY_BUFFER_STATE b ) +{ + if ( ! b ) return; - if ( b == yy_current_buffer ) - yy_current_buffer = (YY_BUFFER_STATE) 0; + if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */ + YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0; if ( b->yy_is_our_buffer ) - yy_flex_free( (void *) b->yy_ch_buf ); - - yy_flex_free( (void *) b ); - } + yyfree((void *) b->yy_ch_buf ); + yyfree((void *) b ); +} -#ifndef YY_ALWAYS_INTERACTIVE -#ifndef YY_NEVER_INTERACTIVE -extern int isatty YY_PROTO(( int )); -#endif -#endif - -#ifdef YY_USE_PROTOS -void yy_init_buffer( YY_BUFFER_STATE b, FILE *file ) -#else -void yy_init_buffer( b, file ) -YY_BUFFER_STATE b; -FILE *file; -#endif - +#ifndef __cplusplus +extern int isatty (int ); +#endif /* __cplusplus */ + +/* Initializes or reinitializes a buffer. + * This function is sometimes called more than once on the same buffer, + * such as during a yyrestart() or at EOF. + */ + static void yy_init_buffer (YY_BUFFER_STATE b, FILE * file ) - { - yy_flush_buffer( b ); +{ + int oerrno = errno; + + yy_flush_buffer(b ); b->yy_input_file = file; b->yy_fill_buffer = 1; -#if YY_ALWAYS_INTERACTIVE - b->yy_is_interactive = 1; -#else -#if YY_NEVER_INTERACTIVE - b->yy_is_interactive = 0; -#else - b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; -#endif -#endif - } - - -#ifdef YY_USE_PROTOS -void yy_flush_buffer( YY_BUFFER_STATE b ) -#else -void yy_flush_buffer( b ) -YY_BUFFER_STATE b; -#endif + /* If b is the current buffer, then yy_init_buffer was _probably_ + * called from yyrestart() or through yy_get_next_buffer. + * In that case, we don't want to reset the lineno or column. + */ + if (b != YY_CURRENT_BUFFER){ + b->yy_bs_lineno = 1; + b->yy_bs_column = 0; + } + + b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; + + errno = oerrno; +} - { - if ( ! b ) +/** Discard all buffered characters. On the next scan, YY_INPUT will be called. + * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER. + * + */ + void yy_flush_buffer (YY_BUFFER_STATE b ) +{ + if ( ! b ) return; b->yy_n_chars = 0; @@ -1680,29 +1745,121 @@ YY_BUFFER_STATE b; b->yy_at_bol = 1; b->yy_buffer_status = YY_BUFFER_NEW; - if ( b == yy_current_buffer ) - yy_load_buffer_state(); + if ( b == YY_CURRENT_BUFFER ) + yy_load_buffer_state( ); +} + +/** Pushes the new state onto the stack. The new state becomes + * the current state. This function will allocate the stack + * if necessary. + * @param new_buffer The new state. + * + */ +void yypush_buffer_state (YY_BUFFER_STATE new_buffer ) +{ + if (new_buffer == NULL) + return; + + yyensure_buffer_stack(); + + /* This block is copied from yy_switch_to_buffer. */ + if ( YY_CURRENT_BUFFER ) + { + /* Flush out information for old buffer. */ + *(yy_c_buf_p) = (yy_hold_char); + YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = (yy_c_buf_p); + YY_CURRENT_BUFFER_LVALUE->yy_n_chars = (yy_n_chars); + } + + /* Only push if top exists. Otherwise, replace top. */ + if (YY_CURRENT_BUFFER) + (yy_buffer_stack_top)++; + YY_CURRENT_BUFFER_LVALUE = new_buffer; + + /* copied from yy_switch_to_buffer. */ + yy_load_buffer_state( ); + (yy_did_buffer_switch_on_eof) = 1; +} + +/** Removes and deletes the top of the stack, if present. + * The next element becomes the new top. + * + */ +void yypop_buffer_state (void) +{ + if (!YY_CURRENT_BUFFER) + return; + + yy_delete_buffer(YY_CURRENT_BUFFER ); + YY_CURRENT_BUFFER_LVALUE = NULL; + if ((yy_buffer_stack_top) > 0) + --(yy_buffer_stack_top); + + if (YY_CURRENT_BUFFER) { + yy_load_buffer_state( ); + (yy_did_buffer_switch_on_eof) = 1; } +} +/* Allocates the stack if it does not exist. + * Guarantees space for at least one push. + */ +static void yyensure_buffer_stack (void) +{ + int num_to_alloc; + + if (!(yy_buffer_stack)) { + + /* First allocation is just for 2 elements, since we don't know if this + * scanner will even need a stack. We use 2 instead of 1 to avoid an + * immediate realloc on the next call. + */ + num_to_alloc = 1; + (yy_buffer_stack) = (struct yy_buffer_state**)yyalloc + (num_to_alloc * sizeof(struct yy_buffer_state*) + ); + + memset((yy_buffer_stack), 0, num_to_alloc * sizeof(struct yy_buffer_state*)); + + (yy_buffer_stack_max) = num_to_alloc; + (yy_buffer_stack_top) = 0; + return; + } -#ifndef YY_NO_SCAN_BUFFER -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_buffer( char *base, yy_size_t size ) -#else -YY_BUFFER_STATE yy_scan_buffer( base, size ) -char *base; -yy_size_t size; -#endif - { - YY_BUFFER_STATE b; + if ((yy_buffer_stack_top) >= ((yy_buffer_stack_max)) - 1){ + /* Increase the buffer to prepare for a possible push. */ + int grow_size = 8 /* arbitrary grow size */; + + num_to_alloc = (yy_buffer_stack_max) + grow_size; + (yy_buffer_stack) = (struct yy_buffer_state**)yyrealloc + ((yy_buffer_stack), + num_to_alloc * sizeof(struct yy_buffer_state*) + ); + + /* zero only the new slots.*/ + memset((yy_buffer_stack) + (yy_buffer_stack_max), 0, grow_size * sizeof(struct yy_buffer_state*)); + (yy_buffer_stack_max) = num_to_alloc; + } +} + +/** Setup the input buffer state to scan directly from a user-specified character buffer. + * @param base the character buffer + * @param size the size in bytes of the character buffer + * + * @return the newly allocated buffer state object. + */ +YY_BUFFER_STATE yy_scan_buffer (char * base, yy_size_t size ) +{ + YY_BUFFER_STATE b; + if ( size < 2 || base[size-2] != YY_END_OF_BUFFER_CHAR || base[size-1] != YY_END_OF_BUFFER_CHAR ) /* They forgot to leave room for the EOB's. */ return 0; - b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) ); + b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ); if ( ! b ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" ); @@ -1716,56 +1873,51 @@ yy_size_t size; b->yy_fill_buffer = 0; b->yy_buffer_status = YY_BUFFER_NEW; - yy_switch_to_buffer( b ); + yy_switch_to_buffer(b ); return b; - } -#endif - - -#ifndef YY_NO_SCAN_STRING -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_string( yyconst char *yy_str ) -#else -YY_BUFFER_STATE yy_scan_string( yy_str ) -yyconst char *yy_str; -#endif - { - int len; - for ( len = 0; yy_str[len]; ++len ) - ; - - return yy_scan_bytes( yy_str, len ); - } -#endif +} +/** Setup the input buffer state to scan a string. The next call to yylex() will + * scan from a @e copy of @a str. + * @param str a NUL-terminated string to scan + * + * @return the newly allocated buffer state object. + * @note If you want to scan bytes that may contain NUL values, then use + * yy_scan_bytes() instead. + */ +YY_BUFFER_STATE yy_scan_string (yyconst char * yystr ) +{ + + return yy_scan_bytes(yystr,strlen(yystr) ); +} -#ifndef YY_NO_SCAN_BYTES -#ifdef YY_USE_PROTOS -YY_BUFFER_STATE yy_scan_bytes( yyconst char *bytes, int len ) -#else -YY_BUFFER_STATE yy_scan_bytes( bytes, len ) -yyconst char *bytes; -int len; -#endif - { +/** Setup the input buffer state to scan the given bytes. The next call to yylex() will + * scan from a @e copy of @a bytes. + * @param bytes the byte buffer to scan + * @param len the number of bytes in the buffer pointed to by @a bytes. + * + * @return the newly allocated buffer state object. + */ +YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len ) +{ YY_BUFFER_STATE b; char *buf; yy_size_t n; int i; - + /* Get memory for full buffer, including space for trailing EOB's. */ - n = len + 2; - buf = (char *) yy_flex_alloc( n ); + n = _yybytes_len + 2; + buf = (char *) yyalloc(n ); if ( ! buf ) YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" ); - for ( i = 0; i < len; ++i ) - buf[i] = bytes[i]; + for ( i = 0; i < _yybytes_len; ++i ) + buf[i] = yybytes[i]; - buf[len] = buf[len+1] = YY_END_OF_BUFFER_CHAR; + buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR; - b = yy_scan_buffer( buf, n ); + b = yy_scan_buffer(buf,n ); if ( ! b ) YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" ); @@ -1775,148 +1927,177 @@ int len; b->yy_is_our_buffer = 1; return b; - } -#endif - +} -#ifndef YY_NO_PUSH_STATE -#ifdef YY_USE_PROTOS -static void yy_push_state( int new_state ) -#else -static void yy_push_state( new_state ) -int new_state; +#ifndef YY_EXIT_FAILURE +#define YY_EXIT_FAILURE 2 #endif - { - if ( yy_start_stack_ptr >= yy_start_stack_depth ) - { - yy_size_t new_size; - yy_start_stack_depth += YY_START_STACK_INCR; - new_size = yy_start_stack_depth * sizeof( int ); +static void yy_fatal_error (yyconst char* msg ) +{ + (void) fprintf( stderr, "%s\n", msg ); + exit( YY_EXIT_FAILURE ); +} + +/* Redefine yyless() so it works in section 3 code. */ - if ( ! yy_start_stack ) - yy_start_stack = (int *) yy_flex_alloc( new_size ); +#undef yyless +#define yyless(n) \ + do \ + { \ + /* Undo effects of setting up yytext. */ \ + int yyless_macro_arg = (n); \ + YY_LESS_LINENO(yyless_macro_arg);\ + yytext[yyleng] = (yy_hold_char); \ + (yy_c_buf_p) = yytext + yyless_macro_arg; \ + (yy_hold_char) = *(yy_c_buf_p); \ + *(yy_c_buf_p) = '\0'; \ + yyleng = yyless_macro_arg; \ + } \ + while ( 0 ) - else - yy_start_stack = (int *) yy_flex_realloc( - (void *) yy_start_stack, new_size ); +/* Accessor methods (get/set functions) to struct members. */ - if ( ! yy_start_stack ) - YY_FATAL_ERROR( - "out of memory expanding start-condition stack" ); - } +/** Get the input stream. + * + */ +FILE *yyget_in (void) +{ + return yyin; +} - yy_start_stack[yy_start_stack_ptr++] = YY_START; +/** Get the output stream. + * + */ +FILE *yyget_out (void) +{ + return yyout; +} - BEGIN(new_state); - } -#endif +/** Get the length of the current token. + * + */ +int yyget_leng (void) +{ + return yyleng; +} +/** Get the current token. + * + */ -#ifndef YY_NO_POP_STATE -static void yy_pop_state() - { - if ( --yy_start_stack_ptr < 0 ) - YY_FATAL_ERROR( "start-condition stack underflow" ); +char *yyget_text (void) +{ + return yytext; +} - BEGIN(yy_start_stack[yy_start_stack_ptr]); - } -#endif +/** Set the input stream. This does not discard the current + * input buffer. + * @param in_str A readable stream. + * + * @see yy_switch_to_buffer + */ +void yyset_in (FILE * in_str ) +{ + yyin = in_str ; +} +void yyset_out (FILE * out_str ) +{ + yyout = out_str ; +} -#ifndef YY_NO_TOP_STATE -static int yy_top_state() - { - return yy_start_stack[yy_start_stack_ptr - 1]; - } -#endif +int yyget_debug (void) +{ + return yy_flex_debug; +} -#ifndef YY_EXIT_FAILURE -#define YY_EXIT_FAILURE 2 -#endif +void yyset_debug (int bdebug ) +{ + yy_flex_debug = bdebug ; +} -#ifdef YY_USE_PROTOS -static void yy_fatal_error( yyconst char msg[] ) +static int yy_init_globals (void) +{ + /* Initialization is the same as for the non-reentrant scanner. + * This function is called from yylex_destroy(), so don't allocate here. + */ + + (yy_buffer_stack) = 0; + (yy_buffer_stack_top) = 0; + (yy_buffer_stack_max) = 0; + (yy_c_buf_p) = (char *) 0; + (yy_init) = 0; + (yy_start) = 0; + +/* Defined in main.c */ +#ifdef YY_STDINIT + yyin = stdin; + yyout = stdout; #else -static void yy_fatal_error( msg ) -char msg[]; + yyin = (FILE *) 0; + yyout = (FILE *) 0; #endif - { - (void) fprintf( stderr, "%s\n", msg ); - exit( YY_EXIT_FAILURE ); - } + /* For future reference: Set errno on error, since we are called by + * yylex_init() + */ + return 0; +} +/* yylex_destroy is for both reentrant and non-reentrant scanners. */ +int yylex_destroy (void) +{ + + /* Pop the buffer stack, destroying each element. */ + while(YY_CURRENT_BUFFER){ + yy_delete_buffer(YY_CURRENT_BUFFER ); + YY_CURRENT_BUFFER_LVALUE = NULL; + yypop_buffer_state(); + } -/* Redefine yyless() so it works in section 3 code. */ + /* Destroy the stack itself. */ + yyfree((yy_buffer_stack) ); + (yy_buffer_stack) = NULL; -#undef yyless -#define yyless(n) \ - do \ - { \ - /* Undo effects of setting up yytext. */ \ - yytext[yyleng] = yy_hold_char; \ - yy_c_buf_p = yytext + n; \ - yy_hold_char = *yy_c_buf_p; \ - *yy_c_buf_p = '\0'; \ - yyleng = n; \ - } \ - while ( 0 ) + /* Reset the globals. This is important in a non-reentrant scanner so the next time + * yylex() is called, initialization will occur. */ + yy_init_globals( ); + return 0; +} -/* Internal utility routines. */ +/* + * Internal utility routines. + */ #ifndef yytext_ptr -#ifdef YY_USE_PROTOS -static void yy_flex_strncpy( char *s1, yyconst char *s2, int n ) -#else -static void yy_flex_strncpy( s1, s2, n ) -char *s1; -yyconst char *s2; -int n; -#endif - { +static void yy_flex_strncpy (char* s1, yyconst char * s2, int n ) +{ register int i; for ( i = 0; i < n; ++i ) s1[i] = s2[i]; - } +} #endif #ifdef YY_NEED_STRLEN -#ifdef YY_USE_PROTOS -static int yy_flex_strlen( yyconst char *s ) -#else -static int yy_flex_strlen( s ) -yyconst char *s; -#endif - { +static int yy_flex_strlen (yyconst char * s ) +{ register int n; for ( n = 0; s[n]; ++n ) ; return n; - } +} #endif - -#ifdef YY_USE_PROTOS -static void *yy_flex_alloc( yy_size_t size ) -#else -static void *yy_flex_alloc( size ) -yy_size_t size; -#endif - { +void *yyalloc (yy_size_t size ) +{ return (void *) malloc( size ); - } +} -#ifdef YY_USE_PROTOS -static void *yy_flex_realloc( void *ptr, yy_size_t size ) -#else -static void *yy_flex_realloc( ptr, size ) -void *ptr; -yy_size_t size; -#endif - { +void *yyrealloc (void * ptr, yy_size_t size ) +{ /* The cast to (char *) in the following accommodates both * implementations that use char* generic pointers, and those * that use void* generic pointers. It works with the latter @@ -1925,23 +2106,13 @@ yy_size_t size; * as though doing an assignment. */ return (void *) realloc( (char *) ptr, size ); - } +} -#ifdef YY_USE_PROTOS -static void yy_flex_free( void *ptr ) -#else -static void yy_flex_free( ptr ) -void *ptr; -#endif - { - free( ptr ); - } +void yyfree (void * ptr ) +{ + free( (char *) ptr ); /* see yyrealloc() for (char *) cast */ +} + +#define YYTABLES_NAME "yytables" -#if YY_MAIN -int main() - { - yylex(); - return 0; - } -#endif #line 116 "printrcl.l" diff --git a/src/gutenprintui/printrcy.c b/src/gutenprintui/printrcy.c index 1609566..ffc38c6 100644 --- a/src/gutenprintui/printrcy.c +++ b/src/gutenprintui/printrcy.c @@ -1,7 +1,9 @@ -/* A Bison parser, made by GNU Bison 1.875. */ +/* A Bison parser, made by GNU Bison 2.3. */ -/* Skeleton parser for Yacc-like parsing with Bison, - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc. +/* Skeleton implementation for Bison's Yacc-like parsers in C + + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -15,16 +17,24 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ + Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ + +/* As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + special exception, which will cause the skeleton and the resulting + Bison output files to be licensed under the GNU General Public + License without this special exception. -/* As a special exception, when this file is copied by Bison into a - Bison output file, you may use that output file without restriction. - This special exception was added by the Free Software Foundation - in version 1.24 of Bison. */ + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. */ -/* Written by Richard Stallman by simplifying the original so called - ``semantic'' parser. */ +/* C LALR(1) parser skeleton written by Richard Stallman, by + simplifying the original so-called "semantic" parser. */ /* All symbols defined below should begin with yy or YY, to avoid infringing on user name space. This should be done even for local @@ -36,6 +46,9 @@ /* Identify Bison output. */ #define YYBISON 1 +/* Bison version. */ +#define YYBISON_VERSION "2.3" + /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -93,6 +106,7 @@ pCURVE = 295 }; #endif +/* Tokens. */ #define tINT 258 #define tDOUBLE 259 #define tDIMENSION 260 @@ -183,7 +197,12 @@ static stpui_plist_t *current_printer = NULL; # define YYERROR_VERBOSE 0 #endif -#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) +/* Enabling the token table. */ +#ifndef YYTOKEN_TABLE +# define YYTOKEN_TABLE 0 +#endif + +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef int YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 @@ -195,49 +214,171 @@ typedef int YYSTYPE; /* Copy the second part of user declarations. */ -/* Line 214 of yacc.c. */ -#line 199 "printrcy.c" +/* Line 216 of yacc.c. */ +#line 219 "printrcy.c" -#if ! defined (yyoverflow) || YYERROR_VERBOSE +#ifdef short +# undef short +#endif -/* The parser invokes alloca or malloc; define the necessary symbols. */ +#ifdef YYTYPE_UINT8 +typedef YYTYPE_UINT8 yytype_uint8; +#else +typedef unsigned char yytype_uint8; +#endif -# if YYSTACK_USE_ALLOCA -# define YYSTACK_ALLOC alloca +#ifdef YYTYPE_INT8 +typedef YYTYPE_INT8 yytype_int8; +#elif (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +typedef signed char yytype_int8; +#else +typedef short int yytype_int8; +#endif + +#ifdef YYTYPE_UINT16 +typedef YYTYPE_UINT16 yytype_uint16; +#else +typedef unsigned short int yytype_uint16; +#endif + +#ifdef YYTYPE_INT16 +typedef YYTYPE_INT16 yytype_int16; +#else +typedef short int yytype_int16; +#endif + +#ifndef YYSIZE_T +# ifdef __SIZE_TYPE__ +# define YYSIZE_T __SIZE_TYPE__ +# elif defined size_t +# define YYSIZE_T size_t +# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +# include /* INFRINGES ON USER NAME SPACE */ +# define YYSIZE_T size_t # else -# ifndef YYSTACK_USE_ALLOCA -# if defined (alloca) || defined (_ALLOCA_H) -# define YYSTACK_ALLOC alloca +# define YYSIZE_T unsigned int +# endif +#endif + +#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) + +#ifndef YY_ +# if YYENABLE_NLS +# if ENABLE_NLS +# include /* INFRINGES ON USER NAME SPACE */ +# define YY_(msgid) dgettext ("bison-runtime", msgid) +# endif +# endif +# ifndef YY_ +# define YY_(msgid) msgid +# endif +#endif + +/* Suppress unused-variable warnings by "using" E. */ +#if ! defined lint || defined __GNUC__ +# define YYUSE(e) ((void) (e)) +#else +# define YYUSE(e) /* empty */ +#endif + +/* Identity function, used to suppress warnings about constant conditions. */ +#ifndef lint +# define YYID(n) (n) +#else +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static int +YYID (int i) +#else +static int +YYID (i) + int i; +#endif +{ + return i; +} +#endif + +#if ! defined yyoverflow || YYERROR_VERBOSE + +/* The parser invokes alloca or malloc; define the necessary symbols. */ + +# ifdef YYSTACK_USE_ALLOCA +# if YYSTACK_USE_ALLOCA +# ifdef __GNUC__ +# define YYSTACK_ALLOC __builtin_alloca +# elif defined __BUILTIN_VA_ARG_INCR +# include /* INFRINGES ON USER NAME SPACE */ +# elif defined _AIX +# define YYSTACK_ALLOC __alloca +# elif defined _MSC_VER +# include /* INFRINGES ON USER NAME SPACE */ +# define alloca _alloca # else -# ifdef __GNUC__ -# define YYSTACK_ALLOC __builtin_alloca +# define YYSTACK_ALLOC alloca +# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +# include /* INFRINGES ON USER NAME SPACE */ +# ifndef _STDLIB_H +# define _STDLIB_H 1 +# endif # endif # endif # endif # endif # ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) + /* Pacify GCC's `empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) +# ifndef YYSTACK_ALLOC_MAXIMUM + /* The OS might guarantee only one guard page at the bottom of the stack, + and a page size can be as small as 4096 bytes. So we cannot safely + invoke alloca (N) if N exceeds 4096. Use a slightly smaller number + to allow for a few compiler-allocated temporary stack slots. */ +# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ +# endif # else -# if defined (__STDC__) || defined (__cplusplus) +# define YYSTACK_ALLOC YYMALLOC +# define YYSTACK_FREE YYFREE +# ifndef YYSTACK_ALLOC_MAXIMUM +# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM +# endif +# if (defined __cplusplus && ! defined _STDLIB_H \ + && ! ((defined YYMALLOC || defined malloc) \ + && (defined YYFREE || defined free))) # include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t +# ifndef _STDLIB_H +# define _STDLIB_H 1 +# endif +# endif +# ifndef YYMALLOC +# define YYMALLOC malloc +# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# ifndef YYFREE +# define YYFREE free +# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +void free (void *); /* INFRINGES ON USER NAME SPACE */ +# endif # endif -# define YYSTACK_ALLOC malloc -# define YYSTACK_FREE free # endif -#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ +#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ -#if (! defined (yyoverflow) \ - && (! defined (__cplusplus) \ - || (YYSTYPE_IS_TRIVIAL))) +#if (! defined yyoverflow \ + && (! defined __cplusplus \ + || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc { - short yyss; + yytype_int16 yyss; YYSTYPE yyvs; }; @@ -247,24 +388,24 @@ union yyalloc /* The size of an array large to enough to hold all stacks, each with N elements. */ # define YYSTACK_BYTES(N) \ - ((N) * (sizeof (short) + sizeof (YYSTYPE)) \ + ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ + YYSTACK_GAP_MAXIMUM) /* Copy COUNT objects from FROM to TO. The source and destination do not overlap. */ # ifndef YYCOPY -# if 1 < __GNUC__ +# if defined __GNUC__ && 1 < __GNUC__ # define YYCOPY(To, From, Count) \ __builtin_memcpy (To, From, (Count) * sizeof (*(From))) # else # define YYCOPY(To, From, Count) \ do \ { \ - register YYSIZE_T yyi; \ + YYSIZE_T yyi; \ for (yyi = 0; yyi < (Count); yyi++) \ (To)[yyi] = (From)[yyi]; \ } \ - while (0) + while (YYID (0)) # endif # endif @@ -282,39 +423,33 @@ union yyalloc yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ - while (0) + while (YYID (0)) #endif -#if defined (__STDC__) || defined (__cplusplus) - typedef signed char yysigned_char; -#else - typedef short yysigned_char; -#endif - -/* YYFINAL -- State number of the termination state. */ +/* YYFINAL -- State number of the termination state. */ #define YYFINAL 10 /* YYLAST -- Last index in YYTABLE. */ #define YYLAST 75 -/* YYNTOKENS -- Number of terminals. */ +/* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 41 -/* YYNNTS -- Number of nonterminals. */ +/* YYNNTS -- Number of nonterminals. */ #define YYNNTS 42 -/* YYNRULES -- Number of rules. */ +/* YYNRULES -- Number of rules. */ #define YYNRULES 70 -/* YYNRULES -- Number of states. */ +/* YYNRULES -- Number of states. */ #define YYNSTATES 114 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 #define YYMAXUTOK 295 -#define YYTRANSLATE(YYX) \ +#define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ -static const unsigned char yytranslate[] = +static const yytype_uint8 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -351,7 +486,7 @@ static const unsigned char yytranslate[] = #if YYDEBUG /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in YYRHS. */ -static const unsigned char yyprhs[] = +static const yytype_uint8 yyprhs[] = { 0, 0, 3, 7, 10, 13, 16, 19, 22, 25, 28, 31, 34, 37, 40, 43, 46, 49, 52, 53, @@ -363,8 +498,8 @@ static const unsigned char yyprhs[] = 189 }; -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const yysigned_char yyrhs[] = +/* YYRHS -- A `-1'-separated list of the rules' RHS. */ +static const yytype_int8 yyrhs[] = { 82, 0, -1, 12, 7, 7, -1, 13, 7, -1, 26, 7, -1, 27, 7, -1, 28, 7, -1, 29, @@ -389,50 +524,50 @@ static const yysigned_char yyrhs[] = }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ -static const unsigned short yyrline[] = +static const yytype_uint16 yyrline[] = { - 0, 100, 100, 111, 118, 128, 138, 148, 158, 164, - 168, 172, 176, 180, 184, 188, 206, 210, 214, 217, - 231, 246, 261, 275, 289, 307, 327, 327, 327, 327, - 328, 328, 328, 331, 334, 334, 337, 337, 337, 337, - 338, 338, 338, 338, 338, 339, 339, 339, 339, 340, - 340, 343, 343, 346, 349, 349, 352, 356, 366, 366, - 369, 372, 383, 383, 386, 386, 389, 392, 392, 392, - 395 + 0, 100, 100, 111, 118, 128, 138, 148, 158, 165, + 172, 179, 186, 193, 200, 207, 228, 235, 242, 245, + 262, 280, 298, 315, 332, 353, 376, 376, 376, 376, + 377, 377, 377, 380, 383, 383, 386, 386, 386, 386, + 387, 387, 387, 387, 387, 388, 388, 388, 388, 389, + 389, 392, 392, 395, 398, 398, 401, 405, 415, 415, + 418, 421, 432, 432, 435, 435, 438, 441, 441, 441, + 444 }; #endif -#if YYDEBUG || YYERROR_VERBOSE -/* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at YYNTOKENS, nonterminals. */ +#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE +/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. + First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { - "$end", "error", "$undefined", "tINT", "tDOUBLE", "tDIMENSION", - "tBOOLEAN", "tSTRING", "tWORD", "tGSWORD", "CURRENT_PRINTER", - "SHOW_ALL_PAPER_SIZES", "PRINTER", "DESTINATION", "SCALING", - "ORIENTATION", "AUTOSIZE_ROLL_PAPER", "UNIT", "DRIVER", "LEFT", "TOP", - "CUSTOM_PAGE_WIDTH", "CUSTOM_PAGE_HEIGHT", "OUTPUT_TYPE", "PRINTRC_HDR", - "PARAMETER", "QUEUE_NAME", "OUTPUT_FILENAME", "EXTRA_PRINTER_OPTIONS", - "CUSTOM_COMMAND", "COMMAND_TYPE", "GLOBAL_SETTINGS", "GLOBAL", - "END_GLOBAL_SETTINGS", "pINT", "pSTRING_LIST", "pFILE", "pDOUBLE", - "pDIMENSION", "pBOOLEAN", "pCURVE", "$accept", "Printer", "Destination", - "Queue_Name", "Output_Filename", "Extra_Printer_Options", - "Custom_Command", "Command_Type", "Scaling", "Orientation", - "Autosize_Roll_Paper", "Unit", "Left", "Top", "Output_Type", - "Custom_Page_Width", "Custom_Page_Height", "Empty", "Int_Param", - "String_List_Param", "File_Param", "Double_Param", "Dimension_Param", - "Boolean_Param", "Curve_Param", "Typed_Param", "Parameter", - "Parameters", "Standard_Value", "Standard_Values", "A_Printer", - "Printers", "Current_Printer", "Show_All_Paper_Sizes", "Global", - "Old_Globals", "New_Global_Setting", "Global_Setting", - "Global_Settings", "Global_Subblock", "Global_Block", "Thing", 0 + "$end", "error", "$undefined", "tINT", "tDOUBLE", "tDIMENSION", + "tBOOLEAN", "tSTRING", "tWORD", "tGSWORD", "CURRENT_PRINTER", + "SHOW_ALL_PAPER_SIZES", "PRINTER", "DESTINATION", "SCALING", + "ORIENTATION", "AUTOSIZE_ROLL_PAPER", "UNIT", "DRIVER", "LEFT", "TOP", + "CUSTOM_PAGE_WIDTH", "CUSTOM_PAGE_HEIGHT", "OUTPUT_TYPE", "PRINTRC_HDR", + "PARAMETER", "QUEUE_NAME", "OUTPUT_FILENAME", "EXTRA_PRINTER_OPTIONS", + "CUSTOM_COMMAND", "COMMAND_TYPE", "GLOBAL_SETTINGS", "GLOBAL", + "END_GLOBAL_SETTINGS", "pINT", "pSTRING_LIST", "pFILE", "pDOUBLE", + "pDIMENSION", "pBOOLEAN", "pCURVE", "$accept", "Printer", "Destination", + "Queue_Name", "Output_Filename", "Extra_Printer_Options", + "Custom_Command", "Command_Type", "Scaling", "Orientation", + "Autosize_Roll_Paper", "Unit", "Left", "Top", "Output_Type", + "Custom_Page_Width", "Custom_Page_Height", "Empty", "Int_Param", + "String_List_Param", "File_Param", "Double_Param", "Dimension_Param", + "Boolean_Param", "Curve_Param", "Typed_Param", "Parameter", "Parameters", + "Standard_Value", "Standard_Values", "A_Printer", "Printers", + "Current_Printer", "Show_All_Paper_Sizes", "Global", "Old_Globals", + "New_Global_Setting", "Global_Setting", "Global_Settings", + "Global_Subblock", "Global_Block", "Thing", 0 }; #endif # ifdef YYPRINT /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to token YYLEX-NUM. */ -static const unsigned short yytoknum[] = +static const yytype_uint16 yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, @@ -443,7 +578,7 @@ static const unsigned short yytoknum[] = # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const unsigned char yyr1[] = +static const yytype_uint8 yyr1[] = { 0, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, @@ -456,7 +591,7 @@ static const unsigned char yyr1[] = }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const unsigned char yyr2[] = +static const yytype_uint8 yyr2[] = { 0, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 4, @@ -471,7 +606,7 @@ static const unsigned char yyr2[] = /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state STATE-NUM when YYTABLE doesn't specify something else to do. Zero means the default is an error. */ -static const unsigned char yydefact[] = +static const yytype_uint8 yydefact[] = { 0, 18, 0, 0, 18, 69, 0, 68, 67, 18, 1, 56, 65, 0, 0, 60, 55, 70, 0, 66, @@ -487,8 +622,8 @@ static const unsigned char yydefact[] = 22, 23, 24, 25 }; -/* YYDEFGOTO[NTERM-NUM]. */ -static const yysigned_char yydefgoto[] = +/* YYDEFGOTO[NTERM-NUM]. */ +static const yytype_int8 yydefgoto[] = { -1, 27, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 5, 85, 86, @@ -500,7 +635,7 @@ static const yysigned_char yydefgoto[] = /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ #define YYPACT_NINF -26 -static const yysigned_char yypact[] = +static const yytype_int8 yypact[] = { -22, -2, 6, 0, -26, -26, 5, -26, -26, -26, -26, -26, -26, -7, 11, -26, -26, 7, 13, -26, @@ -517,7 +652,7 @@ static const yysigned_char yypact[] = }; /* YYPGOTO[NTERM-NUM]. */ -static const yysigned_char yypgoto[] = +static const yytype_int8 yypgoto[] = { -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -4, -26, -26, @@ -531,7 +666,7 @@ static const yysigned_char yypgoto[] = number is the opposite. If zero, do what YYDEFACT says. If YYTABLE_NINF, syntax error. */ #define YYTABLE_NINF -1 -static const unsigned char yytable[] = +static const yytype_uint8 yytable[] = { 12, 18, 1, 3, 14, 16, 10, 11, 3, 93, 94, 95, 96, 97, 98, 99, 14, 25, 84, 26, @@ -543,7 +678,7 @@ static const unsigned char yytable[] = 108, 109, 110, 111, 113, 112 }; -static const yysigned_char yycheck[] = +static const yytype_int8 yycheck[] = { 4, 8, 24, 10, 11, 9, 0, 7, 10, 34, 35, 36, 37, 38, 39, 40, 11, 6, 8, 12, @@ -557,7 +692,7 @@ static const yysigned_char yycheck[] = /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ -static const unsigned char yystos[] = +static const yytype_uint8 yystos[] = { 0, 24, 82, 10, 31, 58, 73, 76, 80, 81, 0, 7, 58, 79, 11, 74, 58, 72, 8, 33, @@ -573,22 +708,6 @@ static const unsigned char yystos[] = 4, 3, 6, 7 }; -#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) -# define YYSIZE_T __SIZE_TYPE__ -#endif -#if ! defined (YYSIZE_T) && defined (size_t) -# define YYSIZE_T size_t -#endif -#if ! defined (YYSIZE_T) -# if defined (__STDC__) || defined (__cplusplus) -# include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -# endif -#endif -#if ! defined (YYSIZE_T) -# define YYSIZE_T unsigned int -#endif - #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) #define YYEMPTY (-2) @@ -596,7 +715,8 @@ static const unsigned char yystos[] = #define YYACCEPT goto yyacceptlab #define YYABORT goto yyabortlab -#define YYERROR goto yyerrlab1 +#define YYERROR goto yyerrorlab + /* Like YYERROR except do call yyerror. This remains here temporarily to ease the transition to the new meaning of YYERROR, for GCC. @@ -613,30 +733,63 @@ do \ yychar = (Token); \ yylval = (Value); \ yytoken = YYTRANSLATE (yychar); \ - YYPOPSTACK; \ + YYPOPSTACK (1); \ goto yybackup; \ } \ else \ - { \ - yyerror ("syntax error: cannot back up");\ + { \ + yyerror (YY_("syntax error: cannot back up")); \ YYERROR; \ } \ -while (0) +while (YYID (0)) + #define YYTERROR 1 #define YYERRCODE 256 -/* YYLLOC_DEFAULT -- Compute the default location (before the actions - are run). */ +/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. + If N is 0, then set CURRENT to the empty location which ends + the previous symbol: RHS[0] (always defined). */ + +#define YYRHSLOC(Rhs, K) ((Rhs)[K]) #ifndef YYLLOC_DEFAULT -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - Current.first_line = Rhs[1].first_line; \ - Current.first_column = Rhs[1].first_column; \ - Current.last_line = Rhs[N].last_line; \ - Current.last_column = Rhs[N].last_column; +# define YYLLOC_DEFAULT(Current, Rhs, N) \ + do \ + if (YYID (N)) \ + { \ + (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ + (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ + (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ + (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ + } \ + else \ + { \ + (Current).first_line = (Current).last_line = \ + YYRHSLOC (Rhs, 0).last_line; \ + (Current).first_column = (Current).last_column = \ + YYRHSLOC (Rhs, 0).last_column; \ + } \ + while (YYID (0)) #endif + +/* YY_LOCATION_PRINT -- Print the location on the stream. + This macro was not mandated originally: define only if we know + we won't break user code: when these are the locations we know. */ + +#ifndef YY_LOCATION_PRINT +# if YYLTYPE_IS_TRIVIAL +# define YY_LOCATION_PRINT(File, Loc) \ + fprintf (File, "%d.%d-%d.%d", \ + (Loc).first_line, (Loc).first_column, \ + (Loc).last_line, (Loc).last_column) +# else +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) +# endif +#endif + + /* YYLEX -- calling `yylex' with the right arguments. */ #ifdef YYLEX_PARAM @@ -657,42 +810,96 @@ while (0) do { \ if (yydebug) \ YYFPRINTF Args; \ -} while (0) +} while (YYID (0)) -# define YYDSYMPRINT(Args) \ -do { \ - if (yydebug) \ - yysymprint Args; \ -} while (0) +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yy_symbol_print (stderr, \ + Type, Value); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (YYID (0)) -# define YYDSYMPRINTF(Title, Token, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yysymprint (stderr, \ - Token, Value); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (0) + +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ + +/*ARGSUSED*/ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +#else +static void +yy_symbol_value_print (yyoutput, yytype, yyvaluep) + FILE *yyoutput; + int yytype; + YYSTYPE const * const yyvaluep; +#endif +{ + if (!yyvaluep) + return; +# ifdef YYPRINT + if (yytype < YYNTOKENS) + YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); +# else + YYUSE (yyoutput); +# endif + switch (yytype) + { + default: + break; + } +} + + +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ + +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +#else +static void +yy_symbol_print (yyoutput, yytype, yyvaluep) + FILE *yyoutput; + int yytype; + YYSTYPE const * const yyvaluep; +#endif +{ + if (yytype < YYNTOKENS) + YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); + else + YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); + + yy_symbol_value_print (yyoutput, yytype, yyvaluep); + YYFPRINTF (yyoutput, ")"); +} /*------------------------------------------------------------------. | yy_stack_print -- Print the state stack from its BOTTOM up to its | -| TOP (cinluded). | +| TOP (included). | `------------------------------------------------------------------*/ -#if defined (__STDC__) || defined (__cplusplus) +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) static void -yy_stack_print (short *bottom, short *top) +yy_stack_print (yytype_int16 *bottom, yytype_int16 *top) #else static void yy_stack_print (bottom, top) - short *bottom; - short *top; + yytype_int16 *bottom; + yytype_int16 *top; #endif { YYFPRINTF (stderr, "Stack now"); - for (/* Nothing. */; bottom <= top; ++bottom) + for (; bottom <= top; ++bottom) YYFPRINTF (stderr, " %d", *bottom); YYFPRINTF (stderr, "\n"); } @@ -701,45 +908,52 @@ yy_stack_print (bottom, top) do { \ if (yydebug) \ yy_stack_print ((Bottom), (Top)); \ -} while (0) +} while (YYID (0)) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ -#if defined (__STDC__) || defined (__cplusplus) +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) static void -yy_reduce_print (int yyrule) +yy_reduce_print (YYSTYPE *yyvsp, int yyrule) #else static void -yy_reduce_print (yyrule) +yy_reduce_print (yyvsp, yyrule) + YYSTYPE *yyvsp; int yyrule; #endif { + int yynrhs = yyr2[yyrule]; int yyi; - unsigned int yylineno = yyrline[yyrule]; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ", - yyrule - 1, yylineno); - /* Print the symbols being reduced, and their result. */ - for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++) - YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]); - YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]); + unsigned long int yylno = yyrline[yyrule]; + YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", + yyrule - 1, yylno); + /* The symbols being reduced. */ + for (yyi = 0; yyi < yynrhs; yyi++) + { + fprintf (stderr, " $%d = ", yyi + 1); + yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], + &(yyvsp[(yyi + 1) - (yynrhs)]) + ); + fprintf (stderr, "\n"); + } } # define YY_REDUCE_PRINT(Rule) \ do { \ if (yydebug) \ - yy_reduce_print (Rule); \ -} while (0) + yy_reduce_print (yyvsp, Rule); \ +} while (YYID (0)) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ int yydebug; #else /* !YYDEBUG */ # define YYDPRINTF(Args) -# define YYDSYMPRINT(Args) -# define YYDSYMPRINTF(Title, Token, Value, Location) +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) # define YY_STACK_PRINT(Bottom, Top) # define YY_REDUCE_PRINT(Rule) #endif /* !YYDEBUG */ @@ -754,13 +968,9 @@ int yydebug; if the built-in stack extension method is used). Do not make this value too large; the results are undefined if - SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH) + YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) evaluated with infinite-precision integer arithmetic. */ -#if YYMAXDEPTH == 0 -# undef YYMAXDEPTH -#endif - #ifndef YYMAXDEPTH # define YYMAXDEPTH 10000 #endif @@ -770,45 +980,47 @@ int yydebug; #if YYERROR_VERBOSE # ifndef yystrlen -# if defined (__GLIBC__) && defined (_STRING_H) +# if defined __GLIBC__ && defined _STRING_H # define yystrlen strlen # else /* Return the length of YYSTR. */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) static YYSIZE_T -# if defined (__STDC__) || defined (__cplusplus) yystrlen (const char *yystr) -# else +#else +static YYSIZE_T yystrlen (yystr) - const char *yystr; -# endif + const char *yystr; +#endif { - register const char *yys = yystr; - - while (*yys++ != '\0') + YYSIZE_T yylen; + for (yylen = 0; yystr[yylen]; yylen++) continue; - - return yys - yystr - 1; + return yylen; } # endif # endif # ifndef yystpcpy -# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE) +# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE # define yystpcpy stpcpy # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) static char * -# if defined (__STDC__) || defined (__cplusplus) yystpcpy (char *yydest, const char *yysrc) -# else +#else +static char * yystpcpy (yydest, yysrc) - char *yydest; - const char *yysrc; -# endif + char *yydest; + const char *yysrc; +#endif { - register char *yyd = yydest; - register const char *yys = yysrc; + char *yyd = yydest; + const char *yys = yysrc; while ((*yyd++ = *yys++) != '\0') continue; @@ -818,70 +1030,192 @@ yystpcpy (yydest, yysrc) # endif # endif -#endif /* !YYERROR_VERBOSE */ +# ifndef yytnamerr +/* Copy to YYRES the contents of YYSTR after stripping away unnecessary + quotes and backslashes, so that it's suitable for yyerror. The + heuristic is that double-quoting is unnecessary unless the string + contains an apostrophe, a comma, or backslash (other than + backslash-backslash). YYSTR is taken from yytname. If YYRES is + null, do not copy; instead, return the length of what the result + would have been. */ +static YYSIZE_T +yytnamerr (char *yyres, const char *yystr) +{ + if (*yystr == '"') + { + YYSIZE_T yyn = 0; + char const *yyp = yystr; + + for (;;) + switch (*++yyp) + { + case '\'': + case ',': + goto do_not_strip_quotes; + + case '\\': + if (*++yyp != '\\') + goto do_not_strip_quotes; + /* Fall through. */ + default: + if (yyres) + yyres[yyn] = *yyp; + yyn++; + break; + + case '"': + if (yyres) + yyres[yyn] = '\0'; + return yyn; + } + do_not_strip_quotes: ; + } - + if (! yyres) + return yystrlen (yystr); -#if YYDEBUG -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ + return yystpcpy (yyres, yystr) - yyres; +} +# endif -#if defined (__STDC__) || defined (__cplusplus) -static void -yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep) -#else -static void -yysymprint (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE *yyvaluep; -#endif +/* Copy into YYRESULT an error message about the unexpected token + YYCHAR while in state YYSTATE. Return the number of bytes copied, + including the terminating null byte. If YYRESULT is null, do not + copy anything; just return the number of bytes that would be + copied. As a special case, return 0 if an ordinary "syntax error" + message will do. Return YYSIZE_MAXIMUM if overflow occurs during + size calculation. */ +static YYSIZE_T +yysyntax_error (char *yyresult, int yystate, int yychar) { - /* Pacify ``unused variable'' warnings. */ - (void) yyvaluep; + int yyn = yypact[yystate]; - if (yytype < YYNTOKENS) - { - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); -# ifdef YYPRINT - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# endif - } + if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) + return 0; else - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); - - switch (yytype) { - default: - break; + int yytype = YYTRANSLATE (yychar); + YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); + YYSIZE_T yysize = yysize0; + YYSIZE_T yysize1; + int yysize_overflow = 0; + enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; + char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; + int yyx; + +# if 0 + /* This is so xgettext sees the translatable formats that are + constructed on the fly. */ + YY_("syntax error, unexpected %s"); + YY_("syntax error, unexpected %s, expecting %s"); + YY_("syntax error, unexpected %s, expecting %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); +# endif + char *yyfmt; + char const *yyf; + static char const yyunexpected[] = "syntax error, unexpected %s"; + static char const yyexpecting[] = ", expecting %s"; + static char const yyor[] = " or %s"; + char yyformat[sizeof yyunexpected + + sizeof yyexpecting - 1 + + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) + * (sizeof yyor - 1))]; + char const *yyprefix = yyexpecting; + + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + + /* Stay within bounds of both yycheck and yytname. */ + int yychecklim = YYLAST - yyn + 1; + int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + int yycount = 1; + + yyarg[0] = yytname[yytype]; + yyfmt = yystpcpy (yyformat, yyunexpected); + + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) + { + if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) + { + yycount = 1; + yysize = yysize0; + yyformat[sizeof yyunexpected - 1] = '\0'; + break; + } + yyarg[yycount++] = yytname[yyx]; + yysize1 = yysize + yytnamerr (0, yytname[yyx]); + yysize_overflow |= (yysize1 < yysize); + yysize = yysize1; + yyfmt = yystpcpy (yyfmt, yyprefix); + yyprefix = yyor; + } + + yyf = YY_(yyformat); + yysize1 = yysize + yystrlen (yyf); + yysize_overflow |= (yysize1 < yysize); + yysize = yysize1; + + if (yysize_overflow) + return YYSIZE_MAXIMUM; + + if (yyresult) + { + /* Avoid sprintf, as that infringes on the user's name space. + Don't have undefined behavior even if the translation + produced a string with the wrong number of "%s"s. */ + char *yyp = yyresult; + int yyi = 0; + while ((*yyp = *yyf) != '\0') + { + if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) + { + yyp += yytnamerr (yyp, yyarg[yyi++]); + yyf += 2; + } + else + { + yyp++; + yyf++; + } + } + } + return yysize; } - YYFPRINTF (yyoutput, ")"); } +#endif /* YYERROR_VERBOSE */ + -#endif /* ! YYDEBUG */ /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ -#if defined (__STDC__) || defined (__cplusplus) +/*ARGSUSED*/ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) static void -yydestruct (int yytype, YYSTYPE *yyvaluep) +yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) #else static void -yydestruct (yytype, yyvaluep) +yydestruct (yymsg, yytype, yyvaluep) + const char *yymsg; int yytype; YYSTYPE *yyvaluep; #endif { - /* Pacify ``unused variable'' warnings. */ - (void) yyvaluep; + YYUSE (yyvaluep); + + if (!yymsg) + yymsg = "Deleting"; + YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); switch (yytype) { default: - break; + break; } } @@ -889,13 +1223,13 @@ yydestruct (yytype, yyvaluep) /* Prevent warnings from -Wmissing-prototypes. */ #ifdef YYPARSE_PARAM -# if defined (__STDC__) || defined (__cplusplus) +#if defined __STDC__ || defined __cplusplus int yyparse (void *YYPARSE_PARAM); -# else +#else int yyparse (); -# endif +#endif #else /* ! YYPARSE_PARAM */ -#if defined (__STDC__) || defined (__cplusplus) +#if defined __STDC__ || defined __cplusplus int yyparse (void); #else int yyparse (); @@ -904,10 +1238,10 @@ int yyparse (); -/* The lookahead symbol. */ +/* The look-ahead symbol. */ int yychar; -/* The semantic value of the lookahead symbol. */ +/* The semantic value of the look-ahead symbol. */ YYSTYPE yylval; /* Number of syntax errors so far. */ @@ -920,14 +1254,18 @@ int yynerrs; `----------*/ #ifdef YYPARSE_PARAM -# if defined (__STDC__) || defined (__cplusplus) -int yyparse (void *YYPARSE_PARAM) -# else -int yyparse (YYPARSE_PARAM) - void *YYPARSE_PARAM; -# endif +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +int +yyparse (void *YYPARSE_PARAM) +#else +int +yyparse (YYPARSE_PARAM) + void *YYPARSE_PARAM; +#endif #else /* ! YYPARSE_PARAM */ -#if defined (__STDC__) || defined (__cplusplus) +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) int yyparse (void) #else @@ -938,13 +1276,19 @@ yyparse () #endif { - register int yystate; - register int yyn; + int yystate; + int yyn; int yyresult; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus; - /* Lookahead token as an internal (translated) token number. */ + /* Look-ahead token as an internal (translated) token number. */ int yytoken = 0; +#if YYERROR_VERBOSE + /* Buffer for error messages, and its allocated size. */ + char yymsgbuf[128]; + char *yymsg = yymsgbuf; + YYSIZE_T yymsg_alloc = sizeof yymsgbuf; +#endif /* Three stacks and their tools: `yyss': related to states, @@ -955,18 +1299,18 @@ yyparse () to reallocate them elsewhere. */ /* The state stack. */ - short yyssa[YYINITDEPTH]; - short *yyss = yyssa; - register short *yyssp; + yytype_int16 yyssa[YYINITDEPTH]; + yytype_int16 *yyss = yyssa; + yytype_int16 *yyssp; /* The semantic value stack. */ YYSTYPE yyvsa[YYINITDEPTH]; YYSTYPE *yyvs = yyvsa; - register YYSTYPE *yyvsp; + YYSTYPE *yyvsp; -#define YYPOPSTACK (yyvsp--, yyssp--) +#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) YYSIZE_T yystacksize = YYINITDEPTH; @@ -975,9 +1319,9 @@ yyparse () YYSTYPE yyval; - /* When reducing, the number of symbols on the RHS of the reduced - rule. */ - int yylen; + /* The number of symbols on the RHS of the reduced rule. + Keep to zero when no symbol should be popped. */ + int yylen = 0; YYDPRINTF ((stderr, "Starting parse\n")); @@ -1001,8 +1345,7 @@ yyparse () `------------------------------------------------------------*/ yynewstate: /* In all cases, when you get here, the value and location stacks - have just been pushed. so pushing a state here evens the stacks. - */ + have just been pushed. So pushing a state here evens the stacks. */ yyssp++; yysetstate: @@ -1015,18 +1358,18 @@ yyparse () #ifdef yyoverflow { - /* Give user a chance to reallocate the stack. Use copies of + /* Give user a chance to reallocate the stack. Use copies of these so that the &'s don't force the real ones into memory. */ YYSTYPE *yyvs1 = yyvs; - short *yyss1 = yyss; + yytype_int16 *yyss1 = yyss; /* Each stack pointer address is followed by the size of the data in use in that stack, in bytes. This used to be a conditional around just the two extra args, but that might be undefined if yyoverflow is a macro. */ - yyoverflow ("parser stack overflow", + yyoverflow (YY_("memory exhausted"), &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), @@ -1037,21 +1380,21 @@ yyparse () } #else /* no yyoverflow */ # ifndef YYSTACK_RELOCATE - goto yyoverflowlab; + goto yyexhaustedlab; # else /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) - goto yyoverflowlab; + goto yyexhaustedlab; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; { - short *yyss1 = yyss; + yytype_int16 *yyss1 = yyss; union yyalloc *yyptr = (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) - goto yyoverflowlab; + goto yyexhaustedlab; YYSTACK_RELOCATE (yyss); YYSTACK_RELOCATE (yyvs); @@ -1082,19 +1425,17 @@ yyparse () `-----------*/ yybackup: -/* Do appropriate processing given the current state. */ -/* Read a lookahead token if we need one and don't already have one. */ -/* yyresume: */ - - /* First try to decide what to do without reference to lookahead token. */ + /* Do appropriate processing given the current state. Read a + look-ahead token if we need one and don't already have one. */ + /* First try to decide what to do without reference to look-ahead token. */ yyn = yypact[yystate]; if (yyn == YYPACT_NINF) goto yydefault; - /* Not known => get a lookahead token if don't already have one. */ + /* Not known => get a look-ahead token if don't already have one. */ - /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ + /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); @@ -1109,7 +1450,7 @@ yybackup: else { yytoken = YYTRANSLATE (yychar); - YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc); + YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); } /* If the proper action on seeing token YYTOKEN is to reduce or to @@ -1129,22 +1470,21 @@ yybackup: if (yyn == YYFINAL) YYACCEPT; - /* Shift the lookahead token. */ - YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken])); - - /* Discard the token being shifted unless it is eof. */ - if (yychar != YYEOF) - yychar = YYEMPTY; - - *++yyvsp = yylval; - - /* Count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus) yyerrstatus--; + /* Shift the look-ahead token. */ + YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); + + /* Discard the shifted token unless it is eof. */ + if (yychar != YYEOF) + yychar = YYEMPTY; + yystate = yyn; + *++yyvsp = yylval; + goto yynewstate; @@ -1182,27 +1522,27 @@ yyreduce: case 2: #line 101 "printrcy.y" { - current_printer = stpui_plist_create(yyvsp[-1].sval, yyvsp[0].sval); - g_free(yyvsp[-1].sval); - g_free(yyvsp[0].sval); + current_printer = stpui_plist_create((yyvsp[(2) - (3)].sval), (yyvsp[(3) - (3)].sval)); + g_free((yyvsp[(2) - (3)].sval)); + g_free((yyvsp[(3) - (3)].sval)); } break; case 3: #line 112 "printrcy.y" { - if (yyvsp[0].sval) - g_free(yyvsp[0].sval); + if ((yyvsp[(2) - (2)].sval)) + g_free((yyvsp[(2) - (2)].sval)); } break; case 4: #line 119 "printrcy.y" { - if (yyvsp[0].sval) + if (current_printer && (yyvsp[(2) - (2)].sval)) { - stpui_plist_set_queue_name(current_printer, yyvsp[0].sval); - g_free(yyvsp[0].sval); + stpui_plist_set_queue_name(current_printer, (yyvsp[(2) - (2)].sval)); + g_free((yyvsp[(2) - (2)].sval)); } } break; @@ -1210,10 +1550,10 @@ yyreduce: case 5: #line 129 "printrcy.y" { - if (yyvsp[0].sval) + if (current_printer && (yyvsp[(2) - (2)].sval)) { - stpui_plist_set_output_filename(current_printer, yyvsp[0].sval); - g_free(yyvsp[0].sval); + stpui_plist_set_output_filename(current_printer, (yyvsp[(2) - (2)].sval)); + g_free((yyvsp[(2) - (2)].sval)); } } break; @@ -1221,10 +1561,10 @@ yyreduce: case 6: #line 139 "printrcy.y" { - if (yyvsp[0].sval) + if (current_printer && (yyvsp[(2) - (2)].sval)) { - stpui_plist_set_extra_printer_options(current_printer, yyvsp[0].sval); - g_free(yyvsp[0].sval); + stpui_plist_set_extra_printer_options(current_printer, (yyvsp[(2) - (2)].sval)); + g_free((yyvsp[(2) - (2)].sval)); } } break; @@ -1232,10 +1572,10 @@ yyreduce: case 7: #line 149 "printrcy.y" { - if (yyvsp[0].sval) + if (current_printer && (yyvsp[(2) - (2)].sval)) { - stpui_plist_set_custom_command(current_printer, yyvsp[0].sval); - g_free(yyvsp[0].sval); + stpui_plist_set_custom_command(current_printer, (yyvsp[(2) - (2)].sval)); + g_free((yyvsp[(2) - (2)].sval)); } } break; @@ -1243,224 +1583,272 @@ yyreduce: case 8: #line 159 "printrcy.y" { - stpui_plist_set_command_type(current_printer, yyvsp[0].ival); + if (current_printer) + stpui_plist_set_command_type(current_printer, (yyvsp[(2) - (2)].ival)); } break; case 9: -#line 165 "printrcy.y" - { current_printer->scaling = yyvsp[0].dval; } +#line 166 "printrcy.y" + { + if (current_printer) + current_printer->scaling = (yyvsp[(2) - (2)].dval); + } break; case 10: -#line 169 "printrcy.y" - { current_printer->orientation = yyvsp[0].ival; } +#line 173 "printrcy.y" + { + if (current_printer) + current_printer->orientation = (yyvsp[(2) - (2)].ival); + } break; case 11: -#line 173 "printrcy.y" - { current_printer->auto_size_roll_feed_paper = yyvsp[0].ival; } +#line 180 "printrcy.y" + { + if (current_printer) + current_printer->auto_size_roll_feed_paper = (yyvsp[(2) - (2)].ival); + } break; case 12: -#line 177 "printrcy.y" - { current_printer->unit = yyvsp[0].ival; } +#line 187 "printrcy.y" + { + if (current_printer) + current_printer->unit = (yyvsp[(2) - (2)].ival); + } break; case 13: -#line 181 "printrcy.y" - { stp_set_left(current_printer->v, yyvsp[0].ival); } +#line 194 "printrcy.y" + { + if (current_printer) + stp_set_left(current_printer->v, (yyvsp[(2) - (2)].ival)); + } break; case 14: -#line 185 "printrcy.y" - { stp_set_top(current_printer->v, yyvsp[0].ival); } +#line 201 "printrcy.y" + { + if (current_printer) + stp_set_top(current_printer->v, (yyvsp[(2) - (2)].ival)); + } break; case 15: -#line 189 "printrcy.y" +#line 208 "printrcy.y" { - switch (yyvsp[0].ival) + if (current_printer) { - case 0: - stp_set_string_parameter - (current_printer->v, "PrintingMode", "BW"); - break; - case 1: - case 2: - default: - stp_set_string_parameter - (current_printer->v, "PrintingMode", "Color"); - break; + switch ((yyvsp[(2) - (2)].ival)) + { + case 0: + stp_set_string_parameter + (current_printer->v, "PrintingMode", "BW"); + break; + case 1: + case 2: + default: + stp_set_string_parameter + (current_printer->v, "PrintingMode", "Color"); + break; + } } } break; case 16: -#line 207 "printrcy.y" - { stp_set_page_width(current_printer->v, yyvsp[0].ival); } +#line 229 "printrcy.y" + { + if (current_printer) + stp_set_page_width(current_printer->v, (yyvsp[(2) - (2)].ival)); + } break; case 17: -#line 211 "printrcy.y" - { stp_set_page_height(current_printer->v, yyvsp[0].ival); } +#line 236 "printrcy.y" + { + if (current_printer) + stp_set_page_height(current_printer->v, (yyvsp[(2) - (2)].ival)); + } break; case 19: -#line 218 "printrcy.y" +#line 246 "printrcy.y" { - stp_set_int_parameter(current_printer->v, yyvsp[-3].sval, yyvsp[0].ival); - if (strcmp(yyvsp[-1].sval, "False") == 0) - stp_set_int_parameter_active(current_printer->v, yyvsp[-3].sval, - STP_PARAMETER_INACTIVE); - else - stp_set_int_parameter_active(current_printer->v, yyvsp[-3].sval, - STP_PARAMETER_ACTIVE); - g_free(yyvsp[-3].sval); - g_free(yyvsp[-1].sval); + if (current_printer) + { + stp_set_int_parameter(current_printer->v, (yyvsp[(1) - (4)].sval), (yyvsp[(4) - (4)].ival)); + if (strcmp((yyvsp[(3) - (4)].sval), "False") == 0) + stp_set_int_parameter_active(current_printer->v, (yyvsp[(1) - (4)].sval), + STP_PARAMETER_INACTIVE); + else + stp_set_int_parameter_active(current_printer->v, (yyvsp[(1) - (4)].sval), + STP_PARAMETER_ACTIVE); + } + g_free((yyvsp[(1) - (4)].sval)); + g_free((yyvsp[(3) - (4)].sval)); } break; case 20: -#line 232 "printrcy.y" +#line 263 "printrcy.y" { - stp_set_string_parameter(current_printer->v, yyvsp[-3].sval, yyvsp[0].sval); - if (strcmp(yyvsp[-1].sval, "False") == 0) - stp_set_string_parameter_active(current_printer->v, yyvsp[-3].sval, - STP_PARAMETER_INACTIVE); - else - stp_set_string_parameter_active(current_printer->v, yyvsp[-3].sval, - STP_PARAMETER_ACTIVE); - g_free(yyvsp[-3].sval); - g_free(yyvsp[-1].sval); - g_free(yyvsp[0].sval); + if (current_printer) + { + stp_set_string_parameter(current_printer->v, (yyvsp[(1) - (4)].sval), (yyvsp[(4) - (4)].sval)); + if (strcmp((yyvsp[(3) - (4)].sval), "False") == 0) + stp_set_string_parameter_active(current_printer->v, (yyvsp[(1) - (4)].sval), + STP_PARAMETER_INACTIVE); + else + stp_set_string_parameter_active(current_printer->v, (yyvsp[(1) - (4)].sval), + STP_PARAMETER_ACTIVE); + } + g_free((yyvsp[(1) - (4)].sval)); + g_free((yyvsp[(3) - (4)].sval)); + g_free((yyvsp[(4) - (4)].sval)); } break; case 21: -#line 247 "printrcy.y" +#line 281 "printrcy.y" { - stp_set_file_parameter(current_printer->v, yyvsp[-3].sval, yyvsp[0].sval); - if (strcmp(yyvsp[-1].sval, "False") == 0) - stp_set_file_parameter_active(current_printer->v, yyvsp[-3].sval, - STP_PARAMETER_INACTIVE); - else - stp_set_file_parameter_active(current_printer->v, yyvsp[-3].sval, - STP_PARAMETER_ACTIVE); - g_free(yyvsp[-3].sval); - g_free(yyvsp[-1].sval); - g_free(yyvsp[0].sval); + if (current_printer) + { + stp_set_file_parameter(current_printer->v, (yyvsp[(1) - (4)].sval), (yyvsp[(4) - (4)].sval)); + if (strcmp((yyvsp[(3) - (4)].sval), "False") == 0) + stp_set_file_parameter_active(current_printer->v, (yyvsp[(1) - (4)].sval), + STP_PARAMETER_INACTIVE); + else + stp_set_file_parameter_active(current_printer->v, (yyvsp[(1) - (4)].sval), + STP_PARAMETER_ACTIVE); + } + g_free((yyvsp[(1) - (4)].sval)); + g_free((yyvsp[(3) - (4)].sval)); + g_free((yyvsp[(4) - (4)].sval)); } break; case 22: -#line 262 "printrcy.y" +#line 299 "printrcy.y" { - stp_set_float_parameter(current_printer->v, yyvsp[-3].sval, yyvsp[0].dval); - if (strcmp(yyvsp[-1].sval, "False") == 0) - stp_set_float_parameter_active(current_printer->v, yyvsp[-3].sval, - STP_PARAMETER_INACTIVE); - else - stp_set_float_parameter_active(current_printer->v, yyvsp[-3].sval, - STP_PARAMETER_ACTIVE); - g_free(yyvsp[-3].sval); - g_free(yyvsp[-1].sval); + if (current_printer) + { + stp_set_float_parameter(current_printer->v, (yyvsp[(1) - (4)].sval), (yyvsp[(4) - (4)].dval)); + if (strcmp((yyvsp[(3) - (4)].sval), "False") == 0) + stp_set_float_parameter_active(current_printer->v, (yyvsp[(1) - (4)].sval), + STP_PARAMETER_INACTIVE); + else + stp_set_float_parameter_active(current_printer->v, (yyvsp[(1) - (4)].sval), + STP_PARAMETER_ACTIVE); + } + g_free((yyvsp[(1) - (4)].sval)); + g_free((yyvsp[(3) - (4)].sval)); } break; case 23: -#line 276 "printrcy.y" +#line 316 "printrcy.y" { - stp_set_dimension_parameter(current_printer->v, yyvsp[-3].sval, yyvsp[0].ival); - if (strcmp(yyvsp[-1].sval, "False") == 0) - stp_set_dimension_parameter_active(current_printer->v, yyvsp[-3].sval, - STP_PARAMETER_INACTIVE); - else - stp_set_dimension_parameter_active(current_printer->v, yyvsp[-3].sval, - STP_PARAMETER_ACTIVE); - g_free(yyvsp[-3].sval); - g_free(yyvsp[-1].sval); + if (current_printer) + { + stp_set_dimension_parameter(current_printer->v, (yyvsp[(1) - (4)].sval), (yyvsp[(4) - (4)].ival)); + if (strcmp((yyvsp[(3) - (4)].sval), "False") == 0) + stp_set_dimension_parameter_active(current_printer->v, (yyvsp[(1) - (4)].sval), + STP_PARAMETER_INACTIVE); + else + stp_set_dimension_parameter_active(current_printer->v, (yyvsp[(1) - (4)].sval), + STP_PARAMETER_ACTIVE); + } + g_free((yyvsp[(1) - (4)].sval)); + g_free((yyvsp[(3) - (4)].sval)); } break; case 24: -#line 290 "printrcy.y" +#line 333 "printrcy.y" { - if (strcmp(yyvsp[0].sval, "False") == 0) - stp_set_boolean_parameter(current_printer->v, yyvsp[-3].sval, 0); - else - stp_set_boolean_parameter(current_printer->v, yyvsp[-3].sval, 1); - if (strcmp(yyvsp[-1].sval, "False") == 0) - stp_set_boolean_parameter_active(current_printer->v, yyvsp[-3].sval, - STP_PARAMETER_INACTIVE); - else - stp_set_boolean_parameter_active(current_printer->v, yyvsp[-3].sval, - STP_PARAMETER_ACTIVE); - g_free(yyvsp[-3].sval); - g_free(yyvsp[-1].sval); - g_free(yyvsp[0].sval); + if (current_printer) + { + if (strcmp((yyvsp[(4) - (4)].sval), "False") == 0) + stp_set_boolean_parameter(current_printer->v, (yyvsp[(1) - (4)].sval), 0); + else + stp_set_boolean_parameter(current_printer->v, (yyvsp[(1) - (4)].sval), 1); + if (strcmp((yyvsp[(3) - (4)].sval), "False") == 0) + stp_set_boolean_parameter_active(current_printer->v, (yyvsp[(1) - (4)].sval), + STP_PARAMETER_INACTIVE); + else + stp_set_boolean_parameter_active(current_printer->v, (yyvsp[(1) - (4)].sval), + STP_PARAMETER_ACTIVE); + } + g_free((yyvsp[(1) - (4)].sval)); + g_free((yyvsp[(3) - (4)].sval)); + g_free((yyvsp[(4) - (4)].sval)); } break; case 25: -#line 308 "printrcy.y" +#line 354 "printrcy.y" { - stp_curve_t *curve = stp_curve_create_from_string(yyvsp[0].sval); - if (curve) + if (current_printer) { - stp_set_curve_parameter(current_printer->v, yyvsp[-3].sval, curve); - if (strcmp(yyvsp[-1].sval, "False") == 0) - stp_set_curve_parameter_active(current_printer->v, yyvsp[-3].sval, - STP_PARAMETER_INACTIVE); - else - stp_set_curve_parameter_active(current_printer->v, yyvsp[-3].sval, - STP_PARAMETER_ACTIVE); - stp_curve_destroy(curve); + stp_curve_t *curve = stp_curve_create_from_string((yyvsp[(4) - (4)].sval)); + if (curve) + { + stp_set_curve_parameter(current_printer->v, (yyvsp[(1) - (4)].sval), curve); + if (strcmp((yyvsp[(3) - (4)].sval), "False") == 0) + stp_set_curve_parameter_active(current_printer->v, (yyvsp[(1) - (4)].sval), + STP_PARAMETER_INACTIVE); + else + stp_set_curve_parameter_active(current_printer->v, (yyvsp[(1) - (4)].sval), + STP_PARAMETER_ACTIVE); + stp_curve_destroy(curve); + } } - g_free(yyvsp[-3].sval); - g_free(yyvsp[-1].sval); - g_free(yyvsp[0].sval); + g_free((yyvsp[(1) - (4)].sval)); + g_free((yyvsp[(3) - (4)].sval)); + g_free((yyvsp[(4) - (4)].sval)); } break; case 56: -#line 353 "printrcy.y" - { stpui_printrc_current_printer = yyvsp[0].sval; } +#line 402 "printrcy.y" + { stpui_printrc_current_printer = (yyvsp[(2) - (2)].sval); } break; case 57: -#line 357 "printrcy.y" +#line 406 "printrcy.y" { - if (strcmp(yyvsp[0].sval, "True") == 0) + if (strcmp((yyvsp[(2) - (2)].sval), "True") == 0) stpui_show_all_paper_sizes = 1; else stpui_show_all_paper_sizes = 0; - g_free(yyvsp[0].sval); + g_free((yyvsp[(2) - (2)].sval)); } break; case 61: -#line 373 "printrcy.y" +#line 422 "printrcy.y" { - if (yyvsp[0].sval) + if ((yyvsp[(2) - (2)].sval)) { - stpui_set_global_parameter(yyvsp[-1].sval, yyvsp[0].sval); - g_free(yyvsp[0].sval); + stpui_set_global_parameter((yyvsp[(1) - (2)].sval), (yyvsp[(2) - (2)].sval)); + g_free((yyvsp[(2) - (2)].sval)); } - g_free(yyvsp[-1].sval); + g_free((yyvsp[(1) - (2)].sval)); } break; +/* Line 1267 of yacc.c. */ +#line 1846 "printrcy.c" + default: break; } + YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); -/* Line 991 of yacc.c. */ -#line 1458 "printrcy.c" - - yyvsp -= yylen; - yyssp -= yylen; - - + YYPOPSTACK (yylen); + yylen = 0; YY_STACK_PRINT (yyss, yyssp); *++yyvsp = yyval; @@ -1489,109 +1877,93 @@ yyerrlab: if (!yyerrstatus) { ++yynerrs; -#if YYERROR_VERBOSE - yyn = yypact[yystate]; - - if (YYPACT_NINF < yyn && yyn < YYLAST) - { - YYSIZE_T yysize = 0; - int yytype = YYTRANSLATE (yychar); - char *yymsg; - int yyx, yycount; - - yycount = 0; - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. */ - for (yyx = yyn < 0 ? -yyn : 0; - yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) - yysize += yystrlen (yytname[yyx]) + 15, yycount++; - yysize += yystrlen ("syntax error, unexpected ") + 1; - yysize += yystrlen (yytname[yytype]); - yymsg = (char *) YYSTACK_ALLOC (yysize); - if (yymsg != 0) - { - char *yyp = yystpcpy (yymsg, "syntax error, unexpected "); - yyp = yystpcpy (yyp, yytname[yytype]); - - if (yycount < 5) - { - yycount = 0; - for (yyx = yyn < 0 ? -yyn : 0; - yyx < (int) (sizeof (yytname) / sizeof (char *)); - yyx++) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) - { - const char *yyq = ! yycount ? ", expecting " : " or "; - yyp = yystpcpy (yyp, yyq); - yyp = yystpcpy (yyp, yytname[yyx]); - yycount++; - } - } - yyerror (yymsg); +#if ! YYERROR_VERBOSE + yyerror (YY_("syntax error")); +#else + { + YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); + if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) + { + YYSIZE_T yyalloc = 2 * yysize; + if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) + yyalloc = YYSTACK_ALLOC_MAXIMUM; + if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); - } - else - yyerror ("syntax error; also virtual memory exhausted"); - } - else -#endif /* YYERROR_VERBOSE */ - yyerror ("syntax error"); + yymsg = (char *) YYSTACK_ALLOC (yyalloc); + if (yymsg) + yymsg_alloc = yyalloc; + else + { + yymsg = yymsgbuf; + yymsg_alloc = sizeof yymsgbuf; + } + } + + if (0 < yysize && yysize <= yymsg_alloc) + { + (void) yysyntax_error (yymsg, yystate, yychar); + yyerror (yymsg); + } + else + { + yyerror (YY_("syntax error")); + if (yysize != 0) + goto yyexhaustedlab; + } + } +#endif } if (yyerrstatus == 3) { - /* If just tried and failed to reuse lookahead token after an + /* If just tried and failed to reuse look-ahead token after an error, discard it. */ - /* Return failure if at end of input. */ - if (yychar == YYEOF) - { - /* Pop the error token. */ - YYPOPSTACK; - /* Pop the rest of the stack. */ - while (yyss < yyssp) - { - YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); - yydestruct (yystos[*yyssp], yyvsp); - YYPOPSTACK; - } - YYABORT; - } - - YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc); - yydestruct (yytoken, &yylval); - yychar = YYEMPTY; - + if (yychar <= YYEOF) + { + /* Return failure if at end of input. */ + if (yychar == YYEOF) + YYABORT; + } + else + { + yydestruct ("Error: discarding", + yytoken, &yylval); + yychar = YYEMPTY; + } } - /* Else will try to reuse lookahead token after shifting the error + /* Else will try to reuse look-ahead token after shifting the error token. */ - goto yyerrlab2; + goto yyerrlab1; -/*----------------------------------------------------. -| yyerrlab1 -- error raised explicitly by an action. | -`----------------------------------------------------*/ -yyerrlab1: - - /* Suppress GCC warning that yyerrlab1 is unused when no action - invokes YYERROR. */ -#if defined (__GNUC_MINOR__) && 2093 <= (__GNUC__ * 1000 + __GNUC_MINOR__) \ - && !defined __cplusplus - __attribute__ ((__unused__)) -#endif +/*---------------------------------------------------. +| yyerrorlab -- error raised explicitly by YYERROR. | +`---------------------------------------------------*/ +yyerrorlab: + /* Pacify compilers like GCC when the user code never invokes + YYERROR and the label yyerrorlab therefore never appears in user + code. */ + if (/*CONSTCOND*/ 0) + goto yyerrorlab; - goto yyerrlab2; + /* Do not reclaim the symbols of the rule which action triggered + this YYERROR. */ + YYPOPSTACK (yylen); + yylen = 0; + YY_STACK_PRINT (yyss, yyssp); + yystate = *yyssp; + goto yyerrlab1; -/*---------------------------------------------------------------. -| yyerrlab2 -- pop states until the error token can be shifted. | -`---------------------------------------------------------------*/ -yyerrlab2: +/*-------------------------------------------------------------. +| yyerrlab1 -- common code for both syntax error and YYERROR. | +`-------------------------------------------------------------*/ +yyerrlab1: yyerrstatus = 3; /* Each real token shifted decrements this. */ for (;;) @@ -1612,22 +1984,23 @@ yyerrlab2: if (yyssp == yyss) YYABORT; - YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); - yydestruct (yystos[yystate], yyvsp); - yyvsp--; - yystate = *--yyssp; + yydestruct ("Error: popping", + yystos[yystate], yyvsp); + YYPOPSTACK (1); + yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); } if (yyn == YYFINAL) YYACCEPT; - YYDPRINTF ((stderr, "Shifting error token, ")); - *++yyvsp = yylval; + /* Shift the error token. */ + YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); + yystate = yyn; goto yynewstate; @@ -1647,24 +2020,42 @@ yyabortlab: goto yyreturn; #ifndef yyoverflow -/*----------------------------------------------. -| yyoverflowlab -- parser overflow comes here. | -`----------------------------------------------*/ -yyoverflowlab: - yyerror ("parser stack overflow"); +/*-------------------------------------------------. +| yyexhaustedlab -- memory exhaustion comes here. | +`-------------------------------------------------*/ +yyexhaustedlab: + yyerror (YY_("memory exhausted")); yyresult = 2; /* Fall through. */ #endif yyreturn: + if (yychar != YYEOF && yychar != YYEMPTY) + yydestruct ("Cleanup: discarding lookahead", + yytoken, &yylval); + /* Do not reclaim the symbols of the rule which action triggered + this YYABORT or YYACCEPT. */ + YYPOPSTACK (yylen); + YY_STACK_PRINT (yyss, yyssp); + while (yyssp != yyss) + { + yydestruct ("Cleanup: popping", + yystos[*yyssp], yyvsp); + YYPOPSTACK (1); + } #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss); #endif - return yyresult; +#if YYERROR_VERBOSE + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); +#endif + /* Make sure YYID is used. */ + return YYID (yyresult); } -#line 398 "printrcy.y" +#line 447 "printrcy.y" diff --git a/src/gutenprintui/printrcy.h b/src/gutenprintui/printrcy.h index afa662b..8a6c041 100644 --- a/src/gutenprintui/printrcy.h +++ b/src/gutenprintui/printrcy.h @@ -1,7 +1,9 @@ -/* A Bison parser, made by GNU Bison 1.875. */ +/* A Bison parser, made by GNU Bison 2.3. */ -/* Skeleton parser for Yacc-like parsing with Bison, - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc. +/* Skeleton interface for Bison's Yacc-like parsers in C + + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -15,13 +17,21 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ + Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ + +/* As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + special exception, which will cause the skeleton and the resulting + Bison output files to be licensed under the GNU General Public + License without this special exception. -/* As a special exception, when this file is copied by Bison into a - Bison output file, you may use that output file without restriction. - This special exception was added by the Free Software Foundation - in version 1.24 of Bison. */ + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. */ /* Tokens. */ #ifndef YYTOKENTYPE @@ -69,6 +79,7 @@ pCURVE = 295 }; #endif +/* Tokens. */ #define tINT 258 #define tDOUBLE 259 #define tDIMENSION 260 @@ -111,7 +122,7 @@ -#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef int YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 @@ -120,5 +131,3 @@ typedef int YYSTYPE; extern YYSTYPE yylval; - - diff --git a/src/gutenprintui/printrcy.y b/src/gutenprintui/printrcy.y index 99cfaeb..f2dd851 100644 --- a/src/gutenprintui/printrcy.y +++ b/src/gutenprintui/printrcy.y @@ -1,5 +1,5 @@ /* - * "$Id: printrcy.y,v 1.1 2004/09/17 18:38:14 rleigh Exp $" + * "$Id: printrcy.y,v 1.1.18.1 2007/03/02 12:01:19 rlk Exp $" * * Test pattern generator for Gutenprint * @@ -117,7 +117,7 @@ Destination: DESTINATION tSTRING Queue_Name: QUEUE_NAME tSTRING { - if ($2) + if (current_printer && $2) { stpui_plist_set_queue_name(current_printer, $2); g_free($2); @@ -127,7 +127,7 @@ Queue_Name: QUEUE_NAME tSTRING Output_Filename: OUTPUT_FILENAME tSTRING { - if ($2) + if (current_printer && $2) { stpui_plist_set_output_filename(current_printer, $2); g_free($2); @@ -137,7 +137,7 @@ Output_Filename: OUTPUT_FILENAME tSTRING Extra_Printer_Options: EXTRA_PRINTER_OPTIONS tSTRING { - if ($2) + if (current_printer && $2) { stpui_plist_set_extra_printer_options(current_printer, $2); g_free($2); @@ -147,7 +147,7 @@ Extra_Printer_Options: EXTRA_PRINTER_OPTIONS tSTRING Custom_Command: CUSTOM_COMMAND tSTRING { - if ($2) + if (current_printer && $2) { stpui_plist_set_custom_command(current_printer, $2); g_free($2); @@ -157,58 +157,86 @@ Custom_Command: CUSTOM_COMMAND tSTRING Command_Type: COMMAND_TYPE tINT { - stpui_plist_set_command_type(current_printer, $2); + if (current_printer) + stpui_plist_set_command_type(current_printer, $2); } ; Scaling: SCALING tDOUBLE - { current_printer->scaling = $2; } + { + if (current_printer) + current_printer->scaling = $2; + } ; Orientation: ORIENTATION tINT - { current_printer->orientation = $2; } + { + if (current_printer) + current_printer->orientation = $2; + } ; Autosize_Roll_Paper: AUTOSIZE_ROLL_PAPER tINT - { current_printer->auto_size_roll_feed_paper = $2; } + { + if (current_printer) + current_printer->auto_size_roll_feed_paper = $2; + } ; Unit: UNIT tINT - { current_printer->unit = $2; } + { + if (current_printer) + current_printer->unit = $2; + } ; Left: LEFT tINT - { stp_set_left(current_printer->v, $2); } + { + if (current_printer) + stp_set_left(current_printer->v, $2); + } ; Top: TOP tINT - { stp_set_top(current_printer->v, $2); } + { + if (current_printer) + stp_set_top(current_printer->v, $2); + } ; Output_Type: OUTPUT_TYPE tINT { - switch ($2) + if (current_printer) { - case 0: - stp_set_string_parameter - (current_printer->v, "PrintingMode", "BW"); - break; - case 1: - case 2: - default: - stp_set_string_parameter - (current_printer->v, "PrintingMode", "Color"); - break; + switch ($2) + { + case 0: + stp_set_string_parameter + (current_printer->v, "PrintingMode", "BW"); + break; + case 1: + case 2: + default: + stp_set_string_parameter + (current_printer->v, "PrintingMode", "Color"); + break; + } } } ; Custom_Page_Width: CUSTOM_PAGE_WIDTH tINT - { stp_set_page_width(current_printer->v, $2); } + { + if (current_printer) + stp_set_page_width(current_printer->v, $2); + } ; Custom_Page_Height: CUSTOM_PAGE_HEIGHT tINT - { stp_set_page_height(current_printer->v, $2); } + { + if (current_printer) + stp_set_page_height(current_printer->v, $2); + } ; Empty: @@ -216,13 +244,16 @@ Empty: Int_Param: tWORD pINT tBOOLEAN tINT { - stp_set_int_parameter(current_printer->v, $1, $4); - if (strcmp($3, "False") == 0) - stp_set_int_parameter_active(current_printer->v, $1, - STP_PARAMETER_INACTIVE); - else - stp_set_int_parameter_active(current_printer->v, $1, - STP_PARAMETER_ACTIVE); + if (current_printer) + { + stp_set_int_parameter(current_printer->v, $1, $4); + if (strcmp($3, "False") == 0) + stp_set_int_parameter_active(current_printer->v, $1, + STP_PARAMETER_INACTIVE); + else + stp_set_int_parameter_active(current_printer->v, $1, + STP_PARAMETER_ACTIVE); + } g_free($1); g_free($3); } @@ -230,13 +261,16 @@ Int_Param: tWORD pINT tBOOLEAN tINT String_List_Param: tWORD pSTRING_LIST tBOOLEAN tSTRING { - stp_set_string_parameter(current_printer->v, $1, $4); - if (strcmp($3, "False") == 0) - stp_set_string_parameter_active(current_printer->v, $1, - STP_PARAMETER_INACTIVE); - else - stp_set_string_parameter_active(current_printer->v, $1, - STP_PARAMETER_ACTIVE); + if (current_printer) + { + stp_set_string_parameter(current_printer->v, $1, $4); + if (strcmp($3, "False") == 0) + stp_set_string_parameter_active(current_printer->v, $1, + STP_PARAMETER_INACTIVE); + else + stp_set_string_parameter_active(current_printer->v, $1, + STP_PARAMETER_ACTIVE); + } g_free($1); g_free($3); g_free($4); @@ -245,13 +279,16 @@ String_List_Param: tWORD pSTRING_LIST tBOOLEAN tSTRING File_Param: tWORD pFILE tBOOLEAN tSTRING { - stp_set_file_parameter(current_printer->v, $1, $4); - if (strcmp($3, "False") == 0) - stp_set_file_parameter_active(current_printer->v, $1, - STP_PARAMETER_INACTIVE); - else - stp_set_file_parameter_active(current_printer->v, $1, - STP_PARAMETER_ACTIVE); + if (current_printer) + { + stp_set_file_parameter(current_printer->v, $1, $4); + if (strcmp($3, "False") == 0) + stp_set_file_parameter_active(current_printer->v, $1, + STP_PARAMETER_INACTIVE); + else + stp_set_file_parameter_active(current_printer->v, $1, + STP_PARAMETER_ACTIVE); + } g_free($1); g_free($3); g_free($4); @@ -260,13 +297,16 @@ File_Param: tWORD pFILE tBOOLEAN tSTRING Double_Param: tWORD pDOUBLE tBOOLEAN tDOUBLE { - stp_set_float_parameter(current_printer->v, $1, $4); - if (strcmp($3, "False") == 0) - stp_set_float_parameter_active(current_printer->v, $1, - STP_PARAMETER_INACTIVE); - else - stp_set_float_parameter_active(current_printer->v, $1, - STP_PARAMETER_ACTIVE); + if (current_printer) + { + stp_set_float_parameter(current_printer->v, $1, $4); + if (strcmp($3, "False") == 0) + stp_set_float_parameter_active(current_printer->v, $1, + STP_PARAMETER_INACTIVE); + else + stp_set_float_parameter_active(current_printer->v, $1, + STP_PARAMETER_ACTIVE); + } g_free($1); g_free($3); } @@ -274,13 +314,16 @@ Double_Param: tWORD pDOUBLE tBOOLEAN tDOUBLE Dimension_Param: tWORD pDIMENSION tBOOLEAN tINT { - stp_set_dimension_parameter(current_printer->v, $1, $4); - if (strcmp($3, "False") == 0) - stp_set_dimension_parameter_active(current_printer->v, $1, - STP_PARAMETER_INACTIVE); - else - stp_set_dimension_parameter_active(current_printer->v, $1, - STP_PARAMETER_ACTIVE); + if (current_printer) + { + stp_set_dimension_parameter(current_printer->v, $1, $4); + if (strcmp($3, "False") == 0) + stp_set_dimension_parameter_active(current_printer->v, $1, + STP_PARAMETER_INACTIVE); + else + stp_set_dimension_parameter_active(current_printer->v, $1, + STP_PARAMETER_ACTIVE); + } g_free($1); g_free($3); } @@ -288,16 +331,19 @@ Dimension_Param: tWORD pDIMENSION tBOOLEAN tINT Boolean_Param: tWORD pBOOLEAN tBOOLEAN tBOOLEAN { - if (strcmp($4, "False") == 0) - stp_set_boolean_parameter(current_printer->v, $1, 0); - else - stp_set_boolean_parameter(current_printer->v, $1, 1); - if (strcmp($3, "False") == 0) - stp_set_boolean_parameter_active(current_printer->v, $1, - STP_PARAMETER_INACTIVE); - else - stp_set_boolean_parameter_active(current_printer->v, $1, - STP_PARAMETER_ACTIVE); + if (current_printer) + { + if (strcmp($4, "False") == 0) + stp_set_boolean_parameter(current_printer->v, $1, 0); + else + stp_set_boolean_parameter(current_printer->v, $1, 1); + if (strcmp($3, "False") == 0) + stp_set_boolean_parameter_active(current_printer->v, $1, + STP_PARAMETER_INACTIVE); + else + stp_set_boolean_parameter_active(current_printer->v, $1, + STP_PARAMETER_ACTIVE); + } g_free($1); g_free($3); g_free($4); @@ -306,17 +352,20 @@ Boolean_Param: tWORD pBOOLEAN tBOOLEAN tBOOLEAN Curve_Param: tWORD pCURVE tBOOLEAN tSTRING { - stp_curve_t *curve = stp_curve_create_from_string($4); - if (curve) + if (current_printer) { - stp_set_curve_parameter(current_printer->v, $1, curve); - if (strcmp($3, "False") == 0) - stp_set_curve_parameter_active(current_printer->v, $1, - STP_PARAMETER_INACTIVE); - else - stp_set_curve_parameter_active(current_printer->v, $1, - STP_PARAMETER_ACTIVE); - stp_curve_destroy(curve); + stp_curve_t *curve = stp_curve_create_from_string($4); + if (curve) + { + stp_set_curve_parameter(current_printer->v, $1, curve); + if (strcmp($3, "False") == 0) + stp_set_curve_parameter_active(current_printer->v, $1, + STP_PARAMETER_INACTIVE); + else + stp_set_curve_parameter_active(current_printer->v, $1, + STP_PARAMETER_ACTIVE); + stp_curve_destroy(curve); + } } g_free($1); g_free($3); diff --git a/src/gutenprintui2/Makefile.in b/src/gutenprintui2/Makefile.in index 9226fe7..3500a8d 100644 --- a/src/gutenprintui2/Makefile.in +++ b/src/gutenprintui2/Makefile.in @@ -49,11 +49,12 @@ subdir = src/gutenprintui2 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ $(top_srcdir)/m4/gimp.m4 $(top_srcdir)/m4/iconv.m4 \ - $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ - $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/progtest.m4 \ - $(top_srcdir)/m4/stp.m4 $(top_srcdir)/m4/stp_cups.m4 \ - $(top_srcdir)/m4/stp_gimp.m4 $(top_srcdir)/m4/stp_option.m4 \ - $(top_srcdir)/m4/stp_release.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/isc-posix.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/stp.m4 \ + $(top_srcdir)/m4/stp_cups.m4 $(top_srcdir)/m4/stp_gimp.m4 \ + $(top_srcdir)/m4/stp_option.m4 $(top_srcdir)/m4/stp_release.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/scripts/mkinstalldirs @@ -81,8 +82,8 @@ libgutenprintui2_la_OBJECTS = $(am_libgutenprintui2_la_OBJECTS) @BUILD_LIBGUTENPRINTUI2_TRUE@am_libgutenprintui2_la_rpath = -rpath \ @BUILD_LIBGUTENPRINTUI2_TRUE@ $(libdir) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -depcomp = -am__depfiles_maybe = +depcomp = $(SHELL) $(top_srcdir)/scripts/depcomp +am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ @@ -105,13 +106,18 @@ CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ +BUILD_CUPS_1_2_FALSE = @BUILD_CUPS_1_2_FALSE@ +BUILD_CUPS_1_2_TRUE = @BUILD_CUPS_1_2_TRUE@ BUILD_CUPS_FALSE = @BUILD_CUPS_FALSE@ +BUILD_CUPS_PPDS = @BUILD_CUPS_PPDS@ BUILD_CUPS_PPDS_FALSE = @BUILD_CUPS_PPDS_FALSE@ BUILD_CUPS_PPDS_TRUE = @BUILD_CUPS_PPDS_TRUE@ BUILD_CUPS_TRUE = @BUILD_CUPS_TRUE@ @@ -137,6 +143,8 @@ BUILD_LIBGUTENPRINTUI_FALSE = @BUILD_LIBGUTENPRINTUI_FALSE@ BUILD_LIBGUTENPRINTUI_TRUE = @BUILD_LIBGUTENPRINTUI_TRUE@ BUILD_MODULES_FALSE = @BUILD_MODULES_FALSE@ BUILD_MODULES_TRUE = @BUILD_MODULES_TRUE@ +BUILD_SIMPLIFIED_CUPS_PPDS_FALSE = @BUILD_SIMPLIFIED_CUPS_PPDS_FALSE@ +BUILD_SIMPLIFIED_CUPS_PPDS_TRUE = @BUILD_SIMPLIFIED_CUPS_PPDS_TRUE@ BUILD_TESTPATTERN_FALSE = @BUILD_TESTPATTERN_FALSE@ BUILD_TESTPATTERN_TRUE = @BUILD_TESTPATTERN_TRUE@ BUILD_TEST_FALSE = @BUILD_TEST_FALSE@ @@ -144,6 +152,7 @@ BUILD_TEST_TRUE = @BUILD_TEST_TRUE@ BUILD_TRANSLATED_CUPS_PPDS_FALSE = @BUILD_TRANSLATED_CUPS_PPDS_FALSE@ BUILD_TRANSLATED_CUPS_PPDS_TRUE = @BUILD_TRANSLATED_CUPS_PPDS_TRUE@ CC = @CC@ +CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CONVERT = @CONVERT@ CPP = @CPP@ @@ -156,12 +165,14 @@ CUPS_PPDS_AT_TOP_LEVEL_TRUE = @CUPS_PPDS_AT_TOP_LEVEL_TRUE@ CUPS_PPD_PS_LEVEL = @CUPS_PPD_PS_LEVEL@ CXX = @CXX@ CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DB2HTML = @DB2HTML@ DB2PDF = @DB2PDF@ DB2PS = @DB2PS@ DEFS = @DEFS@ +DEPDIR = @DEPDIR@ DIALOG = @DIALOG@ DOXYGEN = @DOXYGEN@ DVIPDF = @DVIPDF@ @@ -196,6 +207,7 @@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GMSGFMT = @GMSGFMT@ GNUCFLAGS = @GNUCFLAGS@ +GREP = @GREP@ GTK2_CFLAGS = @GTK2_CFLAGS@ GTK2_LIBS = @GTK2_LIBS@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -291,14 +303,17 @@ VERSION = @VERSION@ WHICH_PPDS = @WHICH_PPDS@ XGETTEXT = @XGETTEXT@ YACC = @YACC@ -ac_ct_AR = @ac_ct_AR@ +YFLAGS = @YFLAGS@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ @@ -315,6 +330,9 @@ cups_exec_prefix = @cups_exec_prefix@ cups_prefix = @cups_prefix@ cups_sbindir = @cups_sbindir@ datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ exec_prefix = @exec_prefix@ gimp2_plug_indir = @gimp2_plug_indir@ gimp_plug_indir = @gimp_plug_indir@ @@ -332,17 +350,21 @@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ +htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ +localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ +psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ @@ -400,9 +422,9 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu --ignore-deps src/gutenprintui2/Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/gutenprintui2/Makefile'; \ cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu --ignore-deps src/gutenprintui2/Makefile + $(AUTOMAKE) --gnu src/gutenprintui2/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ @@ -463,41 +485,99 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgutenprintui2_la-curve.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgutenprintui2_la-gammacurve.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgutenprintui2_la-panel.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgutenprintui2_la-plist.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgutenprintui2_la-print-image-thumbnail.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgutenprintui2_la-printrcl.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgutenprintui2_la-printrcy.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgutenprintui2_la-typebuiltins.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgutenprintui2_la-ui-utils.Plo@am__quote@ + .c.o: - $(COMPILE) -c $< +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: - $(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: - $(LTCOMPILE) -c -o $@ $< +@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< libgutenprintui2_la-printrcy.lo: printrcy.c - $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgutenprintui2_la_CFLAGS) $(CFLAGS) -c -o libgutenprintui2_la-printrcy.lo `test -f 'printrcy.c' || echo '$(srcdir)/'`printrcy.c +@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgutenprintui2_la_CFLAGS) $(CFLAGS) -MT libgutenprintui2_la-printrcy.lo -MD -MP -MF "$(DEPDIR)/libgutenprintui2_la-printrcy.Tpo" -c -o libgutenprintui2_la-printrcy.lo `test -f 'printrcy.c' || echo '$(srcdir)/'`printrcy.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libgutenprintui2_la-printrcy.Tpo" "$(DEPDIR)/libgutenprintui2_la-printrcy.Plo"; else rm -f "$(DEPDIR)/libgutenprintui2_la-printrcy.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='printrcy.c' object='libgutenprintui2_la-printrcy.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgutenprintui2_la_CFLAGS) $(CFLAGS) -c -o libgutenprintui2_la-printrcy.lo `test -f 'printrcy.c' || echo '$(srcdir)/'`printrcy.c libgutenprintui2_la-printrcl.lo: printrcl.c - $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgutenprintui2_la_CFLAGS) $(CFLAGS) -c -o libgutenprintui2_la-printrcl.lo `test -f 'printrcl.c' || echo '$(srcdir)/'`printrcl.c +@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgutenprintui2_la_CFLAGS) $(CFLAGS) -MT libgutenprintui2_la-printrcl.lo -MD -MP -MF "$(DEPDIR)/libgutenprintui2_la-printrcl.Tpo" -c -o libgutenprintui2_la-printrcl.lo `test -f 'printrcl.c' || echo '$(srcdir)/'`printrcl.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libgutenprintui2_la-printrcl.Tpo" "$(DEPDIR)/libgutenprintui2_la-printrcl.Plo"; else rm -f "$(DEPDIR)/libgutenprintui2_la-printrcl.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='printrcl.c' object='libgutenprintui2_la-printrcl.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgutenprintui2_la_CFLAGS) $(CFLAGS) -c -o libgutenprintui2_la-printrcl.lo `test -f 'printrcl.c' || echo '$(srcdir)/'`printrcl.c libgutenprintui2_la-panel.lo: panel.c - $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgutenprintui2_la_CFLAGS) $(CFLAGS) -c -o libgutenprintui2_la-panel.lo `test -f 'panel.c' || echo '$(srcdir)/'`panel.c +@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgutenprintui2_la_CFLAGS) $(CFLAGS) -MT libgutenprintui2_la-panel.lo -MD -MP -MF "$(DEPDIR)/libgutenprintui2_la-panel.Tpo" -c -o libgutenprintui2_la-panel.lo `test -f 'panel.c' || echo '$(srcdir)/'`panel.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libgutenprintui2_la-panel.Tpo" "$(DEPDIR)/libgutenprintui2_la-panel.Plo"; else rm -f "$(DEPDIR)/libgutenprintui2_la-panel.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='panel.c' object='libgutenprintui2_la-panel.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgutenprintui2_la_CFLAGS) $(CFLAGS) -c -o libgutenprintui2_la-panel.lo `test -f 'panel.c' || echo '$(srcdir)/'`panel.c libgutenprintui2_la-plist.lo: plist.c - $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgutenprintui2_la_CFLAGS) $(CFLAGS) -c -o libgutenprintui2_la-plist.lo `test -f 'plist.c' || echo '$(srcdir)/'`plist.c +@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgutenprintui2_la_CFLAGS) $(CFLAGS) -MT libgutenprintui2_la-plist.lo -MD -MP -MF "$(DEPDIR)/libgutenprintui2_la-plist.Tpo" -c -o libgutenprintui2_la-plist.lo `test -f 'plist.c' || echo '$(srcdir)/'`plist.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libgutenprintui2_la-plist.Tpo" "$(DEPDIR)/libgutenprintui2_la-plist.Plo"; else rm -f "$(DEPDIR)/libgutenprintui2_la-plist.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='plist.c' object='libgutenprintui2_la-plist.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgutenprintui2_la_CFLAGS) $(CFLAGS) -c -o libgutenprintui2_la-plist.lo `test -f 'plist.c' || echo '$(srcdir)/'`plist.c libgutenprintui2_la-ui-utils.lo: ui-utils.c - $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgutenprintui2_la_CFLAGS) $(CFLAGS) -c -o libgutenprintui2_la-ui-utils.lo `test -f 'ui-utils.c' || echo '$(srcdir)/'`ui-utils.c +@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgutenprintui2_la_CFLAGS) $(CFLAGS) -MT libgutenprintui2_la-ui-utils.lo -MD -MP -MF "$(DEPDIR)/libgutenprintui2_la-ui-utils.Tpo" -c -o libgutenprintui2_la-ui-utils.lo `test -f 'ui-utils.c' || echo '$(srcdir)/'`ui-utils.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libgutenprintui2_la-ui-utils.Tpo" "$(DEPDIR)/libgutenprintui2_la-ui-utils.Plo"; else rm -f "$(DEPDIR)/libgutenprintui2_la-ui-utils.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ui-utils.c' object='libgutenprintui2_la-ui-utils.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgutenprintui2_la_CFLAGS) $(CFLAGS) -c -o libgutenprintui2_la-ui-utils.lo `test -f 'ui-utils.c' || echo '$(srcdir)/'`ui-utils.c libgutenprintui2_la-print-image-thumbnail.lo: print-image-thumbnail.c - $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgutenprintui2_la_CFLAGS) $(CFLAGS) -c -o libgutenprintui2_la-print-image-thumbnail.lo `test -f 'print-image-thumbnail.c' || echo '$(srcdir)/'`print-image-thumbnail.c +@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgutenprintui2_la_CFLAGS) $(CFLAGS) -MT libgutenprintui2_la-print-image-thumbnail.lo -MD -MP -MF "$(DEPDIR)/libgutenprintui2_la-print-image-thumbnail.Tpo" -c -o libgutenprintui2_la-print-image-thumbnail.lo `test -f 'print-image-thumbnail.c' || echo '$(srcdir)/'`print-image-thumbnail.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libgutenprintui2_la-print-image-thumbnail.Tpo" "$(DEPDIR)/libgutenprintui2_la-print-image-thumbnail.Plo"; else rm -f "$(DEPDIR)/libgutenprintui2_la-print-image-thumbnail.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='print-image-thumbnail.c' object='libgutenprintui2_la-print-image-thumbnail.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgutenprintui2_la_CFLAGS) $(CFLAGS) -c -o libgutenprintui2_la-print-image-thumbnail.lo `test -f 'print-image-thumbnail.c' || echo '$(srcdir)/'`print-image-thumbnail.c libgutenprintui2_la-curve.lo: curve.c - $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgutenprintui2_la_CFLAGS) $(CFLAGS) -c -o libgutenprintui2_la-curve.lo `test -f 'curve.c' || echo '$(srcdir)/'`curve.c +@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgutenprintui2_la_CFLAGS) $(CFLAGS) -MT libgutenprintui2_la-curve.lo -MD -MP -MF "$(DEPDIR)/libgutenprintui2_la-curve.Tpo" -c -o libgutenprintui2_la-curve.lo `test -f 'curve.c' || echo '$(srcdir)/'`curve.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libgutenprintui2_la-curve.Tpo" "$(DEPDIR)/libgutenprintui2_la-curve.Plo"; else rm -f "$(DEPDIR)/libgutenprintui2_la-curve.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='curve.c' object='libgutenprintui2_la-curve.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgutenprintui2_la_CFLAGS) $(CFLAGS) -c -o libgutenprintui2_la-curve.lo `test -f 'curve.c' || echo '$(srcdir)/'`curve.c libgutenprintui2_la-gammacurve.lo: gammacurve.c - $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgutenprintui2_la_CFLAGS) $(CFLAGS) -c -o libgutenprintui2_la-gammacurve.lo `test -f 'gammacurve.c' || echo '$(srcdir)/'`gammacurve.c +@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgutenprintui2_la_CFLAGS) $(CFLAGS) -MT libgutenprintui2_la-gammacurve.lo -MD -MP -MF "$(DEPDIR)/libgutenprintui2_la-gammacurve.Tpo" -c -o libgutenprintui2_la-gammacurve.lo `test -f 'gammacurve.c' || echo '$(srcdir)/'`gammacurve.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libgutenprintui2_la-gammacurve.Tpo" "$(DEPDIR)/libgutenprintui2_la-gammacurve.Plo"; else rm -f "$(DEPDIR)/libgutenprintui2_la-gammacurve.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gammacurve.c' object='libgutenprintui2_la-gammacurve.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgutenprintui2_la_CFLAGS) $(CFLAGS) -c -o libgutenprintui2_la-gammacurve.lo `test -f 'gammacurve.c' || echo '$(srcdir)/'`gammacurve.c libgutenprintui2_la-typebuiltins.lo: typebuiltins.c - $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgutenprintui2_la_CFLAGS) $(CFLAGS) -c -o libgutenprintui2_la-typebuiltins.lo `test -f 'typebuiltins.c' || echo '$(srcdir)/'`typebuiltins.c +@am__fastdepCC_TRUE@ if $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgutenprintui2_la_CFLAGS) $(CFLAGS) -MT libgutenprintui2_la-typebuiltins.lo -MD -MP -MF "$(DEPDIR)/libgutenprintui2_la-typebuiltins.Tpo" -c -o libgutenprintui2_la-typebuiltins.lo `test -f 'typebuiltins.c' || echo '$(srcdir)/'`typebuiltins.c; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/libgutenprintui2_la-typebuiltins.Tpo" "$(DEPDIR)/libgutenprintui2_la-typebuiltins.Plo"; else rm -f "$(DEPDIR)/libgutenprintui2_la-typebuiltins.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='typebuiltins.c' object='libgutenprintui2_la-typebuiltins.lo' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgutenprintui2_la_CFLAGS) $(CFLAGS) -c -o libgutenprintui2_la-typebuiltins.lo `test -f 'typebuiltins.c' || echo '$(srcdir)/'`typebuiltins.c .l.c: $(LEXCOMPILE) $< @@ -669,6 +749,7 @@ clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ mostlyclean-am distclean: distclean-am + -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags @@ -694,6 +775,7 @@ install-man: installcheck-am: maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic diff --git a/src/gutenprintui2/panel.c b/src/gutenprintui2/panel.c index d979ab7..cf4a06b 100644 --- a/src/gutenprintui2/panel.c +++ b/src/gutenprintui2/panel.c @@ -1,5 +1,5 @@ /* - * "$Id: panel.c,v 1.11 2006/05/28 16:59:04 rlk Exp $" + * "$Id: panel.c,v 1.11.8.2 2007/05/29 01:47:27 rlk Exp $" * * Main window code for Print plug-in for the GIMP. * @@ -120,6 +120,8 @@ static GtkWidget *ppd_box; static GtkWidget *ppd_label; /* PPD file entry */ static GtkWidget *ppd_button; /* PPD file browse button */ static GtkWidget *ppd_browser; /* File selection dialog for PPDs */ +static GtkWidget *ppd_model_label; /* PPD file entry */ +static GtkWidget *ppd_model; /* PPD file entry */ static GtkWidget *new_printer_dialog; /* New printer dialog window */ static GtkWidget *new_printer_entry; /* New printer text entry */ static GtkWidget *file_button; /* PPD file browse button */ @@ -192,6 +194,7 @@ static void combo_callback (GtkWidget *widget, gpointer data); static void output_type_callback (GtkWidget *widget, gpointer data); static void unit_callback (GtkWidget *widget, gpointer data); static void orientation_callback (GtkWidget *widget, gpointer data); +static void ppd_file_callback (GtkWidget *widget, gpointer data); static void printandsave_callback (void); static void about_callback (void); static void print_callback (void); @@ -1647,6 +1650,8 @@ create_printer_dialog (void) GTK_FILL, GTK_FILL, 0, 0); ppd_file = gtk_entry_new (); + g_signal_connect(G_OBJECT(ppd_file), "activate", + G_CALLBACK(ppd_file_callback), NULL); gtk_box_pack_start (GTK_BOX (ppd_box), ppd_file, TRUE, TRUE, 0); gtk_widget_show (ppd_file); @@ -1663,6 +1668,19 @@ create_printer_dialog (void) g_signal_connect (G_OBJECT (ppd_button), "clicked", G_CALLBACK (ppd_browse_callback), NULL); + ppd_model_label = gtk_label_new (_("Printer Model:")); + gtk_misc_set_alignment (GTK_MISC (ppd_model_label), 1.0, 0.5); + gtk_table_attach (GTK_TABLE (table), ppd_model_label, 1, 2, 4, 5, + GTK_FILL, GTK_FILL, 0, 0); + gtk_widget_show (ppd_model_label); + + ppd_model = gtk_label_new (""); + gtk_misc_set_alignment (GTK_MISC (ppd_model), 0.0, 0.5); + gtk_table_attach (GTK_TABLE (table), ppd_model, 2, 7, 4, 5, + GTK_FILL, GTK_FILL, 0, 0); + gtk_widget_show (ppd_model); + + /* * Print command. */ @@ -1670,11 +1688,11 @@ create_printer_dialog (void) group = NULL; for (i = 0; i < command_options_count; i++) group = stpui_create_radio_button(&(command_options[i]), group, table, - 0, i > 0 ? i + 5 : i + 4, + 0, i > 0 ? i + 6 : i + 5, G_CALLBACK(command_type_callback)); standard_cmd_entry = gtk_entry_new(); - gtk_table_attach (GTK_TABLE (table), standard_cmd_entry, 2, 7, 5, 6, + gtk_table_attach (GTK_TABLE (table), standard_cmd_entry, 2, 7, 6, 7, GTK_FILL, GTK_FILL, 0, 0); gtk_entry_set_editable(GTK_ENTRY(standard_cmd_entry), FALSE); gtk_widget_set_sensitive(standard_cmd_entry, FALSE); @@ -1692,13 +1710,13 @@ create_printer_dialog (void) "or model, of printer) that you wish to print to")); label = gtk_label_new(_("Printer Queue:")); gtk_widget_show(label); - gtk_table_attach (GTK_TABLE (table), label, 2, 3, 4, 5, + gtk_table_attach (GTK_TABLE (table), label, 2, 3, 5, 6, GTK_FILL, GTK_FILL, 0, 0); - gtk_table_attach (GTK_TABLE (table), event_box, 3, 7, 4, 5, + gtk_table_attach (GTK_TABLE (table), event_box, 3, 7, 5, 6, GTK_FILL, GTK_FILL, 0, 0); custom_command_entry = gtk_entry_new (); - gtk_table_attach (GTK_TABLE (table), custom_command_entry, 2, 7, 6, 7, + gtk_table_attach (GTK_TABLE (table), custom_command_entry, 2, 7, 7, 8, GTK_FILL, GTK_FILL, 0, 0); g_signal_connect(G_OBJECT(custom_command_entry), "activate", G_CALLBACK(setup_callback), NULL); @@ -1709,7 +1727,7 @@ create_printer_dialog (void) (custom_command_entry, _("Enter the correct command to print to your printer. ")); file_entry = gtk_entry_new (); - gtk_table_attach (GTK_TABLE (table), file_entry, 2, 6, 7, 8, + gtk_table_attach (GTK_TABLE (table), file_entry, 2, 6, 8, 9, GTK_FILL, GTK_FILL, 0, 0); g_signal_connect(G_OBJECT(file_entry), "activate", G_CALLBACK(setup_callback), NULL); @@ -1721,7 +1739,7 @@ create_printer_dialog (void) file_button = gtk_button_new_with_label (_("Browse")); - gtk_table_attach (GTK_TABLE (table), file_button, 6, 7, 7, 8, + gtk_table_attach (GTK_TABLE (table), file_button, 6, 7, 8, 9, GTK_FILL, GTK_FILL, 0, 0); gtk_widget_show (file_button); @@ -2623,9 +2641,10 @@ plist_build_combo (GtkWidget *combo, /* I - Combo widget */ gtk_combo_set_popdown_strings (GTK_COMBO (combo), list); - for (i = 0; i < num_items; i ++) - if (strcmp(stp_string_list_param(items, i)->name, cur_item) == 0) - break; + if (cur_item) + for (i = 0; i < num_items; i ++) + if (strcmp(stp_string_list_param(items, i)->name, cur_item) == 0) + break; if (i >= num_items && def_value) for (i = 0; i < num_items; i ++) @@ -3601,6 +3620,7 @@ setup_update (void) gint idx = 0; gint i; gchar *tmp; + stp_parameter_t desc; const char *ppd_file_name = stp_get_file_parameter(pv->v, "PPDFile"); for (i = 0; i < GTK_CLIST(manufacturer_clist)->rows; i++) @@ -3623,23 +3643,49 @@ setup_update (void) idx = 0; */ gtk_clist_select_row (GTK_CLIST (printer_driver), idx, 0); - gtk_label_set_text (GTK_LABEL (printer_model_label), - gettext (stp_printer_get_long_name (tmp_printer))); + stp_describe_parameter(pv->v, "ModelName", &desc); + if (desc.p_type == STP_PARAMETER_TYPE_STRING_LIST && desc.is_active && + desc.deflt.str) + { + const char *extra_printer_model = desc.deflt.str; + char *label_text = + g_malloc(strlen(gettext (stp_printer_get_long_name (tmp_printer))) + + 2 + /* " (" */ + strlen(extra_printer_model) + + 2); /* ")" + null terminator */ + strcpy(label_text, extra_printer_model); + strcat(label_text, " ("); + strcat(label_text, gettext (stp_printer_get_long_name (tmp_printer))); + strcat(label_text, ")"); + gtk_label_set_text (GTK_LABEL (printer_model_label), label_text); + g_free(label_text); + } + else + { + gtk_label_set_text (GTK_LABEL (printer_model_label), + gettext (stp_printer_get_long_name (tmp_printer))); + } + stp_parameter_description_destroy(&desc); if (ppd_file_name) gtk_entry_set_text (GTK_ENTRY (ppd_file), ppd_file_name); else gtk_entry_set_text (GTK_ENTRY (ppd_file), ""); + ppd_file_callback(ppd_file, NULL); if (stp_parameter_find_in_settings(pv->v, "PPDFile")) { gtk_widget_show (ppd_box); gtk_widget_show (ppd_label); + gtk_widget_show (ppd_model_label); + gtk_widget_show (ppd_model); } else { gtk_widget_hide (ppd_box); gtk_widget_hide (ppd_label); + gtk_widget_hide (ppd_model_label); + gtk_widget_hide (ppd_model); } gtk_entry_set_text (GTK_ENTRY (custom_command_entry), stpui_plist_get_custom_command (pv)); @@ -3656,6 +3702,27 @@ setup_update (void) TRUE); } +static void +ppd_file_callback(GtkWidget *widget, gpointer data) +{ + const gchar *name = gtk_entry_get_text(GTK_ENTRY(widget)); + if (name && pv && pv->v) + { + stp_parameter_t desc; + stp_vars_t *v = stp_vars_create_copy(pv->v); + stp_set_file_parameter(v, "PPDFile", name); + stp_describe_parameter(v, "ModelName", &desc); + if (desc.p_type == STP_PARAMETER_TYPE_STRING_LIST && desc.is_active) + gtk_label_set_text(GTK_LABEL(ppd_model), desc.deflt.str); + else + gtk_label_set_text(GTK_LABEL(ppd_model), ""); + stp_parameter_description_destroy(&desc); + stp_vars_destroy(v); + } + else + gtk_label_set_text(GTK_LABEL(ppd_model), ""); +} + /* * setup_open_callback() - */ @@ -3776,11 +3843,15 @@ pop_ppd_box(void) { gtk_widget_show (ppd_label); gtk_widget_show (ppd_box); + gtk_widget_show (ppd_model_label); + gtk_widget_show (ppd_model); } else { gtk_widget_hide (ppd_label); gtk_widget_hide (ppd_box); + gtk_widget_hide (ppd_model_label); + gtk_widget_hide (ppd_model); } } @@ -3884,6 +3955,8 @@ ppd_ok_callback (void) gtk_entry_set_text (GTK_ENTRY (ppd_file), gtk_file_selection_get_filename (GTK_FILE_SELECTION (ppd_browser))); + ppd_file_callback(ppd_file, NULL); + update_options(); } /* @@ -4903,12 +4976,13 @@ dimension_update (GtkAdjustment *adjustment) opt->info.flt.adjustment && adjustment == GTK_ADJUSTMENT(opt->info.flt.adjustment)) { + int new_value = (adjustment->value + (.5 / unit_scaler)) * unit_scaler; invalidate_preview_thumbnail (); if (stp_get_dimension_parameter(pv->v, opt->fast_desc->name) != - adjustment->value * unit_scaler) + new_value) { stp_set_dimension_parameter(pv->v, opt->fast_desc->name, - adjustment->value * unit_scaler); + new_value); update_adjusted_thumbnail(FALSE); } } diff --git a/src/gutenprintui2/plist.c b/src/gutenprintui2/plist.c index 05a13ee..96036a4 100644 --- a/src/gutenprintui2/plist.c +++ b/src/gutenprintui2/plist.c @@ -1,5 +1,5 @@ /* - * "$Id: plist.c,v 1.6 2005/10/26 01:28:35 rlk Exp $" + * "$Id: plist.c,v 1.6.10.3 2007/05/29 01:47:28 rlk Exp $" * * Print plug-in for the GIMP. * @@ -41,7 +41,6 @@ #include #include - typedef enum { PRINTERS_NONE, @@ -180,6 +179,7 @@ stpui_build_standard_print_command(const stpui_plist_t *plist, int raw = 0; char *print_cmd; char *count_string = NULL; + char *quoted_queue_name = NULL; if (!queue_name) queue_name = ""; identify_print_system(); @@ -192,15 +192,19 @@ stpui_build_standard_print_command(const stpui_plist_t *plist, stp_asprintf(&count_string, "%s %d ", global_printing_system->copy_count_command, copy_count); + if (queue_name[0]) + quoted_queue_name = g_shell_quote(queue_name); + stp_asprintf(&print_cmd, "%s %s %s %s %s%s%s", global_printing_system->print_command, queue_name[0] ? global_printing_system->queue_select : "", - queue_name[0] ? g_shell_quote(queue_name) : "", + queue_name[0] ? quoted_queue_name : "", count_string ? count_string : "", raw ? global_printing_system->raw_flag : "", extra_options ? " " : "", extra_options ? extra_options : ""); SAFE_FREE(count_string); + SAFE_FREE(quoted_queue_name); return print_cmd; } @@ -321,7 +325,7 @@ writefunc(void *file, const char *buf, size_t bytes) static void stpui_errfunc(void *file, const char *buf, size_t bytes) { - g_message(buf); + g_message("%s",buf); } void @@ -624,6 +628,8 @@ stpui_plist_add(const stpui_plist_t *key, int add_only) * always first in the list, else call psearch. */ stpui_plist_t *p; + if (!stp_get_printer(key->v)) + stp_set_driver(key->v, "ps2"); if (stp_get_printer(key->v)) { p = psearch(key, stpui_plist, stpui_plist_count, @@ -653,8 +659,13 @@ stpui_plist_add(const stpui_plist_t *key, int add_only) #endif stpui_plist_copy(p, key); } + return 1; + } + else + { + fprintf(stderr, "No printer found!\n"); + return 0; } - return 1; } static void @@ -796,8 +807,7 @@ stpui_printrc_load_v1(FILE *fp) #endif if (strcasecmp("current-printer", keyword) == 0) { - if (current_printer) - g_free (current_printer); + SAFE_FREE(current_printer); current_printer = g_strdup(value); } else if (strcasecmp("printer", keyword) == 0) @@ -930,11 +940,18 @@ stpui_printrc_load_v2(FILE *fp) { int retval; yyin = fp; + char *locale; stpui_printrc_current_printer = NULL; - setlocale(LC_ALL, "C"); +#ifdef HAVE_LOCALE_H + locale = g_strdup(setlocale(LC_NUMERIC, NULL)); + setlocale(LC_NUMERIC, "C"); +#endif retval = yyparse(); - setlocale(LC_ALL, ""); +#ifdef HAVE_LOCALE_H + setlocale(LC_NUMERIC, locale); + SAFE_FREE(locale); +#endif if (stpui_printrc_current_printer) { int i; @@ -976,17 +993,23 @@ stpui_printrc_load(void) (void) memset(line, 0, 1024); if (fgets(line, sizeof(line), fp) != NULL) { - /* Force locale to "C", so that numbers scan correctly */ - setlocale(LC_ALL, "C"); +#ifdef HAVE_LOCALE_H + char *locale = g_strdup(setlocale(LC_NUMERIC, NULL)); + setlocale(LC_NUMERIC, "C"); +#endif if (strncmp("#PRINTRCv", line, 9) == 0) { + /* Force locale to "C", so that numbers scan correctly */ #ifdef DEBUG fprintf(stderr, "Found printrc version tag: `%s'\n", line); fprintf(stderr, "Version number: `%s'\n", &(line[9])); #endif (void) sscanf(&(line[9]), "%d", &format); } - setlocale(LC_ALL, ""); +#ifdef HAVE_LOCALE_H + setlocale(LC_NUMERIC, locale); + SAFE_FREE(locale); +#endif } rewind(fp); switch (format) @@ -1029,7 +1052,10 @@ stpui_printrc_save(void) */ /* Force locale to "C", so that numbers print correctly */ - setlocale(LC_ALL, "C"); +#ifdef HAVE_LOCALE_H + char *locale = g_strdup(setlocale(LC_NUMERIC, NULL)); + setlocale(LC_NUMERIC, "C"); +#endif #ifdef DEBUG fprintf(stderr, "Number of printers: %d\n", stpui_plist_count); #endif @@ -1164,7 +1190,10 @@ stpui_printrc_save(void) fprintf(stderr, "Wrote printer %d: %s\n", i, p->name); #endif } - setlocale(LC_ALL, ""); +#ifdef HAVE_LOCALE_H + setlocale(LC_NUMERIC, locale); + SAFE_FREE(locale); +#endif fclose(fp); } else @@ -1202,6 +1231,8 @@ stpui_get_system_printers(void) identify_print_system(); if (global_printing_system) { + const char *old_locale = getenv("LC_ALL"); + (void) setenv("LC_ALL", "C", 1); if ((pfile = popen(global_printing_system->scan_command, "r")) != NULL) { /* @@ -1223,6 +1254,10 @@ stpui_get_system_printers(void) } } pclose(pfile); + if (old_locale) + setenv("LC_ALL", old_locale, 1); + else + unsetenv("LC_ALL"); } } } @@ -1751,5 +1786,5 @@ stpui_print(const stpui_plist_t *printer, stpui_image_t *image) } /* - * End of "$Id: plist.c,v 1.6 2005/10/26 01:28:35 rlk Exp $". + * End of "$Id: plist.c,v 1.6.10.3 2007/05/29 01:47:28 rlk Exp $". */ diff --git a/src/gutenprintui2/printrcy.c b/src/gutenprintui2/printrcy.c index 0c96062..178c7f5 100644 --- a/src/gutenprintui2/printrcy.c +++ b/src/gutenprintui2/printrcy.c @@ -1,7 +1,9 @@ -/* A Bison parser, made by GNU Bison 1.875. */ +/* A Bison parser, made by GNU Bison 2.3. */ -/* Skeleton parser for Yacc-like parsing with Bison, - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc. +/* Skeleton implementation for Bison's Yacc-like parsers in C + + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -15,16 +17,24 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ + Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ + +/* As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + special exception, which will cause the skeleton and the resulting + Bison output files to be licensed under the GNU General Public + License without this special exception. -/* As a special exception, when this file is copied by Bison into a - Bison output file, you may use that output file without restriction. - This special exception was added by the Free Software Foundation - in version 1.24 of Bison. */ + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. */ -/* Written by Richard Stallman by simplifying the original so called - ``semantic'' parser. */ +/* C LALR(1) parser skeleton written by Richard Stallman, by + simplifying the original so-called "semantic" parser. */ /* All symbols defined below should begin with yy or YY, to avoid infringing on user name space. This should be done even for local @@ -36,6 +46,9 @@ /* Identify Bison output. */ #define YYBISON 1 +/* Bison version. */ +#define YYBISON_VERSION "2.3" + /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -93,6 +106,7 @@ pCURVE = 295 }; #endif +/* Tokens. */ #define tINT 258 #define tDOUBLE 259 #define tDIMENSION 260 @@ -183,7 +197,12 @@ static stpui_plist_t *current_printer = NULL; # define YYERROR_VERBOSE 0 #endif -#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) +/* Enabling the token table. */ +#ifndef YYTOKEN_TABLE +# define YYTOKEN_TABLE 0 +#endif + +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef int YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 @@ -195,49 +214,171 @@ typedef int YYSTYPE; /* Copy the second part of user declarations. */ -/* Line 214 of yacc.c. */ -#line 199 "printrcy.c" +/* Line 216 of yacc.c. */ +#line 219 "printrcy.c" -#if ! defined (yyoverflow) || YYERROR_VERBOSE +#ifdef short +# undef short +#endif -/* The parser invokes alloca or malloc; define the necessary symbols. */ +#ifdef YYTYPE_UINT8 +typedef YYTYPE_UINT8 yytype_uint8; +#else +typedef unsigned char yytype_uint8; +#endif -# if YYSTACK_USE_ALLOCA -# define YYSTACK_ALLOC alloca +#ifdef YYTYPE_INT8 +typedef YYTYPE_INT8 yytype_int8; +#elif (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +typedef signed char yytype_int8; +#else +typedef short int yytype_int8; +#endif + +#ifdef YYTYPE_UINT16 +typedef YYTYPE_UINT16 yytype_uint16; +#else +typedef unsigned short int yytype_uint16; +#endif + +#ifdef YYTYPE_INT16 +typedef YYTYPE_INT16 yytype_int16; +#else +typedef short int yytype_int16; +#endif + +#ifndef YYSIZE_T +# ifdef __SIZE_TYPE__ +# define YYSIZE_T __SIZE_TYPE__ +# elif defined size_t +# define YYSIZE_T size_t +# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +# include /* INFRINGES ON USER NAME SPACE */ +# define YYSIZE_T size_t # else -# ifndef YYSTACK_USE_ALLOCA -# if defined (alloca) || defined (_ALLOCA_H) -# define YYSTACK_ALLOC alloca +# define YYSIZE_T unsigned int +# endif +#endif + +#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) + +#ifndef YY_ +# if YYENABLE_NLS +# if ENABLE_NLS +# include /* INFRINGES ON USER NAME SPACE */ +# define YY_(msgid) dgettext ("bison-runtime", msgid) +# endif +# endif +# ifndef YY_ +# define YY_(msgid) msgid +# endif +#endif + +/* Suppress unused-variable warnings by "using" E. */ +#if ! defined lint || defined __GNUC__ +# define YYUSE(e) ((void) (e)) +#else +# define YYUSE(e) /* empty */ +#endif + +/* Identity function, used to suppress warnings about constant conditions. */ +#ifndef lint +# define YYID(n) (n) +#else +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static int +YYID (int i) +#else +static int +YYID (i) + int i; +#endif +{ + return i; +} +#endif + +#if ! defined yyoverflow || YYERROR_VERBOSE + +/* The parser invokes alloca or malloc; define the necessary symbols. */ + +# ifdef YYSTACK_USE_ALLOCA +# if YYSTACK_USE_ALLOCA +# ifdef __GNUC__ +# define YYSTACK_ALLOC __builtin_alloca +# elif defined __BUILTIN_VA_ARG_INCR +# include /* INFRINGES ON USER NAME SPACE */ +# elif defined _AIX +# define YYSTACK_ALLOC __alloca +# elif defined _MSC_VER +# include /* INFRINGES ON USER NAME SPACE */ +# define alloca _alloca # else -# ifdef __GNUC__ -# define YYSTACK_ALLOC __builtin_alloca +# define YYSTACK_ALLOC alloca +# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +# include /* INFRINGES ON USER NAME SPACE */ +# ifndef _STDLIB_H +# define _STDLIB_H 1 +# endif # endif # endif # endif # endif # ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) + /* Pacify GCC's `empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) +# ifndef YYSTACK_ALLOC_MAXIMUM + /* The OS might guarantee only one guard page at the bottom of the stack, + and a page size can be as small as 4096 bytes. So we cannot safely + invoke alloca (N) if N exceeds 4096. Use a slightly smaller number + to allow for a few compiler-allocated temporary stack slots. */ +# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ +# endif # else -# if defined (__STDC__) || defined (__cplusplus) +# define YYSTACK_ALLOC YYMALLOC +# define YYSTACK_FREE YYFREE +# ifndef YYSTACK_ALLOC_MAXIMUM +# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM +# endif +# if (defined __cplusplus && ! defined _STDLIB_H \ + && ! ((defined YYMALLOC || defined malloc) \ + && (defined YYFREE || defined free))) # include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t +# ifndef _STDLIB_H +# define _STDLIB_H 1 +# endif +# endif +# ifndef YYMALLOC +# define YYMALLOC malloc +# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# ifndef YYFREE +# define YYFREE free +# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +void free (void *); /* INFRINGES ON USER NAME SPACE */ +# endif # endif -# define YYSTACK_ALLOC malloc -# define YYSTACK_FREE free # endif -#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ +#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ -#if (! defined (yyoverflow) \ - && (! defined (__cplusplus) \ - || (YYSTYPE_IS_TRIVIAL))) +#if (! defined yyoverflow \ + && (! defined __cplusplus \ + || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc { - short yyss; + yytype_int16 yyss; YYSTYPE yyvs; }; @@ -247,24 +388,24 @@ union yyalloc /* The size of an array large to enough to hold all stacks, each with N elements. */ # define YYSTACK_BYTES(N) \ - ((N) * (sizeof (short) + sizeof (YYSTYPE)) \ + ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ + YYSTACK_GAP_MAXIMUM) /* Copy COUNT objects from FROM to TO. The source and destination do not overlap. */ # ifndef YYCOPY -# if 1 < __GNUC__ +# if defined __GNUC__ && 1 < __GNUC__ # define YYCOPY(To, From, Count) \ __builtin_memcpy (To, From, (Count) * sizeof (*(From))) # else # define YYCOPY(To, From, Count) \ do \ { \ - register YYSIZE_T yyi; \ + YYSIZE_T yyi; \ for (yyi = 0; yyi < (Count); yyi++) \ (To)[yyi] = (From)[yyi]; \ } \ - while (0) + while (YYID (0)) # endif # endif @@ -282,39 +423,33 @@ union yyalloc yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ - while (0) + while (YYID (0)) #endif -#if defined (__STDC__) || defined (__cplusplus) - typedef signed char yysigned_char; -#else - typedef short yysigned_char; -#endif - -/* YYFINAL -- State number of the termination state. */ +/* YYFINAL -- State number of the termination state. */ #define YYFINAL 10 /* YYLAST -- Last index in YYTABLE. */ #define YYLAST 75 -/* YYNTOKENS -- Number of terminals. */ +/* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 41 -/* YYNNTS -- Number of nonterminals. */ +/* YYNNTS -- Number of nonterminals. */ #define YYNNTS 42 -/* YYNRULES -- Number of rules. */ +/* YYNRULES -- Number of rules. */ #define YYNRULES 70 -/* YYNRULES -- Number of states. */ +/* YYNRULES -- Number of states. */ #define YYNSTATES 114 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 #define YYMAXUTOK 295 -#define YYTRANSLATE(YYX) \ +#define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ -static const unsigned char yytranslate[] = +static const yytype_uint8 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -351,7 +486,7 @@ static const unsigned char yytranslate[] = #if YYDEBUG /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in YYRHS. */ -static const unsigned char yyprhs[] = +static const yytype_uint8 yyprhs[] = { 0, 0, 3, 7, 10, 13, 16, 19, 22, 25, 28, 31, 34, 37, 40, 43, 46, 49, 52, 53, @@ -363,8 +498,8 @@ static const unsigned char yyprhs[] = 189 }; -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const yysigned_char yyrhs[] = +/* YYRHS -- A `-1'-separated list of the rules' RHS. */ +static const yytype_int8 yyrhs[] = { 82, 0, -1, 12, 7, 7, -1, 13, 7, -1, 26, 7, -1, 27, 7, -1, 28, 7, -1, 29, @@ -389,50 +524,50 @@ static const yysigned_char yyrhs[] = }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ -static const unsigned short yyrline[] = +static const yytype_uint16 yyrline[] = { - 0, 100, 100, 111, 118, 128, 138, 148, 158, 164, - 168, 172, 176, 180, 184, 188, 206, 210, 214, 217, - 231, 246, 261, 275, 289, 307, 327, 327, 327, 327, - 328, 328, 328, 331, 334, 334, 337, 337, 337, 337, - 338, 338, 338, 338, 338, 339, 339, 339, 339, 340, - 340, 343, 343, 346, 349, 349, 352, 356, 366, 366, - 369, 372, 383, 383, 386, 386, 389, 392, 392, 392, - 395 + 0, 100, 100, 111, 118, 128, 138, 148, 158, 165, + 172, 179, 186, 193, 200, 207, 228, 235, 242, 245, + 262, 280, 298, 315, 332, 353, 376, 376, 376, 376, + 377, 377, 377, 380, 383, 383, 386, 386, 386, 386, + 387, 387, 387, 387, 387, 388, 388, 388, 388, 389, + 389, 392, 392, 395, 398, 398, 401, 405, 415, 415, + 418, 421, 432, 432, 435, 435, 438, 441, 441, 441, + 444 }; #endif -#if YYDEBUG || YYERROR_VERBOSE -/* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at YYNTOKENS, nonterminals. */ +#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE +/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. + First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { - "$end", "error", "$undefined", "tINT", "tDOUBLE", "tDIMENSION", - "tBOOLEAN", "tSTRING", "tWORD", "tGSWORD", "CURRENT_PRINTER", - "SHOW_ALL_PAPER_SIZES", "PRINTER", "DESTINATION", "SCALING", - "ORIENTATION", "AUTOSIZE_ROLL_PAPER", "UNIT", "DRIVER", "LEFT", "TOP", - "CUSTOM_PAGE_WIDTH", "CUSTOM_PAGE_HEIGHT", "OUTPUT_TYPE", "PRINTRC_HDR", - "PARAMETER", "QUEUE_NAME", "OUTPUT_FILENAME", "EXTRA_PRINTER_OPTIONS", - "CUSTOM_COMMAND", "COMMAND_TYPE", "GLOBAL_SETTINGS", "GLOBAL", - "END_GLOBAL_SETTINGS", "pINT", "pSTRING_LIST", "pFILE", "pDOUBLE", - "pDIMENSION", "pBOOLEAN", "pCURVE", "$accept", "Printer", "Destination", - "Queue_Name", "Output_Filename", "Extra_Printer_Options", - "Custom_Command", "Command_Type", "Scaling", "Orientation", - "Autosize_Roll_Paper", "Unit", "Left", "Top", "Output_Type", - "Custom_Page_Width", "Custom_Page_Height", "Empty", "Int_Param", - "String_List_Param", "File_Param", "Double_Param", "Dimension_Param", - "Boolean_Param", "Curve_Param", "Typed_Param", "Parameter", - "Parameters", "Standard_Value", "Standard_Values", "A_Printer", - "Printers", "Current_Printer", "Show_All_Paper_Sizes", "Global", - "Old_Globals", "New_Global_Setting", "Global_Setting", - "Global_Settings", "Global_Subblock", "Global_Block", "Thing", 0 + "$end", "error", "$undefined", "tINT", "tDOUBLE", "tDIMENSION", + "tBOOLEAN", "tSTRING", "tWORD", "tGSWORD", "CURRENT_PRINTER", + "SHOW_ALL_PAPER_SIZES", "PRINTER", "DESTINATION", "SCALING", + "ORIENTATION", "AUTOSIZE_ROLL_PAPER", "UNIT", "DRIVER", "LEFT", "TOP", + "CUSTOM_PAGE_WIDTH", "CUSTOM_PAGE_HEIGHT", "OUTPUT_TYPE", "PRINTRC_HDR", + "PARAMETER", "QUEUE_NAME", "OUTPUT_FILENAME", "EXTRA_PRINTER_OPTIONS", + "CUSTOM_COMMAND", "COMMAND_TYPE", "GLOBAL_SETTINGS", "GLOBAL", + "END_GLOBAL_SETTINGS", "pINT", "pSTRING_LIST", "pFILE", "pDOUBLE", + "pDIMENSION", "pBOOLEAN", "pCURVE", "$accept", "Printer", "Destination", + "Queue_Name", "Output_Filename", "Extra_Printer_Options", + "Custom_Command", "Command_Type", "Scaling", "Orientation", + "Autosize_Roll_Paper", "Unit", "Left", "Top", "Output_Type", + "Custom_Page_Width", "Custom_Page_Height", "Empty", "Int_Param", + "String_List_Param", "File_Param", "Double_Param", "Dimension_Param", + "Boolean_Param", "Curve_Param", "Typed_Param", "Parameter", "Parameters", + "Standard_Value", "Standard_Values", "A_Printer", "Printers", + "Current_Printer", "Show_All_Paper_Sizes", "Global", "Old_Globals", + "New_Global_Setting", "Global_Setting", "Global_Settings", + "Global_Subblock", "Global_Block", "Thing", 0 }; #endif # ifdef YYPRINT /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to token YYLEX-NUM. */ -static const unsigned short yytoknum[] = +static const yytype_uint16 yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, @@ -443,7 +578,7 @@ static const unsigned short yytoknum[] = # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const unsigned char yyr1[] = +static const yytype_uint8 yyr1[] = { 0, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, @@ -456,7 +591,7 @@ static const unsigned char yyr1[] = }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const unsigned char yyr2[] = +static const yytype_uint8 yyr2[] = { 0, 2, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 0, 4, @@ -471,7 +606,7 @@ static const unsigned char yyr2[] = /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state STATE-NUM when YYTABLE doesn't specify something else to do. Zero means the default is an error. */ -static const unsigned char yydefact[] = +static const yytype_uint8 yydefact[] = { 0, 18, 0, 0, 18, 69, 0, 68, 67, 18, 1, 56, 65, 0, 0, 60, 55, 70, 0, 66, @@ -487,8 +622,8 @@ static const unsigned char yydefact[] = 22, 23, 24, 25 }; -/* YYDEFGOTO[NTERM-NUM]. */ -static const yysigned_char yydefgoto[] = +/* YYDEFGOTO[NTERM-NUM]. */ +static const yytype_int8 yydefgoto[] = { -1, 27, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 5, 85, 86, @@ -500,7 +635,7 @@ static const yysigned_char yydefgoto[] = /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ #define YYPACT_NINF -26 -static const yysigned_char yypact[] = +static const yytype_int8 yypact[] = { -22, -2, 6, 0, -26, -26, 5, -26, -26, -26, -26, -26, -26, -7, 11, -26, -26, 7, 13, -26, @@ -517,7 +652,7 @@ static const yysigned_char yypact[] = }; /* YYPGOTO[NTERM-NUM]. */ -static const yysigned_char yypgoto[] = +static const yytype_int8 yypgoto[] = { -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -26, -4, -26, -26, @@ -531,7 +666,7 @@ static const yysigned_char yypgoto[] = number is the opposite. If zero, do what YYDEFACT says. If YYTABLE_NINF, syntax error. */ #define YYTABLE_NINF -1 -static const unsigned char yytable[] = +static const yytype_uint8 yytable[] = { 12, 18, 1, 3, 14, 16, 10, 11, 3, 93, 94, 95, 96, 97, 98, 99, 14, 25, 84, 26, @@ -543,7 +678,7 @@ static const unsigned char yytable[] = 108, 109, 110, 111, 113, 112 }; -static const yysigned_char yycheck[] = +static const yytype_int8 yycheck[] = { 4, 8, 24, 10, 11, 9, 0, 7, 10, 34, 35, 36, 37, 38, 39, 40, 11, 6, 8, 12, @@ -557,7 +692,7 @@ static const yysigned_char yycheck[] = /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ -static const unsigned char yystos[] = +static const yytype_uint8 yystos[] = { 0, 24, 82, 10, 31, 58, 73, 76, 80, 81, 0, 7, 58, 79, 11, 74, 58, 72, 8, 33, @@ -573,22 +708,6 @@ static const unsigned char yystos[] = 4, 3, 6, 7 }; -#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) -# define YYSIZE_T __SIZE_TYPE__ -#endif -#if ! defined (YYSIZE_T) && defined (size_t) -# define YYSIZE_T size_t -#endif -#if ! defined (YYSIZE_T) -# if defined (__STDC__) || defined (__cplusplus) -# include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -# endif -#endif -#if ! defined (YYSIZE_T) -# define YYSIZE_T unsigned int -#endif - #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) #define YYEMPTY (-2) @@ -596,7 +715,8 @@ static const unsigned char yystos[] = #define YYACCEPT goto yyacceptlab #define YYABORT goto yyabortlab -#define YYERROR goto yyerrlab1 +#define YYERROR goto yyerrorlab + /* Like YYERROR except do call yyerror. This remains here temporarily to ease the transition to the new meaning of YYERROR, for GCC. @@ -613,30 +733,63 @@ do \ yychar = (Token); \ yylval = (Value); \ yytoken = YYTRANSLATE (yychar); \ - YYPOPSTACK; \ + YYPOPSTACK (1); \ goto yybackup; \ } \ else \ - { \ - yyerror ("syntax error: cannot back up");\ + { \ + yyerror (YY_("syntax error: cannot back up")); \ YYERROR; \ } \ -while (0) +while (YYID (0)) + #define YYTERROR 1 #define YYERRCODE 256 -/* YYLLOC_DEFAULT -- Compute the default location (before the actions - are run). */ +/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. + If N is 0, then set CURRENT to the empty location which ends + the previous symbol: RHS[0] (always defined). */ + +#define YYRHSLOC(Rhs, K) ((Rhs)[K]) #ifndef YYLLOC_DEFAULT -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - Current.first_line = Rhs[1].first_line; \ - Current.first_column = Rhs[1].first_column; \ - Current.last_line = Rhs[N].last_line; \ - Current.last_column = Rhs[N].last_column; +# define YYLLOC_DEFAULT(Current, Rhs, N) \ + do \ + if (YYID (N)) \ + { \ + (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ + (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ + (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ + (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ + } \ + else \ + { \ + (Current).first_line = (Current).last_line = \ + YYRHSLOC (Rhs, 0).last_line; \ + (Current).first_column = (Current).last_column = \ + YYRHSLOC (Rhs, 0).last_column; \ + } \ + while (YYID (0)) #endif + +/* YY_LOCATION_PRINT -- Print the location on the stream. + This macro was not mandated originally: define only if we know + we won't break user code: when these are the locations we know. */ + +#ifndef YY_LOCATION_PRINT +# if YYLTYPE_IS_TRIVIAL +# define YY_LOCATION_PRINT(File, Loc) \ + fprintf (File, "%d.%d-%d.%d", \ + (Loc).first_line, (Loc).first_column, \ + (Loc).last_line, (Loc).last_column) +# else +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) +# endif +#endif + + /* YYLEX -- calling `yylex' with the right arguments. */ #ifdef YYLEX_PARAM @@ -657,42 +810,96 @@ while (0) do { \ if (yydebug) \ YYFPRINTF Args; \ -} while (0) +} while (YYID (0)) -# define YYDSYMPRINT(Args) \ -do { \ - if (yydebug) \ - yysymprint Args; \ -} while (0) +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yy_symbol_print (stderr, \ + Type, Value); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (YYID (0)) -# define YYDSYMPRINTF(Title, Token, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yysymprint (stderr, \ - Token, Value); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (0) + +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ + +/*ARGSUSED*/ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +#else +static void +yy_symbol_value_print (yyoutput, yytype, yyvaluep) + FILE *yyoutput; + int yytype; + YYSTYPE const * const yyvaluep; +#endif +{ + if (!yyvaluep) + return; +# ifdef YYPRINT + if (yytype < YYNTOKENS) + YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); +# else + YYUSE (yyoutput); +# endif + switch (yytype) + { + default: + break; + } +} + + +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ + +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +#else +static void +yy_symbol_print (yyoutput, yytype, yyvaluep) + FILE *yyoutput; + int yytype; + YYSTYPE const * const yyvaluep; +#endif +{ + if (yytype < YYNTOKENS) + YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); + else + YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); + + yy_symbol_value_print (yyoutput, yytype, yyvaluep); + YYFPRINTF (yyoutput, ")"); +} /*------------------------------------------------------------------. | yy_stack_print -- Print the state stack from its BOTTOM up to its | -| TOP (cinluded). | +| TOP (included). | `------------------------------------------------------------------*/ -#if defined (__STDC__) || defined (__cplusplus) +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) static void -yy_stack_print (short *bottom, short *top) +yy_stack_print (yytype_int16 *bottom, yytype_int16 *top) #else static void yy_stack_print (bottom, top) - short *bottom; - short *top; + yytype_int16 *bottom; + yytype_int16 *top; #endif { YYFPRINTF (stderr, "Stack now"); - for (/* Nothing. */; bottom <= top; ++bottom) + for (; bottom <= top; ++bottom) YYFPRINTF (stderr, " %d", *bottom); YYFPRINTF (stderr, "\n"); } @@ -701,45 +908,52 @@ yy_stack_print (bottom, top) do { \ if (yydebug) \ yy_stack_print ((Bottom), (Top)); \ -} while (0) +} while (YYID (0)) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ -#if defined (__STDC__) || defined (__cplusplus) +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) static void -yy_reduce_print (int yyrule) +yy_reduce_print (YYSTYPE *yyvsp, int yyrule) #else static void -yy_reduce_print (yyrule) +yy_reduce_print (yyvsp, yyrule) + YYSTYPE *yyvsp; int yyrule; #endif { + int yynrhs = yyr2[yyrule]; int yyi; - unsigned int yylineno = yyrline[yyrule]; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ", - yyrule - 1, yylineno); - /* Print the symbols being reduced, and their result. */ - for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++) - YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]); - YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]); + unsigned long int yylno = yyrline[yyrule]; + YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", + yyrule - 1, yylno); + /* The symbols being reduced. */ + for (yyi = 0; yyi < yynrhs; yyi++) + { + fprintf (stderr, " $%d = ", yyi + 1); + yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], + &(yyvsp[(yyi + 1) - (yynrhs)]) + ); + fprintf (stderr, "\n"); + } } # define YY_REDUCE_PRINT(Rule) \ do { \ if (yydebug) \ - yy_reduce_print (Rule); \ -} while (0) + yy_reduce_print (yyvsp, Rule); \ +} while (YYID (0)) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ int yydebug; #else /* !YYDEBUG */ # define YYDPRINTF(Args) -# define YYDSYMPRINT(Args) -# define YYDSYMPRINTF(Title, Token, Value, Location) +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) # define YY_STACK_PRINT(Bottom, Top) # define YY_REDUCE_PRINT(Rule) #endif /* !YYDEBUG */ @@ -754,13 +968,9 @@ int yydebug; if the built-in stack extension method is used). Do not make this value too large; the results are undefined if - SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH) + YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) evaluated with infinite-precision integer arithmetic. */ -#if YYMAXDEPTH == 0 -# undef YYMAXDEPTH -#endif - #ifndef YYMAXDEPTH # define YYMAXDEPTH 10000 #endif @@ -770,45 +980,47 @@ int yydebug; #if YYERROR_VERBOSE # ifndef yystrlen -# if defined (__GLIBC__) && defined (_STRING_H) +# if defined __GLIBC__ && defined _STRING_H # define yystrlen strlen # else /* Return the length of YYSTR. */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) static YYSIZE_T -# if defined (__STDC__) || defined (__cplusplus) yystrlen (const char *yystr) -# else +#else +static YYSIZE_T yystrlen (yystr) - const char *yystr; -# endif + const char *yystr; +#endif { - register const char *yys = yystr; - - while (*yys++ != '\0') + YYSIZE_T yylen; + for (yylen = 0; yystr[yylen]; yylen++) continue; - - return yys - yystr - 1; + return yylen; } # endif # endif # ifndef yystpcpy -# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE) +# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE # define yystpcpy stpcpy # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) static char * -# if defined (__STDC__) || defined (__cplusplus) yystpcpy (char *yydest, const char *yysrc) -# else +#else +static char * yystpcpy (yydest, yysrc) - char *yydest; - const char *yysrc; -# endif + char *yydest; + const char *yysrc; +#endif { - register char *yyd = yydest; - register const char *yys = yysrc; + char *yyd = yydest; + const char *yys = yysrc; while ((*yyd++ = *yys++) != '\0') continue; @@ -818,70 +1030,192 @@ yystpcpy (yydest, yysrc) # endif # endif -#endif /* !YYERROR_VERBOSE */ +# ifndef yytnamerr +/* Copy to YYRES the contents of YYSTR after stripping away unnecessary + quotes and backslashes, so that it's suitable for yyerror. The + heuristic is that double-quoting is unnecessary unless the string + contains an apostrophe, a comma, or backslash (other than + backslash-backslash). YYSTR is taken from yytname. If YYRES is + null, do not copy; instead, return the length of what the result + would have been. */ +static YYSIZE_T +yytnamerr (char *yyres, const char *yystr) +{ + if (*yystr == '"') + { + YYSIZE_T yyn = 0; + char const *yyp = yystr; + + for (;;) + switch (*++yyp) + { + case '\'': + case ',': + goto do_not_strip_quotes; + + case '\\': + if (*++yyp != '\\') + goto do_not_strip_quotes; + /* Fall through. */ + default: + if (yyres) + yyres[yyn] = *yyp; + yyn++; + break; + + case '"': + if (yyres) + yyres[yyn] = '\0'; + return yyn; + } + do_not_strip_quotes: ; + } - + if (! yyres) + return yystrlen (yystr); -#if YYDEBUG -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ + return yystpcpy (yyres, yystr) - yyres; +} +# endif -#if defined (__STDC__) || defined (__cplusplus) -static void -yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep) -#else -static void -yysymprint (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE *yyvaluep; -#endif +/* Copy into YYRESULT an error message about the unexpected token + YYCHAR while in state YYSTATE. Return the number of bytes copied, + including the terminating null byte. If YYRESULT is null, do not + copy anything; just return the number of bytes that would be + copied. As a special case, return 0 if an ordinary "syntax error" + message will do. Return YYSIZE_MAXIMUM if overflow occurs during + size calculation. */ +static YYSIZE_T +yysyntax_error (char *yyresult, int yystate, int yychar) { - /* Pacify ``unused variable'' warnings. */ - (void) yyvaluep; + int yyn = yypact[yystate]; - if (yytype < YYNTOKENS) - { - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); -# ifdef YYPRINT - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# endif - } + if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) + return 0; else - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); - - switch (yytype) { - default: - break; + int yytype = YYTRANSLATE (yychar); + YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); + YYSIZE_T yysize = yysize0; + YYSIZE_T yysize1; + int yysize_overflow = 0; + enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; + char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; + int yyx; + +# if 0 + /* This is so xgettext sees the translatable formats that are + constructed on the fly. */ + YY_("syntax error, unexpected %s"); + YY_("syntax error, unexpected %s, expecting %s"); + YY_("syntax error, unexpected %s, expecting %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); +# endif + char *yyfmt; + char const *yyf; + static char const yyunexpected[] = "syntax error, unexpected %s"; + static char const yyexpecting[] = ", expecting %s"; + static char const yyor[] = " or %s"; + char yyformat[sizeof yyunexpected + + sizeof yyexpecting - 1 + + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) + * (sizeof yyor - 1))]; + char const *yyprefix = yyexpecting; + + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + + /* Stay within bounds of both yycheck and yytname. */ + int yychecklim = YYLAST - yyn + 1; + int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + int yycount = 1; + + yyarg[0] = yytname[yytype]; + yyfmt = yystpcpy (yyformat, yyunexpected); + + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) + { + if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) + { + yycount = 1; + yysize = yysize0; + yyformat[sizeof yyunexpected - 1] = '\0'; + break; + } + yyarg[yycount++] = yytname[yyx]; + yysize1 = yysize + yytnamerr (0, yytname[yyx]); + yysize_overflow |= (yysize1 < yysize); + yysize = yysize1; + yyfmt = yystpcpy (yyfmt, yyprefix); + yyprefix = yyor; + } + + yyf = YY_(yyformat); + yysize1 = yysize + yystrlen (yyf); + yysize_overflow |= (yysize1 < yysize); + yysize = yysize1; + + if (yysize_overflow) + return YYSIZE_MAXIMUM; + + if (yyresult) + { + /* Avoid sprintf, as that infringes on the user's name space. + Don't have undefined behavior even if the translation + produced a string with the wrong number of "%s"s. */ + char *yyp = yyresult; + int yyi = 0; + while ((*yyp = *yyf) != '\0') + { + if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) + { + yyp += yytnamerr (yyp, yyarg[yyi++]); + yyf += 2; + } + else + { + yyp++; + yyf++; + } + } + } + return yysize; } - YYFPRINTF (yyoutput, ")"); } +#endif /* YYERROR_VERBOSE */ + -#endif /* ! YYDEBUG */ /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ -#if defined (__STDC__) || defined (__cplusplus) +/*ARGSUSED*/ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) static void -yydestruct (int yytype, YYSTYPE *yyvaluep) +yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) #else static void -yydestruct (yytype, yyvaluep) +yydestruct (yymsg, yytype, yyvaluep) + const char *yymsg; int yytype; YYSTYPE *yyvaluep; #endif { - /* Pacify ``unused variable'' warnings. */ - (void) yyvaluep; + YYUSE (yyvaluep); + + if (!yymsg) + yymsg = "Deleting"; + YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); switch (yytype) { default: - break; + break; } } @@ -889,13 +1223,13 @@ yydestruct (yytype, yyvaluep) /* Prevent warnings from -Wmissing-prototypes. */ #ifdef YYPARSE_PARAM -# if defined (__STDC__) || defined (__cplusplus) +#if defined __STDC__ || defined __cplusplus int yyparse (void *YYPARSE_PARAM); -# else +#else int yyparse (); -# endif +#endif #else /* ! YYPARSE_PARAM */ -#if defined (__STDC__) || defined (__cplusplus) +#if defined __STDC__ || defined __cplusplus int yyparse (void); #else int yyparse (); @@ -904,10 +1238,10 @@ int yyparse (); -/* The lookahead symbol. */ +/* The look-ahead symbol. */ int yychar; -/* The semantic value of the lookahead symbol. */ +/* The semantic value of the look-ahead symbol. */ YYSTYPE yylval; /* Number of syntax errors so far. */ @@ -920,14 +1254,18 @@ int yynerrs; `----------*/ #ifdef YYPARSE_PARAM -# if defined (__STDC__) || defined (__cplusplus) -int yyparse (void *YYPARSE_PARAM) -# else -int yyparse (YYPARSE_PARAM) - void *YYPARSE_PARAM; -# endif +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +int +yyparse (void *YYPARSE_PARAM) +#else +int +yyparse (YYPARSE_PARAM) + void *YYPARSE_PARAM; +#endif #else /* ! YYPARSE_PARAM */ -#if defined (__STDC__) || defined (__cplusplus) +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) int yyparse (void) #else @@ -938,13 +1276,19 @@ yyparse () #endif { - register int yystate; - register int yyn; + int yystate; + int yyn; int yyresult; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus; - /* Lookahead token as an internal (translated) token number. */ + /* Look-ahead token as an internal (translated) token number. */ int yytoken = 0; +#if YYERROR_VERBOSE + /* Buffer for error messages, and its allocated size. */ + char yymsgbuf[128]; + char *yymsg = yymsgbuf; + YYSIZE_T yymsg_alloc = sizeof yymsgbuf; +#endif /* Three stacks and their tools: `yyss': related to states, @@ -955,18 +1299,18 @@ yyparse () to reallocate them elsewhere. */ /* The state stack. */ - short yyssa[YYINITDEPTH]; - short *yyss = yyssa; - register short *yyssp; + yytype_int16 yyssa[YYINITDEPTH]; + yytype_int16 *yyss = yyssa; + yytype_int16 *yyssp; /* The semantic value stack. */ YYSTYPE yyvsa[YYINITDEPTH]; YYSTYPE *yyvs = yyvsa; - register YYSTYPE *yyvsp; + YYSTYPE *yyvsp; -#define YYPOPSTACK (yyvsp--, yyssp--) +#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) YYSIZE_T yystacksize = YYINITDEPTH; @@ -975,9 +1319,9 @@ yyparse () YYSTYPE yyval; - /* When reducing, the number of symbols on the RHS of the reduced - rule. */ - int yylen; + /* The number of symbols on the RHS of the reduced rule. + Keep to zero when no symbol should be popped. */ + int yylen = 0; YYDPRINTF ((stderr, "Starting parse\n")); @@ -1001,8 +1345,7 @@ yyparse () `------------------------------------------------------------*/ yynewstate: /* In all cases, when you get here, the value and location stacks - have just been pushed. so pushing a state here evens the stacks. - */ + have just been pushed. So pushing a state here evens the stacks. */ yyssp++; yysetstate: @@ -1015,18 +1358,18 @@ yyparse () #ifdef yyoverflow { - /* Give user a chance to reallocate the stack. Use copies of + /* Give user a chance to reallocate the stack. Use copies of these so that the &'s don't force the real ones into memory. */ YYSTYPE *yyvs1 = yyvs; - short *yyss1 = yyss; + yytype_int16 *yyss1 = yyss; /* Each stack pointer address is followed by the size of the data in use in that stack, in bytes. This used to be a conditional around just the two extra args, but that might be undefined if yyoverflow is a macro. */ - yyoverflow ("parser stack overflow", + yyoverflow (YY_("memory exhausted"), &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), @@ -1037,21 +1380,21 @@ yyparse () } #else /* no yyoverflow */ # ifndef YYSTACK_RELOCATE - goto yyoverflowlab; + goto yyexhaustedlab; # else /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) - goto yyoverflowlab; + goto yyexhaustedlab; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; { - short *yyss1 = yyss; + yytype_int16 *yyss1 = yyss; union yyalloc *yyptr = (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) - goto yyoverflowlab; + goto yyexhaustedlab; YYSTACK_RELOCATE (yyss); YYSTACK_RELOCATE (yyvs); @@ -1082,19 +1425,17 @@ yyparse () `-----------*/ yybackup: -/* Do appropriate processing given the current state. */ -/* Read a lookahead token if we need one and don't already have one. */ -/* yyresume: */ - - /* First try to decide what to do without reference to lookahead token. */ + /* Do appropriate processing given the current state. Read a + look-ahead token if we need one and don't already have one. */ + /* First try to decide what to do without reference to look-ahead token. */ yyn = yypact[yystate]; if (yyn == YYPACT_NINF) goto yydefault; - /* Not known => get a lookahead token if don't already have one. */ + /* Not known => get a look-ahead token if don't already have one. */ - /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ + /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); @@ -1109,7 +1450,7 @@ yybackup: else { yytoken = YYTRANSLATE (yychar); - YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc); + YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); } /* If the proper action on seeing token YYTOKEN is to reduce or to @@ -1129,22 +1470,21 @@ yybackup: if (yyn == YYFINAL) YYACCEPT; - /* Shift the lookahead token. */ - YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken])); - - /* Discard the token being shifted unless it is eof. */ - if (yychar != YYEOF) - yychar = YYEMPTY; - - *++yyvsp = yylval; - - /* Count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus) yyerrstatus--; + /* Shift the look-ahead token. */ + YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); + + /* Discard the shifted token unless it is eof. */ + if (yychar != YYEOF) + yychar = YYEMPTY; + yystate = yyn; + *++yyvsp = yylval; + goto yynewstate; @@ -1182,27 +1522,27 @@ yyreduce: case 2: #line 101 "printrcy.y" { - current_printer = stpui_plist_create(yyvsp[-1].sval, yyvsp[0].sval); - g_free(yyvsp[-1].sval); - g_free(yyvsp[0].sval); + current_printer = stpui_plist_create((yyvsp[(2) - (3)].sval), (yyvsp[(3) - (3)].sval)); + g_free((yyvsp[(2) - (3)].sval)); + g_free((yyvsp[(3) - (3)].sval)); } break; case 3: #line 112 "printrcy.y" { - if (yyvsp[0].sval) - g_free(yyvsp[0].sval); + if ((yyvsp[(2) - (2)].sval)) + g_free((yyvsp[(2) - (2)].sval)); } break; case 4: #line 119 "printrcy.y" { - if (yyvsp[0].sval) + if (current_printer && (yyvsp[(2) - (2)].sval)) { - stpui_plist_set_queue_name(current_printer, yyvsp[0].sval); - g_free(yyvsp[0].sval); + stpui_plist_set_queue_name(current_printer, (yyvsp[(2) - (2)].sval)); + g_free((yyvsp[(2) - (2)].sval)); } } break; @@ -1210,10 +1550,10 @@ yyreduce: case 5: #line 129 "printrcy.y" { - if (yyvsp[0].sval) + if (current_printer && (yyvsp[(2) - (2)].sval)) { - stpui_plist_set_output_filename(current_printer, yyvsp[0].sval); - g_free(yyvsp[0].sval); + stpui_plist_set_output_filename(current_printer, (yyvsp[(2) - (2)].sval)); + g_free((yyvsp[(2) - (2)].sval)); } } break; @@ -1221,10 +1561,10 @@ yyreduce: case 6: #line 139 "printrcy.y" { - if (yyvsp[0].sval) + if (current_printer && (yyvsp[(2) - (2)].sval)) { - stpui_plist_set_extra_printer_options(current_printer, yyvsp[0].sval); - g_free(yyvsp[0].sval); + stpui_plist_set_extra_printer_options(current_printer, (yyvsp[(2) - (2)].sval)); + g_free((yyvsp[(2) - (2)].sval)); } } break; @@ -1232,10 +1572,10 @@ yyreduce: case 7: #line 149 "printrcy.y" { - if (yyvsp[0].sval) + if (current_printer && (yyvsp[(2) - (2)].sval)) { - stpui_plist_set_custom_command(current_printer, yyvsp[0].sval); - g_free(yyvsp[0].sval); + stpui_plist_set_custom_command(current_printer, (yyvsp[(2) - (2)].sval)); + g_free((yyvsp[(2) - (2)].sval)); } } break; @@ -1243,224 +1583,272 @@ yyreduce: case 8: #line 159 "printrcy.y" { - stpui_plist_set_command_type(current_printer, yyvsp[0].ival); + if (current_printer) + stpui_plist_set_command_type(current_printer, (yyvsp[(2) - (2)].ival)); } break; case 9: -#line 165 "printrcy.y" - { current_printer->scaling = yyvsp[0].dval; } +#line 166 "printrcy.y" + { + if (current_printer) + current_printer->scaling = (yyvsp[(2) - (2)].dval); + } break; case 10: -#line 169 "printrcy.y" - { current_printer->orientation = yyvsp[0].ival; } +#line 173 "printrcy.y" + { + if (current_printer) + current_printer->orientation = (yyvsp[(2) - (2)].ival); + } break; case 11: -#line 173 "printrcy.y" - { current_printer->auto_size_roll_feed_paper = yyvsp[0].ival; } +#line 180 "printrcy.y" + { + if (current_printer) + current_printer->auto_size_roll_feed_paper = (yyvsp[(2) - (2)].ival); + } break; case 12: -#line 177 "printrcy.y" - { current_printer->unit = yyvsp[0].ival; } +#line 187 "printrcy.y" + { + if (current_printer) + current_printer->unit = (yyvsp[(2) - (2)].ival); + } break; case 13: -#line 181 "printrcy.y" - { stp_set_left(current_printer->v, yyvsp[0].ival); } +#line 194 "printrcy.y" + { + if (current_printer) + stp_set_left(current_printer->v, (yyvsp[(2) - (2)].ival)); + } break; case 14: -#line 185 "printrcy.y" - { stp_set_top(current_printer->v, yyvsp[0].ival); } +#line 201 "printrcy.y" + { + if (current_printer) + stp_set_top(current_printer->v, (yyvsp[(2) - (2)].ival)); + } break; case 15: -#line 189 "printrcy.y" +#line 208 "printrcy.y" { - switch (yyvsp[0].ival) + if (current_printer) { - case 0: - stp_set_string_parameter - (current_printer->v, "PrintingMode", "BW"); - break; - case 1: - case 2: - default: - stp_set_string_parameter - (current_printer->v, "PrintingMode", "Color"); - break; + switch ((yyvsp[(2) - (2)].ival)) + { + case 0: + stp_set_string_parameter + (current_printer->v, "PrintingMode", "BW"); + break; + case 1: + case 2: + default: + stp_set_string_parameter + (current_printer->v, "PrintingMode", "Color"); + break; + } } } break; case 16: -#line 207 "printrcy.y" - { stp_set_page_width(current_printer->v, yyvsp[0].ival); } +#line 229 "printrcy.y" + { + if (current_printer) + stp_set_page_width(current_printer->v, (yyvsp[(2) - (2)].ival)); + } break; case 17: -#line 211 "printrcy.y" - { stp_set_page_height(current_printer->v, yyvsp[0].ival); } +#line 236 "printrcy.y" + { + if (current_printer) + stp_set_page_height(current_printer->v, (yyvsp[(2) - (2)].ival)); + } break; case 19: -#line 218 "printrcy.y" +#line 246 "printrcy.y" { - stp_set_int_parameter(current_printer->v, yyvsp[-3].sval, yyvsp[0].ival); - if (strcmp(yyvsp[-1].sval, "False") == 0) - stp_set_int_parameter_active(current_printer->v, yyvsp[-3].sval, - STP_PARAMETER_INACTIVE); - else - stp_set_int_parameter_active(current_printer->v, yyvsp[-3].sval, - STP_PARAMETER_ACTIVE); - g_free(yyvsp[-3].sval); - g_free(yyvsp[-1].sval); + if (current_printer) + { + stp_set_int_parameter(current_printer->v, (yyvsp[(1) - (4)].sval), (yyvsp[(4) - (4)].ival)); + if (strcmp((yyvsp[(3) - (4)].sval), "False") == 0) + stp_set_int_parameter_active(current_printer->v, (yyvsp[(1) - (4)].sval), + STP_PARAMETER_INACTIVE); + else + stp_set_int_parameter_active(current_printer->v, (yyvsp[(1) - (4)].sval), + STP_PARAMETER_ACTIVE); + } + g_free((yyvsp[(1) - (4)].sval)); + g_free((yyvsp[(3) - (4)].sval)); } break; case 20: -#line 232 "printrcy.y" +#line 263 "printrcy.y" { - stp_set_string_parameter(current_printer->v, yyvsp[-3].sval, yyvsp[0].sval); - if (strcmp(yyvsp[-1].sval, "False") == 0) - stp_set_string_parameter_active(current_printer->v, yyvsp[-3].sval, - STP_PARAMETER_INACTIVE); - else - stp_set_string_parameter_active(current_printer->v, yyvsp[-3].sval, - STP_PARAMETER_ACTIVE); - g_free(yyvsp[-3].sval); - g_free(yyvsp[-1].sval); - g_free(yyvsp[0].sval); + if (current_printer) + { + stp_set_string_parameter(current_printer->v, (yyvsp[(1) - (4)].sval), (yyvsp[(4) - (4)].sval)); + if (strcmp((yyvsp[(3) - (4)].sval), "False") == 0) + stp_set_string_parameter_active(current_printer->v, (yyvsp[(1) - (4)].sval), + STP_PARAMETER_INACTIVE); + else + stp_set_string_parameter_active(current_printer->v, (yyvsp[(1) - (4)].sval), + STP_PARAMETER_ACTIVE); + } + g_free((yyvsp[(1) - (4)].sval)); + g_free((yyvsp[(3) - (4)].sval)); + g_free((yyvsp[(4) - (4)].sval)); } break; case 21: -#line 247 "printrcy.y" +#line 281 "printrcy.y" { - stp_set_file_parameter(current_printer->v, yyvsp[-3].sval, yyvsp[0].sval); - if (strcmp(yyvsp[-1].sval, "False") == 0) - stp_set_file_parameter_active(current_printer->v, yyvsp[-3].sval, - STP_PARAMETER_INACTIVE); - else - stp_set_file_parameter_active(current_printer->v, yyvsp[-3].sval, - STP_PARAMETER_ACTIVE); - g_free(yyvsp[-3].sval); - g_free(yyvsp[-1].sval); - g_free(yyvsp[0].sval); + if (current_printer) + { + stp_set_file_parameter(current_printer->v, (yyvsp[(1) - (4)].sval), (yyvsp[(4) - (4)].sval)); + if (strcmp((yyvsp[(3) - (4)].sval), "False") == 0) + stp_set_file_parameter_active(current_printer->v, (yyvsp[(1) - (4)].sval), + STP_PARAMETER_INACTIVE); + else + stp_set_file_parameter_active(current_printer->v, (yyvsp[(1) - (4)].sval), + STP_PARAMETER_ACTIVE); + } + g_free((yyvsp[(1) - (4)].sval)); + g_free((yyvsp[(3) - (4)].sval)); + g_free((yyvsp[(4) - (4)].sval)); } break; case 22: -#line 262 "printrcy.y" +#line 299 "printrcy.y" { - stp_set_float_parameter(current_printer->v, yyvsp[-3].sval, yyvsp[0].dval); - if (strcmp(yyvsp[-1].sval, "False") == 0) - stp_set_float_parameter_active(current_printer->v, yyvsp[-3].sval, - STP_PARAMETER_INACTIVE); - else - stp_set_float_parameter_active(current_printer->v, yyvsp[-3].sval, - STP_PARAMETER_ACTIVE); - g_free(yyvsp[-3].sval); - g_free(yyvsp[-1].sval); + if (current_printer) + { + stp_set_float_parameter(current_printer->v, (yyvsp[(1) - (4)].sval), (yyvsp[(4) - (4)].dval)); + if (strcmp((yyvsp[(3) - (4)].sval), "False") == 0) + stp_set_float_parameter_active(current_printer->v, (yyvsp[(1) - (4)].sval), + STP_PARAMETER_INACTIVE); + else + stp_set_float_parameter_active(current_printer->v, (yyvsp[(1) - (4)].sval), + STP_PARAMETER_ACTIVE); + } + g_free((yyvsp[(1) - (4)].sval)); + g_free((yyvsp[(3) - (4)].sval)); } break; case 23: -#line 276 "printrcy.y" +#line 316 "printrcy.y" { - stp_set_dimension_parameter(current_printer->v, yyvsp[-3].sval, yyvsp[0].ival); - if (strcmp(yyvsp[-1].sval, "False") == 0) - stp_set_dimension_parameter_active(current_printer->v, yyvsp[-3].sval, - STP_PARAMETER_INACTIVE); - else - stp_set_dimension_parameter_active(current_printer->v, yyvsp[-3].sval, - STP_PARAMETER_ACTIVE); - g_free(yyvsp[-3].sval); - g_free(yyvsp[-1].sval); + if (current_printer) + { + stp_set_dimension_parameter(current_printer->v, (yyvsp[(1) - (4)].sval), (yyvsp[(4) - (4)].ival)); + if (strcmp((yyvsp[(3) - (4)].sval), "False") == 0) + stp_set_dimension_parameter_active(current_printer->v, (yyvsp[(1) - (4)].sval), + STP_PARAMETER_INACTIVE); + else + stp_set_dimension_parameter_active(current_printer->v, (yyvsp[(1) - (4)].sval), + STP_PARAMETER_ACTIVE); + } + g_free((yyvsp[(1) - (4)].sval)); + g_free((yyvsp[(3) - (4)].sval)); } break; case 24: -#line 290 "printrcy.y" +#line 333 "printrcy.y" { - if (strcmp(yyvsp[0].sval, "False") == 0) - stp_set_boolean_parameter(current_printer->v, yyvsp[-3].sval, 0); - else - stp_set_boolean_parameter(current_printer->v, yyvsp[-3].sval, 1); - if (strcmp(yyvsp[-1].sval, "False") == 0) - stp_set_boolean_parameter_active(current_printer->v, yyvsp[-3].sval, - STP_PARAMETER_INACTIVE); - else - stp_set_boolean_parameter_active(current_printer->v, yyvsp[-3].sval, - STP_PARAMETER_ACTIVE); - g_free(yyvsp[-3].sval); - g_free(yyvsp[-1].sval); - g_free(yyvsp[0].sval); + if (current_printer) + { + if (strcmp((yyvsp[(4) - (4)].sval), "False") == 0) + stp_set_boolean_parameter(current_printer->v, (yyvsp[(1) - (4)].sval), 0); + else + stp_set_boolean_parameter(current_printer->v, (yyvsp[(1) - (4)].sval), 1); + if (strcmp((yyvsp[(3) - (4)].sval), "False") == 0) + stp_set_boolean_parameter_active(current_printer->v, (yyvsp[(1) - (4)].sval), + STP_PARAMETER_INACTIVE); + else + stp_set_boolean_parameter_active(current_printer->v, (yyvsp[(1) - (4)].sval), + STP_PARAMETER_ACTIVE); + } + g_free((yyvsp[(1) - (4)].sval)); + g_free((yyvsp[(3) - (4)].sval)); + g_free((yyvsp[(4) - (4)].sval)); } break; case 25: -#line 308 "printrcy.y" +#line 354 "printrcy.y" { - stp_curve_t *curve = stp_curve_create_from_string(yyvsp[0].sval); - if (curve) + if (current_printer) { - stp_set_curve_parameter(current_printer->v, yyvsp[-3].sval, curve); - if (strcmp(yyvsp[-1].sval, "False") == 0) - stp_set_curve_parameter_active(current_printer->v, yyvsp[-3].sval, - STP_PARAMETER_INACTIVE); - else - stp_set_curve_parameter_active(current_printer->v, yyvsp[-3].sval, - STP_PARAMETER_ACTIVE); - stp_curve_destroy(curve); + stp_curve_t *curve = stp_curve_create_from_string((yyvsp[(4) - (4)].sval)); + if (curve) + { + stp_set_curve_parameter(current_printer->v, (yyvsp[(1) - (4)].sval), curve); + if (strcmp((yyvsp[(3) - (4)].sval), "False") == 0) + stp_set_curve_parameter_active(current_printer->v, (yyvsp[(1) - (4)].sval), + STP_PARAMETER_INACTIVE); + else + stp_set_curve_parameter_active(current_printer->v, (yyvsp[(1) - (4)].sval), + STP_PARAMETER_ACTIVE); + stp_curve_destroy(curve); + } } - g_free(yyvsp[-3].sval); - g_free(yyvsp[-1].sval); - g_free(yyvsp[0].sval); + g_free((yyvsp[(1) - (4)].sval)); + g_free((yyvsp[(3) - (4)].sval)); + g_free((yyvsp[(4) - (4)].sval)); } break; case 56: -#line 353 "printrcy.y" - { stpui_printrc_current_printer = yyvsp[0].sval; } +#line 402 "printrcy.y" + { stpui_printrc_current_printer = (yyvsp[(2) - (2)].sval); } break; case 57: -#line 357 "printrcy.y" +#line 406 "printrcy.y" { - if (strcmp(yyvsp[0].sval, "True") == 0) + if (strcmp((yyvsp[(2) - (2)].sval), "True") == 0) stpui_show_all_paper_sizes = 1; else stpui_show_all_paper_sizes = 0; - g_free(yyvsp[0].sval); + g_free((yyvsp[(2) - (2)].sval)); } break; case 61: -#line 373 "printrcy.y" +#line 422 "printrcy.y" { - if (yyvsp[0].sval) + if ((yyvsp[(2) - (2)].sval)) { - stpui_set_global_parameter(yyvsp[-1].sval, yyvsp[0].sval); - g_free(yyvsp[0].sval); + stpui_set_global_parameter((yyvsp[(1) - (2)].sval), (yyvsp[(2) - (2)].sval)); + g_free((yyvsp[(2) - (2)].sval)); } - g_free(yyvsp[-1].sval); + g_free((yyvsp[(1) - (2)].sval)); } break; +/* Line 1267 of yacc.c. */ +#line 1846 "printrcy.c" + default: break; } + YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); -/* Line 991 of yacc.c. */ -#line 1458 "printrcy.c" - - yyvsp -= yylen; - yyssp -= yylen; - - + YYPOPSTACK (yylen); + yylen = 0; YY_STACK_PRINT (yyss, yyssp); *++yyvsp = yyval; @@ -1489,109 +1877,93 @@ yyerrlab: if (!yyerrstatus) { ++yynerrs; -#if YYERROR_VERBOSE - yyn = yypact[yystate]; - - if (YYPACT_NINF < yyn && yyn < YYLAST) - { - YYSIZE_T yysize = 0; - int yytype = YYTRANSLATE (yychar); - char *yymsg; - int yyx, yycount; - - yycount = 0; - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. */ - for (yyx = yyn < 0 ? -yyn : 0; - yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) - yysize += yystrlen (yytname[yyx]) + 15, yycount++; - yysize += yystrlen ("syntax error, unexpected ") + 1; - yysize += yystrlen (yytname[yytype]); - yymsg = (char *) YYSTACK_ALLOC (yysize); - if (yymsg != 0) - { - char *yyp = yystpcpy (yymsg, "syntax error, unexpected "); - yyp = yystpcpy (yyp, yytname[yytype]); - - if (yycount < 5) - { - yycount = 0; - for (yyx = yyn < 0 ? -yyn : 0; - yyx < (int) (sizeof (yytname) / sizeof (char *)); - yyx++) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) - { - const char *yyq = ! yycount ? ", expecting " : " or "; - yyp = yystpcpy (yyp, yyq); - yyp = yystpcpy (yyp, yytname[yyx]); - yycount++; - } - } - yyerror (yymsg); +#if ! YYERROR_VERBOSE + yyerror (YY_("syntax error")); +#else + { + YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); + if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) + { + YYSIZE_T yyalloc = 2 * yysize; + if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) + yyalloc = YYSTACK_ALLOC_MAXIMUM; + if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); - } - else - yyerror ("syntax error; also virtual memory exhausted"); - } - else -#endif /* YYERROR_VERBOSE */ - yyerror ("syntax error"); + yymsg = (char *) YYSTACK_ALLOC (yyalloc); + if (yymsg) + yymsg_alloc = yyalloc; + else + { + yymsg = yymsgbuf; + yymsg_alloc = sizeof yymsgbuf; + } + } + + if (0 < yysize && yysize <= yymsg_alloc) + { + (void) yysyntax_error (yymsg, yystate, yychar); + yyerror (yymsg); + } + else + { + yyerror (YY_("syntax error")); + if (yysize != 0) + goto yyexhaustedlab; + } + } +#endif } if (yyerrstatus == 3) { - /* If just tried and failed to reuse lookahead token after an + /* If just tried and failed to reuse look-ahead token after an error, discard it. */ - /* Return failure if at end of input. */ - if (yychar == YYEOF) - { - /* Pop the error token. */ - YYPOPSTACK; - /* Pop the rest of the stack. */ - while (yyss < yyssp) - { - YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); - yydestruct (yystos[*yyssp], yyvsp); - YYPOPSTACK; - } - YYABORT; - } - - YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc); - yydestruct (yytoken, &yylval); - yychar = YYEMPTY; - + if (yychar <= YYEOF) + { + /* Return failure if at end of input. */ + if (yychar == YYEOF) + YYABORT; + } + else + { + yydestruct ("Error: discarding", + yytoken, &yylval); + yychar = YYEMPTY; + } } - /* Else will try to reuse lookahead token after shifting the error + /* Else will try to reuse look-ahead token after shifting the error token. */ - goto yyerrlab2; + goto yyerrlab1; -/*----------------------------------------------------. -| yyerrlab1 -- error raised explicitly by an action. | -`----------------------------------------------------*/ -yyerrlab1: - - /* Suppress GCC warning that yyerrlab1 is unused when no action - invokes YYERROR. */ -#if defined (__GNUC_MINOR__) && 2093 <= (__GNUC__ * 1000 + __GNUC_MINOR__) \ - && !defined __cplusplus - __attribute__ ((__unused__)) -#endif +/*---------------------------------------------------. +| yyerrorlab -- error raised explicitly by YYERROR. | +`---------------------------------------------------*/ +yyerrorlab: + /* Pacify compilers like GCC when the user code never invokes + YYERROR and the label yyerrorlab therefore never appears in user + code. */ + if (/*CONSTCOND*/ 0) + goto yyerrorlab; - goto yyerrlab2; + /* Do not reclaim the symbols of the rule which action triggered + this YYERROR. */ + YYPOPSTACK (yylen); + yylen = 0; + YY_STACK_PRINT (yyss, yyssp); + yystate = *yyssp; + goto yyerrlab1; -/*---------------------------------------------------------------. -| yyerrlab2 -- pop states until the error token can be shifted. | -`---------------------------------------------------------------*/ -yyerrlab2: +/*-------------------------------------------------------------. +| yyerrlab1 -- common code for both syntax error and YYERROR. | +`-------------------------------------------------------------*/ +yyerrlab1: yyerrstatus = 3; /* Each real token shifted decrements this. */ for (;;) @@ -1612,22 +1984,23 @@ yyerrlab2: if (yyssp == yyss) YYABORT; - YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); - yydestruct (yystos[yystate], yyvsp); - yyvsp--; - yystate = *--yyssp; + yydestruct ("Error: popping", + yystos[yystate], yyvsp); + YYPOPSTACK (1); + yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); } if (yyn == YYFINAL) YYACCEPT; - YYDPRINTF ((stderr, "Shifting error token, ")); - *++yyvsp = yylval; + /* Shift the error token. */ + YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); + yystate = yyn; goto yynewstate; @@ -1647,24 +2020,42 @@ yyabortlab: goto yyreturn; #ifndef yyoverflow -/*----------------------------------------------. -| yyoverflowlab -- parser overflow comes here. | -`----------------------------------------------*/ -yyoverflowlab: - yyerror ("parser stack overflow"); +/*-------------------------------------------------. +| yyexhaustedlab -- memory exhaustion comes here. | +`-------------------------------------------------*/ +yyexhaustedlab: + yyerror (YY_("memory exhausted")); yyresult = 2; /* Fall through. */ #endif yyreturn: + if (yychar != YYEOF && yychar != YYEMPTY) + yydestruct ("Cleanup: discarding lookahead", + yytoken, &yylval); + /* Do not reclaim the symbols of the rule which action triggered + this YYABORT or YYACCEPT. */ + YYPOPSTACK (yylen); + YY_STACK_PRINT (yyss, yyssp); + while (yyssp != yyss) + { + yydestruct ("Cleanup: popping", + yystos[*yyssp], yyvsp); + YYPOPSTACK (1); + } #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss); #endif - return yyresult; +#if YYERROR_VERBOSE + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); +#endif + /* Make sure YYID is used. */ + return YYID (yyresult); } -#line 398 "printrcy.y" +#line 447 "printrcy.y" diff --git a/src/gutenprintui2/printrcy.h b/src/gutenprintui2/printrcy.h index afa662b..8a6c041 100644 --- a/src/gutenprintui2/printrcy.h +++ b/src/gutenprintui2/printrcy.h @@ -1,7 +1,9 @@ -/* A Bison parser, made by GNU Bison 1.875. */ +/* A Bison parser, made by GNU Bison 2.3. */ -/* Skeleton parser for Yacc-like parsing with Bison, - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc. +/* Skeleton interface for Bison's Yacc-like parsers in C + + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -15,13 +17,21 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ + Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ + +/* As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + special exception, which will cause the skeleton and the resulting + Bison output files to be licensed under the GNU General Public + License without this special exception. -/* As a special exception, when this file is copied by Bison into a - Bison output file, you may use that output file without restriction. - This special exception was added by the Free Software Foundation - in version 1.24 of Bison. */ + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. */ /* Tokens. */ #ifndef YYTOKENTYPE @@ -69,6 +79,7 @@ pCURVE = 295 }; #endif +/* Tokens. */ #define tINT 258 #define tDOUBLE 259 #define tDIMENSION 260 @@ -111,7 +122,7 @@ -#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef int YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 @@ -120,5 +131,3 @@ typedef int YYSTYPE; extern YYSTYPE yylval; - - diff --git a/src/gutenprintui2/printrcy.y b/src/gutenprintui2/printrcy.y index 58bd36e..625d1d7 100644 --- a/src/gutenprintui2/printrcy.y +++ b/src/gutenprintui2/printrcy.y @@ -1,5 +1,5 @@ /* - * "$Id: printrcy.y,v 1.1 2004/09/17 18:38:14 rleigh Exp $" + * "$Id: printrcy.y,v 1.1.18.1 2007/03/02 12:01:20 rlk Exp $" * * Test pattern generator for Gutenprint * @@ -117,7 +117,7 @@ Destination: DESTINATION tSTRING Queue_Name: QUEUE_NAME tSTRING { - if ($2) + if (current_printer && $2) { stpui_plist_set_queue_name(current_printer, $2); g_free($2); @@ -127,7 +127,7 @@ Queue_Name: QUEUE_NAME tSTRING Output_Filename: OUTPUT_FILENAME tSTRING { - if ($2) + if (current_printer && $2) { stpui_plist_set_output_filename(current_printer, $2); g_free($2); @@ -137,7 +137,7 @@ Output_Filename: OUTPUT_FILENAME tSTRING Extra_Printer_Options: EXTRA_PRINTER_OPTIONS tSTRING { - if ($2) + if (current_printer && $2) { stpui_plist_set_extra_printer_options(current_printer, $2); g_free($2); @@ -147,7 +147,7 @@ Extra_Printer_Options: EXTRA_PRINTER_OPTIONS tSTRING Custom_Command: CUSTOM_COMMAND tSTRING { - if ($2) + if (current_printer && $2) { stpui_plist_set_custom_command(current_printer, $2); g_free($2); @@ -157,58 +157,86 @@ Custom_Command: CUSTOM_COMMAND tSTRING Command_Type: COMMAND_TYPE tINT { - stpui_plist_set_command_type(current_printer, $2); + if (current_printer) + stpui_plist_set_command_type(current_printer, $2); } ; Scaling: SCALING tDOUBLE - { current_printer->scaling = $2; } + { + if (current_printer) + current_printer->scaling = $2; + } ; Orientation: ORIENTATION tINT - { current_printer->orientation = $2; } + { + if (current_printer) + current_printer->orientation = $2; + } ; Autosize_Roll_Paper: AUTOSIZE_ROLL_PAPER tINT - { current_printer->auto_size_roll_feed_paper = $2; } + { + if (current_printer) + current_printer->auto_size_roll_feed_paper = $2; + } ; Unit: UNIT tINT - { current_printer->unit = $2; } + { + if (current_printer) + current_printer->unit = $2; + } ; Left: LEFT tINT - { stp_set_left(current_printer->v, $2); } + { + if (current_printer) + stp_set_left(current_printer->v, $2); + } ; Top: TOP tINT - { stp_set_top(current_printer->v, $2); } + { + if (current_printer) + stp_set_top(current_printer->v, $2); + } ; Output_Type: OUTPUT_TYPE tINT { - switch ($2) + if (current_printer) { - case 0: - stp_set_string_parameter - (current_printer->v, "PrintingMode", "BW"); - break; - case 1: - case 2: - default: - stp_set_string_parameter - (current_printer->v, "PrintingMode", "Color"); - break; + switch ($2) + { + case 0: + stp_set_string_parameter + (current_printer->v, "PrintingMode", "BW"); + break; + case 1: + case 2: + default: + stp_set_string_parameter + (current_printer->v, "PrintingMode", "Color"); + break; + } } } ; Custom_Page_Width: CUSTOM_PAGE_WIDTH tINT - { stp_set_page_width(current_printer->v, $2); } + { + if (current_printer) + stp_set_page_width(current_printer->v, $2); + } ; Custom_Page_Height: CUSTOM_PAGE_HEIGHT tINT - { stp_set_page_height(current_printer->v, $2); } + { + if (current_printer) + stp_set_page_height(current_printer->v, $2); + } ; Empty: @@ -216,13 +244,16 @@ Empty: Int_Param: tWORD pINT tBOOLEAN tINT { - stp_set_int_parameter(current_printer->v, $1, $4); - if (strcmp($3, "False") == 0) - stp_set_int_parameter_active(current_printer->v, $1, - STP_PARAMETER_INACTIVE); - else - stp_set_int_parameter_active(current_printer->v, $1, - STP_PARAMETER_ACTIVE); + if (current_printer) + { + stp_set_int_parameter(current_printer->v, $1, $4); + if (strcmp($3, "False") == 0) + stp_set_int_parameter_active(current_printer->v, $1, + STP_PARAMETER_INACTIVE); + else + stp_set_int_parameter_active(current_printer->v, $1, + STP_PARAMETER_ACTIVE); + } g_free($1); g_free($3); } @@ -230,13 +261,16 @@ Int_Param: tWORD pINT tBOOLEAN tINT String_List_Param: tWORD pSTRING_LIST tBOOLEAN tSTRING { - stp_set_string_parameter(current_printer->v, $1, $4); - if (strcmp($3, "False") == 0) - stp_set_string_parameter_active(current_printer->v, $1, - STP_PARAMETER_INACTIVE); - else - stp_set_string_parameter_active(current_printer->v, $1, - STP_PARAMETER_ACTIVE); + if (current_printer) + { + stp_set_string_parameter(current_printer->v, $1, $4); + if (strcmp($3, "False") == 0) + stp_set_string_parameter_active(current_printer->v, $1, + STP_PARAMETER_INACTIVE); + else + stp_set_string_parameter_active(current_printer->v, $1, + STP_PARAMETER_ACTIVE); + } g_free($1); g_free($3); g_free($4); @@ -245,13 +279,16 @@ String_List_Param: tWORD pSTRING_LIST tBOOLEAN tSTRING File_Param: tWORD pFILE tBOOLEAN tSTRING { - stp_set_file_parameter(current_printer->v, $1, $4); - if (strcmp($3, "False") == 0) - stp_set_file_parameter_active(current_printer->v, $1, - STP_PARAMETER_INACTIVE); - else - stp_set_file_parameter_active(current_printer->v, $1, - STP_PARAMETER_ACTIVE); + if (current_printer) + { + stp_set_file_parameter(current_printer->v, $1, $4); + if (strcmp($3, "False") == 0) + stp_set_file_parameter_active(current_printer->v, $1, + STP_PARAMETER_INACTIVE); + else + stp_set_file_parameter_active(current_printer->v, $1, + STP_PARAMETER_ACTIVE); + } g_free($1); g_free($3); g_free($4); @@ -260,13 +297,16 @@ File_Param: tWORD pFILE tBOOLEAN tSTRING Double_Param: tWORD pDOUBLE tBOOLEAN tDOUBLE { - stp_set_float_parameter(current_printer->v, $1, $4); - if (strcmp($3, "False") == 0) - stp_set_float_parameter_active(current_printer->v, $1, - STP_PARAMETER_INACTIVE); - else - stp_set_float_parameter_active(current_printer->v, $1, - STP_PARAMETER_ACTIVE); + if (current_printer) + { + stp_set_float_parameter(current_printer->v, $1, $4); + if (strcmp($3, "False") == 0) + stp_set_float_parameter_active(current_printer->v, $1, + STP_PARAMETER_INACTIVE); + else + stp_set_float_parameter_active(current_printer->v, $1, + STP_PARAMETER_ACTIVE); + } g_free($1); g_free($3); } @@ -274,13 +314,16 @@ Double_Param: tWORD pDOUBLE tBOOLEAN tDOUBLE Dimension_Param: tWORD pDIMENSION tBOOLEAN tINT { - stp_set_dimension_parameter(current_printer->v, $1, $4); - if (strcmp($3, "False") == 0) - stp_set_dimension_parameter_active(current_printer->v, $1, - STP_PARAMETER_INACTIVE); - else - stp_set_dimension_parameter_active(current_printer->v, $1, - STP_PARAMETER_ACTIVE); + if (current_printer) + { + stp_set_dimension_parameter(current_printer->v, $1, $4); + if (strcmp($3, "False") == 0) + stp_set_dimension_parameter_active(current_printer->v, $1, + STP_PARAMETER_INACTIVE); + else + stp_set_dimension_parameter_active(current_printer->v, $1, + STP_PARAMETER_ACTIVE); + } g_free($1); g_free($3); } @@ -288,16 +331,19 @@ Dimension_Param: tWORD pDIMENSION tBOOLEAN tINT Boolean_Param: tWORD pBOOLEAN tBOOLEAN tBOOLEAN { - if (strcmp($4, "False") == 0) - stp_set_boolean_parameter(current_printer->v, $1, 0); - else - stp_set_boolean_parameter(current_printer->v, $1, 1); - if (strcmp($3, "False") == 0) - stp_set_boolean_parameter_active(current_printer->v, $1, - STP_PARAMETER_INACTIVE); - else - stp_set_boolean_parameter_active(current_printer->v, $1, - STP_PARAMETER_ACTIVE); + if (current_printer) + { + if (strcmp($4, "False") == 0) + stp_set_boolean_parameter(current_printer->v, $1, 0); + else + stp_set_boolean_parameter(current_printer->v, $1, 1); + if (strcmp($3, "False") == 0) + stp_set_boolean_parameter_active(current_printer->v, $1, + STP_PARAMETER_INACTIVE); + else + stp_set_boolean_parameter_active(current_printer->v, $1, + STP_PARAMETER_ACTIVE); + } g_free($1); g_free($3); g_free($4); @@ -306,17 +352,20 @@ Boolean_Param: tWORD pBOOLEAN tBOOLEAN tBOOLEAN Curve_Param: tWORD pCURVE tBOOLEAN tSTRING { - stp_curve_t *curve = stp_curve_create_from_string($4); - if (curve) + if (current_printer) { - stp_set_curve_parameter(current_printer->v, $1, curve); - if (strcmp($3, "False") == 0) - stp_set_curve_parameter_active(current_printer->v, $1, - STP_PARAMETER_INACTIVE); - else - stp_set_curve_parameter_active(current_printer->v, $1, - STP_PARAMETER_ACTIVE); - stp_curve_destroy(curve); + stp_curve_t *curve = stp_curve_create_from_string($4); + if (curve) + { + stp_set_curve_parameter(current_printer->v, $1, curve); + if (strcmp($3, "False") == 0) + stp_set_curve_parameter_active(current_printer->v, $1, + STP_PARAMETER_INACTIVE); + else + stp_set_curve_parameter_active(current_printer->v, $1, + STP_PARAMETER_ACTIVE); + stp_curve_destroy(curve); + } } g_free($1); g_free($3); diff --git a/src/main/Makefile.am b/src/main/Makefile.am index aa19a62..55b2868 100644 --- a/src/main/Makefile.am +++ b/src/main/Makefile.am @@ -1,4 +1,4 @@ -## $Id: Makefile.am,v 1.92 2005/11/21 11:16:23 rleigh Exp $ +## $Id: Makefile.am,v 1.92.10.1 2007/03/02 12:01:20 rlk Exp $ ## Copyright (C) 2000 Roger Leigh ## ## This program is free software; you can redistribute it and/or modify @@ -50,7 +50,14 @@ color_traditional_la_SOURCES = \ color_traditional_la_LDFLAGS = -module -avoid-version -print_canon_la_SOURCES = print-canon.c +print_canon_la_SOURCES = \ + print-canon.c \ + print-canon.h \ + canon-inks.h \ + canon-media.h \ + canon-modes.h \ + canon-printers.h + print_canon_la_LDFLAGS = -module -avoid-version print_escp2_la_SOURCES = \ @@ -124,6 +131,7 @@ libgutenprint_la_SOURCES = \ dither-predithered.c \ generic-options.c \ image.c \ + buffer-image.c \ module.c \ path.c \ print-dither-matrices.c \ diff --git a/src/main/Makefile.in b/src/main/Makefile.in index 0ef0165..1d50529 100644 --- a/src/main/Makefile.in +++ b/src/main/Makefile.in @@ -48,11 +48,12 @@ subdir = src/main ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ $(top_srcdir)/m4/gimp.m4 $(top_srcdir)/m4/iconv.m4 \ - $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ - $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/progtest.m4 \ - $(top_srcdir)/m4/stp.m4 $(top_srcdir)/m4/stp_cups.m4 \ - $(top_srcdir)/m4/stp_gimp.m4 $(top_srcdir)/m4/stp_option.m4 \ - $(top_srcdir)/m4/stp_release.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/isc-posix.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/stp.m4 \ + $(top_srcdir)/m4/stp_cups.m4 $(top_srcdir)/m4/stp_gimp.m4 \ + $(top_srcdir)/m4/stp_option.m4 $(top_srcdir)/m4/stp_release.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/scripts/mkinstalldirs @@ -80,14 +81,16 @@ am__libgutenprint_la_SOURCES_DIST = array.c bit-ops.c channel.c \ color.c curve.c curve-cache.c dither-ed.c dither-eventone.c \ dither-inks.c dither-main.c dither-ordered.c \ dither-very-fast.c dither-predithered.c generic-options.c \ - image.c module.c path.c print-dither-matrices.c print-list.c \ - print-papers.c print-util.c print-vars.c print-version.c \ - print-weave.c printers.c sequence.c string-list.c xml.c \ - mxml-attr.c mxml-file.c mxml-node.c mxml-search.c \ - dither-impl.h dither-inlined-functions.h generic-options.h \ - gutenprint-internal.h util.h print-color.c color-conversion.h \ - color-conversions.c print-canon.c print-escp2.c escp2-driver.c \ - print-escp2.h print-escp2-data.c escp2-channels.c escp2-inks.c \ + image.c buffer-image.c module.c path.c print-dither-matrices.c \ + print-list.c print-papers.c print-util.c print-vars.c \ + print-version.c print-weave.c printers.c sequence.c \ + string-list.c xml.c mxml-attr.c mxml-file.c mxml-node.c \ + mxml-search.c dither-impl.h dither-inlined-functions.h \ + generic-options.h gutenprint-internal.h util.h print-color.c \ + color-conversion.h color-conversions.c print-canon.c \ + print-canon.h canon-inks.h canon-media.h canon-modes.h \ + canon-printers.h print-escp2.c escp2-driver.c print-escp2.h \ + print-escp2-data.c escp2-channels.c escp2-inks.c \ escp2-papers.c escp2-resolutions.c print-lexmark.c print-pcl.c \ print-ps.c print-olympus.c print-raw.c am__objects_1 = mxml-attr.lo mxml-file.lo mxml-node.lo mxml-search.lo @@ -110,11 +113,11 @@ am_libgutenprint_la_OBJECTS = array.lo bit-ops.lo channel.lo color.lo \ curve.lo curve-cache.lo dither-ed.lo dither-eventone.lo \ dither-inks.lo dither-main.lo dither-ordered.lo \ dither-very-fast.lo dither-predithered.lo generic-options.lo \ - image.lo module.lo path.lo print-dither-matrices.lo \ - print-list.lo print-papers.lo print-util.lo print-vars.lo \ - print-version.lo print-weave.lo printers.lo sequence.lo \ - string-list.lo xml.lo $(am__objects_1) $(am__objects_2) \ - $(am__objects_12) + image.lo buffer-image.lo module.lo path.lo \ + print-dither-matrices.lo print-list.lo print-papers.lo \ + print-util.lo print-vars.lo print-version.lo print-weave.lo \ + printers.lo sequence.lo string-list.lo xml.lo $(am__objects_1) \ + $(am__objects_2) $(am__objects_12) libgutenprint_la_OBJECTS = $(am_libgutenprint_la_OBJECTS) print_canon_la_LIBADD = am_print_canon_la_OBJECTS = print-canon.lo @@ -147,8 +150,8 @@ am_print_raw_la_OBJECTS = print-raw.lo print_raw_la_OBJECTS = $(am_print_raw_la_OBJECTS) @BUILD_MODULES_TRUE@am_print_raw_la_rpath = -rpath $(pkgmoduledir) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -depcomp = -am__depfiles_maybe = +depcomp = $(SHELL) $(top_srcdir)/scripts/depcomp +am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ @@ -175,13 +178,18 @@ CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ +BUILD_CUPS_1_2_FALSE = @BUILD_CUPS_1_2_FALSE@ +BUILD_CUPS_1_2_TRUE = @BUILD_CUPS_1_2_TRUE@ BUILD_CUPS_FALSE = @BUILD_CUPS_FALSE@ +BUILD_CUPS_PPDS = @BUILD_CUPS_PPDS@ BUILD_CUPS_PPDS_FALSE = @BUILD_CUPS_PPDS_FALSE@ BUILD_CUPS_PPDS_TRUE = @BUILD_CUPS_PPDS_TRUE@ BUILD_CUPS_TRUE = @BUILD_CUPS_TRUE@ @@ -207,6 +215,8 @@ BUILD_LIBGUTENPRINTUI_FALSE = @BUILD_LIBGUTENPRINTUI_FALSE@ BUILD_LIBGUTENPRINTUI_TRUE = @BUILD_LIBGUTENPRINTUI_TRUE@ BUILD_MODULES_FALSE = @BUILD_MODULES_FALSE@ BUILD_MODULES_TRUE = @BUILD_MODULES_TRUE@ +BUILD_SIMPLIFIED_CUPS_PPDS_FALSE = @BUILD_SIMPLIFIED_CUPS_PPDS_FALSE@ +BUILD_SIMPLIFIED_CUPS_PPDS_TRUE = @BUILD_SIMPLIFIED_CUPS_PPDS_TRUE@ BUILD_TESTPATTERN_FALSE = @BUILD_TESTPATTERN_FALSE@ BUILD_TESTPATTERN_TRUE = @BUILD_TESTPATTERN_TRUE@ BUILD_TEST_FALSE = @BUILD_TEST_FALSE@ @@ -214,6 +224,7 @@ BUILD_TEST_TRUE = @BUILD_TEST_TRUE@ BUILD_TRANSLATED_CUPS_PPDS_FALSE = @BUILD_TRANSLATED_CUPS_PPDS_FALSE@ BUILD_TRANSLATED_CUPS_PPDS_TRUE = @BUILD_TRANSLATED_CUPS_PPDS_TRUE@ CC = @CC@ +CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CONVERT = @CONVERT@ CPP = @CPP@ @@ -226,12 +237,14 @@ CUPS_PPDS_AT_TOP_LEVEL_TRUE = @CUPS_PPDS_AT_TOP_LEVEL_TRUE@ CUPS_PPD_PS_LEVEL = @CUPS_PPD_PS_LEVEL@ CXX = @CXX@ CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DB2HTML = @DB2HTML@ DB2PDF = @DB2PDF@ DB2PS = @DB2PS@ DEFS = @DEFS@ +DEPDIR = @DEPDIR@ DIALOG = @DIALOG@ DOXYGEN = @DOXYGEN@ DVIPDF = @DVIPDF@ @@ -266,6 +279,7 @@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GMSGFMT = @GMSGFMT@ GNUCFLAGS = @GNUCFLAGS@ +GREP = @GREP@ GTK2_CFLAGS = @GTK2_CFLAGS@ GTK2_LIBS = @GTK2_LIBS@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -361,14 +375,17 @@ VERSION = @VERSION@ WHICH_PPDS = @WHICH_PPDS@ XGETTEXT = @XGETTEXT@ YACC = @YACC@ -ac_ct_AR = @ac_ct_AR@ +YFLAGS = @YFLAGS@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ @@ -385,6 +402,9 @@ cups_exec_prefix = @cups_exec_prefix@ cups_prefix = @cups_prefix@ cups_sbindir = @cups_sbindir@ datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ exec_prefix = @exec_prefix@ gimp2_plug_indir = @gimp2_plug_indir@ gimp_plug_indir = @gimp_plug_indir@ @@ -402,17 +422,21 @@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ +htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ +localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ +psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ @@ -437,7 +461,14 @@ color_traditional_la_SOURCES = \ color-conversions.c color_traditional_la_LDFLAGS = -module -avoid-version -print_canon_la_SOURCES = print-canon.c +print_canon_la_SOURCES = \ + print-canon.c \ + print-canon.h \ + canon-inks.h \ + canon-media.h \ + canon-modes.h \ + canon-printers.h + print_canon_la_LDFLAGS = -module -avoid-version print_escp2_la_SOURCES = \ print-escp2.c \ @@ -501,6 +532,7 @@ libgutenprint_la_SOURCES = \ dither-predithered.c \ generic-options.c \ image.c \ + buffer-image.c \ module.c \ path.c \ print-dither-matrices.c \ @@ -554,9 +586,9 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu --ignore-deps src/main/Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/main/Makefile'; \ cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu --ignore-deps src/main/Makefile + $(AUTOMAKE) --gnu src/main/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ @@ -655,14 +687,75 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/array.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/bit-ops.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/buffer-image.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/channel.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/color-conversions.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/color.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/curve-cache.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/curve.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dither-ed.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dither-eventone.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dither-inks.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dither-main.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dither-ordered.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dither-predithered.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dither-very-fast.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/escp2-channels.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/escp2-driver.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/escp2-inks.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/escp2-papers.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/escp2-resolutions.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/generic-options.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/image.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/module.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mxml-attr.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mxml-file.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mxml-node.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mxml-search.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/path.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/print-canon.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/print-color.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/print-dither-matrices.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/print-escp2-data.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/print-escp2.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/print-lexmark.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/print-list.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/print-olympus.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/print-papers.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/print-pcl.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/print-ps.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/print-raw.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/print-util.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/print-vars.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/print-version.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/print-weave.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printers.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sequence.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/string-list.Plo@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/xml.Plo@am__quote@ + .c.o: - $(COMPILE) -c $< +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: - $(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: - $(LTCOMPILE) -c -o $@ $< +@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo @@ -826,6 +919,7 @@ clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \ clean-pkgmoduleLTLIBRARIES mostlyclean-am distclean: distclean-am + -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags @@ -852,6 +946,7 @@ install-man: installcheck-am: maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic diff --git a/src/main/bit-ops.c b/src/main/bit-ops.c index 063348d..ab111ca 100644 --- a/src/main/bit-ops.c +++ b/src/main/bit-ops.c @@ -1,5 +1,5 @@ /* - * "$Id: bit-ops.c,v 1.9 2006/03/28 03:27:57 rlk Exp $" + * "$Id: bit-ops.c,v 1.9.8.2 2007/05/12 19:14:27 faust3 Exp $" * * Softweave calculator for Gutenprint. * @@ -73,6 +73,201 @@ stp_fold(const unsigned char *line, } } +void +stp_fold_3bit(const unsigned char *line, + int single_length, + unsigned char *outbuf) +{ + int i; + memset(outbuf, 0, single_length * 3); + for (i = 0; i < single_length; i++) { + outbuf[0] = + ((line[0] & (1 << 7)) >> 2) | + ((line[0] & (1 << 6)) >> 4) | + ((line[single_length] & (1 << 7)) >> 1) | + ((line[single_length] & (1 << 6)) >> 3) | + ((line[single_length] & (1 << 5)) >> 5) | + ((line[2*single_length] & (1 << 7)) << 0) | + ((line[2*single_length] & (1 << 6)) >> 2) | + ((line[2*single_length] & (1 << 5)) >> 4); + outbuf[1] = + ((line[0] & (1 << 5)) << 2) | + ((line[0] & (1 << 4)) << 0) | + ((line[0] & (1 << 3)) >> 2) | + ((line[single_length] & (1 << 4)) << 1) | + ((line[single_length] & (1 << 3)) >> 1) | + ((line[2*single_length] & (1 << 4)) << 2) | + ((line[2*single_length] & (1 << 3)) << 0) | + ((line[2*single_length] & (1 << 2)) >> 2); + outbuf[2] = + ((line[0] & (1 << 2)) << 4) | + ((line[0] & (1 << 1)) << 2) | + ((line[0] & (1 << 0)) << 0) | + ((line[single_length] & (1 << 2)) << 5) | + ((line[single_length] & (1 << 1)) << 3) | + ((line[single_length] & (1 << 0)) << 1) | + ((line[2*single_length] & (1 << 1)) << 4) | + ((line[2*single_length] & (1 << 0)) << 2); + line++; + outbuf += 3; + } +} + +void +stp_fold_3bit_323(const unsigned char *line, + int single_length, + unsigned char *outbuf) +{ + unsigned char A0,A1,A2,B0,B1,B2,C0,C1,C2; + const unsigned char *last= line+single_length; + memset(outbuf, 0, single_length * 3); + for (; line < last; line+=3, outbuf+=8) { + + A0= line[0]; B0= line[single_length]; C0= line[2*single_length]; + + if (line> 0) | + ((B0 & 0x80) >> 1) | + ((A0 & 0x80) >> 2) | + ((B0 & 0x40) >> 2) | + ((A0 & 0x40) >> 3) | + ((C0 & 0x20) >> 3) | + ((B0 & 0x20) >> 4) | + ((A0 & 0x20) >> 5); + outbuf[1] = + ((C0 & 0x10) << 3) | + ((B0 & 0x10) << 2) | + ((A0 & 0x10) << 1) | + ((B0 & 0x08) << 1) | + ((A0 & 0x08) << 0) | + ((C0 & 0x04) >> 0) | + ((B0 & 0x04) >> 1) | + ((A0 & 0x04) >> 2); + outbuf[2] = + ((C0 & 0x02) << 6) | + ((B0 & 0x02) << 5) | + ((A0 & 0x02) << 4) | + ((B0 & 0x01) << 4) | + ((A0 & 0x01) << 3) | + ((C1 & 0x80) >> 5) | + ((B1 & 0x80) >> 6) | + ((A1 & 0x80) >> 7); + outbuf[3] = + ((C1 & 0x40) << 1) | + ((B1 & 0x40) << 0) | + ((A1 & 0x40) >> 1) | + ((B1 & 0x20) >> 1) | + ((A1 & 0x20) >> 2) | + ((C1 & 0x10) >> 2) | + ((B1 & 0x10) >> 3) | + ((A1 & 0x10) >> 4); + outbuf[4] = + ((C1 & 0x08) << 4) | + ((B1 & 0x08) << 3) | + ((A1 & 0x08) << 2) | + ((B1 & 0x04) << 2) | + ((A1 & 0x04) << 1) | + ((C1 & 0x02) << 1) | + ((B1 & 0x02) >> 0) | + ((A1 & 0x02) >> 1); + outbuf[5] = + ((C1 & 0x01) << 7) | + ((B1 & 0x01) << 6) | + ((A1 & 0x01) << 5) | + ((B2 & 0x80) >> 3) | + ((A2 & 0x80) >> 4) | + ((C2 & 0x40) >> 4) | + ((B2 & 0x40) >> 5) | + ((A2 & 0x40) >> 6); + outbuf[6] = + ((C2 & 0x20) << 2) | + ((B2 & 0x20) << 1) | + ((A2 & 0x20) << 0) | + ((B2 & 0x10) >> 0) | + ((A2 & 0x10) >> 1) | + ((C2 & 0x08) >> 1) | + ((B2 & 0x08) >> 2) | + ((A2 & 0x08) >> 3); + outbuf[7] = + ((C2 & 0x04) << 5) | + ((B2 & 0x04) << 4) | + ((A2 & 0x04) << 3) | + ((B2 & 0x02) << 3) | + ((A2 & 0x02) << 2) | + ((C2 & 0x01) << 2) | + ((B2 & 0x01) << 1) | + ((A2 & 0x01) << 0); + } +} + +void +stp_fold_4bit(const unsigned char *line, + int single_length, + unsigned char *outbuf) +{ + int i; + memset(outbuf, 0, single_length * 4); + for (i = 0; i < single_length; i++){ + unsigned char l0 = line[0]; + unsigned char l1 = line[single_length]; + unsigned char l2 = line[single_length*2]; + unsigned char l3 = line[single_length*3]; + if(l0 || l1 || l2 || l3){ + outbuf[0] = + ((l3 & (1<<7)) >> 0)| + ((l2 & (1<<7)) >> 1)| + ((l1 & (1<<7)) >> 2)| + ((l0 & (1<<7)) >> 3)| + ((l3 & (1<<6)) >> 3)| + ((l2 & (1<<6)) >> 4)| + ((l1 & (1<<6)) >> 5)| + ((l0 & (1<<6)) >> 6); + + outbuf[1] = + ((l3 & (1<<5)) << 2)| + ((l2 & (1<<5)) << 1)| + ((l1 & (1<<5)) << 0)| + ((l0 & (1<<5)) >> 1)| + ((l3 & (1<<4)) >> 1)| + ((l2 & (1<<4)) >> 2)| + ((l1 & (1<<4)) >> 3)| + ((l0 & (1<<4)) >> 4); + + outbuf[2] = + ((l3 & (1<<3)) << 4)| + ((l2 & (1<<3)) << 3)| + ((l1 & (1<<3)) << 2)| + ((l0 & (1<<3)) << 1)| + ((l3 & (1<<2)) << 1)| + ((l2 & (1<<2)) << 0)| + ((l1 & (1<<2)) >> 1)| + ((l0 & (1<<2)) >> 2); + outbuf[3] = + ((l3 & (1<<1)) << 6)| + ((l2 & (1<<1)) << 5)| + ((l1 & (1<<1)) << 4)| + ((l0 & (1<<1)) << 3)| + ((l3 & (1<<0)) << 3)| + ((l2 & (1<<0)) << 2)| + ((l1 & (1<<0)) << 1)| + ((l0 & (1<<0)) << 0); + } + line++; + outbuf += 4; + } +} + static void stpi_split_2_1(int length, const unsigned char *in, @@ -950,27 +1145,30 @@ stpi_unpack_16_2(int length, if (tempin & 3) temp[7] |= ((tempin & 3) << 6) >> shift; - tempin = *in++; - - if (tempin & 192) - temp[8] |= (tempin & 192) >> shift; - if (tempin & 48) - temp[9] |= ((tempin & 48) << 2) >> shift; - if (tempin & 12) - temp[10] |= ((tempin & 12) << 4) >> shift; - if (tempin & 3) - temp[11] |= ((tempin & 3) << 6) >> shift; - - tempin = *in++; - - if (tempin & 192) - temp[12] |= (tempin & 192) >> shift; - if (tempin & 48) - temp[13] |= ((tempin & 48) << 2) >> shift; - if (tempin & 12) - temp[14] |= ((tempin & 12) << 4) >> shift; - if (tempin & 3) - temp[15] |= ((tempin & 3) << 6) >> shift; + if (length-- > 0) + { + tempin = *in++; + + if (tempin & 192) + temp[8] |= (tempin & 192) >> shift; + if (tempin & 48) + temp[9] |= ((tempin & 48) << 2) >> shift; + if (tempin & 12) + temp[10] |= ((tempin & 12) << 4) >> shift; + if (tempin & 3) + temp[11] |= ((tempin & 3) << 6) >> shift; + + tempin = *in++; + + if (tempin & 192) + temp[12] |= (tempin & 192) >> shift; + if (tempin & 48) + temp[13] |= ((tempin & 48) << 2) >> shift; + if (tempin & 12) + temp[14] |= ((tempin & 12) << 4) >> shift; + if (tempin & 3) + temp[15] |= ((tempin & 3) << 6) >> shift; + } if (shift < 6) shift += 2; diff --git a/src/main/buffer-image.c b/src/main/buffer-image.c new file mode 100644 index 0000000..030d398 --- /dev/null +++ b/src/main/buffer-image.c @@ -0,0 +1,153 @@ +/* + * Buffer an Image + * + * Copyright 2007 Sascha Sommer + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the Free + * Software Foundation; either version 2 of the License, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifdef HAVE_CONFIG_H +#include +#endif +#include +#include "gutenprint-internal.h" + +struct buffered_image_priv +{ + stp_image_t* image; + unsigned char** buf; + unsigned int flags; +}; + +static void +buffered_image_init(stp_image_t* image) +{ + struct buffered_image_priv *priv = image->rep; + if(priv->image->init) + priv->image->init(priv->image); +} + + +static int +buffered_image_width(stp_image_t * image) +{ + struct buffered_image_priv *priv = image->rep; + return priv->image->width(priv->image); +} + +static int +buffered_image_height(stp_image_t * image) +{ + struct buffered_image_priv *priv = image->rep; + return priv->image->height(priv->image); +} + +static const char * +buffered_image_get_appname(stp_image_t *image) +{ + struct buffered_image_priv *priv = image->rep; + return priv->image->get_appname(priv->image); +} + + +static stp_image_status_t +buffered_image_get_row(stp_image_t* image,unsigned char *data, size_t byte_limit, int row) +{ + struct buffered_image_priv *priv = image->rep; + int width = buffered_image_width(image); + int height = buffered_image_height(image); + /* FIXME this will break with padding bytes */ + int bytes_per_pixel = byte_limit / width; + int inc = bytes_per_pixel; + unsigned char* src; + int i; + /* fill buffer */ + if(!priv->buf){ + priv->buf = stp_zalloc((sizeof(unsigned short*) + 1) * height); + if(!priv->buf){ + return STP_IMAGE_STATUS_ABORT; + } + for(i=0;ibuf[i] = stp_malloc(byte_limit); + if(STP_IMAGE_STATUS_OK != priv->image->get_row(priv->image,priv->buf[i],byte_limit,i)) + return STP_IMAGE_STATUS_ABORT; + } + } + if(priv->flags & BUFFER_FLAG_FLIP_Y) + row = height - row - 1; + + src = priv->buf[row]; + + if(priv->flags & BUFFER_FLAG_FLIP_X){ + src += byte_limit - bytes_per_pixel; + inc = -bytes_per_pixel; + } + + /* copy data */ + for( i = 0 ; i < width ; i++){ + memcpy(data,src,bytes_per_pixel); + src += inc; + data += bytes_per_pixel; + } + return STP_IMAGE_STATUS_OK; +} + +static void +buffered_image_conclude(stp_image_t * image) +{ + struct buffered_image_priv *priv = image->rep; + if(priv->buf){ + int i = 0; + while(priv->buf[i]){ + stp_free(priv->buf[i]); + ++i; + } + stp_free(priv->buf); + priv->buf = NULL; + } + if(priv->image->conclude) + priv->image->conclude(priv->image); + +} + +stp_image_t* +stpi_buffer_image(stp_image_t* image, unsigned int flags) +{ + struct buffered_image_priv *priv; + stp_image_t* buffered_image = stp_zalloc(sizeof(stp_image_t)); + if(!buffered_image){ + return NULL; + } + priv = buffered_image->rep = stp_zalloc(sizeof(struct buffered_image_priv)); + if(!priv){ + stp_free(buffered_image); + return NULL; + } + + if(image->init) + buffered_image->init = buffered_image_init; + buffered_image->width = buffered_image_width; + buffered_image->height = buffered_image_height; + buffered_image->get_row = buffered_image_get_row; + priv->image = image; + priv->flags = flags; + if(image->get_appname) + buffered_image->get_appname = buffered_image_get_appname; + + + return buffered_image; +} + + diff --git a/src/main/canon-inks.h b/src/main/canon-inks.h new file mode 100644 index 0000000..458cb2a --- /dev/null +++ b/src/main/canon-inks.h @@ -0,0 +1,420 @@ +/* + * Print plug-in CANON BJL driver for the GIMP. + * + * Copyright 1997-2000 Michael Sweet (mike@easysw.com), + * Robert Krawitz (rlk@alum.mit.edu) and + * Andy Thaller (thaller@ph.tum.de) + * Copyright (c) 2006 - 2007 Sascha Sommer (saschasommer@freenet.de) + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the Free + * Software Foundation; either version 2 of the License, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +/* This file contains definitions for the various inks +*/ + +#ifndef GUTENPRINT_INTERNAL_CANON_INKS_H +#define GUTENPRINT_INTERNAL_CANON_INKS_H + +/* ink definition: + * ink dots can be printed in various sizes + * one size is called level + * every level is represented by a bitcombination and a density + * the density ranges from 0 (no dot is printed) to 1.0 (maximum dot size) + * + * an ink is therefore defined by the number of bits used for the bitpattern (bitdepth) and the number of possible levels: + * a 1 bit ink can have 2 possible levels 0 and 1 + * a 2 bit ink can have 2*2=4 possible levels with the bitpatterns 0,1,2 and 3 + * a 3 bit ink can have 2*2*2=8 possible levels with the bitpatterns 0 to 7 + * ... + * some inks use less levels than possible with the given bitdepth + * some inks use special compressions to store for example 5 3 level pixels in 1 byte + * naming: + * dotsizes are named dotsizes_xl where x is the number of levels (number of dotsizes + 1) + * inks are named canon_xb_yl_ink where x is the number of bits representing the y possible ink levels + * inks that contain special (compression) flags are named canon_xb_yl_c_ink + * order: + * dotsizes are ordered ascending by the number of dots + * +*/ + + +typedef struct { + const int bits; /* bitdepth */ + const int flags; /* flags: */ +#define INK_FLAG_5pixel_in_1byte 0x1 /* use special compression where 5 3level pixels get stored in 1 byte */ + int numsizes; /* number of possible {bit,density} tuples */ + const stp_dotsize_t *dot_sizes; /* pointer to an array of {bit,density} tuples */ +} canon_ink_t; + +/* declare a standard ink */ +#define DECLARE_INK(bits,levels) \ +static const canon_ink_t canon_##bits##b_##levels##l_ink = { \ + bits,0, \ + sizeof(dotsizes_##levels##l)/sizeof(stp_dotsize_t), dotsizes_##levels##l \ +} + +/* declare an ink with flags */ +#define DECLARE_INK_EXTENDED(bits,levels,flags) \ +static const canon_ink_t canon_##bits##b_##levels##l_c_ink = { \ + bits,flags, \ + sizeof(dotsizes_##levels##l)/sizeof(stp_dotsize_t), dotsizes_##levels##l \ +} + + + +/* NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE + * + * Some of the bitpattern/density combinations were taken from print-escp2.c + * and do NOT represent the requirements of canon inks. Feel free to play + * with them and send a patch to gimp-print-devel@lists.sourceforge.net + */ + + +static const stp_dotsize_t dotsizes_2l[] = { + { 0x1, 1.0 } +}; + +DECLARE_INK(1,2); + + +static const stp_dotsize_t dotsizes_3l[] = { + { 0x1, 0.5 }, + { 0x2, 1.0 } +}; + +DECLARE_INK(2,3); + +DECLARE_INK_EXTENDED(2,3,INK_FLAG_5pixel_in_1byte); + +static const stp_dotsize_t dotsizes_4l[] = { + { 0x1, 0.45 }, + { 0x2, 0.68 }, + { 0x3, 1.0 } +}; + +DECLARE_INK(2,4); + +static const stp_dotsize_t dotsizes_7l[] = { + { 0x1, 0.45 }, + { 0x2, 0.55 }, + { 0x3, 0.66 }, + { 0x4, 0.77 }, + { 0x5, 0.88 }, + { 0x6, 1.0 } +}; + +DECLARE_INK(3,7); + +static const stp_dotsize_t dotsizes_8l[] = { + { 0x1, 0.14 }, + { 0x2, 0.29 }, + { 0x3, 0.43 }, + { 0x4, 0.58 }, + { 0x5, 0.71 }, + { 0x6, 0.86 }, + { 0x7, 1.00 } +}; + +DECLARE_INK(4,8); + +static const stp_dotsize_t dotsizes_16l[] = { + { 0x1, 0.07 }, + { 0x2, 0.13 }, + { 0x3, 0.20 }, + { 0x4, 0.27 }, + { 0x5, 0.33 }, + { 0x6, 0.40 }, + { 0x7, 0.47 }, + { 0x8, 0.53 }, + { 0x9, 0.60 }, + { 0xA, 0.67 }, + { 0xB, 0.73 }, + { 0xC, 0.80 }, + { 0xD, 0.87 }, + { 0xE, 0.93 }, + { 0xF, 1.00 } +}; + +DECLARE_INK(4,16); + + +/* A inkset is a list of inks and their (relative) densities + * For printers that use the extended SetImage command t) + * the inkset will be used to build the parameter list + * therefore invalid inksets will let the printer fallback + * to a default mode which will then lead to wrong output + * use {0,0.0,NULL} for undefined placeholder inks + * set density to 0.0 to disable certain inks + * the paramters will then still occure in the t) command + * + * names: + * inksets are named canon_X_ where X is the number of possible inks in the set + * followed by YZ combinations for every defined ink where Y is the letter + * representing the color and Z the maximum level of the color + * if an inkset contains one or more compressed inks a _c is appended + * the inkset name ends with _inkset + * see the examples below + * order: + * inksets are ordered by ascending number of possible inks, used inks, compression + * + */ + + +typedef struct { + const int channel; + const double density; + const canon_ink_t* ink; +} canon_inkset_t; + + +/* Inkset for printing in K and 1bit/pixel */ +static const canon_inkset_t canon_1_K2_inkset[] = { + {'K',1.0,&canon_1b_2l_ink} +}; + +/* Inkset for printing in CMY and 1bit/pixel */ +static const canon_inkset_t canon_3_C2M2Y2_inkset[] = { + {'C',1.0,&canon_1b_2l_ink}, + {'M',1.0,&canon_1b_2l_ink}, + {'Y',1.0,&canon_1b_2l_ink} +}; + + +/* Inkset for printing in CMY and 2bit/pixel */ +static const canon_inkset_t canon_3_C4M4Y4_inkset[] = { + {'C',1.0,&canon_2b_4l_ink}, + {'M',1.0,&canon_2b_4l_ink}, + {'Y',1.0,&canon_2b_4l_ink} +}; + +/* Inkset for printing in CMYK and 1bit/pixel */ +static const canon_inkset_t canon_4_C2M2Y2K2_inkset[] = { + {'C',1.0,&canon_1b_2l_ink}, + {'M',1.0,&canon_1b_2l_ink}, + {'Y',1.0,&canon_1b_2l_ink}, + {'K',1.0,&canon_1b_2l_ink} +}; + +/* Inkset for printing in CMYK and 2bit/pixel */ +static const canon_inkset_t canon_4_C4M4Y4K4_inkset[] = { + {'C',1.0,&canon_2b_4l_ink}, + {'M',1.0,&canon_2b_4l_ink}, + {'Y',1.0,&canon_2b_4l_ink}, + {'K',1.0,&canon_2b_4l_ink} +}; + +/* + * Dither ranges specifically for any Color and 3bit/pixel + * (see NOTE above) + * + * BIG NOTE: The bjc8200 has this kind of ink. One Byte seems to hold + * drop sizes for 3 pixels in a 3/2/2 bit fashion. + * Size values for 3bit-sized pixels range from 1 to 7, + * size values for 2bit-sized picels from 1 to 3 (kill msb). + * + * + */ + +/* Inkset for printing in CMYK and 3bit/pixel */ +static const canon_inkset_t canon_4_C7M7Y7K7_inkset[] = { + {'C',1.0,&canon_3b_7l_ink}, + {'M',1.0,&canon_3b_7l_ink}, + {'Y',1.0,&canon_3b_7l_ink}, + {'K',1.0,&canon_3b_7l_ink} +}; + +/* Inkset for printing in CMYKcm and 1bit/pixel */ +/* FIXME is it really correct that the density of the CM inks is lowered? */ +static const canon_inkset_t canon_6_C2M2Y2K2c2m2_inkset[] = { + {'C',0.25,&canon_1b_2l_ink}, + {'M',0.26,&canon_1b_2l_ink}, + {'Y',1.0,&canon_1b_2l_ink}, + {'K',1.0,&canon_1b_2l_ink}, + {'c',1.0,&canon_1b_2l_ink}, + {'m',1.0,&canon_1b_2l_ink} +}; + +/* Inkset for printing in CMYKcm and 2bit/pixel */ +/* FIXME is it really correct that the density of the CM inks is lowered? */ +static const canon_inkset_t canon_6_C4M4Y4K4c4m4_inkset[] = { + {'C',0.33,&canon_2b_4l_ink}, + {'M',0.33,&canon_2b_4l_ink}, + {'Y',1.0,&canon_2b_4l_ink}, + {'K',1.0,&canon_2b_4l_ink}, + {'c',1.0,&canon_2b_4l_ink}, + {'m',1.0,&canon_2b_4l_ink} +}; + +/* Inkset for printing in CMYKcm and 3bit/pixel */ +/* FIXME is it really correct that the density of the CM inks is lowered? */ +static const canon_inkset_t canon_6_C7M7Y7K7c7m7_inkset[] = { + {'C',0.33,&canon_3b_7l_ink}, + {'M',0.33,&canon_3b_7l_ink}, + {'Y',1.0,&canon_3b_7l_ink}, + {'K',1.0,&canon_3b_7l_ink}, + {'c',1.0,&canon_3b_7l_ink}, + {'m',1.0,&canon_3b_7l_ink} +}; + +static const canon_inkset_t canon_9_C3M3Y2K2_inkset[] = { + {'C',1.0,&canon_2b_3l_ink}, + {'M',1.0,&canon_2b_3l_ink}, + {'Y',1.0,&canon_1b_2l_ink}, + {'K',1.0,&canon_1b_2l_ink}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, +}; + +static const canon_inkset_t canon_9_C3M3Y2K2_c_inkset[] = { + {'C',1.0,&canon_2b_3l_c_ink}, + {'M',1.0,&canon_2b_3l_c_ink}, + {'Y',1.0,&canon_1b_2l_ink}, + {'K',1.0,&canon_1b_2l_ink}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL} +}; + +static const canon_inkset_t canon_9_C3M3Y2K2k3_c_inkset[] = { + {'C',1.0,&canon_2b_3l_c_ink}, + {'M',1.0,&canon_2b_3l_c_ink}, + {'Y',1.0,&canon_1b_2l_ink}, + {'K',1.0,&canon_1b_2l_ink}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {'k',0.0,&canon_2b_3l_c_ink}, /* even though we won't use the photo black in this mode its parameters have to be set */ + {0,0.0,NULL} +}; + +static const canon_inkset_t canon_9_C4M4Y4K2c4m4k4_inkset[] = { + {'C',1.0,&canon_2b_4l_ink}, + {'M',1.0,&canon_2b_4l_ink}, + {'Y',1.0,&canon_2b_4l_ink}, + {'K',1.0,&canon_1b_2l_ink}, + {'c',0.5,&canon_2b_4l_ink}, + {'m',0.5,&canon_2b_4l_ink}, + {0,0.0,NULL}, + {'k',0.5,&canon_2b_4l_ink}, + {0,0.0,NULL} +}; + +static const canon_inkset_t canon_9_C8M8Y8c16m16k8_inkset[] = { + {'C',1.0,&canon_4b_8l_ink}, + {'M',1.0,&canon_4b_8l_ink}, + {'Y',1.0,&canon_4b_8l_ink}, + {0,0.0,NULL}, + {'c',0.5,&canon_4b_16l_ink}, + {'m',0.5,&canon_4b_16l_ink}, + {0,0.0,NULL}, + {'k',1.0,&canon_4b_8l_ink}, + {0,0.0,NULL} +}; + +static const canon_inkset_t canon_13_C3M3Y2K2_inkset[] = { + {'C',1.0,&canon_2b_3l_ink}, + {'M',1.0,&canon_2b_3l_ink}, + {'Y',1.0,&canon_1b_2l_ink}, + {'K',1.0,&canon_1b_2l_ink}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, +}; + +static const canon_inkset_t canon_19_C3M3Y3k3_inkset[] = { + {'C',1.0,&canon_2b_3l_ink}, + {'M',1.0,&canon_2b_3l_ink}, + {'Y',1.0,&canon_2b_3l_ink}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {'k',1.0,&canon_2b_3l_ink}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, +}; + +static const canon_inkset_t canon_22_C3M3Y2K2k3_c_inkset[] = { + {'C',1.0,&canon_2b_3l_c_ink}, + {'M',1.0,&canon_2b_3l_c_ink}, + {'Y',1.0,&canon_1b_2l_ink}, + {'K',1.0,&canon_1b_2l_ink}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {'k',0.0,&canon_2b_3l_c_ink}, /* even though we won't use the photo black in this mode its parameters have to be set */ + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, +}; + +static const canon_inkset_t canon_22_C4M4Y4K2c4m4k4_inkset[] = { + {'C',1.0,&canon_2b_4l_ink}, + {'M',1.0,&canon_2b_4l_ink}, + {'Y',1.0,&canon_2b_4l_ink}, + {'K',1.0,&canon_1b_2l_ink}, + {'c',0.5,&canon_2b_4l_ink}, + {'m',0.5,&canon_2b_4l_ink}, + {0,0.0,NULL}, + {'k',0.0,&canon_2b_4l_ink}, /* even though we won't use the photo black in this mode its parameters have to be set */ + {0,0.0,NULL}, + {0,0.0,NULL}, + {0xa3,0.0,&canon_2b_4l_ink}, + {0xad,0.0,&canon_2b_4l_ink}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, + {0,0.0,NULL}, +}; + +#endif + diff --git a/src/main/canon-media.h b/src/main/canon-media.h new file mode 100644 index 0000000..d6ed971 --- /dev/null +++ b/src/main/canon-media.h @@ -0,0 +1,146 @@ +/* + * Print plug-in CANON BJL driver for the GIMP. + * + * Copyright 1997-2000 Michael Sweet (mike@easysw.com), + * Robert Krawitz (rlk@alum.mit.edu) and + * Andy Thaller (thaller@ph.tum.de) + * Copyright (c) 2006 Sascha Sommer (saschasommer@freenet.de) + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the Free + * Software Foundation; either version 2 of the License, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +/* This file contains the definitions for the possible Media Types + TODO: Color Correction and Density adjustment +*/ + +#ifndef GUTENPRINT_INTERNAL_CANON_MEDIA_H +#define GUTENPRINT_INTERNAL_CANON_MEDIA_H + +/* media related structs */ + + +/* media slots */ + +typedef struct { + const char* name; + const char* text; + unsigned char code; +} canon_slot_t; + +typedef struct { + const char *name; + short count; + const canon_slot_t *slots; +} canon_slotlist_t; + +#define DECLARE_SLOTS(name) \ +static const canon_slotlist_t name##_slotlist = { \ + #name, \ + sizeof(name##_slots) / sizeof(canon_slot_t), \ + name##_slots \ +} + + +static const canon_slot_t canon_default_slots[] = { + { "Auto", N_ ("Auto Sheet Feeder"), 4 }, + { "Manual", N_ ("Manual with Pause"), 0 }, + { "ManualNP", N_ ("Manual without Pause"), 1 }, + { "Cassette", N_ ("Cassette"), 8 }, + { "CD", N_ ("CD tray"), 10 }, +}; +DECLARE_SLOTS(canon_default); + + +static const canon_slot_t canon_PIXMA_iP4000_slots[] = { + { "SelectKey", N_ ("Selected by Paper Select Key"), 3 }, + { "Auto", N_ ("Auto Sheet Feeder"), 4 }, + { "Cassette", N_ ("Cassette"), 0x8 }, + { "CD", N_ ("CD tray"), 10 }, + { "AutoSwitch", N_ ("Automatic Paper Source Switching"), 15 }, +}; +DECLARE_SLOTS(canon_PIXMA_iP4000); + +/* media types */ + +typedef struct { + const char *name; /* Internal Name may not contain spaces */ + const char *text; /* Translateable name */ + unsigned char media_code_c; /* Media Code used for the ESC (c (SetColor) command */ + unsigned char media_code_l; /* Media Code used for the ESC (l (SetTray) command */ + unsigned int qualities; +#define Q0 0 /* lowest quality */ +#define Q1 1 +#define Q2 2 +#define Q3 4 +#define Q4 8 /* highest quality */ + double base_density; + double k_lower_scale; + double k_upper; + const char *hue_adjustment; + const char *lum_adjustment; + const char *sat_adjustment; +} canon_paper_t; + +typedef struct { + const char *name; + short count; + const canon_paper_t *papers; +} canon_paperlist_t; + +#define DECLARE_PAPERS(name) \ +static const canon_paperlist_t name##_paperlist = { \ + #name, \ + sizeof(name##_papers) / sizeof(canon_paper_t), \ + name##_papers \ +} + + +/* paperlists for the various printers. The first entry will be the default */ + +static const canon_paper_t canon_default_papers[] = { + { "Plain", N_ ("Plain Paper"), 0x00, 0x00,Q2,0.50, 0.25, 0.500, 0, 0, 0 }, + { "Transparency", N_ ("Transparencies"), 0x02, 0x02,Q2,1.00, 1.00, 0.900, 0, 0, 0 }, + { "BackPrint", N_ ("Back Print Film"), 0x03, 0x03,Q2,1.00, 1.00, 0.900, 0, 0, 0 }, + { "Fabric", N_ ("Fabric Sheets"), 0x04, 0x04,Q2,0.50, 0.25, 0.500, 0, 0, 0 }, + { "Envelope", N_ ("Envelope"), 0x08, 0x08,Q2,0.50, 0.25, 0.500, 0, 0, 0 }, + { "Coated", N_ ("High Resolution Paper"), 0x07, 0x07,Q2,0.78, 0.25, 0.500, 0, 0, 0 }, + { "TShirt", N_ ("T-Shirt Transfers"), 0x03, 0x03,Q2,0.50, 0.25, 0.500, 0, 0, 0 }, + { "GlossyFilm", N_ ("High Gloss Film"), 0x06, 0x06,Q2,1.00, 1.00, 0.999, 0, 0, 0 }, + { "GlossyPaper", N_ ("Glossy Photo Paper"), 0x05, 0x05,Q2,1.00, 1.00, 0.999, 0, 0, 0 }, + { "GlossyCard", N_ ("Glossy Photo Cards"), 0x0a, 0x0a,Q2,1.00, 1.00, 0.999, 0, 0, 0 }, + { "GlossyPro", N_ ("Photo Paper Pro"), 0x09, 0x09,Q2,1.00, 1.00, 0.999, 0, 0, 0 }, + { "Other", N_ ("Other"), 0x00, 0x00,Q2,0.50, 0.25, .5, 0, 0, 0 }, +}; +DECLARE_PAPERS(canon_default); + +static const canon_paper_t canon_PIXMA_iP4000_papers[] = { + { "Plain", N_ ("Plain Paper"), 0x00,0x00,Q0|Q1|Q2|Q3,1.00, 0.25, 0.500, 0, 0, 0 }, + { "Transparency", N_ ("Transparencies"), 0x02,0x02,Q2|Q3,0.78, 0.25, 0.500, 0, 0, 0 }, + { "TShirt", N_ ("T-Shirt Transfers"), 0x03,0x03,Q2,0.78, 0.25, 0.500, 0, 0, 0 }, + { "GlossyPaper", N_ ("Glossy Photo Paper"), 0x05,0x05,Q2|Q3,0.78, 0.25, 0.500, 0, 0, 0 }, + { "Coated", N_ ("High Resolution Paper"), 0x07,0x07,Q2|Q3,0.78, 0.25, 0.500, 0, 0, 0 }, + { "Envelope", N_ ("Envelope"), 0x08,0x08,Q2|Q3,0.78, 0.25, 0.500, 0, 0, 0 }, + { "PhotopaperPro", N_ ("Professional Photo Paper"), 0x09,0x0d,Q2|Q3|Q4,0.78, 0.25, 0.500, 0, 0, 0 }, + { "PhotopaperMatte", N_ ("Photo Paper Matte"), 0x0a,0x10,Q2|Q3,0.78, 0.25, 0.500, 0, 0, 0 }, + { "PhotopaperPlus", N_ ("Glossy Photo Paper Plus"), 0x0b,0x11,Q1|Q2|Q3,0.78, 0.25, 0.500, 0, 0, 0 }, + { "CD", N_ ("CD"), 0x00,0x12,Q2|Q3|Q4,0.78, 0.25, 0.500, 0, 0, 0 }, + /* FIXME media code for c) should be 0x0c for CD but this will restrict CD printing to a single, not well supported, resolution */ + { "PhotopaperOther", N_ ("Other Photo Paper"), 0x0f,0x14,Q2,0.78, 0.25, 0.500, 0, 0, 0 }, + { "PhotopaperPlusDouble", N_ ("Photoper Plus Double-Sided"), 0x10,0x15,Q2|Q3,0.78, 0.25, 0.500, 0, 0, 0 }, +}; +DECLARE_PAPERS(canon_PIXMA_iP4000); + +#endif + diff --git a/src/main/canon-modes.h b/src/main/canon-modes.h new file mode 100644 index 0000000..42e7f8b --- /dev/null +++ b/src/main/canon-modes.h @@ -0,0 +1,285 @@ +/* + * Print plug-in CANON BJL driver for the GIMP. + * + * Copyright 1997-2000 Michael Sweet (mike@easysw.com), + * Robert Krawitz (rlk@alum.mit.edu) and + * Andy Thaller (thaller@ph.tum.de) + * Copyright (c) 2006 - 2007 Sascha Sommer (saschasommer@freenet.de) + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the Free + * Software Foundation; either version 2 of the License, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +/* This file contains definitions for the various printmodes +*/ + +#ifndef GUTENPRINT_INTERNAL_CANON_MODES_H +#define GUTENPRINT_INTERNAL_CANON_MODES_H + +/* delay settings + sometimes the raster data has to be sent + | K | + | C | + | M | + | Y | + instead of + | K + | C + | M + | Y + + following tables can be used to account for this + +*/ + +typedef struct { + unsigned char color; + unsigned int delay; +} canon_delay_t; + +/* delay settings for the different printmodes last entry has to be {0,0} */ +static const canon_delay_t delay_1440[] = {{'C',112},{'M',224},{'Y',336},{'c',112},{'m',224},{'y',336},{0,0}}; +static const canon_delay_t delay_S200[] = {{'C',0x30},{'M',0x50},{'Y',0x70},{0,0}}; + + + +/* + * A printmode is defined by its resolution (xdpi x ydpi), the inkset + * and the installed printhead. + * + * For a hereby defined printmode we specify the density and gamma multipliers + * and the ink definition with optional adjustments for lum, hue and sat + * + */ +typedef struct { + const int xdpi; /* horizontal resolution */ + const int ydpi; /* vertical resolution */ + const unsigned int ink_types; /* the used color channels */ + const char* name; /* internal name do not translate, must not contain spaces */ + const char* text; /* description */ + const int num_inks; + const canon_inkset_t *inks; /* ink definition */ + const unsigned int flags; +#define MODE_FLAG_WEAVE 0x1 /* this mode requires weaving */ +#define MODE_FLAG_EXTENDED_T 0x2 /* this mode requires extended color settings in the esc t) command */ +#define MODE_FLAG_CD 0x4 /* this mode can be used to print to cds */ + const canon_delay_t* delay; /* delay settings for this printmode */ + const double density; /* density multiplier */ + const double gamma; /* gamma multiplier */ + const char *lum_adjustment; /* optional lum adj. */ + const char *hue_adjustment; /* optional hue adj. */ + const char *sat_adjustment; /* optional sat adj. */ +} canon_mode_t; + +#define INKSET(a) sizeof(canon_##a##_inkset)/sizeof(canon_inkset_t),canon_##a##_inkset + + +typedef struct { + const char *name; + const short count; + const short default_mode; + const canon_mode_t *modes; +} canon_modelist_t; + +#define DECLARE_MODES(name,default_mode) \ +static const canon_modelist_t name##_modelist = { \ + #name, \ + sizeof(name##_modes) / sizeof(canon_mode_t), \ + default_mode, \ + name##_modes \ +} + + +/* modelist for every printer,modes ordered by ascending resolution ink_type and quality */ +static const canon_mode_t canon_BJC_30_modes[] = { + { 180, 180,CANON_INK_K,"180x180dpi",N_("180x180 DPI"),INKSET(1_K2),0,NULL,1.0,1.0,NULL,NULL,NULL}, + { 360, 360,CANON_INK_K,"360x360dpi",N_("360x360 DPI"),INKSET(1_K2),0,NULL,1.0,1.0,NULL,NULL,NULL}, + { 720, 360,CANON_INK_K,"720x360dpi",N_("720x360 DPI"),INKSET(1_K2),0,NULL,1.0,1.0,NULL,NULL,NULL}, +}; +DECLARE_MODES(canon_BJC_30,0); + + +static const canon_mode_t canon_BJC_85_modes[] = { + { 360, 360,CANON_INK_K | CANON_INK_CMYK | CANON_INK_CcMmYK, + "360x360dpi",N_("360x360 DPI"),INKSET(6_C2M2Y2K2c2m2),0,NULL,1.0,1.0,NULL,NULL,NULL}, + { 360, 360,CANON_INK_K | CANON_INK_CMYK | CANON_INK_CcMmYK, + "360x360dmt",N_("360x360 DPI DMT"),INKSET(6_C4M4Y4K4c4m4),0,NULL,1.0,1.0,NULL,NULL,NULL}, + { 720, 360,CANON_INK_K | CANON_INK_CMYK | CANON_INK_CcMmYK, + "720x360dpi",N_("720x360 DPI"),INKSET(6_C2M2Y2K2c2m2),0,NULL,1.0,1.0,NULL,NULL,NULL}, +}; +DECLARE_MODES(canon_BJC_85,0); + + +/* we treat the printers that can either print in K or CMY as CMYK printers here by assigning a CMYK inkset */ +static const canon_mode_t canon_BJC_210_modes[] = { + { 90, 90,CANON_INK_K | CANON_INK_CMY,"90x90dpi",N_("90x90 DPI"),INKSET(4_C2M2Y2K2),0,NULL,1.0,1.0,NULL,NULL,NULL}, + { 180, 180,CANON_INK_K | CANON_INK_CMY,"180x180dpi",N_("180x180 DPI"),INKSET(4_C2M2Y2K2),0,NULL,1.0,1.0,NULL,NULL,NULL}, + { 360, 360,CANON_INK_K | CANON_INK_CMY,"360x360dpi",N_("360x360 DPI"),INKSET(4_C2M2Y2K2),0,NULL,1.0,1.0,NULL,NULL,NULL}, + { 720, 360,CANON_INK_K | CANON_INK_CMY,"720x360dpi",N_("720x360 DPI"),INKSET(4_C2M2Y2K2),0,NULL,1.0,1.0,NULL,NULL,NULL}, +}; +DECLARE_MODES(canon_BJC_210,0); + + +static const canon_mode_t canon_BJC_240_modes[] = { + { 90, 90,CANON_INK_K | CANON_INK_CMY,"90x90dpi",N_("90x90 DPI"),INKSET(4_C2M2Y2K2),0,NULL,1.0,1.0,NULL,NULL,NULL}, + { 180, 180,CANON_INK_K | CANON_INK_CMY,"180x180dpi",N_("180x180 DPI"),INKSET(4_C2M2Y2K2),0,NULL,1.0,1.0,NULL,NULL,NULL}, + { 360, 360,CANON_INK_K | CANON_INK_CMY,"360x360dpi",N_("360x360 DPI"),INKSET(4_C2M2Y2K2),0,NULL,1.0,1.0,NULL,NULL,NULL}, + { 360, 360,CANON_INK_K | CANON_INK_CMY,"360x360dmt",N_("360x360 DMT"),INKSET(4_C4M4Y4K4),0,NULL,1.0,1.0,NULL,NULL,NULL}, + { 720, 360,CANON_INK_K | CANON_INK_CMY,"720x360dpi",N_("720x360 DPI"),INKSET(4_C2M2Y2K2),0,NULL,1.0,1.0,NULL,NULL,NULL}, +}; +DECLARE_MODES(canon_BJC_240,0); + + +static const canon_mode_t canon_BJC_2000_modes[] = { + { 180, 180,CANON_INK_CMYK,"180x180dpi",N_("180x180 DPI"),INKSET(4_C2M2Y2K2),0,NULL,1.0,1.0,NULL,NULL,NULL}, + { 360, 360,CANON_INK_CMYK,"360x360dpi",N_("360x360 DPI"),INKSET(4_C2M2Y2K2),0,NULL,1.0,1.0,NULL,NULL,NULL}, +}; +DECLARE_MODES(canon_BJC_2000,0); + + +static const canon_mode_t canon_BJC_3000_modes[] = { + { 360, 360,CANON_INK_CMYK | CANON_INK_CcMmYK,"360x360dpi",N_("360x360 DPI"),INKSET(6_C2M2Y2K2c2m2),0,NULL,1.0,1.0,NULL,NULL,NULL}, + { 360, 360,CANON_INK_CMYK | CANON_INK_CcMmYK,"360x360dmt",N_("360x360 DPI DMT"),INKSET(6_C4M4Y4K4c4m4),0,NULL,1.0,1.0,NULL,NULL,NULL}, + { 720, 720,CANON_INK_CMYK | CANON_INK_CcMmYK,"720x720dpi",N_("720x720 DPI"),INKSET(6_C2M2Y2K2c2m2),0,NULL,1.0,1.0,NULL,NULL,NULL}, + { 1440, 720,CANON_INK_CMYK | CANON_INK_CcMmYK,"1440x720dpi",N_("1440x720 DPI"),INKSET(6_C2M2Y2K2c2m2),0,delay_1440,1.0,1.0,NULL,NULL,NULL}, +}; +DECLARE_MODES(canon_BJC_3000,0); + + +static const canon_mode_t canon_BJC_4300_modes[] = { + { 360, 360,CANON_INK_CMYK | CANON_INK_CcMmYK,"360x360dpi",N_("360x360 DPI"),INKSET(6_C2M2Y2K2c2m2),0,NULL,1.0,1.0,NULL,NULL,NULL}, + { 360, 360,CANON_INK_CMYK | CANON_INK_CcMmYK,"360x360dmt",N_("360x360 DPI DMT"),INKSET(6_C4M4Y4K4c4m4),0,NULL,1.0,1.0,NULL,NULL,NULL}, + { 720, 720,CANON_INK_CMYK | CANON_INK_CcMmYK,"720x720dpi",N_("720x720 DPI"),INKSET(6_C2M2Y2K2c2m2),0,NULL,1.0,1.0,NULL,NULL,NULL}, + { 1440, 720,CANON_INK_CMYK | CANON_INK_CcMmYK,"1440x720dpi",N_("1440x720 DPI"),INKSET(6_C2M2Y2K2c2m2),0,delay_1440,1.0,1.0,NULL,NULL,NULL}, +}; +DECLARE_MODES(canon_BJC_4300,0); + + + +static const canon_mode_t canon_BJC_4400_modes[] = { + { 360, 360,CANON_INK_K | CANON_INK_CMYK | CANON_INK_CcMmYK, + "360x360dpi",N_("360x360 DPI"),INKSET(6_C2M2Y2K2c2m2),0,NULL,1.0,1.0,NULL,NULL,NULL}, + { 720, 360,CANON_INK_K | CANON_INK_CMYK | CANON_INK_CcMmYK, + "720x360dpi",N_("720x360 DPI"),INKSET(6_C2M2Y2K2c2m2),0,NULL,1.0,1.0,NULL,NULL,NULL}, +}; +DECLARE_MODES(canon_BJC_4400,0); + + +static const canon_mode_t canon_BJC_5500_modes[] = { + { 180, 180,CANON_INK_CMYK | CANON_INK_CcMmYK,"180x180dpi",N_("180x180 DPI"),INKSET(6_C2M2Y2K2c2m2),0,NULL,1.0,1.0,NULL,NULL,NULL}, + { 360, 360,CANON_INK_CMYK | CANON_INK_CcMmYK,"360x360dpi",N_("360x360 DPI"),INKSET(6_C2M2Y2K2c2m2),0,NULL,1.0,1.0,NULL,NULL,NULL}, +}; +DECLARE_MODES(canon_BJC_5500,0); + + +static const canon_mode_t canon_BJC_6000_modes[] = { + { 360, 360,CANON_INK_CMYK | CANON_INK_CcMmYK,"360x360dpi",N_("360x360 DPI"),INKSET(6_C2M2Y2K2c2m2),0,NULL,1.8,1.0,NULL,NULL,NULL}, + { 360, 360,CANON_INK_CMYK | CANON_INK_CcMmYK,"360x360dmt",N_("360x360 DPI DMT"),INKSET(6_C4M4Y4K4c4m4),0,NULL,1.8,1.0,NULL,NULL,NULL}, + { 720, 720,CANON_INK_CMYK | CANON_INK_CcMmYK,"720x720dpi",N_("720x720 DPI"),INKSET(6_C2M2Y2K2c2m2),0,NULL,1.0,1.0,NULL,NULL,NULL}, + { 1440, 720,CANON_INK_CMYK | CANON_INK_CcMmYK,"1440x720dpi",N_("1440x720 DPI"),INKSET(6_C2M2Y2K2c2m2),0,delay_1440,0.5,1.0,NULL,NULL,NULL}, +}; +DECLARE_MODES(canon_BJC_6000,0); + + +static const canon_mode_t canon_BJC_7000_modes[] = { + { 300, 300,CANON_INK_CMYK | CANON_INK_CcMmYyK,"300x300dpi",N_("300x300 DPI"),INKSET(6_C2M2Y2K2c2m2),0,NULL,3.5,1.0,NULL,NULL,NULL}, + { 600, 600,CANON_INK_CMYK | CANON_INK_CcMmYyK,"600x600dpi",N_("600x600 DPI"),INKSET(6_C2M2Y2K2c2m2),0,NULL,1.8,1.0,NULL,NULL,NULL}, + { 1200, 600,CANON_INK_CMYK | CANON_INK_CcMmYyK,"1200x600dpi",N_("1200x600 DPI"),INKSET(6_C2M2Y2K2c2m2),0,NULL,1.0,1.0,NULL,NULL,NULL}, +}; +DECLARE_MODES(canon_BJC_7000,0); + + +static const canon_mode_t canon_BJC_7100_modes[] = { + { 300, 300,CANON_INK_CMYK | CANON_INK_CcMmYyK,"300x300dpi",N_("300x300 DPI"),INKSET(6_C2M2Y2K2c2m2),0,NULL,1.0,1.0,NULL,NULL,NULL}, + { 600, 600,CANON_INK_CMYK | CANON_INK_CcMmYyK,"600x600dpi",N_("600x600 DPI"),INKSET(6_C2M2Y2K2c2m2),0,NULL,1.0,1.0,NULL,NULL,NULL}, + { 1200, 600,CANON_INK_CMYK | CANON_INK_CcMmYyK,"1200x600dpi",N_("1200x600 DPI"),INKSET(6_C2M2Y2K2c2m2),0,NULL,1.0,1.0,NULL,NULL,NULL}, +}; +DECLARE_MODES(canon_BJC_7100,0); + +static const canon_mode_t canon_BJC_8200_modes[] = { + { 300, 300,CANON_INK_CMYK,"300x300dpi",N_("300x300 DPI"),INKSET(6_C2M2Y2K2c2m2),0,NULL,1.0,1.0,NULL,NULL,NULL}, + { 600, 600,CANON_INK_CMYK,"600x600dpi",N_("600x600 DPI"),INKSET(6_C2M2Y2K2c2m2),0,NULL,1.0,1.0,NULL,NULL,NULL}, + { 1200,1200,CANON_INK_CMYK,"1200x1200dpi",N_("1200x1200 DPI"),INKSET(6_C2M2Y2K2c2m2),0,NULL,1.0,1.0,NULL,NULL,NULL}, +}; +DECLARE_MODES(canon_BJC_8200,0); + + +static const canon_mode_t canon_BJC_8500_modes[] = { + { 300, 300,CANON_INK_CMYK | CANON_INK_CcMmYK,"300x300dpi",N_("300x300 DPI"),INKSET(6_C2M2Y2K2c2m2),0,NULL,1.0,1.0,NULL,NULL,NULL}, + { 600, 600,CANON_INK_CMYK | CANON_INK_CcMmYK,"600x600dpi",N_("600x600 DPI"),INKSET(6_C2M2Y2K2c2m2),0,NULL,1.0,1.0,NULL,NULL,NULL}, +}; +DECLARE_MODES(canon_BJC_8500,0); + + +static const canon_mode_t canon_S200_modes[] = { + { 360, 360,CANON_INK_CMYK | CANON_INK_CMY | CANON_INK_K, + "360x360dpi",N_("360x360 DPI"),INKSET(4_C2M2Y2K2),0,delay_S200,2.0,1.0,NULL,NULL,NULL}, + { 720, 720,CANON_INK_CMYK | CANON_INK_CMY | CANON_INK_K, + "720x720dpi",N_("720x720 DPI"),INKSET(4_C2M2Y2K2),MODE_FLAG_WEAVE,delay_S200,1.0,1.0,NULL,NULL,NULL}, + { 1440, 720,CANON_INK_CMYK | CANON_INK_CMY | CANON_INK_K, + "1440x720dpi",N_("1440x720 DPI"),INKSET(4_C2M2Y2K2),MODE_FLAG_WEAVE,delay_S200,0.5,1.0,NULL,NULL,NULL}, + { 1440,1440,CANON_INK_CMYK | CANON_INK_CMY | CANON_INK_K, + "1440x1440dpi",N_("1440x1440 DPI"),INKSET(4_C2M2Y2K2),MODE_FLAG_WEAVE,delay_S200,0.3,1.0,NULL,NULL,NULL}, +}; +DECLARE_MODES(canon_S200,0); + + +static const canon_mode_t canon_PIXMA_iP2000_modes[] = { + { 600, 600,CANON_INK_CMYK,"600x600dpi",N_("600x600 DPI"),INKSET(9_C3M3Y2K2),MODE_FLAG_EXTENDED_T,NULL,1.0,1.0,NULL,NULL,NULL}, +}; +DECLARE_MODES(canon_PIXMA_iP2000,0); + + +static const canon_mode_t canon_PIXMA_iP3000_modes[] = { + { 600, 600,CANON_INK_CMYK,"600x600dpi",N_("600x600 DPI"),INKSET(9_C3M3Y2K2_c),MODE_FLAG_EXTENDED_T,NULL,1.0,1.0,NULL,NULL,NULL}, +}; +DECLARE_MODES(canon_PIXMA_iP3000,0); + + +static const canon_mode_t canon_PIXMA_iP4000_modes[] = { + { 300, 300,CANON_INK_CMYK,"300x300dpi",N_("300x300 DPI"),INKSET(4_C2M2Y2K2),0,NULL,1.0,1.0,NULL,NULL,NULL}, + { 600, 600,CANON_INK_CMYK,"600x600dpi_draft",N_("600x600 DPI DRAFT"),INKSET(4_C2M2Y2K2),0,NULL,1.0,1.0,NULL,NULL,NULL}, + { 600, 600,CANON_INK_CMYK,"600x600dpi",N_("600x600 DPI"),INKSET(9_C3M3Y2K2k3_c),MODE_FLAG_EXTENDED_T,NULL,1.0,1.0,NULL,NULL,NULL}, +/* { 600, 600,CANON_INK_CcMmYyK,"600x600dpi_high",N_("600x600 DPI HIGH"),INKSET(9_C4M4Y4K2c4m4k4),MODE_FLAG_EXTENDED_T|MODE_FLAG_CD,NULL,1.0,1.0,NULL,NULL,NULL},*/ /* this mode is used for CD printing, K is ignored by the printer then, the seperation between the small and large dot inks needs more work */ +/* { 600, 600,CANON_INK_CcMmYyK,"600x600dpi_superphoto",N_("600x600 DPI Superphoto"),INKSET(9_C8M8Y8c16m16k8),MODE_FLAG_EXTENDED_T,NULL,1.0,1.0,NULL,NULL,NULL}, */ +}; +DECLARE_MODES(canon_PIXMA_iP4000,2); + + +static const canon_mode_t canon_PIXMA_iP4200_modes[] = { + { 600, 600,CANON_INK_CMYK,"600x600dpi",N_("600x600 DPI"),INKSET(22_C3M3Y2K2k3_c),MODE_FLAG_EXTENDED_T,NULL,1.0,1.0,NULL,NULL,NULL}, + /* { 600, 600,CANON_INK_CcMmYyK,"600x600dpi_high",N_("600x600 DPI HIGH"),INKSET(22_C4M4Y4K2c4m4k4),MODE_FLAG_EXTENDED_T|MODE_FLAG_CD,NULL,1.0,1.0,NULL,NULL,NULL}, */ +}; +DECLARE_MODES(canon_PIXMA_iP4200,0); + + +static const canon_mode_t canon_PIXMA_iP6700_modes[] = { + { 600, 600,CANON_INK_CMYK,"600x600dpi",N_("600x600 DPI"),INKSET(19_C3M3Y3k3),MODE_FLAG_EXTENDED_T,NULL,1.0,1.0,NULL,NULL,NULL}, +}; +DECLARE_MODES(canon_PIXMA_iP6700,0); + + +static const canon_mode_t canon_MULTIPASS_MP150_modes[] = { + { 600, 600,CANON_INK_CMYK,"600x600dpi",N_("600x600 DPI"),INKSET(13_C3M3Y2K2),MODE_FLAG_EXTENDED_T,NULL,1.0,1.0,NULL,NULL,NULL}, +}; +DECLARE_MODES(canon_MULTIPASS_MP150,0); + + +static const canon_mode_t canon_MULTIPASS_MP830_modes[] = { + { 600, 600,CANON_INK_CMYK,"600x600dpi",N_("600x600 DPI"),INKSET(4_C2M2Y2K2),0,NULL,1.0,1.0,NULL,NULL,NULL}, +}; +DECLARE_MODES(canon_MULTIPASS_MP830,0); + +#endif + diff --git a/src/main/canon-printers.h b/src/main/canon-printers.h new file mode 100644 index 0000000..82a0536 --- /dev/null +++ b/src/main/canon-printers.h @@ -0,0 +1,519 @@ +/* + * Print plug-in CANON BJL driver for the GIMP. + * + * Copyright 1997-2000 Michael Sweet (mike@easysw.com), + * Robert Krawitz (rlk@alum.mit.edu) and + * Andy Thaller (thaller@ph.tum.de) + * Copyright (c) 2006 Sascha Sommer (saschasommer@freenet.de) + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the Free + * Software Foundation; either version 2 of the License, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + */ + +/* This file contains the capabilities of the various canon printers +*/ + +#ifndef GUTENPRINT_INTERNAL_CANON_PRINTERS_H +#define GUTENPRINT_INTERNAL_CANON_PRINTERS_H + + +typedef struct canon_caps { + int model; /* model number as used in printers.xml */ + int model_id; /* model ID code for use in commands */ + int max_width; /* maximum printable paper size */ + int max_height; + int border_left; /* left margin, points */ + int border_right; /* right margin, points */ + int border_top; /* absolute top margin, points */ + int border_bottom; /* absolute bottom margin, points */ + const canon_slotlist_t* slotlist; /*available paperslots */ + unsigned long features; /* special bjl settings */ + unsigned char ESC_r_arg; /* argument used for the ESC (r command during init */ + const char** control_cmdlist; + const canon_modelist_t* modelist; + const canon_paperlist_t* paperlist; + const char *lum_adjustment; + const char *hue_adjustment; + const char *sat_adjustment; +} canon_cap_t; + +static const char standard_sat_adjustment[] = +"\n" +"\n" +"\n" +"\n" +/* C */ "1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 " /* B */ +/* B */ "1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 " /* M */ +/* M */ "1.00 0.95 0.90 0.90 0.90 0.90 0.90 0.90 " /* R */ +/* R */ "0.90 0.95 0.95 1.00 1.00 1.00 1.00 1.00 " /* Y */ +/* Y */ "1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 " /* G */ +/* G */ "1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 " /* C */ +"\n" +"\n" +"\n"; + +static const char standard_lum_adjustment[] = +"\n" +"\n" +"\n" +"\n" +/* C */ "0.65 0.67 0.70 0.72 0.77 0.80 0.82 0.85 " /* B */ +/* B */ "0.87 0.86 0.82 0.79 0.79 0.82 0.85 0.88 " /* M */ +/* M */ "0.92 0.95 0.96 0.97 0.97 0.97 0.96 0.96 " /* R */ +/* R */ "0.96 0.97 0.97 0.98 0.99 1.00 1.00 1.00 " /* Y */ +/* Y */ "1.00 0.97 0.95 0.94 0.93 0.92 0.90 0.86 " /* G */ +/* G */ "0.79 0.76 0.71 0.68 0.68 0.68 0.68 0.66 " /* C */ +"\n" +"\n" +"\n"; + +static const char standard_hue_adjustment[] = +"\n" +"\n" +"\n" +"\n" +/* C */ "0.00 0.06 0.10 0.10 0.06 -.01 -.09 -.17 " /* B */ +/* B */ "-.25 -.33 -.38 -.38 -.36 -.34 -.34 -.34 " /* M */ +/* M */ "-.34 -.34 -.36 -.40 -.50 -.40 -.30 -.20 " /* R */ +/* R */ "-.12 -.07 -.04 -.02 0.00 0.00 0.00 0.00 " /* Y */ +/* Y */ "0.00 0.00 0.00 -.05 -.10 -.15 -.22 -.24 " /* G */ +/* G */ "-.26 -.30 -.33 -.28 -.25 -.20 -.13 -.06 " /* C */ +"\n" +"\n" +"\n"; + +static const char* control_cmd_ackshort[] = { + "AckTime=Short", + NULL +}; + +static const char* control_cmd_PIXMA_iP4000[] = { +/*"SetTime=20060722092503", */ /*what is this for?*/ + "SetSilent=OFF", + "PEdgeDetection=ON", + "SelectParallel=ECP", + NULL +}; + + +static const char* control_cmd_MULTIPASS_MP150[] = { + "AckTime=Short", + "MediaDetection=ON", + NULL +}; + +static const canon_cap_t canon_model_capabilities[] = +{ + /* ******************************** */ + /* */ + /* tested and color-adjusted models */ + /* */ + /* ******************************** */ + + + + + /* ************************************ */ + /* */ + /* tested models w/out color-adjustment */ + /* */ + /* ************************************ */ + + { /* Canon S200x *//* heads: BC-24 */ + 4202, 3, + 618, 936, /* 8.58" x 13 " */ + 10, 10, 9, 20, + &canon_default_slotlist, + CANON_CAP_STD1 | CANON_CAP_rr,0x61,NULL, + &canon_S200_modelist, + &canon_default_paperlist, + NULL, + NULL, + NULL + }, + + { /* Canon BJC S300 */ + 8201, 3, + 842, 17*72, + 11, 9, 10, 18, + &canon_default_slotlist, + CANON_CAP_STD1 | CANON_CAP_r,0x61,control_cmd_ackshort, + &canon_BJC_8500_modelist, + &canon_default_paperlist, + NULL, + NULL, + NULL + }, + + { /* Canon BJ 30 *//* heads: BC-10 */ + 30, 1, + 9.5*72, 14*72, + 11, 9, 10, 18, + &canon_default_slotlist, + CANON_CAP_STD0 | CANON_CAP_a,0,NULL, + &canon_BJC_30_modelist, + &canon_default_paperlist, + NULL, + NULL, + NULL + }, + { /* Canon BJC 85 *//* heads: BC-20 BC-21 BC-22 */ + 85, 1, + 9.5*72, 14*72, + 11, 9, 10, 18, + &canon_default_slotlist, + CANON_CAP_STD0 | CANON_CAP_a,0,NULL, + &canon_BJC_85_modelist, + &canon_default_paperlist, + NULL, + NULL, + NULL + }, + + { /* Canon BJC 4300 *//* heads: BC-20 BC-21 BC-22 BC-29 */ + 4300, 1, + 618, 936, /* 8.58" x 13 " */ + 11, 9, 10, 18, + &canon_default_slotlist, + CANON_CAP_STD0,0,NULL, + &canon_BJC_4300_modelist, + &canon_default_paperlist, + NULL, + NULL, + NULL + }, + + { /* Canon BJC 4400 *//* heads: BC-20 BC-21 BC-22 BC-29 */ + 4400, 1, + 9.5*72, 14*72, + 11, 9, 10, 18, + &canon_default_slotlist, + CANON_CAP_STD0 | CANON_CAP_a,0,NULL, + &canon_BJC_4400_modelist, + &canon_default_paperlist, + NULL, + NULL, + NULL + }, + + { /* Canon BJC 6000 *//* heads: BC-30/BC-31 BC-32/BC-31 */ + 6000, 3, + 618, 936, /* 8.58" x 13 " */ + 11, 9, 10, 18, + &canon_default_slotlist, + CANON_CAP_STD1,0,control_cmd_ackshort, + &canon_BJC_6000_modelist, + &canon_default_paperlist, + NULL, + NULL, + NULL + }, + + { /* Canon BJC 6200 *//* heads: BC-30/BC-31 BC-32/BC-31 */ + 6200, 3, + 618, 936, /* 8.58" x 13 " */ + 11, 9, 10, 18, + &canon_default_slotlist, + CANON_CAP_STD1,0,control_cmd_ackshort, + &canon_BJC_6000_modelist, + &canon_default_paperlist, + NULL, + NULL, + NULL + }, + + { /* Canon BJC 6500 *//* heads: BC-30/BC-31 BC-32/BC-31 */ + 6500, 3, + 842, 17*72, + 11, 9, 10, 18, + &canon_default_slotlist, + CANON_CAP_STD1,0,NULL, + &canon_BJC_6000_modelist, + &canon_default_paperlist, + NULL, + NULL, + NULL + }, + { /* Canon BJC 8200 *//* heads: BC-50 */ + 8200, 3, + 842, 17*72, + 11, 9, 10, 18, + &canon_default_slotlist, + CANON_CAP_STD1 | CANON_CAP_r,0x61,control_cmd_ackshort, + &canon_BJC_8200_modelist, + &canon_default_paperlist, + NULL, + NULL, + NULL + }, + + + /* *************** */ + /* */ + /* untested models */ + /* */ + /* *************** */ + + { /* Canon BJC 210 *//* heads: BC-02 BC-05 BC-06 */ + 210, 1, + 618, 936, /* 8.58" x 13 " */ + 11, 9, 10, 18, + &canon_default_slotlist, + CANON_CAP_STD0,0,NULL, + &canon_BJC_210_modelist, + &canon_default_paperlist, + NULL, + NULL, + NULL + }, + { /* Canon BJC 240 *//* heads: BC-02 BC-05 BC-06 */ + 240, 1, + 618, 936, /* 8.58" x 13 " */ + 11, 9, 10, 18, + &canon_default_slotlist, + CANON_CAP_STD0,0,NULL, + &canon_BJC_240_modelist, + &canon_default_paperlist, + NULL, + NULL, + NULL + }, + { /* Canon BJC 250 *//* heads: BC-02 BC-05 BC-06 */ + 250, 1, + 618, 936, /* 8.58" x 13 " */ + 11, 9, 10, 18, + &canon_default_slotlist, + CANON_CAP_STD0,0,NULL, + &canon_BJC_240_modelist, + &canon_default_paperlist, + NULL, + NULL, + NULL + }, + { /* Canon BJC 1000 *//* heads: BC-02 BC-05 BC-06 */ + 1000, 1, + 842, 17*72, + 11, 9, 10, 18, + &canon_default_slotlist, + CANON_CAP_STD0 | CANON_CAP_a,0,NULL, + &canon_BJC_240_modelist, + &canon_default_paperlist, + NULL, + NULL, + NULL + }, + { /* Canon BJC 2000 *//* heads: BC-20 BC-21 BC-22 BC-29 */ + 2000, 1, + 842, 17*72, + 11, 9, 10, 18, + &canon_default_slotlist, + CANON_CAP_STD0 | CANON_CAP_a,0,NULL, + &canon_BJC_2000_modelist, + &canon_default_paperlist, + NULL, + NULL, + NULL + }, + { /* Canon BJC 3000 *//* heads: BC-30 BC-33 BC-34 */ + 3000, 3, + 842, 17*72, + 11, 9, 10, 18, + &canon_default_slotlist, + CANON_CAP_STD0 | CANON_CAP_a,0,NULL, /*FIX? should have _r? */ + &canon_BJC_3000_modelist, + &canon_default_paperlist, + NULL, + NULL, + NULL + }, + { /* Canon BJC 6100 *//* heads: BC-30/BC-31 BC-32/BC-31 */ + 6100, 3, + 842, 17*72, + 11, 9, 10, 18, + &canon_default_slotlist, + CANON_CAP_STD1 | CANON_CAP_a | CANON_CAP_r,0x61,NULL, + &canon_BJC_3000_modelist, + &canon_default_paperlist, + NULL, + NULL, + NULL + }, + { /* Canon BJC 7000 *//* heads: BC-60/BC-61 BC-60/BC-62 ??????? */ + 7000, 3, + 842, 17*72, + 11, 9, 10, 18, + &canon_default_slotlist, + CANON_CAP_STD1,0,NULL, + &canon_BJC_7000_modelist, + &canon_default_paperlist, + NULL, + NULL, + NULL + }, + { /* Canon BJC 7100 *//* heads: BC-60/BC-61 BC-60/BC-62 ??????? */ + 7100, 3, + 842, 17*72, + 11, 9, 10, 18, + &canon_default_slotlist, + CANON_CAP_STD0,0,NULL, + &canon_BJC_7100_modelist, + &canon_default_paperlist, + NULL, + NULL, + NULL + }, + + /*****************************/ + /* */ + /* extremely fuzzy models */ + /* (might never work at all) */ + /* */ + /*****************************/ + + { /* Canon BJC 5100 *//* heads: BC-20 BC-21 BC-22 BC-23 BC-29 */ + 5100, 1, + 17*72, 22*72, + 11, 9, 10, 18, + &canon_default_slotlist, + CANON_CAP_STD0,0,NULL, + &canon_BJC_3000_modelist, + &canon_default_paperlist, + NULL, + NULL, + NULL + }, + { /* Canon BJC 5500 *//* heads: BC-20 BC-21 BC-29 */ + 5500, 1, + 22*72, 34*72, + 11, 9, 10, 18, + &canon_default_slotlist, + CANON_CAP_STD0 | CANON_CAP_a,0,NULL, + &canon_BJC_5500_modelist, + &canon_default_paperlist, + NULL, + NULL, + NULL + }, + { /* Canon BJC 6500 *//* heads: BC-30/BC-31 BC-32/BC-31 */ + 6500, 3, + 17*72, 22*72, + 11, 9, 10, 18, + &canon_default_slotlist, + CANON_CAP_STD1 | CANON_CAP_a,0,NULL, + &canon_BJC_3000_modelist, + &canon_default_paperlist, + NULL, + NULL, + NULL + }, + { /* Canon BJC 8500 *//* heads: BC-80/BC-81 BC-82/BC-81 */ + 8500, 3, + 17*72, 22*72, + 11, 9, 10, 18, + &canon_default_slotlist, + CANON_CAP_STD0,0,NULL, + &canon_BJC_8500_modelist, + &canon_default_paperlist, + NULL, + NULL, + NULL + }, + { /* Canon PIXMA iP2000 */ + 9001, 3, /*model, model_id*/ + 842, 17*72, /* max paper width and height */ + 10, 10, 15, 15, /*border_left, border_right, border_top, border_bottom */ + &canon_PIXMA_iP4000_slotlist, + CANON_CAP_STD0|CANON_CAP_DUPLEX|CANON_CAP_r|CANON_CAP_px,0x61,control_cmd_PIXMA_iP4000, /*features */ + &canon_PIXMA_iP2000_modelist, + &canon_PIXMA_iP4000_paperlist, + NULL, + NULL, + NULL + }, + { /* Canon PIXMA iP3000 */ + 3999, 3, /*model, model_id*/ + 842, 17*72, /* max paper width and height */ + 10, 10, 15, 15, /*border_left, border_right, border_top, border_bottom */ + &canon_PIXMA_iP4000_slotlist, + CANON_CAP_STD0|CANON_CAP_DUPLEX|CANON_CAP_r|CANON_CAP_px,0x61,control_cmd_PIXMA_iP4000, /*features */ + &canon_PIXMA_iP3000_modelist, + &canon_PIXMA_iP4000_paperlist, + NULL, + NULL, + NULL + }, + { /* Canon PIXMA iP4000 */ + 4000, 3, /*model, model_id*/ + 842, 17*72, /* max paper width and height */ + 10, 10, 15, 15, /*border_left, border_right, border_top, border_bottom */ + &canon_PIXMA_iP4000_slotlist, + CANON_CAP_STD0|CANON_CAP_DUPLEX|CANON_CAP_r|CANON_CAP_px /*,|CANON_CAP_I*/,0x64,control_cmd_PIXMA_iP4000, /*features */ + &canon_PIXMA_iP4000_modelist, + &canon_PIXMA_iP4000_paperlist, + NULL, + NULL, + NULL + }, + { /* Canon PIXMA iP4200 */ + 4200, 3, /*model, model_id*/ + 842, 17*72, /* max paper width and height */ + 10, 10, 15, 15, /*border_left, border_right, border_top, border_bottom */ + &canon_PIXMA_iP4000_slotlist, + CANON_CAP_STD0|CANON_CAP_DUPLEX|CANON_CAP_r|CANON_CAP_px,0x64,control_cmd_PIXMA_iP4000, /*features */ + &canon_PIXMA_iP4200_modelist, + &canon_PIXMA_iP4000_paperlist, + NULL, + NULL, + NULL + }, + { /* Canon PIXMA iP6700 */ + 4203, 3, /*model, model_id*/ + 842, 17*72, /* max paper width and height */ + 10, 10, 15, 15, /*border_left, border_right, border_top, border_bottom */ + &canon_PIXMA_iP4000_slotlist, + CANON_CAP_STD0|CANON_CAP_DUPLEX|CANON_CAP_r|CANON_CAP_px,0x64,control_cmd_PIXMA_iP4000, /*features */ + &canon_PIXMA_iP6700_modelist, + &canon_PIXMA_iP4000_paperlist, + NULL, + NULL, + NULL + }, + { /* Canon MULTIPASS MP150 */ + 4201, 3, /*model, model_id*/ + 842, 17*72, /* max paper width and height */ + 10, 10, 15, 15, /*border_left, border_right, border_top, border_bottom */ + &canon_PIXMA_iP4000_slotlist, + CANON_CAP_STD0|CANON_CAP_DUPLEX|CANON_CAP_r|CANON_CAP_px|CANON_CAP_I,0x61,control_cmd_MULTIPASS_MP150, /*features */ + &canon_MULTIPASS_MP150_modelist, + &canon_PIXMA_iP4000_paperlist, + NULL, + NULL, + NULL + }, + { /* Canon MULTIPASS MP830 */ + 9000, 3, /*model, model_id*/ + 842, 17*72, /* max paper width and height */ + 10, 10, 15, 15, /*border_left, border_right, border_top, border_bottom */ + &canon_PIXMA_iP4000_slotlist, + CANON_CAP_STD0|CANON_CAP_DUPLEX|CANON_CAP_px,0,control_cmd_MULTIPASS_MP150, /*features */ + &canon_MULTIPASS_MP830_modelist, + &canon_PIXMA_iP4000_paperlist, + NULL, + NULL, + NULL + }, +}; + +#endif + diff --git a/src/main/curve.c b/src/main/curve.c index 03c2ede..3820dea 100644 --- a/src/main/curve.c +++ b/src/main/curve.c @@ -1,5 +1,5 @@ /* - * "$Id: curve.c,v 1.51 2005/04/10 22:57:40 rlk Exp $" + * "$Id: curve.c,v 1.52 2006/09/12 19:03:32 easysw Exp $" * * Print plug-in driver utility functions for the GIMP. * @@ -538,7 +538,7 @@ int stp_curve_set_gamma(stp_curve_t *curve, double fgamma) { check_curve(curve); - if (curve->wrap_mode || ! finite(fgamma) || fgamma == 0.0) + if (curve->wrap_mode || ! isfinite(fgamma) || fgamma == 0.0) return 0; clear_curve_data(curve); curve->gamma = fgamma; @@ -570,7 +570,7 @@ stp_curve_set_data(stp_curve_t *curve, size_t count, const double *data) /* Validate the data before we commit to it. */ stp_sequence_get_bounds(curve->seq, &low, &high); for (i = 0; i < count; i++) - if (! finite(data[i]) || data[i] < low || data[i] > high) + if (! isfinite(data[i]) || data[i] < low || data[i] > high) { stp_deprintf(STP_DBG_CURVE_ERRORS, "stp_curve_set_data: datum out of bounds: " @@ -620,7 +620,7 @@ stp_curve_set_data_points(stp_curve_t *curve, size_t count, stp_sequence_get_bounds(curve->seq, &low, &high); for (i = 0; i < count; i++) { - if (! finite(data[i].y) || data[i].y < low || data[i].y > high) + if (! isfinite(data[i].y) || data[i].y < low || data[i].y > high) { stp_deprintf(STP_DBG_CURVE_ERRORS, "stp_curve_set_data_points: datum out of bounds: " @@ -918,7 +918,7 @@ stp_curve_rescale(stp_curve_t *curve, double scale, } } - if (! finite(nbhi) || ! finite(nblo)) + if (! isfinite(nbhi) || ! isfinite(nblo)) return 0; count = get_point_count(curve); @@ -1302,7 +1302,7 @@ interpolate_points(stp_curve_t *a, stp_curve_t *b, pa += pb; else pa *= pb; - if (! finite(pa)) + if (! isfinite(pa)) { stp_deprintf(STP_DBG_CURVE_ERRORS, "interpolate_points: interpolated point %lu is invalid\n", diff --git a/src/main/escp2-channels.c b/src/main/escp2-channels.c index e12edbf..6b8fbfa 100644 --- a/src/main/escp2-channels.c +++ b/src/main/escp2-channels.c @@ -1,5 +1,5 @@ /* - * "$Id: escp2-channels.c,v 1.62 2006/06/01 23:49:33 rlk Exp $" + * "$Id: escp2-channels.c,v 1.62.8.2 2007/05/29 01:47:28 rlk Exp $" * * Print plug-in EPSON ESC/P2 driver for the GIMP. * @@ -768,6 +768,64 @@ static const physical_subchannel_t f360x_photo_magenta_subchannels[] = DECLARE_INK_CHANNEL(f360x_photo_magenta); +static const physical_subchannel_t claria_black_subchannels[] = +{ + { 0, 0, 0, "BlackDensity", NULL }, +}; + +DECLARE_INK_CHANNEL(claria_black); + +static const physical_subchannel_t claria_yellow_subchannels[] = +{ + { 4, 0, 2, "YellowDensity", NULL }, +}; + +DECLARE_INK_CHANNEL(claria_yellow); + +static const physical_subchannel_t claria_cyan_subchannels[] = +{ + { 2, 0, 0, "CyanDensity", NULL }, +}; + +DECLARE_INK_CHANNEL(claria_cyan); + +static const physical_subchannel_t claria_photo_cyan_subchannels[] = +{ + { 2, 0, 0, "CyanDensity", NULL }, + { 2, 1, 2, "CyanDensity", "LightCyanTransition" }, +}; + +DECLARE_INK_CHANNEL(claria_photo_cyan); + +static const physical_subchannel_t extended_claria_cyan_subchannels[] = +{ + { 2, 1, 2, "CyanDensity", "LightCyanTransition" }, +}; + +DECLARE_INK_CHANNEL(extended_claria_cyan); + +static const physical_subchannel_t claria_magenta_subchannels[] = +{ + { 1, 0, 2, "MagentaDensity", NULL }, +}; + +DECLARE_INK_CHANNEL(claria_magenta); + +static const physical_subchannel_t claria_photo_magenta_subchannels[] = +{ + { 1, 0, 2, "MagentaDensity", NULL }, + { 1, 1, 0, "MagentaDensity", "LightMagentaTransition" }, +}; + +DECLARE_INK_CHANNEL(claria_photo_magenta); + +static const physical_subchannel_t extended_claria_magenta_subchannels[] = +{ + { 1, 1, 0, "MagentaDensity", "LightMagentaTransition" }, +}; + +DECLARE_INK_CHANNEL(extended_claria_magenta); + #define DECLARE_CHANNEL_SET(name) \ static const channel_set_t name##_channel_set = \ @@ -815,7 +873,7 @@ static const ink_channel_t *const standard_black_channels[] = DECLARE_CHANNEL_SET(standard_black); -const escp2_inkname_t stpi_escp2_default_black_inkset = +static const escp2_inkname_t stpi_escp2_default_black_inkset = { "Gray", N_("Grayscale"), INKSET_CMYK, &standard_black_channel_set @@ -828,7 +886,7 @@ static const ink_channel_t *const standard_photo_black_channels[] = DECLARE_CHANNEL_SET(standard_photo_black); -const escp2_inkname_t stpi_escp2_default_photo_black_inkset = +static const escp2_inkname_t stpi_escp2_default_photo_black_inkset = { "Gray", N_("Grayscale"), INKSET_CMYK, &standard_photo_black_channel_set @@ -842,7 +900,7 @@ static const ink_channel_t *const standard_photo_gloss_black_channels[] = DECLARE_CHANNEL_SET(standard_photo_gloss_black); DECLARE_AUX_CHANNEL_SET(standard_photo_black, standard_gloss); -const escp2_inkname_t stpi_escp2_default_photo_gloss_black_inkset = +static const escp2_inkname_t stpi_escp2_default_photo_gloss_black_inkset = { "GrayG", N_("Grayscale"), INKSET_CMYK, &standard_photo_black_standard_gloss_channel_set @@ -1130,6 +1188,20 @@ static const escp2_inkname_t three_color_r2400_composite_inkset = &r2400_cmy_channel_set }; +static const ink_channel_t *const claria_cmy_channels[] = +{ + NULL, &claria_cyan_channel, + &claria_magenta_channel, &claria_yellow_channel +}; + +DECLARE_CHANNEL_SET(claria_cmy); + +static const escp2_inkname_t claria_three_color_composite_inkset = +{ + "RGB", N_("Three Color Composite"), INKSET_CMYK, + &claria_cmy_channel_set +}; + /* **************************************************************** * * @@ -1288,6 +1360,20 @@ static const escp2_inkname_t cx3650_four_color_standard_inkset = &cx3650_cmyk_channel_set }; +static const ink_channel_t *const claria_cmyk_channels[] = +{ + &claria_black_channel, &claria_cyan_channel, + &claria_magenta_channel, &claria_yellow_channel +}; + +DECLARE_CHANNEL_SET(claria_cmyk); + +static const escp2_inkname_t claria_four_color_standard_inkset = +{ + "CMYK", N_("Four Color Standard"), INKSET_CMYK, + &claria_cmyk_channel_set +}; + /* **************************************************************** @@ -1339,6 +1425,20 @@ static const escp2_inkname_t five_color_photo3_inkset = &five_color_photo3_channel_set }; +static const ink_channel_t *const claria_ccmmy_channels[] = +{ + NULL, &claria_photo_cyan_channel, + &claria_photo_magenta_channel, &claria_yellow_channel +}; + +DECLARE_CHANNEL_SET(claria_ccmmy); + +static const escp2_inkname_t claria_five_color_photo_composite_inkset = +{ + "PhotoCMY", N_("Five Color Photo Composite"), INKSET_CcMmYK, + &claria_ccmmy_channel_set +}; + /* **************************************************************** @@ -1390,6 +1490,20 @@ static const escp2_inkname_t six_color_photo3_inkset = &six_color_photo3_channel_set }; +static const ink_channel_t *const claria_ccmmyk_channels[] = +{ + &claria_black_channel, &claria_photo_cyan_channel, + &claria_photo_magenta_channel, &claria_yellow_channel +}; + +DECLARE_CHANNEL_SET(claria_ccmmyk); + +static const escp2_inkname_t claria_six_color_photo_inkset = +{ + "PhotoCMYK", N_("Six Color Photo"), INKSET_CcMmYK, + &claria_ccmmyk_channel_set +}; + /* **************************************************************** * * @@ -1830,6 +1944,19 @@ static const escp2_inkname_t cx3650_three_color_extended_inkset = &cx3650_three_color_extended_channel_set }; +static const ink_channel_t *const claria_three_color_extended_channels[] = +{ + &claria_cyan_channel, &claria_magenta_channel, &claria_yellow_channel +}; + +DECLARE_CHANNEL_SET(claria_three_color_extended); + +static const escp2_inkname_t claria_three_color_extended_inkset = +{ + "PhysicalCMY", N_("Three Color Raw"), INKSET_EXTENDED, + &claria_three_color_extended_channel_set +}; + static const escp2_inkname_t four_color_extended_inkset = { @@ -1873,6 +2000,12 @@ static const escp2_inkname_t cx3650_four_color_extended_inkset = &cx3650_cmyk_channel_set }; +static const escp2_inkname_t claria_four_color_extended_inkset = +{ + "PhysicalCMYK", N_("Four Color Raw"), INKSET_EXTENDED, + &claria_cmyk_channel_set +}; + static const escp2_inkname_t four_color_r800_extended_inkset = { "PhysicalCMYKGloss", N_("Four Color Raw"), INKSET_EXTENDED, @@ -1914,6 +2047,20 @@ static const escp2_inkname_t f360_five_color_extended_inkset = &f360_five_color_extended_channel_set }; +static const ink_channel_t *const claria_five_color_extended_channels[] = +{ + &claria_cyan_channel, &extended_claria_cyan_channel, + &claria_magenta_channel, &extended_claria_magenta_channel, + &claria_yellow_channel +}; +DECLARE_CHANNEL_SET(claria_five_color_extended); + +static const escp2_inkname_t claria_five_color_extended_inkset = +{ + "PhysicalCcMmYK", N_("Six Color Raw"), INKSET_EXTENDED, + &claria_five_color_extended_channel_set +}; + static const ink_channel_t *const six_color_extended_channels[] = { @@ -1963,6 +2110,22 @@ static const escp2_inkname_t six_color_r800_photo_gloss_extended_inkset = &six_color_r800_photo_gloss_channel_set }; +static const ink_channel_t *const claria_six_color_extended_channels[] = +{ + &claria_black_channel, + &claria_cyan_channel, &extended_claria_cyan_channel, + &claria_magenta_channel, &extended_claria_magenta_channel, + &claria_yellow_channel +}; +DECLARE_CHANNEL_SET(claria_six_color_extended); + +static const escp2_inkname_t claria_six_color_extended_inkset = +{ + "PhysicalCcMmYK", N_("Six Color Raw"), INKSET_EXTENDED, + &claria_six_color_extended_channel_set +}; + + static const ink_channel_t *const j_seven_color_extended_channels[] = { &photo_black_channel, @@ -2176,14 +2339,26 @@ static const shade_set_t quadtone_shades = /* Some kind of quadtone ink */ { 1, { 1.0 }}, }; +static const shade_set_t claria_shades = /* Stylus R260 and newer */ +{ + { 1, { 1.0 }}, + { 2, { 1.0, 0.35 }}, + { 2, { 1.0, 0.33 }}, + { 1, { 1.0 }}, + { 1, { 1.0 }}, + { 1, { 1.0 }}, + { 1, { 1.0 }}, + { 1, { 1.0 }}, +}; + #define DECLARE_INKLIST(tname, name, inks, text, papers, adjustments, shades) \ static const inklist_t name##_inklist = \ { \ tname, \ text, \ inks##_ink_types, \ - &stpi_escp2_##papers##_paper_list, \ - &stpi_escp2_##adjustments##_paper_adjustment_list, \ + #papers, \ + #adjustments, \ &shades##_shades, \ sizeof(inks##_ink_types) / sizeof(escp2_inkname_t *), \ } @@ -2209,6 +2384,8 @@ static const escp2_inkname_t *const standard_ink_types[] = DECLARE_INKLIST("None", standard, standard, N_("EPSON Standard Inks"), standard, standard, standard); +DECLARE_INKLIST("None", photo_gen3_4, standard, N_("EPSON Standard Inks"), + standard, photo3, standard); static const escp2_inkname_t *const quadtone_ink_types[] = { @@ -2351,6 +2528,22 @@ static const escp2_inkname_t *const f360_photo_ink_types[] = DECLARE_INKLIST("None", f360_photo, f360_photo, N_("EPSON Standard Inks"), standard, sp960, esp960); +static const escp2_inkname_t *const claria_ink_types[] = +{ + &claria_six_color_photo_inkset, + &claria_five_color_photo_composite_inkset, + &claria_four_color_standard_inkset, + &claria_three_color_composite_inkset, + &one_color_extended_inkset, + &claria_three_color_extended_inkset, + &claria_four_color_extended_inkset, + &claria_five_color_extended_inkset, + &claria_six_color_extended_inkset, +}; + +DECLARE_INKLIST("None", claria, claria, N_("EPSON Standard Inks"), + standard, claria, claria); + static const escp2_inkname_t *const f360_photo7_japan_ink_types[] = { &f360_j_seven_color_enhanced_inkset, @@ -2483,7 +2676,7 @@ DECLARE_INKLIST("picturemate", picturemate, picturemate_photo, #define DECLARE_INKGROUP(name) \ -const inkgroup_t stpi_escp2_##name##_inkgroup = \ +static const inkgroup_t name##_inkgroup = \ { \ #name, \ name##_group, \ @@ -2576,6 +2769,14 @@ static const inklist_t *const photo_gen3_group[] = DECLARE_INKGROUP(photo_gen3); +static const inklist_t *const photo_gen3_4_group[] = +{ + &photo_gen3_4_inklist, + &quadtone_inklist +}; + +DECLARE_INKGROUP(photo_gen3_4); + static const inklist_t *const photo_pigment_group[] = { &pigment_inklist @@ -2635,3 +2836,236 @@ static const inklist_t *const picturemate_group[] = }; DECLARE_INKGROUP(picturemate); + +static const inklist_t *const claria_group[] = +{ + &claria_inklist, +}; + +DECLARE_INKGROUP(claria); + +typedef struct +{ + const char *name; + const inkgroup_t *inkgroup; +} ink_t; + +static const ink_t the_inks[] = +{ + { "cmy", &cmy_inkgroup }, + { "standard", &standard_inkgroup }, + { "c80", &c80_inkgroup }, + { "c82", &c82_inkgroup }, + { "c64", &c64_inkgroup }, + { "f360", &f360_inkgroup }, + { "cx3650", &cx3650_inkgroup }, + { "x80", &x80_inkgroup }, + { "photo_gen1", &photo_gen1_inkgroup }, + { "photo_gen2", &photo_gen2_inkgroup }, + { "photo_gen3", &photo_gen3_inkgroup }, + { "photo_gen3_4", &photo_gen3_4_inkgroup }, + { "photo_pigment", &photo_pigment_inkgroup }, + { "ultrachrome", &ultrachrome_inkgroup }, + { "f360_photo", &f360_photo_inkgroup }, + { "f360_photo7_japan", &f360_photo7_japan_inkgroup }, + { "f360_ultrachrome", &f360_ultrachrome_inkgroup }, + { "f360_ultrachrome_k3", &f360_ultrachrome_k3_inkgroup }, + { "cmykrb", &cmykrb_inkgroup }, + { "picturemate", &picturemate_inkgroup }, + { "claria", &claria_inkgroup }, +}; + +const inkgroup_t * +stpi_escp2_get_inkgroup_named(const char *n) +{ + int i; + if (n) + for (i = 0; i < sizeof(the_inks) / sizeof(ink_t); i++) + { + if (strcmp(n, the_inks[i].name) == 0) + return the_inks[i].inkgroup; + } + return NULL; +} + +const escp2_inkname_t * +stpi_escp2_get_default_black_inkset(void) +{ + return &stpi_escp2_default_black_inkset; +} + + +#define DECLARE_CHANNEL_LIST(name) \ +static const channel_name_t name##_channel_name_list = \ +{ \ + #name, \ + sizeof(name##_channel_names) / sizeof(const char *), \ + name##_channel_names \ +} + +static const char *standard_channel_names[] = +{ + N_("Black"), + N_("Cyan"), + N_("Magenta"), + N_("Yellow") +}; + +DECLARE_CHANNEL_LIST(standard); + +static const char *cx3800_channel_names[] = +{ + N_("Cyan"), + N_("Yellow"), + N_("Magenta"), + N_("Black") +}; + +DECLARE_CHANNEL_LIST(cx3800); + +static const char *mfp2005_channel_names[] = +{ + N_("Cyan"), + N_("Magenta"), + N_("Yellow"), + N_("Black") +}; + +DECLARE_CHANNEL_LIST(mfp2005); + +static const char *photo_channel_names[] = +{ + N_("Black"), + N_("Cyan"), + N_("Magenta"), + N_("Yellow"), + N_("Light Cyan"), + N_("Light Magenta"), +}; + +DECLARE_CHANNEL_LIST(photo); + +static const char *rx700_channel_names[] = +{ + N_("Black"), + N_("Cyan"), + N_("Light Cyan"), + N_("Magenta"), + N_("Light Magenta"), + N_("Yellow"), +}; + +DECLARE_CHANNEL_LIST(rx700); + +static const char *sp2200_channel_names[] = +{ + N_("Black"), + N_("Cyan"), + N_("Magenta"), + N_("Yellow"), + N_("Light Cyan"), + N_("Light Magenta"), + N_("Light Black"), +}; + +DECLARE_CHANNEL_LIST(sp2200); + +static const char *pm_950c_channel_names[] = +{ + N_("Black"), + N_("Cyan"), + N_("Magenta"), + N_("Yellow"), + N_("Light Cyan"), + N_("Light Magenta"), + N_("Dark Yellow"), +}; + +DECLARE_CHANNEL_LIST(pm_950c); + +static const char *sp960_channel_names[] = +{ + N_("Black"), + N_("Cyan"), + N_("Magenta"), + N_("Yellow"), + N_("Light Cyan"), + N_("Light Magenta"), + N_("Black"), +}; + +DECLARE_CHANNEL_LIST(sp960); + +static const char *r800_channel_names[] = +{ + N_("Yellow"), + N_("Magenta"), + N_("Cyan"), + N_("Matte Black"), + N_("Photo Black"), + N_("Red"), + N_("Blue"), + N_("Gloss Optimizer"), +}; + +DECLARE_CHANNEL_LIST(r800); + +static const char *picturemate_channel_names[] = +{ + N_("Yellow"), + N_("Magenta"), + N_("Cyan"), + N_("Black"), + N_("Red"), + N_("Blue"), +}; + +DECLARE_CHANNEL_LIST(picturemate); + +static const char *r2400_channel_names[] = +{ + N_("Light Light Black"), + N_("Light Magenta"), + N_("Light Cyan"), + N_("Light Black"), + N_("Black"), + N_("Cyan"), + N_("Magenta"), + N_("Yellow"), +}; + +DECLARE_CHANNEL_LIST(r2400); + +typedef struct +{ + const char *name; + const channel_name_t *channel_name; +} channel_t; + +static const channel_t the_channels[] = +{ + { "cx3800", &cx3800_channel_name_list }, + { "mfp2005", &mfp2005_channel_name_list }, + { "photo", &photo_channel_name_list }, + { "picturemate", &picturemate_channel_name_list }, + { "pm_950c", &pm_950c_channel_name_list }, + { "r2400", &r2400_channel_name_list }, + { "r800", &r800_channel_name_list }, + { "rx700", &rx700_channel_name_list }, + { "sp2200", &sp2200_channel_name_list }, + { "sp960", &sp960_channel_name_list }, + { "standard", &standard_channel_name_list }, +}; + +const channel_name_t * +stpi_escp2_get_channel_names_named(const char *n) +{ + int i; + if (n) + for (i = 0; i < sizeof(the_channels) / sizeof(channel_t); i++) + { + if (strcmp(n, the_channels[i].name) == 0) + return the_channels[i].channel_name; + } + return NULL; +} diff --git a/src/main/escp2-driver.c b/src/main/escp2-driver.c index 24ef1c1..2141cfc 100644 --- a/src/main/escp2-driver.c +++ b/src/main/escp2-driver.c @@ -1,5 +1,5 @@ /* - * "$Id: escp2-driver.c,v 1.30 2006/07/22 20:28:13 rlk Exp $" + * "$Id: escp2-driver.c,v 1.30.6.1 2007/03/02 12:01:25 rlk Exp $" * * Print plug-in EPSON ESC/P2 driver for the GIMP. * @@ -114,6 +114,7 @@ print_debug_params(stp_vars_t *v) print_remote_int_param(v, "Page_height", pd->page_height); print_remote_int_param(v, "Page_true_height", pd->page_true_height); print_remote_int_param(v, "Page_extra_height", pd->page_extra_height); + print_remote_int_param(v, "Paper_extra_bottom", pd->paper_extra_bottom); print_remote_int_param(v, "Image_left", pd->image_left); print_remote_int_param(v, "Image_top", pd->image_top); print_remote_int_param(v, "Image_width", pd->image_width); @@ -240,22 +241,12 @@ escp2_set_remote_sequence(stp_vars_t *v) stp_send_command(v, "SN", "bccc", 0, 0, feed_sequence); if (stp_get_boolean_parameter(v, "FullBleed")) { - stp_send_command(v, "FP", "bch", 0, 0xffb0); -#if 0 - /* These commands do not appear to do anything on the */ - /* 2200. Need to test on R800. */ - /* From the R1800 manual -- bottom margin borderless */ - stp_send_command(v, "PM", "bcc", 0, 0); - stp_send_command(v, "DP", "bcc", 0, 0); - stp_send_command(v, "SN", "bc", 0); - stp_send_command(v, "MI", "bccc", 1, 0xb, 1); - stp_send_command(v, "US", "bccc", 0, 0, 2); - stp_send_command(v, "US", "bccc", 0, 1, 0); - /* This command means "check paper size - no" */ - stp_send_command(v, "US", "bccc", 0, 2, 0); - stp_send_command(v, "DR", "bcccc", 0, 0, 0, 0); - stp_send_command(v, "PP", "bccc", 0, 1, 0xff); -#endif + stp_send_command(v, "FP", "bch", 0, + (unsigned short) -pd->zero_margin_offset); + if (pd->borderless_sequence) + stp_zfwrite(pd->borderless_sequence->data, + pd->borderless_sequence->bytes, + 1, v); } } if (pd->input_slot) @@ -387,7 +378,8 @@ static void escp2_set_page_height(stp_vars_t *v) { escp2_privdata_t *pd = get_privdata(v); - int l = pd->page_management_units * pd->page_true_height / 72; + int l = (pd->page_true_height + pd->paper_extra_bottom) * + pd->page_management_units / 72; if (pd->use_extended_commands) stp_send_command(v, "\033(C", "bl", l); else @@ -402,6 +394,8 @@ escp2_set_margins(stp_vars_t *v) int top = pd->page_management_units * pd->page_top / 72; top += pd->initial_vertical_offset; + top -= pd->page_extra_height; + bot += pd->page_extra_height; if (pd->use_extended_commands && (pd->command_set == MODEL_COMMAND_2000 || pd->command_set == MODEL_COMMAND_PRO)) @@ -411,21 +405,14 @@ escp2_set_margins(stp_vars_t *v) } static void -escp2_set_form_factor(stp_vars_t *v) +escp2_set_paper_dimensions(stp_vars_t *v) { escp2_privdata_t *pd = get_privdata(v); if (pd->advanced_command_set) { - int w = pd->page_width * pd->page_management_units / 72; - int h = (pd->page_true_height + pd->page_extra_height) * + int w = pd->page_true_width * pd->page_management_units / 72; + int h = (pd->page_true_height + pd->paper_extra_bottom) * pd->page_management_units / 72; - - if (stp_get_boolean_parameter(v, "FullBleed")) - /* Make the page 160/360" wider for full bleed printing. */ - /* Per the Epson manual, the margin should be expanded by 80/360" */ - /* so we need to do this on the left and the right */ - w += 320 * pd->page_management_units / 720; - stp_send_command(v, "\033(S", "bll", w, h); } } @@ -599,7 +586,7 @@ stpi_escp2_init_printer(stp_vars_t *v) escp2_set_printhead_resolution(v); escp2_set_page_height(v); escp2_set_margins(v); - escp2_set_form_factor(v); + escp2_set_paper_dimensions(v); } void diff --git a/src/main/escp2-inks.c b/src/main/escp2-inks.c index 6a5ee2e..309a40e 100644 --- a/src/main/escp2-inks.c +++ b/src/main/escp2-inks.c @@ -1,5 +1,5 @@ /* - * "$Id: escp2-inks.c,v 1.46 2006/01/07 02:43:28 rlk Exp $" + * "$Id: escp2-inks.c,v 1.46.10.2 2007/05/29 01:47:28 rlk Exp $" * * Print plug-in EPSON ESC/P2 driver for the GIMP. * @@ -135,6 +135,64 @@ static const escp2_dropsize_t escp2_r300_2880_dropsizes = static const escp2_dropsize_t escp2_r300_2880_1440_dropsizes = { "r300_2880_1440", 1, { 1.0 } }; +/* Claria inks */ + +/* + * Tested relative drop sizes: + * S M L + * + * 0x21 3 4 5 + * 0x23 2 3 4 + * 0x24 1 3 5 + * 0x25 1 2 3 + * 0x26 2 3 5 + * 0x33 1 3 5 + * + * Therefore, there's no real point to use drop sizes other than 0x24 + * and 0x25. The economy settings (0x10 and 0x0) don't provide any + * bigger drops. We get quite smooth output at 720x360 and 360 DPI, and + * even 360x180 is surprisingly smooth. + * Roy Harrington estimates the drop sizes are: + * + * 1 1.5 pl + * 2 2.4 pl + * 3 6.3 pl + * 4 12 pl (rlk estimate) + * 5 21 pl + */ + +static const escp2_dropsize_t escp2_claria_720_dropsizes = + { "claria_720", 3, { 0.071, 0.3, 1.0 } }; +static const escp2_dropsize_t escp2_claria_1440_dropsizes = + { "claria_1440", 3, { 0.23, 0.37, 1.0 } }; +static const escp2_dropsize_t escp2_claria_2880_dropsizes = + { "claria_2880", 2, { 0.62, 1.0 } }; +static const escp2_dropsize_t escp2_claria_5760_dropsizes = + { "claria_5760", 1, { 1.0 } }; + +/* Stylus Photo 1400 */ + +/* + * Tested relative drop sizes: +* S M L +* +* 0x21 3 4 5 +* 0x25 1 2 3 +* 0x33 1 3 5 +* 0x34 2 3 5 +*/ + +static const escp2_dropsize_t escp2_claria_1400_720_dropsizes = + { "claria_1400_720", 3, { 0.3, 0.57, 1.0 } }; +static const escp2_dropsize_t escp2_claria_1400_1440_720_dropsizes = + { "claria_1400_1440_720", 3, { 0.071, 0.3, 1.0 } }; +static const escp2_dropsize_t escp2_claria_1400_1440_dropsizes = + { "claria_1400_1440", 3, { 0.23, 0.37, 1.0 } }; +static const escp2_dropsize_t escp2_claria_1400_2880_dropsizes = + { "claria_1400_2880", 2, { 0.62, 1.0 } }; +static const escp2_dropsize_t escp2_claria_1400_5760_dropsizes = + { "claria_1400_5760", 1, { 1.0 } }; + /* Stylus Photo R2400 */ static const escp2_dropsize_t escp2_r2400_360_dropsizes = { "r2400_360", 1, { 1 } }; @@ -193,7 +251,7 @@ static const escp2_dropsize_t escp2_ultrachrome_2880_dropsizes = static const escp2_dropsize_t escp2_spro10000_dropsizes = { "spro10000", 2, { 0.661, 1.0 } }; -const escp2_drop_list_t stpi_escp2_simple_drops = +static const escp2_drop_list_t simple_drops = { &escp2_single_dropsizes, &escp2_single_dropsizes, @@ -206,7 +264,7 @@ const escp2_drop_list_t stpi_escp2_simple_drops = &escp2_single_dropsizes, }; -const escp2_drop_list_t stpi_escp2_variable_6pl_drops = +static const escp2_drop_list_t variable_6pl_drops = { &escp2_6pl_dropsizes, &escp2_6pl_dropsizes, @@ -219,7 +277,7 @@ const escp2_drop_list_t stpi_escp2_variable_6pl_drops = &escp2_6pl_2880_dropsizes, }; -const escp2_drop_list_t stpi_escp2_variable_x80_6pl_drops = +static const escp2_drop_list_t variable_x80_6pl_drops = { &escp2_x80_low_dropsizes, &escp2_x80_low_dropsizes, @@ -232,7 +290,7 @@ const escp2_drop_list_t stpi_escp2_variable_x80_6pl_drops = &escp2_x80_2880_6pl_dropsizes, }; -const escp2_drop_list_t stpi_escp2_variable_1440_4pl_drops = +static const escp2_drop_list_t variable_1440_4pl_drops = { &escp2_low_dropsizes, &escp2_low_dropsizes, @@ -245,7 +303,7 @@ const escp2_drop_list_t stpi_escp2_variable_1440_4pl_drops = &escp2_4pl_2880_dropsizes, }; -const escp2_drop_list_t stpi_escp2_variable_2880_4pl_drops = +static const escp2_drop_list_t variable_2880_4pl_drops = { &escp2_new_low_dropsizes, &escp2_new_low_dropsizes, @@ -258,7 +316,7 @@ const escp2_drop_list_t stpi_escp2_variable_2880_4pl_drops = &escp2_4pl_2880_dropsizes, }; -const escp2_drop_list_t stpi_escp2_variable_3pl_drops = +static const escp2_drop_list_t variable_3pl_drops = { &escp2_low_dropsizes, &escp2_low_dropsizes, @@ -271,7 +329,7 @@ const escp2_drop_list_t stpi_escp2_variable_3pl_drops = &escp2_3pl_2880_dropsizes, }; -const escp2_drop_list_t stpi_escp2_variable_2pl_drops = +static const escp2_drop_list_t variable_2pl_drops = { &escp2_2pl_360_dropsizes, &escp2_2pl_360_dropsizes, @@ -284,7 +342,7 @@ const escp2_drop_list_t stpi_escp2_variable_2pl_drops = &escp2_2pl_2880_dropsizes, }; -const escp2_drop_list_t stpi_escp2_variable_3pl_pmg_drops = +static const escp2_drop_list_t variable_3pl_pmg_drops = { &escp2_r300_360_dropsizes, &escp2_r300_360_dropsizes, @@ -297,7 +355,33 @@ const escp2_drop_list_t stpi_escp2_variable_3pl_pmg_drops = &escp2_r300_2880_1440_dropsizes, }; -const escp2_drop_list_t stpi_escp2_variable_r2400_drops = +static const escp2_drop_list_t claria_drops = +{ + &escp2_claria_720_dropsizes, + &escp2_claria_720_dropsizes, + &escp2_claria_720_dropsizes, + &escp2_claria_720_dropsizes, + &escp2_claria_720_dropsizes, + &escp2_claria_1440_dropsizes, + &escp2_claria_1440_dropsizes, + &escp2_claria_2880_dropsizes, + &escp2_claria_5760_dropsizes, +}; + +static const escp2_drop_list_t claria_1400_drops = +{ + &escp2_claria_1400_1440_720_dropsizes, + &escp2_claria_1400_1440_720_dropsizes, + &escp2_claria_1400_720_dropsizes, + &escp2_claria_1400_720_dropsizes, + &escp2_claria_1400_1440_720_dropsizes, + &escp2_claria_1400_1440_dropsizes, + &escp2_claria_1400_1440_dropsizes, + &escp2_claria_1400_2880_dropsizes, + &escp2_claria_1400_5760_dropsizes, +}; + +static const escp2_drop_list_t variable_r2400_drops = { &escp2_r2400_360_dropsizes, &escp2_r2400_360_dropsizes, @@ -310,7 +394,7 @@ const escp2_drop_list_t stpi_escp2_variable_r2400_drops = &escp2_r2400_2880_2880_dropsizes, }; -const escp2_drop_list_t stpi_escp2_variable_picturemate_drops = +static const escp2_drop_list_t variable_picturemate_drops = { &escp2_picturemate_1440_dropsizes, &escp2_picturemate_1440_dropsizes, @@ -323,7 +407,7 @@ const escp2_drop_list_t stpi_escp2_variable_picturemate_drops = &escp2_picturemate_5760_dropsizes, }; -const escp2_drop_list_t stpi_escp2_variable_1_5pl_drops = +static const escp2_drop_list_t variable_1_5pl_drops = { &escp2_1_5pl_360_dropsizes, &escp2_1_5pl_360_dropsizes, @@ -336,7 +420,7 @@ const escp2_drop_list_t stpi_escp2_variable_1_5pl_drops = &escp2_1_5pl_5760_dropsizes, }; -const escp2_drop_list_t stpi_escp2_variable_2000p_drops = +static const escp2_drop_list_t variable_2000p_drops = { &escp2_2000p_dropsizes, &escp2_2000p_dropsizes, @@ -349,7 +433,7 @@ const escp2_drop_list_t stpi_escp2_variable_2000p_drops = &escp2_2000p_dropsizes }; -const escp2_drop_list_t stpi_escp2_variable_ultrachrome_drops = +static const escp2_drop_list_t variable_ultrachrome_drops = { &escp2_ultrachrome_low_dropsizes, &escp2_ultrachrome_low_dropsizes, @@ -362,7 +446,7 @@ const escp2_drop_list_t stpi_escp2_variable_ultrachrome_drops = &escp2_ultrachrome_2880_dropsizes, }; -const escp2_drop_list_t stpi_escp2_variable_3pl_pigment_drops = +static const escp2_drop_list_t variable_3pl_pigment_drops = { &escp2_economy_pigment_dropsizes, &escp2_low_pigment_dropsizes, @@ -375,7 +459,7 @@ const escp2_drop_list_t stpi_escp2_variable_3pl_pigment_drops = &escp2_3pl_pigment_5760_dropsizes, }; -const escp2_drop_list_t stpi_escp2_variable_3pl_pigment_c66_drops = +static const escp2_drop_list_t variable_3pl_pigment_c66_drops = { &escp2_economy_pigment_c66_dropsizes, &escp2_low_pigment_c66_dropsizes, @@ -388,7 +472,7 @@ const escp2_drop_list_t stpi_escp2_variable_3pl_pigment_c66_drops = &escp2_3pl_pigment_c66_5760_dropsizes, }; -const escp2_drop_list_t stpi_escp2_spro10000_drops = +static const escp2_drop_list_t spro10000_drops = { &escp2_spro10000_dropsizes, &escp2_spro10000_dropsizes, @@ -400,3 +484,45 @@ const escp2_drop_list_t stpi_escp2_spro10000_drops = &escp2_spro10000_dropsizes, &escp2_spro10000_dropsizes }; + + +typedef struct +{ + const char *name; + const escp2_drop_list_t *const drop_list; +} drop_list_t; + +static const drop_list_t the_drop_lists[] = +{ + { "simple", &simple_drops }, + { "spro10000", &spro10000_drops }, + { "variable_1_5pl", &variable_1_5pl_drops }, + { "variable_2pl", &variable_2pl_drops }, + { "variable_3pl", &variable_3pl_drops }, + { "variable_3pl_pigment", &variable_3pl_pigment_drops }, + { "variable_3pl_pigment_c66", &variable_3pl_pigment_c66_drops }, + { "variable_3pl_pmg", &variable_3pl_pmg_drops }, + { "variable_claria", &claria_drops }, + { "variable_claria_1400", &claria_1400_drops }, + { "variable_r2400", &variable_r2400_drops }, + { "variable_picturemate", &variable_picturemate_drops }, + { "variable_1440_4pl", &variable_1440_4pl_drops }, + { "variable_ultrachrome", &variable_ultrachrome_drops }, + { "variable_2880_4pl", &variable_2880_4pl_drops }, + { "variable_6pl", &variable_6pl_drops }, + { "variable_2000p", &variable_2000p_drops }, + { "variable_x80_6pl", &variable_x80_6pl_drops }, +}; + +const escp2_drop_list_t * +stpi_escp2_get_drop_list_named(const char *n) +{ + int i; + if (n) + for (i = 0; i < sizeof(the_drop_lists) / sizeof(drop_list_t); i++) + { + if (strcmp(n, the_drop_lists[i].name) == 0) + return the_drop_lists[i].drop_list; + } + return NULL; +} diff --git a/src/main/escp2-papers.c b/src/main/escp2-papers.c index c32e51f..03f9edc 100644 --- a/src/main/escp2-papers.c +++ b/src/main/escp2-papers.c @@ -1,5 +1,5 @@ /* - * "$Id: escp2-papers.c,v 1.99 2006/05/31 23:15:22 rlk Exp $" + * "$Id: escp2-papers.c,v 1.99.8.2 2007/05/29 01:47:28 rlk Exp $" * * Print plug-in EPSON ESC/P2 driver for the GIMP. * @@ -167,6 +167,53 @@ static const char photo3_hue_adj[] = "\n"; + +static const char claria_sat_adj[] = +"\n" +"\n" +"\n" +"\n" +/* C */ "1.00 1.05 1.15 1.25 1.35 1.45 1.50 1.50 " /* B */ +/* B */ "1.50 1.50 1.50 1.50 1.50 1.50 1.50 1.50 " /* M */ +/* M */ "1.50 1.40 1.30 1.20 1.10 1.00 1.00 1.00 " /* R */ +/* R */ "1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 " /* Y */ +/* Y */ "1.00 1.10 1.30 1.55 1.80 1.95 2.00 2.00 " /* G */ +/* G */ "2.00 2.00 2.00 1.95 1.80 1.55 1.30 1.10 " /* C */ +"\n" +"\n" +"\n"; + +static const char claria_lum_adj[] = +"\n" +"\n" +"\n" +"\n" +/* C */ "0.66 0.67 0.69 0.73 0.77 0.83 0.87 0.89 " /* B */ +/* B */ "0.91 0.88 0.84 0.78 0.78 0.80 0.82 0.85 " /* M */ +/* M */ "0.87 0.90 0.94 0.97 1.00 1.00 1.00 1.00 " /* R */ +/* R */ "1.00 1.00 1.00 1.00 1.00 1.00 1.00 1.00 " /* Y */ +/* Y */ "1.00 1.00 0.99 0.98 0.96 0.94 0.92 0.88 " /* G */ +/* G */ "0.84 0.72 0.69 0.67 0.66 0.66 0.66 0.66 " /* C */ +"\n" +"\n" +"\n"; + +static const char claria_hue_adj[] = +"\n" +"\n" +"\n" +"\n" +/* C */ "0.00 -.01 -.03 -.06 -.10 -.15 -.20 -.25 " /* B */ +/* B */ "-.30 -.35 -.38 -.40 -.42 -.46 -.49 -.52 " /* M */ +/* M */ "-.55 -.57 -.57 -.55 -.52 -.48 -.40 -.30 " /* R */ +/* R */ "-.12 -.07 -.04 -.02 0.00 0.00 0.00 0.00 " /* Y */ +/* Y */ "0.00 -.00 -.00 -.00 -.02 -.04 -.08 -.13 " /* G */ +/* G */ "-.18 -.18 -.19 -.16 -.13 -.10 -.07 -.03 " /* C */ +"\n" +"\n" +"\n"; + + static const char sp960_sat_adj[] = "\n" "\n" @@ -531,20 +578,20 @@ static const char r800_glossy_hue_adj[] = "\n" "\n"; -#define DECLARE_PAPERS(name) \ -const paperlist_t stpi_escp2_##name##_paper_list = \ -{ \ - #name, \ - sizeof(name##_papers) / sizeof(paper_t), \ - name##_papers \ +#define DECLARE_PAPERS(name) \ +static const paperlist_t name##_paper_list = \ +{ \ + #name, \ + sizeof(name##_papers) / sizeof(paper_t), \ + name##_papers \ } -#define DECLARE_PAPER_ADJUSTMENTS(name) \ -const paper_adjustment_list_t stpi_escp2_##name##_paper_adjustment_list = \ -{ \ - #name, \ - sizeof(name##_adjustments) / sizeof(paper_adjustment_t), \ - name##_adjustments \ +#define DECLARE_PAPER_ADJUSTMENTS(name) \ +static const paper_adjustment_list_t name##_paper_adjustment_list = \ +{ \ + #name, \ + sizeof(name##_adjustments) / sizeof(paper_adjustment_t), \ + name##_adjustments \ } static const paper_adjustment_t standard_adjustments[] = @@ -723,6 +770,50 @@ static const paper_adjustment_t photo3_adjustments[] = DECLARE_PAPER_ADJUSTMENTS(photo3); +static const paper_adjustment_t claria_adjustments[] = +{ + { "Plain", 0.540, .25, 0.75, .1, .5, 1, .7, .7, 1, 1, 1.0, + claria_hue_adj, claria_lum_adj, claria_sat_adj }, + { "PlainFast", 0.540, .25, 0.75, .1, .5, 1, .7, .7, 1, 1, 1.0, + claria_hue_adj, claria_lum_adj, claria_sat_adj }, + { "Postcard", 0.692, .25, 0.5, .1, .5, 1, .7, .7, 1, 1, 1.0, + claria_hue_adj, claria_lum_adj, claria_sat_adj }, + { "GlossyFilm", 0.833, .25, 0.75, .2, .999, 1, .7, .7, 1, 1, 1, + claria_hue_adj, claria_lum_adj, claria_sat_adj }, + { "Transparency", 0.833, .25, 0.75, .2, .999, 1, .7, .7, 1, 1, 1, + claria_hue_adj, claria_lum_adj, claria_sat_adj }, + { "Envelope", 0.540, .25, 0.75, .1, .5, 1, .7, .7, 1, 1, 1.0, + claria_hue_adj, claria_lum_adj, claria_sat_adj }, + { "BackFilm", 0.833, .25, 0.75, .2, .999, 1, .7, .7, 1, 1, 1, + claria_hue_adj, claria_lum_adj, claria_sat_adj }, + { "Matte", 0.833, .25, 0.6, .15, .999, 1, .7, .7, 1, 1, 1, + claria_hue_adj, claria_lum_adj, claria_sat_adj }, + { "MatteHeavy", 0.833, .25, 0.5, .25, .999, 1, .7, .7, 1, 1, 1, + claria_hue_adj, claria_lum_adj, claria_sat_adj }, + { "Inkjet", 0.709, .25, 0.75, .15, .75, 1, .7, .7, 1, 1, 1, + claria_hue_adj, claria_lum_adj, claria_sat_adj }, + { "Coated", 0.833, .25, 0.5, .25, .999, 1, .7, .7, 1, 1, 1, + claria_hue_adj, claria_lum_adj, claria_sat_adj }, + { "Photo", 0.833, .25, 0.5, .25, .999, 1, .7, .7, 1, 1, 1, + claria_hue_adj, claria_lum_adj, claria_sat_adj }, + { "GlossyPhoto", 0.75, .25, 0.3, .25, .999, 1, .7, .7, 1, 1, 0.92, + claria_hue_adj, claria_lum_adj, claria_sat_adj }, + { "Semigloss", 0.75, .25, 0.3, .25, .999, 1, .7, .7, 1, 1, 0.92, + claria_hue_adj, claria_lum_adj, claria_sat_adj }, + { "Luster", 0.75, .25, 0.3, .25, .999, 1, .7, .7, 1, 1, 0.92, + claria_hue_adj, claria_lum_adj, claria_sat_adj }, + { "GlossyPaper", 0.833, .25, 0.75, .2, .999, 1, .7, .7, 1, 1, 1, + claria_hue_adj, claria_lum_adj, claria_sat_adj }, + { "Ilford", 0.833, .25, 0.75, .2, .999, 1, .7, .7, 1, 1, 1, + claria_hue_adj, claria_lum_adj, claria_sat_adj }, + { "ColorLife", 0.833, .25, 0.75, .2, .9, 1, .7, .7, 1, 1, 1, + claria_hue_adj, claria_lum_adj, claria_sat_adj }, + { "Other", 0.540, .25, 0.5, .1, .5, 1, .7, .7, 1, 1, 1, + claria_hue_adj, claria_lum_adj, claria_sat_adj }, +}; + +DECLARE_PAPER_ADJUSTMENTS(claria); + static const paper_adjustment_t sp960_adjustments[] = { { "Plain", 0.86, .2, 0.4, .1, .9, .9, 1, 1, 1, 1, 1, @@ -1440,3 +1531,471 @@ static const paper_t picturemate_papers[] = }; DECLARE_PAPERS(picturemate); + +typedef struct +{ + const char *name; + const paperlist_t *paper_list; +} paperl_t; + +static const paperl_t the_papers[] = +{ + { "standard", &standard_paper_list }, + { "durabrite", &durabrite_paper_list }, + { "durabrite2", &durabrite2_paper_list }, + { "ultrachrome", &ultrachrome_paper_list }, + { "ultrachrome_k3", &ultrachrome_k3_paper_list }, + { "r800", &r800_paper_list }, + { "picturemate", &picturemate_paper_list }, +}; + +const paperlist_t * +stpi_escp2_get_paperlist_named(const char *n) +{ + int i; + if (n) + for (i = 0; i < sizeof(the_papers) / sizeof(paperl_t); i++) + { + if (strcmp(n, the_papers[i].name) == 0) + return the_papers[i].paper_list; + } + return NULL; +} + +typedef struct +{ + const char *name; + const paper_adjustment_list_t *paper_list; +} paperadj_t; + +static const paperadj_t the_adjustments[] = +{ + { "standard", &standard_paper_adjustment_list }, + { "durabrite", &durabrite_paper_adjustment_list }, + { "durabrite2", &durabrite2_paper_adjustment_list }, + { "photo", &photo_paper_adjustment_list }, + { "photo2", &photo2_paper_adjustment_list }, + { "photo3", &photo3_paper_adjustment_list }, + { "sp960", &sp960_paper_adjustment_list }, + { "ultrachrome_photo", &ultrachrome_photo_paper_adjustment_list }, + { "ultrachrome_matte", &ultrachrome_matte_paper_adjustment_list }, + { "ultrachrome_k3_photo", &ultrachrome_k3_photo_paper_adjustment_list }, + { "ultrachrome_k3_matte", &ultrachrome_k3_matte_paper_adjustment_list }, + { "r800_photo", &r800_photo_paper_adjustment_list }, + { "r800_matte", &r800_matte_paper_adjustment_list }, + { "picturemate", &picturemate_paper_adjustment_list }, + { "claria", &claria_paper_adjustment_list }, +}; + +const paper_adjustment_list_t * +stpi_escp2_get_paper_adjustment_list_named(const char *n) +{ + int i; + if (n) + for (i = 0; i < sizeof(the_adjustments) / sizeof(paperadj_t); i++) + { + if (strcmp(n, the_adjustments[i].name) == 0) + return the_adjustments[i].paper_list; + } + return NULL; +} + + +#define DECLARE_INPUT_SLOT(name) \ +static const input_slot_list_t name##_input_slot_list = \ +{ \ + #name, \ + name##_input_slots, \ + sizeof(name##_input_slots) / sizeof(const input_slot_t), \ +} + +static const input_slot_t standard_roll_feed_input_slots[] = +{ + { + "Standard", + N_("Standard"), + 0, + 0, + 0, + { 16, "IR\002\000\000\001EX\006\000\000\000\000\000\005\000" }, + { 6, "IR\002\000\000\000"} + }, + { + "Roll", + N_("Roll Feed"), + 0, + 1, + ROLL_FEED_DONT_EJECT, + { 16, "IR\002\000\000\001EX\006\000\000\000\000\000\005\001" }, + { 6, "IR\002\000\000\002" } + } +}; + +DECLARE_INPUT_SLOT(standard_roll_feed); + +static const input_slot_t cutter_roll_feed_input_slots[] = +{ + { + "Standard", + N_("Standard"), + 0, + 0, + 0, + { 16, "IR\002\000\000\001EX\006\000\000\000\000\000\005\000" }, + { 6, "IR\002\000\000\000"} + }, + { + "RollCutPage", + N_("Roll Feed (cut each page)"), + 0, + 1, + ROLL_FEED_CUT_ALL, + { 16, "IR\002\000\000\001EX\006\000\000\000\000\000\005\001" }, + { 6, "IR\002\000\000\002" } + }, + { + "RollCutNone", + N_("Roll Feed (do not cut)"), + 0, + 1, + ROLL_FEED_DONT_EJECT, + { 16, "IR\002\000\000\001EX\006\000\000\000\000\000\005\001" }, + { 6, "IR\002\000\000\002" } + } +}; + +DECLARE_INPUT_SLOT(cutter_roll_feed); + +static const input_slot_t cd_cutter_roll_feed_input_slots[] = +{ + { + "Standard", + N_("Standard"), + 0, + 0, + 0, + { 23, "IR\002\000\000\001EX\006\000\000\000\000\000\005\000PP\003\000\000\001\377" }, + { 6, "IR\002\000\000\000"} + }, + { + "Manual", + N_("Manual Feed"), + 0, + 0, + 0, + { 36, "PM\002\000\000\000IR\002\000\000\001EX\006\000\000\000\000\000\005\000FP\003\000\000\000\000PP\003\000\000\002\001" }, + { 6, "IR\002\000\000\000"} + }, + { + "CD", + N_("Print to CD"), + 1, + 0, + 0, + { 36, "PM\002\000\000\000IR\002\000\000\001EX\006\000\000\000\000\000\005\000FP\003\000\000\000\000PP\003\000\000\002\001" }, + { 6, "IR\002\000\000\000"} + }, + { + "RollCutPage", + N_("Roll Feed (cut each page)"), + 0, + 1, + ROLL_FEED_CUT_ALL, + { 23, "IR\002\000\000\001EX\006\000\000\000\000\000\005\001PP\003\000\000\001\377" }, + { 6, "IR\002\000\000\002" } + }, + { + "RollCutNone", + N_("Roll Feed (do not cut)"), + 0, + 1, + ROLL_FEED_DONT_EJECT, + { 23, "IR\002\000\000\001EX\006\000\000\000\000\000\005\001PP\003\000\000\001\377" }, + { 6, "IR\002\000\000\002" } + } +}; + +DECLARE_INPUT_SLOT(cd_cutter_roll_feed); + +static const input_slot_t cd_roll_feed_input_slots[] = +{ + { + "Standard", + N_("Standard"), + 0, + 0, + 0, + { 23, "IR\002\000\000\001EX\006\000\000\000\000\000\005\000PP\003\000\000\001\377" }, + { 6, "IR\002\000\000\000"} + }, + { + "Manual", + N_("Manual Feed"), + 0, + 0, + 0, + { 36, "PM\002\000\000\000IR\002\000\000\001EX\006\000\000\000\000\000\005\000FP\003\000\000\000\000PP\003\000\000\002\001" }, + { 6, "IR\002\000\000\000"} + }, + { + "CD", + N_("Print to CD"), + 1, + 0, + 0, + { 36, "PM\002\000\000\000IR\002\000\000\001EX\006\000\000\000\000\000\005\000FP\003\000\000\000\000PP\003\000\000\002\001" }, + { 6, "IR\002\000\000\000"} + }, + { + "Roll", + N_("Roll Feed"), + 0, + 1, + ROLL_FEED_DONT_EJECT, + { 23, "IR\002\000\000\001EX\006\000\000\000\000\000\005\001PP\003\000\000\001\377" }, + { 6, "IR\002\000\000\002" } + } +}; + +DECLARE_INPUT_SLOT(cd_roll_feed); + +static const input_slot_t r2400_input_slots[] = +{ + { + "Standard", + N_("Standard"), + 0, + 0, + 0, + { 23, "IR\002\000\000\001EX\006\000\000\000\000\000\005\000PP\003\000\000\001\377" }, + { 6, "IR\002\000\000\000"} + }, + { + "Velvet", + N_("Manual Sheet Guide"), + 0, + 0, + 0, + { 23, "IR\002\000\000\001EX\006\000\000\000\000\000\005\000PP\003\000\000\003\000" }, + { 6, "IR\002\000\000\000"} + }, + { + "Matte", + N_("Manual Feed (Front)"), + 0, + 0, + 0, + { 23, "IR\002\000\000\001EX\006\000\000\000\000\000\005\000PP\003\000\000\002\000" }, + { 6, "IR\002\000\000\000"} + }, + { + "Roll", + N_("Roll Feed"), + 0, + 1, + ROLL_FEED_DONT_EJECT, + { 23, "IR\002\000\000\001EX\006\000\000\000\000\000\005\001PP\003\000\000\003\001" }, + { 6, "IR\002\000\000\002" } + } +}; + +DECLARE_INPUT_SLOT(r2400); + +static const input_slot_t r1800_input_slots[] = +{ + { + "Standard", + N_("Standard"), + 0, + 0, + 0, + { 23, "IR\002\000\000\001EX\006\000\000\000\000\000\005\000PP\003\000\000\001\377" }, + { 6, "IR\002\000\000\000"} + }, + { + "Velvet", + N_("Manual Sheet Guide"), + 0, + 0, + 0, + { 23, "IR\002\000\000\001EX\006\000\000\000\000\000\005\000PP\003\000\000\003\000" }, + { 6, "IR\002\000\000\000"} + }, + { + "Matte", + N_("Manual Feed (Front)"), + 0, + 0, + 0, + { 23, "IR\002\000\000\001EX\006\000\000\000\000\000\005\000PP\003\000\000\002\000" }, + { 6, "IR\002\000\000\000"} + }, + { + "Roll", + N_("Roll Feed"), + 0, + 1, + ROLL_FEED_DONT_EJECT, + { 23, "IR\002\000\000\001EX\006\000\000\000\000\000\005\001PP\003\000\000\003\001" }, + { 6, "IR\002\000\000\002" } + }, + { + "CD", + N_("Print to CD"), + 1, + 0, + 0, + { 36, "PM\002\000\000\000IR\002\000\000\001EX\006\000\000\000\000\000\005\000FP\003\000\000\000\000PP\003\000\000\002\001" }, + { 6, "IR\002\000\000\000"} + }, +}; + +DECLARE_INPUT_SLOT(r1800); + +static const input_slot_t rx700_input_slots[] = +{ + { + "Rear", + N_("Rear Tray"), + 0, + 0, + 0, + { 23, "IR\002\000\000\001EX\006\000\000\000\000\000\005\000PP\003\000\000\001\000" }, + { 6, "IR\002\000\000\000"} + }, + { + "Front", + N_("Front Tray"), + 0, + 0, + 0, + { 23, "IR\002\000\000\001EX\006\000\000\000\000\000\005\000PP\003\000\000\001\001" }, + { 6, "IR\002\000\000\000"} + }, + { + "CD", + N_("Print to CD"), + 1, + 0, + 0, + { 36, "PM\002\000\000\000IR\002\000\000\001EX\006\000\000\000\000\000\005\000FP\003\000\000\000\000PP\003\000\000\002\001" }, + { 6, "IR\002\000\000\000"} + }, + { + "PhotoBoard", + N_("Photo Board"), + 0, + 0, + 0, + { 23, "IR\002\000\000\001EX\006\000\000\000\000\000\005\000PP\003\000\000\002\000" }, + { 6, "IR\002\000\000\000"} + }, +}; + +DECLARE_INPUT_SLOT(rx700); + +static const input_slot_t pro_roll_feed_input_slots[] = +{ + { + "Standard", + N_("Standard"), + 0, + 0, + 0, + { 7, "PP\003\000\000\002\000" }, + { 0, "" } + }, + { + "Roll", + N_("Roll Feed"), + 0, + 1, + 0, + { 7, "PP\003\000\000\003\000" }, + { 0, "" } + } +}; + +DECLARE_INPUT_SLOT(pro_roll_feed); + +static const input_slot_t spro5000_input_slots[] = +{ + { + "CutSheet1", + N_("Cut Sheet Bin 1"), + 0, + 0, + 0, + { 7, "PP\003\000\000\001\001" }, + { 0, "" } + }, + { + "CutSheet2", + N_("Cut Sheet Bin 2"), + 0, + 0, + 0, + { 7, "PP\003\000\000\002\001" }, + { 0, "" } + }, + { + "CutSheetAuto", + N_("Cut Sheet Autoselect"), + 0, + 0, + 0, + { 7, "PP\003\000\000\001\377" }, + { 0, "" } + }, + { + "ManualSelect", + N_("Manual Selection"), + 0, + 0, + 0, + { 7, "PP\003\000\000\002\001" }, + { 0, "" } + } +}; + +DECLARE_INPUT_SLOT(spro5000); + +static const input_slot_list_t default_input_slot_list = +{ + "Standard", + NULL, + 0, +}; + +typedef struct +{ + const char *name; + const input_slot_list_t *input_slots; +} inslot_t; + +static const inslot_t the_slots[] = +{ + { "cd_cutter_roll_feed", &cd_cutter_roll_feed_input_slot_list }, + { "cd_roll_feed", &cd_roll_feed_input_slot_list }, + { "cutter_roll_feed", &cutter_roll_feed_input_slot_list }, + { "default", &default_input_slot_list }, + { "pro_roll_feed", &pro_roll_feed_input_slot_list }, + { "r1800", &r1800_input_slot_list }, + { "r2400", &r2400_input_slot_list }, + { "rx700", &rx700_input_slot_list }, + { "spro5000", &spro5000_input_slot_list }, + { "standard_roll_feed", &standard_roll_feed_input_slot_list }, +}; + +const input_slot_list_t * +stpi_escp2_get_input_slot_list_named(const char *n) +{ + int i; + if (n) + for (i = 0; i < sizeof(the_slots) / sizeof(inslot_t); i++) + { + if (strcmp(n, the_slots[i].name) == 0) + return the_slots[i].input_slots; + } + return NULL; +} diff --git a/src/main/escp2-resolutions.c b/src/main/escp2-resolutions.c index 9dfe8e7..22db6c7 100644 --- a/src/main/escp2-resolutions.c +++ b/src/main/escp2-resolutions.c @@ -1,5 +1,5 @@ /* - * "$Id: escp2-resolutions.c,v 1.33 2006/05/06 21:30:59 rlk Exp $" + * "$Id: escp2-resolutions.c,v 1.33.8.2 2007/05/29 01:47:28 rlk Exp $" * * Print plug-in EPSON ESC/P2 driver for the GIMP. * @@ -31,163 +31,154 @@ static const res_t r_360x90dpi = { "360x90dpi", N_("360 x 90 DPI Fast Economy"), - 360, 90, 360, 90, 0, 0, 1 }; + 360, 90, 360, 90, 360, 90, 0, 0, 1 }; static const res_t r_360x90sw = { "360x90sw", N_("360 x 90 DPI Fast Economy"), - 360, 90, 360, 90, 1, 0, 1 }; + 360, 90, 360, 90, 360, 90, 1, 0, 1 }; static const res_t r_360x120dpi = { "360x120dpi", N_("360 x 120 DPI Economy"), - 360, 120, 360, 120, 0, 0, 1 }; + 360, 120, 360, 120, 360, 120, 0, 0, 1 }; static const res_t r_360x120sw = { "360x120sw", N_("360 x 120 DPI Economy"), - 360, 120, 360, 120, 1, 0, 1 }; + 360, 120, 360, 120, 360, 120, 1, 0, 1 }; static const res_t r_180dpi = { "180dpi", N_("180 DPI Economy"), - 180, 180, 180, 180, 0, 0, 1 }; + 180, 180, 180, 180, 180, 180, 0, 0, 1 }; static const res_t r_180sw = { "180sw", N_("180 DPI Economy"), - 180, 180, 180, 180, 1, 0, 1 }; + 180, 180, 180, 180, 180, 180, 1, 0, 1 }; static const res_t r_360x180dpi = { "360x180dpi", N_("360 x 180 DPI Draft"), - 360, 180, 360, 180, 0, 0, 1 }; + 360, 180, 360, 180, 360, 180, 0, 0, 1 }; static const res_t r_360x180sw = { "360x180sw", N_("360 x 180 DPI Draft"), - 360, 180, 360, 180, 1, 0, 1 }; + 360, 180, 360, 180, 360, 180, 1, 0, 1 }; static const res_t r_360x240dpi = { "360x240dpi", N_("360 x 240 DPI Draft"), - 360, 240, 360, 240, 0, 0, 1 }; + 360, 240, 360, 240, 360, 240, 0, 0, 1 }; static const res_t r_360x240sw = { "360x240sw", N_("360 x 240 DPI Draft"), - 360, 240, 360, 240, 1, 0, 1 }; + 360, 240, 360, 240, 360, 240, 1, 0, 1 }; static const res_t r_360mw = { "360mw", N_("360 DPI High Quality"), - 360, 360, 360, 360, 0, 1, 1 }; + 360, 360, 360, 360, 360, 360, 0, 1, 1 }; static const res_t r_360pro = { "360pro", N_("360 DPI"), - 360, 360, 360, 360, 0, 1, 1 }; + 360, 360, 360, 360, 360, 360, 0, 1, 1 }; static const res_t r_360 = { "360", N_("360 DPI"), - 360, 360, 360, 360, 0, 0, 1 }; + 360, 360, 360, 360, 360, 360, 0, 0, 1 }; static const res_t r_360sw = { "360sw", N_("360 DPI"), - 360, 360, 360, 360, 1, 0, 1 }; + 360, 360, 360, 360, 360, 360, 1, 0, 1 }; static const res_t r_720x360mw = { "720x360mw", N_("720 x 360 DPI"), - 720, 360, 720, 360, 0, 1, 1 }; + 720, 360, 720, 360, 720, 360, 0, 1, 1 }; static const res_t r_720x360sw = { "720x360sw", N_("720 x 360 DPI"), - 720, 360, 720, 360, 1, 0, 1 }; + 720, 360, 720, 360, 720, 360, 1, 0, 1 }; +static const res_t r_720x360un = +{ "720x360un", N_("720 x 360 DPI Enhanced"), + 720, 360, 1440, 720, 720, 360, 1, 0, 1 }; static const res_t r_720mw = { "720mw", N_("720 DPI"), - 720, 720, 720, 720, 0, 1, 1 }; + 720, 720, 720, 720, 720, 720, 0, 1, 1 }; static const res_t r_720sw = { "720sw", N_("720 DPI"), - 720, 720, 720, 720, 1, 0, 1 }; + 720, 720, 720, 720, 720, 720, 1, 0, 1 }; +static const res_t r_720un = +{ "720un", N_("720 DPI High Quality"), + 720, 720, 1440, 720, 720, 720, 1, 0, 1 }; static const res_t r_720hq = { "720hq", N_("720 DPI High Quality"), - 720, 720, 720, 720, 1, 0, 2 }; + 720, 720, 720, 720, 720, 720, 1, 0, 2 }; static const res_t r_720hq2 = { "720hq2", N_("720 DPI Highest Quality"), - 720, 720, 720, 720, 1, 0, 4 }; + 720, 720, 720, 720, 720, 720, 1, 0, 4 }; static const res_t r_720x720oov = { "720x720oov", N_("720 x 720 DPI"), - 2880, 720, 720, 720, 1, 0, 1 }; + 2880, 720, 2880, 720, 720, 720, 1, 0, 1 }; static const res_t r_1440x720mw = { "1440x720mw", N_("1440 x 720 DPI"), - 1440, 720, 1440, 720, 0, 1, 1 }; + 1440, 720, 1440, 720, 1440, 720, 0, 1, 1 }; static const res_t r_1440x720sw = { "1440x720sw", N_("1440 x 720 DPI"), - 1440, 720, 1440, 720, 1, 0, 1 }; + 1440, 720, 1440, 720, 1440, 720, 1, 0, 1 }; static const res_t r_1440x720hq2 = { "1440x720hq2", N_("1440 x 720 DPI Highest Quality"), - 1440, 720, 1440, 720, 1, 0, 2 }; + 1440, 720, 1440, 720, 1440, 720, 1, 0, 2 }; static const res_t r_720x1440sw = { "720x1440sw", N_("1440 x 720 DPI Transposed"), - 720, 1440, 720, 1440, 1, 0, 1 }; + 720, 1440, 720, 1440, 720, 1440, 1, 0, 1 }; static const res_t r_720x1440ov = { "720x1440ov", N_("1440 x 720 DPI Transposed"), - 1440, 1440, 720, 1440, 1, 0, 1}; + 1440, 1440, 1440, 1440, 720, 1440, 1, 0, 1}; static const res_t r_1440x720ov = { "1440x720ov", N_("1440 x 720 DPI"), - 2880, 720, 1440, 720, 1, 0, 1 }; + 2880, 720, 2880, 720, 1440, 720, 1, 0, 1 }; static const res_t r_2880x720mw = { "2880x720mw", N_("2880 x 720 DPI"), - 2880, 720, 2880, 720, 0, 1, 1}; + 2880, 720, 2880, 720, 2880, 720, 0, 1, 1}; static const res_t r_2880x720sw = { "2880x720sw", N_("2880 x 720 DPI"), - 2880, 720, 2880, 720, 1, 0, 1}; + 2880, 720, 2880, 720, 2880, 720, 1, 0, 1}; static const res_t r_2880x720hq2 = { "2880x720hq2", N_("2880 x 720 DPI Highest Quality"), - 2880, 720, 2880, 720, 1, 0, 2 }; + 2880, 720, 2880, 720, 2880, 720, 1, 0, 2 }; static const res_t r_1440x1440mw = { "1440x1440mw", N_("1440 x 1440 DPI"), - 1440, 1440, 1440, 1440, 0, 1, 1}; + 1440, 1440, 1440, 1440, 1440, 1440, 0, 1, 1}; static const res_t r_1440x1440sw = { "1440x1440sw", N_("1440 x 1440 DPI"), - 1440, 1440, 1440, 1440, 1, 0, 1}; + 1440, 1440, 1440, 1440, 1440, 1440, 1, 0, 1}; static const res_t r_1440x1440ov = { "1440x1440ov", N_("1440 x 1440 DPI"), - 2880, 1440, 1440, 1440, 1, 0, 1}; -static const res_t r_1440x1440sw3650 = -{ "1440x1440ov", N_("1440 x 1440"), - 1440, 1440, 1440, 1440, 1, 0, 1}; -static const res_t r_1440x1440sw3650hq = -{ "2880x1440sw", N_("1440 x 1440 DPI High Quality"), - 1440, 1440, 1440, 1440, 1, 0, 2}; -static const res_t r_1440x1440sw3650hq2 = -{ "5760x1440sw", N_("1440 x 1440 DPI Highest Quality"), - 1440, 1440, 1440, 1440, 1, 0, 4}; + 2880, 1440, 2880, 1440, 1440, 1440, 1, 0, 1}; static const res_t r_2880x1440mw = { "2880x1440mw", N_("2880 x 1440 DPI"), - 2880, 1440, 2880, 1440, 0, 1, 1}; + 2880, 1440, 2880, 1440, 2880, 1440, 0, 1, 1}; static const res_t r_2880x1440sw = { "2880x1440sw", N_("2880 x 1440 DPI"), - 2880, 1440, 2880, 1440, 1, 0, 1}; + 2880, 1440, 2880, 1440, 2880, 1440, 1, 0, 1}; static const res_t r_1440x2880sw = { "1440x2880sw", N_("2880 x 1440 DPI Transposed"), - 1440, 2880, 1440, 2880, 1, 0, 1}; + 1440, 2880, 1440, 2880, 1440, 2880, 1, 0, 1}; static const res_t r_2880x1440sw2400 = { "2880x1440sw", N_("2880 x 1440 DPI"), - 1440, 2880, 1440, 2880, 1, 0, 1}; -static const res_t r_2880x1440sw2400hq = -{ "2880x2880sw", N_("2880 x 1440 DPI High Quality"), - 1440, 2880, 1440, 2880, 1, 0, 2}; -static const res_t r_2880x1440sw2400hq2 = -{ "5760x2880sw", N_("2880 x 1440 DPI Highest Quality"), - 1440, 2880, 1440, 2880, 1, 0, 4}; + 1440, 2880, 1440, 2880, 1440, 2880, 1, 0, 1}; static const res_t r_5760x1440sw = { "5760x1440sw", N_("5760 x 1440 DPI"), - 5760, 1440, 5760, 1440, 1, 0, 1}; + 5760, 1440, 5760, 1440, 5760, 1440, 1, 0, 1}; static const res_t r_2880x2880mw = { "2880x2880mw", N_("2880 x 2880 DPI"), - 2880, 2880, 2880, 2880, 0, 1, 1}; + 2880, 2880, 2880, 2880, 2880, 2880, 0, 1, 1}; static const res_t r_2880x2880sw = { "2880x2880sw", N_("2880 x 2880 DPI"), - 2880, 2880, 2880, 2880, 1, 0, 1}; + 2880, 2880, 2880, 2880, 2880, 2880, 1, 0, 1}; static const res_t r_5760x2880mw = { "5760x2880mw", N_("5760 x 2880 DPI"), - 5760, 2880, 5760, 2880, 0, 1, 1}; + 5760, 2880, 5760, 2880, 5760, 2880, 0, 1, 1}; static const res_t r_5760x2880sw = { "5760x2880sw", N_("5760 x 2880 DPI"), - 5760, 2880, 5760, 2880, 1, 0, 1}; + 5760, 2880, 5760, 2880, 5760, 2880, 1, 0, 1}; -const res_t *const stpi_escp2_720dpi_reslist[] = +static const res_t *const stpi_escp2_720dpi_reslist[] = { &r_360x90dpi, @@ -209,7 +200,7 @@ const res_t *const stpi_escp2_720dpi_reslist[] = NULL }; -const res_t *const stpi_escp2_1440dpi_reslist[] = +static const res_t *const stpi_escp2_1440dpi_reslist[] = { &r_360x90sw, @@ -234,7 +225,7 @@ const res_t *const stpi_escp2_1440dpi_reslist[] = NULL }; -const res_t *const stpi_escp2_2880dpi_reslist[] = +static const res_t *const stpi_escp2_2880dpi_reslist[] = { &r_360x90sw, @@ -261,7 +252,7 @@ const res_t *const stpi_escp2_2880dpi_reslist[] = NULL }; -const res_t *const stpi_escp2_2880_1440dpi_reslist[] = +static const res_t *const stpi_escp2_2880_1440dpi_reslist[] = { &r_360x90sw, @@ -280,21 +271,19 @@ const res_t *const stpi_escp2_2880_1440dpi_reslist[] = &r_720sw, &r_1440x720sw, - &r_720x1440sw, &r_2880x720sw, &r_1440x1440sw, &r_2880x1440sw, - &r_1440x2880sw, &r_2880x2880sw, NULL }; -const res_t *const stpi_escp2_g3_reslist[] = +static const res_t *const stpi_escp2_g3_reslist[] = { &r_360x90dpi, @@ -320,8 +309,10 @@ const res_t *const stpi_escp2_g3_reslist[] = NULL }; -const res_t *const stpi_escp2_superfine_reslist[] = +static const res_t *const stpi_escp2_superfine_reslist[] = { + &r_360x90sw, + &r_360x120sw, &r_360x180sw, @@ -335,12 +326,12 @@ const res_t *const stpi_escp2_superfine_reslist[] = &r_720sw, &r_1440x720sw, - &r_720x1440sw, &r_1440x1440ov, &r_2880x1440sw, - &r_1440x2880sw, + + &r_5760x1440sw, &r_2880x2880sw, @@ -349,9 +340,9 @@ const res_t *const stpi_escp2_superfine_reslist[] = NULL }; -const res_t *const stpi_escp2_r2400_reslist[] = +static const res_t *const stpi_escp2_claria_1400_reslist[] = { - &r_360x120sw, + &r_360x90sw, &r_360x180sw, @@ -361,45 +352,28 @@ const res_t *const stpi_escp2_r2400_reslist[] = &r_720x360sw, - &r_720sw, - - &r_1440x720sw, - &r_720x1440sw, - - &r_1440x1440sw, - - &r_2880x1440sw2400, - &r_2880x1440sw2400hq, - &r_2880x1440sw2400hq2, + &r_720x360un, - NULL -}; + &r_720sw, -const res_t *const stpi_escp2_cx3650_reslist[] = -{ - &r_360x120sw, + &r_720un, - &r_360x180sw, - - &r_360x240sw, + &r_1440x720sw, - &r_360sw, + &r_1440x1440ov, - &r_720x360sw, + &r_2880x1440sw, - &r_720sw, + &r_5760x1440sw, - &r_1440x720sw, - &r_720x1440sw, + &r_2880x2880sw, - &r_1440x1440sw3650, - &r_1440x1440sw3650hq, - &r_1440x1440sw3650hq2, + &r_5760x2880sw, NULL }; -const res_t *const stpi_escp2_picturemate_reslist[] = +static const res_t *const stpi_escp2_picturemate_reslist[] = { &r_720x720oov, @@ -417,7 +391,7 @@ const res_t *const stpi_escp2_picturemate_reslist[] = NULL }; -const res_t *const stpi_escp2_sc500_reslist[] = +static const res_t *const stpi_escp2_sc500_reslist[] = { &r_360x90dpi, @@ -439,7 +413,7 @@ const res_t *const stpi_escp2_sc500_reslist[] = NULL }; -const res_t *const stpi_escp2_g3_720dpi_reslist[] = +static const res_t *const stpi_escp2_g3_720dpi_reslist[] = { &r_360x90dpi, @@ -463,7 +437,7 @@ const res_t *const stpi_escp2_g3_720dpi_reslist[] = NULL }; -const res_t *const stpi_escp2_720dpi_soft_reslist[] = +static const res_t *const stpi_escp2_720dpi_soft_reslist[] = { &r_360x90dpi, @@ -486,7 +460,7 @@ const res_t *const stpi_escp2_720dpi_soft_reslist[] = NULL }; -const res_t *const stpi_escp2_sc640_reslist[] = +static const res_t *const stpi_escp2_sc640_reslist[] = { &r_360x90dpi, @@ -507,7 +481,7 @@ const res_t *const stpi_escp2_sc640_reslist[] = NULL }; -const res_t *const stpi_escp2_pro_reslist[] = +static const res_t *const stpi_escp2_pro_reslist[] = { &r_360x90dpi, @@ -534,11 +508,47 @@ const res_t *const stpi_escp2_pro_reslist[] = NULL }; +typedef struct +{ + const char *name; + const res_t *const *const res_list; +} resolution_t; + +static const resolution_t the_resolutions[] = +{ + { "superfine", stpi_escp2_superfine_reslist }, + { "claria_1400", stpi_escp2_claria_1400_reslist }, + { "pro", stpi_escp2_pro_reslist }, + { "720dpi", stpi_escp2_720dpi_reslist }, + { "720dpi_soft", stpi_escp2_720dpi_soft_reslist }, + { "g3_720dpi", stpi_escp2_g3_720dpi_reslist }, + { "1440dpi", stpi_escp2_1440dpi_reslist }, + { "2880dpi", stpi_escp2_2880dpi_reslist }, + { "2880_1440dpi", stpi_escp2_2880_1440dpi_reslist }, + { "g3", stpi_escp2_g3_reslist }, + { "sc500", stpi_escp2_sc500_reslist }, + { "sc640", stpi_escp2_sc640_reslist }, + { "picturemate", stpi_escp2_picturemate_reslist }, +}; + +const res_t *const * +stpi_escp2_get_reslist_named(const char *n) +{ + int i; + if (n) + for (i = 0; i < sizeof(the_resolutions) / sizeof(resolution_t); i++) + { + if (strcmp(n, the_resolutions[i].name) == 0) + return the_resolutions[i].res_list; + } + return NULL; +} + #define DECLARE_PRINTER_WEAVES(name) \ -const printer_weave_list_t stpi_escp2_##name##_printer_weave_list = \ +static const printer_weave_list_t name##_printer_weave_list = \ { \ #name, \ - sizeof(name##_printer_weaves) / sizeof(printer_weave_t), \ + sizeof(name##_printer_weaves) / sizeof(printer_weave_t), \ name##_printer_weaves \ } @@ -585,3 +595,108 @@ static const printer_weave_t pro7600_printer_weaves[] = }; DECLARE_PRINTER_WEAVES(pro7600); + +typedef struct +{ + const char *name; + const printer_weave_list_t *weave_list; +} weave_t; + +static const weave_t the_weaves[] = +{ + { "standard", &standard_printer_weave_list }, + { "pro7000", &pro7000_printer_weave_list }, + { "pro7500", &pro7500_printer_weave_list }, + { "pro7600", &pro7600_printer_weave_list }, +}; + +const printer_weave_list_t * +stpi_escp2_get_printer_weaves_named(const char *n) +{ + int i; + if (n) + for (i = 0; i < sizeof(the_weaves) / sizeof(weave_t); i++) + { + if (strcmp(n, the_weaves[i].name) == 0) + return the_weaves[i].weave_list; + } + return NULL; +} + + +#define DECLARE_QUALITY_LIST(name) \ +static const quality_list_t name##_quality_list = \ +{ \ + #name, \ + name##_qualities, \ + sizeof(name##_qualities) / sizeof(const quality_t), \ +} + +static const quality_t standard_qualities[] = +{ + { "FastEconomy", N_("Fast Economy"), 180, 90, 360, 120, 360, 90 }, + { "Economy", N_("Economy"), 360, 180, 360, 240, 360, 180 }, + { "Draft", N_("Draft"), 360, 360, 360, 360, 360, 360 }, + { "Standard", N_("Standard"), 0, 0, 0, 0, 720, 360 }, + { "High", N_("High"), 0, 0, 0, 0, 720, 720 }, + { "Photo", N_("Photo"), 1440, 720, 2880, 720, 1440, 720 }, + { "HighPhoto", N_("Super Photo"), 1440, 1440, 2880, 1440, 1440, 1440 }, + { "UltraPhoto", N_("Ultra Photo"), 2880, 2880, 2880, 2880, 2880, 2880 }, + { "Best", N_("Best"), 720, 360, 0, 0, -1, -1 }, +}; + +DECLARE_QUALITY_LIST(standard); + +static const quality_t p1_5_qualities[] = +{ + { "FastEconomy", N_("Fast Economy"), 180, 90, 360, 120, 360, 90 }, + { "Economy", N_("Economy"), 360, 180, 360, 240, 360, 180 }, + { "Draft", N_("Draft"), 360, 360, 360, 360, 360, 360 }, + { "Standard", N_("Standard"), 0, 0, 0, 0, 720, 360 }, + { "High", N_("High"), 0, 0, 0, 0, 720, 720 }, + { "Photo", N_("Photo"), 1440, 720, 1440, 720, 1440, 720 }, + { "HighPhoto", N_("Super Photo"), 1440, 1440, 2880, 1440, 1440, 1440 }, + { "UltraPhoto", N_("Ultra Photo"), 2880, 2880, 2880, 2880, 2880, 2880 }, + { "Best", N_("Best"), 720, 360, 0, 0, -1, -1 }, +}; + +DECLARE_QUALITY_LIST(p1_5); + +static const quality_t picturemate_qualities[] = +{ + { "Draft", N_("Draft"), 1440, 720, 1440, 720, 1440, 720 }, + { "Standard", N_("Standard"), 1440, 1440, 1440, 1440, 1440, 1440 }, + { "Photo", N_("Photo"), 1440, 1440, 1440, 1440, 1440, 1440 }, + { "High", N_("High"), 2880, 1440, 2880, 1440, 2880, 1440 }, + { "HighPhoto", N_("Super Photo"), 2880, 1440, 2880, 1440, 2880, 1440 }, + { "UltraPhoto", N_("Ultra Photo"), 5760, 1440, 5760, 1440, 5760, 1440 }, + { "Best", N_("Best"), 5760, 1440, 5760, 1440, 5760, 1440 }, +}; + +DECLARE_QUALITY_LIST(picturemate); + +typedef struct +{ + const char *name; + const quality_list_t *quality_list; +} qual_t; + +static const qual_t the_qualities[] = +{ + { "standard", &standard_quality_list }, + { "p1_5", &p1_5_quality_list }, + { "picturemate", &picturemate_quality_list }, +}; + +const quality_list_t * +stpi_escp2_get_quality_list_named(const char *n) +{ + int i; + if (n) + for (i = 0; i < sizeof(the_qualities) / sizeof(qual_t); i++) + { + if (strcmp(n, the_qualities[i].name) == 0) + return the_qualities[i].quality_list; + } + return NULL; +} diff --git a/src/main/papers.xml b/src/main/papers.xml index 4f2bacd..c8a017b 100644 --- a/src/main/papers.xml +++ b/src/main/papers.xml @@ -4,7 +4,7 @@ XML description of papers known to libgutenprint. It should be edited by hand. - "$Id: papers.xml,v 1.21 2006/04/20 00:33:41 rlk Exp $" + "$Id: papers.xml,v 1.21.8.1 2007/03/02 12:01:26 rlk Exp $" --> 0.75 + + 0.4 + + + 0.7 + 0.6 + 1.7 + 0.9 + 0.6 + @@ -64,7 +74,7 @@ - + @@ -72,7 +82,32 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -93,6 +128,10 @@ 1.02 0.500 + + 0.470 + 0.8 + @@ -124,12 +163,14 @@ + + @@ -175,8 +216,8 @@ --> - - + + @@ -194,25 +235,41 @@ + + - + + + + + + + - - - - - - - - - - + + + + + + + + + + + + + + + + + + @@ -244,20 +301,24 @@ + + + - - - - + + + + + - - + + @@ -267,6 +328,14 @@ + + + + + + + + @@ -314,19 +383,23 @@ + - - - - - - + + + + + + + + + @@ -724,6 +797,7 @@ + @@ -789,6 +863,7 @@ + @@ -796,6 +871,8 @@ 0.5 2.0 + + @@ -812,6 +889,8 @@ + + @@ -822,10 +901,15 @@ + + + + + diff --git a/src/main/sequence.c b/src/main/sequence.c index ef69990..83f2b69 100644 --- a/src/main/sequence.c +++ b/src/main/sequence.c @@ -1,5 +1,5 @@ /* - * "$Id: sequence.c,v 1.22 2006/07/07 21:31:02 rleigh Exp $" + * "$Id: sequence.c,v 1.23 2006/09/12 19:03:33 easysw Exp $" * * Sequence data type. This type is designed to be derived from by * the curve and dither matrix types. @@ -277,7 +277,7 @@ stp_sequence_set_point(stp_sequence_t *sequence, size_t where, { check_sequence(sequence); - if (where >= sequence->size || ! finite(data) || + if (where >= sequence->size || ! isfinite(data) || data < sequence->blo || data > sequence->bhi) return 0; @@ -378,7 +378,7 @@ stp_sequence_create_from_xmltree(stp_mxml_node_t *da) child->value.text.string); goto error; } - if (! finite(tmpval) + if (! isfinite(tmpval) || ( tmpval == 0 && errno == ERANGE ) || tmpval < low || tmpval > high) @@ -484,7 +484,7 @@ stp_sequence_set_##name##_data(stp_sequence_t *sequence, \ \ /* Validate the data before we commit to it. */ \ for (i = 0; i < count; i++) \ - if (! finite(data[i]) || \ + if (! isfinite(data[i]) || \ data[i] < sequence->blo || \ data[i] > sequence->bhi) \ return 0; \ diff --git a/src/main/util.h b/src/main/util.h index 701a8eb..7a3fe61 100644 --- a/src/main/util.h +++ b/src/main/util.h @@ -1,5 +1,5 @@ /* - * "$Id: util.h,v 1.33 2006/01/13 16:09:14 rleigh Exp $" + * "$Id: util.h,v 1.33.10.1 2007/03/02 12:01:33 rlk Exp $" * * Gutenprint header. * @@ -58,6 +58,9 @@ extern "C" { extern void stpi_init_paper(void); extern void stpi_init_dither(void); extern void stpi_init_printer(void); +#define BUFFER_FLAG_FLIP_X 0x1 +#define BUFFER_FLAG_FLIP_Y 0x2 +extern stp_image_t* stpi_buffer_image(stp_image_t* image, unsigned int flags); /** @} */ @@ -67,5 +70,5 @@ extern void stpi_init_printer(void); #endif /* GUTENPRINT_INTERNAL_UTIL_H */ /* - * End of "$Id: util.h,v 1.33 2006/01/13 16:09:14 rleigh Exp $". + * End of "$Id: util.h,v 1.33.10.1 2007/03/02 12:01:33 rlk Exp $". */ diff --git a/src/main/xml.c b/src/main/xml.c index ac64537..c43b13b 100644 --- a/src/main/xml.c +++ b/src/main/xml.c @@ -1,5 +1,5 @@ /* - * "$Id: xml.c,v 1.33 2004/09/17 18:38:27 rleigh Exp $" + * "$Id: xml.c,v 1.33.18.1 2007/05/29 01:47:30 rlk Exp $" * * XML parser - process Gutenprint XML data with mxml. * @@ -126,9 +126,7 @@ stp_unregister_xml_preload(const char *name) static void stpi_xml_process_gutenprint(stp_mxml_node_t *gutenprint, const char *file); -static char *saved_lc_collate; /* Saved LC_COLLATE */ -static char *saved_lc_ctype; /* Saved LC_CTYPE */ -static char *saved_lc_numeric; /* Saved LC_NUMERIC */ +static char *saved_locale; /* Saved LC_ALL */ static int xml_is_initialised; /* Flag for init */ void @@ -154,6 +152,8 @@ stp_xml_preinit(void) void stp_xml_init(void) { + stp_deprintf(STP_DBG_XML, "stp_xml_init: entering at level %d\n", + xml_is_initialised); if (xml_is_initialised >= 1) { xml_is_initialised++; @@ -161,9 +161,11 @@ stp_xml_init(void) } /* Set some locale facets to "C" */ - saved_lc_collate = setlocale(LC_COLLATE, "C"); - saved_lc_ctype = setlocale(LC_CTYPE, "C"); - saved_lc_numeric = setlocale(LC_NUMERIC, "C"); +#ifdef HAVE_LOCALE_H + saved_locale = stp_strdup(setlocale(LC_ALL, NULL)); + stp_deprintf(STP_DBG_XML, "stp_xml_init: saving locale %s\n", saved_locale); + setlocale(LC_ALL, "C"); +#endif xml_is_initialised = 1; } @@ -175,6 +177,8 @@ stp_xml_init(void) void stp_xml_exit(void) { + stp_deprintf(STP_DBG_XML, "stp_xml_exit: entering at level %d\n", + xml_is_initialised); if (xml_is_initialised > 1) /* don't restore original state */ { xml_is_initialised--; @@ -184,9 +188,12 @@ stp_xml_exit(void) return; /* Restore locale */ - setlocale(LC_COLLATE, saved_lc_collate); - setlocale(LC_CTYPE, saved_lc_ctype); - setlocale(LC_NUMERIC, saved_lc_numeric); +#ifdef HAVE_LOCALE_H + stp_deprintf(STP_DBG_XML, "stp_xml_init: restoring locale %s\n", saved_locale); + setlocale(LC_ALL, saved_locale); + stp_free(saved_locale); + saved_locale = NULL; +#endif xml_is_initialised = 0; } diff --git a/src/testpattern/Makefile.in b/src/testpattern/Makefile.in index c5833f9..a58e6a2 100644 --- a/src/testpattern/Makefile.in +++ b/src/testpattern/Makefile.in @@ -52,11 +52,12 @@ subdir = src/testpattern ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \ $(top_srcdir)/m4/gimp.m4 $(top_srcdir)/m4/iconv.m4 \ - $(top_srcdir)/m4/lib-ld.m4 $(top_srcdir)/m4/lib-link.m4 \ - $(top_srcdir)/m4/lib-prefix.m4 $(top_srcdir)/m4/progtest.m4 \ - $(top_srcdir)/m4/stp.m4 $(top_srcdir)/m4/stp_cups.m4 \ - $(top_srcdir)/m4/stp_gimp.m4 $(top_srcdir)/m4/stp_option.m4 \ - $(top_srcdir)/m4/stp_release.m4 $(top_srcdir)/configure.ac + $(top_srcdir)/m4/isc-posix.m4 $(top_srcdir)/m4/lib-ld.m4 \ + $(top_srcdir)/m4/lib-link.m4 $(top_srcdir)/m4/lib-prefix.m4 \ + $(top_srcdir)/m4/progtest.m4 $(top_srcdir)/m4/stp.m4 \ + $(top_srcdir)/m4/stp_cups.m4 $(top_srcdir)/m4/stp_gimp.m4 \ + $(top_srcdir)/m4/stp_option.m4 $(top_srcdir)/m4/stp_release.m4 \ + $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(SHELL) $(top_srcdir)/scripts/mkinstalldirs @@ -78,8 +79,8 @@ testpattern_OBJECTS = $(am_testpattern_OBJECTS) testpattern_DEPENDENCIES = $(am__DEPENDENCIES_1) SCRIPTS = $(noinst_SCRIPTS) DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) -depcomp = -am__depfiles_maybe = +depcomp = $(SHELL) $(top_srcdir)/scripts/depcomp +am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ @@ -109,13 +110,18 @@ DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) pkgdatadir = $(datadir)/$(PACKAGE)/samples ACLOCAL = @ACLOCAL@ ALL_LINGUAS = @ALL_LINGUAS@ +AMDEP_FALSE = @AMDEP_FALSE@ +AMDEP_TRUE = @AMDEP_TRUE@ AMTAR = @AMTAR@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ +BUILD_CUPS_1_2_FALSE = @BUILD_CUPS_1_2_FALSE@ +BUILD_CUPS_1_2_TRUE = @BUILD_CUPS_1_2_TRUE@ BUILD_CUPS_FALSE = @BUILD_CUPS_FALSE@ +BUILD_CUPS_PPDS = @BUILD_CUPS_PPDS@ BUILD_CUPS_PPDS_FALSE = @BUILD_CUPS_PPDS_FALSE@ BUILD_CUPS_PPDS_TRUE = @BUILD_CUPS_PPDS_TRUE@ BUILD_CUPS_TRUE = @BUILD_CUPS_TRUE@ @@ -141,6 +147,8 @@ BUILD_LIBGUTENPRINTUI_FALSE = @BUILD_LIBGUTENPRINTUI_FALSE@ BUILD_LIBGUTENPRINTUI_TRUE = @BUILD_LIBGUTENPRINTUI_TRUE@ BUILD_MODULES_FALSE = @BUILD_MODULES_FALSE@ BUILD_MODULES_TRUE = @BUILD_MODULES_TRUE@ +BUILD_SIMPLIFIED_CUPS_PPDS_FALSE = @BUILD_SIMPLIFIED_CUPS_PPDS_FALSE@ +BUILD_SIMPLIFIED_CUPS_PPDS_TRUE = @BUILD_SIMPLIFIED_CUPS_PPDS_TRUE@ BUILD_TESTPATTERN_FALSE = @BUILD_TESTPATTERN_FALSE@ BUILD_TESTPATTERN_TRUE = @BUILD_TESTPATTERN_TRUE@ BUILD_TEST_FALSE = @BUILD_TEST_FALSE@ @@ -148,6 +156,7 @@ BUILD_TEST_TRUE = @BUILD_TEST_TRUE@ BUILD_TRANSLATED_CUPS_PPDS_FALSE = @BUILD_TRANSLATED_CUPS_PPDS_FALSE@ BUILD_TRANSLATED_CUPS_PPDS_TRUE = @BUILD_TRANSLATED_CUPS_PPDS_TRUE@ CC = @CC@ +CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CONVERT = @CONVERT@ CPP = @CPP@ @@ -160,12 +169,14 @@ CUPS_PPDS_AT_TOP_LEVEL_TRUE = @CUPS_PPDS_AT_TOP_LEVEL_TRUE@ CUPS_PPD_PS_LEVEL = @CUPS_PPD_PS_LEVEL@ CXX = @CXX@ CXXCPP = @CXXCPP@ +CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DB2HTML = @DB2HTML@ DB2PDF = @DB2PDF@ DB2PS = @DB2PS@ DEFS = @DEFS@ +DEPDIR = @DEPDIR@ DIALOG = @DIALOG@ DOXYGEN = @DOXYGEN@ DVIPDF = @DVIPDF@ @@ -200,6 +211,7 @@ GLIB_LIBS = @GLIB_LIBS@ GLIB_MKENUMS = @GLIB_MKENUMS@ GMSGFMT = @GMSGFMT@ GNUCFLAGS = @GNUCFLAGS@ +GREP = @GREP@ GTK2_CFLAGS = @GTK2_CFLAGS@ GTK2_LIBS = @GTK2_LIBS@ GTK_CFLAGS = @GTK_CFLAGS@ @@ -295,14 +307,17 @@ VERSION = @VERSION@ WHICH_PPDS = @WHICH_PPDS@ XGETTEXT = @XGETTEXT@ YACC = @YACC@ -ac_ct_AR = @ac_ct_AR@ +YFLAGS = @YFLAGS@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ -ac_ct_RANLIB = @ac_ct_RANLIB@ -ac_ct_STRIP = @ac_ct_STRIP@ -ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@ +am__fastdepCC_FALSE = @am__fastdepCC_FALSE@ +am__fastdepCC_TRUE = @am__fastdepCC_TRUE@ +am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@ +am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@ +am__include = @am__include@ am__leading_dot = @am__leading_dot@ +am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ @@ -319,6 +334,9 @@ cups_exec_prefix = @cups_exec_prefix@ cups_prefix = @cups_prefix@ cups_sbindir = @cups_sbindir@ datadir = @datadir@ +datarootdir = @datarootdir@ +docdir = @docdir@ +dvidir = @dvidir@ exec_prefix = @exec_prefix@ gimp2_plug_indir = @gimp2_plug_indir@ gimp_plug_indir = @gimp_plug_indir@ @@ -336,17 +354,21 @@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ +htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ +localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ +pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ +psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ @@ -376,9 +398,9 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu --ignore-deps src/testpattern/Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/testpattern/Makefile'; \ cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu --ignore-deps src/testpattern/Makefile + $(AUTOMAKE) --gnu src/testpattern/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ @@ -454,14 +476,32 @@ mostlyclean-compile: distclean-compile: -rm -f *.tab.c +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printer_options.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/printers.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testpattern.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testpatternl.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testpatterny.Po@am__quote@ + .c.o: - $(COMPILE) -c $< +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: - $(COMPILE) -c `$(CYGPATH_W) '$<'` +@am__fastdepCC_TRUE@ if $(COMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ `$(CYGPATH_W) '$<'`; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Po"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: - $(LTCOMPILE) -c -o $@ $< +@am__fastdepCC_TRUE@ if $(LTCOMPILE) -MT $@ -MD -MP -MF "$(DEPDIR)/$*.Tpo" -c -o $@ $<; \ +@am__fastdepCC_TRUE@ then mv -f "$(DEPDIR)/$*.Tpo" "$(DEPDIR)/$*.Plo"; else rm -f "$(DEPDIR)/$*.Tpo"; exit 1; fi +@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< .l.c: $(LEXCOMPILE) $< @@ -707,6 +747,7 @@ clean-am: clean-binPROGRAMS clean-generic clean-libtool \ clean-noinstPROGRAMS mostlyclean-am distclean: distclean-am + -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-libtool distclean-tags @@ -732,6 +773,7 @@ install-man: installcheck-am: maintainer-clean: maintainer-clean-am + -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic diff --git a/src/testpattern/printer_options.c b/src/testpattern/printer_options.c index 388e920..444e4b5 100644 --- a/src/testpattern/printer_options.c +++ b/src/testpattern/printer_options.c @@ -1,7 +1,7 @@ /* - * "$Id: printer_options.c,v 1.2 2006/05/28 16:59:05 rlk Exp $" + * "$Id: printer_options.c,v 1.2.8.2 2007/03/04 23:57:48 tillkamppeter Exp $" * - * Dump the per-printer options for Grant Taylor's *-omatic database + * Dump the per-printer options for the OpenPrinting database * * Copyright 2000 Robert Krawitz (rlk@alum.mit.edu) * @@ -32,11 +32,23 @@ int main(int argc, char **argv) { int i, j, k; + int first_arg = 1; + stp_string_list_t *printer_list = NULL; stp_parameter_level_t max_level = STP_PARAMETER_LEVEL_ADVANCED4; if (argc > 1 && !strcmp(argv[1], "-s")) - max_level = STP_PARAMETER_LEVEL_BASIC; + { + max_level = STP_PARAMETER_LEVEL_BASIC; + first_arg++; + } stp_init(); + + if (argc > first_arg) + { + printer_list = stp_string_list_create(); + for (i = 1; i < argc; i++) + stp_string_list_add_string(printer_list, argv[i], argv[i]); + } for (i = 0; i < stp_printer_model_count(); i++) { stp_parameter_list_t params; @@ -51,6 +63,8 @@ main(int argc, char **argv) int printer_is_color = 0; if (strcmp(family, "ps") == 0 || strcmp(family, "raw") == 0) continue; + if (printer_list && !stp_string_list_is_present(printer_list, driver)) + continue; /* Set Job Mode to "Job" as this enables the Duplex option */ stp_set_string_parameter(pv, "JobMode", "Job"); diff --git a/src/testpattern/printers.c b/src/testpattern/printers.c index d9c5286..21ffd1e 100644 --- a/src/testpattern/printers.c +++ b/src/testpattern/printers.c @@ -1,7 +1,7 @@ /* - * "$Id: printers.c,v 1.6 2004/09/17 18:38:27 rleigh Exp $" + * "$Id: printers.c,v 1.6.18.1 2007/03/04 23:57:49 tillkamppeter Exp $" * - * Dump the per-printer options for Grant Taylor's *-omatic database + * Dump the per-printer options for the OpenPrinting database * * Copyright 2000 Robert Krawitz (rlk@alum.mit.edu) * diff --git a/src/testpattern/run-testpattern-2.in b/src/testpattern/run-testpattern-2.in index daba8db..9f0fd5c 100644 --- a/src/testpattern/run-testpattern-2.in +++ b/src/testpattern/run-testpattern-2.in @@ -8,9 +8,14 @@ use strict; my $valgrind = 0; my $cachegrind = 0; my $gdb_attach = 0; +my $calc_md5 = 0; my $dontrun = 0; my $retval = 0; +my $testpattern_command; my @printer_list = (); +my @special_options = (); +my @standard_options = qw(InkType); +my $global_status = 1; my @extras = (); my @messages = (); @@ -24,7 +29,13 @@ GetOptions("v+" => \$valgrind, "c" => \$cachegrind, "g" => \$gdb_attach, "n" => \$dontrun, - "s!" => \$skip_duplicate_printers); + "s!" => \$skip_duplicate_printers, + "o=s" => \@special_options, + "m" => \$calc_md5); + +if (! @special_options) { + @special_options = @standard_options; +} my $pwd = `pwd`; chomp $pwd; @@ -110,15 +121,10 @@ EOF return $stuff; } -open PIPE, "./printer_options|" or die "Cannot run printer_options: $!\n"; -while() { - next if m!^#!; - eval $_; -} -close PIPE or die "Cannot run printer_options: $!\n"; - +my $extra_arg = ""; if ($#ARGV >= 0) { @printer_list = @ARGV; + $extra_arg = join " ", @printer_list; } else { open PIPE, "./printers|" or die "Cannot run printers: $!\n"; while() { @@ -129,24 +135,55 @@ if ($#ARGV >= 0) { close PIPE; } -sub do_printer($$) { +open PIPE, "./printer_options $extra_arg|" or die "Cannot run printer_options: $!\n"; +while() { + next if m!^#!; + eval $_; +} +close PIPE or die "Cannot run printer_options: $!\n"; + +sub do_print { + my ($output, $fh) = @_; + if ($dontrun) { + print $output; + } elsif ($calc_md5) { + open TESTPATTERN, "|$testpattern_command" or + die "Can't run $testpattern_command: $!\n"; + print TESTPATTERN $output; + my $status = close TESTPATTERN; + if (! $status) { + $global_status = 0; + } + } else { + print $fh $output; + } +} + + +sub do_printer { my ($printer, $fh) = @_; - my $tmp = $stpdata{$printer}{'Resolution'}; + my $tmp; my $min_res_name; my $min_res_value = 0; my $first_time = 1; my $model_id = $models{$printer}; my $family_id = $families{$printer}; + my $key; + my %opt_vals = {}; if ($skip_duplicate_printers && $models_found{$family_id}{$model_id}) { return; } else { $models_found{$family_id}{$model_id} = 1; } + $tmp = $stpdata{$printer}{'Resolution'}; my (@resolutions) = grep {$_ ne 'None' } keys %$tmp; $tmp = $stpdata{$printer}{'PrintingMode'}; my (@printing_modes) = grep {$_ ne 'None' } keys %$tmp; - $tmp = $stpdata{$printer}{'InkType'}; - my (@ink_types) = grep {$_ ne 'None' } keys %$tmp; + foreach $key (@special_options) { + $tmp = $stpdata{$printer}{$key}; + my (@tmp) = grep {$_ ne 'None' } keys %$tmp; + $opt_vals{$key} = \@tmp; + } foreach $tmp (sort @resolutions) { my $res_value = ($stpdata{$printer}{'x_resolution'}{$tmp} * $stpdata{$printer}{'y_resolution'}{$tmp}); @@ -159,7 +196,7 @@ sub do_printer($$) { # We don't need to do both resolutions and ink types. my $pmode; foreach $pmode (@printing_modes) { - my ($resolution, $ink_type); + my ($resolution); foreach $resolution (@resolutions) { @extras = (); @messages = (); @@ -173,24 +210,29 @@ sub do_printer($$) { set_opt("ColorCorrection", "Raw"); set_message(" ${pmode}+${resolution}"); my $output = print_one_testpattern($printer); - print $fh $output; + do_print( $output, $fh ); } - if ($#ink_types >= 1) { - foreach $ink_type (@ink_types) { - @extras = (); - @messages = (); - if ($first_time) { - set_message("$printer\n"); - $first_time = 0; + foreach $key (@special_options) { + $tmp = $opt_vals{$key}; + my (@opts) = @$tmp; + if ($#opts >= 1) { + my $opt; + foreach $opt (@opts) { + @extras = (); + @messages = (); + if ($first_time) { + set_message("$printer\n"); + $first_time = 0; + } + set_opt("PrintingMode", $pmode); + set_opt("Resolution", $min_res_name); + set_opt($key, $opt); + set_opt("DitherAlgorithm", "Fast"); + set_opt("ColorCorrection", "Raw"); + set_message(" ${key}=${opt}+${pmode}+${min_res_name}"); + my $output = print_one_testpattern($printer); + do_print( $output, $fh ); } - set_opt("PrintingMode", $pmode); - set_opt("Resolution", $min_res_name); - set_opt("InkType", $ink_type); - set_opt("DitherAlgorithm", "Fast"); - set_opt("ColorCorrection", "Raw"); - set_message(" ${ink_type}+${pmode}+${min_res_name}"); - my $output = print_one_testpattern($printer); - print $fh $output; } } } @@ -200,7 +242,6 @@ if ($dontrun) { map { do_printer($_, \*STDOUT) } @printer_list; exit 0; } else { - my $testpattern_command; my $valgrind_command; my $valopts; if ($cachegrind) { @@ -215,19 +256,26 @@ if ($dontrun) { if ($valgrind == 1) { $valgrind_command = "valgrind $valopts -q --num-callers=100 --error-limit=no --leak-check=yes"; } elsif ($valgrind == 2) { - $valgrind_command = "valgrind $valopts --num-callers=100 --error-limit=no --show-reachable=yes --leak-resolution=high --leak-check=yes"; + $valgrind_command = "valgrind $valopts --num-callers=100 --error-limit=no --leak-resolution=high --leak-check=yes"; } elsif ($valgrind == 3) { $valgrind_command = "valgrind $valopts --error-limit=no --num-callers=100 --show-reachable=yes --leak-resolution=high --leak-check=yes"; } elsif ($valgrind == 4) { $valgrind_command = "valgrind $valopts"; } - $testpattern_command = "$valgrind_command ./testpattern -n"; - - open TESTPATTERN, "|$testpattern_command" or - die "Can't run $testpattern_command: $!\n"; - map { do_printer($_, \*TESTPATTERN) } @printer_list; - my $status = close TESTPATTERN; + my $status = 1; + if ($calc_md5) { + $testpattern_command = "./testpattern > out.prn; a=\$? ; md5sum out.prn; exit \$a"; + map { do_printer($_) } @printer_list; + $status = $global_status; + } else { + $testpattern_command = "$valgrind_command ./testpattern -n"; + open TESTPATTERN, "|$testpattern_command" or + die "Can't run $testpattern_command: $!\n"; + $testpattern_command = "$valgrind_command ./testpattern -n"; + map { do_printer($_, \*TESTPATTERN) } @printer_list; + $status = close TESTPATTERN; + } if ($status) { exit 0; } else { diff --git a/src/testpattern/testpatterny.c b/src/testpattern/testpatterny.c index ede6285..25a082c 100644 --- a/src/testpattern/testpatterny.c +++ b/src/testpattern/testpatterny.c @@ -1,7 +1,9 @@ -/* A Bison parser, made by GNU Bison 1.875. */ +/* A Bison parser, made by GNU Bison 2.3. */ -/* Skeleton parser for Yacc-like parsing with Bison, - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc. +/* Skeleton implementation for Bison's Yacc-like parsers in C + + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -15,16 +17,24 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ + Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ + +/* As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + special exception, which will cause the skeleton and the resulting + Bison output files to be licensed under the GNU General Public + License without this special exception. -/* As a special exception, when this file is copied by Bison into a - Bison output file, you may use that output file without restriction. - This special exception was added by the Free Software Foundation - in version 1.24 of Bison. */ + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. */ -/* Written by Richard Stallman by simplifying the original so called - ``semantic'' parser. */ +/* C LALR(1) parser skeleton written by Richard Stallman, by + simplifying the original so-called "semantic" parser. */ /* All symbols defined below should begin with yy or YY, to avoid infringing on user name space. This should be done even for local @@ -36,6 +46,9 @@ /* Identify Bison output. */ #define YYBISON 1 +/* Bison version. */ +#define YYBISON_VERSION "2.3" + /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -99,6 +112,7 @@ END = 301 }; #endif +/* Tokens. */ #define tINT 258 #define tDOUBLE 259 #define tSTRING 260 @@ -228,7 +242,12 @@ find_color(const char *name) # define YYERROR_VERBOSE 0 #endif -#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) +/* Enabling the token table. */ +#ifndef YYTOKEN_TABLE +# define YYTOKEN_TABLE 0 +#endif + +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef int YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 @@ -240,49 +259,171 @@ typedef int YYSTYPE; /* Copy the second part of user declarations. */ -/* Line 214 of yacc.c. */ -#line 244 "testpatterny.c" +/* Line 216 of yacc.c. */ +#line 264 "testpatterny.c" -#if ! defined (yyoverflow) || YYERROR_VERBOSE +#ifdef short +# undef short +#endif -/* The parser invokes alloca or malloc; define the necessary symbols. */ +#ifdef YYTYPE_UINT8 +typedef YYTYPE_UINT8 yytype_uint8; +#else +typedef unsigned char yytype_uint8; +#endif -# if YYSTACK_USE_ALLOCA -# define YYSTACK_ALLOC alloca +#ifdef YYTYPE_INT8 +typedef YYTYPE_INT8 yytype_int8; +#elif (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +typedef signed char yytype_int8; +#else +typedef short int yytype_int8; +#endif + +#ifdef YYTYPE_UINT16 +typedef YYTYPE_UINT16 yytype_uint16; +#else +typedef unsigned short int yytype_uint16; +#endif + +#ifdef YYTYPE_INT16 +typedef YYTYPE_INT16 yytype_int16; +#else +typedef short int yytype_int16; +#endif + +#ifndef YYSIZE_T +# ifdef __SIZE_TYPE__ +# define YYSIZE_T __SIZE_TYPE__ +# elif defined size_t +# define YYSIZE_T size_t +# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +# include /* INFRINGES ON USER NAME SPACE */ +# define YYSIZE_T size_t # else -# ifndef YYSTACK_USE_ALLOCA -# if defined (alloca) || defined (_ALLOCA_H) -# define YYSTACK_ALLOC alloca +# define YYSIZE_T unsigned int +# endif +#endif + +#define YYSIZE_MAXIMUM ((YYSIZE_T) -1) + +#ifndef YY_ +# if YYENABLE_NLS +# if ENABLE_NLS +# include /* INFRINGES ON USER NAME SPACE */ +# define YY_(msgid) dgettext ("bison-runtime", msgid) +# endif +# endif +# ifndef YY_ +# define YY_(msgid) msgid +# endif +#endif + +/* Suppress unused-variable warnings by "using" E. */ +#if ! defined lint || defined __GNUC__ +# define YYUSE(e) ((void) (e)) +#else +# define YYUSE(e) /* empty */ +#endif + +/* Identity function, used to suppress warnings about constant conditions. */ +#ifndef lint +# define YYID(n) (n) +#else +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static int +YYID (int i) +#else +static int +YYID (i) + int i; +#endif +{ + return i; +} +#endif + +#if ! defined yyoverflow || YYERROR_VERBOSE + +/* The parser invokes alloca or malloc; define the necessary symbols. */ + +# ifdef YYSTACK_USE_ALLOCA +# if YYSTACK_USE_ALLOCA +# ifdef __GNUC__ +# define YYSTACK_ALLOC __builtin_alloca +# elif defined __BUILTIN_VA_ARG_INCR +# include /* INFRINGES ON USER NAME SPACE */ +# elif defined _AIX +# define YYSTACK_ALLOC __alloca +# elif defined _MSC_VER +# include /* INFRINGES ON USER NAME SPACE */ +# define alloca _alloca # else -# ifdef __GNUC__ -# define YYSTACK_ALLOC __builtin_alloca +# define YYSTACK_ALLOC alloca +# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +# include /* INFRINGES ON USER NAME SPACE */ +# ifndef _STDLIB_H +# define _STDLIB_H 1 +# endif # endif # endif # endif # endif # ifdef YYSTACK_ALLOC - /* Pacify GCC's `empty if-body' warning. */ -# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0) + /* Pacify GCC's `empty if-body' warning. */ +# define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0)) +# ifndef YYSTACK_ALLOC_MAXIMUM + /* The OS might guarantee only one guard page at the bottom of the stack, + and a page size can be as small as 4096 bytes. So we cannot safely + invoke alloca (N) if N exceeds 4096. Use a slightly smaller number + to allow for a few compiler-allocated temporary stack slots. */ +# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */ +# endif # else -# if defined (__STDC__) || defined (__cplusplus) +# define YYSTACK_ALLOC YYMALLOC +# define YYSTACK_FREE YYFREE +# ifndef YYSTACK_ALLOC_MAXIMUM +# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM +# endif +# if (defined __cplusplus && ! defined _STDLIB_H \ + && ! ((defined YYMALLOC || defined malloc) \ + && (defined YYFREE || defined free))) # include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t +# ifndef _STDLIB_H +# define _STDLIB_H 1 +# endif +# endif +# ifndef YYMALLOC +# define YYMALLOC malloc +# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ +# endif +# endif +# ifndef YYFREE +# define YYFREE free +# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +void free (void *); /* INFRINGES ON USER NAME SPACE */ +# endif # endif -# define YYSTACK_ALLOC malloc -# define YYSTACK_FREE free # endif -#endif /* ! defined (yyoverflow) || YYERROR_VERBOSE */ +#endif /* ! defined yyoverflow || YYERROR_VERBOSE */ -#if (! defined (yyoverflow) \ - && (! defined (__cplusplus) \ - || (YYSTYPE_IS_TRIVIAL))) +#if (! defined yyoverflow \ + && (! defined __cplusplus \ + || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL))) /* A type that is properly aligned for any stack member. */ union yyalloc { - short yyss; + yytype_int16 yyss; YYSTYPE yyvs; }; @@ -292,24 +433,24 @@ union yyalloc /* The size of an array large to enough to hold all stacks, each with N elements. */ # define YYSTACK_BYTES(N) \ - ((N) * (sizeof (short) + sizeof (YYSTYPE)) \ + ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ + YYSTACK_GAP_MAXIMUM) /* Copy COUNT objects from FROM to TO. The source and destination do not overlap. */ # ifndef YYCOPY -# if 1 < __GNUC__ +# if defined __GNUC__ && 1 < __GNUC__ # define YYCOPY(To, From, Count) \ __builtin_memcpy (To, From, (Count) * sizeof (*(From))) # else # define YYCOPY(To, From, Count) \ do \ { \ - register YYSIZE_T yyi; \ + YYSIZE_T yyi; \ for (yyi = 0; yyi < (Count); yyi++) \ (To)[yyi] = (From)[yyi]; \ } \ - while (0) + while (YYID (0)) # endif # endif @@ -327,39 +468,33 @@ union yyalloc yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \ yyptr += yynewbytes / sizeof (*yyptr); \ } \ - while (0) + while (YYID (0)) #endif -#if defined (__STDC__) || defined (__cplusplus) - typedef signed char yysigned_char; -#else - typedef short yysigned_char; -#endif - -/* YYFINAL -- State number of the termination state. */ -#define YYFINAL 52 +/* YYFINAL -- State number of the termination state. */ +#define YYFINAL 54 /* YYLAST -- Last index in YYTABLE. */ -#define YYLAST 131 +#define YYLAST 134 -/* YYNTOKENS -- Number of terminals. */ +/* YYNTOKENS -- Number of terminals. */ #define YYNTOKENS 47 -/* YYNNTS -- Number of nonterminals. */ -#define YYNNTS 65 -/* YYNRULES -- Number of rules. */ -#define YYNRULES 115 -/* YYNRULES -- Number of states. */ -#define YYNSTATES 170 +/* YYNNTS -- Number of nonterminals. */ +#define YYNNTS 66 +/* YYNRULES -- Number of rules. */ +#define YYNRULES 117 +/* YYNRULES -- Number of states. */ +#define YYNSTATES 174 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX. */ #define YYUNDEFTOK 2 #define YYMAXUTOK 301 -#define YYTRANSLATE(YYX) \ +#define YYTRANSLATE(YYX) \ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK) /* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX. */ -static const unsigned char yytranslate[] = +static const yytype_uint8 yytranslate[] = { 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, @@ -397,26 +532,26 @@ static const unsigned char yytranslate[] = #if YYDEBUG /* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in YYRHS. */ -static const unsigned short yyprhs[] = +static const yytype_uint16 yyprhs[] = { 0, 0, 3, 5, 7, 9, 11, 13, 15, 17, 19, 22, 25, 28, 31, 34, 37, 41, 43, 45, 47, 49, 51, 53, 55, 58, 62, 66, 70, 74, 77, 80, 83, 86, 89, 93, 95, 97, 101, 105, - 109, 111, 113, 115, 118, 121, 124, 127, 130, 133, - 137, 139, 142, 143, 145, 148, 153, 159, 161, 163, - 165, 168, 169, 171, 173, 175, 181, 185, 188, 191, - 195, 198, 202, 207, 213, 220, 222, 224, 226, 228, - 230, 232, 234, 236, 238, 240, 242, 244, 246, 248, - 250, 252, 254, 256, 258, 260, 262, 264, 266, 268, - 271, 273, 275, 277, 279, 282, 283, 286, 288, 289, - 292, 294, 296, 297, 300, 301 + 109, 113, 115, 117, 119, 121, 124, 127, 130, 133, + 136, 139, 143, 145, 148, 149, 151, 154, 159, 165, + 167, 169, 171, 174, 175, 177, 179, 181, 187, 191, + 194, 197, 201, 204, 208, 213, 219, 226, 228, 230, + 232, 234, 236, 238, 240, 242, 244, 246, 248, 250, + 252, 254, 256, 258, 260, 262, 264, 266, 268, 270, + 272, 274, 277, 279, 281, 283, 285, 288, 289, 292, + 294, 295, 298, 300, 302, 303, 306, 307 }; -/* YYRHS -- A `-1'-separated list of the rules' RHS. */ -static const yysigned_char yyrhs[] = +/* YYRHS -- A `-1'-separated list of the rules' RHS. */ +static const yytype_int8 yyrhs[] = { - 110, 0, -1, 6, -1, 7, -1, 8, -1, 9, + 111, 0, -1, 6, -1, 7, -1, 8, -1, 9, -1, 10, -1, 11, -1, 12, -1, 13, -1, 36, 3, -1, 37, 3, -1, 38, 3, -1, 39, 3, -1, 40, 3, -1, 41, 3, -1, 31, 3, 3, @@ -426,71 +561,72 @@ static const yysigned_char yyrhs[] = 14, 3, 4, -1, 14, 4, -1, 16, 3, -1, 17, 4, -1, 18, 5, -1, 44, 5, -1, 44, 3, 3, -1, 66, -1, 67, -1, 19, 5, 5, - -1, 20, 5, 3, -1, 21, 5, 4, -1, 69, - -1, 70, -1, 71, -1, 23, 4, -1, 24, 4, - -1, 25, 4, -1, 26, 4, -1, 27, 4, -1, - 28, 3, -1, 4, 4, 4, -1, 79, -1, 80, - 79, -1, -1, 80, -1, 79, 81, -1, 48, 4, - 4, 4, -1, 35, 3, 4, 4, 4, -1, 83, - -1, 84, -1, 85, -1, 86, 85, -1, -1, 86, - -1, 82, -1, 87, -1, 4, 4, 4, 4, 4, - -1, 29, 89, 88, -1, 30, 88, -1, 33, 3, - -1, 32, 3, 3, -1, 45, 5, -1, 45, 5, - 5, -1, 45, 5, 5, 5, -1, 45, 5, 5, - 5, 5, -1, 45, 5, 5, 5, 5, 5, -1, - 94, -1, 95, -1, 96, -1, 97, -1, 98, -1, - 99, -1, 60, -1, 61, -1, 58, -1, 59, -1, - 62, -1, 63, -1, 64, -1, 65, -1, 72, -1, - 73, -1, 74, -1, 75, -1, 76, -1, 77, -1, - 78, -1, 57, -1, 68, -1, 100, -1, 101, 34, - -1, 90, -1, 91, -1, 92, -1, 100, -1, 103, - 34, -1, -1, 105, 104, -1, 93, -1, -1, 107, - 102, -1, 105, -1, 106, -1, -1, 46, 34, -1, - -1, 107, 111, 108, 109, -1 + -1, 20, 5, 3, -1, 21, 5, 4, -1, 22, + 5, 5, -1, 69, -1, 70, -1, 71, -1, 72, + -1, 23, 4, -1, 24, 4, -1, 25, 4, -1, + 26, 4, -1, 27, 4, -1, 28, 3, -1, 4, + 4, 4, -1, 80, -1, 81, 80, -1, -1, 81, + -1, 80, 82, -1, 48, 4, 4, 4, -1, 35, + 3, 4, 4, 4, -1, 84, -1, 85, -1, 86, + -1, 87, 86, -1, -1, 87, -1, 83, -1, 88, + -1, 4, 4, 4, 4, 4, -1, 29, 90, 89, + -1, 30, 89, -1, 33, 3, -1, 32, 3, 3, + -1, 45, 5, -1, 45, 5, 5, -1, 45, 5, + 5, 5, -1, 45, 5, 5, 5, 5, -1, 45, + 5, 5, 5, 5, 5, -1, 95, -1, 96, -1, + 97, -1, 98, -1, 99, -1, 100, -1, 60, -1, + 61, -1, 58, -1, 59, -1, 62, -1, 63, -1, + 64, -1, 65, -1, 73, -1, 74, -1, 75, -1, + 76, -1, 77, -1, 78, -1, 79, -1, 57, -1, + 68, -1, 101, -1, 102, 34, -1, 91, -1, 92, + -1, 93, -1, 101, -1, 104, 34, -1, -1, 106, + 105, -1, 94, -1, -1, 108, 103, -1, 106, -1, + 107, -1, -1, 46, 34, -1, -1, 108, 112, 109, + 110, -1 }; /* YYRLINE[YYN] -- source line where rule number YYN was defined. */ -static const unsigned short yyrline[] = +static const yytype_uint16 yyrline[] = { 0, 139, 139, 139, 139, 139, 140, 140, 140, 140, 143, 155, 167, 179, 191, 203, 215, 227, 227, 227, 227, 227, 227, 227, 230, 233, 243, 252, 262, 271, 278, 285, 292, 301, 310, 319, 319, 322, 332, 341, - 364, 364, 364, 366, 373, 380, 387, 394, 401, 409, - 424, 424, 427, 427, 430, 433, 447, 460, 460, 463, - 463, 466, 466, 469, 469, 472, 487, 490, 505, 516, - 533, 539, 546, 554, 563, 574, 574, 574, 574, 574, - 577, 580, 580, 580, 580, 580, 580, 581, 581, 581, - 581, 581, 581, 581, 582, 582, 582, 582, 582, 585, - 589, 589, 589, 589, 592, 596, 596, 599, 603, 603, - 606, 606, 609, 609, 614, 613 + 350, 364, 364, 364, 364, 366, 373, 380, 387, 394, + 401, 409, 424, 424, 427, 427, 430, 433, 447, 460, + 460, 463, 463, 466, 466, 469, 469, 472, 487, 490, + 505, 516, 533, 539, 546, 554, 563, 574, 574, 574, + 574, 574, 577, 580, 580, 580, 580, 580, 580, 581, + 581, 581, 581, 581, 581, 581, 582, 582, 582, 582, + 582, 585, 589, 589, 589, 589, 592, 596, 596, 599, + 603, 603, 606, 606, 609, 609, 614, 613 }; #endif -#if YYDEBUG || YYERROR_VERBOSE -/* YYTNME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. - First, the terminals, then, starting at YYNTOKENS, nonterminals. */ +#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE +/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. + First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { - "$end", "error", "$undefined", "tINT", "tDOUBLE", "tSTRING", "CYAN", - "L_CYAN", "MAGENTA", "L_MAGENTA", "YELLOW", "D_YELLOW", "BLACK", - "L_BLACK", "GAMMA", "LEVEL", "STEPS", "INK_LIMIT", "PRINTER", - "PARAMETER", "PARAMETER_INT", "PARAMETER_FLOAT", "PARAMETER_CURVE", - "DENSITY", "TOP", "LEFT", "HSIZE", "VSIZE", "BLACKLINE", "PATTERN", - "XPATTERN", "EXTENDED", "IMAGE", "GRID", "SEMI", "CHANNEL", "CMYK", - "KCMY", "RGB", "CMY", "GRAY", "WHITE", "RAW", "MODE", "PAGESIZE", - "MESSAGE", "END", "$accept", "COLOR", "cmykspec", "kcmyspec", "rgbspec", - "cmyspec", "grayspec", "whitespec", "extendedspec", "modespec", - "inputspec", "level", "channel_level", "gamma", "channel_gamma", - "global_gamma", "steps", "ink_limit", "printer", "page_size_name", - "page_size_custom", "page_size", "parameter_string", "parameter_int", - "parameter_float", "parameter", "density", "top", "left", "hsize", - "vsize", "blackline", "color_block1", "color_blocks1a", - "color_blocks1b", "color_blocks1", "color_block2a", "color_block2b", - "color_block2", "color_blocks2a", "color_blocks2", "color_blocks", - "patvars", "pattern", "xpattern", "grid", "image", "Message0", - "Message1", "Message2", "Message3", "Message4", "A_Message", "message", - "A_Rule", "Rule", "A_Pattern", "Pattern", "Patterns", "Image", "Rules", + "$end", "error", "$undefined", "tINT", "tDOUBLE", "tSTRING", "CYAN", + "L_CYAN", "MAGENTA", "L_MAGENTA", "YELLOW", "D_YELLOW", "BLACK", + "L_BLACK", "GAMMA", "LEVEL", "STEPS", "INK_LIMIT", "PRINTER", + "PARAMETER", "PARAMETER_INT", "PARAMETER_FLOAT", "PARAMETER_CURVE", + "DENSITY", "TOP", "LEFT", "HSIZE", "VSIZE", "BLACKLINE", "PATTERN", + "XPATTERN", "EXTENDED", "IMAGE", "GRID", "SEMI", "CHANNEL", "CMYK", + "KCMY", "RGB", "CMY", "GRAY", "WHITE", "RAW", "MODE", "PAGESIZE", + "MESSAGE", "END", "$accept", "COLOR", "cmykspec", "kcmyspec", "rgbspec", + "cmyspec", "grayspec", "whitespec", "extendedspec", "modespec", + "inputspec", "level", "channel_level", "gamma", "channel_gamma", + "global_gamma", "steps", "ink_limit", "printer", "page_size_name", + "page_size_custom", "page_size", "parameter_string", "parameter_int", + "parameter_float", "parameter_curve", "parameter", "density", "top", + "left", "hsize", "vsize", "blackline", "color_block1", "color_blocks1a", + "color_blocks1b", "color_blocks1", "color_block2a", "color_block2b", + "color_block2", "color_blocks2a", "color_blocks2", "color_blocks", + "patvars", "pattern", "xpattern", "grid", "image", "Message0", + "Message1", "Message2", "Message3", "Message4", "A_Message", "message", + "A_Rule", "Rule", "A_Pattern", "Pattern", "Patterns", "Image", "Rules", "Output", "EOF", "Thing", "@1", 0 }; #endif @@ -498,7 +634,7 @@ static const char *const yytname[] = # ifdef YYPRINT /* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to token YYLEX-NUM. */ -static const unsigned short yytoknum[] = +static const yytype_uint16 yytoknum[] = { 0, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, @@ -509,109 +645,111 @@ static const unsigned short yytoknum[] = # endif /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */ -static const unsigned char yyr1[] = +static const yytype_uint8 yyr1[] = { 0, 47, 48, 48, 48, 48, 48, 48, 48, 48, 49, 50, 51, 52, 53, 54, 55, 56, 56, 56, 56, 56, 56, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 68, 69, 70, 71, - 72, 72, 72, 73, 74, 75, 76, 77, 78, 79, - 80, 80, 81, 81, 82, 83, 84, 85, 85, 86, - 86, 87, 87, 88, 88, 89, 90, 91, 92, 93, - 94, 95, 96, 97, 98, 99, 99, 99, 99, 99, - 100, 101, 101, 101, 101, 101, 101, 101, 101, 101, - 101, 101, 101, 101, 101, 101, 101, 101, 101, 102, - 103, 103, 103, 103, 104, 105, 105, 106, 107, 107, - 108, 108, 109, 109, 111, 110 + 72, 73, 73, 73, 73, 74, 75, 76, 77, 78, + 79, 80, 81, 81, 82, 82, 83, 84, 85, 86, + 86, 87, 87, 88, 88, 89, 89, 90, 91, 92, + 93, 94, 95, 96, 97, 98, 99, 100, 100, 100, + 100, 100, 101, 102, 102, 102, 102, 102, 102, 102, + 102, 102, 102, 102, 102, 102, 102, 102, 102, 102, + 102, 103, 104, 104, 104, 104, 105, 106, 106, 107, + 108, 108, 109, 109, 110, 110, 112, 111 }; /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN. */ -static const unsigned char yyr2[] = +static const yytype_uint8 yyr2[] = { 0, 2, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, 1, 1, 1, 1, 1, 1, 1, 2, 3, 3, 3, 3, 2, 2, 2, 2, 2, 3, 1, 1, 3, 3, 3, - 1, 1, 1, 2, 2, 2, 2, 2, 2, 3, - 1, 2, 0, 1, 2, 4, 5, 1, 1, 1, - 2, 0, 1, 1, 1, 5, 3, 2, 2, 3, - 2, 3, 4, 5, 6, 1, 1, 1, 1, 1, + 3, 1, 1, 1, 1, 2, 2, 2, 2, 2, + 2, 3, 1, 2, 0, 1, 2, 4, 5, 1, + 1, 1, 2, 0, 1, 1, 1, 5, 3, 2, + 2, 3, 2, 3, 4, 5, 6, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, - 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, - 1, 1, 1, 1, 2, 0, 2, 1, 0, 2, - 1, 1, 0, 2, 0, 4 + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, + 1, 2, 1, 1, 1, 1, 2, 0, 2, 1, + 0, 2, 1, 1, 0, 2, 0, 4 }; /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state STATE-NUM when YYTABLE doesn't specify something else to do. Zero means the default is an error. */ -static const unsigned char yydefact[] = +static const yytype_uint8 yydefact[] = { - 108, 114, 0, 0, 0, 0, 0, 0, 0, 0, + 110, 116, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 96, 83, 84, 81, 82, 85, 86, 87, 88, 35, - 36, 97, 40, 41, 42, 89, 90, 91, 92, 93, - 94, 95, 75, 76, 77, 78, 79, 80, 98, 0, - 109, 105, 1, 0, 29, 2, 3, 4, 5, 6, - 7, 8, 9, 0, 0, 0, 30, 31, 32, 0, - 0, 0, 43, 44, 45, 46, 47, 48, 0, 0, - 0, 0, 0, 0, 0, 17, 18, 19, 20, 21, - 22, 23, 24, 0, 33, 70, 99, 0, 107, 110, - 111, 112, 28, 27, 26, 25, 37, 38, 39, 0, - 10, 11, 12, 13, 14, 15, 34, 71, 0, 0, - 61, 0, 100, 101, 102, 103, 0, 106, 0, 115, - 16, 72, 69, 0, 61, 0, 0, 0, 52, 63, - 57, 58, 59, 62, 64, 67, 68, 104, 113, 73, - 0, 66, 0, 0, 0, 50, 53, 54, 60, 74, - 0, 49, 0, 0, 51, 0, 0, 55, 65, 56 + 0, 98, 85, 86, 83, 84, 87, 88, 89, 90, + 35, 36, 99, 41, 42, 43, 44, 91, 92, 93, + 94, 95, 96, 97, 77, 78, 79, 80, 81, 82, + 100, 0, 111, 107, 1, 0, 29, 2, 3, 4, + 5, 6, 7, 8, 9, 0, 0, 0, 30, 31, + 32, 0, 0, 0, 0, 45, 46, 47, 48, 49, + 50, 0, 0, 0, 0, 0, 0, 0, 17, 18, + 19, 20, 21, 22, 23, 24, 0, 33, 72, 101, + 0, 109, 112, 113, 114, 28, 27, 26, 25, 37, + 38, 39, 40, 0, 10, 11, 12, 13, 14, 15, + 34, 73, 0, 0, 63, 0, 102, 103, 104, 105, + 0, 108, 0, 117, 16, 74, 71, 0, 63, 0, + 0, 0, 54, 65, 59, 60, 61, 64, 66, 69, + 70, 106, 115, 75, 0, 68, 0, 0, 0, 52, + 55, 56, 62, 76, 0, 51, 0, 0, 53, 0, + 0, 57, 67, 58 }; -/* YYDEFGOTO[NTERM-NUM]. */ -static const short yydefgoto[] = +/* YYDEFGOTO[NTERM-NUM]. */ +static const yytype_int16 yydefgoto[] = { - -1, 137, 85, 86, 87, 88, 89, 90, 91, 92, - 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, - 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, - 40, 41, 138, 156, 157, 139, 140, 141, 142, 143, - 144, 145, 134, 122, 123, 124, 98, 42, 43, 44, - 45, 46, 47, 48, 49, 50, 126, 127, 99, 100, - 1, 101, 129, 2, 51 + -1, 141, 88, 89, 90, 91, 92, 93, 94, 95, + 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, + 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, + 41, 42, 43, 142, 160, 161, 143, 144, 145, 146, + 147, 148, 149, 138, 126, 127, 128, 101, 44, 45, + 46, 47, 48, 49, 50, 51, 52, 130, 131, 102, + 103, 1, 104, 133, 2, 53 }; /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing STATE-NUM. */ -#define YYPACT_NINF -131 -static const short yypact[] = +#define YYPACT_NINF -118 +static const yytype_int16 yypact[] = { - -131, -14, 16, 56, 41, 25, 36, 38, 53, 66, - 67, 69, 70, 77, 78, 79, 81, 39, 22, 80, - -131, -131, -131, -131, -131, -131, -131, -131, -131, -131, - -131, -131, -131, -131, -131, -131, -131, -131, -131, -131, - -131, -131, -131, -131, -131, -131, -131, -131, -131, 54, - -131, 55, -131, 82, -131, -131, -131, -131, -131, -131, - -131, -131, -131, 85, 86, 87, -131, -131, -131, 88, - 89, 90, -131, -131, -131, -131, -131, -131, 92, 93, - 94, 95, 96, 97, 98, -131, -131, -131, -131, -131, - -131, -131, -131, 99, -131, 100, -131, 101, -131, 12, - -131, 57, -131, -131, -131, -131, -131, -131, -131, 103, - -131, -131, -131, -131, -131, -131, -131, 102, 105, 106, - 11, 108, -131, -131, -131, -131, 75, -131, 83, -131, - -131, 107, -131, 109, 11, 110, 112, 114, 115, -131, - -131, -131, -131, 26, -131, -131, -131, -131, -131, 111, - 116, -131, 117, 118, 119, -131, 115, -131, -131, -131, - 120, -131, 121, 122, -131, 123, 124, -131, -131, -131 + -118, -14, 16, 56, 41, 24, 36, 53, 66, 67, + 68, 69, 77, 78, 79, 80, 81, 83, 39, 23, + 82, -118, -118, -118, -118, -118, -118, -118, -118, -118, + -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, + -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, + -118, 54, -118, 57, -118, 86, -118, -118, -118, -118, + -118, -118, -118, -118, -118, 87, 88, 89, -118, -118, + -118, 90, 91, 92, 93, -118, -118, -118, -118, -118, + -118, 94, 96, 97, 98, 99, 100, 101, -118, -118, + -118, -118, -118, -118, -118, -118, 102, -118, 103, -118, + 104, -118, 12, -118, 60, -118, -118, -118, -118, -118, + -118, -118, -118, 106, -118, -118, -118, -118, -118, -118, + -118, 105, 108, 109, 11, 111, -118, -118, -118, -118, + 84, -118, 85, -118, -118, 107, -118, 112, 11, 113, + 117, 118, 119, -118, -118, -118, -118, 26, -118, -118, + -118, -118, -118, 110, 120, -118, 121, 122, 123, -118, + 119, -118, -118, -118, 124, -118, 125, 126, -118, 127, + 128, -118, -118, -118 }; /* YYPGOTO[NTERM-NUM]. */ -static const short yypgoto[] = +static const yytype_int8 yypgoto[] = { - -131, 52, -131, -131, -131, -131, -131, -131, -131, -131, - -131, -131, -131, -131, -131, -131, -131, -131, -131, -131, - -131, -131, -131, -131, -131, -131, -131, -131, -131, -131, - -131, -131, -130, -131, -131, -131, -131, -131, -13, -131, - -131, -5, -131, -131, -131, -131, -131, -131, -131, -131, - -131, -131, -131, 32, -131, -131, -131, -131, -131, -131, - -131, -131, -131, -131, -131 + -118, 52, -118, -118, -118, -118, -118, -118, -118, -118, + -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, + -118, -118, -118, -118, -118, -118, -118, -118, -118, -118, + -118, -118, -118, -117, -118, -118, -118, -118, -118, -26, + -118, -118, -5, -118, -118, -118, -118, -118, -118, -118, + -118, -118, -118, -118, 32, -118, -118, -118, -118, -118, + -118, -118, -118, -118, -118, -118 }; /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If @@ -619,81 +757,66 @@ static const short yypgoto[] = number is the opposite. If zero, do what YYDEFACT says. If YYTABLE_NINF, syntax error. */ #define YYTABLE_NINF -1 -static const unsigned char yytable[] = +static const yytype_uint8 yytable[] = { - 3, 4, 5, 6, 7, 8, 9, 10, 155, 11, - 12, 13, 14, 15, 16, 135, 52, 55, 56, 57, - 58, 59, 60, 61, 62, 93, 164, 94, 66, 17, - 18, 19, 55, 56, 57, 58, 59, 60, 61, 62, - 67, 119, 120, 68, 64, 121, 136, 55, 56, 57, - 58, 59, 60, 61, 62, 63, 65, 19, 69, 53, - 54, 136, 55, 56, 57, 58, 59, 60, 61, 62, - 78, 70, 71, 72, 73, 79, 80, 81, 82, 83, - 84, 74, 75, 76, 77, 95, 102, 97, 96, 103, - 104, 105, 107, 106, 108, 109, 110, 111, 112, 113, - 114, 115, 116, 128, 118, 117, 130, 131, 132, 147, - 133, 146, 149, 150, 152, 153, 159, 148, 154, 135, - 160, 161, 162, 163, 165, 166, 167, 168, 169, 151, - 158, 125 + 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, + 13, 14, 15, 16, 17, 139, 54, 57, 58, 59, + 60, 61, 62, 63, 64, 159, 96, 68, 97, 18, + 19, 20, 57, 58, 59, 60, 61, 62, 63, 64, + 69, 123, 124, 168, 66, 125, 140, 57, 58, 59, + 60, 61, 62, 63, 64, 65, 67, 20, 70, 55, + 56, 140, 57, 58, 59, 60, 61, 62, 63, 64, + 81, 71, 72, 73, 74, 82, 83, 84, 85, 86, + 87, 75, 76, 77, 78, 79, 80, 98, 99, 100, + 105, 106, 107, 108, 110, 109, 111, 113, 112, 114, + 115, 116, 117, 118, 119, 120, 132, 122, 121, 134, + 135, 136, 153, 137, 150, 163, 154, 156, 151, 152, + 157, 162, 158, 139, 164, 165, 166, 167, 169, 170, + 171, 172, 173, 155, 129 }; -static const unsigned char yycheck[] = +static const yytype_uint8 yycheck[] = { - 14, 15, 16, 17, 18, 19, 20, 21, 138, 23, + 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 4, 0, 6, 7, 8, - 9, 10, 11, 12, 13, 3, 156, 5, 3, 43, + 9, 10, 11, 12, 13, 142, 3, 3, 5, 43, 44, 45, 6, 7, 8, 9, 10, 11, 12, 13, - 4, 29, 30, 5, 3, 33, 35, 6, 7, 8, + 4, 29, 30, 160, 3, 33, 35, 6, 7, 8, 9, 10, 11, 12, 13, 3, 4, 45, 5, 3, 4, 35, 6, 7, 8, 9, 10, 11, 12, 13, - 31, 5, 5, 4, 4, 36, 37, 38, 39, 40, - 41, 4, 4, 4, 3, 5, 4, 32, 34, 4, - 4, 4, 3, 5, 4, 3, 3, 3, 3, 3, - 3, 3, 3, 46, 3, 5, 3, 5, 3, 34, - 4, 3, 5, 4, 4, 3, 5, 34, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 4, 4, 134, - 143, 99 + 31, 5, 5, 5, 5, 36, 37, 38, 39, 40, + 41, 4, 4, 4, 4, 4, 3, 5, 34, 32, + 4, 4, 4, 4, 3, 5, 4, 3, 5, 3, + 3, 3, 3, 3, 3, 3, 46, 3, 5, 3, + 5, 3, 5, 4, 3, 5, 4, 4, 34, 34, + 3, 147, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 138, 102 }; /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing symbol of state STATE-NUM. */ -static const unsigned char yystos[] = +static const yytype_uint8 yystos[] = { - 0, 107, 110, 14, 15, 16, 17, 18, 19, 20, - 21, 23, 24, 25, 26, 27, 28, 43, 44, 45, - 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, - 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, - 77, 78, 94, 95, 96, 97, 98, 99, 100, 101, - 102, 111, 0, 3, 4, 6, 7, 8, 9, 10, - 11, 12, 13, 48, 3, 48, 3, 4, 5, 5, - 5, 5, 4, 4, 4, 4, 4, 3, 31, 36, - 37, 38, 39, 40, 41, 49, 50, 51, 52, 53, - 54, 55, 56, 3, 5, 5, 34, 32, 93, 105, - 106, 108, 4, 4, 4, 4, 5, 3, 4, 3, - 3, 3, 3, 3, 3, 3, 3, 5, 3, 29, - 30, 33, 90, 91, 92, 100, 103, 104, 46, 109, - 3, 5, 3, 4, 89, 4, 35, 48, 79, 82, - 83, 84, 85, 86, 87, 88, 3, 34, 34, 5, - 4, 88, 4, 3, 4, 79, 80, 81, 85, 5, - 4, 4, 4, 4, 79, 4, 4, 4, 4, 4 + 0, 108, 111, 14, 15, 16, 17, 18, 19, 20, + 21, 22, 23, 24, 25, 26, 27, 28, 43, 44, + 45, 57, 58, 59, 60, 61, 62, 63, 64, 65, + 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, + 76, 77, 78, 79, 95, 96, 97, 98, 99, 100, + 101, 102, 103, 112, 0, 3, 4, 6, 7, 8, + 9, 10, 11, 12, 13, 48, 3, 48, 3, 4, + 5, 5, 5, 5, 5, 4, 4, 4, 4, 4, + 3, 31, 36, 37, 38, 39, 40, 41, 49, 50, + 51, 52, 53, 54, 55, 56, 3, 5, 5, 34, + 32, 94, 106, 107, 109, 4, 4, 4, 4, 5, + 3, 4, 5, 3, 3, 3, 3, 3, 3, 3, + 3, 5, 3, 29, 30, 33, 91, 92, 93, 101, + 104, 105, 46, 110, 3, 5, 3, 4, 90, 4, + 35, 48, 80, 83, 84, 85, 86, 87, 88, 89, + 3, 34, 34, 5, 4, 89, 4, 3, 4, 80, + 81, 82, 86, 5, 4, 4, 4, 4, 80, 4, + 4, 4, 4, 4 }; -#if ! defined (YYSIZE_T) && defined (__SIZE_TYPE__) -# define YYSIZE_T __SIZE_TYPE__ -#endif -#if ! defined (YYSIZE_T) && defined (size_t) -# define YYSIZE_T size_t -#endif -#if ! defined (YYSIZE_T) -# if defined (__STDC__) || defined (__cplusplus) -# include /* INFRINGES ON USER NAME SPACE */ -# define YYSIZE_T size_t -# endif -#endif -#if ! defined (YYSIZE_T) -# define YYSIZE_T unsigned int -#endif - #define yyerrok (yyerrstatus = 0) #define yyclearin (yychar = YYEMPTY) #define YYEMPTY (-2) @@ -701,7 +824,8 @@ static const unsigned char yystos[] = #define YYACCEPT goto yyacceptlab #define YYABORT goto yyabortlab -#define YYERROR goto yyerrlab1 +#define YYERROR goto yyerrorlab + /* Like YYERROR except do call yyerror. This remains here temporarily to ease the transition to the new meaning of YYERROR, for GCC. @@ -718,30 +842,63 @@ do \ yychar = (Token); \ yylval = (Value); \ yytoken = YYTRANSLATE (yychar); \ - YYPOPSTACK; \ + YYPOPSTACK (1); \ goto yybackup; \ } \ else \ - { \ - yyerror ("syntax error: cannot back up");\ + { \ + yyerror (YY_("syntax error: cannot back up")); \ YYERROR; \ } \ -while (0) +while (YYID (0)) + #define YYTERROR 1 #define YYERRCODE 256 -/* YYLLOC_DEFAULT -- Compute the default location (before the actions - are run). */ +/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. + If N is 0, then set CURRENT to the empty location which ends + the previous symbol: RHS[0] (always defined). */ + +#define YYRHSLOC(Rhs, K) ((Rhs)[K]) #ifndef YYLLOC_DEFAULT -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - Current.first_line = Rhs[1].first_line; \ - Current.first_column = Rhs[1].first_column; \ - Current.last_line = Rhs[N].last_line; \ - Current.last_column = Rhs[N].last_column; +# define YYLLOC_DEFAULT(Current, Rhs, N) \ + do \ + if (YYID (N)) \ + { \ + (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ + (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ + (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ + (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ + } \ + else \ + { \ + (Current).first_line = (Current).last_line = \ + YYRHSLOC (Rhs, 0).last_line; \ + (Current).first_column = (Current).last_column = \ + YYRHSLOC (Rhs, 0).last_column; \ + } \ + while (YYID (0)) #endif + +/* YY_LOCATION_PRINT -- Print the location on the stream. + This macro was not mandated originally: define only if we know + we won't break user code: when these are the locations we know. */ + +#ifndef YY_LOCATION_PRINT +# if YYLTYPE_IS_TRIVIAL +# define YY_LOCATION_PRINT(File, Loc) \ + fprintf (File, "%d.%d-%d.%d", \ + (Loc).first_line, (Loc).first_column, \ + (Loc).last_line, (Loc).last_column) +# else +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) +# endif +#endif + + /* YYLEX -- calling `yylex' with the right arguments. */ #ifdef YYLEX_PARAM @@ -762,42 +919,96 @@ while (0) do { \ if (yydebug) \ YYFPRINTF Args; \ -} while (0) +} while (YYID (0)) -# define YYDSYMPRINT(Args) \ -do { \ - if (yydebug) \ - yysymprint Args; \ -} while (0) +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \ +do { \ + if (yydebug) \ + { \ + YYFPRINTF (stderr, "%s ", Title); \ + yy_symbol_print (stderr, \ + Type, Value); \ + YYFPRINTF (stderr, "\n"); \ + } \ +} while (YYID (0)) -# define YYDSYMPRINTF(Title, Token, Value, Location) \ -do { \ - if (yydebug) \ - { \ - YYFPRINTF (stderr, "%s ", Title); \ - yysymprint (stderr, \ - Token, Value); \ - YYFPRINTF (stderr, "\n"); \ - } \ -} while (0) + +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ + +/*ARGSUSED*/ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +#else +static void +yy_symbol_value_print (yyoutput, yytype, yyvaluep) + FILE *yyoutput; + int yytype; + YYSTYPE const * const yyvaluep; +#endif +{ + if (!yyvaluep) + return; +# ifdef YYPRINT + if (yytype < YYNTOKENS) + YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); +# else + YYUSE (yyoutput); +# endif + switch (yytype) + { + default: + break; + } +} + + +/*--------------------------------. +| Print this symbol on YYOUTPUT. | +`--------------------------------*/ + +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +static void +yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep) +#else +static void +yy_symbol_print (yyoutput, yytype, yyvaluep) + FILE *yyoutput; + int yytype; + YYSTYPE const * const yyvaluep; +#endif +{ + if (yytype < YYNTOKENS) + YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); + else + YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); + + yy_symbol_value_print (yyoutput, yytype, yyvaluep); + YYFPRINTF (yyoutput, ")"); +} /*------------------------------------------------------------------. | yy_stack_print -- Print the state stack from its BOTTOM up to its | -| TOP (cinluded). | +| TOP (included). | `------------------------------------------------------------------*/ -#if defined (__STDC__) || defined (__cplusplus) +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) static void -yy_stack_print (short *bottom, short *top) +yy_stack_print (yytype_int16 *bottom, yytype_int16 *top) #else static void yy_stack_print (bottom, top) - short *bottom; - short *top; + yytype_int16 *bottom; + yytype_int16 *top; #endif { YYFPRINTF (stderr, "Stack now"); - for (/* Nothing. */; bottom <= top; ++bottom) + for (; bottom <= top; ++bottom) YYFPRINTF (stderr, " %d", *bottom); YYFPRINTF (stderr, "\n"); } @@ -806,45 +1017,52 @@ yy_stack_print (bottom, top) do { \ if (yydebug) \ yy_stack_print ((Bottom), (Top)); \ -} while (0) +} while (YYID (0)) /*------------------------------------------------. | Report that the YYRULE is going to be reduced. | `------------------------------------------------*/ -#if defined (__STDC__) || defined (__cplusplus) +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) static void -yy_reduce_print (int yyrule) +yy_reduce_print (YYSTYPE *yyvsp, int yyrule) #else static void -yy_reduce_print (yyrule) +yy_reduce_print (yyvsp, yyrule) + YYSTYPE *yyvsp; int yyrule; #endif { + int yynrhs = yyr2[yyrule]; int yyi; - unsigned int yylineno = yyrline[yyrule]; - YYFPRINTF (stderr, "Reducing stack by rule %d (line %u), ", - yyrule - 1, yylineno); - /* Print the symbols being reduced, and their result. */ - for (yyi = yyprhs[yyrule]; 0 <= yyrhs[yyi]; yyi++) - YYFPRINTF (stderr, "%s ", yytname [yyrhs[yyi]]); - YYFPRINTF (stderr, "-> %s\n", yytname [yyr1[yyrule]]); + unsigned long int yylno = yyrline[yyrule]; + YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n", + yyrule - 1, yylno); + /* The symbols being reduced. */ + for (yyi = 0; yyi < yynrhs; yyi++) + { + fprintf (stderr, " $%d = ", yyi + 1); + yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi], + &(yyvsp[(yyi + 1) - (yynrhs)]) + ); + fprintf (stderr, "\n"); + } } # define YY_REDUCE_PRINT(Rule) \ do { \ if (yydebug) \ - yy_reduce_print (Rule); \ -} while (0) + yy_reduce_print (yyvsp, Rule); \ +} while (YYID (0)) /* Nonzero means print parse trace. It is left uninitialized so that multiple parsers can coexist. */ int yydebug; #else /* !YYDEBUG */ # define YYDPRINTF(Args) -# define YYDSYMPRINT(Args) -# define YYDSYMPRINTF(Title, Token, Value, Location) +# define YY_SYMBOL_PRINT(Title, Type, Value, Location) # define YY_STACK_PRINT(Bottom, Top) # define YY_REDUCE_PRINT(Rule) #endif /* !YYDEBUG */ @@ -859,13 +1077,9 @@ int yydebug; if the built-in stack extension method is used). Do not make this value too large; the results are undefined if - SIZE_MAX < YYSTACK_BYTES (YYMAXDEPTH) + YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH) evaluated with infinite-precision integer arithmetic. */ -#if YYMAXDEPTH == 0 -# undef YYMAXDEPTH -#endif - #ifndef YYMAXDEPTH # define YYMAXDEPTH 10000 #endif @@ -875,45 +1089,47 @@ int yydebug; #if YYERROR_VERBOSE # ifndef yystrlen -# if defined (__GLIBC__) && defined (_STRING_H) +# if defined __GLIBC__ && defined _STRING_H # define yystrlen strlen # else /* Return the length of YYSTR. */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) static YYSIZE_T -# if defined (__STDC__) || defined (__cplusplus) yystrlen (const char *yystr) -# else +#else +static YYSIZE_T yystrlen (yystr) - const char *yystr; -# endif + const char *yystr; +#endif { - register const char *yys = yystr; - - while (*yys++ != '\0') + YYSIZE_T yylen; + for (yylen = 0; yystr[yylen]; yylen++) continue; - - return yys - yystr - 1; + return yylen; } # endif # endif # ifndef yystpcpy -# if defined (__GLIBC__) && defined (_STRING_H) && defined (_GNU_SOURCE) +# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE # define yystpcpy stpcpy # else /* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in YYDEST. */ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) static char * -# if defined (__STDC__) || defined (__cplusplus) yystpcpy (char *yydest, const char *yysrc) -# else +#else +static char * yystpcpy (yydest, yysrc) - char *yydest; - const char *yysrc; -# endif + char *yydest; + const char *yysrc; +#endif { - register char *yyd = yydest; - register const char *yys = yysrc; + char *yyd = yydest; + const char *yys = yysrc; while ((*yyd++ = *yys++) != '\0') continue; @@ -923,70 +1139,192 @@ yystpcpy (yydest, yysrc) # endif # endif -#endif /* !YYERROR_VERBOSE */ +# ifndef yytnamerr +/* Copy to YYRES the contents of YYSTR after stripping away unnecessary + quotes and backslashes, so that it's suitable for yyerror. The + heuristic is that double-quoting is unnecessary unless the string + contains an apostrophe, a comma, or backslash (other than + backslash-backslash). YYSTR is taken from yytname. If YYRES is + null, do not copy; instead, return the length of what the result + would have been. */ +static YYSIZE_T +yytnamerr (char *yyres, const char *yystr) +{ + if (*yystr == '"') + { + YYSIZE_T yyn = 0; + char const *yyp = yystr; + + for (;;) + switch (*++yyp) + { + case '\'': + case ',': + goto do_not_strip_quotes; + + case '\\': + if (*++yyp != '\\') + goto do_not_strip_quotes; + /* Fall through. */ + default: + if (yyres) + yyres[yyn] = *yyp; + yyn++; + break; + + case '"': + if (yyres) + yyres[yyn] = '\0'; + return yyn; + } + do_not_strip_quotes: ; + } - + if (! yyres) + return yystrlen (yystr); -#if YYDEBUG -/*--------------------------------. -| Print this symbol on YYOUTPUT. | -`--------------------------------*/ + return yystpcpy (yyres, yystr) - yyres; +} +# endif -#if defined (__STDC__) || defined (__cplusplus) -static void -yysymprint (FILE *yyoutput, int yytype, YYSTYPE *yyvaluep) -#else -static void -yysymprint (yyoutput, yytype, yyvaluep) - FILE *yyoutput; - int yytype; - YYSTYPE *yyvaluep; -#endif +/* Copy into YYRESULT an error message about the unexpected token + YYCHAR while in state YYSTATE. Return the number of bytes copied, + including the terminating null byte. If YYRESULT is null, do not + copy anything; just return the number of bytes that would be + copied. As a special case, return 0 if an ordinary "syntax error" + message will do. Return YYSIZE_MAXIMUM if overflow occurs during + size calculation. */ +static YYSIZE_T +yysyntax_error (char *yyresult, int yystate, int yychar) { - /* Pacify ``unused variable'' warnings. */ - (void) yyvaluep; + int yyn = yypact[yystate]; - if (yytype < YYNTOKENS) - { - YYFPRINTF (yyoutput, "token %s (", yytname[yytype]); -# ifdef YYPRINT - YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep); -# endif - } + if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) + return 0; else - YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]); - - switch (yytype) { - default: - break; + int yytype = YYTRANSLATE (yychar); + YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); + YYSIZE_T yysize = yysize0; + YYSIZE_T yysize1; + int yysize_overflow = 0; + enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; + char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; + int yyx; + +# if 0 + /* This is so xgettext sees the translatable formats that are + constructed on the fly. */ + YY_("syntax error, unexpected %s"); + YY_("syntax error, unexpected %s, expecting %s"); + YY_("syntax error, unexpected %s, expecting %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s"); + YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); +# endif + char *yyfmt; + char const *yyf; + static char const yyunexpected[] = "syntax error, unexpected %s"; + static char const yyexpecting[] = ", expecting %s"; + static char const yyor[] = " or %s"; + char yyformat[sizeof yyunexpected + + sizeof yyexpecting - 1 + + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) + * (sizeof yyor - 1))]; + char const *yyprefix = yyexpecting; + + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + + /* Stay within bounds of both yycheck and yytname. */ + int yychecklim = YYLAST - yyn + 1; + int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + int yycount = 1; + + yyarg[0] = yytname[yytype]; + yyfmt = yystpcpy (yyformat, yyunexpected); + + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) + { + if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) + { + yycount = 1; + yysize = yysize0; + yyformat[sizeof yyunexpected - 1] = '\0'; + break; + } + yyarg[yycount++] = yytname[yyx]; + yysize1 = yysize + yytnamerr (0, yytname[yyx]); + yysize_overflow |= (yysize1 < yysize); + yysize = yysize1; + yyfmt = yystpcpy (yyfmt, yyprefix); + yyprefix = yyor; + } + + yyf = YY_(yyformat); + yysize1 = yysize + yystrlen (yyf); + yysize_overflow |= (yysize1 < yysize); + yysize = yysize1; + + if (yysize_overflow) + return YYSIZE_MAXIMUM; + + if (yyresult) + { + /* Avoid sprintf, as that infringes on the user's name space. + Don't have undefined behavior even if the translation + produced a string with the wrong number of "%s"s. */ + char *yyp = yyresult; + int yyi = 0; + while ((*yyp = *yyf) != '\0') + { + if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) + { + yyp += yytnamerr (yyp, yyarg[yyi++]); + yyf += 2; + } + else + { + yyp++; + yyf++; + } + } + } + return yysize; } - YYFPRINTF (yyoutput, ")"); } +#endif /* YYERROR_VERBOSE */ + -#endif /* ! YYDEBUG */ /*-----------------------------------------------. | Release the memory associated to this symbol. | `-----------------------------------------------*/ -#if defined (__STDC__) || defined (__cplusplus) +/*ARGSUSED*/ +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) static void -yydestruct (int yytype, YYSTYPE *yyvaluep) +yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep) #else static void -yydestruct (yytype, yyvaluep) +yydestruct (yymsg, yytype, yyvaluep) + const char *yymsg; int yytype; YYSTYPE *yyvaluep; #endif { - /* Pacify ``unused variable'' warnings. */ - (void) yyvaluep; + YYUSE (yyvaluep); + + if (!yymsg) + yymsg = "Deleting"; + YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); switch (yytype) { default: - break; + break; } } @@ -994,13 +1332,13 @@ yydestruct (yytype, yyvaluep) /* Prevent warnings from -Wmissing-prototypes. */ #ifdef YYPARSE_PARAM -# if defined (__STDC__) || defined (__cplusplus) +#if defined __STDC__ || defined __cplusplus int yyparse (void *YYPARSE_PARAM); -# else +#else int yyparse (); -# endif +#endif #else /* ! YYPARSE_PARAM */ -#if defined (__STDC__) || defined (__cplusplus) +#if defined __STDC__ || defined __cplusplus int yyparse (void); #else int yyparse (); @@ -1009,10 +1347,10 @@ int yyparse (); -/* The lookahead symbol. */ +/* The look-ahead symbol. */ int yychar; -/* The semantic value of the lookahead symbol. */ +/* The semantic value of the look-ahead symbol. */ YYSTYPE yylval; /* Number of syntax errors so far. */ @@ -1025,14 +1363,18 @@ int yynerrs; `----------*/ #ifdef YYPARSE_PARAM -# if defined (__STDC__) || defined (__cplusplus) -int yyparse (void *YYPARSE_PARAM) -# else -int yyparse (YYPARSE_PARAM) - void *YYPARSE_PARAM; -# endif +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) +int +yyparse (void *YYPARSE_PARAM) +#else +int +yyparse (YYPARSE_PARAM) + void *YYPARSE_PARAM; +#endif #else /* ! YYPARSE_PARAM */ -#if defined (__STDC__) || defined (__cplusplus) +#if (defined __STDC__ || defined __C99__FUNC__ \ + || defined __cplusplus || defined _MSC_VER) int yyparse (void) #else @@ -1043,13 +1385,19 @@ yyparse () #endif { - register int yystate; - register int yyn; + int yystate; + int yyn; int yyresult; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus; - /* Lookahead token as an internal (translated) token number. */ + /* Look-ahead token as an internal (translated) token number. */ int yytoken = 0; +#if YYERROR_VERBOSE + /* Buffer for error messages, and its allocated size. */ + char yymsgbuf[128]; + char *yymsg = yymsgbuf; + YYSIZE_T yymsg_alloc = sizeof yymsgbuf; +#endif /* Three stacks and their tools: `yyss': related to states, @@ -1060,18 +1408,18 @@ yyparse () to reallocate them elsewhere. */ /* The state stack. */ - short yyssa[YYINITDEPTH]; - short *yyss = yyssa; - register short *yyssp; + yytype_int16 yyssa[YYINITDEPTH]; + yytype_int16 *yyss = yyssa; + yytype_int16 *yyssp; /* The semantic value stack. */ YYSTYPE yyvsa[YYINITDEPTH]; YYSTYPE *yyvs = yyvsa; - register YYSTYPE *yyvsp; + YYSTYPE *yyvsp; -#define YYPOPSTACK (yyvsp--, yyssp--) +#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N)) YYSIZE_T yystacksize = YYINITDEPTH; @@ -1080,9 +1428,9 @@ yyparse () YYSTYPE yyval; - /* When reducing, the number of symbols on the RHS of the reduced - rule. */ - int yylen; + /* The number of symbols on the RHS of the reduced rule. + Keep to zero when no symbol should be popped. */ + int yylen = 0; YYDPRINTF ((stderr, "Starting parse\n")); @@ -1106,8 +1454,7 @@ yyparse () `------------------------------------------------------------*/ yynewstate: /* In all cases, when you get here, the value and location stacks - have just been pushed. so pushing a state here evens the stacks. - */ + have just been pushed. So pushing a state here evens the stacks. */ yyssp++; yysetstate: @@ -1120,18 +1467,18 @@ yyparse () #ifdef yyoverflow { - /* Give user a chance to reallocate the stack. Use copies of + /* Give user a chance to reallocate the stack. Use copies of these so that the &'s don't force the real ones into memory. */ YYSTYPE *yyvs1 = yyvs; - short *yyss1 = yyss; + yytype_int16 *yyss1 = yyss; /* Each stack pointer address is followed by the size of the data in use in that stack, in bytes. This used to be a conditional around just the two extra args, but that might be undefined if yyoverflow is a macro. */ - yyoverflow ("parser stack overflow", + yyoverflow (YY_("memory exhausted"), &yyss1, yysize * sizeof (*yyssp), &yyvs1, yysize * sizeof (*yyvsp), @@ -1142,21 +1489,21 @@ yyparse () } #else /* no yyoverflow */ # ifndef YYSTACK_RELOCATE - goto yyoverflowlab; + goto yyexhaustedlab; # else /* Extend the stack our own way. */ if (YYMAXDEPTH <= yystacksize) - goto yyoverflowlab; + goto yyexhaustedlab; yystacksize *= 2; if (YYMAXDEPTH < yystacksize) yystacksize = YYMAXDEPTH; { - short *yyss1 = yyss; + yytype_int16 *yyss1 = yyss; union yyalloc *yyptr = (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize)); if (! yyptr) - goto yyoverflowlab; + goto yyexhaustedlab; YYSTACK_RELOCATE (yyss); YYSTACK_RELOCATE (yyvs); @@ -1187,19 +1534,17 @@ yyparse () `-----------*/ yybackup: -/* Do appropriate processing given the current state. */ -/* Read a lookahead token if we need one and don't already have one. */ -/* yyresume: */ - - /* First try to decide what to do without reference to lookahead token. */ + /* Do appropriate processing given the current state. Read a + look-ahead token if we need one and don't already have one. */ + /* First try to decide what to do without reference to look-ahead token. */ yyn = yypact[yystate]; if (yyn == YYPACT_NINF) goto yydefault; - /* Not known => get a lookahead token if don't already have one. */ + /* Not known => get a look-ahead token if don't already have one. */ - /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */ + /* YYCHAR is either YYEMPTY or YYEOF or a valid look-ahead symbol. */ if (yychar == YYEMPTY) { YYDPRINTF ((stderr, "Reading a token: ")); @@ -1214,7 +1559,7 @@ yybackup: else { yytoken = YYTRANSLATE (yychar); - YYDSYMPRINTF ("Next token is", yytoken, &yylval, &yylloc); + YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc); } /* If the proper action on seeing token YYTOKEN is to reduce or to @@ -1234,22 +1579,21 @@ yybackup: if (yyn == YYFINAL) YYACCEPT; - /* Shift the lookahead token. */ - YYDPRINTF ((stderr, "Shifting token %s, ", yytname[yytoken])); - - /* Discard the token being shifted unless it is eof. */ - if (yychar != YYEOF) - yychar = YYEMPTY; - - *++yyvsp = yylval; - - /* Count tokens shifted since error; after three, turn off error status. */ if (yyerrstatus) yyerrstatus--; + /* Shift the look-ahead token. */ + YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc); + + /* Discard the shifted token unless it is eof. */ + if (yychar != YYEOF) + yychar = YYEMPTY; + yystate = yyn; + *++yyvsp = yylval; + goto yynewstate; @@ -1288,12 +1632,12 @@ yyreduce: #line 144 "testpatterny.y" { if (getenv("STP_TESTPATTERN_DEBUG")) - fprintf(stderr, ">>>cmykspec %d\n", yyvsp[0].ival); + fprintf(stderr, ">>>cmykspec %d\n", (yyvsp[(2) - (2)].ival)); global_image_type = "CMYK"; global_channel_depth = 4; global_invert_data = 0; - if (yyvsp[0].ival == 8 || yyvsp[0].ival == 16) - global_bit_depth = yyvsp[0].ival; + if ((yyvsp[(2) - (2)].ival) == 8 || (yyvsp[(2) - (2)].ival) == 16) + global_bit_depth = (yyvsp[(2) - (2)].ival); } break; @@ -1301,12 +1645,12 @@ yyreduce: #line 156 "testpatterny.y" { if (getenv("STP_TESTPATTERN_DEBUG")) - fprintf(stderr, ">>>kcmyspec %d\n", yyvsp[0].ival); + fprintf(stderr, ">>>kcmyspec %d\n", (yyvsp[(2) - (2)].ival)); global_image_type = "KCMY"; global_channel_depth = 4; global_invert_data = 0; - if (yyvsp[0].ival == 8 || yyvsp[0].ival == 16) - global_bit_depth = yyvsp[0].ival; + if ((yyvsp[(2) - (2)].ival) == 8 || (yyvsp[(2) - (2)].ival) == 16) + global_bit_depth = (yyvsp[(2) - (2)].ival); } break; @@ -1314,12 +1658,12 @@ yyreduce: #line 168 "testpatterny.y" { if (getenv("STP_TESTPATTERN_DEBUG")) - fprintf(stderr, ">>>rgbspec %d\n", yyvsp[0].ival); + fprintf(stderr, ">>>rgbspec %d\n", (yyvsp[(2) - (2)].ival)); global_image_type = "RGB"; global_channel_depth = 3; global_invert_data = 1; - if (yyvsp[0].ival == 8 || yyvsp[0].ival == 16) - global_bit_depth = yyvsp[0].ival; + if ((yyvsp[(2) - (2)].ival) == 8 || (yyvsp[(2) - (2)].ival) == 16) + global_bit_depth = (yyvsp[(2) - (2)].ival); } break; @@ -1327,12 +1671,12 @@ yyreduce: #line 180 "testpatterny.y" { if (getenv("STP_TESTPATTERN_DEBUG")) - fprintf(stderr, ">>>cmyspec %d\n", yyvsp[0].ival); + fprintf(stderr, ">>>cmyspec %d\n", (yyvsp[(2) - (2)].ival)); global_image_type = "CMY"; global_channel_depth = 3; global_invert_data = 0; - if (yyvsp[0].ival == 8 || yyvsp[0].ival == 16) - global_bit_depth = yyvsp[0].ival; + if ((yyvsp[(2) - (2)].ival) == 8 || (yyvsp[(2) - (2)].ival) == 16) + global_bit_depth = (yyvsp[(2) - (2)].ival); } break; @@ -1340,12 +1684,12 @@ yyreduce: #line 192 "testpatterny.y" { if (getenv("STP_TESTPATTERN_DEBUG")) - fprintf(stderr, ">>>grayspec %d\n", yyvsp[0].ival); + fprintf(stderr, ">>>grayspec %d\n", (yyvsp[(2) - (2)].ival)); global_image_type = "Grayscale"; global_channel_depth = 1; global_invert_data = 0; - if (yyvsp[0].ival == 8 || yyvsp[0].ival == 16) - global_bit_depth = yyvsp[0].ival; + if ((yyvsp[(2) - (2)].ival) == 8 || (yyvsp[(2) - (2)].ival) == 16) + global_bit_depth = (yyvsp[(2) - (2)].ival); } break; @@ -1353,12 +1697,12 @@ yyreduce: #line 204 "testpatterny.y" { if (getenv("STP_TESTPATTERN_DEBUG")) - fprintf(stderr, ">>>whitespec %d\n", yyvsp[0].ival); + fprintf(stderr, ">>>whitespec %d\n", (yyvsp[(2) - (2)].ival)); global_image_type = "Whitescale"; global_channel_depth = 1; global_invert_data = 1; - if (yyvsp[0].ival == 8 || yyvsp[0].ival == 16) - global_bit_depth = yyvsp[0].ival; + if ((yyvsp[(2) - (2)].ival) == 8 || (yyvsp[(2) - (2)].ival) == 16) + global_bit_depth = (yyvsp[(2) - (2)].ival); } break; @@ -1366,23 +1710,23 @@ yyreduce: #line 216 "testpatterny.y" { if (getenv("STP_TESTPATTERN_DEBUG")) - fprintf(stderr, ">>>extendedspec %d\n", yyvsp[-1].ival); + fprintf(stderr, ">>>extendedspec %d\n", (yyvsp[(2) - (3)].ival)); global_image_type = "Raw"; global_invert_data = 0; - global_channel_depth = yyvsp[-1].ival; - if (yyvsp[-1].ival == 8 || yyvsp[-1].ival == 16) - global_bit_depth = yyvsp[0].ival; + global_channel_depth = (yyvsp[(2) - (3)].ival); + if ((yyvsp[(2) - (3)].ival) == 8 || (yyvsp[(2) - (3)].ival) == 16) + global_bit_depth = (yyvsp[(3) - (3)].ival); } break; case 25: #line 234 "testpatterny.y" { - int channel = find_color(yyvsp[-1].sval); + int channel = find_color((yyvsp[(2) - (3)]).sval); if (getenv("STP_TESTPATTERN_DEBUG")) - fprintf(stderr, ">>>level %s %f\n", yyvsp[-1].sval, yyvsp[0].dval); + fprintf(stderr, ">>>level %s %f\n", (yyvsp[(2) - (3)]).sval, (yyvsp[(3) - (3)].dval)); if (channel >= 0) - global_levels[channel] = yyvsp[0].dval; + global_levels[channel] = (yyvsp[(3) - (3)].dval); } break; @@ -1390,20 +1734,20 @@ yyreduce: #line 244 "testpatterny.y" { if (getenv("STP_TESTPATTERN_DEBUG")) - fprintf(stderr, ">>>channel_level %d %f\n", yyvsp[-1].ival, yyvsp[0].dval); - if (yyvsp[-1].ival >= 0 && yyvsp[-1].ival <= STP_CHANNEL_LIMIT) - global_levels[yyvsp[-1].ival] = yyvsp[0].dval; + fprintf(stderr, ">>>channel_level %d %f\n", (yyvsp[(2) - (3)].ival), (yyvsp[(3) - (3)].dval)); + if ((yyvsp[(2) - (3)].ival) >= 0 && (yyvsp[(2) - (3)].ival) <= STP_CHANNEL_LIMIT) + global_levels[(yyvsp[(2) - (3)].ival)] = (yyvsp[(3) - (3)].dval); } break; case 27: #line 253 "testpatterny.y" { - int channel = find_color(yyvsp[-1].sval); + int channel = find_color((yyvsp[(2) - (3)]).sval); if (getenv("STP_TESTPATTERN_DEBUG")) - fprintf(stderr, ">>>gamma %s %f\n", yyvsp[-1].sval, yyvsp[0].dval); + fprintf(stderr, ">>>gamma %s %f\n", (yyvsp[(2) - (3)]).sval, (yyvsp[(3) - (3)].dval)); if (channel >= 0) - global_gammas[channel] = yyvsp[0].dval; + global_gammas[channel] = (yyvsp[(3) - (3)].dval); } break; @@ -1411,9 +1755,9 @@ yyreduce: #line 263 "testpatterny.y" { if (getenv("STP_TESTPATTERN_DEBUG")) - fprintf(stderr, ">>>channel_gamma %d %f\n", yyvsp[-1].ival, yyvsp[0].dval); - if (yyvsp[-1].ival >= 0 && yyvsp[-1].ival <= STP_CHANNEL_LIMIT) - global_gammas[yyvsp[-1].ival] = yyvsp[0].dval; + fprintf(stderr, ">>>channel_gamma %d %f\n", (yyvsp[(2) - (3)].ival), (yyvsp[(3) - (3)].dval)); + if ((yyvsp[(2) - (3)].ival) >= 0 && (yyvsp[(2) - (3)].ival) <= STP_CHANNEL_LIMIT) + global_gammas[(yyvsp[(2) - (3)].ival)] = (yyvsp[(3) - (3)].dval); } break; @@ -1421,8 +1765,8 @@ yyreduce: #line 272 "testpatterny.y" { if (getenv("STP_TESTPATTERN_DEBUG")) - fprintf(stderr, ">>>global_gamma %f\n", yyvsp[0].dval); - global_gamma = yyvsp[0].dval; + fprintf(stderr, ">>>global_gamma %f\n", (yyvsp[(2) - (2)].dval)); + global_gamma = (yyvsp[(2) - (2)].dval); } break; @@ -1430,8 +1774,8 @@ yyreduce: #line 279 "testpatterny.y" { if (getenv("STP_TESTPATTERN_DEBUG")) - fprintf(stderr, ">>>steps %d\n", yyvsp[0].ival); - global_steps = yyvsp[0].ival; + fprintf(stderr, ">>>steps %d\n", (yyvsp[(2) - (2)].ival)); + global_steps = (yyvsp[(2) - (2)].ival); } break; @@ -1439,8 +1783,8 @@ yyreduce: #line 286 "testpatterny.y" { if (getenv("STP_TESTPATTERN_DEBUG")) - fprintf(stderr, ">>>ink_limit %f\n", yyvsp[0].dval); - global_ink_limit = yyvsp[0].dval; + fprintf(stderr, ">>>ink_limit %f\n", (yyvsp[(2) - (2)].dval)); + global_ink_limit = (yyvsp[(2) - (2)].dval); } break; @@ -1448,9 +1792,9 @@ yyreduce: #line 293 "testpatterny.y" { if (getenv("STP_TESTPATTERN_DEBUG")) - fprintf(stderr, ">>>printer %s\n", yyvsp[0].sval); - global_printer = strdup(yyvsp[0].sval); - free(yyvsp[0].sval); + fprintf(stderr, ">>>printer %s\n", (yyvsp[(2) - (2)].sval)); + global_printer = strdup((yyvsp[(2) - (2)].sval)); + free((yyvsp[(2) - (2)].sval)); } break; @@ -1458,9 +1802,9 @@ yyreduce: #line 302 "testpatterny.y" { if (getenv("STP_TESTPATTERN_DEBUG")) - fprintf(stderr, ">>>page_size_name %s\n", yyvsp[0].sval); - stp_set_string_parameter(global_vars, "PageSize", yyvsp[0].sval); - free(yyvsp[0].sval); + fprintf(stderr, ">>>page_size_name %s\n", (yyvsp[(2) - (2)].sval)); + stp_set_string_parameter(global_vars, "PageSize", (yyvsp[(2) - (2)].sval)); + free((yyvsp[(2) - (2)].sval)); } break; @@ -1468,9 +1812,9 @@ yyreduce: #line 311 "testpatterny.y" { if (getenv("STP_TESTPATTERN_DEBUG")) - fprintf(stderr, ">>>page_size_custom %d %d\n", yyvsp[-1].ival, yyvsp[0].ival); - stp_set_page_width(global_vars, yyvsp[-1].ival); - stp_set_page_height(global_vars, yyvsp[0].ival); + fprintf(stderr, ">>>page_size_custom %d %d\n", (yyvsp[(2) - (3)].ival), (yyvsp[(3) - (3)].ival)); + stp_set_page_width(global_vars, (yyvsp[(2) - (3)].ival)); + stp_set_page_height(global_vars, (yyvsp[(3) - (3)].ival)); } break; @@ -1478,10 +1822,10 @@ yyreduce: #line 323 "testpatterny.y" { if (getenv("STP_TESTPATTERN_DEBUG")) - fprintf(stderr, ">>>parameter_string %s %s\n", yyvsp[-1].sval, yyvsp[0].sval); - stp_set_string_parameter(global_vars, yyvsp[-1].sval, yyvsp[0].sval); - free(yyvsp[-1].sval); - free(yyvsp[0].sval); + fprintf(stderr, ">>>parameter_string %s %s\n", (yyvsp[(2) - (3)].sval), (yyvsp[(3) - (3)].sval)); + stp_set_string_parameter(global_vars, (yyvsp[(2) - (3)].sval), (yyvsp[(3) - (3)].sval)); + free((yyvsp[(2) - (3)].sval)); + free((yyvsp[(3) - (3)].sval)); } break; @@ -1489,9 +1833,9 @@ yyreduce: #line 333 "testpatterny.y" { if (getenv("STP_TESTPATTERN_DEBUG")) - fprintf(stderr, ">>>parameter_int %s %d\n", yyvsp[-1].sval, yyvsp[0].ival); - stp_set_int_parameter(global_vars, yyvsp[-1].sval, yyvsp[0].ival); - free(yyvsp[-1].sval); + fprintf(stderr, ">>>parameter_int %s %d\n", (yyvsp[(2) - (3)].sval), (yyvsp[(3) - (3)].ival)); + stp_set_int_parameter(global_vars, (yyvsp[(2) - (3)].sval), (yyvsp[(3) - (3)].ival)); + free((yyvsp[(2) - (3)].sval)); } break; @@ -1499,128 +1843,143 @@ yyreduce: #line 342 "testpatterny.y" { if (getenv("STP_TESTPATTERN_DEBUG")) - fprintf(stderr, ">>>parameter_float %s %f\n", yyvsp[-1].sval, yyvsp[0].dval); - stp_set_float_parameter(global_vars, yyvsp[-1].sval, yyvsp[0].dval); - free(yyvsp[-1].sval); + fprintf(stderr, ">>>parameter_float %s %f\n", (yyvsp[(2) - (3)].sval), (yyvsp[(3) - (3)].dval)); + stp_set_float_parameter(global_vars, (yyvsp[(2) - (3)].sval), (yyvsp[(3) - (3)].dval)); + free((yyvsp[(2) - (3)].sval)); + } + break; + + case 40: +#line 351 "testpatterny.y" + { + stp_curve_t *curve = stp_curve_create_from_string((yyvsp[(3) - (3)].sval)); + if (getenv("STP_TESTPATTERN_DEBUG")) + fprintf(stderr, ">>>parameter_curve %s %s\n", (yyvsp[(2) - (3)].sval), (yyvsp[(3) - (3)].sval)); + if (curve) + { + stp_set_curve_parameter(global_vars, (yyvsp[(2) - (3)].sval), curve); + stp_curve_destroy(curve); + } + free((yyvsp[(2) - (3)].sval)); } break; - case 43: + case 45: #line 367 "testpatterny.y" { if (getenv("STP_TESTPATTERN_DEBUG")) - fprintf(stderr, ">>>density %f\n", yyvsp[0].dval); - global_density = yyvsp[0].dval; + fprintf(stderr, ">>>density %f\n", (yyvsp[(2) - (2)].dval)); + global_density = (yyvsp[(2) - (2)].dval); } break; - case 44: + case 46: #line 374 "testpatterny.y" { if (getenv("STP_TESTPATTERN_DEBUG")) - fprintf(stderr, ">>>top %f\n", yyvsp[0].dval); - global_xtop = yyvsp[0].dval; + fprintf(stderr, ">>>top %f\n", (yyvsp[(2) - (2)].dval)); + global_xtop = (yyvsp[(2) - (2)].dval); } break; - case 45: + case 47: #line 381 "testpatterny.y" { if (getenv("STP_TESTPATTERN_DEBUG")) - fprintf(stderr, ">>>left %f\n", yyvsp[0].dval); - global_xleft = yyvsp[0].dval; + fprintf(stderr, ">>>left %f\n", (yyvsp[(2) - (2)].dval)); + global_xleft = (yyvsp[(2) - (2)].dval); } break; - case 46: + case 48: #line 388 "testpatterny.y" { if (getenv("STP_TESTPATTERN_DEBUG")) - fprintf(stderr, ">>>hsize %f\n", yyvsp[0].dval); - global_hsize = yyvsp[0].dval; + fprintf(stderr, ">>>hsize %f\n", (yyvsp[(2) - (2)].dval)); + global_hsize = (yyvsp[(2) - (2)].dval); } break; - case 47: + case 49: #line 395 "testpatterny.y" { if (getenv("STP_TESTPATTERN_DEBUG")) - fprintf(stderr, ">>>vsize %f\n", yyvsp[0].dval); - global_vsize = yyvsp[0].dval; + fprintf(stderr, ">>>vsize %f\n", (yyvsp[(2) - (2)].dval)); + global_vsize = (yyvsp[(2) - (2)].dval); } break; - case 48: + case 50: #line 402 "testpatterny.y" { if (getenv("STP_TESTPATTERN_DEBUG")) - fprintf(stderr, ">>>blackline %d\n", yyvsp[0].ival); - global_noblackline = !(yyvsp[0].ival); + fprintf(stderr, ">>>blackline %d\n", (yyvsp[(2) - (2)].ival)); + global_noblackline = !((yyvsp[(2) - (2)].ival)); } break; - case 49: + case 51: #line 410 "testpatterny.y" { if (getenv("STP_TESTPATTERN_DEBUG")) - fprintf(stderr, ">>>color_block1 %f %f %f (%d)\n", yyvsp[-2].dval, yyvsp[-1].dval, yyvsp[0].dval, + fprintf(stderr, ">>>color_block1 %f %f %f (%d)\n", (yyvsp[(1) - (3)].dval), (yyvsp[(2) - (3)].dval), (yyvsp[(3) - (3)].dval), current_index); if (current_index < STP_CHANNEL_LIMIT) { - current_testpattern->d.p.mins[current_index] = yyvsp[-2].dval; - current_testpattern->d.p.vals[current_index] = yyvsp[-1].dval; - current_testpattern->d.p.gammas[current_index] = yyvsp[0].dval; + current_testpattern->d.p.mins[current_index] = (yyvsp[(1) - (3)].dval); + current_testpattern->d.p.vals[current_index] = (yyvsp[(2) - (3)].dval); + current_testpattern->d.p.gammas[current_index] = (yyvsp[(3) - (3)].dval); current_index++; } } break; - case 55: + case 57: #line 434 "testpatterny.y" { - int channel = find_color(yyvsp[-3].sval); + int channel = find_color((yyvsp[(1) - (4)]).sval); if (getenv("STP_TESTPATTERN_DEBUG")) - fprintf(stderr, ">>>color_block2a %s %f %f %f\n", yyvsp[-3].sval, yyvsp[-2].dval, yyvsp[-1].dval, yyvsp[0].dval); + fprintf(stderr, ">>>color_block2a %s %f %f %f\n", (yyvsp[(1) - (4)]).sval, (yyvsp[(2) - (4)].dval), (yyvsp[(3) - (4)].dval), (yyvsp[(4) - (4)].dval)); if (channel >= 0 && channel < STP_CHANNEL_LIMIT) { - current_testpattern->d.p.mins[channel] = yyvsp[-2].dval; - current_testpattern->d.p.vals[channel] = yyvsp[-1].dval; - current_testpattern->d.p.gammas[channel] = yyvsp[0].dval; + current_testpattern->d.p.mins[channel] = (yyvsp[(2) - (4)].dval); + current_testpattern->d.p.vals[channel] = (yyvsp[(3) - (4)].dval); + current_testpattern->d.p.gammas[channel] = (yyvsp[(4) - (4)].dval); } } break; - case 56: + case 58: #line 448 "testpatterny.y" { if (getenv("STP_TESTPATTERN_DEBUG")) - fprintf(stderr, ">>>color_block2b %d %f %f %f\n", yyvsp[-3].ival, yyvsp[-2].dval, yyvsp[-1].dval, yyvsp[0].dval); - if (yyvsp[-3].ival >= 0 && yyvsp[-3].ival < STP_CHANNEL_LIMIT) + fprintf(stderr, ">>>color_block2b %d %f %f %f\n", (yyvsp[(2) - (5)].ival), (yyvsp[(3) - (5)].dval), (yyvsp[(4) - (5)].dval), (yyvsp[(5) - (5)].dval)); + if ((yyvsp[(2) - (5)].ival) >= 0 && (yyvsp[(2) - (5)].ival) < STP_CHANNEL_LIMIT) { - current_testpattern->d.p.mins[yyvsp[-3].ival] = yyvsp[-2].dval; - current_testpattern->d.p.vals[yyvsp[-3].ival] = yyvsp[-1].dval; - current_testpattern->d.p.gammas[yyvsp[-3].ival] = yyvsp[0].dval; + current_testpattern->d.p.mins[(yyvsp[(2) - (5)].ival)] = (yyvsp[(3) - (5)].dval); + current_testpattern->d.p.vals[(yyvsp[(2) - (5)].ival)] = (yyvsp[(4) - (5)].dval); + current_testpattern->d.p.gammas[(yyvsp[(2) - (5)].ival)] = (yyvsp[(5) - (5)].dval); } } break; - case 65: + case 67: #line 473 "testpatterny.y" { if (getenv("STP_TESTPATTERN_DEBUG")) - fprintf(stderr, ">>>patvars %f %f %f %f %f\n", yyvsp[-4].dval, yyvsp[-3].dval, yyvsp[-2].dval, yyvsp[-1].dval, yyvsp[0].dval); + fprintf(stderr, ">>>patvars %f %f %f %f %f\n", (yyvsp[(1) - (5)].dval), (yyvsp[(2) - (5)].dval), (yyvsp[(3) - (5)].dval), (yyvsp[(4) - (5)].dval), (yyvsp[(5) - (5)].dval)); current_testpattern->t = E_PATTERN; - current_testpattern->d.p.lower = yyvsp[-4].dval; - current_testpattern->d.p.upper = yyvsp[-3].dval; - current_testpattern->d.p.levels[1] = yyvsp[-2].dval; - current_testpattern->d.p.levels[2] = yyvsp[-1].dval; - current_testpattern->d.p.levels[3] = yyvsp[0].dval; + current_testpattern->d.p.lower = (yyvsp[(1) - (5)].dval); + current_testpattern->d.p.upper = (yyvsp[(2) - (5)].dval); + current_testpattern->d.p.levels[1] = (yyvsp[(3) - (5)].dval); + current_testpattern->d.p.levels[2] = (yyvsp[(4) - (5)].dval); + current_testpattern->d.p.levels[3] = (yyvsp[(5) - (5)].dval); current_testpattern = get_next_testpattern(); current_index = 0; } break; - case 67: + case 69: #line 491 "testpatterny.y" { if (getenv("STP_TESTPATTERN_DEBUG")) @@ -1636,26 +1995,26 @@ yyreduce: } break; - case 68: + case 70: #line 506 "testpatterny.y" { if (getenv("STP_TESTPATTERN_DEBUG")) - fprintf(stderr, ">>>grid %d\n", yyvsp[0].ival); + fprintf(stderr, ">>>grid %d\n", (yyvsp[(2) - (2)].ival)); current_testpattern->t = E_GRID; - current_testpattern->d.g.ticks = yyvsp[0].ival; + current_testpattern->d.g.ticks = (yyvsp[(2) - (2)].ival); current_testpattern = get_next_testpattern(); current_index = 0; } break; - case 69: + case 71: #line 517 "testpatterny.y" { if (getenv("STP_TESTPATTERN_DEBUG")) - fprintf(stderr, ">>>image %d %d\n", yyvsp[-1].ival, yyvsp[0].ival); + fprintf(stderr, ">>>image %d %d\n", (yyvsp[(2) - (3)].ival), (yyvsp[(3) - (3)].ival)); current_testpattern->t = E_IMAGE; - current_testpattern->d.i.x = yyvsp[-1].ival; - current_testpattern->d.i.y = yyvsp[0].ival; + current_testpattern->d.i.x = (yyvsp[(2) - (3)].ival); + current_testpattern->d.i.y = (yyvsp[(3) - (3)].ival); if (current_testpattern->d.i.x <= 0 || current_testpattern->d.i.y <= 0) { @@ -1666,77 +2025,77 @@ yyreduce: } break; - case 70: + case 72: #line 534 "testpatterny.y" { - fprintf(stderr, yyvsp[0].sval); - free(yyvsp[0].sval); + fprintf(stderr,"%s",(yyvsp[(2) - (2)].sval)); + free((yyvsp[(2) - (2)].sval)); } break; - case 71: + case 73: #line 540 "testpatterny.y" { - fprintf(stderr, yyvsp[-1].sval, yyvsp[0].sval); - free(yyvsp[-1].sval); - free(yyvsp[0].sval); + fprintf(stderr,"%s%s", (yyvsp[(2) - (3)].sval), (yyvsp[(3) - (3)].sval)); + free((yyvsp[(2) - (3)].sval)); + free((yyvsp[(3) - (3)].sval)); } break; - case 72: + case 74: #line 547 "testpatterny.y" { - fprintf(stderr, yyvsp[-2].sval, yyvsp[-1].sval, yyvsp[0].sval); - free(yyvsp[-2].sval); - free(yyvsp[-1].sval); - free(yyvsp[0].sval); + fprintf(stderr,"%s%s%s", (yyvsp[(2) - (4)].sval), (yyvsp[(3) - (4)].sval), (yyvsp[(4) - (4)].sval)); + free((yyvsp[(2) - (4)].sval)); + free((yyvsp[(3) - (4)].sval)); + free((yyvsp[(4) - (4)].sval)); } break; - case 73: + case 75: #line 555 "testpatterny.y" { - fprintf(stderr, yyvsp[-3].sval, yyvsp[-2].sval, yyvsp[-1].sval, yyvsp[0].sval); - free(yyvsp[-3].sval); - free(yyvsp[-2].sval); - free(yyvsp[-1].sval); - free(yyvsp[0].sval); + fprintf(stderr, "%s%s%s%s", (yyvsp[(2) - (5)].sval), (yyvsp[(3) - (5)].sval), (yyvsp[(4) - (5)].sval), (yyvsp[(5) - (5)].sval)); + free((yyvsp[(2) - (5)].sval)); + free((yyvsp[(3) - (5)].sval)); + free((yyvsp[(4) - (5)].sval)); + free((yyvsp[(5) - (5)].sval)); } break; - case 74: + case 76: #line 564 "testpatterny.y" { - fprintf(stderr, yyvsp[-4].sval, yyvsp[-3].sval, yyvsp[-2].sval, yyvsp[-1].sval, yyvsp[0].sval); - free(yyvsp[-4].sval); - free(yyvsp[-3].sval); - free(yyvsp[-2].sval); - free(yyvsp[-1].sval); - free(yyvsp[0].sval); + fprintf(stderr, "%s%s%s%s%s", (yyvsp[(2) - (6)].sval), (yyvsp[(3) - (6)].sval), (yyvsp[(4) - (6)].sval), (yyvsp[(5) - (6)].sval), (yyvsp[(6) - (6)].sval)); + free((yyvsp[(2) - (6)].sval)); + free((yyvsp[(3) - (6)].sval)); + free((yyvsp[(4) - (6)].sval)); + free((yyvsp[(5) - (6)].sval)); + free((yyvsp[(6) - (6)].sval)); } break; - case 99: + case 101: #line 586 "testpatterny.y" { global_did_something = 1; } break; - case 104: + case 106: #line 593 "testpatterny.y" { global_did_something = 1; } break; - case 107: + case 109: #line 600 "testpatterny.y" { global_did_something = 1; } break; - case 113: + case 115: #line 610 "testpatterny.y" { return 0; } break; - case 114: + case 116: #line 614 "testpatterny.y" { current_testpattern = get_next_testpattern(); @@ -1744,15 +2103,14 @@ yyreduce: break; +/* Line 1267 of yacc.c. */ +#line 2108 "testpatterny.c" + default: break; } + YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); -/* Line 991 of yacc.c. */ -#line 1750 "testpatterny.c" - - yyvsp -= yylen; - yyssp -= yylen; - - + YYPOPSTACK (yylen); + yylen = 0; YY_STACK_PRINT (yyss, yyssp); *++yyvsp = yyval; @@ -1781,109 +2139,93 @@ yyerrlab: if (!yyerrstatus) { ++yynerrs; -#if YYERROR_VERBOSE - yyn = yypact[yystate]; - - if (YYPACT_NINF < yyn && yyn < YYLAST) - { - YYSIZE_T yysize = 0; - int yytype = YYTRANSLATE (yychar); - char *yymsg; - int yyx, yycount; - - yycount = 0; - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. */ - for (yyx = yyn < 0 ? -yyn : 0; - yyx < (int) (sizeof (yytname) / sizeof (char *)); yyx++) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) - yysize += yystrlen (yytname[yyx]) + 15, yycount++; - yysize += yystrlen ("syntax error, unexpected ") + 1; - yysize += yystrlen (yytname[yytype]); - yymsg = (char *) YYSTACK_ALLOC (yysize); - if (yymsg != 0) - { - char *yyp = yystpcpy (yymsg, "syntax error, unexpected "); - yyp = yystpcpy (yyp, yytname[yytype]); - - if (yycount < 5) - { - yycount = 0; - for (yyx = yyn < 0 ? -yyn : 0; - yyx < (int) (sizeof (yytname) / sizeof (char *)); - yyx++) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) - { - const char *yyq = ! yycount ? ", expecting " : " or "; - yyp = yystpcpy (yyp, yyq); - yyp = yystpcpy (yyp, yytname[yyx]); - yycount++; - } - } - yyerror (yymsg); +#if ! YYERROR_VERBOSE + yyerror (YY_("syntax error")); +#else + { + YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); + if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) + { + YYSIZE_T yyalloc = 2 * yysize; + if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) + yyalloc = YYSTACK_ALLOC_MAXIMUM; + if (yymsg != yymsgbuf) YYSTACK_FREE (yymsg); - } - else - yyerror ("syntax error; also virtual memory exhausted"); - } - else -#endif /* YYERROR_VERBOSE */ - yyerror ("syntax error"); + yymsg = (char *) YYSTACK_ALLOC (yyalloc); + if (yymsg) + yymsg_alloc = yyalloc; + else + { + yymsg = yymsgbuf; + yymsg_alloc = sizeof yymsgbuf; + } + } + + if (0 < yysize && yysize <= yymsg_alloc) + { + (void) yysyntax_error (yymsg, yystate, yychar); + yyerror (yymsg); + } + else + { + yyerror (YY_("syntax error")); + if (yysize != 0) + goto yyexhaustedlab; + } + } +#endif } if (yyerrstatus == 3) { - /* If just tried and failed to reuse lookahead token after an + /* If just tried and failed to reuse look-ahead token after an error, discard it. */ - /* Return failure if at end of input. */ - if (yychar == YYEOF) - { - /* Pop the error token. */ - YYPOPSTACK; - /* Pop the rest of the stack. */ - while (yyss < yyssp) - { - YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); - yydestruct (yystos[*yyssp], yyvsp); - YYPOPSTACK; - } - YYABORT; - } - - YYDSYMPRINTF ("Error: discarding", yytoken, &yylval, &yylloc); - yydestruct (yytoken, &yylval); - yychar = YYEMPTY; - + if (yychar <= YYEOF) + { + /* Return failure if at end of input. */ + if (yychar == YYEOF) + YYABORT; + } + else + { + yydestruct ("Error: discarding", + yytoken, &yylval); + yychar = YYEMPTY; + } } - /* Else will try to reuse lookahead token after shifting the error + /* Else will try to reuse look-ahead token after shifting the error token. */ - goto yyerrlab2; + goto yyerrlab1; -/*----------------------------------------------------. -| yyerrlab1 -- error raised explicitly by an action. | -`----------------------------------------------------*/ -yyerrlab1: - - /* Suppress GCC warning that yyerrlab1 is unused when no action - invokes YYERROR. */ -#if defined (__GNUC_MINOR__) && 2093 <= (__GNUC__ * 1000 + __GNUC_MINOR__) \ - && !defined __cplusplus - __attribute__ ((__unused__)) -#endif +/*---------------------------------------------------. +| yyerrorlab -- error raised explicitly by YYERROR. | +`---------------------------------------------------*/ +yyerrorlab: + /* Pacify compilers like GCC when the user code never invokes + YYERROR and the label yyerrorlab therefore never appears in user + code. */ + if (/*CONSTCOND*/ 0) + goto yyerrorlab; - goto yyerrlab2; + /* Do not reclaim the symbols of the rule which action triggered + this YYERROR. */ + YYPOPSTACK (yylen); + yylen = 0; + YY_STACK_PRINT (yyss, yyssp); + yystate = *yyssp; + goto yyerrlab1; -/*---------------------------------------------------------------. -| yyerrlab2 -- pop states until the error token can be shifted. | -`---------------------------------------------------------------*/ -yyerrlab2: +/*-------------------------------------------------------------. +| yyerrlab1 -- common code for both syntax error and YYERROR. | +`-------------------------------------------------------------*/ +yyerrlab1: yyerrstatus = 3; /* Each real token shifted decrements this. */ for (;;) @@ -1904,22 +2246,23 @@ yyerrlab2: if (yyssp == yyss) YYABORT; - YYDSYMPRINTF ("Error: popping", yystos[*yyssp], yyvsp, yylsp); - yydestruct (yystos[yystate], yyvsp); - yyvsp--; - yystate = *--yyssp; + yydestruct ("Error: popping", + yystos[yystate], yyvsp); + YYPOPSTACK (1); + yystate = *yyssp; YY_STACK_PRINT (yyss, yyssp); } if (yyn == YYFINAL) YYACCEPT; - YYDPRINTF ((stderr, "Shifting error token, ")); - *++yyvsp = yylval; + /* Shift the error token. */ + YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp); + yystate = yyn; goto yynewstate; @@ -1939,21 +2282,39 @@ yyabortlab: goto yyreturn; #ifndef yyoverflow -/*----------------------------------------------. -| yyoverflowlab -- parser overflow comes here. | -`----------------------------------------------*/ -yyoverflowlab: - yyerror ("parser stack overflow"); +/*-------------------------------------------------. +| yyexhaustedlab -- memory exhaustion comes here. | +`-------------------------------------------------*/ +yyexhaustedlab: + yyerror (YY_("memory exhausted")); yyresult = 2; /* Fall through. */ #endif yyreturn: + if (yychar != YYEOF && yychar != YYEMPTY) + yydestruct ("Cleanup: discarding lookahead", + yytoken, &yylval); + /* Do not reclaim the symbols of the rule which action triggered + this YYABORT or YYACCEPT. */ + YYPOPSTACK (yylen); + YY_STACK_PRINT (yyss, yyssp); + while (yyssp != yyss) + { + yydestruct ("Cleanup: popping", + yystos[*yyssp], yyvsp); + YYPOPSTACK (1); + } #ifndef yyoverflow if (yyss != yyssa) YYSTACK_FREE (yyss); #endif - return yyresult; +#if YYERROR_VERBOSE + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); +#endif + /* Make sure YYID is used. */ + return YYID (yyresult); } diff --git a/src/testpattern/testpatterny.h b/src/testpattern/testpatterny.h index 2567b82..69e3127 100644 --- a/src/testpattern/testpatterny.h +++ b/src/testpattern/testpatterny.h @@ -1,7 +1,9 @@ -/* A Bison parser, made by GNU Bison 1.875. */ +/* A Bison parser, made by GNU Bison 2.3. */ -/* Skeleton parser for Yacc-like parsing with Bison, - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002 Free Software Foundation, Inc. +/* Skeleton interface for Bison's Yacc-like parsers in C + + Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006 + Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -15,13 +17,21 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ + Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ + +/* As a special exception, you may create a larger work that contains + part or all of the Bison parser skeleton and distribute that work + under terms of your choice, so long as that work isn't itself a + parser generator using the skeleton or a modified version thereof + as a parser skeleton. Alternatively, if you modify or redistribute + the parser skeleton itself, you may (at your option) remove this + special exception, which will cause the skeleton and the resulting + Bison output files to be licensed under the GNU General Public + License without this special exception. -/* As a special exception, when this file is copied by Bison into a - Bison output file, you may use that output file without restriction. - This special exception was added by the Free Software Foundation - in version 1.24 of Bison. */ + This special exception was added by the Free Software Foundation in + version 2.2 of Bison. */ /* Tokens. */ #ifndef YYTOKENTYPE @@ -75,6 +85,7 @@ END = 301 }; #endif +/* Tokens. */ #define tINT 258 #define tDOUBLE 259 #define tSTRING 260 @@ -123,7 +134,7 @@ -#if ! defined (YYSTYPE) && ! defined (YYSTYPE_IS_DECLARED) +#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef int YYSTYPE; # define yystype YYSTYPE /* obsolescent; will be withdrawn */ # define YYSTYPE_IS_DECLARED 1 @@ -132,5 +143,3 @@ typedef int YYSTYPE; extern YYSTYPE yylval; - - diff --git a/src/testpattern/testpatterny.y b/src/testpattern/testpatterny.y index 6d92bad..bb2073f 100644 --- a/src/testpattern/testpatterny.y +++ b/src/testpattern/testpatterny.y @@ -1,5 +1,5 @@ /* - * "$Id: testpatterny.y,v 1.26 2004/08/21 22:35:18 rlk Exp $" + * "$Id: testpatterny.y,v 1.26.18.2 2007/05/29 01:47:30 rlk Exp $" * * Test pattern generator for Gimp-Print * @@ -361,7 +361,7 @@ parameter_curve: PARAMETER_CURVE tSTRING tSTRING } ; -parameter: parameter_string | parameter_int | parameter_float +parameter: parameter_string | parameter_int | parameter_float | parameter_curve ; density: DENSITY tDOUBLE { @@ -532,20 +532,20 @@ image: IMAGE tINT tINT Message0: MESSAGE tSTRING { - fprintf(stderr, $2); + fprintf(stderr,"%s",$2); free($2); } ; Message1: MESSAGE tSTRING tSTRING { - fprintf(stderr, $2, $3); + fprintf(stderr,"%s%s", $2, $3); free($2); free($3); } ; Message2: MESSAGE tSTRING tSTRING tSTRING { - fprintf(stderr, $2, $3, $4); + fprintf(stderr,"%s%s%s", $2, $3, $4); free($2); free($3); free($4); @@ -553,7 +553,7 @@ Message2: MESSAGE tSTRING tSTRING tSTRING ; Message3: MESSAGE tSTRING tSTRING tSTRING tSTRING { - fprintf(stderr, $2, $3, $4, $5); + fprintf(stderr, "%s%s%s%s", $2, $3, $4, $5); free($2); free($3); free($4); @@ -562,7 +562,7 @@ Message3: MESSAGE tSTRING tSTRING tSTRING tSTRING ; Message4: MESSAGE tSTRING tSTRING tSTRING tSTRING tSTRING { - fprintf(stderr, $2, $3, $4, $5, $6); + fprintf(stderr, "%s%s%s%s%s", $2, $3, $4, $5, $6); free($2); free($3); free($4); -- cgit v1.2.3