evolisprinter-2.2
authorDobrica Pavlinusic <dpavlin@rot13.org>
Thu, 12 Aug 2010 11:46:27 +0000 (13:46 +0200)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Thu, 12 Aug 2010 11:46:27 +0000 (13:46 +0200)
19 files changed:
COPYING [changed from file to symlink]
INSTALL [changed from file to symlink]
Makefile.in
aclocal.m4
configure
configure.in
ppd/evolis-dualysE.ppd.gz [changed mode: 0755->0644]
ppd/evolis-dualysF.ppd.gz [changed mode: 0755->0644]
ppd/evolis-pebbleE.ppd.gz [changed mode: 0755->0644]
ppd/evolis-pebbleF.ppd.gz [changed mode: 0755->0644]
ppd/evolis-quantumE.ppd.gz [changed mode: 0755->0644]
ppd/evolis-quantumF.ppd.gz [changed mode: 0755->0644]
ppd/evolis-securionE.ppd.gz [new file with mode: 0644]
ppd/evolis-securionF.ppd.gz [new file with mode: 0644]
ppd/evolis-tattooE.ppd.gz [changed mode: 0755->0644]
ppd/evolis-tattooF.ppd.gz [changed mode: 0755->0644]
src/Makefile.in
src/cupsevolis.c
src/evolis.c

diff --git a/COPYING b/COPYING
deleted file mode 100644 (file)
index d60c31a97a544b53039088d14fe9114583c0efc3..0000000000000000000000000000000000000000
--- a/COPYING
+++ /dev/null
@@ -1,340 +0,0 @@
-                   GNU GENERAL PUBLIC LICENSE
-                      Version 2, June 1991
-
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
-     59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-                           Preamble
-
-  The licenses for most software are designed to take away your
-freedom to share and change it.  By contrast, the GNU General Public
-License is intended to guarantee your freedom to share and change free
-software--to make sure the software is free for all its users.  This
-General Public License applies to most of the Free Software
-Foundation's software and to any other program whose authors commit to
-using it.  (Some other Free Software Foundation software is covered by
-the GNU Library General Public License instead.)  You can apply it to
-your programs, too.
-
-  When we speak of free software, we are referring to freedom, not
-price.  Our General Public Licenses are designed to make sure that you
-have the freedom to distribute copies of free software (and charge for
-this service if you wish), that you receive source code or can get it
-if you want it, that you can change the software or use pieces of it
-in new free programs; and that you know you can do these things.
-
-  To protect your rights, we need to make restrictions that forbid
-anyone to deny you these rights or to ask you to surrender the rights.
-These restrictions translate to certain responsibilities for you if you
-distribute copies of the software, or if you modify it.
-
-  For example, if you distribute copies of such a program, whether
-gratis or for a fee, you must give the recipients all the rights that
-you have.  You must make sure that they, too, receive or can get the
-source code.  And you must show them these terms so they know their
-rights.
-
-  We protect your rights with two steps: (1) copyright the software, and
-(2) offer you this license which gives you legal permission to copy,
-distribute and/or modify the software.
-
-  Also, for each author's protection and ours, we want to make certain
-that everyone understands that there is no warranty for this free
-software.  If the software is modified by someone else and passed on, we
-want its recipients to know that what they have is not the original, so
-that any problems introduced by others will not reflect on the original
-authors' reputations.
-
-  Finally, any free program is threatened constantly by software
-patents.  We wish to avoid the danger that redistributors of a free
-program will individually obtain patent licenses, in effect making the
-program proprietary.  To prevent this, we have made it clear that any
-patent must be licensed for everyone's free use or not licensed at all.
-
-  The precise terms and conditions for copying, distribution and
-modification follow.
-\f
-                   GNU GENERAL PUBLIC LICENSE
-   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
-
-  0. This License applies to any program or other work which contains
-a notice placed by the copyright holder saying it may be distributed
-under the terms of this General Public License.  The "Program", below,
-refers to any such program or work, and a "work based on the Program"
-means either the Program or any derivative work under copyright law:
-that is to say, a work containing the Program or a portion of it,
-either verbatim or with modifications and/or translated into another
-language.  (Hereinafter, translation is included without limitation in
-the term "modification".)  Each licensee is addressed as "you".
-
-Activities other than copying, distribution and modification are not
-covered by this License; they are outside its scope.  The act of
-running the Program is not restricted, and the output from the Program
-is covered only if its contents constitute a work based on the
-Program (independent of having been made by running the Program).
-Whether that is true depends on what the Program does.
-
-  1. You may copy and distribute verbatim copies of the Program's
-source code as you receive it, in any medium, provided that you
-conspicuously and appropriately publish on each copy an appropriate
-copyright notice and disclaimer of warranty; keep intact all the
-notices that refer to this License and to the absence of any warranty;
-and give any other recipients of the Program a copy of this License
-along with the Program.
-
-You may charge a fee for the physical act of transferring a copy, and
-you may at your option offer warranty protection in exchange for a fee.
-
-  2. You may modify your copy or copies of the Program or any portion
-of it, thus forming a work based on the Program, and copy and
-distribute such modifications or work under the terms of Section 1
-above, provided that you also meet all of these conditions:
-
-    a) You must cause the modified files to carry prominent notices
-    stating that you changed the files and the date of any change.
-
-    b) You must cause any work that you distribute or publish, that in
-    whole or in part contains or is derived from the Program or any
-    part thereof, to be licensed as a whole at no charge to all third
-    parties under the terms of this License.
-
-    c) If the modified program normally reads commands interactively
-    when run, you must cause it, when started running for such
-    interactive use in the most ordinary way, to print or display an
-    announcement including an appropriate copyright notice and a
-    notice that there is no warranty (or else, saying that you provide
-    a warranty) and that users may redistribute the program under
-    these conditions, and telling the user how to view a copy of this
-    License.  (Exception: if the Program itself is interactive but
-    does not normally print such an announcement, your work based on
-    the Program is not required to print an announcement.)
-\f
-These requirements apply to the modified work as a whole.  If
-identifiable sections of that work are not derived from the Program,
-and can be reasonably considered independent and separate works in
-themselves, then this License, and its terms, do not apply to those
-sections when you distribute them as separate works.  But when you
-distribute the same sections as part of a whole which is a work based
-on the Program, the distribution of the whole must be on the terms of
-this License, whose permissions for other licensees extend to the
-entire whole, and thus to each and every part regardless of who wrote it.
-
-Thus, it is not the intent of this section to claim rights or contest
-your rights to work written entirely by you; rather, the intent is to
-exercise the right to control the distribution of derivative or
-collective works based on the Program.
-
-In addition, mere aggregation of another work not based on the Program
-with the Program (or with a work based on the Program) on a volume of
-a storage or distribution medium does not bring the other work under
-the scope of this License.
-
-  3. You may copy and distribute the Program (or a work based on it,
-under Section 2) in object code or executable form under the terms of
-Sections 1 and 2 above provided that you also do one of the following:
-
-    a) Accompany it with the complete corresponding machine-readable
-    source code, which must be distributed under the terms of Sections
-    1 and 2 above on a medium customarily used for software interchange; or,
-
-    b) Accompany it with a written offer, valid for at least three
-    years, to give any third party, for a charge no more than your
-    cost of physically performing source distribution, a complete
-    machine-readable copy of the corresponding source code, to be
-    distributed under the terms of Sections 1 and 2 above on a medium
-    customarily used for software interchange; or,
-
-    c) Accompany it with the information you received as to the offer
-    to distribute corresponding source code.  (This alternative is
-    allowed only for noncommercial distribution and only if you
-    received the program in object code or executable form with such
-    an offer, in accord with Subsection b above.)
-
-The source code for a work means the preferred form of the work for
-making modifications to it.  For an executable work, complete source
-code means all the source code for all modules it contains, plus any
-associated interface definition files, plus the scripts used to
-control compilation and installation of the executable.  However, as a
-special exception, the source code distributed need not include
-anything that is normally distributed (in either source or binary
-form) with the major components (compiler, kernel, and so on) of the
-operating system on which the executable runs, unless that component
-itself accompanies the executable.
-
-If distribution of executable or object code is made by offering
-access to copy from a designated place, then offering equivalent
-access to copy the source code from the same place counts as
-distribution of the source code, even though third parties are not
-compelled to copy the source along with the object code.
-\f
-  4. You may not copy, modify, sublicense, or distribute the Program
-except as expressly provided under this License.  Any attempt
-otherwise to copy, modify, sublicense or distribute the Program is
-void, and will automatically terminate your rights under this License.
-However, parties who have received copies, or rights, from you under
-this License will not have their licenses terminated so long as such
-parties remain in full compliance.
-
-  5. You are not required to accept this License, since you have not
-signed it.  However, nothing else grants you permission to modify or
-distribute the Program or its derivative works.  These actions are
-prohibited by law if you do not accept this License.  Therefore, by
-modifying or distributing the Program (or any work based on the
-Program), you indicate your acceptance of this License to do so, and
-all its terms and conditions for copying, distributing or modifying
-the Program or works based on it.
-
-  6. Each time you redistribute the Program (or any work based on the
-Program), the recipient automatically receives a license from the
-original licensor to copy, distribute or modify the Program subject to
-these terms and conditions.  You may not impose any further
-restrictions on the recipients' exercise of the rights granted herein.
-You are not responsible for enforcing compliance by third parties to
-this License.
-
-  7. If, as a consequence of a court judgment or allegation of patent
-infringement or for any other reason (not limited to patent issues),
-conditions are imposed on you (whether by court order, agreement or
-otherwise) that contradict the conditions of this License, they do not
-excuse you from the conditions of this License.  If you cannot
-distribute so as to satisfy simultaneously your obligations under this
-License and any other pertinent obligations, then as a consequence you
-may not distribute the Program at all.  For example, if a patent
-license would not permit royalty-free redistribution of the Program by
-all those who receive copies directly or indirectly through you, then
-the only way you could satisfy both it and this License would be to
-refrain entirely from distribution of the Program.
-
-If any portion of this section is held invalid or unenforceable under
-any particular circumstance, the balance of the section is intended to
-apply and the section as a whole is intended to apply in other
-circumstances.
-
-It is not the purpose of this section to induce you to infringe any
-patents or other property right claims or to contest validity of any
-such claims; this section has the sole purpose of protecting the
-integrity of the free software distribution system, which is
-implemented by public license practices.  Many people have made
-generous contributions to the wide range of software distributed
-through that system in reliance on consistent application of that
-system; it is up to the author/donor to decide if he or she is willing
-to distribute software through any other system and a licensee cannot
-impose that choice.
-
-This section is intended to make thoroughly clear what is believed to
-be a consequence of the rest of this License.
-\f
-  8. If the distribution and/or use of the Program is restricted in
-certain countries either by patents or by copyrighted interfaces, the
-original copyright holder who places the Program under this License
-may add an explicit geographical distribution limitation excluding
-those countries, so that distribution is permitted only in or among
-countries not thus excluded.  In such case, this License incorporates
-the limitation as if written in the body of this License.
-
-  9. The Free Software Foundation may publish revised and/or new versions
-of the General Public License from time to time.  Such new versions will
-be similar in spirit to the present version, but may differ in detail to
-address new problems or concerns.
-
-Each version is given a distinguishing version number.  If the Program
-specifies a version number of this License which applies to it and "any
-later version", you have the option of following the terms and conditions
-either of that version or of any later version published by the Free
-Software Foundation.  If the Program does not specify a version number of
-this License, you may choose any version ever published by the Free Software
-Foundation.
-
-  10. If you wish to incorporate parts of the Program into other free
-programs whose distribution conditions are different, write to the author
-to ask for permission.  For software which is copyrighted by the Free
-Software Foundation, write to the Free Software Foundation; we sometimes
-make exceptions for this.  Our decision will be guided by the two goals
-of preserving the free status of all derivatives of our free software and
-of promoting the sharing and reuse of software generally.
-
-                           NO WARRANTY
-
-  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
-FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
-OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
-PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
-OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
-TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
-PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
-REPAIR OR CORRECTION.
-
-  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
-WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
-REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
-INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
-OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
-TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
-YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
-PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
-POSSIBILITY OF SUCH DAMAGES.
-
-                    END OF TERMS AND CONDITIONS
-\f
-           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
-free software which everyone can redistribute and change under these terms.
-
-  To do so, attach the following notices to the program.  It is safest
-to attach them to the start of each source file to most effectively
-convey the exclusion of warranty; and each file should have at least
-the "copyright" line and a pointer to where the full notice is found.
-
-    <one line to give the program's name and a brief idea of what it does.>
-    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
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-
-
-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) 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.
-
-The hypothetical commands `show w' and `show c' should show the appropriate
-parts of the General Public License.  Of course, the commands you use may
-be called something other than `show w' and `show c'; they could even be
-mouse-clicks or menu items--whatever suits your program.
-
-You should also get your employer (if you work as a programmer) or your
-school, if any, to sign a "copyright disclaimer" for the program, if
-necessary.  Here is a sample; alter the names:
-
-  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
-  `Gnomovision' (which makes passes at compilers) written by James Hacker.
-
-  <signature of Ty Coon>, 1 April 1989
-  Ty Coon, President of Vice
-
-This General Public License does not permit incorporating your program into
-proprietary programs.  If your program is a subroutine library, you may
-consider it more useful to permit linking proprietary applications with the
-library.  If this is what you want to do, use the GNU Library General
-Public License instead of this License.
diff --git a/COPYING b/COPYING
new file mode 120000 (symlink)
index 0000000000000000000000000000000000000000..71537690b8e6ec9fd9e88f7561098a03f7c98957
--- /dev/null
+++ b/COPYING
@@ -0,0 +1 @@
+/usr/share/automake-1.9/COPYING
\ No newline at end of file
diff --git a/INSTALL b/INSTALL
deleted file mode 100644 (file)
index 095b1eb406356f57c8d90c89f53681bbb36124a7..0000000000000000000000000000000000000000
--- a/INSTALL
+++ /dev/null
@@ -1,231 +0,0 @@
-Installation Instructions
-*************************
-
-Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004 Free
-Software Foundation, Inc.
-
-This file is free documentation; the Free Software Foundation gives
-unlimited permission to copy, distribute and modify it.
-
-Basic Installation
-==================
-
-These are generic installation instructions.
-
-   The `configure' shell script attempts to guess correct values for
-various system-dependent variables used during compilation.  It uses
-those values to create a `Makefile' in each directory of the package.
-It may also create one or more `.h' files containing system-dependent
-definitions.  Finally, it creates a shell script `config.status' that
-you can run in the future to recreate the current configuration, and a
-file `config.log' containing compiler output (useful mainly for
-debugging `configure').
-
-   It can also use an optional file (typically called `config.cache'
-and enabled with `--cache-file=config.cache' or simply `-C') that saves
-the results of its tests to speed up reconfiguring.  (Caching is
-disabled by default to prevent problems with accidental use of stale
-cache files.)
-
-   If you need to do unusual things to compile the package, please try
-to figure out how `configure' could check whether to do them, and mail
-diffs or instructions to the address given in the `README' so they can
-be considered for the next release.  If you are using the cache, and at
-some point `config.cache' contains results you don't want to keep, you
-may remove or edit it.
-
-   The file `configure.ac' (or `configure.in') is used to create
-`configure' by a program called `autoconf'.  You only need
-`configure.ac' if you want to change it or regenerate `configure' using
-a newer version of `autoconf'.
-
-The simplest way to compile this package is:
-
-  1. `cd' to the directory containing the package's source code and type
-     `./configure' to configure the package for your system.  If you're
-     using `csh' on an old version of System V, you might need to type
-     `sh ./configure' instead to prevent `csh' from trying to execute
-     `configure' itself.
-
-     Running `configure' takes awhile.  While running, it prints some
-     messages telling which features it is checking for.
-
-  2. Type `make' to compile the package.
-
-  3. Optionally, type `make check' to run any self-tests that come with
-     the package.
-
-  4. Type `make install' to install the programs and any data files and
-     documentation.
-
-  5. You can remove the program binaries and object files from the
-     source code directory by typing `make clean'.  To also remove the
-     files that `configure' created (so you can compile the package for
-     a different kind of computer), type `make distclean'.  There is
-     also a `make maintainer-clean' target, but that is intended mainly
-     for the package's developers.  If you use it, you may have to get
-     all sorts of other programs in order to regenerate files that came
-     with the distribution.
-
-Compilers and Options
-=====================
-
-Some systems require unusual options for compilation or linking that the
-`configure' script does not know about.  Run `./configure --help' for
-details on some of the pertinent environment variables.
-
-   You can give `configure' initial values for configuration parameters
-by setting variables in the command line or in the environment.  Here
-is an example:
-
-     ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
-
-   *Note Defining Variables::, for more details.
-
-Compiling For Multiple Architectures
-====================================
-
-You can compile the package for more than one kind of computer at the
-same time, by placing the object files for each architecture in their
-own directory.  To do this, you must use a version of `make' that
-supports the `VPATH' variable, such as GNU `make'.  `cd' to the
-directory where you want the object files and executables to go and run
-the `configure' script.  `configure' automatically checks for the
-source code in the directory that `configure' is in and in `..'.
-
-   If you have to use a `make' that does not support the `VPATH'
-variable, you have to compile the package for one architecture at a
-time in the source code directory.  After you have installed the
-package for one architecture, use `make distclean' before reconfiguring
-for another architecture.
-
-Installation Names
-==================
-
-By default, `make install' will install the package's files in
-`/usr/local/bin', `/usr/local/man', etc.  You can specify an
-installation prefix other than `/usr/local' by giving `configure' the
-option `--prefix=PREFIX'.
-
-   You can specify separate installation prefixes for
-architecture-specific files and architecture-independent files.  If you
-give `configure' the option `--exec-prefix=PREFIX', the package will
-use PREFIX as the prefix for installing programs and libraries.
-Documentation and other data files will still use the regular prefix.
-
-   In addition, if you use an unusual directory layout you can give
-options like `--bindir=DIR' to specify different values for particular
-kinds of files.  Run `configure --help' for a list of the directories
-you can set and what kinds of files go in them.
-
-   If the package supports it, you can cause programs to be installed
-with an extra prefix or suffix on their names by giving `configure' the
-option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
-
-Optional Features
-=================
-
-Some packages pay attention to `--enable-FEATURE' options to
-`configure', where FEATURE indicates an optional part of the package.
-They may also pay attention to `--with-PACKAGE' options, where PACKAGE
-is something like `gnu-as' or `x' (for the X Window System).  The
-`README' should mention any `--enable-' and `--with-' options that the
-package recognizes.
-
-   For packages that use the X Window System, `configure' can usually
-find the X include and library files automatically, but if it doesn't,
-you can use the `configure' options `--x-includes=DIR' and
-`--x-libraries=DIR' to specify their locations.
-
-Specifying the System Type
-==========================
-
-There may be some features `configure' cannot figure out automatically,
-but needs to determine by the type of machine the package will run on.
-Usually, assuming the package is built to be run on the _same_
-architectures, `configure' can figure that out, but if it prints a
-message saying it cannot guess the machine type, give it the
-`--build=TYPE' option.  TYPE can either be a short name for the system
-type, such as `sun4', or a canonical name which has the form:
-
-     CPU-COMPANY-SYSTEM
-
-where SYSTEM can have one of these forms:
-
-     OS KERNEL-OS
-
-   See the file `config.sub' for the possible values of each field.  If
-`config.sub' isn't included in this package, then this package doesn't
-need to know the machine type.
-
-   If you are _building_ compiler tools for cross-compiling, you should
-use the `--target=TYPE' option to select the type of system they will
-produce code for.
-
-   If you want to _use_ a cross compiler, that generates code for a
-platform different from the build platform, you should specify the
-"host" platform (i.e., that on which the generated programs will
-eventually be run) with `--host=TYPE'.
-
-Sharing Defaults
-================
-
-If you want to set default values for `configure' scripts to share, you
-can create a site shell script called `config.site' that gives default
-values for variables like `CC', `cache_file', and `prefix'.
-`configure' looks for `PREFIX/share/config.site' if it exists, then
-`PREFIX/etc/config.site' if it exists.  Or, you can set the
-`CONFIG_SITE' environment variable to the location of the site script.
-A warning: not all `configure' scripts look for a site script.
-
-Defining Variables
-==================
-
-Variables not defined in a site shell script can be set in the
-environment passed to `configure'.  However, some packages may run
-configure again during the build, and the customized values of these
-variables may be lost.  In order to avoid this problem, you should set
-them in the `configure' command line, using `VAR=value'.  For example:
-
-     ./configure CC=/usr/local2/bin/gcc
-
-will cause the specified gcc to be used as the C compiler (unless it is
-overridden in the site shell script).
-
-`configure' Invocation
-======================
-
-`configure' recognizes the following options to control how it operates.
-
-`--help'
-`-h'
-     Print a summary of the options to `configure', and exit.
-
-`--version'
-`-V'
-     Print the version of Autoconf used to generate the `configure'
-     script, and exit.
-
-`--cache-file=FILE'
-     Enable the cache: use and save the results of the tests in FILE,
-     traditionally `config.cache'.  FILE defaults to `/dev/null' to
-     disable caching.
-
-`--config-cache'
-`-C'
-     Alias for `--cache-file=config.cache'.
-
-`--quiet'
-`--silent'
-`-q'
-     Do not print messages saying which checks are being made.  To
-     suppress all normal output, redirect it to `/dev/null' (any error
-     messages will still be shown).
-
-`--srcdir=DIR'
-     Look for the package's source code in directory DIR.  Usually
-     `configure' can determine that directory automatically.
-
-`configure' also accepts some other, not widely useful, options.  Run
-`configure --help' for more details.
-
diff --git a/INSTALL b/INSTALL
new file mode 120000 (symlink)
index 0000000000000000000000000000000000000000..81fa6ffa451ee21fd1c60d4ba33acd5c36bc6865
--- /dev/null
+++ b/INSTALL
@@ -0,0 +1 @@
+/usr/share/automake-1.9/INSTALL
\ No newline at end of file
index ca05201..44a111c 100644 (file)
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.9.2 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,
-# 2003, 2004  Free Software Foundation, Inc.
+# 2003, 2004, 2005  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.
@@ -216,7 +216,13 @@ uninstall-dist_dataDATA:
 #     (which will cause the Makefiles to be regenerated when you run `make');
 # (2) otherwise, pass the desired values on the `make' command line.
 $(RECURSIVE_TARGETS):
-       @set fnord $$MAKEFLAGS; amf=$$2; \
+       @failcom='exit 1'; \
+       for f in x $$MAKEFLAGS; do \
+         case $$f in \
+           *=* | --[!k]*);; \
+           *k*) failcom='fail=yes';; \
+         esac; \
+       done; \
        dot_seen=no; \
        target=`echo $@ | sed s/-recursive//`; \
        list='$(SUBDIRS)'; for subdir in $$list; do \
@@ -228,7 +234,7 @@ $(RECURSIVE_TARGETS):
            local_target="$$target"; \
          fi; \
          (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-          || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
+         || eval $$failcom; \
        done; \
        if test "$$dot_seen" = "no"; then \
          $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
@@ -236,7 +242,13 @@ $(RECURSIVE_TARGETS):
 
 mostlyclean-recursive clean-recursive distclean-recursive \
 maintainer-clean-recursive:
-       @set fnord $$MAKEFLAGS; amf=$$2; \
+       @failcom='exit 1'; \
+       for f in x $$MAKEFLAGS; do \
+         case $$f in \
+           *=* | --[!k]*);; \
+           *k*) failcom='fail=yes';; \
+         esac; \
+       done; \
        dot_seen=no; \
        case "$@" in \
          distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
@@ -257,7 +269,7 @@ maintainer-clean-recursive:
            local_target="$$target"; \
          fi; \
          (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
-          || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
+         || eval $$failcom; \
        done && test -z "$$fail"
 tags-recursive:
        list='$(SUBDIRS)'; for subdir in $$list; do \
index a9aa78f..aef181a 100755 (executable)
@@ -1,7 +1,7 @@
-# generated automatically by aclocal 1.9.2 -*- Autoconf -*-
+# generated automatically by aclocal 1.9.6 -*- Autoconf -*-
 
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
-# Free Software Foundation, Inc.
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005  Free Software Foundation, Inc.
 # This file 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.
 # even the implied warranty of MERCHANTABILITY or FITNESS FOR A
 # PARTICULAR PURPOSE.
 
-#                                                        -*- Autoconf -*-
-# Copyright (C) 2002, 2003  Free Software Foundation, Inc.
-# Generated from amversion.in; do not edit by hand.
-
-# 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, or (at your option)
-# any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# Copyright (C) 2002, 2003, 2005  Free Software Foundation, Inc.
+#
+# This file 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.
 
 # AM_AUTOMAKE_VERSION(VERSION)
 # ----------------------------
@@ -40,26 +28,15 @@ AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"])
 # Call AM_AUTOMAKE_VERSION so it can be traced.
 # This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-        [AM_AUTOMAKE_VERSION([1.9.2])])
-
-# AM_AUX_DIR_EXPAND
+        [AM_AUTOMAKE_VERSION([1.9.6])])
 
-# Copyright (C) 2001, 2003 Free Software Foundation, Inc.
+# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
 
-# 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, or (at your option)
-# any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
+# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
+#
+# This file 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.
 
 # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
 # $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
@@ -106,26 +83,16 @@ AC_PREREQ([2.50])dnl
 am_aux_dir=`cd $ac_aux_dir && pwd`
 ])
 
-# AM_CONDITIONAL                                              -*- Autoconf -*-
-
-# Copyright (C) 1997, 2000, 2001, 2003, 2004 Free Software Foundation, Inc.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
+# AM_CONDITIONAL                                            -*- Autoconf -*-
 
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
+# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file 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.
 
-# serial 6
+# serial 7
 
 # AM_CONDITIONAL(NAME, SHELL-CONDITION)
 # -------------------------------------
@@ -149,26 +116,15 @@ AC_CONFIG_COMMANDS_PRE(
 Usually this means the macro was only invoked conditionally.]])
 fi])])
 
-# serial 7                                             -*- Autoconf -*-
 
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
 # Free Software Foundation, Inc.
+#
+# This file 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 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, or (at your option)
-# any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
+# serial 8
 
 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
 # written in clear, in which case automake, when reading aclocal.m4,
@@ -177,7 +133,6 @@ fi])])
 # CC etc. in the Makefile, will ask for an AC_PROG_CC use...
 
 
-
 # _AM_DEPENDENCIES(NAME)
 # ----------------------
 # See how the compiler implements dependency checking.
@@ -317,27 +272,16 @@ AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
 AC_SUBST([AMDEPBACKSLASH])
 ])
 
-# Generate code to set up dependency tracking.   -*- Autoconf -*-
-
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004
-#   Free Software Foundation, Inc.
+# Generate code to set up dependency tracking.              -*- Autoconf -*-
 
-# 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, or (at your option)
-# any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
+# Free Software Foundation, Inc.
+#
+# This file 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.
 
-#serial 2
+#serial 3
 
 # _AM_OUTPUT_DEPENDENCY_COMMANDS
 # ------------------------------
@@ -396,30 +340,19 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
      [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
 ])
 
-# Do all the work for Automake.                            -*- Autoconf -*-
-
-# This macro actually does too much some checks are only needed if
-# your package does certain things.  But this isn't really a big deal.
+# Do all the work for Automake.                             -*- Autoconf -*-
 
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
 # Free Software Foundation, Inc.
+#
+# This file 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 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, or (at your option)
-# any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
+# serial 12
 
-# serial 11
+# This macro actually does too much.  Some checks are only needed if
+# your package does certain things.  But this isn't really a big deal.
 
 # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
 # AM_INIT_AUTOMAKE([OPTIONS])
@@ -521,51 +454,27 @@ for _am_header in $config_headers :; do
 done
 echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
 
+# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
+#
+# This file 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.
+
 # AM_PROG_INSTALL_SH
 # ------------------
 # Define $install_sh.
-
-# Copyright (C) 2001, 2003 Free Software Foundation, Inc.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
 AC_DEFUN([AM_PROG_INSTALL_SH],
 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
 install_sh=${install_sh-"$am_aux_dir/install-sh"}
 AC_SUBST(install_sh)])
 
-#                                                          -*- Autoconf -*-
-# Copyright (C) 2003  Free Software Foundation, Inc.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
+# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
+#
+# This file 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.
 
-# serial 1
+# serial 2
 
 # Check whether the underlying file-system supports filenames
 # with a leading dot.  For instance MS-DOS doesn't.
@@ -580,26 +489,15 @@ fi
 rmdir .tst 2>/dev/null
 AC_SUBST([am__leading_dot])])
 
-# Check to see how 'make' treats includes.     -*- Autoconf -*-
-
-# Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc.
+# Check to see how 'make' treats includes.                 -*- Autoconf -*-
 
-# 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, or (at your option)
-# any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
+# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
+#
+# This file 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.
 
-# serial 2
+# serial 3
 
 # AM_MAKE_INCLUDE()
 # -----------------
@@ -643,27 +541,16 @@ AC_MSG_RESULT([$_am_result])
 rm -f confinc confmf
 ])
 
-#  -*- Autoconf -*-
-
+# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
 
-# Copyright (C) 1997, 1999, 2000, 2001, 2003 Free Software Foundation, Inc.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
+# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005
+# Free Software Foundation, Inc.
+#
+# This file 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.
 
-# serial 3
+# serial 4
 
 # AM_MISSING_PROG(NAME, PROGRAM)
 # ------------------------------
@@ -689,27 +576,16 @@ else
 fi
 ])
 
+# Copyright (C) 2003, 2004, 2005  Free Software Foundation, Inc.
+#
+# This file 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.
+
 # AM_PROG_MKDIR_P
 # ---------------
 # Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.
-
-# Copyright (C) 2003, 2004 Free Software Foundation, Inc.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
+#
 # Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories
 # created by `make install' are always world readable, even if the
 # installer happens to have an overly restrictive umask (e.g. 077).
@@ -763,26 +639,15 @@ else
 fi
 AC_SUBST([mkdir_p])])
 
-# Helper functions for option handling.                    -*- Autoconf -*-
-
-# Copyright (C) 2001, 2002, 2003  Free Software Foundation, Inc.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
+# Helper functions for option handling.                     -*- Autoconf -*-
 
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
+# Copyright (C) 2001, 2002, 2003, 2005  Free Software Foundation, Inc.
+#
+# This file 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.
 
-# serial 2
+# serial 3
 
 # _AM_MANGLE_OPTION(NAME)
 # -----------------------
@@ -807,28 +672,16 @@ AC_DEFUN([_AM_SET_OPTIONS],
 AC_DEFUN([_AM_IF_OPTION],
 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
 
-#
-# Check to make sure that the build environment is sane.
-#
-
-# Copyright (C) 1996, 1997, 2000, 2001, 2003 Free Software Foundation, Inc.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, 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.
+# Check to make sure that the build environment is sane.    -*- Autoconf -*-
 
-# 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.
+# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
+# Free Software Foundation, Inc.
+#
+# This file 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.
 
-# serial 3
+# serial 4
 
 # AM_SANITY_CHECK
 # ---------------
@@ -871,25 +724,14 @@ Check your system clock])
 fi
 AC_MSG_RESULT(yes)])
 
-# AM_PROG_INSTALL_STRIP
-
-# Copyright (C) 2001, 2003 Free Software Foundation, Inc.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
+# Copyright (C) 2001, 2003, 2005  Free Software Foundation, Inc.
+#
+# This file 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.
 
+# AM_PROG_INSTALL_STRIP
+# ---------------------
 # One issue with vendor `install' (even GNU) is that you can't
 # specify the program used to strip binaries.  This is especially
 # annoying in cross-compiling environments, where the build's strip
@@ -912,25 +754,13 @@ AC_SUBST([INSTALL_STRIP_PROGRAM])])
 
 # Check how to create a tarball.                            -*- Autoconf -*-
 
-# Copyright (C) 2004  Free Software Foundation, Inc.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-# 02111-1307, USA.
-
-# serial 1
+# Copyright (C) 2004, 2005  Free Software Foundation, Inc.
+#
+# This file 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.
 
+# serial 2
 
 # _AM_PROG_TAR(FORMAT)
 # --------------------
index edb1e90..2054b89 100755 (executable)
--- a/configure
+++ b/configure
@@ -1604,7 +1604,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE=evolisprinter
- VERSION=2.0
+ VERSION=2.1
 
 
 cat >>confdefs.h <<_ACEOF
index d5658cb..3dba39d 100755 (executable)
@@ -1,6 +1,6 @@
 AC_INIT(src/cupsevolis.c)
 
-AM_INIT_AUTOMAKE(evolisprinter,2.0)
+AM_INIT_AUTOMAKE(evolisprinter,2.1)
  
 AC_PREFIX_DEFAULT(/usr/lib/cups/filter)
 
old mode 100755 (executable)
new mode 100644 (file)
index 2cb1fd3..30c5aff
Binary files a/ppd/evolis-dualysE.ppd.gz and b/ppd/evolis-dualysE.ppd.gz differ
old mode 100755 (executable)
new mode 100644 (file)
index 231f597..957e298
Binary files a/ppd/evolis-dualysF.ppd.gz and b/ppd/evolis-dualysF.ppd.gz differ
old mode 100755 (executable)
new mode 100644 (file)
index 37ac3f2..8bc4434
Binary files a/ppd/evolis-pebbleE.ppd.gz and b/ppd/evolis-pebbleE.ppd.gz differ
old mode 100755 (executable)
new mode 100644 (file)
index d036ae6..9a168bf
Binary files a/ppd/evolis-pebbleF.ppd.gz and b/ppd/evolis-pebbleF.ppd.gz differ
old mode 100755 (executable)
new mode 100644 (file)
index 9d13ac3..f63b82b
Binary files a/ppd/evolis-quantumE.ppd.gz and b/ppd/evolis-quantumE.ppd.gz differ
old mode 100755 (executable)
new mode 100644 (file)
index 162c208..9c7c5b9
Binary files a/ppd/evolis-quantumF.ppd.gz and b/ppd/evolis-quantumF.ppd.gz differ
diff --git a/ppd/evolis-securionE.ppd.gz b/ppd/evolis-securionE.ppd.gz
new file mode 100644 (file)
index 0000000..0dd6759
Binary files /dev/null and b/ppd/evolis-securionE.ppd.gz differ
diff --git a/ppd/evolis-securionF.ppd.gz b/ppd/evolis-securionF.ppd.gz
new file mode 100644 (file)
index 0000000..68d2a54
Binary files /dev/null and b/ppd/evolis-securionF.ppd.gz differ
old mode 100755 (executable)
new mode 100644 (file)
index c3c74da..5b3c62e
Binary files a/ppd/evolis-tattooE.ppd.gz and b/ppd/evolis-tattooE.ppd.gz differ
old mode 100755 (executable)
new mode 100644 (file)
index 019eec3..1f70d9e
Binary files a/ppd/evolis-tattooF.ppd.gz and b/ppd/evolis-tattooF.ppd.gz differ
index eb16f8f..243742c 100644 (file)
@@ -1,8 +1,8 @@
-# Makefile.in generated by automake 1.9.2 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,
-# 2003, 2004  Free Software Foundation, Inc.
+# 2003, 2004, 2005  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.
@@ -16,8 +16,6 @@
 
 #Makefile.am du repertoire source
 
-SOURCES = $(rastertoevolis_SOURCES)
-
 srcdir = @srcdir@
 top_srcdir = @top_srcdir@
 VPATH = @srcdir@
index 79d02a6..377108d 100755 (executable)
@@ -1 +1 @@
- // 28/06/2004 gestion du YMCKOS + refonte des fichiers ppd et fichiers d'installation\r // 20/10/2004 ajout filtre sharpen Pebble v3\r\r/*\r *\r * Contents:\r *\r *   Setup()        - Prepare the printer for printing.\r *   StartPage()    - Start a page of graphics.\r *   EndPage()      - Finish a page of graphics.\r *   Shutdown()     - Shutdown the printer.\r *   CompressData() - Compress a line of graphics.\r *   OutputLine()   - Output a line of graphics.\r *   main()         - Main entry and processing of driver.\r */\r\r\r#include <string.h>\r#include <stdlib.h>\r#include <sys/stat.h>\r#include <signal.h>\r#include <ctype.h>\r#include <fcntl.h>\r#include <stdarg.h>\r#include <stdio.h>\r#include "evolis.h"\r#include "evoliserror.h"\r#include "cups.h"\r#include "ppd.h"\r#include "raster.h"\r\r// Model numbers...\r#define EVOLIS_1 0\r#define CUPS15    1\r\r#define PORTRAIT 1\r#define LANDSCAPE     2\r\r\rchar Track1[10],            /* STP options */\r  Track2[10],\r  Track3[10],\r  Density1[10],\r  Density2[10],\r  Density3[10],\r  EjectCard[10],\r  TestCard[10],\r  KeepCard[10],\r  InkType[10],\r  Coercivity[10];\r\r// Prototypes...\r\rvoid Setup(void);\rvoid StartPage(const ppd_file_t * ppd, const cups_page_header_t * header, cups_raster_t * ras);\rvoid EndPage(const cups_page_header_t * header);\rvoid Shutdown(void);\rvoid CancelJob(int sig);\r\r// Dealing data functions\rstatic void ShareRVBtoMem(long Height, long Width, long WidthLine, cups_raster_t * ras);\rstatic void ShareRVBtoMemWindow(long Height, long Width, long WidthLine, cups_raster_t * ras,const cups_page_header_t * header);\r//void ShareCMYtoMem(long Height, long Width, long WidthLine, cups_raster_t * ras);\rvoid ViewInfo(const ppd_file_t * ppd, const cups_page_header_t * header);\rint Sharpen(unsigned char * lpMemIn ,/*unsigned char * lpMemOut,*/ long Width, long Height);\rvoid ViewInfoPPD(const ppd_file_t * ppd);\r\r\rstatic  int     page;                 /* Current page */\rstatic         int     cOrientation,cSides,tMargin,lMargin,rMargin,bMargin;\r/*\r * 'Setup()' - Prepare the printer for printing.\r */\r\rvoid upper(char * pt)\r{\r  while(*pt != 0x00) {\r           if( *pt > 0x60){\r                       *pt -= 0x20;\r           }\r              pt++;\r  }\r\r \r//===============================================================================================================\rvoid Setup(void)\r//===============================================================================================================\r{\r  info("Setup()");\r}\r\r\r/*\r * 'StartPage()' - Start a page of graphics.\r */\r\r//===============================================================================================================\rvoid StartPage(const ppd_file_t * ppd,      /* I - PPD file */\r            const cups_page_header_t * header,       /* I - Page header */\r         cups_raster_t * ras)\r//===============================================================================================================\r{\r  int   putB = 0, overfb = 1;\r  int   a,b;\r\r#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)\r       struct sigaction action;        /* Actions for POSIX signals */\r#endif /* HAVE_SIGACTION && !HAVE_SIGSET */\r    \r#ifdef HAVE_SIGSET             /* Use System V signals over POSIX to avoid bugs */\r    sigset(SIGTERM, CancelJob);\r#elif defined(HAVE_SIGACTION)\r      memset(&action, 0, sizeof(action));\r\r   sigemptyset(&action.sa_mask);\r  action.sa_handler = CancelJob;\r sigaction(SIGTERM, &action, NULL);\r#else\r       signal(SIGTERM, CancelJob);\r#endif /* HAVE_SIGSET */\r\r  info("StartPage()");\r  if(header->Duplex || cSides){\r           if((page & 0x01)){//front\r              overfb = 1;\r    }\r      else{//back\r            overfb = 2;\r    }\r    }\r  \r  if(!(strcmp(header->MediaColor, "k")) || !(strcmp(header->MediaColor, "kbl"))\r      || !(strcmp(header->MediaColor, "kgo")) || !(strcmp(header->MediaColor, "h"))\r      || !(strcmp(header->MediaColor, "kgr")) || !(strcmp(header->MediaColor, "ksi"))\r      || !(strcmp(header->MediaColor, "ksc")) || !(strcmp(header->MediaColor, "ka"))\r      || !(strcmp(header->MediaColor, "kw")) || !(strcmp(header->MediaColor, "kr")))\r  {\r    info("PRINT K");\r    ConvertRVBtoK(&lpMem[4 * (dwSizeNeeded / 5)], dwSizeNeeded, 1016, 648, &lpMem[3 * (dwSizeNeeded / 5)]);\r    DBNC(0,1,0);\r  }\r  else if(!(strcmp(header->MediaColor, "ko")))\r  {\r    info("PRINT KO");\r    ConvertRVBtoK(&lpMem[4 * (dwSizeNeeded / 5)], dwSizeNeeded, 1016, 648, &lpMem[3 * (dwSizeNeeded / 5)]);\r    DBNC(0,1,overfb);\r  }\r  else if(!(strcmp(header->MediaColor, "ymcko")) || \r   !(strcmp(header->MediaColor, "ymckos")))\r        //|| !(strcmp(header->MediaColor, "ymckok")) )\r  {\r    info("PRINT YMCKO");\r    if(!(strcmp(header->MediaColor, "ymckos")))\r    {\r      if(!DetectAuto)\r      {\r         GetFirstYMCDot(1016, 648 , &a, &b);\r         output("\033Psp;%.4d\015", b);\r         debug("DetectAuto \033Psp;%.4d\015", b);\r      }\r     else\r     {\r         output("\033Psp;%.4d\015", StartDist );\r         debug("StartDist \033Psp;%.4d\015", StartDist );\r      }\r    }\r    if (!(strcmp(BlackIn, "ALL")))\r    {\r      putB = 1;\r    }\r    else\r    {\r      putB = 0;\r      KinYMC(1016, 648);\r    }\r        \r    if (!(strcmp(ColorSmooth, "CLASSIC"))) DBNC(1,putB,overfb);\r    else if (!(strcmp(ColorSmooth, "HIGHT"))) DBNC(2,putB,overfb);\r    else if (!(strcmp(ColorSmooth, "VERYHIGHT"))) DBNC(3,putB,overfb);\r   }\r   else if (!(strcmp(header->MediaColor, "ymckok")))\r   {\r    if (!(strcmp(BlackIn, "ALL")))\r    {\r      putB = 1;\r    }\r    else\r    {\r      putB = 0;\r      KinYMC(1016, 648);\r    } \r\r    if(header->Duplex || cSides)\r    {\r      if((page & 0x01))//front\r      {\r        info("PRINT FRONT YMCKOK");\r        if (!(strcmp(ColorSmooth, "CLASSIC"))) DBNC(1,putB,overfb);\r        else if (!(strcmp(ColorSmooth, "HIGHT"))) DBNC(2,putB,overfb);\r        else if (!(strcmp(ColorSmooth, "VERYHIGHT"))) DBNC(3,putB,overfb);\r      }\r      else\r      {\r        info("PRINT BACK YMCKOK");\r        ConvertRVBtoK(&lpMem[4 * (dwSizeNeeded / 5)], dwSizeNeeded, header->cupsHeight, header->cupsWidth, &lpMem[3 * (dwSizeNeeded / 5)]);\r        DBNC(0,1,0);\r      }\r    }\r    else {\r        info("PRINT FRONT YMCKOK");\r        if (!(strcmp(ColorSmooth, "CLASSIC"))) DBNC(1,putB,overfb);\r        else if (!(strcmp(ColorSmooth, "HIGHT"))) DBNC(2,putB,overfb);\r        else if (!(strcmp(ColorSmooth, "VERYHIGHT"))) DBNC(3,putB,overfb);\r    }\r    }\r}\r\r\r/*=========================================\r * 'EndPage()' - Finish a page of graphics.\r ==========================================*/\r\r//===============================================================================================================\rvoid EndPage(const cups_page_header_t * header)      /* I - Page header */\r//===============================================================================================================\r{\r#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)\r struct sigaction action;        /* Actions for POSIX signals */\r#endif /* HAVE_SIGACTION && !HAVE_SIGSET */\r\r#ifdef HAVE_SIGSET         /* Use System V signals over POSIX to avoid bugs */\r    sigset(SIGTERM, SIG_IGN);\r#elif defined(HAVE_SIGACTION)\r        memset(&action, 0, sizeof(action));\r    sigemptyset(&action.sa_mask);\r  action.sa_handler = SIG_IGN;\r   sigaction(SIGTERM, &action, NULL);\r#else\r       signal(SIGTERM, SIG_IGN);\r#endif /* HAVE_SIGSET */\r     \r       info("EndPage()");\r}\r//=======================================//\r// 'Shutdown()' - Shutdown the printer.\r\r//=======================================//\rvoid Shutdown(void)\r{\r    info("Shutdown()");\r}\r\r//===========================================//\r// 'CancelJob()' - Cancel the current job...\r//==========================================//\rvoid CancelJob(int sig)              /* I - Signal */\r{\r     info("CancelJob()");\r   if(lpRecto)\r    {\r              debug("CancelJob lpRecto Free memory()");\r              free(lpRecto);\r         lpRecto = NULL;\r        }\r      if(lpVerso)\r    {\r              debug("CancelJob lpVerso Free memory()");\r              free(lpVerso);\r         lpVerso = NULL;\r        }\r\r}\r\r//================================================//\r// 'main()' - Main entry and processing of driver.\r//================================================//\r//===============================================================================================================\rint                                /* O - Exit status */\rmain(int argc,                    /* I - Number of command-line arguments */\r     char *argv[])           /* I - Command-line arguments */\r{\r  cups_raster_t       *ras;      /* Raster stream for printing */\r  cups_page_header_t  header;        /* Page header from file */\r  ppd_file_t          *ppd;           /* PPD file */\r  ppd_option_t        *option;       /* PPD option */\r  cups_option_t       *options;        /* CUPS options */\r  \r  int             model;\r  int            fd;                           /* File descriptor */\r  int               num_options;    /* Number of CUPS options */\r  const char       *val;           /* CUPS option value */\r  char          insert;\r  int           hopper =0;\r  int                feeder =0;\r  unsigned int       index_copy, NbCopy;     /* Numbers of copies */\r  char          end_usb[65];\r  \r  unsigned char doMag = 0x00;\r  char            track[4][1024];\r  \r  char               WtData[2048];\r  int             i = 0, j = 0;\r  \r  lpVerso = NULL;\r  lpRecto = NULL;\r  // Make sure status messages are not buffered...\r  setbuf(stderr, NULL);\r  info("Main()");\r  //Check command-line...\r  if (argc < 6 || argc > 7){\r       //We don't have the correct number of arguments; write an error message and return.\r    fatal("rastertoevolis job-id user title copies options [file]");\r       return (STATUS);\r       }\r  //Open the page stream...\r  if (argc == 7) {\r       if ((fd = open(argv[6], O_RDONLY)) == -1) {\r            fatal("Unable to open raster file.");\r          sleep(1);\r              return (STATUS);\r       }\r  }\r  else {\r   fd = 0;\r  }\r /* info("filtre in %s",argv[0]);\r  info("job-id: %s",argv[1]);\r  info("user: %s",argv[2]);\r  info("title: %s",argv[3]);\r  info("copies: %s",argv[4]);\r  info("options:%s",argv[5]);\r  info("[file]: %s  ",argv[6]);*/\r  // Initialize the print device...\r  //info("PPD file: %s", getenv("PPD"));\r  ppd = ppdOpenFile(getenv("PPD"));\r  //ViewInfo(ppd);\r  model = 1;\r  if(!strcmp(ppd->modelname,"EVOLIS Pebble Card Printer")) model = 1;\r  else if(!strcmp(ppd->modelname,"EVOLIS Tattoo Card Printer")) model = 2;\r  else if(!strcmp(ppd->modelname,"EVOLIS Quantum Card Printer")) model = 3;\r  else if(!strcmp(ppd->modelname,"EVOLIS Dualys Card Printer")) model = 4;\r  \r  info("%s %d",ppd->modelname,model);\r  \r  ras = cupsRasterOpen(fd, CUPS_RASTER_READ);\r   \r  Setup();\r  //---Get the STP options, if any\r  num_options = cupsParseOptions(argv[5], 0, &options);\r  \r  cOrientation = 0;\r  cSides =  0;\r  lMargin = 0;\r  tMargin = 0;\r  rMargin = 0;\r  bMargin = 0;\r  \r//-----------------------------------//\r//---add command line option CUPS API\r//-----------------------------------//  \r         if ((val = cupsGetOption("orientation", num_options, options)) != NULL) {\r              upper((char *) val);\r           if(!strcmp(val,"PORTRAIT")) {\r                  cOrientation = PORTRAIT;\r               }\r              else {\r                 cOrientation = LANDSCAPE;\r              }\r              \r               debug("cOrientation : %d", cOrientation);\r      }\r      \r       if ((val = cupsGetOption("Sides", num_options, options)) != NULL) {\r            upper((char *)val);\r            if(!strcmp(val,"ONE-SIDED")) {\r                 cSides = 0;\r            }\r              else {\r                 cSides = 1;\r            }\r              debug("cSides : %d", cSides);\r  }\r      \r       if ((val = cupsGetOption("page-left", num_options, options)) != NULL) {\r                lMargin = atoi(val);\r           debug("lMargin : %d", lMargin);\r        }\r      \r       if ((val = cupsGetOption("page-top", num_options, options)) != NULL) {\r         tMargin = atoi(val);\r           debug("tMargin : %d", lMargin);\r        }\r      if ((val = cupsGetOption("page-right", num_options, options)) != NULL) {\r               rMargin = atoi(val);\r           debug("rMargin : %d", lMargin);\r        }\r      if ((val = cupsGetOption("page-bottom", num_options, options)) != NULL) {\r              bMargin = atoi(val);\r           debug("bMargin : %d", lMargin);\r        }\r      \r       if ((val = cupsGetOption("InkType", num_options, options)) != NULL)\r            strcpy(InkType, val);\r  else\r           memset(InkType,0x00,9);\r        upper(InkType);\r        debug("InkType : %s", InkType);\r\r//--------------------------------------//\r// STANDARD PRINTING OPTION\r//--------------------------------------//\r     if ((val = cupsGetOption("EjectCard", num_options, options)) != NULL)\r          strcpy(EjectCard, val);\r        else if ((option = ppdFindOption(ppd, "EjectCard")) != NULL)\r           strcpy(EjectCard, option->defchoice);\r  else\r           strcpy(EjectCard, "None");\r     upper(EjectCard);\r      debug("EjectCard : %s", EjectCard);\r    //ColorSmooth value\r    if ((val = cupsGetOption("ColorSmooth", num_options, options)) != NULL)\r                strcpy(ColorSmooth, val);\r      else if ((option = ppdFindOption(ppd, "ColorSmooth")) != NULL)\r         strcpy(ColorSmooth, option->defchoice);\r        else\r           strcpy(ColorSmooth, "Classic");\r        upper(ColorSmooth);\r    debug("ColorSmooth : %s", ColorSmooth);\r        //Brightness value\r     if ((val = cupsGetOption("Brightness", num_options, options)) != NULL)\r         Brightness = atoi(val);\r        else if ((option = ppdFindOption(ppd, "Brightness")) != NULL)\r          Brightness = atoi(option->defchoice);\r  else\r           Brightness = 10;\r       debug("Brightness : %d", Brightness);\r  //Contrast value\r       if ((val = cupsGetOption("Contrast", num_options, options)) != NULL)\r           Contrast = atoi(val);\r  else if ((option = ppdFindOption(ppd, "Contrast")) != NULL)\r            Contrast = atoi(option->defchoice);\r    else\r           Contrast = 10;\r debug("Contrast : %d", Contrast);\r      //OverlayPannel value\r  if ((val = cupsGetOption("OverlayPannel", num_options, options)) != NULL)\r              strcpy(OverlayPannel, val);\r    else if ((option = ppdFindOption(ppd, "OverlayPannel")) != NULL)\r               strcpy(OverlayPannel, option->defchoice);\r      else\r           strcpy(OverlayPannel, "FO");\r   upper(OverlayPannel);\r  debug("OverlayPannel : %s", OverlayPannel);\r    \r       //OverlayBackPannel value\r      if ((val = cupsGetOption("OverlayBackPannel", num_options, options)) != NULL)\r          strcpy(OverlayBackPannel, val);\r        else if ((option = ppdFindOption(ppd, "OverlayBackPannel")) != NULL)\r           strcpy(OverlayBackPannel, option->defchoice);\r  else\r           strcpy(OverlayBackPannel, "FO");\r       upper(OverlayBackPannel);\r      debug("OverlayBackPannel : %s", OverlayBackPannel);\r    \r       //Top B value\r  if ((val = cupsGetOption("TopCover", num_options, options)) != NULL)\r           TB = atoi(val);\r        else if ((option = ppdFindOption(ppd, "TopCover")) != NULL)\r            TB = atoi(option->defchoice);\r  else\r           TB = 0;\r        debug("TB: %d",TB);\r      \r     if ((val = cupsGetOption("TopLeft", num_options, options)) != NULL)\r            LB = atoi(val);\r        else if ((option = ppdFindOption(ppd, "TopLeft")) != NULL)\r             LB = atoi(option->defchoice);\r  else\r           LB = 0;\r        debug("LB: %d",LB);\r    if ((val = cupsGetOption("BottomCover", num_options, options)) != NULL)\r                BB = atoi(val);\r        else if ((option = ppdFindOption(ppd, "BottomCover")) != NULL)\r         BB = atoi(option->defchoice);\r  else\r           BB = 0;\r        debug("BB: %d",BB);\r    if ((val = cupsGetOption("BottomRight", num_options, options)) != NULL)\r                RB = atoi(val);\r        else if ((option = ppdFindOption(ppd, "BottomRight")) != NULL)\r         RB = atoi(option->defchoice);\r  else\r           RB = 0;\r        debug("RB: %d",RB);\r    if ((val = cupsGetOption("TopWCover", num_options, options)) != NULL)\r          TW = atoi(val);\r        else if ((option = ppdFindOption(ppd, "TopWCover")) != NULL)\r           TW = atoi(option->defchoice);\r  else\r           TW = 0;\r        debug("TW: %d",TW);\r    if ((val = cupsGetOption("TopWLeft", num_options, options)) != NULL)\r           LW = atoi(val);\r        else if ((option = ppdFindOption(ppd, "TopWLeft")) != NULL)\r            LW = atoi(option->defchoice);\r  else\r           LW = 0;\r        debug("LW: %d",LW);\r    if ((val = cupsGetOption("BottomWCover", num_options, options)) != NULL)\r               BW = atoi(val);\r        else if ((option = ppdFindOption(ppd, "BottomWCover")) != NULL)\r                BW = atoi(option->defchoice);\r  else\r           BW = 0;\r        debug("BW: %d",BW);\r    if ((val = cupsGetOption("BottomWRight", num_options, options)) != NULL)\r               RW = atoi(val);\r        else if ((option = ppdFindOption(ppd, "BottomWRight")) != NULL)\r                RW = atoi(option->defchoice);\r  else\r           RW = 0;\r        debug("RW: %d",RW);\r    if ((val = cupsGetOption("BlackIn", num_options, options)) != NULL)\r            strcpy(BlackIn, val);\r  else if ((option = ppdFindOption(ppd, "BlackIn")) != NULL)\r             strcpy(BlackIn, option->defchoice);\r    else\r           strcpy(BlackIn, "None");\r       upper( BlackIn);\r       debug("BlackIn : %s", BlackIn);\r                        \r       //TreatementK value\r    if ((val = cupsGetOption("TreatementK", num_options, options)) != NULL)\r                strcpy(TreatementK, val);\r      else if ((option = ppdFindOption(ppd, "TreatementK")) != NULL)\r         strcpy(TreatementK, option->defchoice);\r        else\r           strcpy(TreatementK, "GE");\r      upper(TreatementK);\r   debug("TreatementK : %s", TreatementK);\r        \r       //QualityK value\r       if ((val = cupsGetOption("QualityK", num_options, options)) != NULL)\r           QualityK = atoi(val);\r  else if ((option = ppdFindOption(ppd, "QualityK")) != NULL)\r            QualityK = atoi(option->defchoice);\r    else\r           QualityK = 0;\r  debug("QualityK : %d", QualityK);\r\r     //KSensibilityK value\r  if ((val = cupsGetOption("SensibilityK", num_options, options)) != NULL)\r               SensibilityK = atoi(val);\r      else if ((option = ppdFindOption(ppd, "SensibilityK")) != NULL)\r                SensibilityK = atoi(option->defchoice);\r        else\r           SensibilityK = 10;\r     debug("SensibilityK : %d", SensibilityK);\r\r     //SensibilityO value\r   if ((val = cupsGetOption("SensibilityO", num_options, options)) != NULL)\r               SensibilityO = atoi(val);\r      else if ((option = ppdFindOption(ppd, "SensibilityO")) != NULL)\r                SensibilityO = atoi(option->defchoice);\r        else\r           SensibilityO = 10;\r     debug("SensibilityO : %d", SensibilityO);\r\r     //STartPrinting value\r  if ((val = cupsGetOption("DetectAuto", num_options, options)) != NULL)\r         DetectAuto = atoi(val);\r        else if ((option = ppdFindOption(ppd, "DetectAuto")) != NULL)\r          DetectAuto = atoi(option->defchoice);\r  else\r           DetectAuto = 0;\r        debug("DetectAuto : %d", DetectAuto);\r\r //Distance Printing value\r      if ((val = cupsGetOption("StartDist", num_options, options)) != NULL)\r          StartDist = atoi(val) * 12;\r    else if ((option = ppdFindOption(ppd, "StartDist")) != NULL)\r           StartDist = atoi(option->defchoice) * 12;\r      else\r           StartDist = 0;\r debug("StartDist : %d", StartDist);\r\r   //Sharpen option\r       if ((val = cupsGetOption("Soften", num_options, options)) != NULL)\r             strcpy(Soften, val);\r   else if ((option = ppdFindOption(ppd, "Soften")) != NULL)\r              strcpy(Soften, option->defchoice);\r     else\r           strcpy(Soften, "False");\r       upper(Soften);\r debug("Soften : %s", Soften);\r  \r\r              \r               \r//-----------------------------//\r//MAG OPTIONS\r//-----------------------------//      \r  if ((val = cupsGetOption("Coercivity", num_options, options)) != NULL)\r      strcpy(Coercivity, val);\r  else if ((option = ppdFindOption(ppd, "Coercivity")) != NULL)\r       strcpy(Coercivity, option->defchoice);\r  else\r  strcpy(Coercivity, "True");\r  upper(Coercivity);        \r  debug("Coercivity : %s", Coercivity);\r  \r  if(strcmp(Coercivity,"BLANK") || !(strcmp(EjectCard, "ONLYENCO")) ) {\r  \r if ((val = cupsGetOption("Track1", num_options, options)) != NULL)\r             strcpy(Track1, val);\r   else if ((option = ppdFindOption(ppd, "Track1")) != NULL)\r              strcpy(Track1, option->defchoice);\r     else\r           strcpy(Track1, "ISO1");\r        upper(Track1);\r debug("Track1 : %s", Track1);\r  \r       if ((val = cupsGetOption("Density1", num_options, options)) != NULL)\r                   strcpy(Density1, val);\r else if ((option = ppdFindOption(ppd, "Density1")) != NULL)\r            strcpy(Density1, option->defchoice);\r   else\r           strcpy(Density1, "210 bpi");\r   upper(Density1);\r       debug("Density1 : %s", Density1);\r      \r       if ((val = cupsGetOption("Track2", num_options, options)) != NULL)\r             strcpy(Track2, val);\r   else if ((option = ppdFindOption(ppd, "Track2")) != NULL)\r              strcpy(Track2, option->defchoice);\r     else\r           strcpy(Track2, "ISO2");\r        upper(Track2);\r debug("Track2 : %s", Track2);\r  \r       if ((val = cupsGetOption("Density2", num_options, options)) != NULL)\r           strcpy(Density2, val);\r else if ((option = ppdFindOption(ppd, "Density2")) != NULL)\r            strcpy(Density2, option->defchoice);\r   else\r           strcpy(Density2, "75 bpi");\r    upper(Density2);\r       debug("Density2 : %s", Density2);\r      \r       if ((val = cupsGetOption("Track3", num_options, options)) != NULL)\r             strcpy(Track3, val);\r   else if ((option = ppdFindOption(ppd, "Track3")) != NULL)\r              strcpy(Track3, option->defchoice);\r     else\r           strcpy(Track3, "ISO3");\r        upper(Track3);\r debug("Track3 : %s", Track3);\r  \r       if ((val = cupsGetOption("Density3", num_options, options)) != NULL)\r           strcpy(Density3, val);\r else if ((option = ppdFindOption(ppd, "Density3")) != NULL)\r            strcpy(Density3, option->defchoice);\r   else\r           strcpy(Density3, "210 bpi");\r   upper(Density3);\r       debug("Density3 : %s", Density3);\r      \r       if ((val = cupsGetOption("KeepCard", num_options, options)) != NULL)\r           strcpy(KeepCard, val);\r else if ((option = ppdFindOption(ppd, "KeepCard")) != NULL)\r            strcpy(KeepCard, option->defchoice);\r   else\r           strcpy(KeepCard, "True");\r      upper(KeepCard);        \r       debug("KeepCard : %s", KeepCard);\r      \r       \r       if ((val = cupsGetOption("Track1Data", num_options, options)) != NULL) {\r               sprintf(track[0],"\033Dm;1;%s\015", val);\r              info("%s",track[0]);\r           doMag |= 0x01;\r }\r      else\r           track[0][0] = 0x00;\r    \r       debug("Track1Data : %s", &track[0]);\r   \r       if ((val = cupsGetOption("Track2Data", num_options, options)) != NULL) {\r               sprintf(track[1],"\033Dm;2;%s\015", val);\r              info("%s",track[1]);\r           doMag |= 0x02;\r }\r      else\r           track[1][0] = 0x00;\r    \r       debug("Track2Data : %s", &track[1]);\r   \r       if ((val = cupsGetOption("Track3Data", num_options, options)) != NULL) {\r               sprintf(track[2],"\033Dm;3;%s\015", val);\r              info("%s",track[2]);\r           doMag |= 0x04;\r }\r      else\r           track[2][0] = 0x00;\r    \r       debug("Track3Data : %s", &track[2]);\r   \r       if (!(strcmp(Coercivity, "HICO")))\r             output("\033Pmc;h\015");        \r       else\r           output("\033Pmc;l\015");\r               \r       output("\033Pmt;1;%s\015",Track1);\r     output("\033Pmd;1;%s\015",Density1);\r   output("\033Pmt;2;%s\015",Track2);\r     output("\033Pmd;2;%s\015",Density2);\r   output("\033Pmt;3;%s\015",Track3);\r     output("\033Pmd;3;%s\015",Density3);\r   }\r  \r\r\r  \rif(cupsRasterReadHeader(ras, &header)){\r      ViewInfo(ppd,&header);\r//Coherent info between manual add option and auto cups add option\r      if(cOrientation) {\r             header.Orientation = cOrientation; \r      }\r      if(cSides != -1) {\r           header.Duplex = cSides; \r      }\r         \r      \r      if(model == 3){//Quantum\r               \r               if (!(strcmp(header.OutputType, "AutoH")))\r                     hopper = 0;\r            else if (!(strcmp(header.OutputType, "AlterH")))\r                       hopper = 3;\r            else if (!(strcmp(header.OutputType, "Tray1")))\r                        hopper = 1;\r            else if (!(strcmp(header.OutputType, "Tray2")))\r                        hopper = 2;\r            else hopper = 0;\r               \r               feeder = 5;\r            if ( !(strcmp(header.MediaType, "Feeder1") ))  //header.MediaWeight == 1)\r                      feeder = 1;\r            else if (!(strcmp(header.MediaType, "Feeder2"))) //(header.MediaWeight == 2)\r                   feeder = 2;\r            else if (!(strcmp(header.MediaType, "Alter")))  //(header.MediaWeight == 3)\r                    feeder = 3;\r            else if (!(strcmp(header.MediaType, "Auto")))  //(header.MediaWeight == 0)\r                     feeder = 0;\r            \r               \r               if (feeder != 5){\r                      output("\033Piem;%d;%d\015", feeder,hopper);\r                   info("\033Piem;%d;%d\015", feeder,hopper);\r             }\r      }\r      if(model == 2){ //TATTOO\r               insert = '0';\r          if (!(strcmp(header.MediaType, "Feeder"))) //header.MediaWeight == 1)\r                  insert = 'F';\r          else if (!(strcmp(header.MediaType, "Manual"))) //header.MediaWeight == 2)\r                     insert = 'M';\r          else if (!(strcmp(header.MediaType, "Auto"))) //header.MediaWeight == 3)\r                       insert = 'B';\r          //else insert = '0';\r           \r               if(insert != '0'){\r                     output("\033Pmi;%c\015", insert);\r              }\r      }\r      //color panel\r  if(model != 2){\r                output("\033Pl;a;=;%d\015", Brightness);\r               output("\033Pc;a;=;%d\015", Contrast);\r         output("\033Pc;o;=;%d\015", SensibilityO);\r     }\r      output("\033Pc;k;=;%d\015", SensibilityK);\r     output("\033Ps;k;=;%d\015", QualityK);\r output("\033Pr;%s\015",header.MediaColor);\r\r    // Process Card Test as needed...\r  if ( !(strcmp(EjectCard, "NONE")) ) { // || !(strcmp(EjectCard, "Keep"))) {\r        \r       if (header.cupsColorSpace == CUPS_CSPACE_RGB){\r                 colorspace = CUPS_CSPACE_RGB;\r  }\r      else{\r          fatal("Fail CUPS_CSPACE_RGB ");\r                goto quitmain;\r }\r      //  dwSizeNeeded: Size of lpRecto in pixels\r    if (header.cupsBitsPerPixel == 24){\r            //dwSizeNeeded = header.cupsHeight * header.cupsWidth * 5;\r             dwSizeNeeded = 1016 * 648 *  5;\r                if(lpRecto){\r                   debug("lpRecto Free memory");\r                  free(lpRecto);\r                 lpRecto = NULL;\r                }\r              lpRecto = malloc(dwSizeNeeded);\r                if (lpRecto){\r                  debug("lpRecto: size demands %d pixels... ", dwSizeNeeded);\r            }\r              else{\r                  fatal("Fail memory for lpRecto : %d pixels... ", dwSizeNeeded);\r                        goto quitmain;\r                 }//End of lpRecto\r              if(header.Duplex || cSides){\r                   //dwSizeNeeded = header.cupsHeight * header.cupsWidth * 5;\r                     dwSizeNeeded = 1016 * 648 *  5;\r                        if(lpVerso){\r                           debug("lpVerso Free memory");\r                          free(lpVerso);\r                         lpVerso = NULL;\r                        }\r                      lpVerso = malloc(dwSizeNeeded);\r                        if (lpVerso){\r                          debug("lpVerso: size demands %d pixels... ", dwSizeNeeded);\r                    }\r                      else\r                   {\r                              fatal("Fail memory for lpVerso : %d pixels ", dwSizeNeeded);\r                           goto quitmain;\r                 }\r              }// end of if Duplex\r   }//end of cupRaster = 24\r       else{\r          fatal("Fail Not mode 24 bits ");\r               goto quitmain;\r }//End of lpRecto\r      // Process pages as needed...\r  page = 0;\r      NbCopy = header.NumCopies;\r     do {\r           page++;\r                info("PAGE: %d %d", page, header.NumCopies);\r           if(header.Duplex || cSides){\r                   if((page & 0x01)){\r                             info("Two sides: SEQUENCE RECTO");\r                             output("\033Ss\015\033Sr\015");\r                                if(doMag & 0x01) {\r                                     output("%s",track[0]);\r                         }\r                              if(doMag & 0x02) {\r                                     output("%s",track[1]);\r                         }\r                              if(doMag & 0x04) {\r                                     output("%s",track[2]);\r                         }\r                              lpMem = lpRecto;\r                       }\r                      else{\r                          info("Two sides: SEQUENCE VERSO");\r                             output("\033Sv\015");\r                          lpMem = lpVerso;\r                       }\r              }\r              else {\r                 output("\033Ss\015\033Sr\015");\r                        if(doMag) {\r                            if(doMag & 0x01) {\r                                     output("%s",track[0]);\r                         }\r                              if(doMag & 0x02) {\r                                     output("%s",track[1]);\r                         }\r                              if(doMag & 0x04) {\r                                     output("%s",track[2]);\r                         }\r                      }\r                      lpMem = lpRecto;\r                       info("One side: SEQUENCE RECTO");\r              }\r              \r               if ((header.cupsHeight * header.cupsWidth) == 658368 )\r                 ShareRVBtoMem(header.cupsHeight, header.cupsWidth,  header.cupsBytesPerLine, ras);\r             else\r                   ShareRVBtoMemWindow(header.cupsHeight, header.cupsWidth,  header.cupsBytesPerLine, ras,&header);\r               \r               if (!(strcmp(Soften, "FALSE"))){\r                       Sharpen( &lpMem[0],648,1016);\r                  Sharpen( &lpMem[1016*648],648,1016);\r                   Sharpen( &lpMem[2*1016*648],648,1016);\r         }\r              StartPage(ppd, &header, ras);\r          EndPage(&header);\r              if(header.Duplex || cSides) {\r                  if(!(page & 0x01)){\r                            output("\033Se\015");\r                          NbCopy -= 1;\r                           while (NbCopy) {\r                                       info("Copy page %d",NbCopy);\r                                   NbCopy -= 1;\r                                   output("\033Ss\015\033Sr\015");\r                                        if(doMag & 0x01) {\r                                             output("%s",track[0]);\r                                 }\r                                      if(doMag & 0x02) {\r                                             output("%s",track[1]);\r                                 }\r                                      if(doMag & 0x04) {\r                                             output("%s",track[2]);\r                                 }\r                                      lpMem = lpRecto;\r                                       StartPage(ppd, &header, ras);\r                                  EndPage(&header);\r                                      output("\033Sv\015");\r                                  lpMem = lpVerso;\r                                       StartPage(ppd, &header, ras);\r                                  EndPage(&header);\r                                      output("\033Se\015");\r                          }\r                              NbCopy = header.NumCopies;\r                     }\r              }\r              else {\r                 output("\033Se\015");\r                  NbCopy -= 1;\r                   if (NbCopy >= 1) {\r                             info("Copy %d page(s)",NbCopy);\r                                output("\033Sc;%d\015", NbCopy);\r                       }\r                      NbCopy = header.NumCopies;\r             }\r      }\r      while (cupsRasterReadHeader(ras, &header));\r    output("\033Se\015");\r  \r       /*if((header.Duplex || cSides) && (page & 0x01)) {\r             if ( !(strcmp(EjectCard, "Keep"))) {\r                   output("\033Ste\015");\r         }\r              else {\r                 output("\033Se\015");\r          }\r      }\r      page = 1;\r      do {\r           //cupsRasterReadPixels(ras, lpImgBuf, WidthLine)\r       }\r      while (cupsRasterReadHeader(ras, &header));\r    //NbCopy = header.NumCopies;\r#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)\r      struct sigaction action;        \r#endif \r#ifdef HAVE_SIGSET             \r       sigset(SIGTERM, CancelJob);\r#elif defined(HAVE_SIGACTION)\r      memset(&action, 0, sizeof(action));\r\r   sigemptyset(&action.sa_mask);\r  action.sa_handler = CancelJob;\r sigaction(SIGTERM, &action, NULL);/\r#else\r      signal(SIGTERM, CancelJob);\r#endif \r    info("StartPage()");\r   output("\033Ss\015\033Sr\015");\r        if(doMag & 0x01) {\r             output("%s",track[0]);\r }\r      if(doMag & 0x02) {\r             output("%s",track[1]);\r }\r      if(doMag & 0x04) {\r             output("%s",track[2]);\r }\r                              \r                               \r       if ((val = cupsGetOption("RawData", num_options, options)) != NULL) {\r          strcpy(WtData,val);\r    }\r      else {\r         WtData[0] = 0x00;\r      }\r      \r       j = 0;\r i = 0;\r debug("%s", &WtData[j]);\r       output("\033Wcb;k\015");\r       \r       while(WtData[i] != 0x00 && i < 2047) {\r         if((WtData[i] == '|') && i) {\r                  //output("\033%s\015",&WtData[j]);\r                     WtData[i] = 0x00;\r                      output("\033%s\015",&WtData[j]);\r                       //debug("%d  %d : %s", i,j,&WtData[j]);\r                        i++;\r                   j=i;            \r               }\r              else {          \r                       i++;\r           }\r      }\r      output("\033Se\015");*/\r        \r       memset(end_usb,0x00,64);\r       if(fwrite( end_usb,sizeof(unsigned char),64,stdout) != 64) {\r           debug("Error: fails print end usb ...\n");\r     }\r      /*EndPage();*/\r     \r   }//End test Card\r   else {\r     page = 1;\r      do {\r           //cupsRasterReadPixels(ras, lpImgBuf, WidthLine)\r       }\r      while (cupsRasterReadHeader(ras, &header));\r    //NbCopy = header.NumCopies;\r#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)\r      struct sigaction action;        \r#endif \r#ifdef HAVE_SIGSET\r    sigset(SIGTERM, CancelJob);\r#elif defined(HAVE_SIGACTION)\r      memset(&action, 0, sizeof(action));\r\r   sigemptyset(&action.sa_mask);\r  action.sa_handler = CancelJob;\r sigaction(SIGTERM, &action, NULL);\r#else\r       signal(SIGTERM, CancelJob);\r#endif \r    info("StartPage()");\r   if (!(strcmp(EjectCard, "ISMART"))){\r    info("Inserting smart card.");\r         output("\033Sis\015");\r        }\r      else if (!(strcmp(EjectCard, "ICTLESS"))){\r      info("Inserting contactless card.");\r   output("\033Sic\015");\r        }\r      else if (!(strcmp(EjectCard, "EJECT"))){\r        info("Ejecting card.");\r        output("\033Se\015");\r }\r      else if (!(strcmp(EjectCard, "REJECT"))){\r       info("Rejecting card.");\r       output("\033Ser\015");\r        }\r      else if (!(strcmp(EjectCard, "TEST"))){\r         info("Self test card.");\r       output("\033St\015");\r }\r      else if (!(strcmp(EjectCard, "CLEAN"))){\r        info("Self cleaning card.");\r   output("\033Scp\015");\r        }\r      else if (!(strcmp(EjectCard, "AJUST"))){\r        info("Self adjusment.");\r       output("\033Sa\015");\r }\r      else if (!(strcmp(EjectCard, "SELFMAG"))){\r      info("Self magnetique adjusment.");\r    output("\033Stt;m\015");\r      }\r      else if (!(strcmp(EjectCard, "ONLYENCO"))){\r     info("Only encoding.");\r        \r              if(doMag){\r                     output("\033Ss\015");\r                  if(doMag & 0x01) {\r                             output("%s",track[0]);\r                 }\r                      if(doMag & 0x02) {\r                             output("%s",track[1]);\r                 }\r                      if(doMag & 0x04) {\r                             output("%s",track[2]);\r                 }\r                      \r                       output("\033Smw\015");\r                 if (!(strcmp(KeepCard, "FALSE"))) {\r                            info("Eject card after encoding.");\r                            output("\033Se\015");\r                  }\r                      else {\r                         info("Keep card after encoding.");\r                             output("\033Ste\015");\r                 }\r              }\r      }\r      memset(end_usb,0x00,64);\r       if(fwrite( end_usb,sizeof(unsigned char),64,stdout) != 64) {\r           debug("Error: fails print end usb ...\n");\r     }\r      \r       EndPage(&header);\r      }\r}//End of If cupsrastertHeader\r\rquitmain:;\r\r  //Free memory...\r       if(lpRecto){\r           debug("lpRecto Free memory");\r          free(lpRecto);\r         lpRecto = NULL;\r        }\r      if(lpVerso){\r           debug("lpVerso Free memory");\r          free(lpVerso);\r         lpVerso = NULL;\r        }\r      Shutdown();\r    ppdClose(ppd);\r // Close the raster stream...\r  cupsRasterClose(ras);\r  if (fd != 0)\r           close(fd);\r     // If no pages were printed, send an error message...\r  if (page == 0)\r         fatal("ERROR: No pages found!\n");\r      \r      info("End of printing - Returning %d", STATUS);\r        return (STATUS);\r}\r\r//===============================================================================================================\r//void ShareRVBtoMem(long Height, long Width, long WidthLine, cups_raster_t * ras,long offset)\r//===============================================================================================================\r///////////////////////////////////////////////////////\r// pMem ppV\r//                       ___________\r//                      |           |\r//                      |           |\r//                      |   Yellow  |\r//                      |           |\r//                      |___________|\r//                      |           |\r//                      |           |\r//                      |   Magenta |\r//                      |           |\r//                      |___________|\r//                      |           |\r//                      |           |\r//                      |   Cyan    |\r//                      |           |\r//                      |___________|\r//                      |           |\r//                      |           |\r//                      |   Black   |\r//                      |           |\r//                      |___________|\r//                      |           |\r//                      |           |\r//                      |   Grey    |\r//                      |           |\r//                      |___________|\r///////////////////////////////////////////////////////\rstatic void ShareRVBtoMem(long Height, long Width, long WidthLine, cups_raster_t * ras)\r{\r        //Pointeur sur image buffer\r    unsigned char *lpImgBuf, *lpYellow, *lpMagenta, *lpCyan, *lpBlack, *lpGray;\r\r  //valeur RVB courante & pr��ente\r    unsigned char red, green, blue, r, g, b;\r\r  //index pour scruter le fichier bitmap\r     long index_line, index_dot;\r\r  //Bool�n indiquant le premier bit de la chaine\r        long  stpt = 0;\r\r  long  offx = 0, offy = 0;\r  \r        lpImgBuf = malloc(WidthLine);\r\r if (!lpImgBuf)\r {\r              fatal("ShareRVBtoMem fail to book memory: size requested %d bytes... \n", WidthLine);\r          return;\r        }\r\r     lpYellow = &lpMem[0];\r  //memset(lpYellow,0x00,Width * Height);\r  memset(lpYellow,0x00,1016*648);\r      lpMagenta = &lpMem[Width * Height];\r  //memset(lpMagenta,0x00,Width * Height);\r  memset(lpMagenta,0x00,1016*648);\r      lpCyan = &lpMem[2 * Width * Height];\r  //memset(lpCyan,0x00,Width * Height);\r  memset(lpCyan,0x00,1016*648);  \r lpBlack = &lpMem[3 * Width * Height];\r  //memset(lpBlack,0x00,Width * Height);\r  memset(lpBlack,0x00,1016*648);\r        lpGray = &lpMem[4 * Width * Height];\r  //memset(lpGray,0xFF,Width * Height);\r  memset(lpGray,0xFF,1016*648);\r\r \r        ////////////////\r       //CAS PORTRAIT//\r       ////////////////\r       if ( (Height >= Width) || (cOrientation == PORTRAIT) )\r {\r              info("Portrait");\r              //Pour toutes les lignes de l'image\r            //for (index_line = Height; index_line > 0; index_line--)\r    for (index_line = 0; index_line < Height; index_line++)\r          {\r                      if (cupsRasterReadPixels(ras, lpImgBuf, WidthLine) == WidthLine)\r                       {\r                              r = 0xFF;\r                              g = 0xFF;\r                              b = 0xFF;\r                              stpt = 0;\r                              //Pour tous les points de la ligne\r                             for (index_dot = Width; index_dot > 0; index_dot--)\r                            {\r                                      red = lpImgBuf[(index_dot * 3)];\r                                       green = lpImgBuf[(index_dot * 3) + 1];\r                                 blue = lpImgBuf[(index_dot * 3) + 2];\r                                  //*(lpGray++) = (unsigned char) RgbToGray(red, green, blue);\r          lpGray[(index_line * 648) + index_dot] = (unsigned char) RgbToGray(red, green, blue);\r                                   if (blue == 0x00 && green == 0x00 && red == 0x00)\r                                      {\r                                              if (stpt == 0)  // !stpt\r                                               {\r                                                      //Erreur sur le premier point blanc par defaut\r              lpYellow[(index_line * 648) + index_dot] = 0x00;\r              lpMagenta[(index_line * 648) + index_dot] = 0x00;\r              lpCyan[(index_line * 648) + index_dot] = 0x00;\r              lpBlack[(index_line * 648) + index_dot] = 0xFF;\r                                                       //premier point trait�\r                                                       stpt = 1;\r                                              }\r\r                                             else\r                                           {\r                                                      //Cas point noir on met la couleur du point precedent\r              lpYellow[(index_line * 648) + index_dot] = ((0xFF - b));\r              lpMagenta[(index_line * 648) + index_dot] = ((0xFF - g));\r              lpCyan[(index_line * 648) + index_dot] = ((0xFF - r));\r              lpBlack[(index_line * 648) + index_dot] = 0xFF;\r                                                }\r                                      }\r                                      else\r                                   {\r                                              //Sauvegarde de la valeur precedente\r                                           r = red;\r                                               g = green;\r                                             b = blue;\r                                              //Traitement particulier pour le premier point\r            lpYellow[(index_line * 648) + index_dot] = ((0xFF - b));\r            lpMagenta[(index_line * 648) + index_dot] = ((0xFF - g));\r            lpCyan[(index_line * 648) + index_dot] = ((0xFF - r));\r            lpBlack[(index_line * 648) + index_dot] = 0x00;\r                                               //premier point traite\r                                         stpt = 1;\r                                      }\r                              }       // for point de la line\r                        }       // test read line = cupsRasterReadPixels\r               }               //for ligne\r//#endif\r   }                       //end if H>W\r   /////////////////\r      //CAS LANDSCAPE//\r      /////////////////\r      else\r   {\r              info("Landscape");\r             for (index_line = (Height); index_line > 0; index_line--)\r              {\r                      r = 0xFF;\r                      g = 0xFF;\r                      b = 0xFF;\r                      stpt = 0;\r                      if (cupsRasterReadPixels(ras, lpImgBuf, WidthLine) == WidthLine)\r                       {\r                              for (index_dot = 0; index_dot < Width; index_dot++)\r                            {\r                                      red = lpImgBuf[(index_dot * 3)];\r                                       green = lpImgBuf[(index_dot * 3) + 1];\r                                 blue = lpImgBuf[(index_dot * 3) + 2];\r                                  lpGray[(index_line) + (index_dot * Height)] = (unsigned char) RgbToGray(red, green, blue);\r          if(blue == 0x00 && green == 0x00 && red == 0x00)\r          {\r                                              if (stpt == 0)\r                                         {\r                                                      //Erreur sur le premier point blanc par defaut\r                                                 lpYellow[(index_line) + (index_dot * Height)] = 0x00;\r                                                  lpMagenta[(index_line) + (index_dot * Height)] = 0x00;\r                                                 lpCyan[(index_line) + (index_dot * Height)] = 0x00;\r                                                    lpBlack[(index_line) + (index_dot * Height)] = 0xFF;\r                                                   //premier point traite\r                                                 stpt = 1;\r                                              }\r                                              else\r                                           {\r                                                      //Cas point noir on met la couleur du point precedent\r                                                  lpYellow[(index_line) + (index_dot * Height)] = ((0xFF - b));\r                                                  lpMagenta[(index_line) + (index_dot * Height)] = ((0xFF - g));\r                                                 lpCyan[(index_line) + (index_dot * Height)] = ((0xFF - r));\r                                                    lpBlack[(index_line) + (index_dot * Height)] = (0xFF);\r                                         }\r                                      }\r                                      else\r                                   {\r                                              //Sauvegarde de la valeur precedente\r                                           r = red;\r                                               g = green;\r                                             b = blue;\r                                              //Traitement particulier pour le premier point\r                                         lpYellow[(index_line) + (index_dot * Height)] = ((0xFF - b));\r                                          lpMagenta[(index_line) + (index_dot * Height)] = ((0xFF - g));\r                                         lpCyan[(index_line) + (index_dot * Height)] = ((0xFF - r));\r                                            lpBlack[(index_line) + (index_dot * Height)] = 0x00;\r                                           //premier point traite\r                                         stpt = 1;\r                                      }\r                              }       // for point de la line\r                        }       // test read line\r              }               //for ligne\r    }                       //end else if H>W\r      free(lpImgBuf);\r\r\r\rstatic void ShareRVBtoMemWindow(long Height, long Width, long WidthLine, cups_raster_t * ras, const cups_page_header_t * header)\r{\r        //Pointeur sur image buffer\r    unsigned char *lpImgBuf, *lpYellow, *lpMagenta, *lpCyan, *lpBlack, *lpGray;\r\r  //valeur RVB courante & pr��ente\r    unsigned char red, green, blue, r, g, b;\r\r  //index pour scruter le fichier bitmap\r     long index_line, index_dot;\r\r  //Bool�n indiquant le premier bit de la chaine\r        long  stpt = 0;\r\r  long  offx = 0, offy = 0;\r  long  Hfix = 1016, Wfix = 648;\r  long  dot = 0, line =0;\r\r  lpImgBuf = malloc(WidthLine);\r\r      if (!lpImgBuf)\r {\r              fatal("ShareRVBtoMem fail to book memory: size requested %d bytes... \n", WidthLine);\r          return;\r        }\r\r     lpYellow = &lpMem[0];\r  memset(lpYellow,0x00,1016*648);\r        lpMagenta = &lpMem[1016*648];\r\r  memset(lpMagenta,0x00,1016*648);\r      lpCyan = &lpMem[2 * 1016*648];\r\r  memset(lpCyan,0x00,1016*648);\r        lpBlack = &lpMem[3 * 1016*648];\r\r  memset(lpBlack,0x00,1016*648);\r      lpGray = &lpMem[4 * 1016*648];\r  memset(lpGray,0xFF,1016*648);\r\r  //if (Height >= Width)\r  if(header->Orientation == 1 || header->Orientation == 3 || (cOrientation == PORTRAIT) )\r  {\r    if(Width%2)\r    {\r      \r        cupsRasterReadPixels(ras, lpImgBuf, WidthLine);\r        //info("Read odd line ");\r        Width--;\r    }\r    \r    if(Width > 648)\r      offx = (Width - 648)/2;\r    else\r      offx = 0;\r\r    if(Height > 1016)\r      offy = (Height - 1016)/2;\r    else\r      offy = 0;\r\r    Hfix = 1016;\r    Wfix = 648;\r  }\r  else\r  {\r    if(Height%2)\r    {\r        cupsRasterReadPixels(ras, lpImgBuf, WidthLine);\r        //info("Read odd line ");\r        Height--;\r    }\r\r    if(Width > 1016)\r      offx = (Width - 1016)/2;\r    else\r      offx = 0;\r\r    if(Height > 648)\r      offy = (Height - 648)/2;\r    else\r      offy = 0; \r\r    Hfix = 648;\r    Wfix = 1016;\r  }\r\r  //info(" offx : %d offy : %d", offx, offy);\r       ////////////////\r       //CAS PORTRAIT//\r       ////////////////\r       //if (Height >= Width)\r  if(header->Orientation == 1 || header->Orientation == 3 || (cOrientation == PORTRAIT) )\r       {\r    info("Portrait");\r    for (index_line = (Height); index_line > (Height - offy); index_line--)\r            {\r      cupsRasterReadPixels(ras, lpImgBuf, WidthLine);\r    }\r    //info(" H : %d  W: %d",Hfix,Wfix);\r          //Pour toutes les lignes de l'image\r    line = 0;\r              for (index_line; index_line > offy; index_line--)\r              {\r                      if (cupsRasterReadPixels(ras, lpImgBuf, WidthLine) == WidthLine)\r                       {\r                              r = 0xFF;\r                              g = 0xFF;\r                              b = 0xFF;\r                              stpt = 0;\r                              //Pour tous les points de la ligne\r        dot = 648;\r                          for (index_dot = (Width-offx); index_dot > offx; index_dot--)\r        //dot = 0;\r        //for (index_dot = offx; index_dot < (Width - offx); index_dot++)\r                             {\r                                      red = lpImgBuf[(index_dot * 3)];\r                                       green = lpImgBuf[(index_dot * 3) + 1];\r                                 blue = lpImgBuf[(index_dot * 3) + 2];\r          lpGray[(line*648) + (dot) ] = (unsigned char) RgbToGray(red, green, blue);\r                                     if (blue == 0x00 && green == 0x00 && red == 0x00)\r                                      {\r                                              if (stpt == 0)  // !stpt\r                                               {\r                                                      //Erreur sur le premier point blanc par defaut\r              lpYellow[(line*648) + (dot)] = 0x00;\r              lpMagenta[(line*648) + (dot)] = 0x00;\r              lpCyan[(line*648) + (dot)] = 0x00;\r              lpBlack[(line*648) + (dot)] = 0xFF;\r                                                       //premier point trait�\r                                                       stpt = 1;\r                                              }\r\r                                             else\r                                           {\r                                                      //Cas point noir on met la couleur du point precedent\r              lpYellow[(line*648) + (dot)] = ((0xFF - b));\r              lpMagenta[(line*648) + (dot)] = ((0xFF - g));\r              lpCyan[(line*648) + (dot)] = ((0xFF - r));\r              lpBlack[(line*648) + (dot)] = 0xFF;\r                                                }\r                                      }\r                                      else\r                                   {\r                                              //Sauvegarde de la valeur precedente\r                                           r = red;\r                                               g = green;\r                                             b = blue;\r                                              //Traitement particulier pour le premier point\r            lpYellow[(line*648) + (dot)] = ((0xFF - b));\r            lpMagenta[(line*648) + (dot)] = ((0xFF - g));\r            lpCyan[(line*648) + (dot)] = ((0xFF - r));\r            lpBlack[(line*648) + (dot)] = 0x00;\r                                               //premier point traite\r                                         stpt = 1;\r                                      }\r          dot--;\r                             }       // for point de la line\r                        }       // test read line = cupsRasterReadPixels\r      line++;\r         }               //for ligne\r    for (index_line ; index_line > 0; index_line--)\r                {\r                      if(cupsRasterReadPixels(ras, lpImgBuf, WidthLine) != WidthLine)\r      {\r        debug("Erreur de lecture line CUPS15");\r      }\r                }\r      }                       //end if H>W\r   /////////////////\r      //CAS LANDSCAPE//\r      /////////////////\r      else\r   {\r              info("Landscape");\r    //info("index_line: %d",Height);\r    for (index_line = (Height); index_line > (Height - offy); index_line--)\r            {\r      if(cupsRasterReadPixels(ras, lpImgBuf, WidthLine) != WidthLine)\r      {\r        debug("erreur ");\r      }\r      //cupsRasterReadPixels(ras, lpImgBuf, WidthLine);\r    }\r    //info("index_line - offy: %d",index_line);\r    line = 648;//Hfix;\r    for (index_line ; index_line > offy; index_line--)\r          {\r      //info("index_line - offy: %d line : %d",index_line,line);\r                     r = 0xFF;\r                      g = 0xFF;\r                      b = 0xFF;\r                      stpt = 0;\r                      if (cupsRasterReadPixels(ras, lpImgBuf, WidthLine) == WidthLine)\r                       {\r                              //for (index_dot = 0; index_dot < Width; index_dot++)\r        dot = 0;\r        for (index_dot = offx; index_dot < (Width - offx); index_dot++)\r                         {\r                                      red = lpImgBuf[(index_dot * 3)];\r                                       green = lpImgBuf[(index_dot * 3) + 1];\r                                 blue = lpImgBuf[(index_dot * 3) + 2];\r                                  lpGray[(line) + (dot * 648)] = (unsigned char) RgbToGray(red, green, blue);\r          if(blue == 0x00 && green == 0x00 && red == 0x00)\r          {\r                                             if (stpt == 0)\r                                         {\r                                                      //Erreur sur le premier point blanc par defaut\r                                                 lpYellow[(line) + (dot * 648)] = 0x00;\r                                                 lpMagenta[(line) + (dot * 648)] = 0x00;\r                                                        lpCyan[(line) + (dot * 648)] = 0x00;\r                                                   lpBlack[(line) + (dot * 648)] = 0xFF;\r                                                  //premier point traite\r                                                 stpt = 1;\r                                              }\r                                              else\r                                           {\r                                                      //Cas point noir on met la couleur du point precedent\r                                                  lpYellow[(line) + (dot * 648)] = ((0xFF - b));\r                                                 lpMagenta[(line) + (dot * 648)] = ((0xFF - g));\r                                                        lpCyan[(line) + (dot * 648)] = ((0xFF - r));\r                                                   lpBlack[(line) + (dot * 648)] = (0xFF);\r                                                }\r                                      }\r                                      else\r                                   {\r                                              //Sauvegarde de la valeur precedente\r                                           r = red;\r                                               g = green;\r                                             b = blue;\r                                              //Traitement particulier pour le premier point\r                                         lpYellow[(line) + (dot * 648)] = ((0xFF - b));\r                                         lpMagenta[(line) + (dot * 648)] = ((0xFF - g));\r                                                lpCyan[(line) + (dot * 648)] = ((0xFF - r));\r                                           lpBlack[(line) + (dot * 648)] = 0x00;\r                                          //premier point traite\r                                         stpt = 1;\r                                      }\r          dot++;\r                             }       // for point de la line\r                        }       // test read line\r      line--;\r                }               //for ligne\r    for (index_line; index_line > 0; index_line--)\r         {\r      //cupsRasterReadPixels(ras, lpImgBuf, WidthLine);\r      //info("index_line %d",index_line);\r      if(cupsRasterReadPixels(ras, lpImgBuf, WidthLine) != WidthLine)\r      {\r        debug("erreur ");\r      }\r    }\r      }                       //end else if H>W\r\r  free(lpImgBuf);\r}\r\r\r//Sharpen (medium)\rint SharpenPattern2[5][5] = {\r      {-1,-1,-1,-1,-1},\r      {-1,-1,-1,-1,-1},\r      {-1,-1,49,-1,-1},\r      {-1,-1,-1,-1,-1},\r      {-1,-1,-1,-1,-1}\r};\r\rint Sharpen(unsigned char * lpMemIn, long Width, long Height)\r{\r long      index_line = 0,index_dot = 0;\r unsigned char *lpbDataOut , *lpbData;\r\r int  final = 0;\r int     x= 0,y=0;\r int  divisionFactor = 0;\r\r lpbDataOut = NULL;\r lpbDataOut = malloc(Width * Height);\r if (lpbDataOut)\r    debug("lpDataOut: size demands %d pixels... ", Width * Height);\r  else\r    fatal("Fail memory for lpDataOut : %d pixels ", Width * Height);\r\r for(y=-2; y<=2; y++)     // and for each pixel around our\r    for(x=-2; x<=2; x++)   //  "hot pixel"...\r              divisionFactor += SharpenPattern2[x+2][y+2];\r\r //lpbData ppV mem bmp brute\r lpbData = &lpMemIn[0];\r //lpbDataOut = &lpMemOut[0];\r for(index_line = 2; index_line < Height -2; index_line++)\r    for(index_dot = 2 ; index_dot < Width -2; index_dot++)\r {\r              //gridCounter=0;      // reset some values\r             final = 0;\r             for(y=-2; y<=2; y++)     // and for each pixel around our\r                      for(x=-2; x<=2; x++)   //  "hot pixel"...\r                              final += lpbData[(index_dot + x) + ((index_line + y) * Width)] * SharpenPattern2[y+2][x+2];\r\r           // and put it back into the right range\r                final /= divisionFactor;\r               //iMemFilter[index_dot + (index_line * Width)] = final;\r                lpbDataOut[(index_dot) + ((index_line) * Width)] = final;\r              if(final > 255)\r                        lpbDataOut[(index_dot) + ((index_line) * Width)] = 0xFF;\r               else if(final < 0)\r                     lpbDataOut[(index_dot) + ((index_line) * Width)] = 0x00;\r       }\r  index_dot = Height * Width;\r  for(index_line = 0; index_line < index_dot; index_line++)\r    lpbData[index_line] =  lpbDataOut[index_line];\r\r    //Free memory...\r   if(lpbDataOut)\r {\r              debug("lpbDataOut Free memory");\r               free(lpbDataOut);\r              lpbDataOut = NULL;\r     } \r\r  \r return(1);\r}\r\rvoid ViewInfo(const ppd_file_t * ppd, const cups_page_header_t * header)\r{\r  info("header->cupsWidth... : %d ", header->cupsWidth);\r\r     info("header->cupsHeight... : %d ", header->cupsHeight);\r       \r  info("header->MediaClass... : %s ", header->MediaClass);\r  info("header->MediaColor... : %s ", header->MediaColor);\r  info("header->MediaType... : %s ", header->MediaType); \r  info("header->OutputType... : %s ", header->OutputType);\r  info("header->CutMedia... : %d ", header->CutMedia);      \r\r  info("header->Duplex... : %d ", header->Duplex);    \r  info("header->HWResolution... : %d %d ", header->HWResolution[0],header->HWResolution[1]);\r  info("header->ManualFeed... : %d ", header->ManualFeed);\r  info("header->MediaPosition... : %d ", header->MediaPosition);       \r  info("header->MediaWeight... : %d ", header->MediaWeight);   \r\r  info("header->NumCopies... : %d ", header->NumCopies);      \r  info("header->Orientation... : %d ", header->Orientation);\r  info("header->PageSize... : %d ,%d ", header->PageSize[0], header->PageSize[1]);        \r\r  info("header->TraySwitch... : %d ", header->TraySwitch);\r\r  info("header->Tumble... : %d ", header->Tumble);        \r  info("header->cupsWidth... : %d ", header->cupsWidth);\r\r\r    info("header->cupsHeight... : %d ", header->cupsHeight);\r       info("header->ImagingBoundingBox... : %d %d %d %d", header->ImagingBoundingBox[0],header->ImagingBoundingBox[1],header->ImagingBoundingBox[2],header->ImagingBoundingBox[3]);   \r  info("header->PageSize... : %d ,%d ", header->PageSize[0], header->PageSize[1]);     \r\r\r  info("header->Margins... : %d , %d", header->Margins[0],header->Margins[1]);       \r\r  info("header->cupsBitsPercolor... : %d ", header->cupsBitsPerColor);        \r       info("header->cupsBitsPerPixel... : %d ", header->cupsBitsPerPixel);    \r       info("header->cupsBitsPerline... : %d ", header->cupsBytesPerLine);     \r       info("header->cupsCompression... : %d ", header->cupsCompression);      \r\r      info("header->cupsRowCount... : %d ", header->cupsRowCount);    \r       info("header->cupsRowFeed... : %d ", header->cupsRowFeed);      \r       info("header->cupsRowStep... : %d ", header->cupsRowStep);      \r       info("header->cupsColorSpace... : %d ", header->cupsColorSpace);        \r\r      info("header->cupsColorOrder... : %d ", header->cupsColorOrder);        \r  \r  info("header->InsertSheet... : %d ", header->InsertSheet);        // Width of page image in pixels //\r  info("header->Jog... : %d ", header->Jog);        // Width of page image in pixels //\r  info("header->LeadingEdge... : %d ", header->LeadingEdge);        // Width of page image in pixels //\r  info("header->ManualFeed... : %d ", header->ManualFeed);  // Width of page image in pixels //\r  info("header->MediaPosition... : %d ", header->MediaPosition);    // Width of page image in pixels //\r  info("header->MediaWeight... : %d ", header->MediaWeight);        // Width of page image in pixels //\r  info("header->MirrorPrint... : %d ", header->MirrorPrint);        // Width of page image in pixels //\r  info("header->NegativePrint... : %d ", header->NegativePrint);    // Width of page image in pixels //\r  info("header->OutputFaceUp... : %d ", header->OutputFaceUp);      // Width of page image in pixels //\r  info("header->Separations... : %d ", header->Separations);        // Width of page image in pixels //\r}\r\rvoid ViewInfoPPD(const ppd_file_t * ppd)\r{\r  info("PPD->Langage Level # - %d", ppd->language_level);\r\r\r  info("PPD->color_device # - %d", ppd->color_device);\r  info("PPD->variable_sizes # - %d", ppd->variable_sizes);\r  info("PPD->accurate_screens # - %d", ppd->accurate_screens);\r  info("PPD->contone_only # - %d", ppd->contone_only);\r  info("PPD->landscape # - %d", ppd->landscape);\r  info("PPD->model_number # - %d", ppd->model_number);\r  info("PPD->manual_copies # - %d", ppd->manual_copies);\r  info("PPD->throughput # - %d", ppd->throughput);\r  info("PPD->colorspace # - %d", ppd->colorspace);\r  info("PPD->num_emulations # - %d", ppd->num_emulations);\r  info("PPD->emulation # - %s", ppd->emulations);\r\r  info("PPD->jcl_begin # - %s", ppd->jcl_begin);\r  info("PPD->pjcl_end # - %s", ppd->jcl_end);\r  info("PPD->lang_encoding # - %s", ppd->lang_encoding);\r\r  info("PPD->lang_version # - %s", ppd->lang_version);\r  info("PPD->modelname # - %s", ppd->modelname);\r  info("PPD->ttrasterizer # - %s", ppd->ttrasterizer);\r  info("PPD->manufacturer # - %s", ppd->manufacturer);\r  info("PPD->product # - %s", ppd->product);\r  info("PPD->nickname # - %s", ppd->nickname);\r  info("PPD->shortnickname # - %s", ppd->shortnickname);\r  info("PPD->num_groups # - %d", ppd->num_groups);\r  info("PPD->num_sizes # - %d", ppd->num_sizes);\r  info("PPD->sizes[0] # - %d, %s, %f, %f, %f, %f, %f, %f", ppd->sizes[0].marked,ppd->sizes[0].name,\r  ppd->sizes[0].width,ppd->sizes[0].length,ppd->sizes[0].left,ppd->sizes[0].right,ppd->sizes[0].top );\r\r\r  info("PPD->custom_min # - %f, %f", ppd->custom_min[0],ppd->custom_min[1]);\r  info("PPD->custom_max # - %f, %f", ppd->custom_max[0],ppd->custom_max[1]);\r  info("PPD->custom_margins # - %f,%f,%f,%f", ppd->custom_margins[0],ppd->custom_margins[1]);\r  info("PPD->num_consts # - %d", ppd->num_consts);\r\r  info("PPD->num_fonts # - %d", ppd->num_fonts);\r  info("PPD->num_profiles # - %d", ppd->num_profiles);\r  info("PPD->num_filters # - %d", ppd->num_filters);\r  info("PPD->filters # - %s", ppd->filters[0]);\r\r  info("PPD->flip_duplex # - %d", ppd->flip_duplex);\r}\r/* End of rastertoevolis.c,v 2.0*/\r\r
\ No newline at end of file
+// 28/06/2004 gestion du YMCKOS + refonte des fichiers ppd et fichiers d'installation\r // 20/10/2004 ajout filtre sharpen Pebble v3\r\r/*\r *\r * Contents:\r *\r *   Setup()        - Prepare the printer for printing.\r *   StartPage()    - Start a page of graphics.\r *   EndPage()      - Finish a page of graphics.\r *   Shutdown()     - Shutdown the printer.\r *   CompressData() - Compress a line of graphics.\r *   OutputLine()   - Output a line of graphics.\r *   main()         - Main entry and processing of driver.\r */\r\r\r#include <string.h>\r#include <stdlib.h>\r#include <sys/stat.h>\r#include <signal.h>\r#include <ctype.h>\r#include <fcntl.h>\r#include <stdarg.h>\r#include <stdio.h>\r#include "evolis.h"\r#include "evoliserror.h"\r#include "cups.h"\r#include "ppd.h"\r#include "raster.h"\r\r// Model numbers...\r#define EVOLIS_1  0\r#define CUPS15    1\r\r#define PORTRAIT 1\r#define LANDSCAPE     2\r\r\rchar Track1[10],            /* STP options */\r  Track2[10],\r  Track3[10],\r  Density1[10],\r  Density2[10],\r  Density3[10],\r  EjectCard[10],\r  TestCard[10],\r  KeepCard[10],\r  InkType[10],\r  Coercivity[10];\r\r// Prototypes...\r\rvoid Setup(void);\rvoid StartPage(const ppd_file_t * ppd, const cups_page_header_t * header, cups_raster_t * ras);\rvoid EndPage(const cups_page_header_t * header);\rvoid Shutdown(void);\rvoid CancelJob(int sig);\r\r// Dealing data functions\rstatic void ShareRVBtoMem(long Height, long Width, long WidthLine, cups_raster_t * ras);\rstatic void ShareRVBtoMemWindow(long Height, long Width, long WidthLine, cups_raster_t * ras,const cups_page_header_t * header);\r//void ShareCMYtoMem(long Height, long Width, long WidthLine, cups_raster_t * ras);\rvoid ViewInfo(const ppd_file_t * ppd, const cups_page_header_t * header);\rint Sharpen(unsigned char * lpMemIn ,/*unsigned char * lpMemOut,*/ long Width, long Height);\rvoid ViewInfoPPD(const ppd_file_t * ppd);\r\r\rstatic  int     page;                 /* Current page */\rstatic         int     cOrientation,cSides,tMargin,lMargin,rMargin,bMargin;\r/*\r * 'Setup()' - Prepare the printer for printing.\r */\r\rvoid upper(char * pt)\r{\r  while(*pt != 0x00) {\r           if( *pt > 0x60){\r                       *pt -= 0x20;\r           }\r              pt++;\r  }\r\r \r//===============================================================================================================\rvoid Setup(void)\r//===============================================================================================================\r{\r  info("Setup()");\r}\r\r\r/*\r * 'StartPage()' - Start a page of graphics.\r */\r\r//===============================================================================================================\rvoid StartPage(const ppd_file_t * ppd,      /* I - PPD file */\r            const cups_page_header_t * header,       /* I - Page header */\r         cups_raster_t * ras)\r//===============================================================================================================\r{\r  int   putB = 0, overfb = 1;\r  int   a,b;\r\r#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)\r       struct sigaction action;        /* Actions for POSIX signals */\r#endif /* HAVE_SIGACTION && !HAVE_SIGSET */\r    \r#ifdef HAVE_SIGSET             /* Use System V signals over POSIX to avoid bugs */\r    sigset(SIGTERM, CancelJob);\r#elif defined(HAVE_SIGACTION)\r      memset(&action, 0, sizeof(action));\r\r   sigemptyset(&action.sa_mask);\r  action.sa_handler = CancelJob;\r sigaction(SIGTERM, &action, NULL);\r#else\r       signal(SIGTERM, CancelJob);\r#endif /* HAVE_SIGSET */\r\r  info("StartPage()");\r  if(header->Duplex || cSides){\r           if((page & 0x01)){//front\r              overfb = 1;\r    }\r      else{//back\r            overfb = 2;\r    }\r    }\r  \r  if(!(strcmp(header->MediaColor, "k")) || !(strcmp(header->MediaColor, "kbl"))\r      || !(strcmp(header->MediaColor, "kgo")) || !(strcmp(header->MediaColor, "h"))\r      || !(strcmp(header->MediaColor, "kgr")) || !(strcmp(header->MediaColor, "ksi"))\r      || !(strcmp(header->MediaColor, "ksc")) || !(strcmp(header->MediaColor, "ka"))\r      || !(strcmp(header->MediaColor, "kw")) || !(strcmp(header->MediaColor, "kr")))\r  {\r    info("PRINT K");\r    ConvertRVBtoK(&lpMem[4 * (dwSizeNeeded / 5)], dwSizeNeeded, 1016, 648, &lpMem[3 * (dwSizeNeeded / 5)]);\r    DBNC(0,1,0);\r  }\r  else if(!(strcmp(header->MediaColor, "ko")))\r  {\r    info("PRINT KO");\r    ConvertRVBtoK(&lpMem[4 * (dwSizeNeeded / 5)], dwSizeNeeded, 1016, 648, &lpMem[3 * (dwSizeNeeded / 5)]);\r    DBNC(0,1,overfb);\r  }\r  else if(!(strcmp(header->MediaColor, "ymcko")) || \r   !(strcmp(header->MediaColor, "ymckos")))\r        //|| !(strcmp(header->MediaColor, "ymckok")) )\r  {\r    info("PRINT YMCKO");\r    if(!(strcmp(header->MediaColor, "ymckos")))\r    {\r      if(!DetectAuto)\r      {\r         GetFirstYMCDot(1016, 648 , &a, &b);\r         output("\033Psp;%.4d\015", b);\r         debug("DetectAuto \033Psp;%.4d\015", b);\r      }\r     else\r     {\r         output("\033Psp;%.4d\015", StartDist );\r         debug("StartDist \033Psp;%.4d\015", StartDist );\r      }\r    }\r    if (!(strcmp(BlackIn, "ALL")))\r    {\r      putB = 1;\r    }\r    else\r    {\r      putB = 0;\r      KinYMC(1016, 648);\r    }\r        \r    if (!(strcmp(ColorSmooth, "CLASSIC"))) DBNC(1,putB,overfb);\r    else if (!(strcmp(ColorSmooth, "HIGHT"))) DBNC(2,putB,overfb);\r    else if (!(strcmp(ColorSmooth, "VERYHIGHT"))) DBNC(3,putB,overfb);\r   }\r   else if (!(strcmp(header->MediaColor, "ymckok")))\r   {\r    if (!(strcmp(BlackIn, "ALL")))\r    {\r      putB = 1;\r    }\r    else\r    {\r      putB = 0;\r      KinYMC(1016, 648);\r    } \r\r    if(header->Duplex || cSides)\r    {\r      if((page & 0x01))//front\r      {\r        info("PRINT FRONT YMCKOK");\r        if (!(strcmp(ColorSmooth, "CLASSIC"))) DBNC(1,putB,overfb);\r        else if (!(strcmp(ColorSmooth, "HIGHT"))) DBNC(2,putB,overfb);\r        else if (!(strcmp(ColorSmooth, "VERYHIGHT"))) DBNC(3,putB,overfb);\r      }\r      else\r      {\r        info("PRINT BACK YMCKOK");\r        ConvertRVBtoK(&lpMem[4 * (dwSizeNeeded / 5)], dwSizeNeeded, header->cupsHeight, header->cupsWidth, &lpMem[3 * (dwSizeNeeded / 5)]);\r        DBNC(0,1,0);\r      }\r    }\r    else {\r        info("PRINT FRONT YMCKOK");\r        if (!(strcmp(ColorSmooth, "CLASSIC"))) DBNC(1,putB,overfb);\r        else if (!(strcmp(ColorSmooth, "HIGHT"))) DBNC(2,putB,overfb);\r        else if (!(strcmp(ColorSmooth, "VERYHIGHT"))) DBNC(3,putB,overfb);\r    }\r    }\r}\r\r\r/*=========================================\r * 'EndPage()' - Finish a page of graphics.\r ==========================================*/\r\r//===============================================================================================================\rvoid EndPage(const cups_page_header_t * header)      /* I - Page header */\r//===============================================================================================================\r{\r#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)\r struct sigaction action;        /* Actions for POSIX signals */\r#endif /* HAVE_SIGACTION && !HAVE_SIGSET */\r\r#ifdef HAVE_SIGSET         /* Use System V signals over POSIX to avoid bugs */\r    sigset(SIGTERM, SIG_IGN);\r#elif defined(HAVE_SIGACTION)\r        memset(&action, 0, sizeof(action));\r    sigemptyset(&action.sa_mask);\r  action.sa_handler = SIG_IGN;\r   sigaction(SIGTERM, &action, NULL);\r#else\r       signal(SIGTERM, SIG_IGN);\r#endif /* HAVE_SIGSET */\r     \r       info("EndPage()");\r}\r//=======================================//\r// 'Shutdown()' - Shutdown the printer.\r\r//=======================================//\rvoid Shutdown(void)\r{\r    info("Shutdown()");\r}\r\r//===========================================//\r// 'CancelJob()' - Cancel the current job...\r//==========================================//\rvoid CancelJob(int sig)              /* I - Signal */\r{\r     info("CancelJob()");\r   if(lpRecto)\r    {\r              debug("CancelJob lpRecto Free memory()");\r              free(lpRecto);\r         lpRecto = NULL;\r        }\r      if(lpVerso)\r    {\r              debug("CancelJob lpVerso Free memory()");\r              free(lpVerso);\r         lpVerso = NULL;\r        }\r\r}\r\r//================================================//\r// 'main()' - Main entry and processing of driver.\r//================================================//\r//===============================================================================================================\rint                                /* O - Exit status */\rmain(int argc,                    /* I - Number of command-line arguments */\r     char *argv[])           /* I - Command-line arguments */\r{\r  cups_raster_t       *ras;      /* Raster stream for printing */\r  cups_page_header_t  header;        /* Page header from file */\r  ppd_file_t          *ppd;           /* PPD file */\r  ppd_option_t        *option;       /* PPD option */\r  cups_option_t       *options;        /* CUPS options */\r  \r  int             model;\r  int            fd;                           /* File descriptor */\r  int               num_options;    /* Number of CUPS options */\r  const char       *val;           /* CUPS option value */\r  char          insert;\r  int           hopper =0;\r  int                feeder =0;\r  unsigned int       index_copy, NbCopy;     /* Numbers of copies */\r  char          end_usb[65];\r  \r  unsigned char doMag = 0x00;\r  char            track[4][1024];\r  \r  char               WtData[2048];\r  int             i = 0, j = 0;\r  \r  lpVerso = NULL;\r  lpRecto = NULL;\r  // Make sure status messages are not buffered...\r  setbuf(stderr, NULL);\r  info("Start Process");\r  //Check command-line...\r  if (argc < 6 || argc > 7){\r        //We don't have the correct number of arguments; write an error message and return.\r    fatal("rastertoevolis job-id user title copies options [file]");\r       return (STATUS);\r       }\r  //Open the page stream...\r  if (argc == 7) {\r       if ((fd = open(argv[6], O_RDONLY)) == -1) {\r            fatal("Unable to open raster file.");\r          sleep(1);\r              return (STATUS);\r       }\r  }\r  else {\r   fd = 0;\r  }\r /* info("filtre in %s",argv[0]);\r  info("job-id: %s",argv[1]);\r  info("user: %s",argv[2]);\r  info("title: %s",argv[3]);\r  info("copies: %s",argv[4]);\r  info("options:%s",argv[5]);\r  info("[file]: %s  ",argv[6]);*/\r  // Initialize the print device...\r  //info("PPD file: %s", getenv("PPD"));\r  ppd = ppdOpenFile(getenv("PPD"));\r  //ViewInfo(ppd);\r  model = 1;\r  if(!strcmp(ppd->modelname,"EVOLIS Pebble Card Printer")) model = 1;\r  else if(!strcmp(ppd->modelname,"EVOLIS Tattoo Card Printer")) model = 2;\r  else if(!strcmp(ppd->modelname,"EVOLIS Quantum Card Printer")) model = 3;\r  else if(!strcmp(ppd->modelname,"EVOLIS Dualys Card Printer")) model = 4;\r  \r  info("%s %d",ppd->modelname,model);\r  \r  ras = cupsRasterOpen(fd, CUPS_RASTER_READ);\r   \r  Setup();\r  //---Get the STP options, if any\r  num_options = cupsParseOptions(argv[5], 0, &options);\r  \r  cOrientation = 0;\r  cSides =  0;\r  lMargin = 0;\r  tMargin = 0;\r  rMargin = 0;\r  bMargin = 0;\r  \r//-----------------------------------//\r//---add command line option CUPS API\r//-----------------------------------//  \r         if ((val = cupsGetOption("orientation", num_options, options)) != NULL) {\r              upper((char *) val);\r           if(!strcmp(val,"PORTRAIT")) {\r                  cOrientation = PORTRAIT;\r               }\r              else {\r                 cOrientation = LANDSCAPE;\r              }\r              \r               debug("cOrientation : %d", cOrientation);\r      }\r      \r       if ((val = cupsGetOption("Sides", num_options, options)) != NULL) {\r            upper((char *)val);\r            if(!strcmp(val,"ONE-SIDED")) {\r                 cSides = 0;\r            }\r              else {\r                 cSides = 1;\r            }\r              debug("cSides : %d", cSides);\r  }\r      \r       if ((val = cupsGetOption("page-left", num_options, options)) != NULL) {\r                lMargin = atoi(val);\r           debug("lMargin : %d", lMargin);\r        }\r      \r       if ((val = cupsGetOption("page-top", num_options, options)) != NULL) {\r         tMargin = atoi(val);\r           debug("tMargin : %d", lMargin);\r        }\r      if ((val = cupsGetOption("page-right", num_options, options)) != NULL) {\r               rMargin = atoi(val);\r           debug("rMargin : %d", lMargin);\r        }\r      if ((val = cupsGetOption("page-bottom", num_options, options)) != NULL) {\r              bMargin = atoi(val);\r           debug("bMargin : %d", lMargin);\r        }\r      \r       if ((val = cupsGetOption("InkType", num_options, options)) != NULL)\r            strcpy(InkType, val);\r  else\r           memset(InkType,0x00,9);\r        upper(InkType);\r        debug("InkType : %s", InkType);\r\r//--------------------------------------//\r// STANDARD PRINTING OPTION\r//--------------------------------------//\r     if ((val = cupsGetOption("EjectCard", num_options, options)) != NULL)\r          strcpy(EjectCard, val);\r        else if ((option = ppdFindOption(ppd, "EjectCard")) != NULL)\r           strcpy(EjectCard, option->defchoice);\r  else\r           strcpy(EjectCard, "None");\r     upper(EjectCard);\r      debug("EjectCard : %s", EjectCard);\r    //ColorSmooth value\r    if ((val = cupsGetOption("ColorSmooth", num_options, options)) != NULL)\r                strcpy(ColorSmooth, val);\r      else if ((option = ppdFindOption(ppd, "ColorSmooth")) != NULL)\r         strcpy(ColorSmooth, option->defchoice);\r        else\r           strcpy(ColorSmooth, "Classic");\r        upper(ColorSmooth);\r    debug("ColorSmooth : %s", ColorSmooth);\r        //Brightness value\r     if ((val = cupsGetOption("Brightness", num_options, options)) != NULL)\r         Brightness = atoi(val);\r        else if ((option = ppdFindOption(ppd, "Brightness")) != NULL)\r          Brightness = atoi(option->defchoice);\r  else\r           Brightness = 10;\r       debug("Brightness : %d", Brightness);\r  //Contrast value\r       if ((val = cupsGetOption("Contrast", num_options, options)) != NULL)\r           Contrast = atoi(val);\r  else if ((option = ppdFindOption(ppd, "Contrast")) != NULL)\r            Contrast = atoi(option->defchoice);\r    else\r           Contrast = 10;\r debug("Contrast : %d", Contrast);\r      //OverlayPannel value\r  if ((val = cupsGetOption("OverlayPannel", num_options, options)) != NULL)\r              strcpy(OverlayPannel, val);\r    else if ((option = ppdFindOption(ppd, "OverlayPannel")) != NULL)\r               strcpy(OverlayPannel, option->defchoice);\r      else\r           strcpy(OverlayPannel, "FO");\r   upper(OverlayPannel);\r  debug("OverlayPannel : %s", OverlayPannel);\r    \r       //OverlayBackPannel value\r      if ((val = cupsGetOption("OverlayBackPannel", num_options, options)) != NULL)\r          strcpy(OverlayBackPannel, val);\r        else if ((option = ppdFindOption(ppd, "OverlayBackPannel")) != NULL)\r           strcpy(OverlayBackPannel, option->defchoice);\r  else\r           strcpy(OverlayBackPannel, "FO");\r       upper(OverlayBackPannel);\r      debug("OverlayBackPannel : %s", OverlayBackPannel);\r    \r       //Top B value\r  if ((val = cupsGetOption("TopCover", num_options, options)) != NULL)\r           TB = atoi(val);\r        else if ((option = ppdFindOption(ppd, "TopCover")) != NULL)\r            TB = atoi(option->defchoice);\r  else\r           TB = 0;\r        debug("TB: %d",TB);\r      \r     if ((val = cupsGetOption("TopLeft", num_options, options)) != NULL)\r            LB = atoi(val);\r        else if ((option = ppdFindOption(ppd, "TopLeft")) != NULL)\r             LB = atoi(option->defchoice);\r  else\r           LB = 0;\r        debug("LB: %d",LB);\r    if ((val = cupsGetOption("BottomCover", num_options, options)) != NULL)\r                BB = atoi(val);\r        else if ((option = ppdFindOption(ppd, "BottomCover")) != NULL)\r         BB = atoi(option->defchoice);\r  else\r           BB = 0;\r        debug("BB: %d",BB);\r    if ((val = cupsGetOption("BottomRight", num_options, options)) != NULL)\r                RB = atoi(val);\r        else if ((option = ppdFindOption(ppd, "BottomRight")) != NULL)\r         RB = atoi(option->defchoice);\r  else\r           RB = 0;\r        debug("RB: %d",RB);\r    if ((val = cupsGetOption("TopWCover", num_options, options)) != NULL)\r          TW = atoi(val);\r        else if ((option = ppdFindOption(ppd, "TopWCover")) != NULL)\r           TW = atoi(option->defchoice);\r  else\r           TW = 0;\r        debug("TW: %d",TW);\r    if ((val = cupsGetOption("TopWLeft", num_options, options)) != NULL)\r           LW = atoi(val);\r        else if ((option = ppdFindOption(ppd, "TopWLeft")) != NULL)\r            LW = atoi(option->defchoice);\r  else\r           LW = 0;\r        debug("LW: %d",LW);\r    if ((val = cupsGetOption("BottomWCover", num_options, options)) != NULL)\r               BW = atoi(val);\r        else if ((option = ppdFindOption(ppd, "BottomWCover")) != NULL)\r                BW = atoi(option->defchoice);\r  else\r           BW = 0;\r        debug("BW: %d",BW);\r    if ((val = cupsGetOption("BottomWRight", num_options, options)) != NULL)\r               RW = atoi(val);\r        else if ((option = ppdFindOption(ppd, "BottomWRight")) != NULL)\r                RW = atoi(option->defchoice);\r  else\r           RW = 0;\r        debug("RW: %d",RW);\r    if ((val = cupsGetOption("BlackIn", num_options, options)) != NULL)\r            strcpy(BlackIn, val);\r  else if ((option = ppdFindOption(ppd, "BlackIn")) != NULL)\r             strcpy(BlackIn, option->defchoice);\r    else\r           strcpy(BlackIn, "None");\r       upper( BlackIn);\r       debug("BlackIn : %s", BlackIn);\r                        \r       //TreatementK value\r    if ((val = cupsGetOption("TreatementK", num_options, options)) != NULL)\r                strcpy(TreatementK, val);\r      else if ((option = ppdFindOption(ppd, "TreatementK")) != NULL)\r         strcpy(TreatementK, option->defchoice);\r        else\r           strcpy(TreatementK, "GE");\r      upper(TreatementK);\r   debug("TreatementK : %s", TreatementK);\r        \r       //QualityK value\r       if ((val = cupsGetOption("QualityK", num_options, options)) != NULL)\r           QualityK = atoi(val);\r  else if ((option = ppdFindOption(ppd, "QualityK")) != NULL)\r            QualityK = atoi(option->defchoice);\r    else\r           QualityK = 0;\r  debug("QualityK : %d", QualityK);\r\r     //KSensibilityK value\r  if ((val = cupsGetOption("SensibilityK", num_options, options)) != NULL)\r               SensibilityK = atoi(val);\r      else if ((option = ppdFindOption(ppd, "SensibilityK")) != NULL)\r                SensibilityK = atoi(option->defchoice);\r        else\r           SensibilityK = 10;\r     debug("SensibilityK : %d", SensibilityK);\r\r     //SensibilityO value\r   if ((val = cupsGetOption("SensibilityO", num_options, options)) != NULL)\r               SensibilityO = atoi(val);\r      else if ((option = ppdFindOption(ppd, "SensibilityO")) != NULL)\r                SensibilityO = atoi(option->defchoice);\r        else\r           SensibilityO = 10;\r     debug("SensibilityO : %d", SensibilityO);\r\r     //STartPrinting value\r  if ((val = cupsGetOption("DetectAuto", num_options, options)) != NULL)\r         DetectAuto = atoi(val);\r        else if ((option = ppdFindOption(ppd, "DetectAuto")) != NULL)\r          DetectAuto = atoi(option->defchoice);\r  else\r           DetectAuto = 0;\r        debug("DetectAuto : %d", DetectAuto);\r\r //Distance Printing value\r      if ((val = cupsGetOption("StartDist", num_options, options)) != NULL)\r          StartDist = atoi(val) * 12;\r    else if ((option = ppdFindOption(ppd, "StartDist")) != NULL)\r           StartDist = atoi(option->defchoice) * 12;\r      else\r           StartDist = 0;\r debug("StartDist : %d", StartDist);\r\r   //Sharpen option\r       if ((val = cupsGetOption("Soften", num_options, options)) != NULL)\r             strcpy(Soften, val);\r   else if ((option = ppdFindOption(ppd, "Soften")) != NULL)\r              strcpy(Soften, option->defchoice);\r     else\r           strcpy(Soften, "False");\r       upper(Soften);\r debug("Soften : %s", Soften);\r  \r\r              \r               \r//-----------------------------//\r//MAG OPTIONS\r//-----------------------------//      \r  if ((val = cupsGetOption("Coercivity", num_options, options)) != NULL)\r      strcpy(Coercivity, val);\r  else if ((option = ppdFindOption(ppd, "Coercivity")) != NULL)\r       strcpy(Coercivity, option->defchoice);\r  else\r  strcpy(Coercivity, "True");\r  upper(Coercivity);        \r  debug("Coercivity : %s", Coercivity);\r  \r  if(strcmp(Coercivity,"BLANK") || !(strcmp(EjectCard, "ONLYENCO")) ) {\r    \r  \r    if ((val = cupsGetOption("Track1", num_options, options)) != NULL)\r             strcpy(Track1, val);\r   else if ((option = ppdFindOption(ppd, "Track1")) != NULL)\r              strcpy(Track1, option->defchoice);\r     else\r           strcpy(Track1, "ISO1");\r        upper(Track1);\r debug("Track1 : %s", Track1);\r  \r       if ((val = cupsGetOption("Density1", num_options, options)) != NULL)\r                   strcpy(Density1, val);\r else if ((option = ppdFindOption(ppd, "Density1")) != NULL)\r            strcpy(Density1, option->defchoice);\r   else\r           strcpy(Density1, "210 bpi");\r   upper(Density1);\r       debug("Density1 : %s", Density1);\r      \r       if ((val = cupsGetOption("Track2", num_options, options)) != NULL)\r             strcpy(Track2, val);\r   else if ((option = ppdFindOption(ppd, "Track2")) != NULL)\r              strcpy(Track2, option->defchoice);\r     else\r           strcpy(Track2, "ISO2");\r        upper(Track2);\r debug("Track2 : %s", Track2);\r  \r       if ((val = cupsGetOption("Density2", num_options, options)) != NULL)\r           strcpy(Density2, val);\r else if ((option = ppdFindOption(ppd, "Density2")) != NULL)\r            strcpy(Density2, option->defchoice);\r   else\r           strcpy(Density2, "75 bpi");\r    upper(Density2);\r       debug("Density2 : %s", Density2);\r      \r       if ((val = cupsGetOption("Track3", num_options, options)) != NULL)\r             strcpy(Track3, val);\r   else if ((option = ppdFindOption(ppd, "Track3")) != NULL)\r              strcpy(Track3, option->defchoice);\r     else\r           strcpy(Track3, "ISO3");\r        upper(Track3);\r debug("Track3 : %s", Track3);\r  \r       if ((val = cupsGetOption("Density3", num_options, options)) != NULL)\r           strcpy(Density3, val);\r else if ((option = ppdFindOption(ppd, "Density3")) != NULL)\r            strcpy(Density3, option->defchoice);\r   else\r           strcpy(Density3, "210 bpi");\r   upper(Density3);\r       debug("Density3 : %s", Density3);\r      \r       if ((val = cupsGetOption("KeepCard", num_options, options)) != NULL)\r           strcpy(KeepCard, val);\r else if ((option = ppdFindOption(ppd, "KeepCard")) != NULL)\r            strcpy(KeepCard, option->defchoice);\r   else\r           strcpy(KeepCard, "True");\r      upper(KeepCard);        \r       debug("KeepCard : %s", KeepCard);\r      \r       \r       if ((val = cupsGetOption("Track1Data", num_options, options)) != NULL) {\r               sprintf(track[0],"\033Dm;1;%s\015", val);\r              info("%s",track[0]);\r           doMag |= 0x01;\r }\r      else\r           track[0][0] = 0x00;\r    \r       debug("Track1Data : %s", &track[0]);\r   \r       if ((val = cupsGetOption("Track2Data", num_options, options)) != NULL) {\r               sprintf(track[1],"\033Dm;2;%s\015", val);\r              info("%s",track[1]);\r           doMag |= 0x02;\r }\r      else\r           track[1][0] = 0x00;\r    \r       debug("Track2Data : %s", &track[1]);\r   \r       if ((val = cupsGetOption("Track3Data", num_options, options)) != NULL) {\r               sprintf(track[2],"\033Dm;3;%s\015", val);\r              info("%s",track[2]);\r           doMag |= 0x04;\r }\r      else\r           track[2][0] = 0x00;\r    \r       debug("Track3Data : %s", &track[2]);\r   \r       info("Set Magnetic encoder");\r  \r       if (!(strcmp(Coercivity, "HICO")))\r             output("\033Pmc;h\015");        \r       else\r           output("\033Pmc;l\015");\r               \r       output("\033Pmt;1;%s\015",Track1);\r     output("\033Pmd;1;%s\015",Density1);\r   output("\033Pmt;2;%s\015",Track2);\r     output("\033Pmd;2;%s\015",Density2);\r   output("\033Pmt;3;%s\015",Track3);\r     output("\033Pmd;3;%s\015",Density3);\r   }\r  \r\r\r  \rif(cupsRasterReadHeader(ras, &header)){\r      ViewInfo(ppd,&header);\r//Coherent info between manual add option and auto cups add option\r      if(cOrientation) {\r             header.Orientation = cOrientation; \r      }\r      if(cSides != -1) {\r           header.Duplex = cSides; \r      }\r         \r      \r      if(model == 3){//Quantum\r               \r               if (!(strcmp(header.OutputType, "AutoH")))\r                     hopper = 0;\r            else if (!(strcmp(header.OutputType, "AlterH")))\r                       hopper = 3;\r            else if (!(strcmp(header.OutputType, "Tray1")))\r                        hopper = 1;\r            else if (!(strcmp(header.OutputType, "Tray2")))\r                        hopper = 2;\r            else hopper = 0;\r               \r               feeder = 5;\r            if ( !(strcmp(header.MediaType, "Feeder1") ))  //header.MediaWeight == 1)\r                      feeder = 1;\r            else if (!(strcmp(header.MediaType, "Feeder2"))) //(header.MediaWeight == 2)\r                   feeder = 2;\r            else if (!(strcmp(header.MediaType, "Alter")))  //(header.MediaWeight == 3)\r                    feeder = 3;\r            else if (!(strcmp(header.MediaType, "Auto")))  //(header.MediaWeight == 0)\r                     feeder = 0;\r            \r               \r               if (feeder != 5){\r                      info("Set Feeder and output hopper");\r                  output("\033Piem;%d;%d\015", feeder,hopper);\r                   //info("\033Piem;%d;%d\015", feeder,hopper);\r           }\r      }\r      if(model == 2){ //TATTOO\r               insert = '0';\r          if (!(strcmp(header.MediaType, "Feeder"))) //header.MediaWeight == 1)\r                  insert = 'F';\r          else if (!(strcmp(header.MediaType, "Manual"))) //header.MediaWeight == 2)\r                     insert = 'M';\r          else if (!(strcmp(header.MediaType, "Auto"))) //header.MediaWeight == 3)\r                       insert = 'B';\r          //else insert = '0';\r           \r               if(insert != '0'){\r                     info("Set Feeder");\r                    output("\033Pmi;%c\015", insert);\r              }\r      }\r      //color panel\r  if(model != 2){\r                info("Set color ribbon/panels temperature");\r           output("\033Pl;a;=;%d\015", Brightness);\r               output("\033Pc;a;=;%d\015", Contrast);\r         output("\033Pc;o;=;%d\015", SensibilityO);\r     }\r      info("Set black ribbon/panel temperature");\r    output("\033Pc;k;=;%d\015", SensibilityK);\r     output("\033Ps;k;=;%d\015", QualityK);\r output("\033Pr;%s\015",header.MediaColor);\r\r    // Process Card Test as needed...\r  if ( !(strcmp(EjectCard, "NONE")) ) { // || !(strcmp(EjectCard, "Keep"))) {\r        \r       if (header.cupsColorSpace == CUPS_CSPACE_RGB){\r                 colorspace = CUPS_CSPACE_RGB;\r  }\r      else{\r          fatal("Fail CUPS_CSPACE_RGB ");\r                goto quitmain;\r }\r      //  dwSizeNeeded: Size of lpRecto in pixels\r    if (header.cupsBitsPerPixel == 24){\r            //dwSizeNeeded = header.cupsHeight * header.cupsWidth * 5;\r             dwSizeNeeded = 1016 * 648 *  5;\r                if(lpRecto){\r                   debug("lpRecto Free memory");\r                  free(lpRecto);\r                 lpRecto = NULL;\r                }\r              lpRecto = malloc(dwSizeNeeded);\r                if (lpRecto){\r                  debug("lpRecto: size demands %d pixels... ", dwSizeNeeded);\r            }\r              else{\r                  fatal("Fail memory for lpRecto : %d pixels... ", dwSizeNeeded);\r                        goto quitmain;\r                 }//End of lpRecto\r              if(header.Duplex || cSides){\r                   //dwSizeNeeded = header.cupsHeight * header.cupsWidth * 5;\r                     dwSizeNeeded = 1016 * 648 *  5;\r                        if(lpVerso){\r                           debug("lpVerso Free memory");\r                          free(lpVerso);\r                         lpVerso = NULL;\r                        }\r                      lpVerso = malloc(dwSizeNeeded);\r                        if (lpVerso){\r                          debug("lpVerso: size demands %d pixels... ", dwSizeNeeded);\r                    }\r                      else\r                   {\r                              fatal("Fail memory for lpVerso : %d pixels ", dwSizeNeeded);\r                           goto quitmain;\r                 }\r              }// end of if Duplex\r   }//end of cupRaster = 24\r       else{\r          fatal("Fail Not mode 24 bits ");\r               goto quitmain;\r }//End of lpRecto\r      // Process pages as needed...\r  page = 0;\r      NbCopy = header.NumCopies;\r     do {\r           page++;\r                info("PAGE: %d %d", page, header.NumCopies);\r           if(header.Duplex || cSides){\r                   if((page & 0x01)){\r                             info("Two sides: SEQUENCE RECTO");\r                             output("\033Ss\015\033Sr\015");\r                                if(doMag & 0x01) {\r                                     info("Download track 1");\r                                      output("%s",track[0]);\r                         }\r                              if(doMag & 0x02) {\r                                     info("Download track 2");\r                                      output("%s",track[1]);\r                         }\r                              if(doMag & 0x04) {\r                                     info("Download track 3");\r                                      output("%s",track[2]);\r                         }\r                              lpMem = lpRecto;\r                       }\r                      else{\r                          info("Two sides: SEQUENCE VERSO");\r                             output("\033Sv\015");\r                          lpMem = lpVerso;\r                       }\r              }\r              else {\r                 info("One side: SEQUENCE RECTO");\r                      output("\033Ss\015\033Sr\015");\r                        if(doMag) {\r                            if(doMag & 0x01) {\r                                     info("Download track 1");\r                                      output("%s",track[0]);\r                         }\r                              if(doMag & 0x02) {\r                                     info("Download track 2");\r                                      output("%s",track[1]);\r                         }\r                              if(doMag & 0x04) {\r                                     info("Download track 3");\r                                      output("%s",track[2]);\r                         }\r                      }\r                      lpMem = lpRecto;\r                       \r               }\r              \r               if ((header.cupsHeight * header.cupsWidth) == 658368 )\r                 ShareRVBtoMem(header.cupsHeight, header.cupsWidth,  header.cupsBytesPerLine, ras);\r             else\r                   ShareRVBtoMemWindow(header.cupsHeight, header.cupsWidth,  header.cupsBytesPerLine, ras,&header);\r               \r               if (!(strcmp(Soften, "FALSE"))){\r                       Sharpen( &lpMem[0],648,1016);\r                  Sharpen( &lpMem[1016*648],648,1016);\r                   Sharpen( &lpMem[2*1016*648],648,1016);\r         }\r              StartPage(ppd, &header, ras);\r          EndPage(&header);\r              if(header.Duplex || cSides) {\r                  if(!(page & 0x01)){\r                            info("Eject card");\r                            output("\033Se\015");\r                          NbCopy -= 1;\r                           while (NbCopy) {\r                                       info("Copy page %d",NbCopy);\r                                   NbCopy -= 1;\r                                   info("Two sides: SEQUENCE RECTO");\r                                     output("\033Ss\015\033Sr\015");\r                                        if(doMag & 0x01) {\r                                             info("Download track 1");\r                                              output("%s",track[0]);\r                                 }\r                                      if(doMag & 0x02) {\r                                             info("Download track 2");\r                                              output("%s",track[1]);\r                                 }\r                                      if(doMag & 0x04) {\r                                             info("Download track 3");\r                                              output("%s",track[2]);\r                                 }\r                                      lpMem = lpRecto;\r                                       StartPage(ppd, &header, ras);\r                                  EndPage(&header);\r                                      info("Two sides: SEQUENCE VERSO");\r                                     output("\033Sv\015");\r                                  lpMem = lpVerso;\r                                       StartPage(ppd, &header, ras);\r                                  EndPage(&header);\r                                      info("Eject card");\r                                    output("\033Se\015");\r                          }\r                              NbCopy = header.NumCopies;\r                     }\r              }\r              else {\r                 info("Eject card");\r                    output("\033Se\015");\r                  NbCopy -= 1;\r                   if (NbCopy >= 1) {\r                             info("Copy %d page(s)",NbCopy);\r                                output("\033Sc;%d\015", NbCopy);\r                       }\r                      NbCopy = header.NumCopies;\r             }\r      }\r      while (cupsRasterReadHeader(ras, &header));\r    info("Eject card");\r    output("\033Se\015");\r  \r       /*if((header.Duplex || cSides) && (page & 0x01)) {\r             if ( !(strcmp(EjectCard, "Keep"))) {\r                   output("\033Ste\015");\r         }\r              else {\r                 output("\033Se\015");\r          }\r      }\r      page = 1;\r      do {\r           //cupsRasterReadPixels(ras, lpImgBuf, WidthLine)\r       }\r      while (cupsRasterReadHeader(ras, &header));\r    //NbCopy = header.NumCopies;\r#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)\r      struct sigaction action;        \r#endif \r#ifdef HAVE_SIGSET             \r       sigset(SIGTERM, CancelJob);\r#elif defined(HAVE_SIGACTION)\r      memset(&action, 0, sizeof(action));\r\r   sigemptyset(&action.sa_mask);\r  action.sa_handler = CancelJob;\r sigaction(SIGTERM, &action, NULL);/\r#else\r      signal(SIGTERM, CancelJob);\r#endif \r    info("StartPage()");\r   output("\033Ss\015\033Sr\015");\r        if(doMag & 0x01) {\r             output("%s",track[0]);\r }\r      if(doMag & 0x02) {\r             output("%s",track[1]);\r }\r      if(doMag & 0x04) {\r             output("%s",track[2]);\r }\r                              \r                               \r       if ((val = cupsGetOption("RawData", num_options, options)) != NULL) {\r          strcpy(WtData,val);\r    }\r      else {\r         WtData[0] = 0x00;\r      }\r      \r       j = 0;\r i = 0;\r debug("%s", &WtData[j]);\r       output("\033Wcb;k\015");\r       \r       while(WtData[i] != 0x00 && i < 2047) {\r         if((WtData[i] == '|') && i) {\r                  //output("\033%s\015",&WtData[j]);\r                     WtData[i] = 0x00;\r                      output("\033%s\015",&WtData[j]);\r                       //debug("%d  %d : %s", i,j,&WtData[j]);\r                        i++;\r                   j=i;            \r               }\r              else {          \r                       i++;\r           }\r      }\r      output("\033Se\015");*/\r        \r       memset(end_usb,0x00,64);\r       if(fwrite( end_usb,sizeof(unsigned char),64,stdout) != 64) {\r           debug("Error: fails print end usb ...\n");\r     }\r      /*EndPage();*/\r     \r   }//End test Card\r   else {\r     page = 1;\r      do {\r           //cupsRasterReadPixels(ras, lpImgBuf, WidthLine)\r       }\r      while (cupsRasterReadHeader(ras, &header));\r    //NbCopy = header.NumCopies;\r#if defined(HAVE_SIGACTION) && !defined(HAVE_SIGSET)\r      struct sigaction action;        \r#endif \r#ifdef HAVE_SIGSET\r    sigset(SIGTERM, CancelJob);\r#elif defined(HAVE_SIGACTION)\r      memset(&action, 0, sizeof(action));\r\r   sigemptyset(&action.sa_mask);\r  action.sa_handler = CancelJob;\r sigaction(SIGTERM, &action, NULL);\r#else\r       signal(SIGTERM, CancelJob);\r#endif \r    info("StartPage()");\r   if (!(strcmp(EjectCard, "ISMART"))){\r    info("Inserting smart card.");\r         output("\033Sis\015");\r        }\r      else if (!(strcmp(EjectCard, "ICTLESS"))){\r      info("Inserting contactless card.");\r   output("\033Sic\015");\r        }\r      else if (!(strcmp(EjectCard, "EJECT"))){\r        info("Ejecting card.");\r        output("\033Se\015");\r }\r      else if (!(strcmp(EjectCard, "REJECT"))){\r       info("Rejecting card.");\r       output("\033Ser\015");\r        }\r      else if (!(strcmp(EjectCard, "TEST"))){\r         info("Self test card.");\r       output("\033St\015");\r }\r      else if (!(strcmp(EjectCard, "CLEAN"))){\r        info("Self cleaning card.");\r   output("\033Scp\015");\r        }\r      else if (!(strcmp(EjectCard, "AJUST"))){\r        info("Self adjusment.");\r       output("\033Sa\015");\r }\r      else if (!(strcmp(EjectCard, "SELFMAG"))){\r      info("Self magnetic test card.");\r      output("\033Stt;m\015");\r      }\r      else if (!(strcmp(EjectCard, "ONLYENCO"))){\r     info("Only encoding.");\r        \r              if(doMag){\r                     output("\033Ss\015");\r                  if(doMag & 0x01) {\r                             info("Download track 1");\r                              output("%s",track[0]);\r                 }\r                      if(doMag & 0x02) {\r                             info("Download track 2");\r                              output("%s",track[1]);\r                 }\r                      if(doMag & 0x04) {\r                             info("Download track 3");\r                              output("%s",track[2]);\r                 }\r                      \r                       output("\033Smw\015");\r                 if (!(strcmp(KeepCard, "FALSE"))) {\r                            info("Eject card after encoding.");\r                            output("\033Se\015");\r                  }\r                      else {\r                         info("Keep card after encoding.");\r                             output("\033Ste\015");\r                 }\r              }\r      }\r      memset(end_usb,0x00,64);\r       if(fwrite( end_usb,sizeof(unsigned char),64,stdout) != 64) {\r           debug("Error: fails print end usb ...\n");\r     }\r      \r       EndPage(&header);\r      }\r}//End of If cupsrastertHeader\r\rquitmain:;\r\r  //Free memory...\r       if(lpRecto){\r           debug("lpRecto Free memory");\r          free(lpRecto);\r         lpRecto = NULL;\r        }\r      if(lpVerso){\r           debug("lpVerso Free memory");\r          free(lpVerso);\r         lpVerso = NULL;\r        }\r      Shutdown();\r    ppdClose(ppd);\r // Close the raster stream...\r  cupsRasterClose(ras);\r  if (fd != 0)\r           close(fd);\r     // If no pages were printed, send an error message...\r  if (page == 0)\r         fatal("ERROR: No pages found!\n");\r     if (!STATUS) {\r         info("Job is done : successful operation(s)");\r } else {\r               info("Error processing Job");\r  }\r      info("End of printing - Returning %d", STATUS);\r        return (STATUS);\r}\r\r//===============================================================================================================\r//void ShareRVBtoMem(long Height, long Width, long WidthLine, cups_raster_t * ras,long offset)\r//===============================================================================================================\r///////////////////////////////////////////////////////\r// pMem ppV\r//                       ___________\r//                      |           |\r//                      |           |\r//                      |   Yellow  |\r//                      |           |\r//                      |___________|\r//                      |           |\r//                      |           |\r//                      |   Magenta |\r//                      |           |\r//                      |___________|\r//                      |           |\r//                      |           |\r//                      |   Cyan    |\r//                      |           |\r//                      |___________|\r//                      |           |\r//                      |           |\r//                      |   Black   |\r//                      |           |\r//                      |___________|\r//                      |           |\r//                      |           |\r//                      |   Grey    |\r//                      |           |\r//                      |___________|\r///////////////////////////////////////////////////////\rstatic void ShareRVBtoMem(long Height, long Width, long WidthLine, cups_raster_t * ras)\r{\r        //Pointeur sur image buffer\r    unsigned char *lpImgBuf, *lpYellow, *lpMagenta, *lpCyan, *lpBlack, *lpGray;\r\r  //valeur RVB courante & pr��ente\r    unsigned char red, green, blue, r, g, b;\r\r  //index pour scruter le fichier bitmap\r     long index_line, index_dot;\r\r  //Bool�n indiquant le premier bit de la chaine\r        long  stpt = 0;\r\r  long  offx = 0, offy = 0;\r  \r        lpImgBuf = malloc(WidthLine);\r\r if (!lpImgBuf)\r {\r              fatal("ShareRVBtoMem fail to book memory: size requested %d bytes... \n", WidthLine);\r          return;\r        }\r\r     lpYellow = &lpMem[0];\r  //memset(lpYellow,0x00,Width * Height);\r  memset(lpYellow,0x00,1016*648);\r      lpMagenta = &lpMem[Width * Height];\r  //memset(lpMagenta,0x00,Width * Height);\r  memset(lpMagenta,0x00,1016*648);\r      lpCyan = &lpMem[2 * Width * Height];\r  //memset(lpCyan,0x00,Width * Height);\r  memset(lpCyan,0x00,1016*648);  \r lpBlack = &lpMem[3 * Width * Height];\r  //memset(lpBlack,0x00,Width * Height);\r  memset(lpBlack,0x00,1016*648);\r        lpGray = &lpMem[4 * Width * Height];\r  //memset(lpGray,0xFF,Width * Height);\r  memset(lpGray,0xFF,1016*648);\r\r \r        ////////////////\r       //CAS PORTRAIT//\r       ////////////////\r       if ( (Height >= Width) || (cOrientation == PORTRAIT) )\r {\r              info("Portrait");\r              //Pour toutes les lignes de l'image\r            //for (index_line = Height; index_line > 0; index_line--)\r    for (index_line = 0; index_line < Height; index_line++)\r          {\r                      if (cupsRasterReadPixels(ras, lpImgBuf, WidthLine) == WidthLine)\r                       {\r                              r = 0xFF;\r                              g = 0xFF;\r                              b = 0xFF;\r                              stpt = 0;\r                              //Pour tous les points de la ligne\r                             for (index_dot = Width; index_dot > 0; index_dot--)\r                            {\r                                      red = lpImgBuf[(index_dot * 3)];\r                                       green = lpImgBuf[(index_dot * 3) + 1];\r                                 blue = lpImgBuf[(index_dot * 3) + 2];\r                                  //*(lpGray++) = (unsigned char) RgbToGray(red, green, blue);\r          lpGray[(index_line * 648) + index_dot] = (unsigned char) RgbToGray(red, green, blue);\r                                   if (blue == 0x00 && green == 0x00 && red == 0x00)\r                                      {\r                                              if (stpt == 0)  // !stpt\r                                               {\r                                                      //Erreur sur le premier point blanc par defaut\r              lpYellow[(index_line * 648) + index_dot] = 0x00;\r              lpMagenta[(index_line * 648) + index_dot] = 0x00;\r              lpCyan[(index_line * 648) + index_dot] = 0x00;\r              lpBlack[(index_line * 648) + index_dot] = 0xFF;\r                                                       //premier point trait�\r                                                       stpt = 1;\r                                              }\r\r                                             else\r                                           {\r                                                      //Cas point noir on met la couleur du point precedent\r              lpYellow[(index_line * 648) + index_dot] = ((0xFF - b));\r              lpMagenta[(index_line * 648) + index_dot] = ((0xFF - g));\r              lpCyan[(index_line * 648) + index_dot] = ((0xFF - r));\r              lpBlack[(index_line * 648) + index_dot] = 0xFF;\r                                                }\r                                      }\r                                      else\r                                   {\r                                              //Sauvegarde de la valeur precedente\r                                           r = red;\r                                               g = green;\r                                             b = blue;\r                                              //Traitement particulier pour le premier point\r            lpYellow[(index_line * 648) + index_dot] = ((0xFF - b));\r            lpMagenta[(index_line * 648) + index_dot] = ((0xFF - g));\r            lpCyan[(index_line * 648) + index_dot] = ((0xFF - r));\r            lpBlack[(index_line * 648) + index_dot] = 0x00;\r                                               //premier point traite\r                                         stpt = 1;\r                                      }\r                              }       // for point de la line\r                        }       // test read line = cupsRasterReadPixels\r               }               //for ligne\r//#endif\r   }                       //end if H>W\r   /////////////////\r      //CAS LANDSCAPE//\r      /////////////////\r      else\r   {\r              info("Landscape");\r             for (index_line = (Height); index_line > 0; index_line--)\r              {\r                      r = 0xFF;\r                      g = 0xFF;\r                      b = 0xFF;\r                      stpt = 0;\r                      if (cupsRasterReadPixels(ras, lpImgBuf, WidthLine) == WidthLine)\r                       {\r                              for (index_dot = 0; index_dot < Width; index_dot++)\r                            {\r                                      red = lpImgBuf[(index_dot * 3)];\r                                       green = lpImgBuf[(index_dot * 3) + 1];\r                                 blue = lpImgBuf[(index_dot * 3) + 2];\r                                  lpGray[(index_line) + (index_dot * Height)] = (unsigned char) RgbToGray(red, green, blue);\r          if(blue == 0x00 && green == 0x00 && red == 0x00)\r          {\r                                              if (stpt == 0)\r                                         {\r                                                      //Erreur sur le premier point blanc par defaut\r                                                 lpYellow[(index_line) + (index_dot * Height)] = 0x00;\r                                                  lpMagenta[(index_line) + (index_dot * Height)] = 0x00;\r                                                 lpCyan[(index_line) + (index_dot * Height)] = 0x00;\r                                                    lpBlack[(index_line) + (index_dot * Height)] = 0xFF;\r                                                   //premier point traite\r                                                 stpt = 1;\r                                              }\r                                              else\r                                           {\r                                                      //Cas point noir on met la couleur du point precedent\r                                                  lpYellow[(index_line) + (index_dot * Height)] = ((0xFF - b));\r                                                  lpMagenta[(index_line) + (index_dot * Height)] = ((0xFF - g));\r                                                 lpCyan[(index_line) + (index_dot * Height)] = ((0xFF - r));\r                                                    lpBlack[(index_line) + (index_dot * Height)] = (0xFF);\r                                         }\r                                      }\r                                      else\r                                   {\r                                              //Sauvegarde de la valeur precedente\r                                           r = red;\r                                               g = green;\r                                             b = blue;\r                                              //Traitement particulier pour le premier point\r                                         lpYellow[(index_line) + (index_dot * Height)] = ((0xFF - b));\r                                          lpMagenta[(index_line) + (index_dot * Height)] = ((0xFF - g));\r                                         lpCyan[(index_line) + (index_dot * Height)] = ((0xFF - r));\r                                            lpBlack[(index_line) + (index_dot * Height)] = 0x00;\r                                           //premier point traite\r                                         stpt = 1;\r                                      }\r                              }       // for point de la line\r                        }       // test read line\r              }               //for ligne\r    }                       //end else if H>W\r      free(lpImgBuf);\r\r\r\rstatic void ShareRVBtoMemWindow(long Height, long Width, long WidthLine, cups_raster_t * ras, const cups_page_header_t * header)\r{\r        //Pointeur sur image buffer\r    unsigned char *lpImgBuf, *lpYellow, *lpMagenta, *lpCyan, *lpBlack, *lpGray;\r\r  //valeur RVB courante & pr��ente\r    unsigned char red, green, blue, r, g, b;\r\r  //index pour scruter le fichier bitmap\r     long index_line, index_dot;\r\r  //Bool�n indiquant le premier bit de la chaine\r        long  stpt = 0;\r\r  long  offx = 0, offy = 0;\r  long  Hfix = 1016, Wfix = 648;\r  long  dot = 0, line =0;\r\r  lpImgBuf = malloc(WidthLine);\r\r      if (!lpImgBuf)\r {\r              fatal("ShareRVBtoMem fail to book memory: size requested %d bytes... \n", WidthLine);\r          return;\r        }\r\r     lpYellow = &lpMem[0];\r  memset(lpYellow,0x00,1016*648);\r        lpMagenta = &lpMem[1016*648];\r\r  memset(lpMagenta,0x00,1016*648);\r      lpCyan = &lpMem[2 * 1016*648];\r\r  memset(lpCyan,0x00,1016*648);\r        lpBlack = &lpMem[3 * 1016*648];\r\r  memset(lpBlack,0x00,1016*648);\r      lpGray = &lpMem[4 * 1016*648];\r  memset(lpGray,0xFF,1016*648);\r\r  //if (Height >= Width)\r  if(header->Orientation == 1 || header->Orientation == 3 || (cOrientation == PORTRAIT) )\r  {\r    if(Width%2)\r    {\r      \r        cupsRasterReadPixels(ras, lpImgBuf, WidthLine);\r        //info("Read odd line ");\r        Width--;\r    }\r    \r    if(Width > 648)\r      offx = (Width - 648)/2;\r    else\r      offx = 0;\r\r    if(Height > 1016)\r      offy = (Height - 1016)/2;\r    else\r      offy = 0;\r\r    Hfix = 1016;\r    Wfix = 648;\r  }\r  else\r  {\r    if(Height%2)\r    {\r        cupsRasterReadPixels(ras, lpImgBuf, WidthLine);\r        //info("Read odd line ");\r        Height--;\r    }\r\r    if(Width > 1016)\r      offx = (Width - 1016)/2;\r    else\r      offx = 0;\r\r    if(Height > 648)\r      offy = (Height - 648)/2;\r    else\r      offy = 0; \r\r    Hfix = 648;\r    Wfix = 1016;\r  }\r\r  //info(" offx : %d offy : %d", offx, offy);\r       ////////////////\r       //CAS PORTRAIT//\r       ////////////////\r       //if (Height >= Width)\r  if(header->Orientation == 1 || header->Orientation == 3 || (cOrientation == PORTRAIT) )\r       {\r    info("Portrait");\r    for (index_line = (Height); index_line > (Height - offy); index_line--)\r            {\r      cupsRasterReadPixels(ras, lpImgBuf, WidthLine);\r    }\r    //info(" H : %d  W: %d",Hfix,Wfix);\r          //Pour toutes les lignes de l'image\r    line = 0;\r              for (index_line; index_line > offy; index_line--)\r              {\r                      if (cupsRasterReadPixels(ras, lpImgBuf, WidthLine) == WidthLine)\r                       {\r                              r = 0xFF;\r                              g = 0xFF;\r                              b = 0xFF;\r                              stpt = 0;\r                              //Pour tous les points de la ligne\r        dot = 648;\r                          for (index_dot = (Width-offx); index_dot > offx; index_dot--)\r        //dot = 0;\r        //for (index_dot = offx; index_dot < (Width - offx); index_dot++)\r                             {\r                                      red = lpImgBuf[(index_dot * 3)];\r                                       green = lpImgBuf[(index_dot * 3) + 1];\r                                 blue = lpImgBuf[(index_dot * 3) + 2];\r          lpGray[(line*648) + (dot) ] = (unsigned char) RgbToGray(red, green, blue);\r                                     if (blue == 0x00 && green == 0x00 && red == 0x00)\r                                      {\r                                              if (stpt == 0)  // !stpt\r                                               {\r                                                      //Erreur sur le premier point blanc par defaut\r              lpYellow[(line*648) + (dot)] = 0x00;\r              lpMagenta[(line*648) + (dot)] = 0x00;\r              lpCyan[(line*648) + (dot)] = 0x00;\r              lpBlack[(line*648) + (dot)] = 0xFF;\r                                                       //premier point trait�\r                                                       stpt = 1;\r                                              }\r\r                                             else\r                                           {\r                                                      //Cas point noir on met la couleur du point precedent\r              lpYellow[(line*648) + (dot)] = ((0xFF - b));\r              lpMagenta[(line*648) + (dot)] = ((0xFF - g));\r              lpCyan[(line*648) + (dot)] = ((0xFF - r));\r              lpBlack[(line*648) + (dot)] = 0xFF;\r                                                }\r                                      }\r                                      else\r                                   {\r                                              //Sauvegarde de la valeur precedente\r                                           r = red;\r                                               g = green;\r                                             b = blue;\r                                              //Traitement particulier pour le premier point\r            lpYellow[(line*648) + (dot)] = ((0xFF - b));\r            lpMagenta[(line*648) + (dot)] = ((0xFF - g));\r            lpCyan[(line*648) + (dot)] = ((0xFF - r));\r            lpBlack[(line*648) + (dot)] = 0x00;\r                                               //premier point traite\r                                         stpt = 1;\r                                      }\r          dot--;\r                             }       // for point de la line\r                        }       // test read line = cupsRasterReadPixels\r      line++;\r         }               //for ligne\r    for (index_line ; index_line > 0; index_line--)\r                {\r                      if(cupsRasterReadPixels(ras, lpImgBuf, WidthLine) != WidthLine)\r      {\r        debug("Erreur de lecture line CUPS15");\r      }\r                }\r      }                       //end if H>W\r   /////////////////\r      //CAS LANDSCAPE//\r      /////////////////\r      else\r   {\r              info("Landscape");\r    //info("index_line: %d",Height);\r    for (index_line = (Height); index_line > (Height - offy); index_line--)\r            {\r      if(cupsRasterReadPixels(ras, lpImgBuf, WidthLine) != WidthLine)\r      {\r        debug("erreur ");\r      }\r      //cupsRasterReadPixels(ras, lpImgBuf, WidthLine);\r    }\r    //info("index_line - offy: %d",index_line);\r    line = 648;//Hfix;\r    for (index_line ; index_line > offy; index_line--)\r          {\r      //info("index_line - offy: %d line : %d",index_line,line);\r                     r = 0xFF;\r                      g = 0xFF;\r                      b = 0xFF;\r                      stpt = 0;\r                      if (cupsRasterReadPixels(ras, lpImgBuf, WidthLine) == WidthLine)\r                       {\r                              //for (index_dot = 0; index_dot < Width; index_dot++)\r        dot = 0;\r        for (index_dot = offx; index_dot < (Width - offx); index_dot++)\r                         {\r                                      red = lpImgBuf[(index_dot * 3)];\r                                       green = lpImgBuf[(index_dot * 3) + 1];\r                                 blue = lpImgBuf[(index_dot * 3) + 2];\r                                  lpGray[(line) + (dot * 648)] = (unsigned char) RgbToGray(red, green, blue);\r          if(blue == 0x00 && green == 0x00 && red == 0x00)\r          {\r                                             if (stpt == 0)\r                                         {\r                                                      //Erreur sur le premier point blanc par defaut\r                                                 lpYellow[(line) + (dot * 648)] = 0x00;\r                                                 lpMagenta[(line) + (dot * 648)] = 0x00;\r                                                        lpCyan[(line) + (dot * 648)] = 0x00;\r                                                   lpBlack[(line) + (dot * 648)] = 0xFF;\r                                                  //premier point traite\r                                                 stpt = 1;\r                                              }\r                                              else\r                                           {\r                                                      //Cas point noir on met la couleur du point precedent\r                                                  lpYellow[(line) + (dot * 648)] = ((0xFF - b));\r                                                 lpMagenta[(line) + (dot * 648)] = ((0xFF - g));\r                                                        lpCyan[(line) + (dot * 648)] = ((0xFF - r));\r                                                   lpBlack[(line) + (dot * 648)] = (0xFF);\r                                                }\r                                      }\r                                      else\r                                   {\r                                              //Sauvegarde de la valeur precedente\r                                           r = red;\r                                               g = green;\r                                             b = blue;\r                                              //Traitement particulier pour le premier point\r                                         lpYellow[(line) + (dot * 648)] = ((0xFF - b));\r                                         lpMagenta[(line) + (dot * 648)] = ((0xFF - g));\r                                                lpCyan[(line) + (dot * 648)] = ((0xFF - r));\r                                           lpBlack[(line) + (dot * 648)] = 0x00;\r                                          //premier point traite\r                                         stpt = 1;\r                                      }\r          dot++;\r                             }       // for point de la line\r                        }       // test read line\r      line--;\r                }               //for ligne\r    for (index_line; index_line > 0; index_line--)\r         {\r      //cupsRasterReadPixels(ras, lpImgBuf, WidthLine);\r      //info("index_line %d",index_line);\r      if(cupsRasterReadPixels(ras, lpImgBuf, WidthLine) != WidthLine)\r      {\r        debug("erreur ");\r      }\r    }\r      }                       //end else if H>W\r\r  free(lpImgBuf);\r}\r\r\r//Sharpen (medium)\rint SharpenPattern2[5][5] = {\r      {-1,-1,-1,-1,-1},\r      {-1,-1,-1,-1,-1},\r      {-1,-1,49,-1,-1},\r      {-1,-1,-1,-1,-1},\r      {-1,-1,-1,-1,-1}\r};\r\rint Sharpen(unsigned char * lpMemIn, long Width, long Height)\r{\r long      index_line = 0,index_dot = 0;\r unsigned char *lpbDataOut , *lpbData;\r\r int  final = 0;\r int     x= 0,y=0;\r int  divisionFactor = 0;\r\r lpbDataOut = NULL;\r lpbDataOut = malloc(Width * Height);\r if (lpbDataOut)\r    debug("lpDataOut: size demands %d pixels... ", Width * Height);\r  else\r    fatal("Fail memory for lpDataOut : %d pixels ", Width * Height);\r\r for(y=-2; y<=2; y++)     // and for each pixel around our\r    for(x=-2; x<=2; x++)   //  "hot pixel"...\r              divisionFactor += SharpenPattern2[x+2][y+2];\r\r //lpbData ppV mem bmp brute\r lpbData = &lpMemIn[0];\r //lpbDataOut = &lpMemOut[0];\r for(index_line = 2; index_line < Height -2; index_line++)\r    for(index_dot = 2 ; index_dot < Width -2; index_dot++)\r {\r              //gridCounter=0;      // reset some values\r             final = 0;\r             for(y=-2; y<=2; y++)     // and for each pixel around our\r                      for(x=-2; x<=2; x++)   //  "hot pixel"...\r                              final += lpbData[(index_dot + x) + ((index_line + y) * Width)] * SharpenPattern2[y+2][x+2];\r\r           // and put it back into the right range\r                final /= divisionFactor;\r               //iMemFilter[index_dot + (index_line * Width)] = final;\r                lpbDataOut[(index_dot) + ((index_line) * Width)] = final;\r              if(final > 255)\r                        lpbDataOut[(index_dot) + ((index_line) * Width)] = 0xFF;\r               else if(final < 0)\r                     lpbDataOut[(index_dot) + ((index_line) * Width)] = 0x00;\r       }\r  index_dot = Height * Width;\r  for(index_line = 0; index_line < index_dot; index_line++)\r    lpbData[index_line] =  lpbDataOut[index_line];\r\r    //Free memory...\r   if(lpbDataOut)\r {\r              debug("lpbDataOut Free memory");\r               free(lpbDataOut);\r              lpbDataOut = NULL;\r     } \r\r  \r return(1);\r}\r\rvoid ViewInfo(const ppd_file_t * ppd, const cups_page_header_t * header)\r{\r  info("header->cupsWidth... : %d ", header->cupsWidth);\r\r     info("header->cupsHeight... : %d ", header->cupsHeight);\r       \r  info("header->MediaClass... : %s ", header->MediaClass);\r  info("header->MediaColor... : %s ", header->MediaColor);\r  info("header->MediaType... : %s ", header->MediaType); \r  info("header->OutputType... : %s ", header->OutputType);\r  info("header->CutMedia... : %d ", header->CutMedia);      \r\r  info("header->Duplex... : %d ", header->Duplex);    \r  info("header->HWResolution... : %d %d ", header->HWResolution[0],header->HWResolution[1]);\r  info("header->ManualFeed... : %d ", header->ManualFeed);\r  info("header->MediaPosition... : %d ", header->MediaPosition);       \r  info("header->MediaWeight... : %d ", header->MediaWeight);   \r\r  info("header->NumCopies... : %d ", header->NumCopies);      \r  info("header->Orientation... : %d ", header->Orientation);\r  info("header->PageSize... : %d ,%d ", header->PageSize[0], header->PageSize[1]);        \r\r  info("header->TraySwitch... : %d ", header->TraySwitch);\r\r  info("header->Tumble... : %d ", header->Tumble);        \r  info("header->cupsWidth... : %d ", header->cupsWidth);\r\r\r    info("header->cupsHeight... : %d ", header->cupsHeight);\r       info("header->ImagingBoundingBox... : %d %d %d %d", header->ImagingBoundingBox[0],header->ImagingBoundingBox[1],header->ImagingBoundingBox[2],header->ImagingBoundingBox[3]);   \r  info("header->PageSize... : %d ,%d ", header->PageSize[0], header->PageSize[1]);     \r\r\r  info("header->Margins... : %d , %d", header->Margins[0],header->Margins[1]);       \r\r  info("header->cupsBitsPercolor... : %d ", header->cupsBitsPerColor);        \r       info("header->cupsBitsPerPixel... : %d ", header->cupsBitsPerPixel);    \r       info("header->cupsBitsPerline... : %d ", header->cupsBytesPerLine);     \r       info("header->cupsCompression... : %d ", header->cupsCompression);      \r\r      info("header->cupsRowCount... : %d ", header->cupsRowCount);    \r       info("header->cupsRowFeed... : %d ", header->cupsRowFeed);      \r       info("header->cupsRowStep... : %d ", header->cupsRowStep);      \r       info("header->cupsColorSpace... : %d ", header->cupsColorSpace);        \r\r      info("header->cupsColorOrder... : %d ", header->cupsColorOrder);        \r  \r  info("header->InsertSheet... : %d ", header->InsertSheet);        // Width of page image in pixels //\r  info("header->Jog... : %d ", header->Jog);        // Width of page image in pixels //\r  info("header->LeadingEdge... : %d ", header->LeadingEdge);        // Width of page image in pixels //\r  info("header->ManualFeed... : %d ", header->ManualFeed);  // Width of page image in pixels //\r  info("header->MediaPosition... : %d ", header->MediaPosition);    // Width of page image in pixels //\r  info("header->MediaWeight... : %d ", header->MediaWeight);        // Width of page image in pixels //\r  info("header->MirrorPrint... : %d ", header->MirrorPrint);        // Width of page image in pixels //\r  info("header->NegativePrint... : %d ", header->NegativePrint);    // Width of page image in pixels //\r  info("header->OutputFaceUp... : %d ", header->OutputFaceUp);      // Width of page image in pixels //\r  info("header->Separations... : %d ", header->Separations);        // Width of page image in pixels //\r}\r\rvoid ViewInfoPPD(const ppd_file_t * ppd)\r{\r  info("PPD->Langage Level # - %d", ppd->language_level);\r\r\r  info("PPD->color_device # - %d", ppd->color_device);\r  info("PPD->variable_sizes # - %d", ppd->variable_sizes);\r  info("PPD->accurate_screens # - %d", ppd->accurate_screens);\r  info("PPD->contone_only # - %d", ppd->contone_only);\r  info("PPD->landscape # - %d", ppd->landscape);\r  info("PPD->model_number # - %d", ppd->model_number);\r  info("PPD->manual_copies # - %d", ppd->manual_copies);\r  info("PPD->throughput # - %d", ppd->throughput);\r  info("PPD->colorspace # - %d", ppd->colorspace);\r  info("PPD->num_emulations # - %d", ppd->num_emulations);\r  info("PPD->emulation # - %s", ppd->emulations);\r\r  info("PPD->jcl_begin # - %s", ppd->jcl_begin);\r  info("PPD->pjcl_end # - %s", ppd->jcl_end);\r  info("PPD->lang_encoding # - %s", ppd->lang_encoding);\r\r  info("PPD->lang_version # - %s", ppd->lang_version);\r  info("PPD->modelname # - %s", ppd->modelname);\r  info("PPD->ttrasterizer # - %s", ppd->ttrasterizer);\r  info("PPD->manufacturer # - %s", ppd->manufacturer);\r  info("PPD->product # - %s", ppd->product);\r  info("PPD->nickname # - %s", ppd->nickname);\r  info("PPD->shortnickname # - %s", ppd->shortnickname);\r  info("PPD->num_groups # - %d", ppd->num_groups);\r  info("PPD->num_sizes # - %d", ppd->num_sizes);\r  info("PPD->sizes[0] # - %d, %s, %f, %f, %f, %f, %f, %f", ppd->sizes[0].marked,ppd->sizes[0].name,\r  ppd->sizes[0].width,ppd->sizes[0].length,ppd->sizes[0].left,ppd->sizes[0].right,ppd->sizes[0].top );\r\r\r  info("PPD->custom_min # - %f, %f", ppd->custom_min[0],ppd->custom_min[1]);\r  info("PPD->custom_max # - %f, %f", ppd->custom_max[0],ppd->custom_max[1]);\r  info("PPD->custom_margins # - %f,%f,%f,%f", ppd->custom_margins[0],ppd->custom_margins[1]);\r  info("PPD->num_consts # - %d", ppd->num_consts);\r\r  info("PPD->num_fonts # - %d", ppd->num_fonts);\r  info("PPD->num_profiles # - %d", ppd->num_profiles);\r  info("PPD->num_filters # - %d", ppd->num_filters);\r  info("PPD->filters # - %s", ppd->filters[0]);\r\r  info("PPD->flip_duplex # - %d", ppd->flip_duplex);\r}\r/* End of rastertoevolis.c,v 2.0*/\r\r
\ No newline at end of file
index cd71e71..4f7175b 100755 (executable)
@@ -286,6 +286,11 @@ int DB32NC(long lPos, char color)
        \r
        lComp = ReduceColor(ucCol, &ucCommand[9], 5);//,1016);\r
        lCommandSize += 10;\r
+\r
+       if (color=='y') info("Download Yellow color");\r
+       else if (color=='m') info("Download Magenta color");\r
+       else if (color=='c') info("Download Cyan color");\r
+\r
        numwritten = fwrite(ucCommand, sizeof(unsigned char), lCommandSize, stdout);\r
        if (numwritten != lCommandSize) {\r
                fatal("DP32NC Error: Fails printf %d... \n", numwritten);\r
@@ -353,6 +358,12 @@ int DB64NC(long lPos, char color)
        //fprintf(stderr, "**************** EVOLIS DP64NC taille apres compression %d... \n",lComp);\r
        strncpy(&ucCommand[lCommandSize + 9], "\015", 1);\r
        lCommandSize += 10;\r
+\r
+       if (color=='y') info("Download Yellow color");\r
+       else if (color=='m') info("Download Magenta color");\r
+       else if (color=='c') info("Download Cyan color");\r
+\r
+\r
        numwritten = fwrite(ucCommand, sizeof(unsigned char), lCommandSize, stdout);\r
        if (numwritten != lCommandSize)\r
        {\r
@@ -399,6 +410,11 @@ int DB128NC(long lPos, char color)
        lComp = ReduceColor(ucCol, &ucCommand[10], 7);//,1016);\r
        strncpy(&ucCommand[lCommandSize + 10], "\015", 1);\r
        lCommandSize += 11;\r
+\r
+       if (color=='y') info("Download Yellow color");\r
+       else if (color=='m') info("Download Magenta color");\r
+       else if (color=='c') info("Download Cyan color");\r
+\r
        numwritten = fwrite(ucCommand, sizeof(unsigned char), lCommandSize, stdout);\r
        if (numwritten != lCommandSize)\r
        {\r
@@ -606,6 +622,8 @@ int DB2NC(long lPos, char pannel[10])
                lComp = ReduceBlack(ucCol, &ucCommand[8],1016);\r
                strncpy(&ucCommand[lCommandSize + 8], "\015", 1);\r
                lCommandSize += 9;\r
+\r
+               info("Download Black");\r
                numwritten = fwrite(ucCommand, sizeof(unsigned char), lCommandSize, stdout);\r
                if (numwritten != lCommandSize)\r
        {\r
@@ -621,6 +639,7 @@ int DB2NC(long lPos, char pannel[10])
                        strcpy(ucCommand, "\033Db;o;2;");\r
                        strncpy(&ucCommand[lCommandSize + 8], "\015", 1);\r
                        lCommandSize += 9;\r
+                       info("Download varnish - statut : no varnish");\r
                        numwritten = fwrite(ucCommand, sizeof(unsigned char), lCommandSize, stdout);\r
                        if (numwritten != lCommandSize)\r
                        {\r
@@ -635,6 +654,7 @@ int DB2NC(long lPos, char pannel[10])
                                strcpy(ucCommand, "\033Db;o;2;");\r
                                strncpy(&ucCommand[lCommandSize + 8], "\015", 1);\r
                                lCommandSize += 9;\r
+                               info("Download varnish - statut : full varnish");\r
                                numwritten = fwrite(ucCommand, sizeof(unsigned char), lCommandSize, stdout);\r
                                if (numwritten != lCommandSize)\r
                                {\r
@@ -741,6 +761,7 @@ int DB2NC(long lPos, char pannel[10])
 \r
        strncpy(&ucCommand[lCommandSize + 8], "\015", 1);\r
        lCommandSize += 9;\r
+       info("Download varnish - statut : cover overlay");\r
        numwritten = fwrite(ucCommand, sizeof(unsigned char), lCommandSize, stdout);\r
        if (numwritten != lCommandSize)\r
        {\r