diff options
Diffstat (limited to 'src/escputil')
-rw-r--r-- | src/escputil/.cvsignore | 5 | ||||
-rw-r--r-- | src/escputil/Makefile.am | 5 | ||||
-rw-r--r-- | src/escputil/Makefile.in | 450 | ||||
-rw-r--r-- | src/escputil/escputil.c | 235 |
4 files changed, 596 insertions, 99 deletions
diff --git a/src/escputil/.cvsignore b/src/escputil/.cvsignore deleted file mode 100644 index 5da45ee..0000000 --- a/src/escputil/.cvsignore +++ /dev/null @@ -1,5 +0,0 @@ -.deps -.libs -Makefile -Makefile.in -escputil diff --git a/src/escputil/Makefile.am b/src/escputil/Makefile.am index d730545..b9be86c 100644 --- a/src/escputil/Makefile.am +++ b/src/escputil/Makefile.am @@ -28,7 +28,8 @@ MAINT_CHARSET = latin1 AM_CFLAGS = $(GNUCFLAGS) INCLUDES = @INCLUDES@ -LIBS = @LIBS@ ../../lib/libprintut.la $(INTLLIBS) ../../lib/libprintut.la +LIBPRINTUT = $(top_builddir)/lib/libprintut.la +LIBS = $(INTLLIBS) @LIBS@ ## Programs @@ -39,7 +40,7 @@ bin_PROGRAMS = @ESCPUTIL_BIN@ EXTRA_PROGRAMS = escputil -escputil_LDADD = $(LIBREADLINE_DEPS) +escputil_LDADD = $(LIBPRINTUT) $(LIBREADLINE_DEPS) ## Clean diff --git a/src/escputil/Makefile.in b/src/escputil/Makefile.in new file mode 100644 index 0000000..41221a5 --- /dev/null +++ b/src/escputil/Makefile.in @@ -0,0 +1,450 @@ +# Makefile.in generated automatically by automake 1.4 from Makefile.am + +# Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +# This Makefile.in is free software; the Free Software Foundation +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DESTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = ../.. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ +ALL_LINGUAS = @ALL_LINGUAS@ +AS = @AS@ +AWK = @AWK@ +BISON_PROG = @BISON_PROG@ +BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CONVERT = @CONVERT@ +CUPS_BACKEND_BIN = @CUPS_BACKEND_BIN@ +CUPS_BIN = @CUPS_BIN@ +CUPS_CFLAGS = @CUPS_CFLAGS@ +CUPS_CONF = @CUPS_CONF@ +CUPS_CONFIG = @CUPS_CONFIG@ +CUPS_FILTER_BIN = @CUPS_FILTER_BIN@ +CUPS_INSTALL = @CUPS_INSTALL@ +CUPS_LIBS = @CUPS_LIBS@ +CUPS_MAN = @CUPS_MAN@ +CUPS_NOINST_BIN = @CUPS_NOINST_BIN@ +CUPS_PKG = @CUPS_PKG@ +CUPS_PPD_PS_LEVEL = @CUPS_PPD_PS_LEVEL@ +DATADIRNAME = @DATADIRNAME@ +DB2HTML = @DB2HTML@ +DB2PDF = @DB2PDF@ +DB2PS = @DB2PS@ +DLLTOOL = @DLLTOOL@ +DVIPDF = @DVIPDF@ +DVIPS = @DVIPS@ +ECHO = @ECHO@ +ESCPUTIL_MAN = @ESCPUTIL_MAN@ +EXEEXT = @EXEEXT@ +FOOMATIC_3_NOINST_BIN = @FOOMATIC_3_NOINST_BIN@ +FOOMATIC_CONFIGURE = @FOOMATIC_CONFIGURE@ +FOOMATIC_INSTALL = @FOOMATIC_INSTALL@ +FOOMATIC_KITLOAD = @FOOMATIC_KITLOAD@ +FOOMATIC_NOINST_BIN = @FOOMATIC_NOINST_BIN@ +FOOMATIC_OLDIDS_NOINST_BIN = @FOOMATIC_OLDIDS_NOINST_BIN@ +FOOMATIC_PPDFILE = @FOOMATIC_PPDFILE@ +GENCAT = @GENCAT@ +GIMPPRINT_BINARY_AGE = @GIMPPRINT_BINARY_AGE@ +GIMPPRINT_CFLAGS = @GIMPPRINT_CFLAGS@ +GIMPPRINT_CURRENT_INTERFACE = @GIMPPRINT_CURRENT_INTERFACE@ +GIMPPRINT_DEPLIBS = @GIMPPRINT_DEPLIBS@ +GIMPPRINT_INTERFACE_AGE = @GIMPPRINT_INTERFACE_AGE@ +GIMPPRINT_LIBS = @GIMPPRINT_LIBS@ +GIMPPRINT_MAJOR_VERSION = @GIMPPRINT_MAJOR_VERSION@ +GIMPPRINT_MICRO_VERSION = @GIMPPRINT_MICRO_VERSION@ +GIMPPRINT_MINOR_VERSION = @GIMPPRINT_MINOR_VERSION@ +GIMPPRINT_VERSION = @GIMPPRINT_VERSION@ +GIMPTOOL = @GIMPTOOL@ +GIMPTOOL_CHECK = @GIMPTOOL_CHECK@ +GIMP_BIN = @GIMP_BIN@ +GIMP_CFLAGS = @GIMP_CFLAGS@ +GIMP_CFLAGS_NOUI = @GIMP_CFLAGS_NOUI@ +GIMP_DATA_DIR = @GIMP_DATA_DIR@ +GIMP_LIBS = @GIMP_LIBS@ +GIMP_LIBS_NOUI = @GIMP_LIBS_NOUI@ +GIMP_PLUGIN_DIR = @GIMP_PLUGIN_DIR@ +GLIBC21 = @GLIBC21@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GNUCFLAGS = @GNUCFLAGS@ +IJS_BIN = @IJS_BIN@ +IJS_CFLAGS = @IJS_CFLAGS@ +IJS_CONFIG = @IJS_CONFIG@ +IJS_INSTALL = @IJS_INSTALL@ +IJS_LIBS = @IJS_LIBS@ +INSTOBJEXT = @INSTOBJEXT@ +INTLBISON = @INTLBISON@ +INTLLIBS = @INTLLIBS@ +INTLOBJS = @INTLOBJS@ +INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@ +LEX = @LEX@ +LIBGIMPPRINT_LIBS = @LIBGIMPPRINT_LIBS@ +LIBICONV = @LIBICONV@ +LIBM = @LIBM@ +LIBREADLINE_DEPS = @LIBREADLINE_DEPS@ +LIBTOOL = @LIBTOOL@ +LIBTOOL_DEPS = @LIBTOOL_DEPS@ +LN_S = @LN_S@ +LTALLOCA = @LTALLOCA@ +LTLIBOBJS = @LTLIBOBJS@ +LT_AGE = @LT_AGE@ +LT_CURRENT = @LT_CURRENT@ +LT_RELEASE = @LT_RELEASE@ +LT_REVISION = @LT_REVISION@ +MAINT = @MAINT@ +MAINTAINER_CFLAGS = @MAINTAINER_CFLAGS@ +MAIN_BIN = @MAIN_BIN@ +MAIN_DAT = @MAIN_DAT@ +MAIN_MAN = @MAIN_MAN@ +MAIN_SCR = @MAIN_SCR@ +MAKEINFO = @MAKEINFO@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +OBJDUMP = @OBJDUMP@ +OBJEXT = @OBJEXT@ +PACKAGE = @PACKAGE@ +PERL = @PERL@ +PLUG_IN_PATH = @PLUG_IN_PATH@ +POFILES = @POFILES@ +POSUB = @POSUB@ +PRINT_VASPRINTF = @PRINT_VASPRINTF@ +RANLIB = @RANLIB@ +RELEASE_DATE = @RELEASE_DATE@ +RM = @RM@ +SAMPLE_IMAGES = @SAMPLE_IMAGES@ +STRIP = @STRIP@ +TESTPATTERN_BIN = @TESTPATTERN_BIN@ +TEST_BIN = @TEST_BIN@ +TEXI2HTML = @TEXI2HTML@ +USER_GUIDE = @USER_GUIDE@ +USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +YACC = @YACC@ +YACC_PROG = @YACC_PROG@ +cups_bindir = @cups_bindir@ +cups_conf_datadir = @cups_conf_datadir@ +cups_conf_serverbin = @cups_conf_serverbin@ +cups_conf_serverroot = @cups_conf_serverroot@ +cups_exec_prefix = @cups_exec_prefix@ +cups_prefix = @cups_prefix@ +gimp_plug_indir = @gimp_plug_indir@ +gimpprint_cflags = @gimpprint_cflags@ +gimpprint_libs = @gimpprint_libs@ + +AUTOMAKE_OPTIONS = 1.4 gnu + +MAINT_CHARSET = latin1 + +AM_CFLAGS = $(GNUCFLAGS) +INCLUDES = @INCLUDES@ +LIBPRINTUT = $(top_builddir)/lib/libprintut.la +LIBS = $(INTLLIBS) @LIBS@ + +ESCPUTIL_BIN = escputil + +bin_PROGRAMS = @ESCPUTIL_BIN@ + +EXTRA_PROGRAMS = escputil + +escputil_LDADD = $(LIBPRINTUT) $(LIBREADLINE_DEPS) + +CLEANFILES = $(EXTRA_PROGRAMS) +MAINTAINERCLEANFILES = Makefile.in +mkinstalldirs = $(SHELL) $(top_srcdir)/scripts/mkinstalldirs +CONFIG_HEADER = ../../config.h +CONFIG_CLEAN_FILES = +bin_PROGRAMS = @ESCPUTIL_BIN@ +PROGRAMS = $(bin_PROGRAMS) + + +DEFS = @DEFS@ -I. -I$(srcdir) -I../.. +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +escputil_SOURCES = escputil.c +escputil_OBJECTS = escputil.$(OBJEXT) +escputil_DEPENDENCIES = $(top_builddir)/lib/libprintut.la +escputil_LDFLAGS = +CFLAGS = @CFLAGS@ +COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ +DIST_COMMON = Makefile.am Makefile.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP_ENV = --best +SOURCES = escputil.c +OBJECTS = escputil.$(OBJEXT) + +all: all-redirect +.SUFFIXES: +.SUFFIXES: .S .c .lo .o .obj .s +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps src/escputil/Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + + +mostlyclean-binPROGRAMS: + +clean-binPROGRAMS: + -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) + +distclean-binPROGRAMS: + +maintainer-clean-binPROGRAMS: + +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(bindir) + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + if test -f $$p; then \ + echo " $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \ + $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ + else :; fi; \ + done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + list='$(bin_PROGRAMS)'; for p in $$list; do \ + rm -f $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ + done + +.c.o: + $(COMPILE) -c $< + +# FIXME: We should only use cygpath when building on Windows, +# and only if it is available. +.c.obj: + $(COMPILE) -c `cygpath -w $<` + +.s.o: + $(COMPILE) -c $< + +.S.o: + $(COMPILE) -c $< + +mostlyclean-compile: + -rm -f *.o core *.core + -rm -f *.$(OBJEXT) + +clean-compile: + +distclean-compile: + -rm -f *.tab.c + +maintainer-clean-compile: + +.c.lo: + $(LIBTOOL) --mode=compile $(COMPILE) -c $< + +.s.lo: + $(LIBTOOL) --mode=compile $(COMPILE) -c $< + +.S.lo: + $(LIBTOOL) --mode=compile $(COMPILE) -c $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + +maintainer-clean-libtool: + +escputil$(EXEEXT): $(escputil_OBJECTS) $(escputil_DEPENDENCIES) + @rm -f escputil$(EXEEXT) + $(LINK) $(escputil_LDFLAGS) $(escputil_OBJECTS) $(escputil_LDADD) $(LIBS) + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $$unique $(LISP) + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) + +mostlyclean-tags: + +clean-tags: + +distclean-tags: + -rm -f TAGS ID + +maintainer-clean-tags: + +distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) + +subdir = src/escputil + +distdir: $(DISTFILES) + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done +escputil.o: escputil.c ../../config.h ../../lib/libprintut.h \ + ../../lib/xmalloc.h \ + ../../include/gimp-print/gimp-print-intl-internal.h + +info-am: +info: info-am +dvi-am: +dvi: dvi-am +check-am: all-am +check: check-am +installcheck-am: +installcheck: installcheck-am +install-exec-am: install-binPROGRAMS +install-exec: install-exec-am + +install-data-am: +install-data: install-data-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-am +uninstall-am: uninstall-binPROGRAMS +uninstall: uninstall-am +all-am: Makefile $(PROGRAMS) +all-redirect: all-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: + $(mkinstalldirs) $(DESTDIR)$(bindir) + + +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + +maintainer-clean-generic: + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) +mostlyclean-am: mostlyclean-binPROGRAMS mostlyclean-compile \ + mostlyclean-libtool mostlyclean-tags \ + mostlyclean-generic + +mostlyclean: mostlyclean-am + +clean-am: clean-binPROGRAMS clean-compile clean-libtool clean-tags \ + clean-generic mostlyclean-am + +clean: clean-am + +distclean-am: distclean-binPROGRAMS distclean-compile distclean-libtool \ + distclean-tags distclean-generic clean-am + -rm -f libtool + +distclean: distclean-am + +maintainer-clean-am: maintainer-clean-binPROGRAMS \ + maintainer-clean-compile maintainer-clean-libtool \ + maintainer-clean-tags maintainer-clean-generic \ + distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-am + +.PHONY: mostlyclean-binPROGRAMS distclean-binPROGRAMS clean-binPROGRAMS \ +maintainer-clean-binPROGRAMS uninstall-binPROGRAMS install-binPROGRAMS \ +mostlyclean-compile distclean-compile clean-compile \ +maintainer-clean-compile mostlyclean-libtool distclean-libtool \ +clean-libtool maintainer-clean-libtool tags mostlyclean-tags \ +distclean-tags clean-tags maintainer-clean-tags distdir info-am info \ +dvi-am dvi check check-am installcheck-am installcheck install-exec-am \ +install-exec install-data-am install-data install-am install \ +uninstall-am uninstall all-redirect all-am all installdirs \ +mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +@SET_MAKE@ + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/src/escputil/escputil.c b/src/escputil/escputil.c index 954ff3c..836889c 100644 --- a/src/escputil/escputil.c +++ b/src/escputil/escputil.c @@ -1,5 +1,5 @@ /* - * "$Id: escputil.c,v 1.39 2001/10/27 17:16:38 rlk Exp $" + * "$Id: escputil.c,v 1.39.2.18 2004/05/08 19:47:36 rlk Exp $" * * Printer maintenance utility for EPSON Stylus (R) printers * @@ -29,12 +29,14 @@ #include <string.h> #include <stdlib.h> #include <errno.h> -#include <fcntl.h> #if defined(HAVE_VARARGS_H) && !defined(HAVE_STDARG_H) #include <varargs.h> #else #include <stdarg.h> #endif +#ifdef HAVE_FCNTL_H +#include <fcntl.h> +#endif #ifdef HAVE_POLL #include <sys/poll.h> #endif @@ -200,9 +202,25 @@ stp_printer_t printer_list[] = { "C20ux", N_("Stylus C20ux"), 3, 15, 0, 2, 9 }, { "C40sx", N_("Stylus C40sx"), 3, 15, 0, 2, 9 }, { "C40ux", N_("Stylus C40ux"), 3, 15, 0, 2, 9 }, + { "C41sx", N_("Stylus C41sx"), 3, 15, 0, 2, 9 }, + { "C41ux", N_("Stylus C41ux"), 3, 15, 0, 2, 9 }, + { "C42sx", N_("Stylus C42sx"), 3, 15, 0, 2, 9 }, + { "C42ux", N_("Stylus C42ux"), 3, 15, 0, 2, 9 }, + { "C43sx", N_("Stylus C43sx"), 3, 15, 0, 2, 9 }, + { "C43ux", N_("Stylus C43ux"), 3, 15, 0, 2, 9 }, + { "C44sx", N_("Stylus C44sx"), 3, 15, 0, 2, 9 }, + { "C44ux", N_("Stylus C44ux"), 3, 15, 0, 2, 9 }, + { "C50", N_("Stylus C50"), 3, 15, 0, 2, 9 }, { "C60", N_("Stylus C60"), 3, 15, 0, 0, 0 }, - { "C70", N_("Stylus C70"), 3, 15, 0, 2, 9 }, - { "C80", N_("Stylus C80"), 3, 15, 0, 2, 9 }, + { "C61", N_("Stylus C61"), 3, 15, 0, 0, 0 }, + { "C62", N_("Stylus C62"), 3, 15, 0, 0, 0 }, + { "C63", N_("Stylus C63"), 4, 15, 0, 1, 7 }, + { "C64", N_("Stylus C64"), 4, 15, 0, 1, 7 }, + { "C70", N_("Stylus C70"), 4, 15, 0, 1, 7 }, + { "C80", N_("Stylus C80"), 4, 15, 0, 1, 7 }, + { "C82", N_("Stylus C82"), 4, 15, 0, 1, 7 }, + { "C83", N_("Stylus C83"), 4, 15, 0, 1, 7 }, + { "C84", N_("Stylus C84"), 4, 15, 0, 1, 7 }, { "color", N_("Stylus Color"), 1, 7, 0, 0, 0 }, { "pro", N_("Stylus Color Pro"), 1, 7, 0, 0, 0 }, { "pro-xl", N_("Stylus Color Pro XL"),1, 7, 0, 0, 0 }, @@ -241,24 +259,42 @@ stp_printer_t printer_list[] = { "790", N_("Stylus Photo 790"), 3, 15, 0, 0, 0 }, { "810", N_("Stylus Photo 810"), 3, 15, 0, 0, 0 }, { "820", N_("Stylus Photo 820"), 3, 15, 0, 0, 0 }, + { "830", N_("Stylus Photo 830"), 3, 15, 0, 0, 0 }, { "870", N_("Stylus Photo 870"), 3, 15, 0, 0, 0 }, { "875", N_("Stylus Photo 875"), 3, 15, 0, 0, 0 }, { "890", N_("Stylus Photo 890"), 3, 15, 0, 0, 0 }, { "895", N_("Stylus Photo 895"), 3, 15, 0, 0, 0 }, + { "915", N_("Stylus Photo 915"), 3, 15, 0, 0, 0 }, + { "925", N_("Stylus Photo 925"), 3, 15, 0, 0, 0 }, + { "935", N_("Stylus Photo 935"), 3, 15, 0, 0, 0 }, + { "950", N_("Stylus Photo 950"), 4, 15, 0, 0, 0 }, + { "960", N_("Stylus Photo 960"), 4, 15, 0, 0, 0 }, { "1200", N_("Stylus Photo 1200"),3, 15, 0, 0, 0 }, { "1270", N_("Stylus Photo 1270"),3, 15, 0, 0, 0 }, { "1280", N_("Stylus Photo 1280"),3, 15, 0, 0, 0 }, { "1290", N_("Stylus Photo 1290"),3, 15, 0, 0, 0 }, { "2000", N_("Stylus Photo 2000P"),2, 15, 0, 0, 0 }, + { "2100", N_("Stylus Photo 2100"),4, 15, 0, 0, 0 }, + { "2200", N_("Stylus Photo 2200"),4, 15, 0, 0, 0 }, { "5000", N_("Stylus Pro 5000"), 1, 7, 0, 0, 0 }, { "5500", N_("Stylus Pro 5500"), 1, 7, 0, 0, 0 }, { "7000", N_("Stylus Pro 7000"), 1, 7, 0, 0, 0 }, { "7500", N_("Stylus Pro 7500"), 1, 7, 0, 0, 0 }, + { "7600", N_("Stylus Pro 7600"), 3, 15, 0, 0, 0 }, { "9000", N_("Stylus Pro 9000"), 1, 7, 0, 0, 0 }, { "9500", N_("Stylus Pro 9500"), 1, 7, 0, 0, 0 }, + { "9600", N_("Stylus Pro 9600"), 3, 15, 0, 0, 0 }, { "10000", N_("Stylus Pro 10000"), 3, 15, 0, 0, 0 }, { "scan2000", N_("Stylus Scan 2000"), 3, 15, 0, 0, 0 }, { "scan2500", N_("Stylus Scan 2500"), 3, 15, 0, 0, 0 }, + { "CX3100", N_("Stylus CX-3100"), 4, 15, 0, 1, 7 }, + { "CX3200", N_("Stylus CX-3200"), 4, 15, 0, 1, 7 }, + { "CX5100", N_("Stylus CX-5100"), 4, 15, 0, 1, 7 }, + { "CX5200", N_("Stylus CX-5200"), 4, 15, 0, 1, 7 }, + { "CX6300", N_("Stylus CX-6300"), 4, 15, 0, 1, 7 }, + { "CX6400", N_("Stylus CX-6400"), 4, 15, 0, 1, 7 }, + { "CX8300", N_("Stylus CX-8300"), 4, 15, 0, 1, 7 }, + { "CX8400", N_("Stylus CX-8400"), 4, 15, 0, 1, 7 }, { NULL, NULL, 0, 0, 0, 0, 0 }, }; @@ -309,6 +345,13 @@ main(int argc, char **argv) int quiet = 0; int operation = 0; int c; + + /* Set up gettext */ +#ifdef ENABLE_NLS + setlocale (LC_ALL, ""); + bindtextdomain (PACKAGE, PACKAGE_LOCALE_DIR); +#endif + while (1) { #ifdef __GNU_LIBRARY__ @@ -450,12 +493,12 @@ do_print_cmd(void) if (printer == NULL) strcpy(command, "lpr -l"); else - sprintf(command, "lpr -P%s -l", printer); + snprintf(command, 1023, "lpr -P%s -l", printer); } else if (printer == NULL) strcpy(command, "lp -s -oraw"); else - sprintf(command, "lp -s -oraw -d%s", printer); + snprintf(command, 1023, "lp -s -oraw -d%s", printer); if ((pfile = popen(command, "w")) == NULL) { @@ -509,21 +552,38 @@ read_from_printer(int fd, char *buf, int bufsize) struct pollfd ufds; #endif int status; - int retry = 5; + int retry = 10; + +#ifdef HAVE_FCNTL_H + fcntl(fd, F_SETFL, + O_NONBLOCK | fcntl(fd, F_GETFL)); +#endif + memset(buf, 0, bufsize); + do { #ifdef HAVE_POLL ufds.fd = fd; ufds.events = POLLIN; ufds.revents = 0; - (void) poll(&ufds, 1, 1000); + if ((status = poll(&ufds, 1, 1000)) < 0) + break; /* poll error */ #endif status = read(fd, buf, bufsize - 1); - if (status <= 0) - sleep(1); + if (status == 0 || (status < 0 && errno == EAGAIN)) + { + sleep(1); + status = 0; /* not an error (read would have blocked) */ + } } while ((status == 0) && (--retry != 0)); + + if (status == 0 && retry == 0) + fprintf(stderr, _("Read from printer timed out\n")); + else if (status < 0) + fprintf(stderr, _("Cannot read from %s: %s\n"), raw_device, strerror(errno)); + return status; } @@ -580,6 +640,7 @@ const char *colors[] = N_("Yellow"), N_("Light Cyan"), N_("Light Magenta"), + N_("Black/Dark Yellow"), 0 }; @@ -588,6 +649,7 @@ do_ink_level(void) { int fd; int status; + int retry = 6; char buf[1024]; char *ind; int i; @@ -596,41 +658,51 @@ do_ink_level(void) fprintf(stderr,_("Obtaining ink levels requires using a raw device.\n")); exit(1); } - fd = open(raw_device, O_RDWR, 0666); - if (fd == -1) - { - fprintf(stderr, _("Cannot open %s read/write: %s\n"), raw_device, - strerror(errno)); - exit(1); - } - initialize_print_cmd(); - do_remote_cmd("ST", 2, 0, 1); - add_resets(2); - if (write(fd, printer_cmd, bufpos) < bufpos) - { - fprintf(stderr, _("Cannot write to %s: %s\n"), raw_device, - strerror(errno)); - exit(1); - } - status = read_from_printer(fd, buf, 1024); - if (status < 0) - { - fprintf(stderr, _("Cannot read from %s: %s\n"), - raw_device,strerror(errno)); - exit(1); - } - ind = buf; do - ind = strchr(ind, 'I'); - while (ind && ind[1] != 'Q' && (ind[1] != '\0' && ind[2] != ':')); - if (!ind || ind[1] != 'Q' || ind[2] != ':') + { + if (retry <= 4) + sleep(1); + fd = open(raw_device, O_RDWR, 0666); + if (fd == -1) + { + fprintf(stderr, _("Cannot open %s read/write: %s\n"), raw_device, + strerror(errno)); + exit(1); + } + add_resets(2); + initialize_print_cmd(); + if (isnew && !(retry & 1)) + do_remote_cmd("IQ", 1, 1); + else + do_remote_cmd("ST", 2, 0, 1); + add_resets(2); + if (write(fd, printer_cmd, bufpos) < bufpos) + { + fprintf(stderr, _("Cannot write to %s: %s\n"), raw_device, + strerror(errno)); + exit(1); + } + status = read_from_printer(fd, buf, 1024); + if (status < 0) + exit(1); + (void) close(fd); + ind = buf; + do + ind = strchr(ind, 'I'); + while (ind && ind[1] != 'Q' && (ind[1] != '\0' && ind[2] != ':')); + if (!ind || ind[1] != 'Q' || ind[2] != ':' || ind[3] == ';') + { + ind = NULL; + } + } while (--retry != 0 && !ind); + if (!ind) { fprintf(stderr, _("Cannot parse output from printer\n")); exit(1); } ind += 3; printf("%20s %s\n", _("Ink color"), _("Percent remaining")); - for (i = 0; i < 6; i++) + for (i = 0; i < 7; i++) { int val, j; if (!ind[0] || ind[0] == ';') @@ -650,12 +722,6 @@ do_ink_level(void) printf("%20s %3d\n", _(colors[i]), val); ind += 2; } - initialize_print_cmd(); - do_remote_cmd("ST", 2, 0, 0); - add_resets(2); - (void) write(fd, printer_cmd, bufpos); - (void) read(fd, buf, 1024); - (void) close(fd); exit(0); } @@ -691,11 +757,7 @@ do_identify(void) } status = read_from_printer(fd, buf, 1024); if (status < 0) - { - fprintf(stderr, _("Cannot read from %s: %s\n"), - raw_device, strerror(errno)); - exit(1); - } + exit(1); printf("%s\n", buf); (void) close(fd); exit(0); @@ -732,16 +794,12 @@ do_status(void) } status = read_from_printer(fd, buf, 1024); if (status < 0) - { - fprintf(stderr, _("Cannot read from %s: %s\n"), - raw_device, strerror(errno)); - exit(1); - } + exit(1); initialize_print_cmd(); do_remote_cmd("ST", 2, 0, 0); add_resets(2); (void) write(fd, printer_cmd, bufpos); - (void) read(fd, buf, 1024); + (void) read_from_printer(fd, buf, 1024); while ((where = strchr(buf, ';')) != NULL) *where = '\n'; printf("%s\n", buf); @@ -886,10 +944,7 @@ get_printer(void) } status = read_from_printer(fd, buf, 1024); if (status < 0) - { - printf(_("\nCannot read from %s: %s\n"), raw_device,strerror(errno)); - exit(1); - } + exit(1); (void) close(fd); pos = strchr(buf, (int) ';'); if (pos) @@ -975,16 +1030,19 @@ do_final_alignment(void) inbuf = do_get_input(_("> ")); if (inbuf[0] == 's' || inbuf[0] == 'S') { - printf(_("Please insert your alignment test page in the printer once more\n" - "for the final save of your alignment settings. When the printer\n" - "feeds the page through, your settings have been saved.\n")); + printf(_("About to save settings...")); fflush(stdout); initialize_print_cmd(); - add_newlines(2); do_remote_cmd("SV", 0); - add_newlines(2); if (do_print_cmd()) - printer_error(); + { + printf(_("failed!\n")); + printf(_("Your settings were not saved successfully. You must repeat the\n" + "alignment procedure.\n")); + exit(1); + } + printf(_("succeeded!\n")); + printf(_("Your alignment settings have been saved to the printer.\n")); return 1; } break; @@ -1023,26 +1081,19 @@ do_align(void) do_align_help(passes, choices); printf(_(printer_msg), _(printer_name)); inbuf = do_get_input(_("Press enter to continue > ")); + top: + initialize_print_cmd(); + for (curpass = 0; curpass < passes; curpass++) + do_remote_cmd("DT", 3, 0, curpass, 0); + if (do_print_cmd()) + printer_error(); + printf(_("Please inspect the print, and choose the best pair of lines in each pattern.\n" + "Type a pair number, '?' for help, or 'r' to repeat the procedure.\n")); initialize_print_cmd(); for (curpass = 1; curpass <= passes; curpass ++) { - top: - add_newlines(7 * (curpass - 1)); - do_remote_cmd("DT", 3, 0, curpass - 1, 0); - if (do_print_cmd()) - printer_error(); reread: - if (curpass == passes) - printf(_("Please inspect the print, and choose the best pair of lines\n" - "in pattern #%d, and then insert a fresh page in the input tray.\n" - "Type a pair number, '?' for help, or 'r' to retry this pattern.\n"), - curpass); - else - printf(_("Please inspect the print, and choose the best pair of lines\n" - "in pattern #%d, and then reinsert the page in the input tray.\n" - "Type a pair number, '?' for help, or 'r' to retry this pattern.\n"), - curpass); - fflush(stdout); + printf(_("Pass #%d"), curpass); inbuf = do_get_input(_("> ")); switch (inbuf[0]) { @@ -1083,19 +1134,19 @@ do_align(void) fflush(stdout); goto reread; } - if (curpass == passes) - { - printf(_("Aligning phase %d, and performing final test.\n" - "Please insert a fresh sheet of paper.\n"), curpass); - (void) do_get_input(_("Press enter to continue > ")); - } - else - printf(_("Aligning phase %d, and starting phase %d.\n"), curpass, - curpass + 1); - fflush(stdout); - initialize_print_cmd(); do_remote_cmd("DA", 4, 0, curpass - 1, 0, answer); } + printf(_("Attempting to set alignment...")); + if (do_print_cmd()) + printer_error(); + printf(_("succeeded.\n")); + printf(_("Please verify that the alignment is correct. After the alignment pattern\n" + "is printed again, please ensure that the best pattern for each line is\n" + "pattern %d. If it is not, you should repeat the process to get the best\n" + "quality printing.\n"), (choices + 1) / 2); + printf(_("Please insert a fresh sheet of paper.\n")); + (void) do_get_input(_("Press enter to continue > ")); + initialize_print_cmd(); for (curpass = 0; curpass < passes; curpass++) do_remote_cmd("DT", 3, 0, curpass, 0); if (do_print_cmd()) |