Hello community,
here is the log from the commit of package filters
checked in at Mon Aug 14 18:23:40 CEST 2006.
--------
--- filters/filters.changes 2006-05-18 16:50:40.000000000 +0200
+++ filters/filters.changes 2006-08-14 17:21:23.000000000 +0200
@@ -1,0 +2,5 @@
+Mon Aug 14 17:20:08 CEST 2006 - werner@suse.de
+
+- Update Minolta filter progam min12xxw-0.0.9 (bug #198661)
+
+-------------------------------------------------------------------
Old:
----
min12xxw-0.0.7.dif
min12xxw-0.0.7.tar.bz2
New:
----
min12xxw-0.0.9.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ filters.spec ++++++
--- /var/tmp/diff_new_pack.Agua45/_old 2006-08-14 18:23:10.000000000 +0200
+++ /var/tmp/diff_new_pack.Agua45/_new 2006-08-14 18:23:10.000000000 +0200
@@ -1,5 +1,5 @@
#
-# spec file for package filters (Version 2006.5.18)
+# spec file for package filters (Version 2006.8.14)
#
# Copyright (c) 2006 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
@@ -18,7 +18,7 @@
Requires: ghostscript_any
Autoreqprov: on
Summary: Printer Filters for HP, Lexmark, CaPSL, Citizen, and Apple
-Version: 2006.5.18
+Version: 2006.8.14
Release: 1
BuildRoot: %{_tmppath}/%{name}-%{version}-build
URL: http://sourceforge.net/projects/pnm2ppa
@@ -31,7 +31,7 @@
Source6: ppmtomd-1.2.tar.bz2
Source7: stylewriter.tar.gz
Source8: foo2zjs.tar.bz2
-Source9: min12xxw-0.0.7.tar.bz2
+Source9: min12xxw-0.0.9.tar.bz2
Patch0: pnm2ppa-1.12.dif
Patch1: c2070-0.99.dif
Patch2: LexZ11-distro.dif
@@ -41,7 +41,7 @@
Patch6: ppmtomd-1.2.dif
Patch7: stylewriter.dif
Patch8: foo2zjs.dif
-Patch9: min12xxw-0.0.7.dif
+#Patch9: min12xxw-0.0.9.dif
%description
This package includes several converters for printers from HP, Lexmark,
@@ -89,7 +89,7 @@
%patch -P 8 -p 0
popd
pushd ../min12xxw*
-%patch -P 9 -p 0
+#%patch -P 9 -p 0
popd
%build
@@ -218,6 +218,8 @@
%doc %{_docdir}/%{name}/
%changelog -n filters
+* Mon Aug 14 2006 - werner@suse.de
+- Update Minolta filter progam min12xxw-0.0.9 (bug #198661)
* Thu May 18 2006 - schwab@suse.de
- Don't build as root.
- Don't strip binaries.
++++++ min12xxw-0.0.7.tar.bz2 -> min12xxw-0.0.9.tar.bz2 ++++++
++++ 2720 lines of diff (skipped)
++++ retrying with extended exclude list
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/min12xxw-0.0.7/COPYING new/min12xxw-0.0.9/COPYING
--- old/min12xxw-0.0.7/COPYING 2004-10-06 14:05:58.000000000 +0200
+++ new/min12xxw-0.0.9/COPYING 2005-05-05 22:01:35.000000000 +0200
@@ -2,18 +2,10 @@
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
+ 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
-The Free Software Foundation has exempted Bash from the requirement of
-Paragraph 2c of the General Public License. This is to say, there is
-no requirement for Bash to print a notice when it is started
-interactively in the usual way. We made this exception because users
-and standards expect shells not to print such messages. This
-exception applies to any program that serves as a shell and that is
-based primarily on Bash as opposed to other GNU software.
-
Preamble
The licenses for most software are designed to take away your
@@ -287,7 +279,7 @@
END OF TERMS AND CONDITIONS
- Appendix: How to Apply These Terms to Your New Programs
+ How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
@@ -299,7 +291,7 @@
the "copyright" line and a pointer to where the full notice is found.
- Copyright (C) 19yy <name of author>
+ Copyright (C) <year> <name of author>
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
@@ -313,14 +305,15 @@
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 St, Fifth Floor, Boston, MA 02110-1301 USA
+
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
- Gnomovision version 69, Copyright (C) 19yy name of author
+ Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/min12xxw-0.0.7/ChangeLog new/min12xxw-0.0.9/ChangeLog
--- old/min12xxw-0.0.7/ChangeLog 2005-04-11 22:03:51.000000000 +0200
+++ new/min12xxw-0.0.9/ChangeLog 2005-12-28 23:49:59.000000000 +0100
@@ -42,3 +42,26 @@
resulting in cleaner support for BSD-like systems which have
fgetln instead of getline. Min12xxw used to build on MaxOS X,
now it works on Mac OS X as well. ;) No functional changes.
+
+v. 0.0.8 (Aug 5 2005) a few fixes making the code (hopefully) 64-bit
+ clean. Check for gettext in libintl or standard C library is
+ now done - compiling on NetBSD should be possible now. Apart
+ from that no functional changes.
+
+v. 0.0.9 (Dec 31 2005) a few code cleanups here and there, fixed a bug
+ that was triggered by pages with very small dimensions (thanks
+ go to Ben Cooper for his bug report), initial support for the
+ 1400W model (thanks go to Krishnaprasad for asking me to do
+ it, and to Konica-Minolta in the Netherlands because it was
+ the only web site that I managed to download a windoof driver
+ from so I could have a look at the raw printer data produced
+ by the windoof driver, besides I wish to thank the qemu
+ developers for writing a virtual machine that allows one to
+ drink a tea or two but not to grow a beard while waiting for
+ the windoof 98 installation to complete on a G3 330 MHz)
+ also updated esc-m, an utility to dump the raw data format
+ used by all supported printers in a more human-readable way
+ still, esc-m remains a hack and should only be used to
+ analyse and debug raw data if really neccessary, for example
+ raw data produced by windoof drivers for new models that
+ min12xxw does not (yet) support
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/min12xxw-0.0.7/FAQ new/min12xxw-0.0.9/FAQ
--- old/min12xxw-0.0.7/FAQ 2004-10-08 12:58:28.000000000 +0200
+++ new/min12xxw-0.0.9/FAQ 2005-12-31 15:01:03.000000000 +0100
@@ -65,7 +65,7 @@
are actually using (e.g. if you have a 1250W, it should read ... -m 1250W ...)
If you have more than one printer connected, or have several parallel ports,
you may also have to use something like /dev/lp1 or /dev/usb/lp2 instead.
-Usually, the defaults are just file. Note that you have to be root to use the
+Usually, the defaults are just fine. Note that you have to be root to use the
driver in this way because it talks directly to the printer. You should see a
message indicating the printer model, status, and how many pages it has
already printed in its life. (See below for an example.) Please note that on
@@ -90,6 +90,10 @@
This means that the driver talks to your PC.
+Please do also note that the procedure described above may or may not work on
+other operating systems. If you know how to make things work on your platform,
+feedback would be greatly appreciated.
+
3. I've built min12xxw, how do I get my documents to print?
@@ -143,6 +147,11 @@
man min12xxw
+This manual page will also give you the neccessary details to print without
+a spooling system for testing purposes, see the example given in the man
+page and tailor it to your situation (adjust printer model, resolution,
+paper size and tray used, and the filenames).
+
4. When I print multiple documents one right after the other, some pages are
incomplete, blank or missing. What's happening?
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/min12xxw-0.0.7/Makefile.am new/min12xxw-0.0.9/Makefile.am
--- old/min12xxw-0.0.7/Makefile.am 2004-10-06 14:28:29.000000000 +0200
+++ new/min12xxw-0.0.9/Makefile.am 2005-12-30 23:48:40.000000000 +0100
@@ -1,4 +1,10 @@
bin_PROGRAMS = min12xxw esc-m
man_MANS = min12xxw.1
-min12xxw_SOURCES = min12xxw.c getopt.c getopt1.c getline.c
+dist_man_MANS = min12xxw.1
+min12xxw_SOURCES = min12xxw.c getopt.c getopt.h getopt1.c getline.c getline.h
esc_m_SOURCES = esc-m.c
+# make sure a few extra files are included in the distribution tarballs
+EXTRA_DIST = FAQ README.OSX format.txt usblogs
+# but don't include subversion files
+dist-hook:
+ rm -rf `find $(distdir)/usblogs -name '.svn'`
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/min12xxw-0.0.7/README new/min12xxw-0.0.9/README
--- old/min12xxw-0.0.7/README 2004-10-06 14:28:29.000000000 +0200
+++ new/min12xxw-0.0.9/README 2005-12-30 11:50:00.000000000 +0100
@@ -1,10 +1,10 @@
This is min12xxw, a filter to convert pbmraw data such as produced by
-ghostscript to the printer language of Minolta 1[23]xx W printers.
+ghostscript to the printer language of Minolta 1[234]xx W printers.
It is based on an initial driver by Adam Bocim .
-Support for the newer 13xxW models is not tested by me because I do not
-have such a printer. However, I have had reports confirming that it also
-works increasingly well.
+Support for the newer 13xxW and 1400W models is not tested by me because
+I do not have such a printer. However, I have had reports confirming that
+it also works increasingly well.
Building and installing:
@@ -46,6 +46,20 @@
driven by this filter. I noticed support for PagePro 13xxW would be possible
using this approach.
+I've had reports by people using min12xxw on at least the following machines
+and under the following operating systems:
+
+ - Linux (x86, amd64, ppc)
+ - FreeBSD (x86, amd64)
+ - OS X (ppc)
+ - NetBSD (sparc64)
+ - Solaris (sparc64)
+
+This list is probably not complete, and the order in which the items are
+mentioned does not mean that the author prefers a certain platfrom or
+operating system. If you use min12xxw on a platform that is not listed
+here, please drop me an e-mail so I can include the information here.
+
Thanks:
@@ -61,6 +75,8 @@
developing the support for the PagePro 1350W. His patience when testing
things out was enormous. He really deserves a big THANKS.
+Krishnaprasad encouraged me to support the PagePro 1400W and helped testing
+the new code.
Happy printing!
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/min12xxw-0.0.7/README.OSX new/min12xxw-0.0.9/README.OSX
--- old/min12xxw-0.0.7/README.OSX 1970-01-01 01:00:00.000000000 +0100
+++ new/min12xxw-0.0.9/README.OSX 2005-05-03 22:58:30.000000000 +0200
@@ -0,0 +1,96 @@
+The following message was sent to www.linuxprinting.org Minolta forum
+by Marc Cerisier. He describes the steps he needed to perform on his
+system to get hin Minolta PagePro 1350W to work. Because I haven't got
+MacOS X on any computer, I can't test it and give instructions on how
+to get things going, Marc has kindly given me permission to include his
+post here, so others can use it as a starting point. The steps you may
+have to perform need not neccessarily match his' in all details, but the
+general outline should be similar.
+Anyway, I hope this bit of information is helpful...
+
+Manuel
+
+[Original message follows:]
+From: cerisier@mc.edu (Marc Cerisier)
+Newsgroups: linuxprinting.minolta.general
+Date: Mon, 2 May 2005 17:03:17 +0000 (UTC)
+Organization: http://www.linuxprinting.org/
+To: minolta-list@linuxprinting.org
+Subject: [lp.minolta] Instructions for installing a PagePro 1350W on Mac OS X
+
+These instructions are the fruit of my own struggle to install this printer on
+my mother's Mini Mac. Hope they help. I sure wish these were available before
+I started.
+
+-Marc Cerisier
+
+
+To install a Minolta PagePro 1350W on Mac OS 10.3.8:
+
+1) PREPARE THE DEVELOPMENT ENVIRONMENT
+
+If you've never installed the development tools (Xcode), install them as you
+will need the compiler(gcc). The version of autoconf and automake are not
+current enough for the min12xxw driver, though, so you need to compile new
+versions of those packages. Here are the links:
+
+www.gnu.org/software/autoconf/
+www.gnu.org/software/automake/
+
+You need to build the new autoconf before automake.
+
+The build process is similar for both, and will also be the same for min12xxw:
+
+tar zxf <downloaded file>
+cd <new directory>
+/configure
+make
+make install
+
+In both instances, the new files are installed into /usr/local/bin/, which
+isn't in the path by default, so first, add it to the path
+(PATH="$PATH:/usr/local/bin"), and then rename all of the files in /usr/bin/
+that have new versions in /usr/local/bin/. As soon as you type 'make install',
+you will see which files were created by that build, and those are the ones
+that need to be renamed. If you don't rename them(or delete them), the build
+process for minn12xxw will see the old versions before the new ones of the same
+name since /usr/bin/ occurs before /usr/local/bin/ in the path.
+
+2) BUILD MIN12XXW
+
+Get the driver here:
+
+http://www.hinterbergen.de/mala/min12xxw/
+
+Using the build process outlined in the above step, this should happen without
+flaw. The driver will be installed to /usr/local/bin/.
+
+You also need to get the PPD file for the printer. Do so here:
+
+http://www.linuxprinting.org/show_driver.cgi?driver=min12xxw
+
+Place the PPD in this folder:
+
+/Library/Printers/PPDs/Contents/Resources/en.lproj
+
+3) INSTALL PRINTER
+
+First, restart the CUPS system with this command - 'killall -HUP cupsd'. Next
+open the Printer Setup Utility (in /Applications/Utilities). Since the os
+cannot directly recognize the driver, you have add the printer with the
+advanced option. Do this by holding down the option key, and clicking Add in
+the Printer Setup Utility. When the new widow opens, select Advanced from the
+very first popup menu (the one that selects the connection method). In the
+Device popup menu, look for your printer--should be at the bottom of the menu.
+When you select your printer (mine was called PP1350W), the Device Name &
+Device URI fields are filled in for you. On the Printer Model popup menu,
+select Minolta, and when you do so, the PPD you installed should appear below.
+Be sure it's selected, and click add.
+
+Your printer should now work! By substituting another PPD, these instructions
+should work for the other printers that use this driver.
+_______________________________________________
+Minolta-list mailing list
+Minolta-list@linuxprinting.org
+http://www.linuxprinting.org/cgi-bin/mailman/listinfo/minolta-list
+
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/min12xxw-0.0.7/config.h.in new/min12xxw-0.0.9/config.h.in
--- old/min12xxw-0.0.7/config.h.in 2005-03-28 18:20:11.000000000 +0200
+++ new/min12xxw-0.0.9/config.h.in 2005-12-29 01:59:51.000000000 +0100
@@ -6,9 +6,15 @@
/* Define to 1 if you have the `getline' function. */
#undef HAVE_GETLINE
+/* Define to 1 if you have the `gettext' function. */
+#undef HAVE_GETTEXT
+
/* Define to 1 if you have the header file. */
#undef HAVE_INTTYPES_H
+/* Define to 1 if you have the `intl' library (-lintl). */
+#undef HAVE_LIBINTL
+
/* Define to 1 if you have the header file. */
#undef HAVE_LIBINTL_H
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/min12xxw-0.0.7/configure.ac new/min12xxw-0.0.9/configure.ac
--- old/min12xxw-0.0.7/configure.ac 2005-04-11 21:56:04.000000000 +0200
+++ new/min12xxw-0.0.9/configure.ac 2005-12-28 23:50:26.000000000 +0100
@@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.59)
-AC_INIT([min12xxw], [0.0.7], [mala@hinterbergen.de])
+AC_INIT([min12xxw], [0.0.9], [mala@hinterbergen.de])
AM_INIT_AUTOMAKE
AC_CONFIG_SRCDIR([min12xxw.c])
AM_CONFIG_HEADER([config.h])
@@ -12,6 +12,7 @@
AC_PROG_INSTALL
# Checks for libraries.
+AC_CHECK_LIB(intl, gettext)
# Checks for header files.
AC_HEADER_STDC
@@ -24,7 +25,7 @@
# Checks for library functions.
AC_FUNC_MALLOC
AC_FUNC_REALLOC
-AC_CHECK_FUNCS([memmove memset strcasecmp strchr getline fgetln])
+AC_CHECK_FUNCS([memmove memset strcasecmp strchr getline fgetln gettext])
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/min12xxw-0.0.7/esc-m.c new/min12xxw-0.0.9/esc-m.c
--- old/min12xxw-0.0.7/esc-m.c 2004-10-06 14:11:54.000000000 +0200
+++ new/min12xxw-0.0.9/esc-m.c 2005-12-31 13:29:40.000000000 +0100
@@ -1,6 +1,6 @@
/* esc-m.c - try to parse minolta pagepro 1200 w printer data files
*
- * Copyright (C) 2004 Manuel Tobias Schiller
+ * Copyright (C) 2004, 2005 Manuel Tobias Schiller
*
* 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
@@ -14,7 +14,7 @@
*
* 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.
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/*
* this little program was meant to make understanding the output
@@ -39,7 +39,7 @@
/* file position ans sequence number */
static int i = 0, sq = 0;
/* current resolution */
-static int gl_res = -1;
+static int gl_res = -1, gl_res_h = -1;
/* page dimensions in dots at current resolution */
static int gl_x, gl_y;
/* paper tray */
@@ -77,8 +77,8 @@
static void dump50(unsigned char *data)
{
- char *res, *ptype;
- unsigned char r, p;
+ char *res, *ptype, *rmstr;
+ unsigned char r, p, rm;
int lb;
lb = data[3];
@@ -91,6 +91,9 @@
dumpraw(data);
return;
}
+ /* we dump the raw data nevertheless to make is easier to spot
+ * format changes when Minolta introduces a new model... */
+ dumpraw(data);
data += 6;
@@ -108,7 +111,21 @@
res = "unknown"; gl_res = -1;
break;
}
- data += 2; /* next two bytes seem to be don't care data */
+ switch (rm = *data++) {
+ case 0:
+ rmstr = "none";
+ gl_res_h = gl_res;
+ break;
+ case 1:
+ rmstr = "double horizontal resolution";
+ gl_res_h = gl_res * 2;
+ break;
+ default:
+ rmstr = "unknown horizontal resolution modifier";
+ gl_res_h = -1;
+ break;
+ }
+ data += 1; /* next two bytes seem to be don't care data */
switch (p = *data++) {
case 0:
ptype = "normal paper";
@@ -129,6 +146,8 @@
/* next four bytes seem to be don't care data */
printf("\tresolution code %02x (%s)\n", r, res);
+ printf("\thorizontal resolution modifier: %02x (%s)\n", rm, rmstr);
+ printf("\teffective resolution is %d x %d dpi\n", gl_res_h, gl_res);
printf("\tpaper code %02x (%s)\n\n", p, ptype);
}
@@ -147,14 +166,16 @@
dumpraw(data);
return;
}
+ /* we dump the raw data nevertheless to make is easier to spot
+ * format changes when Minolta introduces a new model... */
+ dumpraw(data);
data += 6;
data += 2; /* seems to be don't care data */
gl_x = getdword(data); data += 4;
gl_y = getdword(data); data += 4;
data += 4; /* seems to be don't care data */
- gl_tray = *data;
- switch (*data++) {
+ switch (gl_tray = *data++) {
case 0xff:
tray = "auto"; break;
case 0x00:
@@ -166,8 +187,7 @@
default:
tray = "unknown"; break;
}
- gl_pformat = *data;
- switch (*data) {
+ switch (gl_pformat = *data) {
default:
pformat = "unknown"; break;
case 0x04:
@@ -224,9 +244,9 @@
printf("\tpaper format is %02x (%s).\n", gl_pformat, pformat);
printf("\tpage size is %d x %d dots (%.3lf x %.3lf \" or %.2lf x %.2lf mm).\n",
gl_x, gl_y,
- (double) gl_x / (double) gl_res,
+ (double) gl_x / (double) gl_res_h,
(double) gl_y / (double) gl_res,
- 25.4 * (double) gl_x / (double) gl_res,
+ 25.4 * (double) gl_x / (double) gl_res_h,
25.4 * (double) gl_y / (double) gl_res);
printf("\tpaper tray id %02x (%s)\n\n", gl_tray, tray);
}
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/min12xxw-0.0.7/format.txt new/min12xxw-0.0.9/format.txt
--- old/min12xxw-0.0.7/format.txt 2004-10-06 14:11:54.000000000 +0200
+++ new/min12xxw-0.0.9/format.txt 2005-12-30 12:10:16.000000000 +0100
@@ -1,4 +1,4 @@
-This is what I found out about the Minolta Pagepro 1[23]xxW ESC codes:
+This is what I found out about the Minolta Pagepro 1[234]xxW ESC codes:
(The information contained in this document may be wrong or inaccurate,
this is only what I guessed by looking at the output of the windoof
driver and by monitoring the traffic to and from the printer I have)
@@ -9,7 +9,7 @@
cmd printer command
sq sequence number for all ESC sequences in print job, starting
with 00
- lb word: length of command data in bytes (a word is 2 bytes!)
+ lw word: length of command data in bytes (a word is 2 bytes!)
ck byte: sum over all bytes of the ESC sequence modulo 256
(... or AND the result with 0xff if you like that better)
@@ -34,6 +34,8 @@
------------------------------------------------------------------------------
model byte 81 - Minolta PagePro 12xxW series
83 - Minolta PagePro 13xxW series
+ 86 - Minolta PagePro 1400W (and maybe later
+ models)
* data 00 (this data is required!)
------------------------------------------------------------------------------
@@ -73,6 +75,7 @@
* data 04 00 00 00 (for Minolta PagePro 12xxW)
04 00 04 00 (for Minolta PagePro 13xxW)
+ 04 00 04 00 (for Minolta PagePro 1400W, too)
12xxW models seem to accept 04 00 04 00...
@@ -193,7 +196,8 @@
command 6a (alternate read printer register (?))
------------------------------------------------------------------------------
* data 78 00 04 (on 1200W)
- 1c 00 04 (on 1350W)
+ 1c 00 04 (on 1350W, seems to work on 1400W
+ and 1200W as well)
very little is known about this command. reading two chunks on the
1200W will have register 0x53 in the second chunk (page counter!)
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/min12xxw-0.0.7/getline.c new/min12xxw-0.0.9/getline.c
--- old/min12xxw-0.0.7/getline.c 2005-03-28 18:37:56.000000000 +0200
+++ new/min12xxw-0.0.9/getline.c 2005-12-31 14:23:53.000000000 +0100
@@ -3,6 +3,22 @@
* implements a getline version for systems that don't have it
* for BSDish systems, we use the fgetln libary function, for systems
* which lack it, we do things the hard way
+ *
+ * Copyright (C) 2004-2006 Manuel Tobias Schiller
+ *
+ * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "config.h"
@@ -27,7 +43,7 @@
line = fgetln(f, &len);
/* if there was an error, we bail out */
- if (ferror(f)) return -1;
+ if (ferror(f) || !line) return -1;
/* if we couldn't read anything and we have reached EOF, we give up */
if (!len && feof(f)) return -1;
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/min12xxw-0.0.7/getline.h new/min12xxw-0.0.9/getline.h
--- old/min12xxw-0.0.7/getline.h 2004-10-06 14:28:29.000000000 +0200
+++ new/min12xxw-0.0.9/getline.h 2005-12-31 14:25:30.000000000 +0100
@@ -1,4 +1,20 @@
/* getline.h header file to declare a prototype for getline
+ *
+ * Copyright (C) 2004-2006 Manuel Tobias Schiller
+ *
+ * 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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _GETLINE_H
@@ -6,7 +22,7 @@
/* we may include this by accident, so we check if we really need to
* declare the prototype... */
-#include
+#include "config.h"
#ifndef HAVE_GETLINE
#include /* for size_t */
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/min12xxw-0.0.7/getopt.c new/min12xxw-0.0.9/getopt.c
--- old/min12xxw-0.0.7/getopt.c 2004-10-06 14:28:29.000000000 +0200
+++ new/min12xxw-0.0.9/getopt.c 2005-12-31 13:31:08.000000000 +0100
@@ -17,7 +17,7 @@
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. */
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
/* This tells Alpha OSF/1 not to define a getopt prototype in .
Ditto for AIX 3.2 and . */
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/min12xxw-0.0.7/getopt.h new/min12xxw-0.0.9/getopt.h
--- old/min12xxw-0.0.7/getopt.h 2004-10-06 14:28:29.000000000 +0200
+++ new/min12xxw-0.0.9/getopt.h 2005-12-31 13:31:42.000000000 +0100
@@ -14,8 +14,8 @@
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 St, Fifth Floor, Boston, MA 02110-1301
+ USA */
#ifndef _GETOPT_H
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/min12xxw-0.0.7/getopt1.c new/min12xxw-0.0.9/getopt1.c
--- old/min12xxw-0.0.7/getopt1.c 2004-10-06 14:28:29.000000000 +0200
+++ new/min12xxw-0.0.9/getopt1.c 2005-12-31 13:32:06.000000000 +0100
@@ -16,7 +16,7 @@
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. */
+ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */
#ifdef HAVE_CONFIG_H
#include
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/min12xxw-0.0.7/min12xxw.1 new/min12xxw-0.0.9/min12xxw.1
--- old/min12xxw-0.0.7/min12xxw.1 2004-10-06 14:28:29.000000000 +0200
+++ new/min12xxw-0.0.9/min12xxw.1 2005-12-31 15:05:20.000000000 +0100
@@ -1,4 +1,4 @@
-.TH MIN12XXW 1 "July 2004" "Local Utilities"
+.TH MIN12XXW 1 "December 2005" "Local Utilities"
.SH NAME
min12xxw \- Convert pbmraw streams to Minolta PagePro 12xxW languages
.SH SYNOPSIS
@@ -9,7 +9,7 @@
.B Min12xxw
is a filter which converts pbmraw streams (produced by ghostscript,
-for example) to the printer language of Minolta PagePro 1[23]xxW
+for example) to the printer language of Minolta PagePro 1[234]xxW
printers.
.PP
@@ -42,30 +42,41 @@
not be busy printing (or your print job may be truncated). See the
.B -d
option below which sets the device file to use. This has so far only been
-tested on 1200W and 1350W printers. Send mail if it works for others as well.
+tested on 1200W, 1350W and 1400W printers. Send mail if it works for
+others as well.
.TP .5i
.B -d dev, --device dev
Sets the device file to use for queries. The default is /dev/lp0.
+Please note that this option is only meaningful with the "-s" or "--status"
+option. If you intend to send a document to the printer, you have to
+redirect min12xxw's standard output to the device file in question. See
+the documentation that came with your shell on how to do that.
+
.TP .5i
.B -n, --nomargins
Disables the enforcement of the 0.17 inch margins on all sides of the
paper. The converter discards the equivalent of this length of its input
because ghostscript outputs a full page with margins. If you arranged in
some way for the input to be marginless, or have slightly larger paper,
-you can give this option to include the full input with margins.
+you can give this option to include the full input with margins. Please
+note that for very small page dimensions, min12xxw might need to disable
+enforcing the page margins for all pages following the offending page to
+make the job printable. In that case, a warning message will be printed
+on the standard error stream to inform the user.
.TP .5i
.B -m model, --model model
Sets which printer model to produce output for. Currently, no checks for
features only available to specific models are made (available paper trays
differ from model to model, for example). Let me know if this causes
-problems. Available models are: 1200W, 1250W, 1300W, 1350W. 1200W is the
-default. As an alternative, you can also symlink, link or rename your
-executable to min1200w, min1250w, min1300w or min1350w, thus making the
-model specified in the filename the default model. This saves you from
-typing the model selection option again and again and again...
+problems. Available models are: 1200W, 1250W, 1300W, 1350W, 1400W. 1200W
+is the default. As an alternative, you can also symlink, link or rename
+your executable to min1200w, min1250w, min1300w, min1350w or min1400w,
+thus making the model specified in the filename the default model. This
+saves you from typing the model selection option again and again and
+again...
Please note that you
.B must
supply the model option correctly if you drive any other model than what
@@ -81,22 +92,23 @@
resolution may be once or twice the vertical resolution. The maximum
resolution is 1200 dpi in both vertical and horizontal direction. The
minimum vertical resolution for mixed resolution printing seems to be
-600 dpi. 300 dpi printing has only been tested on 1200W and 1350W
-models. Mixed resolution printing was seen for 13xxW models only, but
-tests show that the 1200W is capable of handling it as well, so chances
-are that 1250W printers won't have trouble, either.
+600 dpi. 300 dpi printing has only been tested on 1200W, 1350W and 1400W
+models. Mixed resolution printing was seen for 13xxW and 1400W models
+only, but tests show that the 1200W is capable of handling it as well,
+so chances are that 1250W printers won't have trouble, either.
.TP .5i
.B -t tray, --tray tray
Sets the paper tray to be used. Valid values for tray are "auto",
"tray1", "tray2" and "manual", with "auto" being the default. Not all
-printer models have all sorts of paper trays. "tray1" should be safe on
-all of them, I think.
+printer models have all sorts of paper trays. "auto" should be safe on
+all of them, I think. In fact, the PagePro 1400W seems to have only this
+kind of paper tray.
.TP .5i
.B -p type, --papertype type
Sets the type of paper used. Type can be one of "normal", "thick",
-"envelope" or "postcard". "normal" is the default.
+"transparency", "envelope" or "postcard". "normal" is the default.
.TP .5i
.B -f fmt, --paperformat fmt
@@ -277,8 +289,12 @@
have comments to make or know more about the format than I do, please
share your thoughts and your knowledge.
-13xxW series support is not heavily tested yet. Send mail with feedback
-if you have such a printer and it works or you experience problems.
+13xxW series support seems to be relatively well tested by now. Send mail
+with feedback if you have such a printer and you experience problems.
+
+1400W support is pretty new - please send e-mail if it works or if you
+run into problems. Feedback on models for which support has just been
+completed is very important to improve and stabilise this support.
Bugs and problems reports are generally welcome because I just don't
have the time to test everything out. I needed a filter and here it
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore --exclude Makefile.in --exclude configure --exclude config.guess --exclude '*.pot' --exclude mkinstalldirs --exclude aclocal.m4 --exclude config.sub --exclude depcomp --exclude install-sh --exclude ltmain.sh old/min12xxw-0.0.7/min12xxw.c new/min12xxw-0.0.9/min12xxw.c
--- old/min12xxw-0.0.7/min12xxw.c 2005-03-28 18:46:44.000000000 +0200
+++ new/min12xxw-0.0.9/min12xxw.c 2005-12-31 14:50:48.000000000 +0100
@@ -1,9 +1,9 @@
-/* min12xxw.c driver for minolta pagepro 1[23]xxW printers
+/* min12xxw.c driver for minolta pagepro 1[234]xxW printers
*
* It converts pages in pbmraw format read from stdin to the printer
- * language used by Minolta PagePro 1[23]00W. The output goes to stdout.
+ * language used by Minolta PagePro 1[234]00W. The output goes to stdout.
*
- * Copyright (C) 2004 Manuel Tobias Schiller
+ * Copyright (C) 2004-2006 Manuel Tobias Schiller
*
* 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
@@ -17,7 +17,7 @@
*
* 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.
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
/* Note: This program was written without any documentation from the
* manufacturer. The description of the printer language may be
@@ -38,7 +38,7 @@
/* see the file CHANGELOG for a list of changes between revisions.
*/
-#include
+#include "config.h"
#define _GNU_SOURCE /* we might need this because we use getline */
#include
@@ -46,8 +46,8 @@
#include
#include
#include
-#include /* usleep */
-#include /* fstat */
+#include /* usleep */
+#include /* fstat */
#include
/* include the inttypes.h for uint8_t and similar types */
@@ -72,17 +72,17 @@
#define MAX(x, y) (((x) > (y))?(x):(y))
#endif
-static char *version = "version " PACKAGE_VERSION " ($Id: min12xxw.c 48 2005-03-28 16:46:44Z mala $)";
+/* we wish to know what version we are ;) */
+static char *versionstr = "version " PACKAGE_VERSION " ($Id: min12xxw.c 115 2005-12-31 13:50:48Z mala $)";
/* defaults used for the output */
static int ptype = 0x00; /* normal paper */
static int pformat = 0x04; /* a4 */
-static int res = 1; /* 600 dpi */
+static int res = 0x0001; /* 600 dpi, horizontal resolution not doubled */
static int tray = 0xff; /* auto select paper tray */
static int nomargins = 0; /* if flag is set, margins are not enforced */
static int ecomode = 0; /* if set, toner-saving mode is enabled */
static int model = 0x81; /* 12xxW series printers are the default */
-static int hresdbl = 0; /* don't double horizontal resolution */
static char *device = "/dev/lp0"; /* default device used for queries */
/* try to exit gracefully in case of fatal errors */
@@ -209,7 +209,10 @@
{
uint8_t buf[3];
- buf[0] = ((model == 0x83)?(0x1c):(0x78));
+ /* FIXME: until we know better, we'll just treat the 1400W as a
+ * better 13xxW here - testers report that this seems to work
+ * well */
+ buf[0] = (((model == 0x83) || (model == 0x86))?(0x1c):(0x78));
buf[1] = 0;
buf[2] = 0x04;
do_cmd(out, 0x6a, 3, buf);
@@ -340,13 +343,13 @@
do_start(out); /* start-of-printer-commands command */
- cmdbuf[0] = (uint8_t) res; /* set resolution and paper type */
+ cmdbuf[0] = (uint8_t) (res & 0xff); /* set resolution and paper type */
+ /* check if we are to use doubled horizontal resolution */
+ cmdbuf[1] = (uint8_t) (res >> 8);
cmdbuf[3] = (uint8_t) ptype;
cmdbuf[4] = 0x04;
- /* 13xxW series models might expect an 0x04 in cmdbuf[6] as well */
- if (model == 0x83) cmdbuf[6] = 0x04;
- /* check if we are to use doubled horizontal resolution */
- if (hresdbl) cmdbuf[1] = 0x01;
+ /* 1[34]xxW series models might expect an 0x04 in cmdbuf[6] as well */
+ if ((model == 0x83) || (model == 0x86)) cmdbuf[6] = 0x04;
do_cmd(out, 0x50, 8, cmdbuf); /* issue it */
}
@@ -372,7 +375,7 @@
*p++ = y & 0xff; *p++ = (y >> 8) & 0xff;
*p++ = 0x08; p++; *p++ = 0x08; p++;
*p++ = tray; *p++ = pformat;
- if (res == 0) {
+ if ((res & 0xff) == 0) {
/* apparently, 300 dpi needs special flags set here */
cmdbuf[20] = 0xc0;
}
@@ -545,7 +548,7 @@
uint32_t yy, yc; /* counters */
/* this controls how many pixels are skipped on each side of a
* sheet of paper to keep the margins that the printer expects */
- int skip = ((nomargins == 0)?skiptbl[res]:0);
+ int skip = ((nomargins == 0)?skiptbl[res & 0xff]:0);
int i; /* counter */
int ecofl = 0; /* flag used for toner-saving mode */
@@ -610,7 +613,7 @@
char *line = NULL; /* buffer for reading whole lines from the input */
size_t llen = 0; /* length of line buffer */
/* how much to skip because of margins */
- int skip = ((nomargins == 0)?(16 * skiptbl[res]):0);
+ int skip = ((nomargins == 0)?(16 * skiptbl[res & 0xff]):0);
/* send the printer a start-of-job/set-resolution-and-papertype
* sequence */
@@ -622,19 +625,40 @@
if (getline(&line, &llen, in) == -1) break;
/* check for valid pbmraw signature */
if ((line[0] != 'P') || (line[1] != '4'))
- fatal("min12xxw: input is not valid pbmraw");
+ fatal("min12xxw: input is not valid pbmraw "
+ "(no valid signature)");
/* read in comment lines and the line containing the
* resolution */
do {
if (getline(&line, &llen, in) == -1)
- fatal("min12xxw: input is not valid pbmraw");
+ fatal("min12xxw: input is not valid pbmraw "
+ "(premature end of file)");
} while (line[0] == '#');
/* parse resolution */
- if (sscanf(line, "%lu %lu", (unsigned long *) &x, \
- (unsigned long *) &y) != 2)
- fatal("min12xxw: input is not valid pbmraw");
+ {
+ /* this ugly hack is needed to make things work
+ * on 64 bit platforms like sparc64 or amd64 */
+ unsigned long lx, ly;
+ if (sscanf(line, "%lu %lu", &lx, &ly) != 2)
+ fatal("min12xxw: input is not valid pbmraw "
+ "(ill formatted bitmap dimensions)");
+ x = lx; y = ly;
+ }
/* scanlines are byte-aligned - adjust x accordingly */
if (x & 0x7) x = 8 + (x & ~0x7);
+ /* check if the page dimensions are so small that we need
+ * switch of the margins
+ * many thanks go to Ben Cooper who alerted me to the
+ * problem */
+ if ((((y - skip) / 8) <= skip) || (x <= (2 * skip))) {
+ if (!nomargins)
+ fprintf(stderr, "min12xxw: page dimensions"
+ " are so small that I won't "
+ "enforce page margins for this and"
+ "all subsequent pages!\n");
+ nomargins = 1;
+ skip = 0;
+ }
/* tell the printer to start a new page - note the page
* dimensions are reduced because we need to take the
@@ -655,44 +679,9 @@
/**********************************************************************
* option handling
**********************************************************************/
-/* this procedure gives help */
-static void help()
-{
- fprintf(stderr, "min12xxw - a pbmraw to Milolta PagePro 1[23]xx W " \
- "filter\n\noptions: (defaults are marked with an" \
- " asterisk)\n" \
- "\t-h\t--help\t\t\tthis help\n" \
- "\t-v\t--version\t\tshow version number\n" \
- "\t-d dev\t--device dev\t\tset device to use for " \
- "queries\n" \
- "\t-s\t--status\t\tquery printer status\n" \
- "\t-e\t--ecomode\t\teconomic (toner saving) mode\n" \
- "\t-n\t--nomargins\t\tdisable enforcement of " \
- "margins\n" \
- "\t-m mod\t--model mod\t\tset the printer model to " \
- "produce output for\n" \
- "\t-r res\t--res res\t\tset resolution\n" \
- "\t-t tray\t--tray tray\t\tset paper tray\n" \
- "\t-p type\t--papertype type\tset paper type" \
- "\n\t-f fmt\t--paperformat fmt\tset paper format\n" \
- "\navailable printer models: 1200W*, 1250W, 1300W, " \
- "1350W\n" \
- "\navailable resolutions in dpi: 300, 600*, 1200\n" \
- "\navailable paper trays: auto*, tray1, tray2, " \
- "manual\n\navailable paper types: normal*, thick, "\
- "envelope, postcard\n" \
- "\navailable paper formats: " \
- "a4*, b5, a5, jpost, corpost,\njisy6, jisy0, "\
- "chinese16k, chinese32k, legal, glegal,\n" \
- "letter, gletter, executive, halfletter, " \
- "envmonarch,\nenv10, envdl, envc5, envc6," \
- "envb5, choukei3gou, choukei5gou,\ncustom, " \
- "envb6, folio, jisy1, jisy2, quadpost\n\n");
- exit(1);
-}
-
/* the next few tables contain the mappings from human-readable strings
- * to id numbers the printer understands */
+ * to id numbers the printer understands (or our routines, for that
+ * matter) */
struct map {
char *str;
int id;
@@ -719,9 +708,92 @@
};
static struct map models[] = {
{ "1200W", 0x81 }, { "1250W", 0x81 },
- { "1300W", 0x83 }, { "1350W", 0x83 }, { NULL, -1 }
+ { "1300W", 0x83 }, { "1350W", 0x83 },
+ { "1400W", 0x86 }, { NULL, -1 }
+};
+static struct map resolutions[] = {
+ { "300", 0x0000 }, { "300x300", 0x0000 },
+ { "600", 0x0001 }, { "600x600", 0x0001 },
+ { "1200", 0x0002 }, { "1200x1200", 0x0002 },
+ { "1200x600", 0x0101 }, { NULL, -1 }
};
+/* this procedure is used by help() below to print available somethings
+ * in a nice and painless way from the maps above
+ * see help() below and everything will become clearer */
+static void printav(char *msg, struct map *m, int defid)
+{
+ int i, n;
+
+ n = printf(msg);
+ /* print all available somethings from our map */
+ for (i = 0; m[i].str != NULL; i++) {
+ /* in case we had to start a new line below, we need to
+ * print a tab here */
+ if (n == 0) {
+ printf("\t");
+ n = 8;
+ }
+ /* print the next something */
+ n += printf("%s", m[i].str);
+ /* is it the default? if so, print "*" */
+ if (m[i].id == defid)
+ n += printf("*");
+ /* print ", " unless it's the last something */
+ if (m[i + 1].str != NULL)
+ n += printf(", ");
+ /* check if we have to start a new line */
+ if (n > 72) {
+ printf("\n");
+ n = 0;
+ }
+ }
+ /* unless the last thing we did was to start a new line, we append
+ * a newline here */
+ if (n != 0) printf("\n");
+}
+
+/* this procedure gives help */
+static void help()
+{
+ printf("min12xxw - a pbmraw to Minolta PagePro 1[234]xx W "
+ "filter\n\noptions: (defaults are marked with an"
+ " asterisk)\n"
+ "\t-h\t--help\t\t\tthis help\n"
+ "\t-v\t--version\t\tshow version number\n"
+ "\t-d dev\t--device dev\t\tset device to use for "
+ "queries (%s by default)\n"
+ "\t-s\t--status\t\tquery printer status\n"
+ "\t-e\t--ecomode\t\teconomic (toner saving) mode\n"
+ "\t-n\t--nomargins\t\tdisable enforcement of margins\n"
+ "\t-m mod\t--model mod\t\tset the printer model to "
+ "produce output for\n"
+ "\t-r res\t--res res\t\tset resolution\n"
+ "\t-t tray\t--tray tray\t\tset paper tray\n"
+ "\t-p type\t--papertype type\tset paper type"
+ "\n\t-f fmt\t--paperformat fmt\tset paper format\n"
+ "\n", device);
+ /* print the available somethings */
+ printav("available models: ", models, model);
+ printav("available resolutions: ", resolutions, res);
+ printav("available paper trays: ", trays, tray);
+ printav("available paper types: ", ptypes, ptype);
+ printav("available paper formats: ", pformats, pformat);
+ printf("\n");
+ exit(0);
+}
+
+/* this procedure prints out version information */
+static void version()
+{
+ printf("min12xxw: %s\n", versionstr);
+ printf("\nCopyright (C) 2004-2006 Manuel Tobias Schiller\n"
+ "This is free software; see the source for copying "
+ "conditions. There is NO\nwarranty; not even for "
+ "MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n");
+ exit(0);
+}
+
/* convert string to id number */
static int getid(struct map *m, char *thing, char *str, int deflt)
{
@@ -733,38 +805,6 @@
return deflt; /* return the default */
}
-/* convert resolution to id number */
-static int getres(char *res)
-{
- int v, h, i;
-
- if ((i = sscanf(res, "%dx%d", &h, &v)) >= 1) {
- if ((i == 2) && (h != v)) {
- if ((2 * v != h) || (v < 600)) {
- /* horizontal must be twice the vertical
- * resolution; vertical resolution less than
- * 600 dpi does not work */
- fprintf(stderr, \
- "min12xxw: unknown resolution: %s\n",
- res);
- return 1;
- }
- hresdbl = 1; /* double horizontal resolution */
- h = v; /* we expect vertical resolutions here */
- }
- switch (h) {
- case 300:
- return 0;
- case 600:
- return 1;
- case 1200:
- return 2;
- }
- }
- fprintf(stderr, "min12xxw: unknown resolution: %s\n", res);
- return 1;
-}
-
/* parse the options given to the filter */
static void parseopts(int argc, char **argv)
{
@@ -785,6 +825,9 @@
};
int optidx = 0, dostate = 0;
int c;
+ int lres = res, lptype = ptype, lpformat = pformat, lmodel = model;
+ int ltray = tray, lnomargins = nomargins, lecomode = ecomode;
+ char *ldevice = device;
opterr = 1; /* let getopt_long do the error reporting */
while (42) { /* this line is for all hitch-hikers out there */
@@ -794,34 +837,33 @@
case 'h':
help();
case 'v':
- printf("min12xxw: %s\n", version);
- exit(0);
+ version();
case 'r':
- res = getres(optarg);
+ lres = getid(resolutions, "resolution", optarg, 0x0001);
break;
case 'p':
- ptype = getid(ptypes, "paper type", optarg, 0);
+ lptype = getid(ptypes, "paper type", optarg, 0);
break;
case 'f':
- pformat = getid(pformats, "paper format", optarg, 4);
+ lpformat = getid(pformats, "paper format", optarg, 4);
break;
case 'm':
- model = getid(models, "printer model", optarg, 0x81);
+ lmodel = getid(models, "printer model", optarg, 0x81);
break;
case 't':
- tray = getid(trays, "tray", optarg, 0xff);
+ ltray = getid(trays, "tray", optarg, 0xff);
break;
case 'n':
- nomargins = 1;
+ lnomargins = 1;
break;
case 'd':
- device = optarg;
+ ldevice = optarg;
break;
case 's':
dostate = 1;
break;
case 'e':
- ecomode = 1;
+ lecomode = 1;
break;
default:
/* getopt_long told the user about the unknown option
@@ -829,6 +871,12 @@
exit(1);
}
}
+ /* copy the local copies of options to the global ones
+ * we need to do this copying to make sure that help sees the
+ * global defaults, not what the users sets with options */
+ res = lres; ptype = lptype; pformat = lpformat; model = lmodel;
+ tray = ltray; nomargins = lnomargins; device = ldevice;
+ ecomode = lecomode;
if (dostate) {
/* process printer queries right away and exit */
FILE *d;
@@ -856,6 +904,7 @@
if (strcmp(str, "min1250w") == 0) model = 0x81;
if (strcmp(str, "min1300w") == 0) model = 0x83;
if (strcmp(str, "min1350w") == 0) model = 0x83;
+ if (strcmp(str, "min1400w") == 0) model = 0x86;
}
/**********************************************************************
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
---------------------------------------------------------------------
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org