diff options
author | Roger Leigh <rleigh@debian.org> | 2008-10-26 16:13:15 +0000 |
---|---|---|
committer | Roger Leigh <rleigh@debian.org> | 2008-10-26 16:13:15 +0000 |
commit | 162bb22c0a612c065ea77a88136fcf8ded9159a9 (patch) | |
tree | 5dd9b87d64c613ad2fc3998e80aa9fbf1400f537 /src/escputil | |
parent | e74aac350fb79d8cc3ed6a97451b30443ad9dac9 (diff) |
Imported Upstream version 4.3.99+cvs20051122.dfsg.1
Diffstat (limited to 'src/escputil')
-rw-r--r-- | src/escputil/Makefile.am | 4 | ||||
-rw-r--r-- | src/escputil/Makefile.in | 49 | ||||
-rw-r--r-- | src/escputil/escputil.c | 133 |
3 files changed, 93 insertions, 93 deletions
diff --git a/src/escputil/Makefile.am b/src/escputil/Makefile.am index e46d38b..4bba6e2 100644 --- a/src/escputil/Makefile.am +++ b/src/escputil/Makefile.am @@ -17,12 +17,8 @@ ## Process this file with automake to produce Makefile.in. -AUTOMAKE_OPTIONS = 1.4 gnu - @SET_MAKE@ -MAINT_CHARSET = latin1 - include $(top_srcdir)/scripts/global.mk diff --git a/src/escputil/Makefile.in b/src/escputil/Makefile.in index 1e4adc4..91cb23a 100644 --- a/src/escputil/Makefile.in +++ b/src/escputil/Makefile.in @@ -1,4 +1,4 @@ -# Makefile.in generated by automake 1.9.5 from Makefile.am. +# Makefile.in generated by automake 1.9.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, @@ -16,8 +16,6 @@ # Variables -SOURCES = $(escputil_SOURCES) - srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ @@ -66,8 +64,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 = $(SHELL) $(top_srcdir)/scripts/depcomp -am__depfiles_maybe = depfiles +depcomp = +am__depfiles_maybe = COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(DEFS) \ @@ -83,8 +81,6 @@ 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@ @@ -122,7 +118,6 @@ 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,14 +130,12 @@ 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@ @@ -277,13 +270,8 @@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_F77 = @ac_ct_F77@ ac_ct_RANLIB = @ac_ct_RANLIB@ ac_ct_STRIP = @ac_ct_STRIP@ -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@ +ac_pt_PKG_CONFIG = @ac_pt_PKG_CONFIG@ am__leading_dot = @am__leading_dot@ -am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ @@ -329,8 +317,6 @@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ -AUTOMAKE_OPTIONS = 1.4 gnu -MAINT_CHARSET = latin1 AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_builddir)/include $(LOCAL_CPPFLAGS) $(GNUCFLAGS) escputil_SOURCES = d4lib.c escputil.c d4lib.h escputil_LDADD = $(GUTENPRINT_LIBS) $(LIBREADLINE_DEPS) @@ -348,9 +334,9 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir exit 1;; \ esac; \ done; \ - echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/escputil/Makefile'; \ + echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu --ignore-deps src/escputil/Makefile'; \ cd $(top_srcdir) && \ - $(AUTOMAKE) --gnu src/escputil/Makefile + $(AUTOMAKE) --gnu --ignore-deps src/escputil/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ @@ -406,29 +392,14 @@ 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: -@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 $< + $(COMPILE) -c $< .c.obj: -@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) '$<'` + $(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: -@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 $@ $< + $(LTCOMPILE) -c -o $@ $< mostlyclean-libtool: -rm -f *.lo @@ -553,7 +524,6 @@ 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 @@ -579,7 +549,6 @@ 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 669cd88..3be1bf3 100644 --- a/src/escputil/escputil.c +++ b/src/escputil/escputil.c @@ -1,5 +1,5 @@ /* - * "$Id: escputil.c,v 1.75 2005/08/13 20:24:55 rlk Exp $" + * "$Id: escputil.c,v 1.76 2005/10/01 18:47:29 rlk Exp $" * * Printer maintenance utility for EPSON Stylus (R) printers * @@ -858,20 +858,22 @@ get_printer(int quiet, int fail_if_not_found) static const char *colors_new[] = { - N_("Black"), - N_("Matte Black"), - N_("Photo Black"), - N_("Cyan"), - N_("Magenta"), - N_("Yellow"), - N_("Light Cyan"), - N_("Light Magenta"), - N_("Dark Yellow"), - N_("Light Black"), - N_("unknown"), - N_("Red"), - N_("Blue"), - N_("Gloss Optimizer"), + N_("Black"), /* 0 */ + N_("Photo Black"), /* 1 */ + N_("Unknown"), /* 2 */ + N_("Cyan"), /* 3 */ + N_("Magenta"), /* 4 */ + N_("Yellow"), /* 5 */ + N_("Light Cyan"), /* 6 */ + N_("Light Magenta"), /* 7 */ + N_("Unknown"), /* 8 */ + N_("Unknown"), /* 9 */ + N_("Light Black"), /* a */ + N_("Matte Black"), /* b */ + N_("Red"), /* c */ + N_("Blue"), /* d */ + N_("Gloss Optimizer"), /* e */ + N_("Light Light Black"), /* f */ }; static int color_count = sizeof(colors_new) / sizeof(const char *); @@ -969,34 +971,15 @@ do_status_command_internal(status_cmd_t cmd) while (buf[i] != 0x0f && i < status) i += buf[i + 1] + 2; ind = buf + i; - i = 4; + i = 3; col_number = 0; - printf("%20s %s\n", _("Ink color"), _("Percent remaining")); - while (i < ind[1] + 3) + printf("%18s %20s\n", _("Ink color"), _("Percent remaining")); + while (i < ind[1]) { - if (ind[i] == 0) - { - /* black */ - switch (col_number) - { - case 0: - printf("%20s %3d\n", _(colors_new[0]), ind[i + 1]); - break; - case 3: - printf("%20s %3d\n", _(colors_new[1]), ind[i + 1]); - break; - case 4: - printf("%20s %3d\n", _(colors_new[2]), ind[i + 1]); - break; - } - } + if (ind[i] < color_count) + printf("%18s %20d\n", _(colors_new[(int) ind[i]]), ind[i + 2]); else - { - if (ind[i] + 2 < color_count) - printf("%20s %3d\n", _(colors_new[ind[i] + 2]), ind[i + 1]); - else - printf("%18s%2x %3d\n", _("Unknown"), ind[i] + 2, ind[i + 1]); - } + printf("%18s %20d\n", _("Unknown"), ind[i + 2]); col_number++; i+=3; } @@ -1085,7 +1068,7 @@ do_status_command_internal(status_cmd_t cmd) { ind += 3; - printf("%20s %s\n", _("Ink color"), _("Percent remaining")); + printf("%18s %20s\n", _("Ink color"), _("Percent remaining")); for (i = 0; i < stp_string_list_count(desc.bounds.str); i++) { int val, j; @@ -1103,7 +1086,7 @@ do_status_command_internal(status_cmd_t cmd) exit(1); } val = (ind[0] << 4) + ind[1]; - printf("%20s %3d\n",_(stp_string_list_param(desc.bounds.str, i)->text), + printf("%18s %20d\n",_(stp_string_list_param(desc.bounds.str, i)->text), val); ind += 2; } @@ -1134,7 +1117,8 @@ do_extended_ink_info(int extended_output) int credit; int retry = 4; char buf[1024]; - unsigned val, id, year, month, ik1, ik2; + unsigned val, id, id2, year, year2, month, month2; + unsigned iv[6]; char *ind; int i; @@ -1192,17 +1176,68 @@ do_extended_ink_info(int extended_output) exit(1); } ind = strchr(buf, 'I'); - if (sscanf(ind, - "II:01;IQT:%x;TSH:NAVL;PDY:%x;PDM:%x;IC1:%x;IC2:000A;IK1:%x;IK2:%x;TOV:18;TVU:06;LOG:INKbyEPSON;", - &val, &year, &month, &id, &ik1, &ik2 ) == 6) + if (sscanf(ind, + "II:01;IQT:%x;TSH:%*4s;PDY:%x;PDM:%x;IC1:%x;IC2:%*x;IK1:%*x;IK2:%*x;TOV:%*x;TVU:%*x;LOG:EPSON;IQT:%x,%x,%x,%x,%x;TSH:%*4s;PDY:%x;PDM:%x;IC1:%x;IC2:%*xIK1:%*x;IK2;%*x;TOV:%*x;TVU:%*x;LOG:EPSON;", + &iv[0], &year, &month, &id, + &iv[1], &iv[2], &iv[3], &iv[4], &iv[5], + &year2, &month2, &id2) == 12 || + sscanf(ind, + "II:01;IQT:%x;TSH:%*4s;PDY:%x;PDM:%x;IC1:%x;IC2:%*x;IK1:%*x;IK2:%*x;TOV:%*x;TVU:%*x;LOG:INKbyEPSON;IQT:%x,%x,%x,%x,%x;TSH:%*4s;PDY:%x;PDM:%x;IC1:%x;IC2:%*xIK1:%*x;IK2;%*x;TOV:%*x;TVU:%*x;LOG:INKbyEPSON;", + &iv[0], &year, &month, &id, + &iv[1], &iv[2], &iv[3], &iv[4], &iv[5], + &year2, &month2, &id2) == 12) + { + int j; + printf("%18s %20s %12s %7s\n", + _("Ink color"), _("Percent remaining"), _("Part number"), + _("Date")); + printf("%18s %20d T0%03d %2d%02d-%02d\n", + _(stp_string_list_param(desc.bounds.str, 0)->text), + iv[0], id, (year > 80 ? 19 : 20), year, month); + for (j = 1; j < 6; j++) + printf("%18s %20d T0%03d %2d%02d-%02d\n", + _(stp_string_list_param(desc.bounds.str, j)->text), + iv[j], id2, (year2 > 80 ? 19 : 20), year2, month2); + break; + } + else if (sscanf(ind, + "II:01;IQT:%x;TSH:%*4s;PDY:%x;PDM:%x;IC1:%x;IC2:%*x;IK1:%*x;IK2:%*x;TOV:%*x;TVU:%*x;LOG:EPSON;IQT:%x,%x,%x;TSH:%*4s;PDY:%x;PDM:%x;IC1:%x;IC2:%*xIK1:%*x;IK2;%*x;TOV:%*x;TVU:%*x;LOG:EPSON;", + &iv[0], &year, &month, &id, + &iv[1], &iv[2], &iv[3], + &year2, &month2, &id2) == 10 || + sscanf(ind, + "II:01;IQT:%x;TSH:%*4s;PDY:%x;PDM:%x;IC1:%x;IC2:%*x;IK1:%*x;IK2:%*x;TOV:%*x;TVU:%*x;LOG:INKbyEPSON;IQT:%x,%x,%x;TSH:%*4s;PDY:%x;PDM:%x;IC1:%x;IC2:%*xIK1:%*x;IK2;%*x;TOV:%*x;TVU:%*x;LOG:INKbyEPSON;", + &iv[0], &year, &month, &id, + &iv[1], &iv[2], &iv[3], + &year2, &month2, &id2) == 10) + { + int j; + printf("%18s %20s %12s %7s\n", + _("Ink color"), _("Percent remaining"), _("Part number"), + _("Date")); + printf("%18s %20d T0%03d %2d%02d-%02d\n", + _(stp_string_list_param(desc.bounds.str, 0)->text), + iv[0], id, (year > 80 ? 19 : 20), year, month); + for (j = 1; j < 4; j++) + printf("%18s %20d T0%03d %2d%02d-%02d\n", + _(stp_string_list_param(desc.bounds.str, j)->text), + iv[j], id2, (year2 > 80 ? 19 : 20), year2, month2); + break; + } + else if (sscanf(ind, + "II:01;IQT:%x;TSH:%*4s;PDY:%x;PDM:%x;IC1:%x;IC2:%*x;IK1:%*x;IK2:%*x;TOV:%*x;TVU:%*x;LOG:EPSON;", + &val, &year, &month, &id ) == 4 || + sscanf(ind, + "II:01;IQT:%x;TSH:%*4s;PDY:%x;PDM:%x;IC1:%x;IC2:%*x;IK1:%*x;IK2:%*x;TOV:%*x;TVU:%*x;LOG:INKbyEPSON;", + &val, &year, &month, &id ) == 4) { if (i == 0) - printf("%15s %20s %12s %7s\n", + printf("%18s %20s %12s %7s\n", _("Ink color"), _("Percent remaining"), _("Part number"), _("Date")); - printf("%15s %20d T0%03d 20%02d-%02d\n", + printf("%18s %20d T0%03d %2d%02d-%02d\n", _(stp_string_list_param(desc.bounds.str, i)->text), - val, id, year, month); + val, id, (year > 80 ? 19 : 20), year, month); } } else /* could not write */ |