summaryrefslogtreecommitdiff
path: root/src/escputil
diff options
context:
space:
mode:
authorRoger Leigh <rleigh@debian.org>2008-10-26 17:28:54 +0000
committerRoger Leigh <rleigh@debian.org>2008-10-26 17:28:54 +0000
commit33a17feb28af2d2aeabc8c7ab5ef509ea3de15a7 (patch)
treed444cf1a245694bd049a9e6722c41b8f280ad429 /src/escputil
parent9d82a443d65ea3e4e015ba6988208231fa8fdc77 (diff)
Imported Upstream version 5.2.1
Diffstat (limited to 'src/escputil')
-rw-r--r--src/escputil/Makefile.in35
-rw-r--r--src/escputil/d4lib.c1
-rw-r--r--src/escputil/escputil.c146
3 files changed, 114 insertions, 68 deletions
diff --git a/src/escputil/Makefile.in b/src/escputil/Makefile.in
index 0aeaade..d441e3c 100644
--- a/src/escputil/Makefile.in
+++ b/src/escputil/Makefile.in
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.10 from Makefile.am.
+# Makefile.in generated by automake 1.10.1 from Makefile.am.
# @configure_input@
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+# 2003, 2004, 2005, 2006, 2007, 2008 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.
@@ -17,7 +17,7 @@
# Variables
#export STP_MODULE_PATH = $(top_builddir)/src/main/.libs:$(top_builddir)/src/main
-#export STP_DATA_PATH = $(top_srcdir)/src/main
+#export STP_DATA_PATH = $(top_srcdir)/src/xml
VPATH = @srcdir@
pkgdatadir = $(datadir)/@PACKAGE@
@@ -45,7 +45,8 @@ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/gettext.m4 \
$(top_srcdir)/m4/iconv.m4 $(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/lib-prefix.m4 $(top_srcdir)/m4/nls.m4 \
+ $(top_srcdir)/m4/po.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
@@ -61,7 +62,7 @@ am_escputil_OBJECTS = d4lib.$(OBJEXT) escputil.$(OBJEXT)
escputil_OBJECTS = $(am_escputil_OBJECTS)
am__DEPENDENCIES_1 =
escputil_DEPENDENCIES = $(GUTENPRINT_LIBS) $(am__DEPENDENCIES_1)
-DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@
+DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/scripts/depcomp
am__depfiles_maybe = depfiles
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
@@ -109,6 +110,7 @@ DEFS = @DEFS@
DEPDIR = @DEPDIR@
DIALOG = @DIALOG@
DOXYGEN = @DOXYGEN@
+DSYMUTIL = @DSYMUTIL@
DVIPDF = @DVIPDF@
DVIPS = @DVIPS@
ECHO = @ECHO@
@@ -129,6 +131,7 @@ GIMP2_LIBS = @GIMP2_LIBS@
GIMPTOOL2_CHECK = @GIMPTOOL2_CHECK@
GLIB_MKENUMS = @GLIB_MKENUMS@
GMSGFMT = @GMSGFMT@
+GMSGFMT_015 = @GMSGFMT_015@
GNUCFLAGS = @GNUCFLAGS@
GREP = @GREP@
GTK2_CFLAGS = @GTK2_CFLAGS@
@@ -161,6 +164,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
INTLLIBS = @INTLLIBS@
+INTL_MACOSX_LIBS = @INTL_MACOSX_LIBS@
LDFLAGS = @LDFLAGS@
LEX = @LEX@
LEXLIB = @LEXLIB@
@@ -181,9 +185,10 @@ MAINT = @MAINT@
MAINTAINER_CFLAGS = @MAINTAINER_CFLAGS@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
-MKINSTALLDIRS = @MKINSTALLDIRS@
MSGFMT = @MSGFMT@
+MSGFMT_015 = @MSGFMT_015@
MSGMERGE = @MSGMERGE@
+NMEDIT = @NMEDIT@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
@@ -210,6 +215,7 @@ USE_NLS = @USE_NLS@
VERSION = @VERSION@
WHICH_PPDS = @WHICH_PPDS@
XGETTEXT = @XGETTEXT@
+XGETTEXT_015 = @XGETTEXT_015@
YACC = @YACC@
YFLAGS = @YFLAGS@
abs_builddir = @abs_builddir@
@@ -324,8 +330,8 @@ install-binPROGRAMS: $(bin_PROGRAMS)
|| test -f $$p1 \
; then \
f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \
- echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
- $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
+ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \
+ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \
else :; fi; \
done
@@ -388,8 +394,8 @@ ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
+ $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
mkid -fID $$unique
tags: TAGS
@@ -401,8 +407,8 @@ TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
@@ -412,13 +418,12 @@ ctags: CTAGS
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
$(TAGS_FILES) $(LISP)
tags=; \
- here=`pwd`; \
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | \
- $(AWK) ' { files[$$0] = 1; } \
- END { for (i in files) print i; }'`; \
+ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in files) print i; }; }'`; \
test -z "$(CTAGS_ARGS)$$tags$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$tags $$unique
diff --git a/src/escputil/d4lib.c b/src/escputil/d4lib.c
index 46e508a..17cd4ae 100644
--- a/src/escputil/d4lib.c
+++ b/src/escputil/d4lib.c
@@ -312,7 +312,6 @@ static int printError(unsigned char errorNb)
}
fprintf(stderr,"Unknown IEEE 1284.4 error number %d\n",errorNb);
return 0;
- return 1; /* non recoverable error */
}
diff --git a/src/escputil/escputil.c b/src/escputil/escputil.c
index 4ebdab3..f4fa3c0 100644
--- a/src/escputil/escputil.c
+++ b/src/escputil/escputil.c
@@ -1,5 +1,5 @@
/*
- * "$Id: escputil.c,v 1.92 2007/12/26 18:13:02 rlk Exp $"
+ * "$Id: escputil.c,v 1.96 2008/07/05 01:43:26 rlk Exp $"
*
* Printer maintenance utility for EPSON Stylus (R) printers
*
@@ -972,22 +972,23 @@ get_printer(int quiet, int fail_if_not_found)
static const char *colors_new[] =
{
- 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 */
+ N_("Black"), /* 00 */
+ N_("Photo Black"), /* 01 */
+ N_("Unknown"), /* 02 */
+ N_("Cyan"), /* 03 */
+ N_("Magenta"), /* 04 */
+ N_("Yellow"), /* 05 */
+ N_("Light Cyan"), /* 06 */
+ N_("Light Magenta"), /* 07 */
+ N_("Unknown"), /* 08 */
+ N_("Unknown"), /* 09 */
+ N_("Light Black"), /* 0a */
+ N_("Matte Black"), /* 0b */
+ N_("Red"), /* 0c */
+ N_("Blue"), /* 0d */
+ N_("Gloss Optimizer"), /* 0e */
+ N_("Light Light Black"), /* 0f */
+ N_("Orange"), /* 10 */
};
static int color_count = sizeof(colors_new) / sizeof(const char *);
@@ -1006,7 +1007,7 @@ static const char *aux_colors[] =
N_("Blue"), /* a */
NULL, /* b */
NULL, /* c */
- NULL, /* d */
+ N_("Orange"), /* d */
NULL, /* e */
NULL, /* f */
};
@@ -1073,18 +1074,33 @@ print_error(int param)
case 6:
printf(_("Error: Paper out\n"));
break;
+ case 0xc:
+ printf(_("Error: Miscellaneous paper error\n"));
+ break;
+ case 0x10:
+ printf(_("Error: Maintenance cartridge overflow\n"));
+ break;
case 0x11:
printf(_("Error: Wait return from the tear-off position\n"));
break;
case 0x12:
printf(_("Error: Double feed error\n"));
break;
+ case 0x1a:
+ printf(_("Error: Ink cartridge lever released\n\n"));
+ break;
case 0x1c:
printf(_("Error: Unrecoverable cutter error\n"));
break;
case 0x1d:
printf(_("Error: Recoverable cutter jam\n"));
break;
+ case 0x22:
+ printf(_("Error: No maintenance cartridge present\n"));
+ break;
+ case 0x25:
+ printf(_("Error: Rear cover open\n"));
+ break;
case 0x29:
printf(_("Error: CD Tray Out\n"));
break;
@@ -1094,6 +1110,15 @@ print_error(int param)
case 0x2b:
printf(_("Error: Tray cover open\n"));
break;
+ case 0x36:
+ printf(_("Error: Maintenance cartridge cover open\n"));
+ break;
+ case 0x37:
+ printf(_("Error: Front cover open\n"));
+ break;
+ case 0x41:
+ printf(_("Error: Maintenance request\n"));
+ break;
default:
printf(_("Error: Unknown (%d)\n"), param);
break;
@@ -1101,6 +1126,44 @@ print_error(int param)
}
static void
+print_warning(int param, const stp_string_list_t *color_list)
+{
+ if (param >= 0x10 && param < 0x20)
+ {
+ param &= 0xf;
+ if (color_list && param < stp_string_list_count(color_list))
+ printf(_("Warning: %s Ink Low\n"),
+ gettext(stp_string_list_param(color_list, param)->text));
+ else
+ printf(_("Warning: Channel %d Ink Low\n"), param);
+ }
+ else if (param >= 0x50 && param < 0x60)
+ {
+ param &= 0xf;
+ if (color_list && param < stp_string_list_count(color_list))
+ printf(_("Warning: %s Cleaning Disabled\n"),
+ gettext(stp_string_list_param(color_list, param)->text));
+ else
+ printf(_("Warning: Channel %d Cleaning \n"), param);
+ }
+ else
+ {
+ switch (param)
+ {
+ case 0x20:
+ printf(_("Warning: Maintenance cartridge near full\n"));
+ break;
+ case 0x21:
+ printf(_("Warning: Maintenance request pending\n"));
+ break;
+ default:
+ printf(_("Warning: Unknown (%d)\n"), param);
+ break;
+ }
+ }
+}
+
+static void
print_self_printing_state(int param)
{
switch (param)
@@ -1224,7 +1287,16 @@ do_new_status(status_cmd_t cmd, char *buf, int bytes,
int i = 0;
int j;
const char *ind;
+ const stp_string_list_t *color_list = NULL;
+ stp_parameter_t desc;
+ const stp_vars_t *printvars = stp_printer_get_defaults(printer);
+ stp_describe_parameter(printvars, "ChannelNames", &desc);
+ if (desc.p_type == STP_PARAMETER_TYPE_STRING_LIST)
+ color_list = desc.bounds.str;
STP_DEBUG(fprintf(stderr, "New format bytes: %d bytes\n", bytes));
+ if (cmd == CMD_STATUS)
+ printf(_("Printer Name: %s\n"),
+ printer ? stp_printer_get_long_name(printer) : _("Unknown"));
while (i < bytes)
{
unsigned hdr = buf[i];
@@ -1249,7 +1321,7 @@ do_new_status(status_cmd_t cmd, char *buf, int bytes,
printf("%18s %20d\n",
gettext(aux_colors[(int) ind[1]]), ind[2]);
else
- printf("%8s 0x%2x 0x%2x %20d\n",
+ printf("%8s 0x%02x 0x%02x %20d\n",
_("Unknown"), (unsigned char) ind[0],
(unsigned char) ind[1], ind[2]);
ind += param;
@@ -1271,42 +1343,11 @@ do_new_status(status_cmd_t cmd, char *buf, int bytes,
print_self_printing_state(param);
break;
case 0x4: /* Warning */
-#if 0
- /*
- * Bits mean different things on different printers
- * Need to figure out how to do this...
- * Maybe we don't really need to, since we're also
- * printing out ink levels
- */
- for (j = 0; j < total_param_count; i++)
+ for (j = 0; j < total_param_count; j++)
{
param = (unsigned) buf[i + j + 2];
- switch (param)
- {
- case 0x10:
- printf(_("Warning: Black Ink Low\n"));
- break;
- case 0x11:
- printf(_("Warning: Black Ink Low\n"));
- break;
- case 0x12:
- printf(_("Warning: Black Ink Low\n"));
- break;
- case 0x13:
- printf(_("Warning: Black Ink Low\n"));
- break;
- case 0x14:
- printf(_("Warning: Black Ink Low\n"));
- break;
- case 0x15:
- printf(_("Warning: Black Ink Low\n"));
- break;
- default:
- printf(_("Warning: Unknown (%d)\n"), param);
- break;
- }
+ print_warning(param, color_list);
}
-#endif
break;
case 0x19: /* Job name */
if (total_param_count > 5)
@@ -1324,6 +1365,7 @@ do_new_status(status_cmd_t cmd, char *buf, int bytes,
}
i += total_param_count + 2;
}
+ stp_parameter_description_destroy(&desc);
exit(0);
}