pnm2ppa-1.13/0000777000076400007640000000000011313235737010035 500000000000000pnm2ppa-1.13/docs/0000777000076400007640000000000011313235642010760 500000000000000pnm2ppa-1.13/docs/en/0000777000076400007640000000000011313235641011361 500000000000000pnm2ppa-1.13/docs/en/pnm2ppa.10000644000076400007640000001512207505255006012742 00000000000000.TH pnm2ppa "23 Jun 2002" .SH NAME pnm2ppa - convert portable anymap (PNM) images to HP's PPA printer format. .SH SYNOPSIS pnm2ppa [options] [ -i \fIinfile\fR ] [ -o \fIoutfile\fR ] .SH DESCRIPTION Reads portable anymap (PNM) format as input. Binary PNM formats pnmraw = {ppmraw (color pixmap), pgmraw (graymap), and pbmraw (black-and-white bitmap)} are strongly preferred. Output stream can be locally processed by Hewlett-Packard's Printing Performance Architecture (PPA) printers (HP DeskJet 710C, 712C, 720C, 722C, 820C, and 1000C series). .PP (PNM format output can be produced from PostScript(tm) input by the GhostScript output devices "pbmraw", "pgmraw" or "ppmraw", or by "pnmraw", which will choose one of these formats as appropriate for the document.) \fBpnm2ppa\fP assumes the input resolution is 600dpi (or 300dpi if the command-line option \fB--dpi300\fP is used): input at higher/lower resolutions will result in a correspondingly larger/smaller printed image, provided it is within the printer's allowed size range. .PP .SH OPTIONS .\"{{{ -b bottommargin .IP "\fB\-b \fIbottommargin\fR\fP" Sets the bottom margin \fIbottommargin\fR in units of 1/600 inches (e.g., \fB -b 150\fP corresponds to 0.25"). .\"}}} .\"{{{ -B blackness .IP "\fB\-B \fIblackness\fR\fP" Sets the black ink density \fIblackness\fR in drops per pixel (0,1,2,3,4). .\"}}} .\"{{{ --bi .IP "\fB\--bi\fP" Force bidirectional print sweeps. .\"}}} .\"{{{ --bw .IP "\fB\--bw\fP" Disables the color cartridge; will print in grey scale using only the black cartridge. .\"}}} .\"{{{ -d .IP "\fB\-d\fP" Displays the current configuration. .\"}}} .\"{{{ --dpi300 .IP "\fB\--dpi300\fP" Treat input resolution as 300dpi instead of 600dpi. .\"}}} .\"{{{ --eco .IP "\fB\--eco\fP" Econofast mode: lower print quality that is faster and saves ink. .\"}}} .\"{{{ -f configFile .IP "\fB\-f \fIconfigFile\fR\fP" Re-reads configuration from \fIconfigFile\fR (after initially reading it from /etc/pnm2ppa.conf). .\"}}} .\"{{{ -F GammaFile .IP "\fB\-F \fIGammaFile\fR\fP" Overrides reading the color-correction table (Gamma curve) from the default file /etc/pnm2ppa.gamma, and uses \fIGammaFile\fR instead. .\"}}} .\"{{{ --fd .IP "\fB\--fd\fP" Enable fast ordered dithering instead of using the slower, but beautiful, Floyd-Steinberg dithering. (Has no effect in --bw mode.) .\"}}} .\"{{{ -g .IP "\fB\-g\fP" Prints a page of color intensity samples (for comparison with gamma.ppm data produced by calibrate_ppa). This is part of a \fBcolor-correction\fP procedure; see COLOR.txt for more details. .\"}}} .\"{{{ -h, --help .IP "\fB\-h, --help\fP" Displays program usage. .\"}}} .\"{{{ -i infile .IP "\fB\-i \fIinfile\fR\fP" Input file \fIinfile\fR is either a path to a PPM file, or '-' to indicate stdin (defaults to stdin). .\"}}} .\"{{{ -l leftmargin .IP "\fB\-l \fIleftmargin\fR\fP" Sets the left margin \fIleftmargin\fR in units of 1/600 inches (e.g., \fB-l 150\fP corresponds to 0.25"). .\"}}} .\"{{{ --noGamma .IP "\fB\--noGamma\fP" Switches off any color-correction. .\"}}} .\"{{{ -o outfile | - .IP "\fB\-o \fIoutfile\fR | - \fP" Output file \fIoutfile\fR is either a path to a file or device, or '-' to indicate stdout (defaults to stdout). .\"}}} .\"{{{ -p .IP "\fB\-p\fP" Disables the black ink cartridge; i.e., print using only the color ink cartridge, even for printing "black". This might be useful for printing high-quality color images. .\"}}} .\"{{{ -r rightmargin .IP "\fB\-r \fIrightmargin\fR\fP" Sets the right margin \fIrightmargin\fR in units of 1/600 inches (e.g., \fB-r 150\fP corresponds to 0.25"). .\"}}} .\"{{{ -s papersize .IP "\fB\-s \fIpapersize\fR\fP" Sets the default paper size (now used only for color-correction output produced by the \fB-g\fP option). In normal use, pnm2ppa now instead reads the paper dimensions from pnm input file headers, and checks that it is a valid papersize for the given printer model. Possible values for \fIpapersize\fR are \fBa4\fP (A4), \fBletter\fP or \fBus\fP (US Letter, 8.5"x11"), \fBlegal\fR (US Legal, 8.5"x14"). The default is US Letter. .\"}}} .\"{{{ -t topmargin .IP "\fB\-t \fItopmargin\fR\fP" Sets the top margin \fItopmargin\fR in units of 1/600 inches (ie \fB-t 150\fP corresponds to 0.25"). .\"}}} .\"{{{ --uni .IP "\fB\--uni\fP" Force unidirectional (left to right) print sweeps. Useful if "shearing" is a problem for high quality color images. .\"}}} .\"{{{ -v printertype .IP "\fB\-v \fIprintertype\fP" Selects the printer model. Possible values of \fIprintertype\fR are: \fB710\fP, \fB712\fP, \fB720\fP, \fB722\fP, \fB820\fP and \fB1000\fP. The default is the HP DeskJet 7X0 Series (710, 712, 720, 722). .\"}}} .\"{{{ --verbose .IP "\fB\--verbose\fP" Displays the program's System Log messages on the standard output, as well. .\"}}} .\"{{{ --version .IP "\fB\--version\fP" Displays the program's version information. .\"}}} .\"{{{ -x xoffset .IP "\fB\-x \fIxoffset\fR\fP" Sets the x-offset \fIxoffset\fR from the left of the page. Units are 1/600 inches. .\"}}} .\"{{{ -y yoffset .IP "\fB\-y \fIyoffset\fR\fP" Sets the y-offset \fIyoffset\fR from the top of the page. Units are 1/600 inches. .\"}}} .SH NOTES The default configuration file \fI/etc/pnm2ppa.conf\fR is read in first. Command line arguments then modify the resulting definitions. .PP The \fB-v\fP option resets all definitions (margins, offsets, etc.) back to the inbuilt defaults for that printer and should be used before subsequent \fB-b\fP, \fB-l\fP, \fB-r\fP, \fB-t\fP, \fB-x\fP and \fB-y\fP arguments. .SH "SEE ALSO" pnm(5), ppm(5), pbm(5) .SH FILES .\"{{{ /etc/pnm2ppa.conf .IP "\fB\fI/etc/pnm2ppa.conf\fR\fP" Default configuration file. .\"}}} .\"{{{ /etc/pnm2ppa.gamma .IP "\fB\fI/etc/pnm2ppa.gamma\fR\fP" Default Gamma (color-correction) file. .\"}}} .SH AUTHOR This code is licensed under the GNU Public License version 2. See LICENSE for details. .PP (c) 1998-1999 Tim Norman .PP (c) 1999 Giorgio Marzano .PP (c) 1999 Andrew van der Stock .PP (c) 1998-2002 Various authors for many, many fixes .SH HISTORY This program was originally pbm2ppa, written by Tim Norman. It originally supported black and white output on the 820 series. Tim added nascent color support in early 1999. In May 1999, Giorgio Marzano started making real headway in getting color support working properly. Andrew van der Stock has maintained the code since September 1999, and made it available at http://sourceforge.net/projects/pnm2ppa. .SH BUGS Faint horizontal lines marking boundaries between print sweeps may be visible. You may get better results when printing images, with the options: \fB -p --uni \fP (this may no longer apply since recent code improvements). pnm2ppa-1.13/docs/en/sgml/0000777000076400007640000000000011313235642012324 500000000000000pnm2ppa-1.13/docs/en/sgml/CALIBRATION.sgml0000644000076400007640000002127607176674550014704 00000000000000
PPA Printer calibration for pnm2ppa <author>The pnm2ppa project team <htmlurl url="mailto:ppa-rpms@sourceforge.net" name="ppa-rpms@users.sourceforge.net"> <date>v0.4, October 28, 2000 <abstract> Information and instructions for printer calibration using pnm2ppa. <htmlurl url="http://sourceforge.net/projects/pnm2ppa" name="http://sourceforge.net/projects/pnm2ppa"> (Updated for pnm2ppa-1.02 and later.) </abstract> <!-- Begin the document --> <p> <bf> Overview of Printer Calibration.</bf> There are three main tasks you may need to carry out to fine-tune your PPA printer: <itemize> <item>Adjust the x-offset and y-offset to <bf>correctly center the printed page on the paper</bf> <item>Adjust the relative offsets between black and colored ink printing - <bf>this should be done each time you replace an ink cartridge</bf>. <item> Match the colors of printed images to some other output device - this is <bf>color correction</bf> and is described in <htmlurl url="./COLOR.html" name="COLOR.html"> (or COLOR.txt). </itemize> These instructions assume that you are already able to print postscript files with your PPA printer. If your print filters are properly configured, something like "<tt>lpr test.ps</tt>" will successfully invoke ghostscript and pnm2ppa to print the postscript file test.ps. Alternatively, you may be using shell scripts like "lprbw", "lprcolor" and "lpreco" supplied with the pnm2ppa source code, and modified by you for your defaults; you may also have defined special printing devices in <tt>/etc/printcap</tt>, e.g. a "coloreco" device so you print with <tt>lpr -P coloreco test.ps</tt>. These details vary with the operating system and distribution you use. <p> <bf> (1) Centering the printed page on the paper. </bf> This is done by adjusting the x-offset and y-offset parameters <bf>xoffset</bf> and <bf>yoffset</bf> in the <tt>pnm2ppa</tt> configuration file (usually <tt>/etc/pnm2ppa.conf</tt>). The parameters are given in units of 1/600 inch; increasing <tt>xoffset</tt> moves the image to the right, and increasing <tt>yoffset</tt> moves it downwards. These offsets now have default values defined for each printer model, and you will probably not need to adjust them. Uncomment and make small adjustments to the default values for these in the configuration file, until the printout is satisfactory. (You can also use the '-x' and '-y' command-line parameters.) There are two ways to check the offsets. <itemize> <item>either <bf>using the "<tt>calibrate_ppa</tt>" program.</bf> <item>or <bf>printing a suitable test page</bf>. </itemize> <p> The "<tt>calibrate_ppa</tt>" program is a stand-alone program distributed with <tt>pnm2ppa</tt> which creates various test patterns in the raw pixmap format accepted by pnm2ppa. (The three paper sizes, US Letter, US Legal, and A4, are supported). If your paper size is A4, and your printer filter accepts the "<tt>-l</tt>" (direct output) option to <tt>lpr</tt>, the command to run is: <tscreen><verb> calibrate_ppa -s a4 --center | pnm2ppa --bw -i - -o - | lpr -l </verb></tscreen> (Substitute "letter" or "legal" for "a4" to change the papersize; if no paper size is specified, it is assumed to be <tt>letter</tt>.) If "<tt>lpr -l</tt>" is not valid, you need to know which port your printer is attached to. Assuming it is <tt>/dev/lp0</tt>, the above command becomes <tt> calibrate_ppa -s a4 --center | pnm2ppa --bw -i - -o /dev/lp0</tt>. The pattern shows distances from the edge of the printed page in units of 50 dots (1/12 inch), and diagonal lines that should point to the corners. Change <tt>xoffset</tt> and <tt>yoffset</tt> in the configuration file (usually <tt>/etc/pnm2ppa.conf</tt> to center the pattern. The configuration file is supplied with commented-out entries like <tt>#xoffset 160</tt> showing the default value. Remove the "<tt>#</tt>" to activate the entry. In Red Hat or Mandrake Linux distributions, a suitable test page is <tt>/usr/lib/rhs/rhs-printfilters/testpage.ps</tt> (US Letter paper) or <tt>/usr/lib/rhs/rhs-printfilters/testpage-a4.ps</tt> (A4 paper). (If these are not available, similar test pages are supplied in the pnm2ppa source distribution.) These pages have margins drawn at standard distances from the edges of the paper, and can also be used to check the centering, but are not as accurate <bf> (2) Calibrating the X and Y Color Head Offsets. </bf> The color ink offsets now have to be calibrated with respect to the black ink. Because the relative position of the two ink cartridges can move slightly, <bf>this must be done whenever an ink cartridge is removed and replaced</bf>. To print an alignment calibration pattern on a4 paper, run <tscreen><verb> calibrate_ppa -s a4 --align | pnm2ppa --fd -i - -o - | lpr -l </verb></tscreen> On the printed page, there are four alignment patterns, corresponding to configuration file parameters <bf>ColOffsX</bf>, <bf>ColOffsY</bf>, <bf>colorshear</bf> and <bf>blackshear</bf>. The central alignment patterns, labelled "0" should be perfectly aligned. If they are not, first correct the shearing patterns, (see below). Then identify the best-aligned <bf>ColOffsX</bf> and <bf>ColOffsY</bf> patterns, and add or subtract the positive or negative number below the pattern from the value in the configuration file. Check the result by printing the alignment test pattern: <tscreen><verb> calibrate_ppa --test | pnm2ppa -fd -i - -o - | lpr -l </verb></tscreen> The lines in the cross and square should be perfectly straight now. The calibration can also be done by printing the test page <tt>test.ps</tt> (found in the tarball <tt>pnm2ppa-1.0.tar.gz</tt>; or installed with the <tt>pnm2ppa</tt> documentation. (This is often in <tt>/usr/doc/pnm2ppa*/</tt>.) On the printout you see several images: <itemize> <item>top left, you see a square with both black and colored items. These should align correctly, or you have to change your settings. <item>You see a large vertical bar, and also a horizontal bar. On the sides of the vertical bar there are a blue and a green line. These should align with the 0 mark. <item> You also see a small vertical, and horizontal, bar, with a red bar on its side. </itemize> If these items do NOT line up, you should take the following steps: <itemize> <item> (1) take for the large bar the number of the tickmark just smaller than the place where the green and blue lines point to. The minor tick marks are 25 points. <item> (2) To this number, add the number of the tick mark at which a red tick mark exactly lines up. This might not work if the offsets are way off; in that case, apply the correction of step 1, and print again. <item> (3) Add the horizontal offset to the value of <bf>ColOffsX</bf>, and the vertical offset to the value of <bf>ColOffsY</bf> in the configuration file. </itemize> Now you can print test.ps again to see whether this procedure worked. <bf>Shearing adjustments</bf> If bidirectional printing causes "shearing" of vertical lines (horizontal offsets of those parts of the line printed by left-to-right print-head sweeps relative to those printed on right-to-left sweeps) you can make small adjustments (in 1/600 inch) units using the <bf>blackshear</bf> and <bf>colorshear</bf> parameters in the configuration file. You can also suppress bidirectional printing with a <bf>unimode 1</bf> configuration file entry. The third and fourth lines on the color head offset calibration page (see above) correspond to color and black print head shearing corrections. If the central alignment patterns (labeled "0") are not aligned, add or subtract the positive or negative number below the best-aligned pattern from the <tt>colorshear</tt> and <tt>blackshear</tt> values in the configuration file. <bf>Cleaning the Print Heads</bf> You can use <tt>calibrate_ppa</tt> to clean the print heads by printing patterns that exercise all the ink nozzles: <tscreen><verb> calibrate_ppa --clean | pnm2ppa -p -i - -o - | lpr -l calibrate_ppa --clean | pnm2ppa --bw -i - -o - | lpr -l </verb></tscreen> The first of these commands prints a cleaning pattern with colored ink, the second uses black ink. <bf>Other adjustments</bf> The parameter <bf>blackness</bf> adjusts the number of black ink drops printed per pixel. It takes values 1, 2, 3, or 4 (2 is the default). Other values, like 0, suppress black ink. Inks can also be suppressed by configuration file entries <tt>black_ink 0</tt>, <tt>color_ink 0</tt>, <tt>cyan_ink 0</tt>, <tt>magenta_ink 0</tt>, or <tt>yellow_ink 0</tt>. These are mainly useful for debugging the printer driver. </article> ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������pnm2ppa-1.13/docs/en/sgml/COLOR.sgml����������������������������������������������������������������0000644�0000764�0000764�00000016565�07176621443�014031� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<!doctype linuxdoc system> <article> <!-- Title information --> <title>Color correction for pnm2ppa <author>The pnm2ppa project team <htmlurl url="mailto:ppa-rpms@sourceforge.net" name="ppa-rpms@users.sourceforge.net"> <date> v0.6, October 28, 2000 <abstract> Information and instructions for color correction of pnm2ppa color printing. <htmlurl url="http://sourceforge.net/projects/pnm2ppa" name="http://sourceforge.net/projects/pnm2ppa"> (Updated for pnm2ppa-1.0 and later.) </abstract> <!-- Begin the document --> <p> <bf> Overview of Color correction.</bf> Color Pixmap input to <tt>pnm2ppa</tt> (ppm format, produced by the ghostscript output devices <tt>ppmraw</tt> or <tt>ppm</tt>) specifies the color of a pixel as three coordinates (Red, Green, Blue) in the range 0-255. The program <tt>pnm2ppa</tt> converts these to relative amounts of Cyan, Magenta and Yellow ink drops printed on the page. <bf>Color correction</bf> allows the user to attempt to match the printed colors to some reference colors, such as those displayed on the terminal, or those printed on a different printer, or those printed on the same printer with a different driver (such as the Win9x drivers supplied by HP with their PPA printers). The color output from <tt>pnm2ppa</tt> can be controlled in two ways: <itemize> <item> by a color correction "gamma" file, if it is installed. By default this file is <tt>/etc/pnm2ppa.gamma</tt>, but it may also be specified with the pnm2ppa option <tt> pnm2ppa ... -F gammafile ... </tt>. <item> if there is no gamma file, by three values specified by keywords ( either <tt>GammaR</tt>, <tt>GammaG</tt>, <tt>GammaB</tt> or <tt>RedGammaIdx</tt>, <tt>BlueGammaIdx</tt>, <tt>GreenGammaIdx</tt>) in the <tt>pnm2ppa</tt> configuration file. </itemize> <tt>pnm2ppa</tt> will carry out <bf>"color correction"</bf>, unless it is called with the <bf>--noGamma</bf> command line option. However, unless you set up a color correction scheme, the default color correction does not change any colors. Color correction is specified by three color intensity functions (curves), one for each of Red, Green, and Blue. In their simplest form, these curves have a standard form controlled by a single "gamma" parameter such as <tt>GammaR</tt>. The more sophisticated correction, in the file <tt>pnm2ppa.gamma</tt>, specifies these curves more generally as a table of numbers that translate each possible color intensity value to a new value. Note that, in principle, different color corrections are needed for different print quality settings, and for different brands and qualities of paper! At present the methods for constructing a color correction for <tt>pnm2ppa</tt> are not very user-friendly. If you can improve them, please help!. <bf> Color correction with "gamma" values in the configuration file.</bf> <p> The PixMap (ppa) format specifies colors by an intensity for each primary color, Red, Green and Blue, in the range 0-255, so (0,0,0) is black, and (255,255,255) is white. The standard color intensity enhancement function replaces the ppm intensity <tt>i</tt> of each primary color by <tt> Enh(i) </tt> which is the closest integer to ( i / 256) raised to the power <tt>Gamma</tt>, times 256. You can specify the Gamma values in the configuration file as decimal numbers <tt>GammaR</tt>, <tt>GammaG</tt>, <tt>GammaB</tt>, but how do you find out what values to choose?. Perhaps by experimenting with changing the Gamma values. A source of information on Gamma color correction is <htmlurl url="http://www.cgsd.com/papers/gamma.html" name="www.cgsd.com/papers/gamma.html"> One method for constructing a Gamma correction has been built into <tt>pnm2ppa</tt>, but it wastes quite a lot of ink, and many users find it less effective than producing a customized color correction curve as described in the next section. You must first use pnm2ppa to print a color test page, and then generate a file <tt>gamma.ppm</tt> to compare to it. To do this, type <tscreen><verb> pnm2ppa -g -i - -o /dev/lp0 </verb></tscreen> (replace <tt>/dev/lp0</tt> by whatever printer device your PPA printer uses, or use <tt> ... -o - | lpr -l </tt>, etc.). Note also that as <tt>pnm2ppa</tt> is not receiving any ghostscript input to tell it the paper size, this must be correctly specified by a configuration file entry or, e.g., a <tt> -s a4 </tt> option, if the default US Letter paper is not being used. This procedure will print a color calibration page. The printed output is an array of sets of three colored bands, red, blue and green, each of which increases in brightness from left to right. The topmost set of bands should be referrred to as bands "0", the next ones as "1", etc. Next, run the extra program <tt>calibrate_ppa</tt> which will produce a (large, 10MB) PixMap (ppm) file: <tscreen><verb> calibrate_ppa -g -o gamma.ppm </verb></tscreen> This will produce the PixMap file as <tt>gamma.ppm</tt> in the current directory. To color-correct the printer so that its colors match those on the terminal screen, you should now attempt to view the file <tt>gamma.ppm</tt> using some application (such as the GNU image manipulation program <tt>gimp</tt>, or <tt>xv</tt>) that can view <tt>.ppm</tt> files. For each color, identify the printed band (0, 1, 2, ... etc) that most closely corresponds to the brightness profile shown on the screen. The default values are now: <tscreen><verb> RedGammaIdx 0 GreenGammaIdx 0 BlueGammaIdx 0 </verb></tscreen> (i.e., no color correction). Enter your modified values for these in the <tt>pnm2ppa</tt> configuration file (usually <tt>/etc/pnm2ppa.conf</tt>). The actual Gamma value is then <bf>1.0 - 0.033*(Color)GammaIdx </bf>; To color-correct with respect to another printer (or the Win9x drivers), you must manage to print <tt>gamma.ppm</tt> on that other device, then make the comparison. (Or print the output of <tt>pnm2ppa -g </tt> on that device; the top line is the same uncorrected color data as <tt>gamma.ppm</tt>.) <bf> Color correction using a "gamma file". </bf> A "gamma correction file" is a binary file containing 3 x 256 numbers, which are lookup tables of corrected red green and blue color intensities. The program <tt>pnm2ppa</tt> will use a default correction file <tt>/etc/pnm2ppa.gamma</tt> if it exists, unless the <tt>--noGamma </tt> option is used. The default correction file location can be changed by using the <tt>pnm2ppa</tt> option <tt>-F gammafile </tt>, where "gammafile" is the name (including the full path) of the gamma correction file to be used. Currently, there are two available tools for constructing a gamma correction file: <itemize> <item> A graphical utility <tt>ppagammacorrect</tt> is available in the PPA Color Correction Utilities section of the <tt>pnm2ppa</tt> web page <htmlurl url="http://sourceforge.net/projects/pnm2ppa" name="http://sourceforge.net/projects/pnm2ppa">, (but at the time of writing, this appears to be frozen in early stages of development, with little documentation, and may not be fully functional). <item> A working procedure is given in <htmlurl url="http://download.sourceforge.net/pnm2ppa/color-calibrate-1.0.tar.gz" name="http://download.sourceforge.net/pnm2ppa/color-calibrate-1.0.tar.gz">, which is made available by Klamer Schutte. <bf>This is the method recommended by many users.</bf> </itemize> </article> �������������������������������������������������������������������������������������������������������������������������������������������pnm2ppa-1.13/docs/en/sgml/INSTALL.MANDRAKE.sgml�����������������������������������������������������0000644�0000764�0000764�00000005730�07501053375�015425� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<!doctype linuxdoc system> <article> <!-- Title information --> <title>PPA Printer-Support RPM Packages for MANDRAKE Linux distributions. <author>The pnm2ppa project team <htmlurl url="mailto:ppa-rpms@sourceforge.net" name="ppa-rpms@users.sourceforge.net"> <date>v0.2 June 11, 2002 <abstract> Information about using pnm2ppa with Mandrake. (Updated for pnm2ppa-1.04 and later.) </abstract> <!-- Begin the document --> <p> <bf> Mandrake-specific issues.</bf> See the document <htmlurl url="file:INSTALL.REDHAT.html" name="INSTALL.REDHAT.html"> for installation and setup. That document is written for Red Hat; note the Mandrake-specific differences listed below, <bf> To update <tt>pnm2ppa</tt> in any recent Mandrake release (7.2 or later) from v1.04 to v1.10, the simplest procedure may be just to compile pnm2ppa from tarball source and replace the Mandake binaries <tt>/usr/bin/pnm2ppa</tt> and <tt>/usr/bin/calibrate_ppa</tt> with the new versions. They should function as drop-in replacements, with the same user interface, but improved image quality. (You may also wish to use the newer <tt>pnm2ppa.conf</tt> configuration file template).</bf> <itemize> <item> Mandrake 7.0 and earlier has incompatible and non-functional <tt>pnm2ppa</tt> support which must be replaced. Please use <tt>printtool</tt> to delete any installed PPA printers BEFORE upgrading <tt>rhs-printfilters</tt>. (If you forget to do this, and printtool will not start after the update, delete or move your <tt>/etc/printcap</tt> file.) Install the <tt>pnm2ppa</tt> RPM package. Then update <tt>rhs-printfilters</tt> with <tt>rhs-printfilters-1.58-4ppa5mdk.i386.rpm</tt> from <htmlurl url="http://sourceforge.net/projects/pnm2ppa" name="http://sourceforge.net/projects/pnm2ppa">. (Do <bf>NOT</bf> use <tt>rhs-printfilters-1.57-4ppa4.i386.rpm</tt> which is for RedHat systems only.) <item> Mandrake-7.1 supplies a <tt>pnm2ppa</tt> RPM and has support for it in <tt>rhs-printfilters</tt>. Mandrake 7.1 has a configuration tool <tt>DrakConf</tt> for setting up printers, which may be an interface to <tt>printtool</tt>. Some users have reported difficulties with this. In that case, just use <tt>printtool</tt> to configure the printer. <item> Mandrake-7.2 does not have a separate <tt>pnm2ppa</tt> RPM package, but has added <tt>pnm2ppa</tt> to the <tt>ghostscript</tt> RPM package. This creates difficulties for updating <tt>pnm2ppa</tt> with the RPM package from <htmlurl url="http://sourceforge.net/projects/pnm2ppa" name="http://sourceforge.net/projects/pnm2ppa">. You will get reported conflicts with <tt>ghostscript</tt> if you try to install the <tt>pnm2ppa-1.04-1.i386.rpm</tt> package, but it seems that you can safely use the rpm option <tt>--force</tt> to force its installation. Mandrake-7.2 also has moved to using CUPS as its printing system, and appears to now have its own printer configuration tool, but still includes <tt>pnm2ppa</tt> support in <tt>rhs-printfilters</tt>. </itemize> </article> ����������������������������������������pnm2ppa-1.13/docs/en/sgml/INSTALL.REDHAT.sgml�������������������������������������������������������0000644�0000764�0000764�00000075476�07512500653�015226� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<!doctype linuxdoc system> <article> <!-- Title information --> <title>PPA Printer-Support RPM Packages for Red Hat Linux and Compatible Distributions <author>The pnm2ppa project team <htmlurl url="mailto:ppa-rpms@sourceforge.net" name="ppa-rpms@users.sourceforge.net"> <date>v0.30, July 9, 2002 <abstract> Information and installation instructions to accompany pnm2ppa packages for Red Hat Linux available at <htmlurl url="http://sourceforge.net/projects/pnm2ppa" name="http://sourceforge.net/projects/pnm2ppa"> (Updated for pnm2ppa-1.10 and Red Hat 6.2 or later.) See the "Troubleshooting" section at the end of this document for fixes to some reported problems </abstract> <!-- Begin the document --> <p> <bf> Overview of HP's PPA DeskJet Printers.</bf> Most of Hewlett-Packard's DeskJet(tm) printers use the PCL3 command language, and are currently supported by Ghostscript drivers. However, a few legacy models, namely <itemize> <item> <em>DeskJet 710C Series</em>: HP DeskJet 710C, 712C <em>(discontinued)</em> <item> <em>DeskJet 720C Series</em>: HP DeskJet 720C, 722C <em>(discontinued)</em> <item> <em>DeskJet 820C Series</em>: HP DeskJet 820Cxi, 820Cse <em>(discontinued)</em> <item> <em>DeskJet 1000C Series</em>: HP DeskJet 1000Cxi, 1000Cse <em>(discontinued)</em> </itemize> feature "Host-based" printing, and use HP's proprietary PPA (<em>Printer Performance Architecture</em>) protocol, instead of PCL. The two models in each series are physically identical; they just came with different bundled Windows software. All PPA printers are now discontinued from HP's product lines, but may still be found as second-hand legacy items. PPA printers rely on software running on the host CPU to carry out the low-level processing of printer output that would be done by hardware in a standard PCL printer. The relation of PPA printers to PCL printers is analogous to the relation between "Winmodems" and true modems. Presumably, the idea at the time was that this would allow cheaper hardware to be used, but the decline in hardware prices probably meant that the savings were not significant, and PPA printing seems to have been abandoned. Unfortunately, HP only supplied Windows software drivers for PPA printers, and have indicated that it is unlikely that they will ever make the proprietary PPA specs public. This is apparently because of concerns that publication of the specs might reveal crucial details of HP's trade secrets about "color science" to competitors. (A secondary issue is that it is apparently possible to physically damage the printer by sending it bad sequences of PPA commands, which is not the case for PCL commands, and it seems that HP do not wish to take any responsibility for such damage by encouraging unofficial PPA programming.) In the past, Linux users often inadvertently purchased PPA DeskJet models, mistaking them for PCL3 DeskJets, which have traditionally been well-supported by Linux drivers. Fortunately, a reverse engineering effort, started in 1998 by Tim Norman, and continued by the <em>pnm2ppa</em> project at <htmlurl url="http://pnm2ppa.sourceforge.net" name="http://pnm2ppa.sourceforge.net">, and <htmlurl url="http://sourceforge.net/projects/pnm2ppa" name="http://sourceforge.net/projects/pnm2ppa"> has managed to produce drivers that provide basic printing functionality for these PPA printers under Linux and other Unices. While HP have recently begun to release their own Linux drivers for PCL3 DeskJets, they have not included drivers for their legacy PPA printers in this effort. The <tt>pnm2ppa</tt> driver has been stable since v1.04, released October 2000, with no known reproducible bugs, except that image printing quality was not so good. This version has been distributed with Red Hat, and other Linux distributions. v1.10, released July 2002, contains a lot of changes that improve image quality, in particular by improved bidirectional printing, and always printing black on top of color. A better improvement would be for someone to make a PPA backend to <htmlurl url="http://gimp-print.sourceforge.net" name="gimp-print">, using <tt>pnm2ppa</tt> as a guide for how to send data to PPA printers. But, since PPA printers are now "legacy" hardware, and <tt>pnm2ppa</tt> appears to work fine for most printing tasks, it is unlikely that any new developers will be interested in doing this, and there is currently no further development anticipated. The project is currently in "low-maintenance mode". <p> <bf> The pnm2ppa driver for color printing with PPA printers.</bf> Color printing with PPA printers is supported by the <em><tt>pnm2ppa</tt></em> driver which is the successor to the older black-and-white-only driver <htmlurl url="http://pnm2ppa.sourceforge.net/files/pbm2ppa-0.8.6.tar.gz" name="pbm2ppa-0.8.6"> developed by Tim Norman. <tt>pnm2ppa</tt> translates <em>portable anymap</em> (<em>pnm</em>) format images into a stream of PPA instructions which can be sent to the printer. In the driver name, "<em>pnm</em>" stands for the superset of <em>three</em> image formats: <em>ppm</em> (portable "pixmap" format for color images), <em>pgm</em> (portable "greymap" format for greyscale images), and <em>pbm</em> (portable "bitmap" format for black and white images). Ghostscript has a number of "output devices" that produce pnm format output from postscript or pdf input. These come in <em>plain</em> (text) and <em>raw</em> (binary) variants. While <tt>pnm2ppa</tt> can now interpret both plain and raw pnm formats, there is no point in using the inefficient plain formats: <em>always</em> use the "raw" output devices, which are: <itemize> <item><em>ppmraw</em> - raw pixmap format (color images); <item><em>pgmraw</em> - raw greymap format (greyscale images); <item><em> pbmraw</em> - raw bitmap format (black and white images); <item><em>pnmraw</em> - selects between ppm, pgm, and pbm raw formats; <item><em>pgnmraw</em> - selects between pgm and pbm raw formats. </itemize> The last two output devices are switches that try to analyze the image, and select an appropriate format; however, they are not recommended for routine use, as they may inconsistently choose the format. The <tt>ghostscript</tt> packages supplied with all recent Red Hat distributions provides all these devices. To see the list of available ghostscript output devices, type the command line <tscreen><verb> gs --help </verb></tscreen> if the required <tt>ppmraw</tt> or <tt>pbmraw</tt> devices are not shown, you will have to upgrade your version of ghostscript. The data must be streamed directly from ghostscript to <tt>pnm2ppa</tt> to the (local) printer without being stored in any intermediate file: one ppm-format (color) US Letter size page is represented by 3x5100x6600 Bytes (100MB) in binary format and four times this amount in text format. An example of a command line for printing a postscript file <tt>file.ps</tt> using <tt>gs</tt> (ghostscript) and <tt>pnm2ppa</tt> is <tscreen><verb> cat file.ps | gs -q -sDEVICE=ppmraw -r600 -sPAPERSIZE=letter -dNOPAUSE \ -sOutputFile=- - | pnm2ppa --eco -v 720 -i - -o - | lpr -l </verb></tscreen> (all on a single line). In this example the paper size is explicitly given to <tt>gs</tt> as <em>US Letter</em> (8.5"x11") size (<tt>letter</tt>); <tt>pnm2ppa</tt> no longer needs to be told what the paper size is, and will read it from the <tt>gs</tt> output (and check that it is a permitted size for the printer type). The <tt>pnm2ppa</tt> option <tt>--eco</tt> specifies "EconoFast" mode, for a lower quality output which uses less ink, and prints faster, and <tt>-v 720</tt> specifies the PPA printer as belonging to the DeskJet 720C series. <itemize> <item> <tt>pnm2ppa</tt> expects that the input resolution is 600dpi (or 300dpi if it is called with the <tt>pnm2ppa --dpi300 ...</tt>option). This corresponds to the <tt>gs -r600 ...</tt> or <tt>gs -r300 ... </tt> ghostscript options. If other higher/lower input resolutions are used, the size of the printed image will be larger/smaller, provided it is within the printer's allowed size range. </itemize> Obviously, it would be impractical to type such a command each time one wished to print something, and since RedHat 6.2, printfilter support for <tt>pnm2ppa</tt> is built into Red Hat's printer configuration scheme, so after configuration, the simple command <tscreen><verb> lpr file.ps </verb></tscreen> should successfully print a postscript file. However, in case you wish to check if something is misconfigured in the print filters, you can use a script like the above one to bypass them and check that the printer is working. <itemize> <item> <em> Also, if you wish to print to paper sizes supported by ghostscript, but not supported by the Red Hat Printer configuration utilities, you can use scripts like the one above. The HP 710C, 720C, and 820C series support paper sizes from 3"x3" to 8.5"x14", while the 1000C supports 4"x6" to 13"x19". </em> </itemize> <p> <bf> Available RPM packages.</bf> A RPM package for <tt>pnm2ppa</tt> is part of the Red Hat Linux distribution starting with Red Hat 6.2. You will also find a RPM package for the latest release of <tt>pnm2ppa</tt> at <htmlurl url="http://sourceforge.net/projects/pnm2ppa" name="http://sourceforge.net/projects/pnm2ppa">. The latest version at the time of writing is <tt>pnm2ppa-1.10-1rh7x.i386.rpm</tt>, and is built on Red Hat 7.3, or <tt>pnm2ppa-1.10-1rh62.i386.rpm</tt>, built on Red Hat 6.2. If you are running a different release of Red Hat (or a different Linux distribution) you may need to download and rebuild the source RPM <tt>pnm2ppa-1.10-1.src.rpm</tt> instead: <tscreen><verb> rpm --rebuild pnm2ppa-1.10-1.src.rpm </verb></tscreen> (You must be <tt>root</tt> to do this, and have the necessary compilers installed; on Red Hat, the rebuilt binary RPM will be created in the directory <tt>/usr/src/redhat/RPMS/i386/</tt>.) Red Hat 6.2 and later also includes support for configuring your printer to use <tt>pnm2ppa</tt>. (Information necessary for configuring <tt>pnm2ppa</tt> on older Red Hat releases has been removed from this document; for this, see the documentation that came with <tt>pnm2ppa-1.04</tt>, or update your RedHat distribution.) Note: If you are still using Red Hat 6.2, you may wish to update the print filter support for <tt>pnm2ppa</tt> that comes with it. The <tt>pnm2ppa-1.10-1rh62*</tt> RPM package supplies the necessary files that you can use. After installing this RPM, see <tt>/usr/lib/rhs/rhs-printfilters/README.ppa</tt> for details. <p> <bf> Installing the <tt>pnm2ppa</tt> RPM package and setting up the PPA printer.</bf> To install the RPM package, you must log in as the system administrator, <tt>root</tt>. Now begin the installation. First install the <tt>pnm2ppa</tt> RPM: <tscreen><verb> rpm -Uvh pnm2ppa-1.10-1*.i386.rpm </verb></tscreen> The <tt>pnm2ppa</tt> executable gets installed in <tt>/usr/bin/</tt>. The Linux kernel will be able to autodetect IEEE-1284 devices like PPA printers, provided they are attached to the parallel port with a bidirectional IEEE-1284 cable. (If your printer works under Windows, you have the correct cable.) A script <tt>detect_ppa</tt> is provided by the <tt>pnm2ppa</tt> RPM: just type <tscreen><verb> detect_ppa </verb></tscreen> to confirm that your Printer is found. A typical message from the printer, which will be displayed if autodetection is successful, is: <tscreen><verb> CLASS:PRINTER; MODEL:DESKJET 820C; MANUFACTURER:HEWLETT-PACKARD; DESCRIPTION:Hewlett-Packard DeskJet 820C; COMMAND SET:SCP,VLINK; </verb></tscreen> A list of PPA printers found, and the parallel ports to which they are attached, will also be shown. At this point it is useful to test that your printer is working, by printing a test page using the supplied script <tt>test_ppa</tt> which the RPM has installed. You will need to know your printer model (710, 712, 720, 722, 820, 1000), your paper size (letter, legal, a4) and the printer port the printer is attached to. If it is attached to the primary parallel port, this is (usually) <em><tt>/dev/lp0</tt></em>. Type <tscreen><verb> test_ppa </verb></tscreen> and give the details about printer model. papersize, and port number when prompted. You will then be asked whether to print a test page, an offset calibration page, or an alignment calibration page, etc. <itemize> <item> <em><em>Tip:</em> The </em><tt>test_ppa</tt><em> script does not use the Red Hat print filters, so it is useful when troubleshooting, for testing if any printing problems are associated with the basic printer installation, or with the configuration of the print filters.</em> </itemize> <bf> Configuring the print filters.</bf> Note: Red Hat 7.3 now features either CUPS or LPRng printer management. The configuration tools should be able to configure <tt>pnm2ppa</tt>, using the information about it taken from the Linux Printer Database. Apart from the addition of a new <tt>--dpi300</tt> option to accept 300dpi input (useful for printing PNM output from 300dpi scanners), there have been no changes in the pnm2ppa command line since the pnm2ppa-1.0 release, so the configuration scripts are stable. (They can only use the default 600dpi input mode.) Since Red Hat 7.1, there is a graphical printer configuration utility <tt>printconf-gui</tt>. In Red Hat 6.2 and 7.0, the older configuration utility called <tt>printtool</tt> is used. In either case, start the "<em>Red Hat Linux Print System Manager</em>" (as root) to configure the printer, either by clicking on the printer icon in Red Hat's "control-panel", or just typing <tscreen><verb> printtool </verb></tscreen> which also starts <tt>printconf-gui</tt> in the newer Red Hat releases. <p> <bf> Configuring the print filters with the Red Hat 6.2/7.0 printtool</bf> (Skip this section unless you are still using Red Hat 6.2 or 7.0) The following description is for the older <tt>printtool</tt> that is used by Red Hat 6.2/7.0. The printer configuration utility <tt>printconf-gui</tt> for Red Hat 7.1 and later is a little different, as it is based on the <em>foomatic</em> printer configuration database which contains entries for <tt>pnm2ppa</tt> (but not the older <tt>pbm2ppa</tt>). You should be able to easily figure out what to do: it can configure all <tt>pnm2ppa</tt> command-line options in the <em>Driver Options</em> screen. In the Red Hat 6.2/7.0 Print System Manager window, click on <em>Add</em>, then in the "Add a Printer Entry", select <em>Local Printer</em>, and click <em>Ok</em>. Hopefully, the port on which the printer is attached will be listed as "Detected" (<em>if not, fix the problem before continuing</em>, perhaps by adding the line "<tt>alias parport_lowlevel parport_pc</tt>" to <tt>/etc/conf.modules</tt>). You will now have to "<em>edit the local printer entry</em>" for the PPA printer. Click on <em>Select</em> to chose the "Input filter". The <em>Configure Filter</em> screen will open. Among the many printer entries in the list "<em>Printer Type</em>", you should find three entries <itemize> <item><bf>HP DeskJet 1000 series (PPA)</bf> (for 1000Cse, 1000Cxi models) <item><bf>HP DeskJet 710/720 series (PPA)</bf> (for 710C, 712C, 720C, 722C models) <item><bf>HP DeskJet 820 series (PPA)</bf> (for 820Cse, 820Cxi models) </itemize> Select the appropriate entry for your printer model. You will then be presented with various options: <itemize> <item> The <em>Driver Description</em> box contains information about the driver (you may have to use the scrollbar at the right of the box to read it all). <item>The <em>resolution</em> box shows a single resolution (600x600). There are no other choices. <item> The <em>Paper Size</em> box allows various choices (only <em>letter</em>, <em>legal</em>, and <em>a4</em> seem correspond to native paper sizes printed by the Red Hat print filters; the other choices, (a3, ledger, ...) appear to get resized by the print filters to print on US Letter size paper (?) ). (Other paper sizes cannot be selected this way, but you <em>can</em> print to any papersize, <em>if it supported by both ghostscript and the printer</em>, using a script, as described above, that bypasses the RedHat printfilters.) <item> The <em>Color Depth/ Uniprint Mode</em> box allows various selections of color and print quality (These are achieved by using various combinations of the <tt>pnm2ppa</tt> options <em>--eco</em> (EconoFast mode), <em>-p</em> (disable black ink cartridge) and <em>--bw</em> (black and white printing only), without direct intervention by the user.) The choices (in the most recent <tt>printerdb</tt> database) are: <itemize> <item> Black and White, econofast mode (<tt>--bw --eco</tt>) <item> Black and White, normal quality (<tt>--bw</tt>) <item> Color, econofast mode (<tt>--eco --fd</tt>) <item> Color, normal quality (<tt>--eco</tt>) <item> Color, high quality <item> Color, normal quality, black ink disabled (<tt>-p --eco</tt>) <item> Color, high quality, black ink disabled (<tt>-p --uni</tt>) </itemize> (These are the choices that will be presented by "official" <tt>rhs-printfilters-1.72</tt>; if you installed a <tt>pnm2ppa</tt> RPM package from <htmlurl url="http://sourceforge.net/projects/pnm2ppa" name="the SourceForge pnm2ppa site">, you may have a file <tt>/usr/lib/rhs/rhs-printfilters/README.ppa</tt> explaining how to modify earlier versions of <tt>rhs-printfilters</tt> to show these updated choices.) You may also see a choice to use the older "Legacy" driver <tt>pbm2ppa</tt> (black and white only); this is is stable but unmaintained; it may still be a useful alternative to <tt>pnm2ppa</tt> on older, slower systems with less available memory. <item> The three <em>Printing options</em> are not relevant here, and should <em>not</em> be selected. They are for direct printing of text (ascii) to non-postscript printers, but since the only way of printing text files with <tt>pnm2ppa</tt> is by first converting them to postscript(tm), this is <em>not</em> possible on the PPA printer. <itemize> <item> <em>It is important that the choice </em> "Fast text printing (non-PS printers only)"<em> is NOT selected, so that the print filters will convert text files to postscript before printing.</em> </itemize> <item>The <em>Margins</em> entries control the margins used when printing text files (these are instructions to the text-to-postscript conversion process). <item> The <em>Extra GS options</em> box is not only a place for adding options for ghostscript, but also for the PPA drivers. <em>Leave this box empty unless you know what you are doing</em>. As explained in the text in the Driver Description box (you did read it, didn't you ?), the entry should be in the format: <tscreen><verb> gs_options PPA ppa_options </verb></tscreen> Anything before the "<tt>PPA</tt>" is interpreted as a <tt>gs</tt> option, anything after it is interpreted as a <tt>ppa</tt> option. You can learn about <tt>pnm2ppa</tt> options by typing either "<tt>man pnm2ppa</tt>" or "<tt>pnm2ppa --help</tt>" at a command line (hopefully, these two sources of information will be consistent with each other!); </itemize> When you have made your choices, click on <em>Ok</em> to save your selections and close the "Configure Filter" screen, and then click on <em>OK</em> to close the "Edit Local Printer Entry" screen. You are now back in the "Red Hat Print System Manager" screen; highlight the printer you just configured, and, in the <em>Tests</em> menu, choose <em>Print Postscript test page</em> to print a test page using the Red Hat print filters. If this printed correctly, your print system is set up to use the PPA printer, just like any of the other printers that the Red Hat print filters support. <p> <bf> Configuring pnm2ppa.conf and calibrating the printer. </bf> A number of printer parameters are set to reasonable default values for each of the printer models, but you may wish to "fine tune" or calibrate your printer. The default values can be overridden by entries in the configuration files, which by default are <tt>/etc/pnm2ppa.conf</tt> and <tt>/etc/pbm2ppa.conf</tt>. At 600dpi, one pixel is 1/600 inch. The user-adjustable parameters are: <itemize> <item> <bf>verbose 1</bf> and <bf>silent 1</bf>. These control messages about progress and errors from <tt>pnm2ppa</tt>. By default, messages are sent to the system log <tt>/var/log/messages</tt>. The <tt>verbose 1</tt> keyword send copies to <tt>stderr</tt>, the standard error stream to the terminal. The <tt>silent 1</tt> keyword silences the stream of messages to the system log. <itemize> <item> <bf> The system log messages may be silenced in the default configuration file; switch off "silent" mode with "silent 0" for debugging printer problems (or use verbose mode).</bf> </itemize> <item> The <bf>version</bf> keyword can be used to specify the printer model as 710, 712, 720, 722, 820, or 1000. It is not needed if you use the RedHat printool to configure the printer. <item> <bf>xoffset</bf> and <bf>yoffset</bf>: the x-offset and y-offset (in pixels) of the printed image on the page, which should be chosen so the image is correctly centered on the paper. (These can also be set with the <tt> -x <xoff> </tt> and <tt> -y <yoff> </tt> options.) See <htmlurl url="./CALIBRATION.html" name="CALIBRATION.html"> (or CALIBRATION.txt) for more information. <item> <bf>topmargin</bf>, <bf>bottommargin</bf>, <bf>leftmargin</bf>, <bf>rightmargin</bf>: the four margins, which define the distances (in pixels) from the edges of the paper to the printed region; parts of the image that are outside these margins will not be printed. (These can also be set with the <tt> -t <top margin> </tt>, <tt> -b <bottom margin> </tt>, <tt> -l <left margin> </tt>, and <tt> -r <right margin> </tt> options.) <item> <bf>ColOffsX</bf> and <bf>ColOffsY</bf>: the x-offset and y-offset (in pixels) between the color image produced by the color ink printer head, and that produced by the black ink printer head. These should be recalibrated <bf> each time an ink cartridge is replaced</bf>. See <htmlurl url="./CALIBRATION.html" name="CALIBRATION.html"> (or CALIBRATION.txt) for more information. <item> <bf>blackshear</bf> and <bf>colorshear</bf>: these are x offsets between right-to-left and left-to-right sweeps of the print head, one for the black printing and one for the color printing. These provide sideways offsets (in pixels) of the right-to-left sweeps, that can be used to correct "shearing" when printing in modes that use bidirectional print head sweeps. <item><bf>unimode 1</bf> will make unidirectional print sweeps (left-to-right) the default, instead of bidirectional sweeps. The <tt>--uni</tt> and <tt>--bi</tt> options can control how a particular print run is printed. Unidirectional printing is only useful (it is slower) if there are issues of "shearing" in high quality image printing. <item> <bf>blackness</bf> : this takes values 0,1,2,3 or 4 drops of black ink per pixel, and controls black ink density in black-and-white and "text-like" black regions in color printing. At present, this has no effect on printing with the black ink cartridge disabled, or on black regions identified as "image-like". (This can also be set with the <tt> -B <n></tt> option, where <tt>n</tt> is the number of drops.) <item><bf>GammaR</bf>, <bf>GammaG</bf>, and <bf>GammaB</bf>: the are the three "gamma" parameters that define the standard color correction curves for red, green, and blue. Changing these will affect how colors appear (decreasing any Gamma enhaces the corresponding color). The Gamma values are specified as decimal numbers, with Gamma = 1.0 corresponding to no color correction. <item> Gamma values can also be specified using integer numbers <bf>RedGammaIdx</bf>, <bf>GreenGammaIdx</bf>, <bf>BlueGammaIdx</bf>; These are determined by a procedure discussed in <htmlurl url="./COLOR.html" name="COLOR.html"> or COLOR.txt, which involves printing a test page. The <bf>papersize</bf> keyword specifies the paper size used for this testpage, because it is produced by <tt>pnm2ppa</tt> without the input that usually specifies the page size. <item> The keywords <bf>black_ink 0</bf>, <bf>color_ink 0</bf>, <bf>cyan_ink 0</bf>, <bf>magenta_ink 0</bf>, and <bf>yellow_ink 0</bf> can be used to switch of the various inks; this can be useful in troubleshooting and debugging <tt>pnm2ppa</tt>. </itemize> Use <tt>test_ppa</tt> to print various test pages or calibration patterns to adjust the offsets. If you wish to specify these parameters using the command-line options described above, in Red Hat 6.2/7.0 some of them can be entered in the "extra GS options" box using the Print System Manager (<tt>printtool</tt>), as described above. In Red Hat 7.1 and later, all command-line options can be set using the new <tt>printconf-gui</tt> utility. <p> <bf> Utility programs for the printer.</bf> HP's Windows software provides a utility program that sends PPA commands to tell the printer to perform tasks like cleaning the printheads, etc. On Red Hat Linux, You can use <tt>test_ppa</tt> (which acts as a command-line front-end for <tt>calibrate_ppa</tt>) to print head-cleaning patterns. There is a graphical (gtk-based) tool written by Javier Sedano for creating a <tt>pnm2ppa.conf</tt> file and acting as a front end to <tt>calibrate_ppa</tt>. This is called <tt>ppaSet</tt>, and a beta version of it can be found in the same place as the <tt>pnm2ppa-1.10</tt> distribution at <htmlurl url="http://sourceforge.net/projects/pnm2ppa" name="http://sourceforge.net/projects/pnm2ppa"> There was also at one time a proposal to add support for PPA printers to the PUP (Printer Utility Program) utility, which is also a project at <htmlurl url="http://www.sourceforge.net/project/?group_id=1118" name="http://www.sourceforge.net">. However, as of the time of writing, no PUP support for PPA printers is available. <p> <bf>Troubleshooting</bf> The first thing to do is to look at the messages from <tt>pnm2ppa</tt> in the system log to see what is happening, whether <tt>pnm2ppa</tt> <bf>actually received any input</bf>, and if it was valid. <bf> (You may need to enable system log messages in <tt>/etc/pnm2ppa.conf</tt>, see above.)</bf> Maybe ghostscript failed to convert your postscript file into PNM format: in that case the system log reports <bf>"Fatal Error! Input image (pnm2ppa) is not a PNM image"</bf>. (note: when this occured, older versions of <tt>pnm2ppa</tt> reported <bf>"Input image is not a supported PNM format"</bf> which may have been confusing). This is because the input received by <tt>pnm2ppa</tt> was not a valid PNM image, but instead ghostscript failed to produce any PNM output at all, and its only output was probably just an error message. This is <em>not</em> a <tt>pnm2ppa</tt> problem! Here are suggestions for dealing with other problems that you may encounter. <itemize> <item><bf> Printing fails in the middle of a print run</bf>, perhaps when a figure embedded in the document is printing (in the latest <tt>pnm2ppa</tt> versions, printing finishes normally, but an incomplete document is printed). The system log reports that <tt>read_line</tt> could not read the image, and found EOF (end-of-file). This probably means that <tt>ghostscript</tt>'s "ppmraw" or "pgmraw" output device started correctly, but failed for some reason before finishing the image conversion from postscript to PNM format, usually leaving a core dump. (This has been seen to happen in ghostscript 5.10 ; upgrading to ghostscript 5.50 solved the problem.) If you cannot upgrade, try printing the document in black-and-white using the ghostscript "pbmraw" output device. <item> <bf>You printed an image file using a "high quality" printer setting, but it has visible horizontal lines on it </bf>and printing under Windows(tm) 9x doesn't show this effect (except in "economode"). These are probably "swath boundaries", showing the junction between different sweeps of the print head. Solution: using unidirectional printing (PPA option <tt>--uni</tt>, or <tt>unimode 1</tt> in <tt>/etc/pnm2ppa.conf</tt>) helps a little. <bf>this problem is fixed in the pnm2ppa-1.10 release</bf> <item> "<bf>Flashing light syndrome</bf> ". Your printer usually works, but you have found that some particular documents cause the printer to fail, and the lights on its panel start flashing rapidly in sequence. Solution, turn the printer off and back on again. This is not supposed to happen any more; if it happens reproducibly, contact the pnm2ppa developers, and offer to make the offending file available for testing and diagnosis of this problem. (Don't sent it to the Mailing List unless requested). Bug reports can be filed at <htmlurl url="http://sourceforge.net/projects/pnm2ppa" name="the SourceForge pnm2ppa site">. <item> <bf>You wish to print on envelopes or other non-standard media not supported by the print filters</bf>? Solution: if you can get Ghostscript (<tt>gs</tt>) to produce the correct image, and the paper size is in the range allowed by your printer, you should be able to do this with a script that bypasses the print filters, as described earlier in this document. <item> <bf>Colors look wrong, or do not match what the Windows(tm) 9x driver produces</bf>. Solution: check that your color ink cartridge is not running out of some ink color; if not, (a) adjust the "gamma" entries in <tt>/etc/pnm2ppa,conf</tt>, or (b) install a customized color calibration file <tt>/etc/pnm2ppa.gamma</tt>. See the file <htmlurl url="./COLOR.html" name="COLOR.html"> (or COLOR.txt) for more information. </itemize> <p> <bf>Contacting the pnm2ppa project.</bf> Send comments or corrections (about this document or the RPMS) to: <htmlurl url="mailto:ppa-rpms@sourceforge.net" name="ppa-rpms@users.sourceforge.net"> There are three mailing lists, <em>pnm2ppa-announce@lists.sourceforge.net</em> (announcements), <em>pnm2ppa-users@lists.sourceforge.net</em> (users helping users) and <em>pnm2ppa-devel@lists.sourceforge.net</em> (developers). You can subscribe to them, or browse their archives, at <htmlurl url="http://sourceforge.net/projects/pnm2ppa" name="http://sourceforge.net/projects/pnm2ppa">. (The older pnm2ppa mailing lists died with the ListBot service) To contact the developers, subscribe to <em>ppa.devel</em> and post a message. There are Public Forums for posting questions and comments at <htmlurl url="http://sourceforge.net/projects/pnm2ppa" name="http://sourceforge.net/projects/pnm2ppa"> (but whether you get any help from these, depends on whether anyone is reading them (unlikely!)). </article> ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������pnm2ppa-1.13/docs/en/sgml/PPA_networking.sgml�������������������������������������������������������0000644�0000764�0000764�00000047127�07431763126�016037� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<!doctype linuxdoc system> <article> <!-- Title information --> <title>Networking HP PPA DeskJet Printers using SAMBA. <author>The pnm2ppa project team <htmlurl url="mailto:ppa-rpms@sourceforge.net" name="ppa-rpms@users.sourceforge.net"> <date>v0.12 Feb 10, 2002 <abstract> This document discusses Networking HP 710C, 720C 820C or 1000C Series (PPA Protocol) HP DeskJet printers with non-Windows Hosts or Clients, using SAMBA. Topics include choosing between transmitting PPA or PostScript across the network, Windows and Linux/Unix Hosts, Windows and Linux/Unix Clients, and emulating a PostScript printer on Windows. (Updated for pnm2ppa-1.04 and later.) </abstract> <!-- Begin the document --> <toc> <sect> Networking HP DeskJet PPA printers with SAMBA <p> <sect1> Overview of PPA printers. <p> The HP DeskJet 710/712C, 720/722C, 820Cse/820Cxi and 1000Cse/1000Cxi printers are "Winprinters" which are designed only for use with MS Windows operating systems. HP supplies Windows-only software that processes the input data into the proprietary and unpublished PPA ("Printer Performance Architecture") protocol. HP states that these printers are <bf>not supported as networked printers</bf>, but they in fact function correctly as shared (SMB) printers under MS Windows. In this document, the <bf>Host</bf> is the computer to which the PPA printer is physically connected, and the <bf>Clients</bf> are other computers on the network that wish to print documents on the PPA printer. In the Windows printing system, separate copies of the HP PPA printer drivers are installed on each Client, and are run on the Client to produce PPA output that is sent over the network to be spooled on the Host to which the printer is attached. HP's drivers are only supplied for Windows systems. The independently-produced <htmlurl url="http://sourceforge.net/projects/pnm2ppa" name="pnm2ppa"> driver runs on Linux, some other Unix systems, and BeOS. This document describes various tested strategies for using <tt>pnm2ppa</tt> and the <htmlurl url="http://www.samba.org" name="samba"> suite of SMB tools to allow the PPA printer to be attached to a non-Windows host on a (TCP-based) SMB network, or to allow non-Windows Clients to receive printing services from a Host on the network. <sect1> Choice of protocol for sending over the network. <p> There are <bf>two</bf> possible ways to send printer data from a Client to the printer Host over the network. <itemize> <item> as <bf>PPA data</bf>, created by a driver on the Client. This is what happens when using conventional printer sharing on Windows. <item> as <bf>PostScript data</bf>, created on the Client, which is then translated into PPA instructions by drivers running on the printer Host. </itemize> Since PPA data is rather large, the first method involves sending larger amounts of data over the network, which may be why HP do not officially support PPA DeskJets as networked printers. It also requires that PPA drivers are installed on the Client. The Host to which the printer is attached can thus provide <bf>two</bf> classes of printing services: <itemize> <item> <bf>PPA printing services:</bf> the Host accepts PPA-format printing jobs created on the Clients either with HP's native PPA drivers (Windows Clients) or <tt>pnm2ppa</tt> (Unix/Linux/BeOS Clients); <item> <bf>PostScript printing services:</bf> the Host accepts PostScript-format printing jobs created on any postscript-capable Client, and converts them to PPA format using either HP's native PPA drivers (Windows Host) or <tt>pnm2ppa</tt> (Unix/Linux/BeOS Host); </itemize> It is useful to set up the Host to offer <bf>both types</bf> of service, sharing a common spooling system. <sect> Configuring the Printer Host. <p> <sect1> Configuring a Linux/Unix Host to share a PPA printer using Samba. <p> It is assumed that <tt>pnm2ppa</tt> is installed and working to provide local printing services on the Host, and that <tt>lpr</tt> will invoke a full set of print filters, as (e.g.) in Red Hat 6.2. The PPA printer is installed with the printer name <tt>lp</tt>, and <tt>samba</tt> is assumed to be installed. General Samba configuration issues involving security levels, network password, etc, are outside the scope of this document (see the SMB-HOWTO). You must log in as <tt>root</tt> to configure Samba. Here is a sample entry setting up two public printer shares in the Host's <tt>/etc/smb.conf</tt> file. The printer HP722C-PPA is for printing by a Client that sends PPA output from <tt>pnm2ppa</tt> or the HP drivers across the network, and HP722-PS is for Clients that produce PostScript output: <tscreen><verb> [HP722C-PPA] comment = HP 722C printer on Linux (PPA input) path = /var/tmp printer name = lp writable = yes public = yes printable = yes print command = lpr -l -r -h -P %p %s [HP722C-PS] comment = HP 722C printer on Linux (Postscript input) path = /var/tmp printer name = lp writable = yes public = yes printable = yes print command = lpr -r -h -P %p %s </verb></tscreen> The only differences besides the names are that the print command for HP722-PPA uses the "<tt> -l </tt>" "pass-through" option so print filters are not applied. The <tt>path</tt> entry uses <tt>/var/tmp</tt> because this is (presumably) a world-readable and -writable area for temporary files. After editing <tt>/etc/smb.conf</tt> to include these entries, save it, and test its syntax with Samba's <tt>testparm</tt> utility. Then restart samba (run "<tt>/etc/rc.d/init.d/smb restart</tt>" on Red Hat). <sect1> Configuring a Windows Host to share a PPA printer with non-Windows Clients. <p> The Host is assumed to be a Window 98 system, and the PPA printer is assumed to be a HP722C installed with the native HP PPA drivers supplied on HP's installation CD. Some details may vary on other Windows versions. First set up a shared printer that can accept PPA input from both networked Windows Clients, and from networked non-Windows Clients that use <tt>pnm2ppa</tt>. <itemize> <item><bf>IMPORTANT!</bf>: A PPA printer attached to a Windows Host shared with a Client running pnm2ppa has the following limitation: <itemize> <item> <bf>Bi-Directional communication between the Windows Host and the printer must be disabled.</bf> </itemize> If it is not done, <bf>a General Protection Fault</bf> will usually occur on the Windows Host when pnm2ppa sends output to the shared printer. (A "Hpfbkg06" error occurs, and the printer becomes nonfunctional until the Windows system is rebooted.) Disabling bi-directional communication appears to be a minor inconvenience: according to HP, the print quality is unaffected, but the "advanced features of the Status Monitor" will no longer send reminders to align the print cartridges after a new cartridge is installed, or send error messages associated with the ink cartridges or the banner lever. </itemize> You may be able to avoid disabling bi-directional communication by using an emulated Postscript printer to serve non-Windows Clients <bf>without</bf> using <tt>pnm2ppa</tt> (see below). To turn off bi-directional communication between the Windows Host and the printer, open the <bf>Settings/Printers</bf> folder, then right-click on the printer icon, and open the <bf>Properties</bf> dialog. Select the <bf>Details</bf> tab, and click on <bf>Spool Settings</bf>, then choose the setting "<bf>Disable bi-directional support for this printer</bf>". If you have any difficulties, try rebooting Windows after the change, or see HP's support document <htmlurl url="http://www.hp.com/cposupport/printers/support_doc/bpd06455.html" name="http://www.hp.com/cposupport/printers/support_doc/bpd06455.html"> about disabling bi-directional communication. To set up the Host to share the printer, right-click on its icon in the <bf>Settings/Printers</bf> folder, and select <bf>Sharing</bf>, then assign it a Share Name like HP722C-PPA , and enter a Comment Line like "HP 722C printer on Windows 98 (PPA input)". You may now also wish to set up an emulated Postscript printer that accepts Postscript input from the Client, and prints it using HP's PPA drivers <bf>running on the Host, instead of on the Client.</bf> See the section <htmlurl url="PPA_networking-4.html" name="Emulating a PostScript printer on a Windows Host"> If you have installed and successfully tested the emulated printer, set it up for sharing on the network. Right-click on its icon in the <bf>Settings/Printers</bf> folder, and select <bf>Sharing</bf>, then assign it a Share Name like HP722C-PS, and enter a Comment Line like "HP 722C printer on Windows 98 (PostScript input)". The emulated printer will appear like a Postscript printer to the Clients. If it provides acceptable printing services to the non-Windows clients, you will not need to connect <tt>pnm2ppa</tt> printers to HP722C-PPA, and will be able to re-enable bi-directional communication between the HP drivers and the printer. (However, the extra processing involved in the emulation may be unacceptably slow, or turn out to use too much of the host's CPU) <sect> Configuring the Printing Clients. <p> <sect1> Setting up Printing from a Windows Client. <p> Open the <bf>Settings/Printers</bf> folder, and start the <bf>Add Printer</bf> Wizard. Choose to add a Network Printer, and browse the network to find the Printer Shares you configured on the host (e.g., HP722C-PPA and HP722C-PS). If they are not visible, either the Host or the network is not properly configured. Correct the problem before proceding. Normally, you will probably want to use the native Windows HP PPA drivers, so select the printer Share that accepts PPA input (e.g., HP722C-PPA). If the Host is a Windows Host, it will provide the drivers over the network, otherwise you will have to find the printer in the list of available HP Printer drivers, or click on <bf>Have Disk</bf> and install them from HP's installation CD. You then get a chance to change the name with which the printer will be known on the Client. Finally, you should choose to print a test page. You might instead (or also) want to set up printing services using the Printer Share that accepts Postscript (e.g., HP722C-PS). In that case, if the Host is not a Windows Host, choose a "generic" PostScript printer like the Apple LaserWriter II NT or the Digital turboPrintServer 20/Net. If the test page prints sucessfully, you are finished! <sect1> Setting up Printing from a Linux/Unix Samba Client <p> First examine the network by opening a terminal window and using the command <tscreen><verb> smbclient -L hostname </verb></tscreen> (where "hostname" should be replaced by the network name of the Host to which the printer is attached). This will list the SMB services provided by that Host. (Alternatively, your system may have some graphical front-end to <tt>smbclient</tt> that allows you to inspect the network.) The list should include the Printer Share(s) you configured on the Host (e.g., HP722C-PPA and HP722C-PS). If these are absent, you must first identify and correct the problem. You must now configure the printer. The details of how to do this will vary between Linux/Unix distributions, but there will probably be support for network printing using Samba. If the Printer Share you wish to use is intended to accept PPA input (e.g., HP722C-PPA), configure the Client to use the <tt>pnm2ppa</tt> driver. If it is intended to accept PostScript input (e.g., HP722C-PS), configure the Client to print to a PostScript printer. You may wish to configure both types of printers, and experiment to see which provides the best printing services on your network. See the SMB-HOWTO documentation for more information. <sect> Emulating a PostScript printer on a Windows Host. <p> If you do not have commercial PostScript emulation software for Windows that will work with your HP PPA DeskJet (the author is unaware of any such software that supports PPA printers), you can use <bf>Ghostscript</bf> together with HP's native Windows drivers. <sect1> Installing Ghostscript as the emulation software. <p> From the Ghostscript home page <htmlurl url="http://www.cs.wisc.edu/~ghost/" name="http://www.cs.wisc.edu/~ghost/"> download and install (in this order) the Windows packages of <itemize> <item> <bf>Ghostscript</bf> (PostScript Emulation Software). <item> <bf>GSview</bf> (Ghostscript previewer, provides <tt>gsprint</tt>). <item> <bf>RedMon</bf> (printer port redirection utility). </itemize> (Install these using their <tt>setup.exe</tt> installation tools, and do not manually set up any configuration files for <tt>gsprint</tt> or <tt>RedMon</tt>.) You must now follow the detailed instructions below, and use the Windows "Add Printer Wizard" to add a postscript printer, and then configure it to use the <tt>gsprint</tt> utility that comes with GSview, and redirect the output to your HP PPA DeskJet using the <tt>RedMon</tt> utility. <sect1> Adding the fictitious Postscript printer. <p> In the following, I assume your printer is a HP DeskJet 722C, and is installed with its native Windows Drivers as a printer called "HP DeskJet 720C Series". Change printer name entries below as appropriate for your printer model. The following instructions are tested on Windows 98, and may differ on other Windows variants. Open the <bf>Settings/Printers</bf> folder. First check that the HP PPA Deskjet is correctly installed, using HP's native Windows drivers. Right-click on its icon, and select its <bf>Properties</bf> dialog. The <bf>General Properties</bf> screen will open. This shows the <bf>exact name</bf> that the printer was given when it was installed. Make a note of it, and use the <bf>Print Test Page</bf> button to confirm that the printer is working. (The "Printer name:" line on the test page will also show the <bf>exact name</bf> of the HP PPA Deskjet that you will need to use when configuring the emulated postscript printer below). When you are done, click on <bf>OK</bf> to close the dialog. Now start the <bf>Add Printer</bf> "Wizard". Make the choices: <itemize> <item> install a <bf>local printer</bf> <item> select a PostScript printer from the list of printers; (e.g., one of the <bf>Apple LaserWriter</bf> models: the Laserwriter II NT is known to work; <bf>Digital PrintServer</bf> models such as the turboPrintServer 20/Net have also been recommended). This will provide a suitable postscript driver. <item> From the list of Available Ports, choose "<bf>FILE: Creates a file on disk</bf>" (you will change this after the printer is installed) <item> set as default printer?: <bf>NO</bf> <item> Print test page?: <bf>NO</bf> </itemize> <sect1>Redirecting the output to the PPA printer. <p> After the printer has been installed, right-click on its icon, and rename it to something like, e.g., "Ghostscript+HP722C". Then right click again and open its <bf>Properties</bf> dialog. On the <bf>General</bf> tab screen, enter something informative in the <bf>Comment</bf> box, such as " Emulated Postscript printer; output redirected to a HP722C DeskJet printer" (optional). Next select the <bf>Details</bf> tab. The box "<bf>Print using the following driver:</bf>" should show the Postscript driver you selected (e.g., Apple LaserWriter II NT). <itemize> <item> Click on <bf>Add Port</bf>. Select <bf>other</bf>, then <bf> Redirected Port</bf>, which should be available if <tt>RedMon</tt> was correctly installed, and click on <bf>OK</bf> to accept these settings and close the Add Port dialog. On the <bf>Details</bf> tab screen, The box "<bf>Print to the following port:</bf>" should now show a redirected port such as "<tt>RPT1 [Redirected Port]</tt>". <item> Click on <bf>Port Settings</bf>. <itemize> <item>In the box "<bf>Redirect port to the program:</bf>", enter the path to the <tt>gsprint</tt> program. (If you accepted the defaults when installing it, this may be <tt>C:\Ghostgum\gsview\gsprint.exe</tt>; you may search for it by clicking on <bf>Browse</bf>). <item>In the box "<bf>arguments for this program are:</bf>" enter the arguments to be passed to the <tt>gsprint</tt> program (there is a document <tt>gsprint.htm</tt> with more details of these in the folder containing <tt>gsprint.exe</tt>). Suggested arguments are: <tscreen><verb> -printer "HP DeskJet 720C Series" -color - </verb></tscreen> Replace "HP DeskJet 720C Series" by the (quoted) <bf>exact name</bf> of the HP PPA DeskJet printer that you made a note of earlier. <bf>(If you do not copy this name exactly, including any capitalization or spaces, things may not work!)</bf> The <tt>-color</tt> argument is needed to enable color printing; (Whether you actually get color printing will depend on the local settings of the "HP DeskJet 720C Series" printer that really prints the document.) The final "<tt> - </tt>" is <bf>required</bf>: without it, the output of <tt>gsprint</tt> will not get redirected to the printer. <item>The box "<bf>Output</bf>" should show "<bf>Program handles output</bf>". <item>In the box "<bf>Run</bf>", select "<bf>hidden</bf>". <item>The box "<bf>Shutdown delay</bf>" will say "300 seconds". Print jobs for which processing by <tt>gsprint</tt> takes longer than this will be terminated, to avoid blocking the printer spool queue. Increase this limit if necessary. </itemize> Now click on <bf>OK</bf> to close the Port Settings dialog. <item> Click on <bf>Spool Settings</bf>, and select "<bf>Disable bi-directional support for this printer</bf>", and click <bf>OK</bf>. </itemize> Finally, again select the <bf>General</bf> tab, and test the installation by clicking on "<bf>Print a test page</bf>". If it works, you are finished setting up Postscript emulation. Click <bf>OK</bf> to exit the Printer Properties dialog. (If you have problems, first check that you made the correct entries in the Printer Properties dialogs, <bf>especially check that you did not make any typing errors in the exact name for the PPA DeskJet printer in the</bf> <tt>gsprint</tt><bf> arguments box</bf>, which must correspond exactly to the "Printer name" given to the HP PPA printer). If the problems persist, you might get guidance from the gsprint and RedMon documentation; look in the folders where these were installed.) You now have a working emulated "Postscript printer" that can now be shared over a network. (The "sharing" options will now be available if you right-click on the emulated printer's icon.) <sect1> Limitations. <p> This emulated postscript printer is most useful for providing printing services to non-Windows Clients on a <tt>samba</tt> network, but can be also be used by Windows Clients with the following limitations: <itemize> <item>Windows Clients will be able to select Print Settings only for the visible ("front end") "Postscript printer", but not for the hidden ("back end") HP PPA DeskJet printer that actually does the printing. <item>Changes in the local Print Settings of the PPA driver for the DeskJet printer on the Host system (but not on Client systems, if it too is shared) will affect network printing by the "Postscript printer". <item>Since the visible "Postscript printer" falsely advertises its identity, some of its Print Settings options seen by users on the Clients may not be valid. <item>The extra processing on the printer Host may make printing rather slow compared to native Windows printing. </itemize> </article> �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������pnm2ppa-1.13/docs/en/CALIBRATION.html���������������������������������������������������������������0000644�0000764�0000764�00000022027�07176674550�013737� �����������������������������������������������������������������������������������������������������������������������������������������������������������������������������0000000�0000000������������������������������������������������������������������������������������������������������������������������������������������������������������������������<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <HTML> <HEAD> <META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.9"> <TITLE>PPA Printer calibration for pnm2ppa Next Previous Contents

PPA Printer calibration for pnm2ppa

The pnm2ppa project team ppa-rpms@users.sourceforge.net

v0.4, October 28, 2000


Information and instructions for printer calibration using pnm2ppa. http://sourceforge.net/projects/pnm2ppa (Updated for pnm2ppa-1.02 and later.)

Overview of Printer Calibration.

There are three main tasks you may need to carry out to fine-tune your PPA printer:

These instructions assume that you are already able to print postscript files with your PPA printer. If your print filters are properly configured, something like "lpr test.ps" will successfully invoke ghostscript and pnm2ppa to print the postscript file test.ps. Alternatively, you may be using shell scripts like "lprbw", "lprcolor" and "lpreco" supplied with the pnm2ppa source code, and modified by you for your defaults; you may also have defined special printing devices in /etc/printcap, e.g. a "coloreco" device so you print with lpr -P coloreco test.ps. These details vary with the operating system and distribution you use.

(1) Centering the printed page on the paper.

This is done by adjusting the x-offset and y-offset parameters xoffset and yoffset in the pnm2ppa configuration file (usually /etc/pnm2ppa.conf). The parameters are given in units of 1/600 inch; increasing xoffset moves the image to the right, and increasing yoffset moves it downwards. These offsets now have default values defined for each printer model, and you will probably not need to adjust them. Uncomment and make small adjustments to the default values for these in the configuration file, until the printout is satisfactory. (You can also use the '-x' and '-y' command-line parameters.)

There are two ways to check the offsets.

The "calibrate_ppa" program is a stand-alone program distributed with pnm2ppa which creates various test patterns in the raw pixmap format accepted by pnm2ppa. (The three paper sizes, US Letter, US Legal, and A4, are supported). If your paper size is A4, and your printer filter accepts the "-l" (direct output) option to lpr, the command to run is:

 calibrate_ppa -s a4  --center  | pnm2ppa --bw  -i -  -o - | lpr -l
(Substitute "letter" or "legal" for "a4" to change the papersize; if no paper size is specified, it is assumed to be letter.)

If "lpr -l" is not valid, you need to know which port your printer is attached to. Assuming it is /dev/lp0, the above command becomes calibrate_ppa -s a4 --center | pnm2ppa --bw -i - -o /dev/lp0.

The pattern shows distances from the edge of the printed page in units of 50 dots (1/12 inch), and diagonal lines that should point to the corners. Change xoffset and yoffset in the configuration file (usually /etc/pnm2ppa.conf to center the pattern. The configuration file is supplied with commented-out entries like #xoffset 160 showing the default value. Remove the "#" to activate the entry.

In Red Hat or Mandrake Linux distributions, a suitable test page is /usr/lib/rhs/rhs-printfilters/testpage.ps (US Letter paper) or /usr/lib/rhs/rhs-printfilters/testpage-a4.ps (A4 paper). (If these are not available, similar test pages are supplied in the pnm2ppa source distribution.) These pages have margins drawn at standard distances from the edges of the paper, and can also be used to check the centering, but are not as accurate

(2) Calibrating the X and Y Color Head Offsets.

The color ink offsets now have to be calibrated with respect to the black ink. Because the relative position of the two ink cartridges can move slightly, this must be done whenever an ink cartridge is removed and replaced.

To print an alignment calibration pattern on a4 paper, run

calibrate_ppa -s a4  --align | pnm2ppa --fd  -i - -o - | lpr -l

On the printed page, there are four alignment patterns, corresponding to configuration file parameters ColOffsX, ColOffsY, colorshear and blackshear. The central alignment patterns, labelled "0" should be perfectly aligned. If they are not, first correct the shearing patterns, (see below). Then identify the best-aligned ColOffsX and ColOffsY patterns, and add or subtract the positive or negative number below the pattern from the value in the configuration file.

Check the result by printing the alignment test pattern:

calibrate_ppa  --test | pnm2ppa -fd  -i - -o - | lpr -l
The lines in the cross and square should be perfectly straight now.

The calibration can also be done by printing the test page test.ps (found in the tarball pnm2ppa-1.0.tar.gz; or installed with the pnm2ppa documentation. (This is often in /usr/doc/pnm2ppa*/.)

On the printout you see several images:

If these items do NOT line up, you should take the following steps:

Now you can print test.ps again to see whether this procedure worked.

Shearing adjustments

If bidirectional printing causes "shearing" of vertical lines (horizontal offsets of those parts of the line printed by left-to-right print-head sweeps relative to those printed on right-to-left sweeps) you can make small adjustments (in 1/600 inch) units using the blackshear and colorshear parameters in the configuration file. You can also suppress bidirectional printing with a unimode 1 configuration file entry.

The third and fourth lines on the color head offset calibration page (see above) correspond to color and black print head shearing corrections. If the central alignment patterns (labeled "0") are not aligned, add or subtract the positive or negative number below the best-aligned pattern from the colorshear and blackshear values in the configuration file.

Cleaning the Print Heads

You can use calibrate_ppa to clean the print heads by printing patterns that exercise all the ink nozzles:

calibrate_ppa  --clean | pnm2ppa -p   -i - -o - | lpr -l
calibrate_ppa  --clean | pnm2ppa --bw  -i - -o - | lpr -l
The first of these commands prints a cleaning pattern with colored ink, the second uses black ink.

Other adjustments

The parameter blackness adjusts the number of black ink drops printed per pixel. It takes values 1, 2, 3, or 4 (2 is the default). Other values, like 0, suppress black ink.

Inks can also be suppressed by configuration file entries black_ink 0, color_ink 0, cyan_ink 0, magenta_ink 0, or yellow_ink 0. These are mainly useful for debugging the printer driver.


Next Previous Contents pnm2ppa-1.13/docs/en/CALIBRATION.txt0000644000076400007640000001750007505260041013570 00000000000000 PPA Printer calibration for pnm2ppa The pnm2ppa project team ppa-rpms@users.sourceforge.net v0.4, October 28, 2000 Information and instructions for printer calibration using pnm2ppa. http://sourceforge.net/projects/pnm2ppa (Updated for pnm2ppa-1.02 and later.) Overview of Printer Calibration. There are three main tasks you may need to carry out to fine-tune your PPA printer: o Adjust the x-offset and y-offset to correctly center the printed page on the paper o Adjust the relative offsets between black and colored ink printing - this should be done each time you replace an ink cartridge. o Match the colors of printed images to some other output device - this is color correction and is described in COLOR.html (or COLOR.txt). These instructions assume that you are already able to print postscript files with your PPA printer. If your print filters are properly configured, something like "lpr test.ps" will successfully invoke ghostscript and pnm2ppa to print the postscript file test.ps. Alternatively, you may be using shell scripts like "lprbw", "lprcolor" and "lpreco" supplied with the pnm2ppa source code, and modified by you for your defaults; you may also have defined special printing devices in /etc/printcap, e.g. a "coloreco" device so you print with lpr -P coloreco test.ps. These details vary with the operating system and distribution you use. (1) Centering the printed page on the paper. This is done by adjusting the x-offset and y-offset parameters xoffset and yoffset in the pnm2ppa configuration file (usually /etc/pnm2ppa.conf). The parameters are given in units of 1/600 inch; increasing xoffset moves the image to the right, and increasing yoffset moves it downwards. These offsets now have default values defined for each printer model, and you will probably not need to adjust them. Uncomment and make small adjustments to the default values for these in the configuration file, until the printout is satisfactory. (You can also use the '-x' and '-y' command-line parameters.) There are two ways to check the offsets. o either using the "calibrate_ppa" program. o or printing a suitable test page. The "calibrate_ppa" program is a stand-alone program distributed with pnm2ppa which creates various test patterns in the raw pixmap format accepted by pnm2ppa. (The three paper sizes, US Letter, US Legal, and A4, are supported). If your paper size is A4, and your printer filter accepts the "-l" (direct output) option to lpr, the command to run is: calibrate_ppa -s a4 --center | pnm2ppa --bw -i - -o - | lpr -l (Substitute "letter" or "legal" for "a4" to change the papersize; if no paper size is specified, it is assumed to be letter.) If "lpr -l" is not valid, you need to know which port your printer is attached to. Assuming it is /dev/lp0, the above command becomes calibrate_ppa -s a4 --center | pnm2ppa --bw -i - -o /dev/lp0. The pattern shows distances from the edge of the printed page in units of 50 dots (1/12 inch), and diagonal lines that should point to the corners. Change xoffset and yoffset in the configuration file (usually /etc/pnm2ppa.conf to center the pattern. The configuration file is supplied with commented-out entries like #xoffset 160 showing the default value. Remove the "#" to activate the entry. In Red Hat or Mandrake Linux distributions, a suitable test page is /usr/lib/rhs/rhs-printfilters/testpage.ps (US Letter paper) or /usr/lib/rhs/rhs-printfilters/testpage-a4.ps (A4 paper). (If these are not available, similar test pages are supplied in the pnm2ppa source distribution.) These pages have margins drawn at standard distances from the edges of the paper, and can also be used to check the centering, but are not as accurate (2) Calibrating the X and Y Color Head Offsets. The color ink offsets now have to be calibrated with respect to the black ink. Because the relative position of the two ink cartridges can move slightly, this must be done whenever an ink cartridge is removed and replaced. To print an alignment calibration pattern on a4 paper, run calibrate_ppa -s a4 --align | pnm2ppa --fd -i - -o - | lpr -l On the printed page, there are four alignment patterns, corresponding to configuration file parameters ColOffsX, ColOffsY, colorshear and blackshear. The central alignment patterns, labelled "0" should be perfectly aligned. If they are not, first correct the shearing patterns, (see below). Then identify the best-aligned ColOffsX and ColOffsY patterns, and add or subtract the positive or negative number below the pattern from the value in the configuration file. Check the result by printing the alignment test pattern: calibrate_ppa --test | pnm2ppa -fd -i - -o - | lpr -l The lines in the cross and square should be perfectly straight now. The calibration can also be done by printing the test page test.ps (found in the tarball pnm2ppa-1.0.tar.gz; or installed with the pnm2ppa documentation. (This is often in /usr/doc/pnm2ppa*/.) On the printout you see several images: o top left, you see a square with both black and colored items. These should align correctly, or you have to change your settings. o You see a large vertical bar, and also a horizontal bar. On the sides of the vertical bar there are a blue and a green line. These should align with the 0 mark. o You also see a small vertical, and horizontal, bar, with a red bar on its side. If these items do NOT line up, you should take the following steps: o (1) take for the large bar the number of the tickmark just smaller than the place where the green and blue lines point to. The minor tick marks are 25 points. o (2) To this number, add the number of the tick mark at which a red tick mark exactly lines up. This might not work if the offsets are way off; in that case, apply the correction of step 1, and print again. o (3) Add the horizontal offset to the value of ColOffsX, and the vertical offset to the value of ColOffsY in the configuration file. Now you can print test.ps again to see whether this procedure worked. Shearing adjustments If bidirectional printing causes "shearing" of vertical lines (horizontal offsets of those parts of the line printed by left-to- right print-head sweeps relative to those printed on right-to-left sweeps) you can make small adjustments (in 1/600 inch) units using the blackshear and colorshear parameters in the configuration file. You can also suppress bidirectional printing with a unimode 1 configuration file entry. The third and fourth lines on the color head offset calibration page (see above) correspond to color and black print head shearing corrections. If the central alignment patterns (labeled "0") are not aligned, add or subtract the positive or negative number below the best-aligned pattern from the colorshear and blackshear values in the configuration file. Cleaning the Print Heads You can use calibrate_ppa to clean the print heads by printing patterns that exercise all the ink nozzles: calibrate_ppa --clean | pnm2ppa -p -i - -o - | lpr -l calibrate_ppa --clean | pnm2ppa --bw -i - -o - | lpr -l The first of these commands prints a cleaning pattern with colored ink, the second uses black ink. Other adjustments The parameter blackness adjusts the number of black ink drops printed per pixel. It takes values 1, 2, 3, or 4 (2 is the default). Other values, like 0, suppress black ink. Inks can also be suppressed by configuration file entries black_ink 0, color_ink 0, cyan_ink 0, magenta_ink 0, or yellow_ink 0. These are mainly useful for debugging the printer driver. pnm2ppa-1.13/docs/en/COLOR.html0000644000076400007640000001735307176621443013065 00000000000000 Color correction for pnm2ppa Next Previous Contents

Color correction for pnm2ppa

The pnm2ppa project team ppa-rpms@users.sourceforge.net

v0.6, October 28, 2000


Information and instructions for color correction of pnm2ppa color printing. http://sourceforge.net/projects/pnm2ppa (Updated for pnm2ppa-1.0 and later.)

Overview of Color correction.

Color Pixmap input to pnm2ppa (ppm format, produced by the ghostscript output devices ppmraw or ppm) specifies the color of a pixel as three coordinates (Red, Green, Blue) in the range 0-255. The program pnm2ppa converts these to relative amounts of Cyan, Magenta and Yellow ink drops printed on the page.

Color correction allows the user to attempt to match the printed colors to some reference colors, such as those displayed on the terminal, or those printed on a different printer, or those printed on the same printer with a different driver (such as the Win9x drivers supplied by HP with their PPA printers).

The color output from pnm2ppa can be controlled in two ways:

pnm2ppa will carry out "color correction", unless it is called with the --noGamma command line option. However, unless you set up a color correction scheme, the default color correction does not change any colors.

Color correction is specified by three color intensity functions (curves), one for each of Red, Green, and Blue. In their simplest form, these curves have a standard form controlled by a single "gamma" parameter such as GammaR. The more sophisticated correction, in the file pnm2ppa.gamma, specifies these curves more generally as a table of numbers that translate each possible color intensity value to a new value.

Note that, in principle, different color corrections are needed for different print quality settings, and for different brands and qualities of paper!

At present the methods for constructing a color correction for pnm2ppa are not very user-friendly. If you can improve them, please help!.

Color correction with "gamma" values in the configuration file.

The PixMap (ppa) format specifies colors by an intensity for each primary color, Red, Green and Blue, in the range 0-255, so (0,0,0) is black, and (255,255,255) is white. The standard color intensity enhancement function replaces the ppm intensity i of each primary color by Enh(i) which is the closest integer to ( i / 256) raised to the power Gamma, times 256.

You can specify the Gamma values in the configuration file as decimal numbers GammaR, GammaG, GammaB, but how do you find out what values to choose?. Perhaps by experimenting with changing the Gamma values.

A source of information on Gamma color correction is www.cgsd.com/papers/gamma.html

One method for constructing a Gamma correction has been built into pnm2ppa, but it wastes quite a lot of ink, and many users find it less effective than producing a customized color correction curve as described in the next section.

You must first use pnm2ppa to print a color test page, and then generate a file gamma.ppm to compare to it. To do this, type

pnm2ppa -g -i - -o /dev/lp0
(replace /dev/lp0 by whatever printer device your PPA printer uses, or use ... -o - | lpr -l , etc.). Note also that as pnm2ppa is not receiving any ghostscript input to tell it the paper size, this must be correctly specified by a configuration file entry or, e.g., a -s a4 option, if the default US Letter paper is not being used. This procedure will print a color calibration page.

The printed output is an array of sets of three colored bands, red, blue and green, each of which increases in brightness from left to right. The topmost set of bands should be referrred to as bands "0", the next ones as "1", etc.

Next, run the extra program calibrate_ppa which will produce a (large, 10MB) PixMap (ppm) file:

calibrate_ppa -g -o gamma.ppm
This will produce the PixMap file as gamma.ppm in the current directory.

To color-correct the printer so that its colors match those on the terminal screen, you should now attempt to view the file gamma.ppm using some application (such as the GNU image manipulation program gimp, or xv) that can view .ppm files. For each color, identify the printed band (0, 1, 2, ... etc) that most closely corresponds to the brightness profile shown on the screen. The default values are now:

RedGammaIdx 0
GreenGammaIdx 0
BlueGammaIdx 0
(i.e., no color correction). Enter your modified values for these in the pnm2ppa configuration file (usually /etc/pnm2ppa.conf).

The actual Gamma value is then 1.0 - 0.033*(Color)GammaIdx ;

To color-correct with respect to another printer (or the Win9x drivers), you must manage to print gamma.ppm on that other device, then make the comparison. (Or print the output of pnm2ppa -g on that device; the top line is the same uncorrected color data as gamma.ppm.)

Color correction using a "gamma file".

A "gamma correction file" is a binary file containing 3 x 256 numbers, which are lookup tables of corrected red green and blue color intensities.

The program pnm2ppa will use a default correction file /etc/pnm2ppa.gamma if it exists, unless the --noGamma option is used. The default correction file location can be changed by using the pnm2ppa option -F gammafile , where "gammafile" is the name (including the full path) of the gamma correction file to be used.

Currently, there are two available tools for constructing a gamma correction file:


Next Previous Contents pnm2ppa-1.13/docs/en/COLOR.txt0000644000076400007640000001465507505260041012727 00000000000000 Color correction for pnm2ppa The pnm2ppa project team ppa-rpms@users.sourceforge.net v0.6, October 28, 2000 Information and instructions for color correction of pnm2ppa color printing. http://sourceforge.net/projects/pnm2ppa (Updated for pnm2ppa-1.0 and later.) Overview of Color correction. Color Pixmap input to pnm2ppa (ppm format, produced by the ghostscript output devices ppmraw or ppm) specifies the color of a pixel as three coordinates (Red, Green, Blue) in the range 0-255. The program pnm2ppa converts these to relative amounts of Cyan, Magenta and Yellow ink drops printed on the page. Color correction allows the user to attempt to match the printed colors to some reference colors, such as those displayed on the terminal, or those printed on a different printer, or those printed on the same printer with a different driver (such as the Win9x drivers supplied by HP with their PPA printers). The color output from pnm2ppa can be controlled in two ways: o by a color correction "gamma" file, if it is installed. By default this file is /etc/pnm2ppa.gamma, but it may also be specified with the pnm2ppa option pnm2ppa ... -F gammafile ... . o if there is no gamma file, by three values specified by keywords ( either GammaR, GammaG, GammaB or RedGammaIdx, BlueGammaIdx, GreenGammaIdx) in the pnm2ppa configuration file. pnm2ppa will carry out "color correction", unless it is called with the --noGamma command line option. However, unless you set up a color correction scheme, the default color correction does not change any colors. Color correction is specified by three color intensity functions (curves), one for each of Red, Green, and Blue. In their simplest form, these curves have a standard form controlled by a single "gamma" parameter such as GammaR. The more sophisticated correction, in the file pnm2ppa.gamma, specifies these curves more generally as a table of numbers that translate each possible color intensity value to a new value. Note that, in principle, different color corrections are needed for different print quality settings, and for different brands and qualities of paper! At present the methods for constructing a color correction for pnm2ppa are not very user-friendly. If you can improve them, please help!. Color correction with "gamma" values in the configuration file. The PixMap (ppa) format specifies colors by an intensity for each primary color, Red, Green and Blue, in the range 0-255, so (0,0,0) is black, and (255,255,255) is white. The standard color intensity enhancement function replaces the ppm intensity i of each primary color by Enh(i) which is the closest integer to ( i / 256) raised to the power Gamma, times 256. You can specify the Gamma values in the configuration file as decimal numbers GammaR, GammaG, GammaB, but how do you find out what values to choose?. Perhaps by experimenting with changing the Gamma values. A source of information on Gamma color correction is www.cgsd.com/papers/gamma.html One method for constructing a Gamma correction has been built into pnm2ppa, but it wastes quite a lot of ink, and many users find it less effective than producing a customized color correction curve as described in the next section. You must first use pnm2ppa to print a color test page, and then generate a file gamma.ppm to compare to it. To do this, type pnm2ppa -g -i - -o /dev/lp0 (replace /dev/lp0 by whatever printer device your PPA printer uses, or use ... -o - | lpr -l , etc.). Note also that as pnm2ppa is not receiving any ghostscript input to tell it the paper size, this must be correctly specified by a configuration file entry or, e.g., a -s a4 option, if the default US Letter paper is not being used. This procedure will print a color calibration page. The printed output is an array of sets of three colored bands, red, blue and green, each of which increases in brightness from left to right. The topmost set of bands should be referrred to as bands "0", the next ones as "1", etc. Next, run the extra program calibrate_ppa which will produce a (large, 10MB) PixMap (ppm) file: calibrate_ppa -g -o gamma.ppm This will produce the PixMap file as gamma.ppm in the current direc- tory. To color-correct the printer so that its colors match those on the terminal screen, you should now attempt to view the file gamma.ppm using some application (such as the GNU image manipulation program gimp, or xv) that can view .ppm files. For each color, identify the printed band (0, 1, 2, ... etc) that most closely corresponds to the brightness profile shown on the screen. The default values are now: RedGammaIdx 0 GreenGammaIdx 0 BlueGammaIdx 0 (i.e., no color correction). Enter your modified values for these in the pnm2ppa configuration file (usually /etc/pnm2ppa.conf). The actual Gamma value is then 1.0 - 0.033*(Color)GammaIdx ; To color-correct with respect to another printer (or the Win9x drivers), you must manage to print gamma.ppm on that other device, then make the comparison. (Or print the output of pnm2ppa -g on that device; the top line is the same uncorrected color data as gamma.ppm.) Color correction using a "gamma file". A "gamma correction file" is a binary file containing 3 x 256 numbers, which are lookup tables of corrected red green and blue color intensities. The program pnm2ppa will use a default correction file /etc/pnm2ppa.gamma if it exists, unless the --noGamma option is used. The default correction file location can be changed by using the pnm2ppa option -F gammafile , where "gammafile" is the name (including the full path) of the gamma correction file to be used. Currently, there are two available tools for constructing a gamma correction file: o A graphical utility ppagammacorrect is available in the PPA Color Correction Utilities section of the pnm2ppa web page http://sourceforge.net/projects/pnm2ppa, (but at the time of writing, this appears to be frozen in early stages of development, with little documentation, and may not be fully functional). o A working procedure is given in http://download.sourceforge.net/pnm2ppa/color-calibrate-1.0.tar.gz, which is made available by Klamer Schutte. This is the method recommended by many users. pnm2ppa-1.13/docs/en/CREDITS0000644000076400007640000000173707072327606012337 00000000000000CREDITS ------- This project would not be where it is without the help of the following people (in firstname alphabetical order): Andrew van der Stock - rampant featuritis and general code enhancer since Sept 1999 Ben Boule - first contacted me about the 720 series and helped with testing Duncan Haldane - Redhat doco, fixes, RH print filter, RPM maintainer; extensive debugging of code, Jan-April 2000, Giorgio Marzano - heaps of quality bug fixes and features since May 1999 Javier Sandano - hp-ppa-printing-howto Jim Peterson - spent hours modifying the code for the 720 and adding lots of features, including all the configurability options. Kirk Reiten - helped with testing the 1000 series code Klamer Schutte - Fixed calibrate.c to work with pnm2ppa Michael Mancini - additonal BeOS support Panayotis Vryonis - author of the first version of the README.REDHAT file. Tim Norman - original author, web site maintainer Tomasz Patora - Polish translation of documentation pnm2ppa-1.13/docs/en/INSTALL0000644000076400007640000001502511313234742012332 00000000000000pnp2ppa-1.13, December 2009. Overview -------- This file contains some quick notes on installation in general. For more information on pnm2ppa, see INSTALL.REDHAT.txt or INSTALL.REDHAT.html, which (despite its name) has a lot of non-RedHat-specific information. Configuration ------------- Run 'configure' to setup the package. Run it with the following switches to get the same result as in the previous releases: ./configure --sysconfdir=/etc add: '--enable-debug' to get a more verbose program (default is no). This switch is intended for developers. '--disable-syslog' to disable the syslog feature. Its checked by default, if the system supports a syslog feature. This optione replaces the previous Makefile -D__NO_SYSLOG__ modification '--with-language=[EN | CZ | ES | FR | IT | NL]' to select one of the compiled in languages. 'EN' is the default. '--enable-vlink' to also build the 'parse_vlink' tool Compilation ----------- To build pnm2ppa, simply cd to the source directory, and type: make If you wish to do any further development of pnm2ppa, or study how it works so you can write a PPA backend to some other print system such as gimp-print, there is a useful tool called parse_vlink (and some documentation) that can be built in the ppa_protocol subdirectory. Installation ------------ Two binaries are created: calibrate_ppa and pnm2ppa (and on demand parse_vlink). calibrate_ppa is used to calibrate your printer (center the printed page, adjust the offset between black and color ink cartridges after changing them, etc.) See the CALIBRATION.* file for details. The other binary created, pnm2ppa, is a converter from a PNM image to a stream of PPA data that can be sent directly to the printer. The PNM image will be aasumed to have a resolution of 600 dpi (or 300dpi if the --dpi300 command line option is used). (Input at higher/lower resolutions will print with an incorrect larger/smaller size, if it is within the allowed page size limits.) These files can be generated with ghostscript. The binary-output pbmraw, pgmraw, ppmraw devices are supported (the text-output pbm, pgm, ppm devices are also supported, but the raw devices are MUCH faster!). The pnmraw and pgnmraw devices are switches that will try to select among the raw formats, as appropriate for the document, but do not always make the correct choice. You should now type make install to install the binaries (by default, in /usr/local/bin/) , the manpage (in /usr/local/man/man1), and the sample configuration file (/usr/local/etc/pnm2ppa.conf). You may change these locations by using the --sysconfdir/--prefix parameter when running the 'configure' step. *** IMPORTANT *** The default configuration file /usr/local/etc/pnm2ppa.conf sets the printer model to "version 0" (NULL printer). Unless you use the -v command line option to set the printer model (as is usually done by CUPS, lprNG, etc. scripts that call pnm2ppa), you must edit the configuration file to change this line and choose the correct printer version (720, 820, 1000, etc). If the printer version is unspecified, it defaults to "720" (valid for HP710C/712C/720C/722C). Other things you can do are documented in the sample configuration file /usr/local/etc/pnm2ppa.conf Usage ----- To print a postscript file with this program, You may use a simple shell script: #!/bin/sh cat $1 | \ gs -sDEVICE=ppmraw -sPAPERSIZE=letter -q -dNOPAUSE -r600 -sOutputFile=- - | \ pnm2ppa $2 $3 $4 $5 $6 $7 -i - -o - | lpr -l Any valid ghostscript papersize like "legal", "a4", etc. can be substituted for "letter" (in fact, "letter" is the default, so the "-sPAPERSIZE=letter" is not really needed.) If this script is placed in /usr/local/bin/ppaprint , ppaprint file.ps will print the postscript file file.ps in high quality color. Other options are: ppapprint file.ps --eco // economy color ink mode ppaprint file.ps --bw // black and white ppaprint file.ps --bw --eco // black and white economy mode etc. In the example, up to six pnm2ppa options can be added (see "man pnm2ppa" to list options, or "pnm2ppa --h" ). You may wish to replace the ghostscript output device "ppmraw" with "pbmraw" for only black and white printing - it is somewhat faster - or "pgmraw" for greyscale images. an ascii file could be printed in black and white with the script #!/bin/sh enscript -2rj $1 | \ gs -sDEVICE=pbmraw -sPAPERSIZE=letter -q -dNOPAUSE -r600 -sOutputFile=- - | \ pnm2ppa --bw $2 $3 $4 $5 $6 $7 -i - -o - | lpr -l Integration into Printing Systems ----------------------------------- (A) lpr, LPRng systems You can set up printer filters. See the documentation for your print spooler for information on how to do that. The subdirectory lpd of the pnm2ppa distribution contains a printer description file "printcap" and so filters to go with it. See the README.lpd file there. The subdirectory ppaSet of the pnm2ppa distribution contains a software to help configuring the printer (and better, for each user in the system), for both GTK and ncurses. Just see README file there. This software is fully compatible with the previous one, not a replacement. On some Linux distributions, (RedHat, Mandrake, ... etc.), packages that install pnm2ppa and appropriate printer filters will be available to do all this for you. On others, you must do this manually, for example using the files in our lpd subdirectory. See lpd/README.lpd in the pnm2ppa source distribution. Note: the "foomatic" data base at http://www.linuxprint.org now supports pnm2ppa, and produces scripts for configuring lpd-based systems. RedHat use this system since RedHat 7.2 An older printfilter system for lpd systems that also supports pnm2ppa is apsfilter (http://www.apsfilter.org). --------------- (B) PDQ ("Print, Don't Queue") PDQ is an alternative, spooler-free printing system available from http://pdq.sourceforge.net The pdq subdirectory of the pnm2ppa source provides a pdq driver, gs-pnm2ppa ---------------- (C) CUPS ("Common Unix Printing System") pnm2ppa is now integrated into the CUPS printing system: see http://www.cups.org. The "cupsomatic" scripts from the http://www.linuxprinting.org site support pnm2ppa on CUPS. "ppaSet": a Graphical User Interface for configuring pnm2ppa: ------------------------------- There is also a new graphical (gtk-based) utility for creating a pnm2ppa.conf configuration file and also can act as a front end to the calibration utility calibrate_ppa. It is written by Javier Sedano, and called ppaSet. Find it at http://sourceforge.net/projects/pnm2ppa. pnm2ppa-1.13/docs/en/INSTALL.BEOS0000644000076400007640000000307407201342011013050 00000000000000Note on installation on BeOS. (1) You should edit the Makefile to adjust it for BeOS. -- The locations of the binaries pnm2ppa and calibrate_ppa may need to be changed. (One succesful BeOS user put them in /boot/home/config/bin ) -- The location of the manpage pnm2ppa.1 may need to be changed. (2) scripts used for printing may need to be changed. Here is what one happy BeOS user reported on the ppa.users@listbot.com list: (available in the mailing lists section of http://pnm2ppa.sourceforge.net see message #598, "No more BeOS woes", July 21, 2000) ---------------------------------------------------------------- "Yeah, baby! :) That mother prints! Here's what I did: made a script called pnm #!/bin/sh pnm2ppa -i - -o /dev/parallel/parallel1 and then I made my printps script as follows #!/bin/sh cat $1 | gs -sDEVICE=ppmraw -q -dNOPAUSE -r600 -sOutputFile=\|pnm - The neatto trick here is the -sOutputFile=\|pnm voodoo. For whatever reason, it likes that mo better. Thanks for everyone's help." ----------------------------------------------------------------- This BeOS user apparently had difficulties with scripts using the standard pipe syntax for sending ghostscript output to pnm2ppa: cat $1 | gs -sDEVICE=ppmraw -q -dNOPAUSE -r600 -sOutputFile=- - | pnm (3) On BeOS, pnm2ppa does not send messages to the system log. They go to the standard error stream unless "silent 1" is specified in /etc/pnm2ppa.conf. ----------------------- If you can provide us with an improved INSTALL.BEOS and Makefile, please contact the pnm2ppa project. pnm2ppa-1.13/docs/en/INSTALL.CALDERA0000644000076400007640000000001607036515603013363 00000000000000To be written pnm2ppa-1.13/docs/en/INSTALL.MANDRAKE.html0000644000076400007640000000633507501053374014466 00000000000000 PPA Printer-Support RPM Packages for MANDRAKE Linux distributions. Next Previous Contents

PPA Printer-Support RPM Packages for MANDRAKE Linux distributions.

The pnm2ppa project team ppa-rpms@users.sourceforge.net

v0.2 June 11, 2002
Information about using pnm2ppa with Mandrake. (Updated for pnm2ppa-1.04 and later.)

Mandrake-specific issues.

See the document INSTALL.REDHAT.html for installation and setup. That document is written for Red Hat; note the Mandrake-specific differences listed below,

To update pnm2ppa in any recent Mandrake release (7.2 or later) from v1.04 to v1.10, the simplest procedure may be just to compile pnm2ppa from tarball source and replace the Mandake binaries /usr/bin/pnm2ppa and /usr/bin/calibrate_ppa with the new versions. They should function as drop-in replacements, with the same user interface, but improved image quality. (You may also wish to use the newer pnm2ppa.conf configuration file template).


Next Previous Contents pnm2ppa-1.13/docs/en/INSTALL.MANDRAKE.txt0000644000076400007640000000470307505260041014331 00000000000000 PPA Printer-Support RPM Packages for MANDRAKE Linux distri- butions. The pnm2ppa project team ppa-rpms@users.sourceforge.net v0.2 June 11, 2002 Information about using pnm2ppa with Mandrake. (Updated for pnm2ppa-1.04 and later.) Mandrake-specific issues. See the document INSTALL.REDHAT.html for installation and setup. That document is written for Red Hat; note the Mandrake-specific differences listed below, To update pnm2ppa in any recent Mandrake release (7.2 or later) from v1.04 to v1.10, the simplest procedure may be just to compile pnm2ppa from tarball source and replace the Mandake binaries /usr/bin/pnm2ppa and /usr/bin/calibrate_ppa with the new versions. They should function as drop-in replacements, with the same user interface, but improved image quality. (You may also wish to use the newer pnm2ppa.conf configuration file template). o Mandrake 7.0 and earlier has incompatible and non-functional pnm2ppa support which must be replaced. Please use printtool to delete any installed PPA printers BEFORE upgrading rhs- printfilters. (If you forget to do this, and printtool will not start after the update, delete or move your /etc/printcap file.) Install the pnm2ppa RPM package. Then update rhs-printfilters with rhs-printfilters-1.58-4ppa5mdk.i386.rpm from http://sourceforge.net/projects/pnm2ppa. (Do NOT use rhs- printfilters-1.57-4ppa4.i386.rpm which is for RedHat systems only.) o Mandrake-7.1 supplies a pnm2ppa RPM and has support for it in rhs- printfilters. Mandrake 7.1 has a configuration tool DrakConf for setting up printers, which may be an interface to printtool. Some users have reported difficulties with this. In that case, just use printtool to configure the printer. o Mandrake-7.2 does not have a separate pnm2ppa RPM package, but has added pnm2ppa to the ghostscript RPM package. This creates difficulties for updating pnm2ppa with the RPM package from http://sourceforge.net/projects/pnm2ppa. You will get reported conflicts with ghostscript if you try to install the pnm2ppa-1.04-1.i386.rpm package, but it seems that you can safely use the rpm option --force to force its installation. Mandrake-7.2 also has moved to using CUPS as its printing system, and appears to now have its own printer configuration tool, but still includes pnm2ppa support in rhs-printfilters. pnm2ppa-1.13/docs/en/INSTALL.REDHAT.html0000644000076400007640000007727507512500653014265 00000000000000 PPA Printer-Support RPM Packages for Red Hat Linux and Compatible Distributions Next Previous Contents

PPA Printer-Support RPM Packages for Red Hat Linux and Compatible Distributions

The pnm2ppa project team ppa-rpms@users.sourceforge.net

v0.30, July 9, 2002
Information and installation instructions to accompany pnm2ppa packages for Red Hat Linux available at http://sourceforge.net/projects/pnm2ppa (Updated for pnm2ppa-1.10 and Red Hat 6.2 or later.) See the "Troubleshooting" section at the end of this document for fixes to some reported problems

Overview of HP's PPA DeskJet Printers.

Most of Hewlett-Packard's DeskJet(tm) printers use the PCL3 command language, and are currently supported by Ghostscript drivers. However, a few legacy models, namely

feature "Host-based" printing, and use HP's proprietary PPA (Printer Performance Architecture) protocol, instead of PCL. The two models in each series are physically identical; they just came with different bundled Windows software. All PPA printers are now discontinued from HP's product lines, but may still be found as second-hand legacy items.

PPA printers rely on software running on the host CPU to carry out the low-level processing of printer output that would be done by hardware in a standard PCL printer. The relation of PPA printers to PCL printers is analogous to the relation between "Winmodems" and true modems. Presumably, the idea at the time was that this would allow cheaper hardware to be used, but the decline in hardware prices probably meant that the savings were not significant, and PPA printing seems to have been abandoned.

Unfortunately, HP only supplied Windows software drivers for PPA printers, and have indicated that it is unlikely that they will ever make the proprietary PPA specs public. This is apparently because of concerns that publication of the specs might reveal crucial details of HP's trade secrets about "color science" to competitors. (A secondary issue is that it is apparently possible to physically damage the printer by sending it bad sequences of PPA commands, which is not the case for PCL commands, and it seems that HP do not wish to take any responsibility for such damage by encouraging unofficial PPA programming.)

In the past, Linux users often inadvertently purchased PPA DeskJet models, mistaking them for PCL3 DeskJets, which have traditionally been well-supported by Linux drivers. Fortunately, a reverse engineering effort, started in 1998 by Tim Norman, and continued by the pnm2ppa project at http://pnm2ppa.sourceforge.net, and http://sourceforge.net/projects/pnm2ppa has managed to produce drivers that provide basic printing functionality for these PPA printers under Linux and other Unices. While HP have recently begun to release their own Linux drivers for PCL3 DeskJets, they have not included drivers for their legacy PPA printers in this effort.

The pnm2ppa driver has been stable since v1.04, released October 2000, with no known reproducible bugs, except that image printing quality was not so good. This version has been distributed with Red Hat, and other Linux distributions. v1.10, released July 2002, contains a lot of changes that improve image quality, in particular by improved bidirectional printing, and always printing black on top of color.

A better improvement would be for someone to make a PPA backend to gimp-print, using pnm2ppa as a guide for how to send data to PPA printers. But, since PPA printers are now "legacy" hardware, and pnm2ppa appears to work fine for most printing tasks, it is unlikely that any new developers will be interested in doing this, and there is currently no further development anticipated. The project is currently in "low-maintenance mode".

The pnm2ppa driver for color printing with PPA printers.

Color printing with PPA printers is supported by the pnm2ppa driver which is the successor to the older black-and-white-only driver pbm2ppa-0.8.6 developed by Tim Norman.

pnm2ppa translates portable anymap (pnm) format images into a stream of PPA instructions which can be sent to the printer. In the driver name, "pnm" stands for the superset of three image formats: ppm (portable "pixmap" format for color images), pgm (portable "greymap" format for greyscale images), and pbm (portable "bitmap" format for black and white images).

Ghostscript has a number of "output devices" that produce pnm format output from postscript or pdf input. These come in plain (text) and raw (binary) variants. While pnm2ppa can now interpret both plain and raw pnm formats, there is no point in using the inefficient plain formats: always use the "raw" output devices, which are:

The last two output devices are switches that try to analyze the image, and select an appropriate format; however, they are not recommended for routine use, as they may inconsistently choose the format. The ghostscript packages supplied with all recent Red Hat distributions provides all these devices. To see the list of available ghostscript output devices, type the command line
gs --help
if the required ppmraw or pbmraw devices are not shown, you will have to upgrade your version of ghostscript.

The data must be streamed directly from ghostscript to pnm2ppa to the (local) printer without being stored in any intermediate file: one ppm-format (color) US Letter size page is represented by 3x5100x6600 Bytes (100MB) in binary format and four times this amount in text format.

An example of a command line for printing a postscript file file.ps using gs (ghostscript) and pnm2ppa is

cat file.ps | gs -q -sDEVICE=ppmraw -r600 -sPAPERSIZE=letter -dNOPAUSE \
 -sOutputFile=- - | pnm2ppa --eco -v 720  -i - -o - | lpr -l  
(all on a single line). In this example the paper size is explicitly given to gs as US Letter (8.5"x11") size (letter); pnm2ppa no longer needs to be told what the paper size is, and will read it from the gs output (and check that it is a permitted size for the printer type). The pnm2ppa option --eco specifies "EconoFast" mode, for a lower quality output which uses less ink, and prints faster, and -v 720 specifies the PPA printer as belonging to the DeskJet 720C series.

Obviously, it would be impractical to type such a command each time one wished to print something, and since RedHat 6.2, printfilter support for pnm2ppa is built into Red Hat's printer configuration scheme, so after configuration, the simple command

lpr file.ps
should successfully print a postscript file. However, in case you wish to check if something is misconfigured in the print filters, you can use a script like the above one to bypass them and check that the printer is working.

Available RPM packages. A RPM package for pnm2ppa is part of the Red Hat Linux distribution starting with Red Hat 6.2. You will also find a RPM package for the latest release of pnm2ppa at http://sourceforge.net/projects/pnm2ppa.

The latest version at the time of writing is pnm2ppa-1.10-1rh7x.i386.rpm, and is built on Red Hat 7.3, or pnm2ppa-1.10-1rh62.i386.rpm, built on Red Hat 6.2. If you are running a different release of Red Hat (or a different Linux distribution) you may need to download and rebuild the source RPM pnm2ppa-1.10-1.src.rpm instead:

rpm --rebuild pnm2ppa-1.10-1.src.rpm
(You must be root to do this, and have the necessary compilers installed; on Red Hat, the rebuilt binary RPM will be created in the directory /usr/src/redhat/RPMS/i386/.)

Red Hat 6.2 and later also includes support for configuring your printer to use pnm2ppa. (Information necessary for configuring pnm2ppa on older Red Hat releases has been removed from this document; for this, see the documentation that came with pnm2ppa-1.04, or update your RedHat distribution.) Note: If you are still using Red Hat 6.2, you may wish to update the print filter support for pnm2ppa that comes with it. The pnm2ppa-1.10-1rh62* RPM package supplies the necessary files that you can use. After installing this RPM, see /usr/lib/rhs/rhs-printfilters/README.ppa for details.

Installing the pnm2ppa RPM package and setting up the PPA printer.

To install the RPM package, you must log in as the system administrator, root.

Now begin the installation. First install the pnm2ppa RPM:

rpm -Uvh pnm2ppa-1.10-1*.i386.rpm
The pnm2ppa executable gets installed in /usr/bin/.

The Linux kernel will be able to autodetect IEEE-1284 devices like PPA printers, provided they are attached to the parallel port with a bidirectional IEEE-1284 cable. (If your printer works under Windows, you have the correct cable.) A script detect_ppa is provided by the pnm2ppa RPM: just type

detect_ppa
to confirm that your Printer is found. A typical message from the printer, which will be displayed if autodetection is successful, is:
CLASS:PRINTER;
MODEL:DESKJET 820C;
MANUFACTURER:HEWLETT-PACKARD;
DESCRIPTION:Hewlett-Packard DeskJet 820C;
COMMAND SET:SCP,VLINK;
A list of PPA printers found, and the parallel ports to which they are attached, will also be shown.

At this point it is useful to test that your printer is working, by printing a test page using the supplied script test_ppa which the RPM has installed. You will need to know your printer model (710, 712, 720, 722, 820, 1000), your paper size (letter, legal, a4) and the printer port the printer is attached to. If it is attached to the primary parallel port, this is (usually) /dev/lp0. Type

test_ppa
and give the details about printer model. papersize, and port number when prompted. You will then be asked whether to print a test page, an offset calibration page, or an alignment calibration page, etc.

Configuring the print filters.

Note: Red Hat 7.3 now features either CUPS or LPRng printer management. The configuration tools should be able to configure pnm2ppa, using the information about it taken from the Linux Printer Database. Apart from the addition of a new --dpi300 option to accept 300dpi input (useful for printing PNM output from 300dpi scanners), there have been no changes in the pnm2ppa command line since the pnm2ppa-1.0 release, so the configuration scripts are stable. (They can only use the default 600dpi input mode.)

Since Red Hat 7.1, there is a graphical printer configuration utility printconf-gui. In Red Hat 6.2 and 7.0, the older configuration utility called printtool is used. In either case, start the "Red Hat Linux Print System Manager" (as root) to configure the printer, either by clicking on the printer icon in Red Hat's "control-panel", or just typing

printtool
which also starts printconf-gui in the newer Red Hat releases.

Configuring the print filters with the Red Hat 6.2/7.0 printtool

(Skip this section unless you are still using Red Hat 6.2 or 7.0)

The following description is for the older printtool that is used by Red Hat 6.2/7.0. The printer configuration utility printconf-gui for Red Hat 7.1 and later is a little different, as it is based on the foomatic printer configuration database which contains entries for pnm2ppa (but not the older pbm2ppa). You should be able to easily figure out what to do: it can configure all pnm2ppa command-line options in the Driver Options screen.

In the Red Hat 6.2/7.0 Print System Manager window, click on Add, then in the "Add a Printer Entry", select Local Printer, and click Ok. Hopefully, the port on which the printer is attached will be listed as "Detected" (if not, fix the problem before continuing, perhaps by adding the line "alias parport_lowlevel parport_pc" to /etc/conf.modules). You will now have to "edit the local printer entry" for the PPA printer. Click on Select to chose the "Input filter". The Configure Filter screen will open. Among the many printer entries in the list "Printer Type", you should find three entries

Select the appropriate entry for your printer model. You will then be presented with various options: When you have made your choices, click on Ok to save your selections and close the "Configure Filter" screen, and then click on OK to close the "Edit Local Printer Entry" screen.

You are now back in the "Red Hat Print System Manager" screen; highlight the printer you just configured, and, in the Tests menu, choose Print Postscript test page to print a test page using the Red Hat print filters. If this printed correctly, your print system is set up to use the PPA printer, just like any of the other printers that the Red Hat print filters support.

Configuring pnm2ppa.conf and calibrating the printer.

A number of printer parameters are set to reasonable default values for each of the printer models, but you may wish to "fine tune" or calibrate your printer. The default values can be overridden by entries in the configuration files, which by default are /etc/pnm2ppa.conf and /etc/pbm2ppa.conf. At 600dpi, one pixel is 1/600 inch.

The user-adjustable parameters are:

Use test_ppa to print various test pages or calibration patterns to adjust the offsets.

If you wish to specify these parameters using the command-line options described above, in Red Hat 6.2/7.0 some of them can be entered in the "extra GS options" box using the Print System Manager (printtool), as described above. In Red Hat 7.1 and later, all command-line options can be set using the new printconf-gui utility.

Utility programs for the printer.

HP's Windows software provides a utility program that sends PPA commands to tell the printer to perform tasks like cleaning the printheads, etc.

On Red Hat Linux, You can use test_ppa (which acts as a command-line front-end for calibrate_ppa) to print head-cleaning patterns.

There is a graphical (gtk-based) tool written by Javier Sedano for creating a pnm2ppa.conf file and acting as a front end to calibrate_ppa. This is called ppaSet, and a beta version of it can be found in the same place as the pnm2ppa-1.10 distribution at http://sourceforge.net/projects/pnm2ppa

There was also at one time a proposal to add support for PPA printers to the PUP (Printer Utility Program) utility, which is also a project at http://www.sourceforge.net. However, as of the time of writing, no PUP support for PPA printers is available.

Troubleshooting

The first thing to do is to look at the messages from pnm2ppa in the system log to see what is happening, whether pnm2ppa actually received any input, and if it was valid. (You may need to enable system log messages in /etc/pnm2ppa.conf, see above.) Maybe ghostscript failed to convert your postscript file into PNM format: in that case the system log reports "Fatal Error! Input image (pnm2ppa) is not a PNM image". (note: when this occured, older versions of pnm2ppa reported "Input image is not a supported PNM format" which may have been confusing). This is because the input received by pnm2ppa was not a valid PNM image, but instead ghostscript failed to produce any PNM output at all, and its only output was probably just an error message. This is not a pnm2ppa problem!

Here are suggestions for dealing with other problems that you may encounter.

Contacting the pnm2ppa project.

Send comments or corrections (about this document or the RPMS) to: ppa-rpms@users.sourceforge.net

There are three mailing lists, pnm2ppa-announce@lists.sourceforge.net (announcements), pnm2ppa-users@lists.sourceforge.net (users helping users) and pnm2ppa-devel@lists.sourceforge.net (developers). You can subscribe to them, or browse their archives, at http://sourceforge.net/projects/pnm2ppa. (The older pnm2ppa mailing lists died with the ListBot service)

To contact the developers, subscribe to ppa.devel and post a message.

There are Public Forums for posting questions and comments at http://sourceforge.net/projects/pnm2ppa (but whether you get any help from these, depends on whether anyone is reading them (unlikely!)).


Next Previous Contents pnm2ppa-1.13/docs/en/INSTALL.REDHAT.txt0000644000076400007640000006702607512500653014131 00000000000000 PPA Printer-Support RPM Packages for Red Hat Linux and Com- patible Distributions The pnm2ppa project team ppa-rpms@users.sourceforge.net v0.30, July 9, 2002 Information and installation instructions to accompany pnm2ppa pack- ages for Red Hat Linux available at http://sourceforge.net/pro- jects/pnm2ppa (Updated for pnm2ppa-1.10 and Red Hat 6.2 or later.) See the "Troubleshooting" section at the end of this document for fixes to some reported problems Overview of HP's PPA DeskJet Printers. Most of Hewlett-Packard's DeskJet(tm) printers use the PCL3 command language, and are currently supported by Ghostscript drivers. However, a few legacy models, namely o DeskJet 710C Series: HP DeskJet 710C, 712C (discontinued) o DeskJet 720C Series: HP DeskJet 720C, 722C (discontinued) o DeskJet 820C Series: HP DeskJet 820Cxi, 820Cse (discontinued) o DeskJet 1000C Series: HP DeskJet 1000Cxi, 1000Cse (discontinued) feature "Host-based" printing, and use HP's proprietary PPA (Printer Performance Architecture) protocol, instead of PCL. The two models in each series are physically identical; they just came with different bundled Windows software. All PPA printers are now discontinued from HP's product lines, but may still be found as second-hand legacy items. PPA printers rely on software running on the host CPU to carry out the low-level processing of printer output that would be done by hardware in a standard PCL printer. The relation of PPA printers to PCL printers is analogous to the relation between "Winmodems" and true modems. Presumably, the idea at the time was that this would allow cheaper hardware to be used, but the decline in hardware prices probably meant that the savings were not significant, and PPA printing seems to have been abandoned. Unfortunately, HP only supplied Windows software drivers for PPA printers, and have indicated that it is unlikely that they will ever make the proprietary PPA specs public. This is apparently because of concerns that publication of the specs might reveal crucial details of HP's trade secrets about "color science" to competitors. (A secondary issue is that it is apparently possible to physically damage the printer by sending it bad sequences of PPA commands, which is not the case for PCL commands, and it seems that HP do not wish to take any responsibility for such damage by encouraging unofficial PPA programming.) In the past, Linux users often inadvertently purchased PPA DeskJet models, mistaking them for PCL3 DeskJets, which have traditionally been well-supported by Linux drivers. Fortunately, a reverse engineering effort, started in 1998 by Tim Norman, and continued by the pnm2ppa project at http://pnm2ppa.sourceforge.net, and http://sourceforge.net/projects/pnm2ppa has managed to produce drivers that provide basic printing functionality for these PPA printers under Linux and other Unices. While HP have recently begun to release their own Linux drivers for PCL3 DeskJets, they have not included drivers for their legacy PPA printers in this effort. The pnm2ppa driver has been stable since v1.04, released October 2000, with no known reproducible bugs, except that image printing quality was not so good. This version has been distributed with Red Hat, and other Linux distributions. v1.10, released July 2002, contains a lot of changes that improve image quality, in particular by improved bidirectional printing, and always printing black on top of color. A better improvement would be for someone to make a PPA backend to gimp-print, using pnm2ppa as a guide for how to send data to PPA printers. But, since PPA printers are now "legacy" hardware, and pnm2ppa appears to work fine for most printing tasks, it is unlikely that any new developers will be interested in doing this, and there is currently no further development anticipated. The project is currently in "low-maintenance mode". The pnm2ppa driver for color printing with PPA printers. Color printing with PPA printers is supported by the pnm2ppa driver which is the successor to the older black-and-white-only driver pbm2ppa-0.8.6 developed by Tim Norman. pnm2ppa translates portable anymap (pnm) format images into a stream of PPA instructions which can be sent to the printer. In the driver name, "pnm" stands for the superset of three image formats: ppm (portable "pixmap" format for color images), pgm (portable "greymap" format for greyscale images), and pbm (portable "bitmap" format for black and white images). Ghostscript has a number of "output devices" that produce pnm format output from postscript or pdf input. These come in plain (text) and raw (binary) variants. While pnm2ppa can now interpret both plain and raw pnm formats, there is no point in using the inefficient plain formats: always use the "raw" output devices, which are: o ppmraw - raw pixmap format (color images); o pgmraw - raw greymap format (greyscale images); o pbmraw - raw bitmap format (black and white images); o pnmraw - selects between ppm, pgm, and pbm raw formats; o pgnmraw - selects between pgm and pbm raw formats. The last two output devices are switches that try to analyze the image, and select an appropriate format; however, they are not recommended for routine use, as they may inconsistently choose the format. The ghostscript packages supplied with all recent Red Hat distributions provides all these devices. To see the list of available ghostscript output devices, type the command line gs --help if the required ppmraw or pbmraw devices are not shown, you will have to upgrade your version of ghostscript. The data must be streamed directly from ghostscript to pnm2ppa to the (local) printer without being stored in any intermediate file: one ppm-format (color) US Letter size page is represented by 3x5100x6600 Bytes (100MB) in binary format and four times this amount in text format. An example of a command line for printing a postscript file file.ps using gs (ghostscript) and pnm2ppa is cat file.ps | gs -q -sDEVICE=ppmraw -r600 -sPAPERSIZE=letter -dNOPAUSE \ -sOutputFile=- - | pnm2ppa --eco -v 720 -i - -o - | lpr -l (all on a single line). In this example the paper size is explicitly given to gs as US Letter (8.5"x11") size (letter); pnm2ppa no longer needs to be told what the paper size is, and will read it from the gs output (and check that it is a permitted size for the printer type). The pnm2ppa option --eco specifies "EconoFast" mode, for a lower quality output which uses less ink, and prints faster, and -v 720 specifies the PPA printer as belonging to the DeskJet 720C series. o pnm2ppa expects that the input resolution is 600dpi (or 300dpi if it is called with the pnm2ppa --dpi300 ...option). This corresponds to the gs -r600 ... or gs -r300 ... ghostscript options. If other higher/lower input resolutions are used, the size of the printed image will be larger/smaller, provided it is within the printer's allowed size range. Obviously, it would be impractical to type such a command each time one wished to print something, and since RedHat 6.2, printfilter support for pnm2ppa is built into Red Hat's printer configuration scheme, so after configuration, the simple command lpr file.ps should successfully print a postscript file. However, in case you wish to check if something is misconfigured in the print filters, you can use a script like the above one to bypass them and check that the printer is working. o Also, if you wish to print to paper sizes supported by ghostscript, but not supported by the Red Hat Printer configuration utilities, you can use scripts like the one above. The HP 710C, 720C, and 820C series support paper sizes from 3"x3" to 8.5"x14", while the 1000C supports 4"x6" to 13"x19". Available RPM packages. A RPM package for pnm2ppa is part of the Red Hat Linux distribution starting with Red Hat 6.2. You will also find a RPM package for the latest release of pnm2ppa at http://sourceforge.net/projects/pnm2ppa. The latest version at the time of writing is pnm2ppa-1.10-1rh7x.i386.rpm, and is built on Red Hat 7.3, or pnm2ppa-1.10-1rh62.i386.rpm, built on Red Hat 6.2. If you are running a different release of Red Hat (or a different Linux distribution) you may need to download and rebuild the source RPM pnm2ppa-1.10-1.src.rpm instead: rpm --rebuild pnm2ppa-1.10-1.src.rpm (You must be root to do this, and have the necessary compilers installed; on Red Hat, the rebuilt binary RPM will be created in the directory /usr/src/redhat/RPMS/i386/.) Red Hat 6.2 and later also includes support for configuring your printer to use pnm2ppa. (Information necessary for configuring pnm2ppa on older Red Hat releases has been removed from this document; for this, see the documentation that came with pnm2ppa-1.04, or update your RedHat distribution.) Note: If you are still using Red Hat 6.2, you may wish to update the print filter support for pnm2ppa that comes with it. The pnm2ppa-1.10-1rh62* RPM package supplies the necessary files that you can use. After installing this RPM, see /usr/lib/rhs/rhs-printfilters/README.ppa for details. Installing the pnm2ppa RPM package and setting up the PPA printer. To install the RPM package, you must log in as the system administrator, root. Now begin the installation. First install the pnm2ppa RPM: rpm -Uvh pnm2ppa-1.10-1*.i386.rpm The pnm2ppa executable gets installed in /usr/bin/. The Linux kernel will be able to autodetect IEEE-1284 devices like PPA printers, provided they are attached to the parallel port with a bidirectional IEEE-1284 cable. (If your printer works under Windows, you have the correct cable.) A script detect_ppa is provided by the pnm2ppa RPM: just type detect_ppa to confirm that your Printer is found. A typical message from the printer, which will be displayed if autodetection is successful, is: CLASS:PRINTER; MODEL:DESKJET 820C; MANUFACTURER:HEWLETT-PACKARD; DESCRIPTION:Hewlett-Packard DeskJet 820C; COMMAND SET:SCP,VLINK; A list of PPA printers found, and the parallel ports to which they are attached, will also be shown. At this point it is useful to test that your printer is working, by printing a test page using the supplied script test_ppa which the RPM has installed. You will need to know your printer model (710, 712, 720, 722, 820, 1000), your paper size (letter, legal, a4) and the printer port the printer is attached to. If it is attached to the primary parallel port, this is (usually) /dev/lp0. Type test_ppa and give the details about printer model. papersize, and port number when prompted. You will then be asked whether to print a test page, an offset calibration page, or an alignment calibration page, etc. o Tip: The test_ppa script does not use the Red Hat print filters, so it is useful when troubleshooting, for testing if any printing problems are associated with the basic printer installation, or with the configuration of the print filters. Configuring the print filters. Note: Red Hat 7.3 now features either CUPS or LPRng printer management. The configuration tools should be able to configure pnm2ppa, using the information about it taken from the Linux Printer Database. Apart from the addition of a new --dpi300 option to accept 300dpi input (useful for printing PNM output from 300dpi scanners), there have been no changes in the pnm2ppa command line since the pnm2ppa-1.0 release, so the configuration scripts are stable. (They can only use the default 600dpi input mode.) Since Red Hat 7.1, there is a graphical printer configuration utility printconf-gui. In Red Hat 6.2 and 7.0, the older configuration utility called printtool is used. In either case, start the "Red Hat Linux Print System Manager" (as root) to configure the printer, either by clicking on the printer icon in Red Hat's "control-panel", or just typing printtool which also starts printconf-gui in the newer Red Hat releases. Configuring the print filters with the Red Hat 6.2/7.0 printtool (Skip this section unless you are still using Red Hat 6.2 or 7.0) The following description is for the older printtool that is used by Red Hat 6.2/7.0. The printer configuration utility printconf-gui for Red Hat 7.1 and later is a little different, as it is based on the foomatic printer configuration database which contains entries for pnm2ppa (but not the older pbm2ppa). You should be able to easily figure out what to do: it can configure all pnm2ppa command-line options in the Driver Options screen. In the Red Hat 6.2/7.0 Print System Manager window, click on Add, then in the "Add a Printer Entry", select Local Printer, and click Ok. Hopefully, the port on which the printer is attached will be listed as "Detected" (if not, fix the problem before continuing, perhaps by adding the line "alias parport_lowlevel parport_pc" to /etc/conf.modules). You will now have to "edit the local printer entry" for the PPA printer. Click on Select to chose the "Input filter". The Configure Filter screen will open. Among the many printer entries in the list "Printer Type", you should find three entries o HP DeskJet 1000 series (PPA) (for 1000Cse, 1000Cxi models) o HP DeskJet 710/720 series (PPA) (for 710C, 712C, 720C, 722C models) o HP DeskJet 820 series (PPA) (for 820Cse, 820Cxi models) Select the appropriate entry for your printer model. You will then be presented with various options: o The Driver Description box contains information about the driver (you may have to use the scrollbar at the right of the box to read it all). o The resolution box shows a single resolution (600x600). There are no other choices. o The Paper Size box allows various choices (only letter, legal, and a4 seem correspond to native paper sizes printed by the Red Hat print filters; the other choices, (a3, ledger, ...) appear to get resized by the print filters to print on US Letter size paper (?) ). (Other paper sizes cannot be selected this way, but you can print to any papersize, if it supported by both ghostscript and the printer, using a script, as described above, that bypasses the RedHat printfilters.) o The Color Depth/ Uniprint Mode box allows various selections of color and print quality (These are achieved by using various combinations of the pnm2ppa options --eco (EconoFast mode), -p (disable black ink cartridge) and --bw (black and white printing only), without direct intervention by the user.) The choices (in the most recent printerdb database) are: o Black and White, econofast mode (--bw --eco) o Black and White, normal quality (--bw) o Color, econofast mode (--eco --fd) o Color, normal quality (--eco) o Color, high quality o Color, normal quality, black ink disabled (-p --eco) o Color, high quality, black ink disabled (-p --uni) (These are the choices that will be presented by "official" rhs- printfilters-1.72; if you installed a pnm2ppa RPM package from the SourceForge pnm2ppa site, you may have a file /usr/lib/rhs/rhs- printfilters/README.ppa explaining how to modify earlier versions of rhs-printfilters to show these updated choices.) You may also see a choice to use the older "Legacy" driver pbm2ppa (black and white only); this is is stable but unmaintained; it may still be a useful alternative to pnm2ppa on older, slower systems with less available memory. o The three Printing options are not relevant here, and should not be selected. They are for direct printing of text (ascii) to non- postscript printers, but since the only way of printing text files with pnm2ppa is by first converting them to postscript(tm), this is not possible on the PPA printer. o It is important that the choice "Fast text printing (non-PS printers only)" is NOT selected, so that the print filters will convert text files to postscript before printing. o The Margins entries control the margins used when printing text files (these are instructions to the text-to-postscript conversion process). o The Extra GS options box is not only a place for adding options for ghostscript, but also for the PPA drivers. Leave this box empty unless you know what you are doing. As explained in the text in the Driver Description box (you did read it, didn't you ?), the entry should be in the format: gs_options PPA ppa_options Anything before the "PPA" is interpreted as a gs option, anything after it is interpreted as a ppa option. You can learn about pnm2ppa options by typing either "man pnm2ppa" or "pnm2ppa --help" at a com- mand line (hopefully, these two sources of information will be consis- tent with each other!); When you have made your choices, click on Ok to save your selections and close the "Configure Filter" screen, and then click on OK to close the "Edit Local Printer Entry" screen. You are now back in the "Red Hat Print System Manager" screen; highlight the printer you just configured, and, in the Tests menu, choose Print Postscript test page to print a test page using the Red Hat print filters. If this printed correctly, your print system is set up to use the PPA printer, just like any of the other printers that the Red Hat print filters support. Configuring pnm2ppa.conf and calibrating the printer. A number of printer parameters are set to reasonable default values for each of the printer models, but you may wish to "fine tune" or calibrate your printer. The default values can be overridden by entries in the configuration files, which by default are /etc/pnm2ppa.conf and /etc/pbm2ppa.conf. At 600dpi, one pixel is 1/600 inch. The user-adjustable parameters are: o verbose 1 and silent 1. These control messages about progress and errors from pnm2ppa. By default, messages are sent to the system log /var/log/messages. The verbose 1 keyword send copies to stderr, the standard error stream to the terminal. The silent 1 keyword silences the stream of messages to the system log. o The system log messages may be silenced in the default configuration file; switch off "silent" mode with "silent 0" for debugging printer problems (or use verbose mode). o The version keyword can be used to specify the printer model as 710, 712, 720, 722, 820, or 1000. It is not needed if you use the RedHat printool to configure the printer. o xoffset and yoffset: the x-offset and y-offset (in pixels) of the printed image on the page, which should be chosen so the image is correctly centered on the paper. (These can also be set with the -x and -y options.) See CALIBRATION.html (or CALIBRATION.txt) for more information. o topmargin, bottommargin, leftmargin, rightmargin: the four margins, which define the distances (in pixels) from the edges of the paper to the printed region; parts of the image that are outside these margins will not be printed. (These can also be set with the -t , -b , -l , and -r options.) o ColOffsX and ColOffsY: the x-offset and y-offset (in pixels) between the color image produced by the color ink printer head, and that produced by the black ink printer head. These should be recalibrated each time an ink cartridge is replaced. See CALIBRATION.html (or CALIBRATION.txt) for more information. o blackshear and colorshear: these are x offsets between right-to- left and left-to-right sweeps of the print head, one for the black printing and one for the color printing. These provide sideways offsets (in pixels) of the right-to-left sweeps, that can be used to correct "shearing" when printing in modes that use bidirectional print head sweeps. o unimode 1 will make unidirectional print sweeps (left-to-right) the default, instead of bidirectional sweeps. The --uni and --bi options can control how a particular print run is printed. Unidirectional printing is only useful (it is slower) if there are issues of "shearing" in high quality image printing. o blackness : this takes values 0,1,2,3 or 4 drops of black ink per pixel, and controls black ink density in black-and-white and "text- like" black regions in color printing. At present, this has no effect on printing with the black ink cartridge disabled, or on black regions identified as "image-like". (This can also be set with the -B option, where n is the number of drops.) o GammaR, GammaG, and GammaB: the are the three "gamma" parameters that define the standard color correction curves for red, green, and blue. Changing these will affect how colors appear (decreasing any Gamma enhaces the corresponding color). The Gamma values are specified as decimal numbers, with Gamma = 1.0 corresponding to no color correction. o Gamma values can also be specified using integer numbers RedGammaIdx, GreenGammaIdx, BlueGammaIdx; These are determined by a procedure discussed in COLOR.html or COLOR.txt, which involves printing a test page. The papersize keyword specifies the paper size used for this testpage, because it is produced by pnm2ppa without the input that usually specifies the page size. o The keywords black_ink 0, color_ink 0, cyan_ink 0, magenta_ink 0, and yellow_ink 0 can be used to switch of the various inks; this can be useful in troubleshooting and debugging pnm2ppa. Use test_ppa to print various test pages or calibration patterns to adjust the offsets. If you wish to specify these parameters using the command-line options described above, in Red Hat 6.2/7.0 some of them can be entered in the "extra GS options" box using the Print System Manager (printtool), as described above. In Red Hat 7.1 and later, all command-line options can be set using the new printconf-gui utility. Utility programs for the printer. HP's Windows software provides a utility program that sends PPA commands to tell the printer to perform tasks like cleaning the printheads, etc. On Red Hat Linux, You can use test_ppa (which acts as a command-line front-end for calibrate_ppa) to print head-cleaning patterns. There is a graphical (gtk-based) tool written by Javier Sedano for creating a pnm2ppa.conf file and acting as a front end to calibrate_ppa. This is called ppaSet, and a beta version of it can be found in the same place as the pnm2ppa-1.10 distribution at http://sourceforge.net/projects/pnm2ppa There was also at one time a proposal to add support for PPA printers to the PUP (Printer Utility Program) utility, which is also a project at http://www.sourceforge.net. However, as of the time of writing, no PUP support for PPA printers is available. Troubleshooting The first thing to do is to look at the messages from pnm2ppa in the system log to see what is happening, whether pnm2ppa actually received any input, and if it was valid. (You may need to enable system log messages in /etc/pnm2ppa.conf, see above.) Maybe ghostscript failed to convert your postscript file into PNM format: in that case the system log reports "Fatal Error! Input image (pnm2ppa) is not a PNM image". (note: when this occured, older versions of pnm2ppa reported "Input image is not a supported PNM format" which may have been confusing). This is because the input received by pnm2ppa was not a valid PNM image, but instead ghostscript failed to produce any PNM output at all, and its only output was probably just an error message. This is not a pnm2ppa problem! Here are suggestions for dealing with other problems that you may encounter. o Printing fails in the middle of a print run, perhaps when a figure embedded in the document is printing (in the latest pnm2ppa versions, printing finishes normally, but an incomplete document is printed). The system log reports that read_line could not read the image, and found EOF (end-of-file). This probably means that ghostscript's "ppmraw" or "pgmraw" output device started correctly, but failed for some reason before finishing the image conversion from postscript to PNM format, usually leaving a core dump. (This has been seen to happen in ghostscript 5.10 ; upgrading to ghostscript 5.50 solved the problem.) If you cannot upgrade, try printing the document in black-and-white using the ghostscript "pbmraw" output device. o You printed an image file using a "high quality" printer setting, but it has visible horizontal lines on it and printing under Windows(tm) 9x doesn't show this effect (except in "economode"). These are probably "swath boundaries", showing the junction between different sweeps of the print head. Solution: using unidirectional printing (PPA option --uni, or unimode 1 in /etc/pnm2ppa.conf) helps a little. this problem is fixed in the pnm2ppa-1.10 release o "Flashing light syndrome ". Your printer usually works, but you have found that some particular documents cause the printer to fail, and the lights on its panel start flashing rapidly in sequence. Solution, turn the printer off and back on again. This is not supposed to happen any more; if it happens reproducibly, contact the pnm2ppa developers, and offer to make the offending file available for testing and diagnosis of this problem. (Don't sent it to the Mailing List unless requested). Bug reports can be filed at the SourceForge pnm2ppa site. o You wish to print on envelopes or other non-standard media not supported by the print filters? Solution: if you can get Ghostscript (gs) to produce the correct image, and the paper size is in the range allowed by your printer, you should be able to do this with a script that bypasses the print filters, as described earlier in this document. o Colors look wrong, or do not match what the Windows(tm) 9x driver produces. Solution: check that your color ink cartridge is not running out of some ink color; if not, (a) adjust the "gamma" entries in /etc/pnm2ppa,conf, or (b) install a customized color calibration file /etc/pnm2ppa.gamma. See the file COLOR.html (or COLOR.txt) for more information. Contacting the pnm2ppa project. Send comments or corrections (about this document or the RPMS) to: ppa-rpms@users.sourceforge.net There are three mailing lists, pnm2ppa-announce@lists.sourceforge.net (announcements), pnm2ppa-users@lists.sourceforge.net (users helping users) and pnm2ppa-devel@lists.sourceforge.net (developers). You can subscribe to them, or browse their archives, at http://sourceforge.net/projects/pnm2ppa. (The older pnm2ppa mailing lists died with the ListBot service) To contact the developers, subscribe to ppa.devel and post a message. There are Public Forums for posting questions and comments at http://sourceforge.net/projects/pnm2ppa (but whether you get any help from these, depends on whether anyone is reading them (unlikely!)). pnm2ppa-1.13/docs/en/INSTALL.SOLARIS0000644000076400007640000000173407343336252013456 00000000000000On Solaris systems, you will probably have to install the GNU "libiberty" library (-liberty) which provides getopt_long for Solaris; get it at http://sunfreeware.com (look for the package "libiberty.so" in the list of freeware) and install it into /usr/local/lib. The tarball of the package is called "shared-libiberty.tar.gz". If you use the precompiled library libiberty-i386.so that it supplies for x86 systems, rename it to libiberty.so when you install it. Otherwise, build the library from source. Uncomment the Makefile line adding an entry for -liberty to LDFLAGS. You may also need to compile with the -D__NO_SYSLOG__ option to suppress system log messages. See the Makefile. If "make install" fails, manually copy the pnm2ppa and calibrate_ppa binaries, the manpage pnp2ppa.1, and the configuration file pnm2ppa.conf to their appropriate locations. The "install" command on Solaris does not have the -b (backup) option. uncomment the Makefile line entry for this.pnm2ppa-1.13/docs/en/INSTALL.SUSE0000644000076400007640000000246007176353610013117 00000000000000Installation of pnm2ppa with S.u.S.E. Linux ------------------------------------------------------ 1. Installation of program package pnm2ppa Follow the standard installation instructions in INSTALL and CALIBRATION. The driver pnm2ppa is installed to /usr/local/bin. The manual page pnm2ppa.1 is installed in /usr/local/man/man1. 2. To integrate pnm2ppa into the BSD print spooler of the Linux system we create printer spoolers in /etc/printcap, to print postscript files in color or black and white, and to print plain ascii files. See the file README.lpd in the subdirectory "lpd" of the pnm2ppa distribution. This shows how to set up five printer descriptions: coloreco (normal quality color,the default); color (high quality color) bweco (economy mode black) bw (high quality black and white) ascii (for printing text files using enscript) (Maybe there is a better way, using SUSE's own printing configuration system; if so please let us know). 3. Now you are ready to print files with # lpr filename.ps which is equivalent to: #lpr -P coloreco filename.ps or explicitly specify the color and quality mode: #lpr -P bweco filename.ps #lpr -P bw filename.ps #lpr -P coloreco filename.ps #lpr -P color filename.ps and for ascii (text) files: # lpr -P ascii filename pnm2ppa-1.13/docs/en/LICENSE0000755000076400007640000004400007132471700012305 00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 675 Mass Ave, Cambridge, MA 02139, 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. 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.) 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. 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. 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 Appendix: 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. Copyright (C) 19yy 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., 675 Mass Ave, Cambridge, MA 02139, USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19yy name of author Gnomovision 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. , 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. pnm2ppa-1.13/docs/en/PPA_networking-1.html0000644000076400007640000000714507275663602015235 00000000000000 Networking HP PPA DeskJet Printers using SAMBA.: Networking HP DeskJet PPA printers with SAMBA Next Previous Contents

1. Networking HP DeskJet PPA printers with SAMBA

1.1 Overview of PPA printers.

The HP DeskJet 710/712C, 720/722C, 820Cse/820Cxi and 1000Cse/1000Cxi printers are "Winprinters" which are designed only for use with MS Windows operating systems. HP supplies Windows-only software that processes the input data into the proprietary and unpublished PPA ("Printer Performance Architecture") protocol.

HP states that these printers are not supported as networked printers, but they in fact function correctly as shared (SMB) printers under MS Windows.

In this document, the Host is the computer to which the PPA printer is physically connected, and the Clients are other computers on the network that wish to print documents on the PPA printer.

In the Windows printing system, separate copies of the HP PPA printer drivers are installed on each Client, and are run on the Client to produce PPA output that is sent over the network to be spooled on the Host to which the printer is attached.

HP's drivers are only supplied for Windows systems. The independently-produced pnm2ppa driver runs on Linux, some other Unix systems, and BeOS.

This document describes various tested strategies for using pnm2ppa and the samba suite of SMB tools to allow the PPA printer to be attached to a non-Windows host on a (TCP-based) SMB network, or to allow non-Windows Clients to receive printing services from a Host on the network.

1.2 Choice of protocol for sending over the network.

There are two possible ways to send printer data from a Client to the printer Host over the network.

  • as PPA data, created by a driver on the Client. This is what happens when using conventional printer sharing on Windows.
  • as PostScript data, created on the Client, which is then translated into PPA instructions by drivers running on the printer Host.
Since PPA data is rather large, the first method involves sending larger amounts of data over the network, which may be why HP do not officially support PPA DeskJets as networked printers. It also requires that PPA drivers are installed on the Client.

The Host to which the printer is attached can thus provide two classes of printing services:

  • PPA printing services: the Host accepts PPA-format printing jobs created on the Clients either with HP's native PPA drivers (Windows Clients) or pnm2ppa (Unix/Linux/BeOS Clients);
  • PostScript printing services: the Host accepts PostScript-format printing jobs created on any postscript-capable Client, and converts them to PPA format using either HP's native PPA drivers (Windows Host) or pnm2ppa (Unix/Linux/BeOS Host);
It is useful to set up the Host to offer both types of service, sharing a common spooling system.


Next Previous Contents pnm2ppa-1.13/docs/en/PPA_networking-2.html0000644000076400007640000001430007275663602015225 00000000000000 Networking HP PPA DeskJet Printers using SAMBA.: Configuring the Printer Host. Next Previous Contents

2. Configuring the Printer Host.

2.1 Configuring a Linux/Unix Host to share a PPA printer using Samba.

It is assumed that pnm2ppa is installed and working to provide local printing services on the Host, and that lpr will invoke a full set of print filters, as (e.g.) in Red Hat 6.2. The PPA printer is installed with the printer name lp, and samba is assumed to be installed. General Samba configuration issues involving security levels, network password, etc, are outside the scope of this document (see the SMB-HOWTO). You must log in as root to configure Samba.

Here is a sample entry setting up two public printer shares in the Host's /etc/smb.conf file. The printer HP722C-PPA is for printing by a Client that sends PPA output from pnm2ppa or the HP drivers across the network, and HP722-PS is for Clients that produce PostScript output:

[HP722C-PPA]
    comment = HP 722C printer on Linux (PPA input)
    path = /var/tmp
    printer name = lp
    writable = yes
    public = yes
    printable = yes
    print command = lpr -l -r -h -P %p %s
[HP722C-PS]
    comment = HP 722C printer on Linux (Postscript input)
    path = /var/tmp
    printer name = lp
    writable = yes
    public = yes
    printable = yes
    print command = lpr -r -h -P %p %s
The only differences besides the names are that the print command for HP722-PPA uses the " -l " "pass-through" option so print filters are not applied. The path entry uses /var/tmp because this is (presumably) a world-readable and -writable area for temporary files.

After editing /etc/smb.conf to include these entries, save it, and test its syntax with Samba's testparm utility. Then restart samba (run "/etc/rc.d/init.d/smb restart" on Red Hat).

2.2 Configuring a Windows Host to share a PPA printer with non-Windows Clients.

The Host is assumed to be a Window 98 system, and the PPA printer is assumed to be a HP722C installed with the native HP PPA drivers supplied on HP's installation CD. Some details may vary on other Windows versions.

First set up a shared printer that can accept PPA input from both networked Windows Clients, and from networked non-Windows Clients that use pnm2ppa.

  • IMPORTANT!: A PPA printer attached to a Windows Host shared with a Client running pnm2ppa has the following limitation:
    • Bi-Directional communication between the Windows Host and the printer must be disabled.
    If it is not done, a General Protection Fault will usually occur on the Windows Host when pnm2ppa sends output to the shared printer. (A "Hpfbkg06" error occurs, and the printer becomes nonfunctional until the Windows system is rebooted.) Disabling bi-directional communication appears to be a minor inconvenience: according to HP, the print quality is unaffected, but the "advanced features of the Status Monitor" will no longer send reminders to align the print cartridges after a new cartridge is installed, or send error messages associated with the ink cartridges or the banner lever.

You may be able to avoid disabling bi-directional communication by using an emulated Postscript printer to serve non-Windows Clients without using pnm2ppa (see below).

To turn off bi-directional communication between the Windows Host and the printer, open the Settings/Printers folder, then right-click on the printer icon, and open the Properties dialog. Select the Details tab, and click on Spool Settings, then choose the setting "Disable bi-directional support for this printer". If you have any difficulties, try rebooting Windows after the change, or see HP's support document http://www.hp.com/cposupport/printers/support_doc/bpd06455.html about disabling bi-directional communication.

To set up the Host to share the printer, right-click on its icon in the Settings/Printers folder, and select Sharing, then assign it a Share Name like HP722C-PPA , and enter a Comment Line like "HP 722C printer on Windows 98 (PPA input)".

You may now also wish to set up an emulated Postscript printer that accepts Postscript input from the Client, and prints it using HP's PPA drivers running on the Host, instead of on the Client. See the section Emulating a PostScript printer on a Windows Host

If you have installed and successfully tested the emulated printer, set it up for sharing on the network. Right-click on its icon in the Settings/Printers folder, and select Sharing, then assign it a Share Name like HP722C-PS, and enter a Comment Line like "HP 722C printer on Windows 98 (PostScript input)".

The emulated printer will appear like a Postscript printer to the Clients. If it provides acceptable printing services to the non-Windows clients, you will not need to connect pnm2ppa printers to HP722C-PPA, and will be able to re-enable bi-directional communication between the HP drivers and the printer. (However, the extra processing involved in the emulation may be unacceptably slow, or turn out to use too much of the host's CPU)


Next Previous Contents pnm2ppa-1.13/docs/en/PPA_networking-3.html0000644000076400007640000000663007275452761015237 00000000000000 Networking HP PPA DeskJet Printers using SAMBA.: Configuring the Printing Clients. Next Previous Contents

3. Configuring the Printing Clients.

3.1 Setting up Printing from a Windows Client.

Open the Settings/Printers folder, and start the Add Printer Wizard. Choose to add a Network Printer, and browse the network to find the Printer Shares you configured on the host (e.g., HP722C-PPA and HP722C-PS). If they are not visible, either the Host or the network is not properly configured. Correct the problem before proceding.

Normally, you will probably want to use the native Windows HP PPA drivers, so select the printer Share that accepts PPA input (e.g., HP722C-PPA). If the Host is a Windows Host, it will provide the drivers over the network, otherwise you will have to find the printer in the list of available HP Printer drivers, or click on Have Disk and install them from HP's installation CD. You then get a chance to change the name with which the printer will be known on the Client. Finally, you should choose to print a test page.

You might instead (or also) want to set up printing services using the Printer Share that accepts Postscript (e.g., HP722C-PS). In that case, if the Host is not a Windows Host, choose a "generic" PostScript printer like the Apple LaserWriter II NT or the Digital turboPrintServer 20/Net.

If the test page prints sucessfully, you are finished!

3.2 Setting up Printing from a Linux/Unix Samba Client

First examine the network by opening a terminal window and using the command

smbclient -L hostname
(where "hostname" should be replaced by the network name of the Host to which the printer is attached). This will list the SMB services provided by that Host. (Alternatively, your system may have some graphical front-end to smbclient that allows you to inspect the network.) The list should include the Printer Share(s) you configured on the Host (e.g., HP722C-PPA and HP722C-PS). If these are absent, you must first identify and correct the problem.

You must now configure the printer. The details of how to do this will vary between Linux/Unix distributions, but there will probably be support for network printing using Samba.

If the Printer Share you wish to use is intended to accept PPA input (e.g., HP722C-PPA), configure the Client to use the pnm2ppa driver.

If it is intended to accept PostScript input (e.g., HP722C-PS), configure the Client to print to a PostScript printer.

You may wish to configure both types of printers, and experiment to see which provides the best printing services on your network.

See the SMB-HOWTO documentation for more information.


Next Previous Contents pnm2ppa-1.13/docs/en/PPA_networking-4.html0000644000076400007640000002115407431763126015230 00000000000000 Networking HP PPA DeskJet Printers using SAMBA.: Emulating a PostScript printer on a Windows Host. Next Previous Contents

4. Emulating a PostScript printer on a Windows Host.

If you do not have commercial PostScript emulation software for Windows that will work with your HP PPA DeskJet (the author is unaware of any such software that supports PPA printers), you can use Ghostscript together with HP's native Windows drivers.

4.1 Installing Ghostscript as the emulation software.

From the Ghostscript home page http://www.cs.wisc.edu/~ghost/ download and install (in this order) the Windows packages of

  • Ghostscript (PostScript Emulation Software).
  • GSview (Ghostscript previewer, provides gsprint).
  • RedMon (printer port redirection utility).
(Install these using their setup.exe installation tools, and do not manually set up any configuration files for gsprint or RedMon.) You must now follow the detailed instructions below, and use the Windows "Add Printer Wizard" to add a postscript printer, and then configure it to use the gsprint utility that comes with GSview, and redirect the output to your HP PPA DeskJet using the RedMon utility.

4.2 Adding the fictitious Postscript printer.

In the following, I assume your printer is a HP DeskJet 722C, and is installed with its native Windows Drivers as a printer called "HP DeskJet 720C Series". Change printer name entries below as appropriate for your printer model.

The following instructions are tested on Windows 98, and may differ on other Windows variants.

Open the Settings/Printers folder.

First check that the HP PPA Deskjet is correctly installed, using HP's native Windows drivers. Right-click on its icon, and select its Properties dialog. The General Properties screen will open. This shows the exact name that the printer was given when it was installed. Make a note of it, and use the Print Test Page button to confirm that the printer is working. (The "Printer name:" line on the test page will also show the exact name of the HP PPA Deskjet that you will need to use when configuring the emulated postscript printer below). When you are done, click on OK to close the dialog.

Now start the Add Printer "Wizard". Make the choices:

  • install a local printer
  • select a PostScript printer from the list of printers; (e.g., one of the Apple LaserWriter models: the Laserwriter II NT is known to work; Digital PrintServer models such as the turboPrintServer 20/Net have also been recommended). This will provide a suitable postscript driver.
  • From the list of Available Ports, choose "FILE: Creates a file on disk" (you will change this after the printer is installed)
  • set as default printer?: NO
  • Print test page?: NO

4.3 Redirecting the output to the PPA printer.

After the printer has been installed, right-click on its icon, and rename it to something like, e.g., "Ghostscript+HP722C". Then right click again and open its Properties dialog.

On the General tab screen, enter something informative in the Comment box, such as " Emulated Postscript printer; output redirected to a HP722C DeskJet printer" (optional).

Next select the Details tab. The box "Print using the following driver:" should show the Postscript driver you selected (e.g., Apple LaserWriter II NT).

  • Click on Add Port. Select other, then Redirected Port, which should be available if RedMon was correctly installed, and click on OK to accept these settings and close the Add Port dialog. On the Details tab screen, The box "Print to the following port:" should now show a redirected port such as "RPT1 [Redirected Port]".
  • Click on Port Settings.
    • In the box "Redirect port to the program:", enter the path to the gsprint program. (If you accepted the defaults when installing it, this may be C:\Ghostgum\gsview\gsprint.exe; you may search for it by clicking on Browse).
    • In the box "arguments for this program are:" enter the arguments to be passed to the gsprint program (there is a document gsprint.htm with more details of these in the folder containing gsprint.exe). Suggested arguments are:
       -printer "HP DeskJet 720C Series" -color - 
      
      Replace "HP DeskJet 720C Series" by the (quoted) exact name of the HP PPA DeskJet printer that you made a note of earlier. (If you do not copy this name exactly, including any capitalization or spaces, things may not work!) The -color argument is needed to enable color printing; (Whether you actually get color printing will depend on the local settings of the "HP DeskJet 720C Series" printer that really prints the document.) The final " - " is required: without it, the output of gsprint will not get redirected to the printer.
    • The box "Output" should show "Program handles output".
    • In the box "Run", select "hidden".
    • The box "Shutdown delay" will say "300 seconds". Print jobs for which processing by gsprint takes longer than this will be terminated, to avoid blocking the printer spool queue. Increase this limit if necessary.
    Now click on OK to close the Port Settings dialog.
  • Click on Spool Settings, and select "Disable bi-directional support for this printer", and click OK.

Finally, again select the General tab, and test the installation by clicking on "Print a test page". If it works, you are finished setting up Postscript emulation. Click OK to exit the Printer Properties dialog.

(If you have problems, first check that you made the correct entries in the Printer Properties dialogs, especially check that you did not make any typing errors in the exact name for the PPA DeskJet printer in the gsprint arguments box, which must correspond exactly to the "Printer name" given to the HP PPA printer). If the problems persist, you might get guidance from the gsprint and RedMon documentation; look in the folders where these were installed.)

You now have a working emulated "Postscript printer" that can now be shared over a network. (The "sharing" options will now be available if you right-click on the emulated printer's icon.)

4.4 Limitations.

This emulated postscript printer is most useful for providing printing services to non-Windows Clients on a samba network, but can be also be used by Windows Clients with the following limitations:

  • Windows Clients will be able to select Print Settings only for the visible ("front end") "Postscript printer", but not for the hidden ("back end") HP PPA DeskJet printer that actually does the printing.
  • Changes in the local Print Settings of the PPA driver for the DeskJet printer on the Host system (but not on Client systems, if it too is shared) will affect network printing by the "Postscript printer".
  • Since the visible "Postscript printer" falsely advertises its identity, some of its Print Settings options seen by users on the Clients may not be valid.
  • The extra processing on the printer Host may make printing rather slow compared to native Windows printing.

Next Previous Contents pnm2ppa-1.13/docs/en/PPA_networking.html0000644000076400007640000000461307431763126015070 00000000000000 Networking HP PPA DeskJet Printers using SAMBA. Next Previous Contents

Networking HP PPA DeskJet Printers using SAMBA.

The pnm2ppa project team ppa-rpms@users.sourceforge.net

v0.12 Feb 10, 2002


This document discusses Networking HP 710C, 720C 820C or 1000C Series (PPA Protocol) HP DeskJet printers with non-Windows Hosts or Clients, using SAMBA. Topics include choosing between transmitting PPA or PostScript across the network, Windows and Linux/Unix Hosts, Windows and Linux/Unix Clients, and emulating a PostScript printer on Windows. (Updated for pnm2ppa-1.04 and later.)

1. Networking HP DeskJet PPA printers with SAMBA

2. Configuring the Printer Host.

3. Configuring the Printing Clients.

4. Emulating a PostScript printer on a Windows Host.


Next Previous Contents pnm2ppa-1.13/docs/en/PPA_networking.txt0000644000076400007640000004565507505260041014744 00000000000000 Networking HP PPA DeskJet Printers using SAMBA. The pnm2ppa project team ppa-rpms@users.sourceforge.net v0.12 Feb 10, 2002 This document discusses Networking HP 710C, 720C 820C or 1000C Series (PPA Protocol) HP DeskJet printers with non-Windows Hosts or Clients, using SAMBA. Topics include choosing between transmitting PPA or PostScript across the network, Windows and Linux/Unix Hosts, Windows and Linux/Unix Clients, and emulating a PostScript printer on Windows. (Updated for pnm2ppa-1.04 and later.) ______________________________________________________________________ Table of Contents 1. Networking HP DeskJet PPA printers with SAMBA 1.1 Overview of PPA printers. 1.2 Choice of protocol for sending over the network. 2. Configuring the Printer Host. 2.1 Configuring a Linux/Unix Host to share a PPA printer using Samba. 2.2 Configuring a Windows Host to share a PPA printer with non-Windows Clients. 3. Configuring the Printing Clients. 3.1 Setting up Printing from a Windows Client. 3.2 Setting up Printing from a Linux/Unix Samba Client 4. Emulating a PostScript printer on a Windows Host. 4.1 Installing Ghostscript as the emulation software. 4.2 Adding the fictitious Postscript printer. 4.3 Redirecting the output to the PPA printer. 4.4 Limitations. ______________________________________________________________________ 1. Networking HP DeskJet PPA printers with SAMBA 1.1. Overview of PPA printers. The HP DeskJet 710/712C, 720/722C, 820Cse/820Cxi and 1000Cse/1000Cxi printers are "Winprinters" which are designed only for use with MS Windows operating systems. HP supplies Windows-only software that processes the input data into the proprietary and unpublished PPA ("Printer Performance Architecture") protocol. HP states that these printers are not supported as networked printers, but they in fact function correctly as shared (SMB) printers under MS Windows. In this document, the Host is the computer to which the PPA printer is physically connected, and the Clients are other computers on the network that wish to print documents on the PPA printer. In the Windows printing system, separate copies of the HP PPA printer drivers are installed on each Client, and are run on the Client to produce PPA output that is sent over the network to be spooled on the Host to which the printer is attached. HP's drivers are only supplied for Windows systems. The independently-produced pnm2ppa driver runs on Linux, some other Unix systems, and BeOS. This document describes various tested strategies for using pnm2ppa and the samba suite of SMB tools to allow the PPA printer to be attached to a non-Windows host on a (TCP-based) SMB network, or to allow non-Windows Clients to receive printing services from a Host on the network. 1.2. Choice of protocol for sending over the network. There are two possible ways to send printer data from a Client to the printer Host over the network. o as PPA data, created by a driver on the Client. This is what happens when using conventional printer sharing on Windows. o as PostScript data, created on the Client, which is then translated into PPA instructions by drivers running on the printer Host. Since PPA data is rather large, the first method involves sending larger amounts of data over the network, which may be why HP do not officially support PPA DeskJets as networked printers. It also requires that PPA drivers are installed on the Client. The Host to which the printer is attached can thus provide two classes of printing services: o PPA printing services: the Host accepts PPA-format printing jobs created on the Clients either with HP's native PPA drivers (Windows Clients) or pnm2ppa (Unix/Linux/BeOS Clients); o PostScript printing services: the Host accepts PostScript-format printing jobs created on any postscript-capable Client, and converts them to PPA format using either HP's native PPA drivers (Windows Host) or pnm2ppa (Unix/Linux/BeOS Host); It is useful to set up the Host to offer both types of service, sharing a common spooling system. 2. Configuring the Printer Host. 2.1. Configuring a Linux/Unix Host to share a PPA printer using Samba. It is assumed that pnm2ppa is installed and working to provide local printing services on the Host, and that lpr will invoke a full set of print filters, as (e.g.) in Red Hat 6.2. The PPA printer is installed with the printer name lp, and samba is assumed to be installed. General Samba configuration issues involving security levels, network password, etc, are outside the scope of this document (see the SMB- HOWTO). You must log in as root to configure Samba. Here is a sample entry setting up two public printer shares in the Host's /etc/smb.conf file. The printer HP722C-PPA is for printing by a Client that sends PPA output from pnm2ppa or the HP drivers across the network, and HP722-PS is for Clients that produce PostScript output: [HP722C-PPA] comment = HP 722C printer on Linux (PPA input) path = /var/tmp printer name = lp writable = yes public = yes printable = yes print command = lpr -l -r -h -P %p %s [HP722C-PS] comment = HP 722C printer on Linux (Postscript input) path = /var/tmp printer name = lp writable = yes public = yes printable = yes print command = lpr -r -h -P %p %s The only differences besides the names are that the print command for HP722-PPA uses the " -l " "pass-through" option so print filters are not applied. The path entry uses /var/tmp because this is (presum- ably) a world-readable and -writable area for temporary files. After editing /etc/smb.conf to include these entries, save it, and test its syntax with Samba's testparm utility. Then restart samba (run "/etc/rc.d/init.d/smb restart" on Red Hat). 2.2. Configuring a Windows Host to share a PPA printer with non-Win- dows Clients. The Host is assumed to be a Window 98 system, and the PPA printer is assumed to be a HP722C installed with the native HP PPA drivers supplied on HP's installation CD. Some details may vary on other Windows versions. First set up a shared printer that can accept PPA input from both networked Windows Clients, and from networked non-Windows Clients that use pnm2ppa. o IMPORTANT!: A PPA printer attached to a Windows Host shared with a Client running pnm2ppa has the following limitation: o Bi-Directional communication between the Windows Host and the printer must be disabled. If it is not done, a General Protection Fault will usually occur on the Windows Host when pnm2ppa sends output to the shared printer. (A "Hpfbkg06" error occurs, and the printer becomes nonfunctional until the Windows system is rebooted.) Disabling bi-directional communication appears to be a minor inconvenience: according to HP, the print quality is unaffected, but the "advanced features of the Status Monitor" will no longer send reminders to align the print cartridges after a new cartridge is installed, or send error mes- sages associated with the ink cartridges or the banner lever. You may be able to avoid disabling bi-directional communication by using an emulated Postscript printer to serve non-Windows Clients without using pnm2ppa (see below). To turn off bi-directional communication between the Windows Host and the printer, open the Settings/Printers folder, then right-click on the printer icon, and open the Properties dialog. Select the Details tab, and click on Spool Settings, then choose the setting "Disable bi- directional support for this printer". If you have any difficulties, try rebooting Windows after the change, or see HP's support document http://www.hp.com/cposupport/printers/support_doc/bpd06455.html about disabling bi-directional communication. To set up the Host to share the printer, right-click on its icon in the Settings/Printers folder, and select Sharing, then assign it a Share Name like HP722C-PPA , and enter a Comment Line like "HP 722C printer on Windows 98 (PPA input)". You may now also wish to set up an emulated Postscript printer that accepts Postscript input from the Client, and prints it using HP's PPA drivers running on the Host, instead of on the Client. See the section Emulating a PostScript printer on a Windows Host If you have installed and successfully tested the emulated printer, set it up for sharing on the network. Right-click on its icon in the Settings/Printers folder, and select Sharing, then assign it a Share Name like HP722C-PS, and enter a Comment Line like "HP 722C printer on Windows 98 (PostScript input)". The emulated printer will appear like a Postscript printer to the Clients. If it provides acceptable printing services to the non- Windows clients, you will not need to connect pnm2ppa printers to HP722C-PPA, and will be able to re-enable bi-directional communication between the HP drivers and the printer. (However, the extra processing involved in the emulation may be unacceptably slow, or turn out to use too much of the host's CPU) 3. Configuring the Printing Clients. 3.1. Setting up Printing from a Windows Client. Open the Settings/Printers folder, and start the Add Printer Wizard. Choose to add a Network Printer, and browse the network to find the Printer Shares you configured on the host (e.g., HP722C-PPA and HP722C-PS). If they are not visible, either the Host or the network is not properly configured. Correct the problem before proceding. Normally, you will probably want to use the native Windows HP PPA drivers, so select the printer Share that accepts PPA input (e.g., HP722C-PPA). If the Host is a Windows Host, it will provide the drivers over the network, otherwise you will have to find the printer in the list of available HP Printer drivers, or click on Have Disk and install them from HP's installation CD. You then get a chance to change the name with which the printer will be known on the Client. Finally, you should choose to print a test page. You might instead (or also) want to set up printing services using the Printer Share that accepts Postscript (e.g., HP722C-PS). In that case, if the Host is not a Windows Host, choose a "generic" PostScript printer like the Apple LaserWriter II NT or the Digital turboPrintServer 20/Net. If the test page prints sucessfully, you are finished! 3.2. Setting up Printing from a Linux/Unix Samba Client First examine the network by opening a terminal window and using the command smbclient -L hostname (where "hostname" should be replaced by the network name of the Host to which the printer is attached). This will list the SMB services provided by that Host. (Alternatively, your system may have some graphical front-end to smbclient that allows you to inspect the net- work.) The list should include the Printer Share(s) you configured on the Host (e.g., HP722C-PPA and HP722C-PS). If these are absent, you must first identify and correct the problem. You must now configure the printer. The details of how to do this will vary between Linux/Unix distributions, but there will probably be support for network printing using Samba. If the Printer Share you wish to use is intended to accept PPA input (e.g., HP722C-PPA), configure the Client to use the pnm2ppa driver. If it is intended to accept PostScript input (e.g., HP722C-PS), configure the Client to print to a PostScript printer. You may wish to configure both types of printers, and experiment to see which provides the best printing services on your network. See the SMB-HOWTO documentation for more information. 4. Emulating a PostScript printer on a Windows Host. If you do not have commercial PostScript emulation software for Windows that will work with your HP PPA DeskJet (the author is unaware of any such software that supports PPA printers), you can use Ghostscript together with HP's native Windows drivers. 4.1. Installing Ghostscript as the emulation software. From the Ghostscript home page http://www.cs.wisc.edu/~ghost/ download and install (in this order) the Windows packages of o Ghostscript (PostScript Emulation Software). o GSview (Ghostscript previewer, provides gsprint). o RedMon (printer port redirection utility). (Install these using their setup.exe installation tools, and do not manually set up any configuration files for gsprint or RedMon.) You must now follow the detailed instructions below, and use the Windows "Add Printer Wizard" to add a postscript printer, and then configure it to use the gsprint utility that comes with GSview, and redirect the output to your HP PPA DeskJet using the RedMon utility. 4.2. Adding the fictitious Postscript printer. In the following, I assume your printer is a HP DeskJet 722C, and is installed with its native Windows Drivers as a printer called "HP DeskJet 720C Series". Change printer name entries below as appropriate for your printer model. The following instructions are tested on Windows 98, and may differ on other Windows variants. Open the Settings/Printers folder. First check that the HP PPA Deskjet is correctly installed, using HP's native Windows drivers. Right-click on its icon, and select its Properties dialog. The General Properties screen will open. This shows the exact name that the printer was given when it was installed. Make a note of it, and use the Print Test Page button to confirm that the printer is working. (The "Printer name:" line on the test page will also show the exact name of the HP PPA Deskjet that you will need to use when configuring the emulated postscript printer below). When you are done, click on OK to close the dialog. Now start the Add Printer "Wizard". Make the choices: o install a local printer o select a PostScript printer from the list of printers; (e.g., one of the Apple LaserWriter models: the Laserwriter II NT is known to work; Digital PrintServer models such as the turboPrintServer 20/Net have also been recommended). This will provide a suitable postscript driver. o From the list of Available Ports, choose "FILE: Creates a file on disk" (you will change this after the printer is installed) o set as default printer?: NO o Print test page?: NO 4.3. Redirecting the output to the PPA printer. After the printer has been installed, right-click on its icon, and rename it to something like, e.g., "Ghostscript+HP722C". Then right click again and open its Properties dialog. On the General tab screen, enter something informative in the Comment box, such as " Emulated Postscript printer; output redirected to a HP722C DeskJet printer" (optional). Next select the Details tab. The box "Print using the following driver:" should show the Postscript driver you selected (e.g., Apple LaserWriter II NT). o Click on Add Port. Select other, then Redirected Port, which should be available if RedMon was correctly installed, and click on OK to accept these settings and close the Add Port dialog. On the Details tab screen, The box "Print to the following port:" should now show a redirected port such as "RPT1 [Redirected Port]". o Click on Port Settings. o In the box "Redirect port to the program:", enter the path to the gsprint program. (If you accepted the defaults when installing it, this may be C:\Ghostgum\gsview\gsprint.exe; you may search for it by clicking on Browse). o In the box "arguments for this program are:" enter the arguments to be passed to the gsprint program (there is a document gsprint.htm with more details of these in the folder containing gsprint.exe). Suggested arguments are: -printer "HP DeskJet 720C Series" -color - Replace "HP DeskJet 720C Series" by the (quoted) exact name of the HP PPA DeskJet printer that you made a note of earlier. (If you do not copy this name exactly, including any capitalization or spaces, things may not work!) The -color argument is needed to enable color printing; (Whether you actually get color printing will depend on the local settings of the "HP DeskJet 720C Series" printer that really prints the document.) The final " - " is required: without it, the output of gsprint will not get redi- rected to the printer. o The box "Output" should show "Program handles output". o In the box "Run", select "hidden". o The box "Shutdown delay" will say "300 seconds". Print jobs for which processing by gsprint takes longer than this will be terminated, to avoid blocking the printer spool queue. Increase this limit if necessary. Now click on OK to close the Port Settings dialog. o Click on Spool Settings, and select "Disable bi-directional support for this printer", and click OK. Finally, again select the General tab, and test the installation by clicking on "Print a test page". If it works, you are finished setting up Postscript emulation. Click OK to exit the Printer Properties dialog. (If you have problems, first check that you made the correct entries in the Printer Properties dialogs, especially check that you did not make any typing errors in the exact name for the PPA DeskJet printer in the gsprint arguments box, which must correspond exactly to the "Printer name" given to the HP PPA printer). If the problems persist, you might get guidance from the gsprint and RedMon documentation; look in the folders where these were installed.) You now have a working emulated "Postscript printer" that can now be shared over a network. (The "sharing" options will now be available if you right-click on the emulated printer's icon.) 4.4. Limitations. This emulated postscript printer is most useful for providing printing services to non-Windows Clients on a samba network, but can be also be used by Windows Clients with the following limitations: o Windows Clients will be able to select Print Settings only for the visible ("front end") "Postscript printer", but not for the hidden ("back end") HP PPA DeskJet printer that actually does the printing. o Changes in the local Print Settings of the PPA driver for the DeskJet printer on the Host system (but not on Client systems, if it too is shared) will affect network printing by the "Postscript printer". o Since the visible "Postscript printer" falsely advertises its identity, some of its Print Settings options seen by users on the Clients may not be valid. o The extra processing on the printer Host may make printing rather slow compared to native Windows printing. pnm2ppa-1.13/docs/en/README0000644000076400007640000000312607432061647012171 00000000000000PPM to PPA converter -------------------- Copyright (c) 1998-2000 Tim Norman, Giorgio Marzano, Andrew van der Stock, and others. All trademarks referenced are the property of their respective owners. You use this software at your own risk. Although damage to your computer or printer is unlikely, it is possible, and by using this software you agree not to hold the authors responsible for any such damage. License ------- This software is being released under the GNU General Public License. Please see the file LICENSE for details. We provide it free to all who want it. What is this? ------------- This software creates output using the PPA (printer performance architecture) protocol. This protocol is used by some HP "Windows-only" printers, including the HP Deskjet 720C series, the HP DeskJet 820 series, and the HP DeskJet 1000 series. It has been tested on all three series, but your personal experience (positive or negative) is very much appreciated! Installing ---------- Read the INSTALL file to compile and install this software. More Info --------- For full information on the PPA protocol and this software, visit http://pnm2ppa.sourceforge.net, and the SourceForge site http://sourceforge.net/projects/pnm2ppa Contact Info ------------ If you need help using this software, you can send a message to the pnm2ppa-users@lists.sourceforge.net mailing list, or post your concerns on one of the SourceForge forums. Subscribe to the mailing lists at http://sourceforge.net/projects/pnm2ppa (Note the old pnm2ppa mailing lists which used the ListBot service died with that service!) pnm2ppa-1.13/docs/en/RELEASE-NOTES0000644000076400007640000001056607547621677013224 00000000000000Release notes for pnm2ppa-1.11 October 2002 - pnm2ppa-1.10 had problems with HP820C printers. Hopefully, these are fixed. - Also fixed: a memory leak affected all printer models in certain circumstances: in high quality mode, if the last data on a page was in color, the final three print head passes were not printed, and the data was left in unfreed memory. (discovered using the "valgrind" memory-leak detector). - compression of color data sent to the printer is now enabled. (only compression of black data was previously enabled). If it is suspected this is causing problems, it can be disabled by a new configuration file keyword "compression 0". - Logging of normal informational messages to the system log is now turned off by default. (They still go to stderr in "verbose" mode). Logging of information messages in the System Log can be re-enabled with a new configuration-file entry "log_info 1": this is only accepted from the default configuration file (/etc/pnm2ppa.conf). -------------------------------------------- Release notes for pnm2ppa-1.10 June 23 2002 - major rework of swath-cutting internals so black ink is never overprinted by color ink, and multipass color printing is bidirectional. Only tested on HP722C. Should have much better image quality now, we will have to see if the redesign has broken printing on HP820C, 1000C... Is anyone still using these PPA printers? - new: a --dpi300 command line option for interpreting the input as 300dpi instead of 600dpi. This may be useful for printing 300dpi pnm output directly from scanners. ----------------------------------------------------- Release notes for pnm2ppa-1.04 November 12 2000 - reduced memory footprint of calibrate_ppa from 36MB to 1.8MB - fix bug in black shearing test pattern in calibrate_ppa - fix bug in silent/vebose switches for error messages. - repair the earlier 1.01 HP820 flashing light bug fix that got broken by the 600 dot yoffset shift in 1.03... -------------------------------------------- Release Notes for pnm2ppa-1.02. 1.03 October 28 2000 - improved calibrate_ppa output, made configuration easier - change default offsets, etc. (add 600 to yoffset) - added an automated lpd setup . -------------------------------------------------- Release Notes for pnm2ppa-1.01 October 24, 2000 Fixed one more cause of "flashing light syndrome" on the HP820C. Other changes: Improved and functional calibration program, now called calibrate_ppa, incorporating Bruno Alix's calibration pages from calibrateco.c Moved the creation of "gamma.ppm" for color calibration from pnm2ppa to calibrate_ppa. All user input and syslog output was audited for security. No incorrect user input is now echoed to the syslog; syslog messages can be silenced with a new keyword "silent 1" in /etc/pnm2ppa.conf. File paths entered as user input are now handled carefully. Gamma color enhancement values can now be given as decimals in the configuration file. The various inks can be switched off in the configuration file (as an aid in troubleshooting). Release Notes for pnm2ppa-1.0 July 11, 2000 --------------------------------------------- This release is the 1.0 release of pnm2ppa. It is fully functional on all three PPA printer families, and has no known bugs. (Is "Flashing LED syndrome a thing of the past?) It can now handle all paper sizes compatible with the printer, and all pnm formats. The documentation is updated. ---- Remaining issues such as somewhat-visible horizontal swath boundaries on uniform dithered color backgrounds (such as in the ghostscript example tiger.ps) cannot be resolved without major design changes, but this should not affect most uses of pnm2ppa. (see the TODO file). Such changes will require significant effort (by someone highly motivated) to be achieved. pnm2ppa is probably as good as it can get by tweaking its code with little bug fixes. [FIXED IN v1.10] Improvements in color correction techniques could still be achieved, though (see docs/en/COLOR.txt). Calibration and printer utility procedures (head cleaning codes, etc) could also be added. (perhaps using the PUP utility?) [NOW USE calibrate_ppa FOR SOME OF THESE FUNCTIONS] Use of data compression of sweep data for color sweeps could also be added without a major rewite, to perhaps speed up printing. [FIXED IN v1.11] The pnm2ppa team. http://sourceforge.net/projects/pnm2ppa pnm2ppa-1.13/docs/en/TODO0000644000076400007640000000445507501053374012002 00000000000000TODO UPDATE (June 10, 2002) * Striping in images like ghostscript' example image "tiger.ps' has been eliminated by just making sure that black ink is never overprinted by color ink. A major reworking to cutswath.c and some improvements to image.c were needed. This is probably the final work done on this driver.. -------------------------------- Code issues (comments by duncan): * implement data compression for color as well as black and white printing. * check out the new information about the buffer on the printer. (mentioned on ppa.devel by andrew in early 2000) * cleaning head codes needed. (or put them into PUP); document the codes in the ppa docs here. * should multiple color sweeps in a swath (gMaxpass=4) alternate between right-to-left and left-to-right ? * The Windows driver also has a "normal" mode with gMaxPass=2, and well as "econofast" (gMaxPass=1) and high quality (gMaxPass=4). It alternates color passes in one direction with black passes in the other direction, at the same vertical position. If this structure is adopted, maybe the way the 600dpi resolution of black if reduced to 300dpi resolution in dither.c should be rethought. (Why not keep 600dpi black resolution ?). * A FS_black_dither routine is needed in black-only printing, for high-quality black-only images. * add autodetection of device via IEEE 1284 and other methods * redo debugging support (done ajv) * add extra .conf parameters to avoid recompiles (done: ajv & giorgio) * getopt() rather than current handling (done: ajv 19991003) Distribution and Installation issues * *BSD compatibility (partially there: ajv 19991021) * update README and all doco * update installation instructions for major distributions (caldera, RH, etc) * Translate man page into other languages * add autoconf support ? (NetBSD and alpha issues) * update CREDITS * Make install target (done: ajv) * make syslog configurable; stdout or syslog (done: ajv 19991021) CALIBRATION * CALIBRATE doco, and supporting .ps file to generate page Long Term wants * write instructions on how to speed up parallel port (Linux 2.2.x and later) * write hppaconf (KDE)? * gs native filter rather than take pnm/pbm/ppm files * scpd to monitor printer status, and provide support for console alerts (These are dumb printers, so ...) pnm2ppa-1.13/docs/pl/0000777000076400007640000000000011313235642011373 500000000000000pnm2ppa-1.13/docs/pl/CZYTAJ.TO0000644000076400007640000000215107051417471012564 00000000000000PPM -> PPA konwerter -------------------- XXX Prosimy o pomoc w pracy nad tym programem ni¿ o raporty o b³êdach w nim... XXX Copyright (c) 1998-1999 Tim Norman, Giorgio Marzano, Andrew van der Stock and others Licenja ------- Ten program podlega prawom wg. licencji GNU General Public License. Przeczytaj plik LICENSE aby dowiedzieæ siê wiêcej szczegó³ów. CO TO TAKIEGO? -------------- Ten program obs³uguje protokó³ zwany PPA (Printer performance architecture). Protokó³ ten jest wykorzystywany w Win-drukarkach HP DeskJet (720,820,1000,710) By³ testowany na wszystkich powy¿szych jednak ka¿da uwaga co do pracy na nowym modelu jest mile widziana. INSTALACJA ---------- Wszystkie informacje zawarte s± w pliku INSTALACJA INFORMACJE DODATKOWE -------------------- Szczegó³owe informacje nt. protoko³u PPA oraz tego programu uzyskasz na naszej stronie: http://www.httptech.com/ppa/ KONTAKT ------- Je¶li ten program jest dla Ciebie u¿yteczny, PROSIMY o kontakt!!! Chcemy wiedzieæ jak wiele osób korzysta z naszej pracy. Kontakt email: tim@normsoft.com (T³umaczenie Tomasz Patora pnm2ppa-1.13/docs/pl/AUTORZY0000644000076400007640000000100207051417471012406 00000000000000 Ten projekt nie móg³ by powstaæ bez udzia³u tych osób: Andrew van der Stock - wizjoner i g³owna osoba odpowiedzialna za rozbudowê kodu. Ben Boule - pierwsza osoba, która pomog³a mi uzyskaæ informacjê o drukarce z serii 720 oraz testowa³a program na tym sprzêcie. Giorgio Marzano - go¶æ od poprawiania b³êdów od maja 1999. Jim Peterson - spêdzi³ mnóstwo godzin modyfikuj±c kod dla 720-tek i twórca wielu usprawnieñ w³±czaj±c w to konfiguracjê. Kirk Reiten - testowanie programu na drukarkach z serii 1000. pnm2ppa-1.13/docs/pl/INSTALACJA0000644000076400007640000000365607130662526012664 00000000000000CO TO JEST ---------- W tym pliku znajduje siê krótka nota dotycz±ca instalacji. Je¶li informacje zawarte w tym tek¶cie oka¿± siê niewystarczaj±ce wiêcej informacji uzyskasz z pliku INSTALACJA-DOKLADNA. Kompilacja ---------- Aby stworzyæ program wystarczy napisaæ: make Je¶li u¿ywasz NetBSD lub FreeBSD musisz dokonaæ zmian w pliku Makefile (aby do³±cz±³ dodatkow± bibliotekê "libgnugetopt", która jest wymagana przez program pnm2ppa). INSTALACJA ---------- Tworzy dwa pliki wykonywalne: calibrate i pnm2ppa. Calibrate - tego programu u¿ywaj do ustawienia marginesów. Wiêcej szczegó³ów znajduje siê w pliku KALIBRACJA Drugim programem jest pnm2ppa. Jest to konwerter formatu PBM na PPA. PBM jest to surowa postaæ pliku w którym zawarte s± informacje gdzie i w jakim kolorze wydrukowaæ punkt. (podstawowym programem u¿ywanym do generowania tego rodzaju plików jest GhostScript) PPA jest to natomiast protokó³ transmisji miêdzy komputerem a Win-drukark±. Standartowym rozmiarem drukowania jest 600dpi oraz rozmiar papieru US Letter. Dodatkowo program pnm2ppa rozumie formaty pbm, pbmraw, pnm, pnmraw. Ten ostatni jest najszybszy, wiêc je¶li masz mo¿liwo¶æ u¿ywaj go. U¿ywanie -------- Aby wydrukowaæ stronê postscript przy u¿yciu tego programu zosta³y stworzone skrypty. Wydruk o najlepszej jako¶ci w kolorze w rozmiarze US Letter cat $1 | gs -sDEVICE=ppmraw -q -dNOPAUSE -r600 -sOutputFile=- - | \ pnm2ppa -i - -o - | lpr w rozmiarze US Legal cat $1 | gs -sDEVICE=ppmraw -q -dNOPAUSE -r600 -sOutputFile=- - | \ pnm2ppa -i - -o - | lpr w rozmiarze A4 cat $1 | gs -sPAPERSIZE=a4 -sDEVICE=ppmraw -q -dNOPAUSE -r600 -sOutputFile=- - | \ pnm2ppa -i - -o - | lpr itd... W szczególno¶ci powinno takie rzeczy ustawiæ siê w filtrze programu drukarki (np.:lpd). Wiêcej informacji, jak to zrobiæ dowiesz siê z dokumentacji u¿ywanego filtru lub przeczytaj plik INSTALACJA.SUSE z którego dowiesz siê jak ustawiæ filtr lpd dla tekstu i plików postscript. pnm2ppa-1.13/docs/pl/INSTALACJA.SUSE0000644000076400007640000001115607051417471013433 000000000000000. Informacje Ten tekst opisuje, jak zainstalowaæ program pbm2ppa napisany przez Tima Normana w systemie S.u.S.E Linux System. Ten program wykorzystuje GDI (dla Windofsow) daj±c mo¿liwo¶æ korzystania z drukarki w systemie Linux. Aktualnie program jest konwerterem pomiêdzy formatem PBM (np. tworzonego przez GhostScript) a formatem PPA zjadliwym dla win-drukarek z serii 710/720, 820 i 1000. Do druku najwygodniej jest u¿ywaæ GhostScripta, któremu zlecamy zrobienie pliku pbmraw (mo¿e te¿ byæ pbm, ale za to wolniej bêdzie siê to drukowaæ). Z drukowaniem samego tekstu jest roboty. Z racji tego, ¿e drukarka go nie zrozumie musimy zamieniæ tekst na format postscript i zrobiæ jak napisa³em akapit wy¿ej. Zamiany tekstu ascii na postscript wykonuje program enscript. Nie jest to proste ale nie panikuj. Autor dla wygody stworzy³ dwie drukarki w spoolers (nie bêdê siê mêczy³ aby to przet³umaczyæ...), jedn± dla plików ps, drug± dla plików ascii. Instalacja tego ustrojstwa to tylko 7 kroków. 1. Instalacja pakietu ppa-0.8.5 Pobierz pakiet ze strony http://www.rpi.edu/~normat/technical/ppa/ i sk±piluj wpisuj±c: # make XXX (gdzie XXX to numer twojej win-drukarki, czyli 720,820 lub 1000. Je¶li masz drukarkê z serii 710 to u¿yj opcji dla 720-stki. U mnie dzia³a...) 2. Ustaw papier na A4 u¿ywaj±c opcji -s A4 w programie pbm2ppa lub w pliku pbm2ppa.conf wpisz "papersize a4" (patrz te¿ pkt.5) 3. Kalibracja. Dla rozmiaru US wpisz # pbmtpg | pbm2ppa > /dev/lp1 ( jako root ) Dla rozmiaru A4 wpisz # pbmtpg -a4 | pbm2ppa -s a4 > /dev/lp1 ( jako root ) 4. Teraz mo¿esz drukowaæ pliki postscript u¿ywaj±c nastêpuj±cego pliku shella: cat $1 | gs -sDEVICE=pbmraw -q -dNOPAUSE -r600 -sOutputFile=- - | \ pbm2ppa - - >/dev/lp0 Je¶li zapiszesz to w pliku "print" (po oczywistej zmianie - chmod 755 print) mo¿esz ju¿ drukowaæ pliki ps wpisuj±c # print nazwapliku.ps Je¶li zale¿y Ci na drukowaniu plików ascii to przepisz ten skrypt: enscript -2rj -p- $1 | \ gs -sDEVICE=pbmraw -q -dNOPAUSE -r600 -sOutputFile=- - | \ pbm2ppa - - >/dev/lp1 Je¶li zapiszesz to w pliku "printascii" (po oczywistej zmianie - chmod 755 print) mo¿esz ju¿ drukowaæ tekst wpisuj±c: # printascii nazwapliku.ascii (Uwaga: Parametry w tym skrypcie dla enscript s± ustawione na drukowanie tekstu w dwóch kolumnach. Wiêcej informacji dotycz±cych konwersji ascii->ps przeczytasz w instrukcji programu enscript.) 5. Mo¿liwe, ¿e powiniene¶ przekalibrowaæ swoj± drukarkê (patrz pkt.3) Oto instrukcje w jaki sposób ustawiæ drukarkê aby poprawnie drukowa³± pliki ascii przy u¿yciu skryptu printascii (patrz pkt.4) Program pbm2ppa pobiera argumenty w podanej kolejno¶ci: a) z lini poleceñ b) z pliku konfiguracyjnego /etc/pbm2ppa.conf c) z ustawieñ w pliku nag³ówkowym "default.h" Najwygodniejszym rozwi±zaniem jest odpowiednia zmiana pliku konfiguracyjnego. Oto przyk³ad jak to zrobiæ (/etc/pbm2ppa.conf): # Przyk³adowa konfiguracyjna dla HP720 i papieru A4 # version 720 papersize a4 xoff 0 # \ Ustaw to dla swojej drukarki. yoff -600 # / (patrz plik KALIBRACJA) # 1/4 cala marginesu z ka¿dej strony (dla 600 DPI) # mo¿esz wpisaæ swoje warto¶ci... top 50 bottom 50 left 50 right 50 6. Aby zescaliæ konwerter z systemem Linux tworzymy dwie drukarki w pliku /etc/printcap. Jedna z nich obs³uguje postscript, druga pliki ascii. Oto co wpisaæ do pliku /etc/printcap: lp:\ :lp=/dev/lp1:\ :sd=/var/spool/lpd/lp:\ :lf=/var/spool/lpd/lp/log:\ :af=/var/spool/lpd/lp/acct:\ :if=/usr/local/bin/ps.if:\ :la:mx#0:\ :sh:sf: ascii:\ :lp=/dev/lp1:\ :sd=/var/spool/lpd/ascii:\ :lf=/var/spool/lpd/ascii/log:\ :af=/var/spool/lpd/ascii/acct:\ :if=/usr/local/bin/ascii.if:\ :la:mx#0:\ :sh:sf: Teraz trochê wyja¶nieñ. U¿ywamy standartowo portu /dev/lp1. Wykorzystujemy równie¿ katalogi /var/spool/lpd/ascii oraz /var/spool/lpd/lp (najlepiej stwórz je teraz). Aby po³±czyæ konwerter pbm2ppa z systemem stworzyli¶my dwa filtry. Aby zaczê³o to dzia³aæ nale¿y jeszcze stworzyæ dwa pliki: Plik /usr/local/bin/ascii.if: #! /bin/sh enscript -2rj -p- | \ gs -sDEVICE=pbmraw -q -dNOPAUSE -r600 -sOutputFile=- - | \ /usr/local/bin/pbm2ppa - - Plik /usr/local/bin/ps.if: #! /bin/sh gs -sDEVICE=pbmraw -q -dNOPAUSE -r600 -sOutputFile=- - | \ /usr/local/bin/pbm2ppa - - 7. Przekopiowaæ program pbm2ppa do /usr/local/bin. Teraz aby wydrukowaæ plik wpisz: # lpr nazwapliku.ps lub # lpr -P ascii nazwapliku.ascii I to na tyle. 19. May 1998 Michael Buehlmann Badenerstrasse 285 8003 Zuerich Switzerland mbuehlma@stud.ee.ethz.ch T³umaczenie Tomasz Patora pnm2ppa-1.13/docs/pl/KALIBRACJA0000644000076400007640000000325107051417471012624 00000000000000XXX XXX Uwaga, Uwaga: Tak naprawdê, to mo¿e nie dzia³aæ... XXX Spróbuj sam, mo¿e Tobie siê uda... XXX Kalibracja (ustawianie) pnm2ppa dla Twojej drukarki Zanim zaczniesz drukowanie powiniene¶ skalibrowaæ drukarkê. Mo¿na to zrobiæ u¿ywaj±c programu 'calibrate'. Proces ustawiania polega na wydrukowaniu strony testowej o maksymalnym rozmiarze. Ca³a zabawa polega na takich ustawieniach marginesu w pliku konfiguracyjnym, aby ca³a strona by³a wydrukowana w ca³o¶ci. Program 'calibrate' jest prosty jak drut. Wyrzuca na wyj¶cie wzór testowy w formacie pbmraw. Gdy skierujemy to co wypluje 'calibrate' do programu pnm2ppa przy u¿yciu komendy: calibrate | pnm2ppa > /dev/lp1 ( jako ) - lub - calibrate | pnm2ppa | lpr -l ( je¶li Twoj filtr drukarki rozpoznaje parametr '-l') Wydrukowana strona powinna zawieraæ siatkê oraz liczby okre¶laj±ce wspó³rzêdne pikseli. Na nieszczê¶cie pierwsze wydruki obcinaj± wydrukowan± stronê przy brzegach strony. Je¶li tak siê dzieje powiniene¶ ustaliæ marginesy w pliku konfiguracyjnym /etc/pnm2ppa.conf. Podane tam warto¶ci podane s± w jednostkach punktów na cal. Czyli je¶li podamy tam warto¶æ np. 100, bêdzie to 100/600 cala (rozdzielczo¶æ druku 600dpi) czyli 1/6cala. Je¶li szczê¶liwie uda Ci siê znale¼æ odpowiednie warto¶ci to mo¿esz je wpisaæ na trzy sposoby: [1]do pliku konfiguracyjnego, [2] do pliku "global.h" i przekompilowaæ ca³y program, [3] u¿ywaj±c parametrów '-x', '-y' przy uruchamianiu programu. (osobi¶cie polecam rozwi±zanie [2]). Je¶li wszystko jest odpowiednio ustawione to wydruk testowy powinien byæ na ¶rodku kartki. Marginesy prawdopodobnie powinny byæ nie wiêksze ni¿ 1/4 cala bez efektu 'ucinania strony'. pnm2ppa-1.13/docs/pl/text-pl.h0000644000076400007640000000323007051417471013061 00000000000000/*************************************************************************** text-pl.h - polskie komunikaty ------------------- begin : Thu Jan 21 2000 copyright : (C) 2000 by Tomasz Patora email : ajv@greebo.net ***************************************************************************/ /*************************************************************************** * * * 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. * * * ***************************************************************************/ // messages from cutswath.c /* 00 */ "cutswath(): nie mogê zaalokowaæ danych\n", /* 01 */ "cutswath(): nie mogê przeczytaæ danych o górnym marginesie\n", /* 02 */ "cutswath(): nie mogê przeczytaæ danych o bocznym marginesie\n", /* 03 */ "cutswath(): nie mogê przeczytaæ nastêpnej lini\n", /* 04 */ "cutswath(): nie mogê zaalokowaæ danych ppa\n", /* 05 */ "ppa_print_page(): b³±d w wywo³aniu procedury cut_im_black_swath()\n", /* 06 */ "ppa_print_page(): nieznany kod powrotu w switch\n", /* 07 */ "ppa_print_page(): b³±d w wywo³aniu cut_im_color_swath()\n", /* 08 */ "make_im_stat: nie mogê otczytaæ pliku gamma. Sprawdz uprawnienia dla pliku\n", "FATALNIE: Nieznany b³±d\n" pnm2ppa-1.13/README0000644000076400007640000000006507132525137010632 00000000000000English Please read the README in ./docs/en/README pnm2ppa-1.13/configure.ac0000644000076400007640000001034011313234742012230 00000000000000AC_PREREQ(2.59) AC_INIT([pnm2ppa], 1.13, [pnm2ppa-users@lists.sourceforge.net]) AC_CONFIG_HEADERS([config.h]) AC_CONFIG_SRCDIR([ppa.c]) AC_CANONICAL_BUILD AC_CANONICAL_HOST AM_MAINTAINER_MODE AM_INIT_AUTOMAKE([foreign no-exeext dist-bzip2]) CFLAGS="${CFLAGS} -Wall -Wsign-compare -Wfloat-equal -Wformat-security -g" # Checks for programs. AC_PROG_CC AC_MSG_CHECKING([if cross compiling]) if test "x$cross_compiling" = "xno"; then CC_FOR_BUILD=${CC_FOR_BUILD-${CC-gcc}} AC_MSG_RESULT([no]) else CC_FOR_BUILD=${CC_FOR_BUILD-gcc} AC_MSG_RESULT([yes]) fi AC_SUBST(CC_FOR_BUILD) # # do we need libm for 'sqrt' and 'pow'? # AC_SEARCH_LIBS(sqrt, m) AC_SEARCH_LIBS(pow, m) # # other things we rely on # AC_CHECK_FUNCS([memmove] [memset] [strcasecmp] [strchr] [strdup]) AC_CHECK_HEADERS([sys/param.h]) AC_C_INLINE AC_FUNC_MALLOC AC_HEADER_STDBOOL AC_TYPE_SIZE_T # # Some systems need a special library for 'getopt_long' # (for example MacOS and FreeBSD). # AC_SEARCH_LIBS(getopt_long, [gnugetopt iberty]) # # check if the syslog feature is present # On some systems other than the libc is required to use this feature # AC_SEARCH_LIBS(syslog, [bsd socket inet]) # do we have a syslog feature? if test "${ac_cv_search_syslog}" = "no"; then # disable its usage AC_DEFINE(__NO_SYSLOG__, 1, [no syslog]) else # # okay, 'syslog' is present. But should we use it? # AC_MSG_CHECKING([whether to enable syslog]) AC_ARG_ENABLE(syslog, AS_HELP_STRING([--enable-syslog], [enable syslog @<:@default=yes@:>@]), [case "$enableval" in y | yes) CONFIG_SYSLOG=yes ;; *) CONFIG_SYSLOG=no ;; esac], [CONFIG_SYSLOG=yes]) AC_MSG_RESULT([${CONFIG_SYSLOG}]) if test "${CONFIG_SYSLOG}" = "yes"; then AC_DEFINE(USE_SYSLOG, 1 , [use the syslog feature]) else AC_DEFINE(__NO_SYSLOG__, 1, [no syslog]) fi fi # # Some things have to be done in accordance to the operating system # AC_MSG_CHECKING([operating system]) case $host in *-linux*) AC_MSG_RESULT([Linux]) ;; *-solaris*) AC_MSG_RESULT([SOLARIS]) AC_DEFINE(__NO_LOG_PERROR__, [], [absent]) ;; *-BeOS*) AC_MSG_RESULT([BeOS]) # On BeOS the LDFLAGS should not be used. AM_LDFLAGS="" ;; *-darwin*) AC_MSG_RESULT([Darwin/MacOS X]) CFLAGS="${CFLAGS} -no-cpp-precomp -traditional-cpp" ;; *-bsd*) AC_MSG_RESULT([FreeBSD]) ;; *) AC_MSG_RESULT([unsupported operating system, pnm2ppa may fail]) esac # # Debugging # AC_MSG_CHECKING([whether to enable debugging]) AC_ARG_ENABLE(debug, AS_HELP_STRING([--enable-debug], [enable debugging @<:@default=no@:>@]), [case "$enableval" in y | yes) CONFIG_DEBUG=yes ;; *) CONFIG_DEBUG=no ;; esac], [CONFIG_DEBUG=no]) AC_MSG_RESULT([${CONFIG_DEBUG}]) if test "${CONFIG_DEBUG}" = "yes"; then AC_DEFINE(DEBUG, 1, [debugging]) AM_CONDITIONAL(PNM2PPA_DEBUG, [true]) CFLAGS="${CFLAGS} -O1" else CFLAGS="${CFLAGS} -O2 -DNDEBUG" AM_CONDITIONAL(PNM2PPA_DEBUG, [false]) fi # # define the compiled in language # AC_MSG_CHECKING([which language is to be used]) AC_ARG_WITH([language], AS_HELP_STRING([--with-language=EN | CZ | ES | FR | IT | NL], [Compiled in language]), [ppa_language="$withval"]) # english language is the default if test -z "${ppa_language}"; then # default is english ppa_language=EN fi case "${ppa_language}" in EN | en) AC_DEFINE(LANG_EN, [], [english]) used_language="english" ;; CZ | en) AC_DEFINE(LANG_CZ, [], [cech]) used_language="cech" ;; ES | es) AC_DEFINE(LANG_ES, [], [espanol]) used_language="espanol" ;; FR | fr) AC_DEFINE(LANG_FR, [], [french]) used_language="french" ;; IT | it) AC_DEFINE(LANG_IT, [], [italian]) used_language="italian" ;; NL | nl) AC_DEFINE(LANG_NL, [], [dutch]) used_language="dutch" ;; *) AC_MSG_ERROR([Unsupported language]) ;; esac AC_MSG_RESULT([${used_language}]) AC_MSG_CHECKING([whether to build the 'parse_vlink' tool]) AC_ARG_ENABLE(vlink, AS_HELP_STRING([--enable-vlink], [enable building parse_vlink @<:@default=no@:>@]), [case "$enableval" in y | yes) CONFIG_VLINK=yes ;; *) CONFIG_VLINK=no ;; esac], [CONFIG_VLINK=no]) AC_MSG_RESULT([${CONFIG_VLINK}]) if test "${CONFIG_VLINK}" = "yes"; then AM_CONDITIONAL(BUILD_PARSE_VLINK, [true]) else AM_CONDITIONAL(BUILD_PARSE_VLINK, [false]) fi AC_CONFIG_FILES( [Makefile] [ppa_protocol/Makefile] ) AC_OUTPUT pnm2ppa-1.13/aclocal.m40000644000076400007640000010012511313235712011601 00000000000000# generated automatically by aclocal 1.10 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006 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 distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_if(m4_PACKAGE_VERSION, [2.62],, [m4_fatal([this file was generated for autoconf 2.62. You have another version of autoconf. If you want to use that, you should regenerate the build system entirely.], [63])]) # Copyright (C) 2002, 2003, 2005, 2006 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) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.10' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.10], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AC_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.10])dnl _AM_AUTOCONF_VERSION(m4_PACKAGE_VERSION)]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # 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 # `$srcdir', `$srcdir/..', or `$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is `.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006 # 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 8 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 # 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 9 # 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, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "GCJ", or "OBJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl ifelse([$1], CC, [depcc="$CC" am_compiler_list=], [$1], CXX, [depcc="$CXX" am_compiler_list=], [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], UPC, [depcc="$UPC" am_compiler_list=], [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking, [ --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # 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 3 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [for mf in $CONFIG_FILES; do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each `.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006 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 12 # 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]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.60])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) AM_PROG_INSTALL_SH AM_PROG_INSTALL_STRIP AC_REQUIRE([AM_PROG_MKDIR_P])dnl # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES(CC)], [define([AC_PROG_CC], defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES(OBJC)], [define([AC_PROG_OBJC], defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl ]) ]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $1 | $1:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac 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. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} AC_SUBST(install_sh)]) # 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 2 # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering # Copyright (C) 1996, 1998, 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 4 AC_DEFUN([AM_MAINTAINER_MODE], [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) dnl maintainer-mode is disabled by default AC_ARG_ENABLE(maintainer-mode, [ --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer], USE_MAINTAINER_MODE=$enableval, USE_MAINTAINER_MODE=no) AC_MSG_RESULT([$USE_MAINTAINER_MODE]) AM_CONDITIONAL(MAINTAINER_MODE, [test $USE_MAINTAINER_MODE = yes]) MAINT=$MAINTAINER_MODE_TRUE AC_SUBST(MAINT)dnl ] ) AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE]) # Check to see how 'make' treats includes. -*- Autoconf -*- # 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 3 # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo done .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote="\"" _am_result=BSD fi fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997, 1999, 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 5 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # Copyright (C) 2003, 2004, 2005, 2006 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 for `mkdir -p'. AC_DEFUN([AM_PROG_MKDIR_P], [AC_PREREQ([2.60])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, dnl while keeping a definition of mkdir_p for backward compatibility. dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of dnl Makefile.ins that do not define MKDIR_P, so we do our own dnl adjustment using top_builddir (which is defined more often than dnl MKDIR_P). AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl case $mkdir_p in [[\\/$]]* | ?:[[\\/]]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac ]) # Helper functions for option handling. -*- Autoconf -*- # 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 3 # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # ------------------------------ # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) # ---------------------------------- # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # 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 4 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT(yes)]) # 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 # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in `make install-strip', and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be `maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006 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_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputing VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # Check how to create a tarball. -*- Autoconf -*- # 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) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of `v7', `ustar', or `pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. AM_MISSING_PROG([AMTAR], [tar]) m4_if([$1], [v7], [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' _am_tools=${am_cv_prog_tar_$1-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of `-'. for _am_tool in $_am_tools do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR pnm2ppa-1.13/pnm2ppa.conf0000644000076400007640000001704107563301203012172 00000000000000# Sample configuration file # # This file will be automatically read upon startup if it is placed in # /etc/pnm2ppa.conf # # uncomment entries by removing "#" to activate them. # #-----------set the printer model--------------------------- # The printer model will normally be set by a -v command # line argument. Otherwise, if not set in the configuration file # it defaults to the 710/720 series. Remove/comment out the line # "version 0" below to get the default choice. # # If there is more than one "version" entry activated, the last one # will be used. The printer version can also be set with the command line # option e.g., "-v 720". version 0 # REMOVE THIS ENTRY to make 720 the default printer model!!! #version 720 # 710, 712, 722 also acceptable #version 820 #version 1000 #--------control system log messages from pnm2ppa------------------- # pnm2ppa issues progress and error messages to the system log (syslog). # For security reasons, no input from the user is ever sent to the syslog. # The setting "silent 1" suppresses messages to the syslog. The # setting "verbose 1" sends messages to the standard error stream (stderr) # in addition to the syslog. (Note: if pnm2ppa was compiled with the # -D__NO_SYSLOG__ option (e.g., for BeOS), syslog messages are # diverted to stderr; use "silent 1" to suppress them.) #silent 1 #verbose 1 # (NEW FEATURE:) # standard informational messages ( when a job starts, when each page # prints, job finished, etc.) will not be recorded in the System Log, # unless explicitly activated here with the "log_info 1" keyword. # (i.e., "log_info 0" is the default.) # (Informational messages will still always be sent to stderr in "verbose" # mode, even if log_info is not set.) log_info 1 # <= COMMENT THIS OUT TO GET THE NEW DEFAULT BEHAVIOR! # Note: the "silent 1" and "log_info" keywords are only accepted from the # system configuration file (/etc/pnm2ppa.conf), and not from configuration # files specified by users with the pnm2ppa option "-f". #---------set the margins of the printed page------------------- # Margins: these are distances from the edges of the paper in # "dots" ( 600 dots = 1 inch = 2.54 cm). # Nothing outside these margins will be printed. # Default values are give below; uncomment and change, if necessary. # (Older versions of pnm2ppa required larger left and right margins to avoid # printer failure with "flashing lights", but this problem is believed to # be solved) #topmargin 10 #bottommargin 150 #leftmargin 10 #rightmargin 10 #----------center the printer output on the paper------------------- # Offsets: these are adjustments for centering the print correctly on the # paper. Units are dots (1/600 inch). Add a positive number of dots to # xoff to move the printed image to the right, relative to the paper. # add to yoff to move it down. The helper program calibrate_ppa prints # a test page to check the offsets (see CALIBRATON.txt): # usage: "calibrate_ppa --center | pnm2ppa --bw - - | lpr -l # Default values are: #xoffset 160 #yoffset 50 #------------align the black and color ink cartridges-------- # Color Offsets: these control alignment between the black ink # and color ink print cartridges. This changes a little whenever you # replace an ink cartridge, so the default values are just approximate. # # Use "calibrate_ppa --align | pnm2ppa --fd - - | lpr -l " # to print a test page to help you adjust the color offsets. # # The first line checks horizontal alignment ColOffsX,: # The second line checks vertical alignment ColOffsY,: # The alignment is correct if alignment patterns "0" is best. # If a diffent alignment pattern is best, add or subtract the + or # - value shown below it to ColOffsX or ColOffSy. # # See CALIBRATION.txt for more details. # Use "calibrate_ppa --test | pnm2ppa --fd - - | lpr -l " to check your # new settings. #ColOffsX 0 #ColOffsY 0 #---------------"shearing" corrections------------------------------------- # shearing correction (for bidirectional printing modes) # if there is a horizontal offset between right-to-left and left-to-right # sweeps of the print head, adjust these in units of 1"/600 (1 dot). # There are separate corrections colorshear and blackshear for the # color and black print heads. The third and fourth lines of the # alignment test page (see above) tests these. # The setting is correct when alignments "0" are correct. # The (positive or negative) number shown under the best-aligned shearing # alignment pattern tells you how much to change the colorshar or blackshear # value by. (For, example, if you print the calibration page with # "colorshear 0" (the default value) and the best pattern is labelled "-2", # uncomment the "colorshear" value below and set it equal to -2.) #colorshear 0 #blackshear 0 #-------------blackness control----------------------------- # this controls the density of black ink used. # valid blackness choices are 1 2 3 4; controls the # density of black ink used: 1 (least ink), 2 (default), 4 (most). # 0 = no black ink. This affects black ink bordered by whitespace # only (e.g. text, but not black in color images) #blackness 2 #------------Color correct curve Gamma parameters------------------------- # Gamma color correction values for Red, Green and Blue: # (Note: a more effective method of color correction is to use # a calibration file /etc/pnm2ppa.gamma, in which case these # Gamma values will not be used. See COLOR.html or COLOR.txt) # The pnm2ppa option --noGamma suppresses color correction. # The standard Gamma enhancement curve is # gEnh(i) = (int) ( pow ( (double) i / 256, Gamma ) * 256 ) # (i.e., 256 times ( i*(1.0/256)) to the power Gamma ), # where (int) i is the ppm color intensity, in the range 0 - 255. # positive values of Gamma enhance (increase the intensity of) # the corresponding color. Gamma = 1.0 corresponds to no # color correction, gEnh[i] = i. # You can specify Gamma values as a decimal number for each primary color #GammaR 1.0 # red enhancement #GammaG 1.0 # green enhancement #GammaB 1.0 # blue enhancement # For use with the printed output of "pnm2ppa -g ", # you can also specify Gamma values using the integer GammaIdx, # which gives Gamma = 1.0 - 0.033 * GammaIdx : #RedGammaIdx 0 #GreenGammaIdx 0 #BlueGammaIdx 0 # Default papersize (only used for printing the color calibration # test page with pnm2ppa -g). # Valid choices are: a4, letter, legal: #papersize letter # this is the default #papersize legal #papersize a4 #-----------suppress bidirectional printing--------------------- # by default the printing sweeps are now bidirectional (unimode 0); # to make unidirectional printing (left-to-right) the default behavior, # (unimode 1) uncomment the next line . (The command line options --uni # and --bi override the default behavior). You might wish to print # unidirectionally to avoid shearing effects in high-quality # color images, for example) #unimode 1 #------------switch off (color) data compression------------------ # Previously, data compression of color data sent to the printer # was not enabled. It is now enabled by default, but has only # been tested on HP71x/72xC models. Uncomment and set "compression 0" # to disable color data compression if necessary. #compression 1 #===================================================================== # the following are switches for debugging purposes only: # set their values to 0 to switch off the corresponding ink type: #black_ink 1 #color_ink 1 #cyan_ink 1 #magenta_ink 1 #yellow_ink 1 pnm2ppa-1.13/global.h0000644000076400007640000000724111310765657011374 00000000000000/*************************************************************************** global.h - contains all the global variables for the entire program ------------------- begin : Thu Jan 13 2000 copyright : (C) 2000 by the pnm2ppa project email : ***************************************************************************/ /*************************************************************************** * * * 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. * * * ***************************************************************************/ /* * Global Variables */ /* now provided by the 'configure' script */ /* #define VERSION "1.12 (November 19, 2002)" */ /* * Global types */ typedef enum { false = 0, true = 1 } BOOLEAN; /* Paper sizes in 600ths of an inch. */ /* Default paper sizes: Letter, Legal, and A4. */ /* US Letter is 8.5 in by 11 in */ #define LETTERWIDTH (5100) #define LETTERHEIGHT (6600) /* US Legal is 8.5 in by 14 in */ #define LEGALWIDTH (5100) #define LEGALHEIGHT (8400) /* A4 is 210 mm by 297 mm == 8.27 in by 11.69 in */ #define A4WIDTH (4960) #define A4HEIGHT (7016) #define MAXBUFFLINES 300 #ifdef __PNM2PPA_C__ int gEnh_curve_r[256], gEnh_curve_g[256], gEnh_curve_b[256]; int gMaxPass; BOOLEAN gFastMode; int gWidth; /* width and height in 600ths of an inch */ int gHeight; int gminWidth; /* max and min values allowed by printer */ int gmaxWidth; int gminHeight; int gmaxHeight; char gFormat[12]; /* string describing the image format */ BOOLEAN gPixmapMode; /* Defines if printing text or photo * (enable/disable black cartridge) */ BOOLEAN gColorMode; /* enable/disable color cartridge */ BOOLEAN gUnimode; /* force unidirectional print sweeps */ BOOLEAN gTerminate; /* force clean termination of print run*/ int *gErrVec; int *gErrVec_bw; BOOLEAN gGammaMode; BOOLEAN gEcoMode; int gBlackness; /* 1,2,3, or 4: black ink density adjustment */ BOOLEAN gBlack, gCyan, gMagenta, gYellow; /* switch off inks */ BOOLEAN gSilent, gVerbose ; /* switch off syslog, messages to stderr */ int gByteCount; /* 1 for pbm/pgm input, 3 for ppm */ BOOLEAN gCalibrate; /* true when printing calibration pages */ BOOLEAN g300; /* assume 300dpi input when true */ BOOLEAN gCompress; /* enable compressed (color) sweep data */ BOOLEAN gLogInfo; /* enable informational syslog messages */ #else #ifndef __CALIBRATE_C__ extern int gMaxPass; extern int gWidth; extern int gHeight; extern int gminWidth; extern int gmaxWidth; extern int gminHeight; extern int gmaxHeight; extern char gFormat[12]; extern int gBlackness ; extern BOOLEAN gUnimode ; extern BOOLEAN gTerminate ; extern BOOLEAN gColorMode; extern BOOLEAN gEcoMode; extern int gEnh_curve_r[256], gEnh_curve_g[256], gEnh_curve_b[256]; extern BOOLEAN gFastMode; extern int *gErrVec; extern int *gErrVec_bw; extern BOOLEAN gGammaMode; extern BOOLEAN gPixmapMode; extern BOOLEAN gBlack, gCyan, gMagenta, gYellow; extern BOOLEAN gSilent, gVerbose; extern int gByteCount; extern BOOLEAN gCalibrate; extern BOOLEAN g300; extern BOOLEAN gCompress; extern BOOLEAN gLogInfo; #endif #endif pnm2ppa-1.13/image.h0000644000076400007640000000470107500230727011203 00000000000000/*************************************************************************** image.h - prototypes and stuff for image.c ------------------- begin : Thu Jan 13 2000 copyright : (C) 1998-2000 by pnm2ppa project email : ***************************************************************************/ /*************************************************************************** * * * 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. * * * ***************************************************************************/ #ifndef _IMAGE_H #define _IMAGE_H #include typedef struct { FILE *fptr; enum { none, P1_PBM, P2_PGM, P3_PPM, P4_PBMRAW, P5_PGMRAW, P6_PPMRAW } version; int width, height; int blackCurLine, colorCurLine, bufferCurLine; unsigned char *LineType; int left, right, top, bottom; void *revdata; /* used to stash a line read too early */ int unread; /* buffer */ int bufsize; /* size of buffer in bytes */ int bufpos; /* start position in buffer */ int buflines; /* number of lines in the buffer */ enum { empty = 0, bitmap, color, grey } buftype; /* 0=empty, 1=black, 2=color, grey */ unsigned char *palette; int ncols; unsigned char *buffer[4]; int colors; /* for ppm and pgm formats (usually 255) */ } image_t; /* values for image->LineType descriptions */ #define READLINE 0x01 /* line has been read */ #define NONBLANK 0x02 /* non blank line */ #define BLACKLINE 0x04 /* line has black ink */ #define COLORLINE 0x08 /* line has color ink */ int initImage (image_t *, FILE *); /* reads a single line into char* */ int im_black_readline (image_t *, unsigned char *data[], int offset); /* reads a single line of color */ int im_color_readline (image_t *, unsigned char *data[], int offset); /* pushes a single line back */ void im_unreadline (image_t *, void *); /* produces color calibration page */ int ProduceGamma (image_t *, unsigned char *line ); #endif /* ; */ pnm2ppa-1.13/defaults.h0000644000076400007640000001077107431764432011744 00000000000000/*************************************************************************** defaults.h - contains model-specific defaults for various parameters ------------------- begin : Thu Jan 13 2000 copyright : (C) 2000 by the pnm2ppa project email : ***************************************************************************/ /*************************************************************************** * * * 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. * * * ***************************************************************************/ #ifndef _DEFAULTS_H #define _DEFAULTS_H /* Refer to CALIBRATION file about these settings */ #define MAXPRNNAMELEN 64 typedef enum { NOPRINTER = 0xff, HP7X0 = 0, HP820, HP1000 } printerModel_t; typedef struct { printerModel_t model; char name[MAXPRNNAMELEN]; char friendlyname[MAXPRNNAMELEN]; int ColBwOffsX; int ColBwOffsY; int x_offset; int y_offset; int r2l_bw_offset; int r2l_col_offset; int top_margin; int bottom_margin; int left_margin; int right_margin; int marg_diff; size_t bufsize; int min_pagewidth; int max_pagewidth; int min_pageheight; int max_pageheight; } printerDefault_t; #ifdef __PNM2PPA_C__ /* we only initialise the once */ printerDefault_t gPrinterDefaults[] = { { HP7X0, "HP7x0", "HP 710C, 712C, 720C, 722C Series Printers", -5, /* colxoff */ 43, /* colyoff */ 160, /* x_offset */ 50, /* y_offset */ 0, /* r2l_bw_offset */ 0, /* r2l_col_offset */ 10, /* top_margin */ 150, /* bottom_margin */ 10, /* left_margin */ 10, /* right_margin */ 2, /* margin difference */ 200 * 1024, /* buffer size */ 1800, /* min pagewidth 3" */ 5100, /* max pagewidth 8.5"*/ 1800, /* min pageheight 3" */ 8400 /* max pageheight 14" */ }, { HP820, "HP820", "HP 820 Series Printers", 35, /* colxoff */ 43, /* colyoff */ 160, /* x_offset */ 50, /* y_offset */ 0, /* r2l_bw_offset */ 0, /* r2l_col_offset */ 80, /* top_margin */ 150, /* bottom_margin */ 80, /* left_margin */ 80, /* right_margin */ 0x62, /* margin difference */ 200 * 1024, /* buffer size */ 1800, /* min pagewidth 3" */ 5100, /* max pagewidth 8.5"*/ 1800, /* min pageheight 3" */ 8400 /* max pageheight 14" */ }, { HP1000, "HP1000", "HP 1000 Series Printers", 35, /* colxoff */ 43, /* colyoff */ 160, /* x_offset */ 50, /* y_offset */ 0, /* r2l_bw_offset */ 0, /* r2l_col_offset */ 10, /* top_margin */ 150, /* bottom_margin */ 10, /* left_margin */ 10, /* right_margin */ 0x62, /* margin difference */ 200 * 1024, /* buffer size */ 2400, /* min pagewidth 4" */ 7800, /* max pagewidth 13" */ 3600, /* min pageheight 6" */ 11400 /* max pageheight 19" */ }, { NOPRINTER, "", "", 0, /* colxoff */ 0, /* colyoff */ 0, /* x_off */ 0, /* y_off */ 0, /* r2l_bw_offset */ 0, /* r2l_col_offset */ 0, /* top */ 0, /* bottom */ 0, /* left */ 0, /* right */ 0, /* margin difference */ 0, /* buffer size */ 0, /* min pagewidth */ 0, /* max pagewidth */ 0, /* min pageheight */ 0 /* max pageheight */ } }; #else extern printerDefault_t *gPrinterDefaults; #endif #endif pnm2ppa-1.13/pnmtools.h0000644000076400007640000000421507431764432012004 00000000000000/*************************************************************************** pnmtools.h - headers for pnmtools.c . ------------------- begin : Sat Oct 14, 2000 copyright : (C) 2000 by pnm2ppa project email : ***************************************************************************/ /*************************************************************************** * * * 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. * * * ***************************************************************************/ #ifndef _PNMTOOLS_H #define _PNMTOOLS_H void setpixel(int, int, unsigned char ); void setplus(int, int, int ); void setx(int, int, int ); void setblock(int, int, int ); void setchar(int, int, char, int ); void setstring(int , int , char* , int); void setstringv(int ,int ,char* ,int ); void setCG(int x,int y); void setsquare(int , int , int , int , int , int ); extern int Width; /* width and height in 600ths of an inch */ extern int Height; #if 0 extern int Pwidth; /* width in bytes */ #endif extern char *color_bitmap; extern int BitMap_topline; /* top line of bitmap */ extern int BitMap_bottomline; /* bottom line of bitmap */ extern int BitMap_Height; /* height for malloc */ extern int BitMap_Width; /* width for malloc */ #ifdef __CALIBRATE_PPA_C__ int Width; /* width and height in 600ths of an inch */ int Height; #if 0 int Pwidth; /* width in bytes */ int Pheight; /* height for malloc */ #endif char *color_bitmap; int BitMap_topline; /* top line of bitmap */ int BitMap_bottomline; /* bottom line of bitmap */ int BitMap_Height; /* height for malloc */ int BitMap_Width; /* width for malloc */ #endif #endif pnm2ppa-1.13/debug.h0000644000076400007640000000232607037364336011221 00000000000000/*************************************************************************** debug.h - debug header ------------------- begin : Thu Jan 13 2000 copyright : (C) 2000 by Andrew van der Stock email : ajv@greebo.net ***************************************************************************/ /*************************************************************************** * * * 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. * * * ***************************************************************************/ #ifndef _DEBUG_H_ #define _DEBUG_H_ #ifdef DEBUG /* debugging macros */ /* debugging routines */ void DPRINTF (char *format, ...); #else /* removal routines */ #define DPRINTF if(1){}else printf #endif #endif pnm2ppa-1.13/ppa.h0000644000076400007640000000551007450276225010707 00000000000000 /*************************************************************************** ppa.h - PPA protocol definitions and routines ------------------- begin : Thu Jan 13 2000 copyright : (C) 1998-2000 by the pnm2ppa project email : ***************************************************************************/ /*************************************************************************** * * * 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. * * * ***************************************************************************/ #ifndef _PPA_H #define _PPA_H #include "defaults.h" typedef struct { FILE *fptr; printerModel_t version; /* from defaults.h */ int ColBwOffsX; int ColBwOffsY; int x_offset; int y_offset; int r2l_bw_offset; int r2l_col_offset; int marg_diff; int top_margin; int left_margin; int right_margin; int bottom_margin; int bufsize; int min_pagewidth; int max_pagewidth; int min_pageheight; int max_pageheight; } ppaPrinter_t; typedef struct { unsigned short DPI; unsigned short pins_used_d2; unsigned short unused_pins_p1; unsigned short first_pin; unsigned short left_margin; unsigned short right_margin; unsigned char nozzle_delay; } ppaNozzleData_t; typedef struct ppaSweepData_s { unsigned char *image_data; unsigned data_size; BOOLEAN in_color; enum { right_to_left, left_to_right, unknown} direction; int vertical_pos; unsigned short left_margin; unsigned short right_margin; unsigned char nozzle_data_size; ppaNozzleData_t *nozzle_data; struct ppaSweepData_s *next; /* NULL indicates last print sweep */ int first_data_line; int last_data_line; int pre_blanklines; int post_blanklines; } ppaSweepData_t; typedef struct ppaSwathLimits_s { int left; int right; int numlines; int non_blanklines; int pre_blanklines; int post_blanklines; int first_line; int last_line; } ppaSwathLimits_t; typedef struct ppaPageLimits_s { int left; int right; int top; int bottom; } ppaPageLimits_t; void ppa_init_job (ppaPrinter_t *); void ppa_init_page (ppaPrinter_t *); void ppa_load_page (ppaPrinter_t *); void ppa_eject_page (ppaPrinter_t *); void ppa_end_print (ppaPrinter_t *); void ppa_print_sweep (ppaPrinter_t *, ppaSweepData_t *); /* prints one sweep */ void ppa_print_sweeps (ppaPrinter_t *, ppaSweepData_t *); /* prints a linked-list of sweeps */ #endif pnm2ppa-1.13/ppa_syslog.h0000644000076400007640000000375711310243725012307 00000000000000/*************************************************************************** ppa_syslog.h - prototypes and stuff for syslog.c ------------------- begin : Thu Jan 13 2000 copyright : (C) 1998-2000 by pnm2ppa project email : ***************************************************************************/ /*************************************************************************** * * * 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. * * * ***************************************************************************/ /* syslog.h modified Duncan Haldane Oct 2000. all syslog messages are now wrapped. */ #ifndef _PNM2PPA_SYSLOG_H_ #define _PNM2PPA_SYSLOG_H_ #ifdef __NO_SYSLOG__ /* (included only for compatibility, if syslog.h is absent): */ #define LOG_EMERG 0 /* system is unusable */ #define LOG_ALERT 1 /* action must be taken immediately */ #define LOG_CRIT 2 /* critical conditions */ #define LOG_ERR 3 /* error conditions */ #define LOG_WARNING 4 /* warning conditions */ #define LOG_NOTICE 5 /* normal but significant condition */ #define LOG_INFO 6 /* informational */ #define LOG_DEBUG 7 /* debug-level messages */ #else #include #endif char syslog_message[128]; extern size_t message_size ; void wrap_syslog( int, char *, char *); void wrap_openlog( char *, int ); void wrap_closelog (void); #ifdef __PNM2PPA_C__ size_t message_size = 128; #endif #endif pnm2ppa-1.13/palette.h0000644000076400007640000000673607043673450011577 00000000000000/*************************************************************************** palette.h - contains the possible palette of colors for HP PPA printers ------------------- begin : Thu Jan 13 2000 copyright : (C) 1999-2000 by the pnm2ppa project email : ***************************************************************************/ /*************************************************************************** * * * 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 array conteins rgb coordinates for each color printable * different component values are obtained shooting 0 to 4 ink drops * over the same pixel. * * Giorgio Marzano * */ /* unsigned char */ int hp_pal[5][5][5][3] = { { {{25, 20, 20}, {69, 48, 49}, {83, 50, 49}, {107, 50, 47}, {246, 57, 50}}, {{60, 56, 54}, {67, 54, 50}, {82, 57, 50}, {109, 59, 50}, {254, 67, 53}}, {{59, 65, 56}, {65, 65, 53}, {80, 67, 52}, {109, 72, 52}, {254, 83, 56}}, {{57, 78, 58}, {64, 81, 55}, {77, 87, 55}, {109, 96, 56}, {255, 116, 60}}, {{56, 120, 62}, {62, 132, 60}, {76, 153, 61}, {106, 187, 63}, {255, 255, 71}} }, { {{58, 47, 57}, {65, 44, 52}, {78, 45, 51}, {103, 47, 51}, {248, 53, 53}}, {{56, 53, 58}, {63, 51, 54}, {75, 51, 52}, {103, 55, 53}, {249, 62, 55}}, {{54, 61, 61}, {60, 60, 56}, {74, 62, 55}, {105, 68, 57}, {243, 80, 60}}, {{53, 62, 72}, {60, 77, 61}, {72, 81, 59}, {104, 91, 61}, {254, 114, 70}}, {{54, 117, 71}, {60, 129, 68}, {72, 148, 69}, {105, 185, 73}, {255, 255, 85}} }, { {{56, 45, 63}, {61, 43, 58}, {74, 43, 56}, {99, 44, 56}, {240, 51, 58}}, {{53, 48, 64}, {60, 48, 61}, {73, 48, 59}, {101, 51, 60}, {245, 60, 63}}, {{52, 57, 68}, {57, 57, 65}, {72, 59, 64}, {102, 64, 65}, {251, 78, 71}}, {{51, 70, 73}, {57, 73, 71}, {70, 79, 71}, {103, 90, 74}, {254, 114, 82}}, {{51, 113, 84}, {59, 128, 85,}, {71, 146, 85}, {108, 186, 93}, {255, 255, 108}} }, { {{54, 41, 69}, {59, 40, 67}, {70, 41, 66}, {99, 43, 66}, {239, 52, 71}}, {{52, 47, 77}, {59, 46, 75}, {72, 48, 74}, {100, 50, 75}, {243, 61, 79}}, {{51, 55, 85}, {56, 54, 83}, {69, 56, 81}, {102, 63, 84}, {249, 77, 90}}, {{50, 70, 96}, {57, 74, 97}, {68, 78, 96}, {102, 89, 99}, {254, 118, 111}}, {{51, 115, 117}, {59, 129, 119}, {73, 151, 124}, {108, 191, 133}, {255, 255, 154}} }, { {{53, 40, 98}, {59, 40, 97}, {70, 40, 96}, {100, 45, 100}, {241, 55, 106}}, {{52, 45, 111}, {59, 45, 110}, {71, 47, 111}, {100, 53, 116}, {248, 66, 124}}, {{51, 52, 129}, {57, 54, 131}, {70, 56, 131}, {102, 66, 139}, {253, 89, 152}}, {{51, 68, 161}, {58, 72, 167}, {71, 79, 171}, {106, 93, 182}, {254, 131, 200}}, {{56, 122, 242}, {65, 138, 252}, {84, 163, 254}, {122, 204, 255}, {255, 255, 255}} } }; pnm2ppa-1.13/fscoeff.h0000644000076400007640000002527707037364336011560 00000000000000/*************************************************************************** fscoeff.h - floyd-steinberg coefficients, mapping colors to ink depths ------------------- begin : Thu Jan 13 2000 copyright : (C) 1998-2000 by the pnm2ppa project email : ***************************************************************************/ /*************************************************************************** * * * 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. * * * ***************************************************************************/ #ifndef __COEFF_H #define __COEFF_H short fs_err_coeff_e[] = { -111, -111, -110, -110, -109, -109, -108, -108, -108, -107, -107, -106, -106, -105, -105, -105, -104, -104, -103, -103, -102, -102, -101, -101, -101, -100, -100, -99, -99, -98, -98, -98, -97, -97, -96, -96, -95, -95, -94, -94, -94, -93, -93, -92, -92, -91, -91, -91, -90, -90, -89, -89, -88, -88, -87, -87, -87, -86, -86, -85, -85, -84, -84, -84, -83, -83, -82, -82, -81, -81, -80, -80, -80, -79, -79, -78, -78, -77, -77, -77, -76, -76, -75, -75, -74, -74, -73, -73, -73, -72, -72, -71, -71, -70, -70, -70, -69, -69, -68, -68, -67, -67, -66, -66, -66, -65, -65, -64, -64, -63, -63, -63, -62, -62, -61, -61, -60, -60, -59, -59, -59, -58, -58, -57, -57, -56, -56, -56, -55, -55, -54, -54, -53, -53, -52, -52, -52, -51, -51, -50, -50, -49, -49, -49, -48, -48, -47, -47, -46, -46, -45, -45, -45, -44, -44, -43, -43, -42, -42, -42, -41, -41, -40, -40, -39, -39, -38, -38, -38, -37, -37, -36, -36, -35, -35, -35, -34, -34, -33, -33, -32, -32, -31, -31, -31, -30, -30, -29, -29, -28, -28, -28, -27, -27, -26, -26, -25, -25, -24, -24, -24, -23, -23, -22, -22, -21, -21, -21, -20, -20, -19, -19, -18, -18, -17, -17, -17, -16, -16, -15, -15, -14, -14, -14, -13, -13, -12, -12, -11, -11, -10, -10, -10, -9, -9, -8, -8, -7, -7, -7, -6, -6, -5, -5, -4, -4, -3, -3, -3, -2, -2, -1, -1, 0, 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 7, 8, 8, 9, 9, 10, 10, 10, 11, 11, 12, 12, 13, 13, 14, 14, 14, 15, 15, 16, 16, 17, 17, 17, 18, 18, 19, 19, 20, 20, 21, 21, 21, 22, 22, 23, 23, 24, 24, 24, 25, 25, 26, 26, 27, 27, 28, 28, 28, 29, 29, 30, 30, 31, 31, 31, 32, 32, 33, 33, 34, 34, 35, 35, 35, 36, 36, 37, 37, 38, 38, 38, 39, 39, 40, 40, 41, 41, 42, 42, 42, 43, 43, 44, 44, 45, 45, 45, 46, 46, 47, 47, 48, 48, 49, 49, 49, 50, 50, 51, 51, 52, 52, 52, 53, 53, 54, 54, 55, 55, 56, 56, 56, 57, 57, 58, 58, 59, 59, 59, 60, 60, 61, 61, 62, 62, 63, 63, 63, 64, 64, 65, 65, 66, 66, 66, 67, 67, 68, 68, 69, 69, 70, 70, 70, 71, 71, 72, 72, 73, 73, 73, 74, 74, 75, 75, 76, 76, 77, 77, 77, 78, 78, 79, 79, 80, 80, 80, 81, 81, 82, 82, 83, 83, 84, 84, 84, 85, 85, 86, 86, 87, 87, 87, 88, 88, 89, 89, 90, 90, 91, 91, 91, 92, 92, 93, 93, 94, 94, 94, 95, 95, 96, 96, 97, 97, 98, 98, 98, 99, 99, 100, 100, 101, 101, 101, 102, 102, 103, 103, 104, 104, 105, 105, 105, 106, 106, 107, 107, 108, 108, 108, 109, 109, 110, 110, 111, 111 }; short fs_err_coeff_se[] = { -47, -47, -47, -47, -47, -46, -46, -46, -46, -46, -45, -45, -45, -45, -45, -45, -44, -44, -44, -44, -44, -43, -43, -43, -43, -43, -42, -42, -42, -42, -42, -42, -41, -41, -41, -41, -41, -40, -40, -40, -40, -40, -39, -39, -39, -39, -39, -39, -38, -38, -38, -38, -38, -37, -37, -37, -37, -37, -36, -36, -36, -36, -36, -36, -35, -35, -35, -35, -35, -34, -34, -34, -34, -34, -33, -33, -33, -33, -33, -33, -32, -32, -32, -32, -32, -31, -31, -31, -31, -31, -30, -30, -30, -30, -30, -30, -29, -29, -29, -29, -29, -28, -28, -28, -28, -28, -27, -27, -27, -27, -27, -27, -26, -26, -26, -26, -26, -25, -25, -25, -25, -25, -24, -24, -24, -24, -24, -24, -23, -23, -23, -23, -23, -22, -22, -22, -22, -22, -21, -21, -21, -21, -21, -21, -20, -20, -20, -20, -20, -19, -19, -19, -19, -19, -18, -18, -18, -18, -18, -18, -17, -17, -17, -17, -17, -16, -16, -16, -16, -16, -15, -15, -15, -15, -15, -15, -14, -14, -14, -14, -14, -13, -13, -13, -13, -13, -12, -12, -12, -12, -12, -12, -11, -11, -11, -11, -11, -10, -10, -10, -10, -10, -9, -9, -9, -9, -9, -9, -8, -8, -8, -8, -8, -7, -7, -7, -7, -7, -6, -6, -6, -6, -6, -6, -5, -5, -5, -5, -5, -4, -4, -4, -4, -4, -3, -3, -3, -3, -3, -3, -2, -2, -2, -2, -2, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 30, 30, 30, 30, 30, 30, 31, 31, 31, 31, 31, 32, 32, 32, 32, 32, 33, 33, 33, 33, 33, 33, 34, 34, 34, 34, 34, 35, 35, 35, 35, 35, 36, 36, 36, 36, 36, 36, 37, 37, 37, 37, 37, 38, 38, 38, 38, 38, 39, 39, 39, 39, 39, 39, 40, 40, 40, 40, 40, 41, 41, 41, 41, 41, 42, 42, 42, 42, 42, 42, 43, 43, 43, 43, 43, 44, 44, 44, 44, 44, 45, 45, 45, 45, 45, 45, 46, 46, 46, 46, 46, 47, 47, 47, 47, 47 }; short fs_err_coeff_s[] = { -79, -79, -79, -78, -78, -78, -77, -77, -77, -76, -76, -76, -75, -75, -75, -75, -74, -74, -74, -73, -73, -73, -72, -72, -72, -71, -71, -71, -70, -70, -70, -70, -69, -69, -69, -68, -68, -68, -67, -67, -67, -66, -66, -66, -65, -65, -65, -65, -64, -64, -64, -63, -63, -63, -62, -62, -62, -61, -61, -61, -60, -60, -60, -60, -59, -59, -59, -58, -58, -58, -57, -57, -57, -56, -56, -56, -55, -55, -55, -55, -54, -54, -54, -53, -53, -53, -52, -52, -52, -51, -51, -51, -50, -50, -50, -50, -49, -49, -49, -48, -48, -48, -47, -47, -47, -46, -46, -46, -45, -45, -45, -45, -44, -44, -44, -43, -43, -43, -42, -42, -42, -41, -41, -41, -40, -40, -40, -40, -39, -39, -39, -38, -38, -38, -37, -37, -37, -36, -36, -36, -35, -35, -35, -35, -34, -34, -34, -33, -33, -33, -32, -32, -32, -31, -31, -31, -30, -30, -30, -30, -29, -29, -29, -28, -28, -28, -27, -27, -27, -26, -26, -26, -25, -25, -25, -25, -24, -24, -24, -23, -23, -23, -22, -22, -22, -21, -21, -21, -20, -20, -20, -20, -19, -19, -19, -18, -18, -18, -17, -17, -17, -16, -16, -16, -15, -15, -15, -15, -14, -14, -14, -13, -13, -13, -12, -12, -12, -11, -11, -11, -10, -10, -10, -10, -9, -9, -9, -8, -8, -8, -7, -7, -7, -6, -6, -6, -5, -5, -5, -5, -4, -4, -4, -3, -3, -3, -2, -2, -2, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 2, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 7, 7, 7, 8, 8, 8, 9, 9, 9, 10, 10, 10, 10, 11, 11, 11, 12, 12, 12, 13, 13, 13, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 17, 17, 17, 18, 18, 18, 19, 19, 19, 20, 20, 20, 20, 21, 21, 21, 22, 22, 22, 23, 23, 23, 24, 24, 24, 25, 25, 25, 25, 26, 26, 26, 27, 27, 27, 28, 28, 28, 29, 29, 29, 30, 30, 30, 30, 31, 31, 31, 32, 32, 32, 33, 33, 33, 34, 34, 34, 35, 35, 35, 35, 36, 36, 36, 37, 37, 37, 38, 38, 38, 39, 39, 39, 40, 40, 40, 40, 41, 41, 41, 42, 42, 42, 43, 43, 43, 44, 44, 44, 45, 45, 45, 45, 46, 46, 46, 47, 47, 47, 48, 48, 48, 49, 49, 49, 50, 50, 50, 50, 51, 51, 51, 52, 52, 52, 53, 53, 53, 54, 54, 54, 55, 55, 55, 55, 56, 56, 56, 57, 57, 57, 58, 58, 58, 59, 59, 59, 60, 60, 60, 60, 61, 61, 61, 62, 62, 62, 63, 63, 63, 64, 64, 64, 65, 65, 65, 65, 66, 66, 66, 67, 67, 67, 68, 68, 68, 69, 69, 69, 70, 70, 70, 70, 71, 71, 71, 72, 72, 72, 73, 73, 73, 74, 74, 74, 75, 75, 75, 75, 76, 76, 76, 77, 77, 77, 78, 78, 78, 79, 79, 79 }; short fs_err_coeff_sw[] = { -18, -17, -17, -17, -17, -17, -18, -17, -16, -17, -17, -17, -17, -17, -16, -15, -17, -16, -16, -16, -16, -16, -17, -16, -15, -16, -16, -16, -16, -16, -15, -14, -16, -15, -15, -15, -15, -15, -16, -15, -14, -15, -15, -15, -15, -15, -14, -13, -15, -14, -14, -14, -14, -14, -15, -14, -13, -14, -14, -14, -14, -14, -13, -12, -14, -13, -13, -13, -13, -13, -14, -13, -12, -13, -13, -13, -13, -13, -12, -11, -13, -12, -12, -12, -12, -12, -13, -12, -11, -12, -12, -12, -12, -12, -11, -10, -12, -11, -11, -11, -11, -11, -12, -11, -10, -11, -11, -11, -11, -11, -10, -9, -11, -10, -10, -10, -10, -10, -11, -10, -9, -10, -10, -10, -10, -10, -9, -8, -10, -9, -9, -9, -9, -9, -10, -9, -8, -9, -9, -9, -9, -9, -8, -7, -9, -8, -8, -8, -8, -8, -9, -8, -7, -8, -8, -8, -8, -8, -7, -6, -8, -7, -7, -7, -7, -7, -8, -7, -6, -7, -7, -7, -7, -7, -6, -5, -7, -6, -6, -6, -6, -6, -7, -6, -5, -6, -6, -6, -6, -6, -5, -4, -6, -5, -5, -5, -5, -5, -6, -5, -4, -5, -5, -5, -5, -5, -4, -3, -5, -4, -4, -4, -4, -4, -5, -4, -3, -4, -4, -4, -4, -4, -3, -2, -4, -3, -3, -3, -3, -3, -4, -3, -2, -3, -3, -3, -3, -3, -2, -1, -3, -2, -2, -2, -2, -2, -3, -2, -1, -2, -2, -2, -2, -2, -1, 0, 1, 2, 2, 2, 2, 2, 1, 2, 3, 2, 2, 2, 2, 2, 3, 1, 2, 3, 3, 3, 3, 3, 2, 3, 4, 3, 3, 3, 3, 3, 4, 2, 3, 4, 4, 4, 4, 4, 3, 4, 5, 4, 4, 4, 4, 4, 5, 3, 4, 5, 5, 5, 5, 5, 4, 5, 6, 5, 5, 5, 5, 5, 6, 4, 5, 6, 6, 6, 6, 6, 5, 6, 7, 6, 6, 6, 6, 6, 7, 5, 6, 7, 7, 7, 7, 7, 6, 7, 8, 7, 7, 7, 7, 7, 8, 6, 7, 8, 8, 8, 8, 8, 7, 8, 9, 8, 8, 8, 8, 8, 9, 7, 8, 9, 9, 9, 9, 9, 8, 9, 10, 9, 9, 9, 9, 9, 10, 8, 9, 10, 10, 10, 10, 10, 9, 10, 11, 10, 10, 10, 10, 10, 11, 9, 10, 11, 11, 11, 11, 11, 10, 11, 12, 11, 11, 11, 11, 11, 12, 10, 11, 12, 12, 12, 12, 12, 11, 12, 13, 12, 12, 12, 12, 12, 13, 11, 12, 13, 13, 13, 13, 13, 12, 13, 14, 13, 13, 13, 13, 13, 14, 12, 13, 14, 14, 14, 14, 14, 13, 14, 15, 14, 14, 14, 14, 14, 15, 13, 14, 15, 15, 15, 15, 15, 14, 15, 16, 15, 15, 15, 15, 15, 16, 14, 15, 16, 16, 16, 16, 16, 15, 16, 17, 16, 16, 16, 16, 16, 17, 15, 16, 17, 17, 17, 17, 17, 16, 17, 18, 17, 17, 17, 17, 17, 18 }; #endif /* ; */ pnm2ppa-1.13/lang.h0000644000076400007640000000611107431764432011047 00000000000000/*************************************************************************** lang.h - contains the language selectors for I18N purposes ------------------- begin : Thu Jan 13 2000 copyright : (C) 1999-2000 by Andrew van der Stock email : ajv@greebo.net ***************************************************************************/ /*************************************************************************** * * * 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. * * * ***************************************************************************/ #ifndef __LANG_H__ #define __LANG_H__ typedef enum { E_CS_BADMALLOC, /* 00 */ E_CS_BADTOPMARG, /* 01 */ E_CS_BADBOTMARG, /* 02 */ E_CS_BADNEXTLINE, /* 03 */ E_CS_BADPPAMALLOC, /* 04 */ E_CS_ERROR, /* 05 */ E_CS_BADSWITCH, /* 06 */ W_PPA_NOZZLE, /* 07 */ E_IM_BADGAMMA, /* 08 */ E_IM_EOFREADLINE, /* 09 */ E_IM_BADREADLINE, /* 10 */ E_IM_BADIMAGE, /* 11 */ E_BADMALLOC, /* 12 */ E_IM_BADFORMAT, /* 13 */ /* 14 (removed) */ E_IM_BADPAPERSIZE, /* 15 */ E_IM_BADMAXVALUE, /* 16 */ E_PPA_UNKNOWN, /* 17 */ E_PPA_BADMALLOC, /* 18 */ LOG_START, /* 19 */ LOG_PAGE, /* 20 */ LOG_FINISH, /* 21 */ LOG_NOPAGES, /* 22 */ LOG_SUCCESS, /* 23 */ LOG_VERBOSE, /* 24 */ E_CONFIG, /* 25 */ E_BADCONFIGFILE, /* 26 */ E_BAD_PAPER, /* 27 */ E_BADPARM, /* 28 */ LINE, /* 29 */ E_PARSE_CONFIG, /* 30 */ E_UNKNOWN_ARG, /* 31 */ E_BAD_OUTPUT, /* 32 */ E_BAD_INPUT, /* 33 */ LOG_VERSION, /* 34 */ E_BAD_GAMMAFILE, /* 35 */ E_BAD_PATH , /* 36 */ E_LANGNOMESS /* placeholder */ } mess_t; #ifdef __PNM2PPA_C__ /* only defined the once */ char *gMessages[] = { #ifdef LANG_CZ #include "text-cz.h" #endif #ifdef LANG_EN #include "text-en.h" #endif #ifdef LANG_ES #include "text-es.h" #endif #ifdef LANG_FR #include "text-fr.h" #endif #ifdef LANG_IT #include "text-it.h" #endif #ifdef LANG_NL #include "text-nl.h" #endif }; #else /* make the messages available to other files */ extern char *gMessages[]; #endif #endif pnm2ppa-1.13/text-cz.h0000644000076400007640000000706707431762566011545 00000000000000/*************************************************************************** text-cs.h - contains the czech strings ------------------- begin : Thu Jan 13 2000 copyright : (C) 2000 by Andrew van der Stock email : ajv@greebo.net translator : Ivo Panacek ***************************************************************************/ /*************************************************************************** * * * 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. * * * ***************************************************************************/ /* messages from cutswath.c */ /* 00 */ "nemohu alokovat dal¹í pamì»\n", /* 01 */ "nemohu pøeèíst velikost horního okraje\n", /* 02 */ "nemohu pøeèíst velikost spodního okraje\n", /* 03 */ "nemohu pøeèíst dal¹í øádku\n", /* 04 */ "nemohu alokovat pamì» pro ppa\n", /* 05 */ "chyba pøi volání", /*followed by function name*/ /* 06 */ "neznámá návratová hodnota pøepínaèe\n", /* from ppa.c */ /* 07 */ "zkracuji data pro trysky na 6 øádek, (pùvodnì ", /* followed by number */ /* messages from image.c */ /* 08 */ "Nemohu vytvoøit gamma.ppm soubor. Zkontrolujte práva\n", /* 09 */ "Pøedèasnì ukonèený vstup - narazil jsem na EOF pøi ètení obrázku:", /*followed by format*/ /* 10 */ "Fatální chyba - nemohu èíst obrázek\n", /* 11 */ "Fatální chyba - vstupní obrázek obsahuje pixl s hodnotou > 255\n", /* 12 */ "Fatální chyba! Nemohu alokovat pamì» pro buffer!\n", /* 13 */ "Fatální chyba! Vstupní obrázek (pnm2ppa) nemá PNM formát\n", /* 14 */ /* (removed) */ /* 15 */ "Tiskárna nemù¾e tisknout na papír velikosti ", /*followed by size*/ /* 16 */ "maximální hodnota PNM pixlu musí být 255, ale je: ", /*followed by value */ /* messages from ppa.c and pnm2ppa.c */ /* 17 */ "Neznámá verze tiskárny\n", /* 18 */ "Nemohu alokovat prostor pro ulo¾ení komprimovaných dat\n", /* 19 */ "Zaèínám zpracovávat tiskovou úlohu\n", /* 20 */ "Tisknu stránku ", /*followed by page number*/ /* 21 */ "Konec zpracování stránky ", /*followed by page number*/ /* 22 */ "®ádné stránky nebyly vyti¹tìny!\n", /* 23 */ "Tisková úloha dopadla úspì¹nì.\n", /* 24 */ "Upovídaný výpis na konzoli\n", /* 25 */ "Prosím, nastavte si tiskárnu v souboru /etc/pnm2ppa.conf\n", /* 26 */ "nemohu otevøít konfiguraèního soubor\n", /* 27 */ "neznámá velikost papíru\n", /* 28 */ "neznámý parametr", /* not followed by \n */ /* 29 */ "na øádce", /* followed by line number */ /* 30 */ "chyba pøi ètení konfiguraèního souboru", /* not followed by \n */ /* 31 */ "Fatální chyba: neznámý argument\n" , /* 32 */ "Nemohu otevøít výstupní PPA soubor\n", /* 33 */ "Nemohu otevøít vstupní PPA soubor\n", /* 34 */ "verze a datum pøekladu:", /*followed by version number and date*/ /* 35 */ "Color correction curve (Gamma) file exists, but is corrupt.\n", /* 36 */ "POSSIBLE BUFFER OVERFLOW ATTACK!!: length of a path specified as an option exceeds", /*followed by maximum allowed size*/ "FATAL: ©patné chybové hlá¹ení\n" pnm2ppa-1.13/text-en.h0000644000076400007640000000653307431762566011530 00000000000000/*************************************************************************** text-en.h - contains the english strings ------------------- begin : Thu Jan 13 2000 copyright : (C) 2000 by Andrew van der Stock email : ajv@greebo.net ***************************************************************************/ /*************************************************************************** * * * 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. * * * ***************************************************************************/ /* messages from cutswath.c */ /* 00 */ "could not malloc data storage\n", /* 01 */ "could not read top margin\n", /* 02 */ "could not clear bottom margin\n", /* 03 */ "could not read next line\n", /* 04 */ "could not malloc ppa storage\n", /* 05 */ "error calling", /*followed by function name*/ /* 06 */ "unknown return code in switch\n", /* from ppa.c */ /* 07 */ "truncating nozzle data to 6 rows, (was ", /* followed by number*/ /* messages from image.c */ /* 08 */ "Could not create gamma.ppm file. Check permissions\n", /* 09 */ "Truncated input - EOF while reading image:", /*followed by format*/ /* 10 */ "Fatal error - failed to read input image\n", /* 11 */ "Fatal error - input image has pixel with value > 255\n", /* 12 */ "Fatal error! Unable to allocate buffer memory!\n", /* 13 */ "Fatal error! Input image (pnm2ppa) is not a PNM image\n", /* 14 */ /* (removed) */ /* 15 */ "Printer cannot print on paper size ", /*followed by size*/ /* 16 */ "maximum PNM pixel value must be 255, but is: ", /*followed by value*/ /* messages from ppa.c and pnm2ppa.c*/ /* 17 */ "Unknown Printer version\n", /* 18 */ " Could not malloc storage for compressed data\n", /* 19 */ "Starting print job\n", /* 20 */ "Printing page ", /*followed by page number*/ /* 21 */ "Finished rendering page ", /*followed by page number*/ /* 22 */ "No pages printed!\n", /* 23 */ "Print job completed successfully.\n", /* 24 */ "Verbose logging to console\n", /* 25 */ "Please configure your printer in /etc/pnm2ppa.conf\n", /* 26 */ "couldn't open config file \n", /* 27 */ "unknown paper size\n", /* 28 */ "unrecognized parameter", /*not followed by \n */ /* 29 */ "at line", /* followed by line number */ /* 30 */ "error parsing config file", /* not followed by \n */ /* 31 */ "Fatal: unknown argument\n" , /* 32 */ "Could not open PPA output file\n", /* 33 */ "Could not open PNM input file\n", /* 34 */ "version and build date:", /*followed by version number and date */ /* 35 */ "Color correction curve (Gamma) file exists, but is corrupt.\n", /* 36 */ "POSSIBLE BUFFER OVERFLOW ATTACK!!: length of a path specified as an option exceeds", /*followed by maximum allowed size */ "FATAL: Bad error message\n" pnm2ppa-1.13/text-es.h0000644000076400007640000001045007431762567011527 00000000000000/*************************************************************************** text-es.h - contains the Spanish strings - Contiene las cadenas es español ------------------- begin : Thu Jan 13 2000 copyright : (C) 2000 by Andrew van der Stock email : ajv@greebo.net Translated by Javier Sedano (jsedano@it.uc3m.es), Wed Apr 12 11:10:14 CEST 2000, Spanish. Traducido por Javier Sedano (jsedano@it.uc3m.es), Wed Apr 12 11:10:14 CEST 2000, al español. ***************************************************************************/ /*************************************************************************** * * * 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. * * * * Este programa es software libre; puedes redistribuirlo y/o * * modificarlo bajo los terminos de la GNU General Public License * * (Licencia Publica General GNU) tal y como es publicada por la Free * * Software Fundation (Fundacion de Software Libre); la version 2 de la * * Licencia, o (a tu eleccion) cualquier version anterior. * ***************************************************************************/ /* messages from cutswath.c */ /* 00 */ "no pude reservar memoria para almacen de datos\n", /* 01 */ "no pude leer el margen superior\n", /* 02 */ "no pude limpiar el margen inferior\n", /* 03 */ "no pude leer la siguiente linea\n", /* 04 */ "no pude reservar memoria para almacenar el ppa\n", /* 05 */ "error invocando", /*followed by function name*/ /* 06 */ "codigo devuelto por switch desconocido\n", /* from ppa.c */ /* 07 */ "truncando datos de las boquillas a 6 filas, (era ", /* followed by number */ /* messages from image.c */ /* 08 */ "No pude crear el archivo gamma.ppm . Comprueba los permisos\n", /* 09 */ "Entrada truncada - EOF mientras leia la imagen:", /*followed by format */ /* 10 */ "Error fatal - imposible leer imagen de entrada\n", /* 11 */ "Error fatal - la imagen de entrada tiene un pixel que vale mas de 255\n", /* 12 */ "Error fatal! Imposible reservar buffer de memoria!\n", /* 13 */ "Error fatal! La imagen de entrada (pnm2ppa) no es una imagen PNM\n", /* 14 */ /* removed */ /* 15 */ "La impresora no puede imprimir en tamaño de papel ", /*followed by size */ /* 16 */ "el maximo calor para un pixel PNM debe ser 255, pero es: ", /*followed by value */ /* messages from ppa.c and pnm2ppa.c */ /* 17 */ "Version de impresora desconocida\n", /* 18 */ "No pude reservar memoria para los datos comprimidos C\n", /* 19 */ "Comenzando trabajo de impresion\n", /* 20 */ "Imprimiendo pagina ", /*followed by page number */ /* 21 */ "Terminado renderizado de la pagina ", /*followed by page number*/ /* 22 */ "No imprimi ninguna pagina!\n", /* 23 */ "Trabajo de impresion completado con exito.\n", /* 24 */ "Registrando salida en la consola\n", /* 25 */ "Por favor, configura tu impresora en /etc/pnm2ppa.conf\n", /* 26 */ "no pude abrir el archivo de configuracion\n", /* 27 */ "tamaño de papel desconocido\n", /* 28 */ "parametro desconocido", /*not followed by \n*/ /* 29 */ "en la linea", /* followed by line number */ /* 30 */ "error procesando el archivo de configuracionco", /* not followed by \n */ /* 31 */ "Critico: argumento desconocido\n" , /* 32 */ "No pude abrir el archivo de salida PPA\n", /* 33 */ "No pude abrir el archivo de entrada PNM\n", /* 34 */ "version y fecha de compilacion:", /*followed by version number and date */ /* 35 */ "El archivo de correcion de color (gamma) existe, pero esta corrupto.\n", /* 36 */ "POSSIBLE BUFFER OVERFLOW ATTACK!!: length of a path specified as an option exceeds", /*followed by maximum allowed size */ "CRITICO: Mensaje de error incorrecto\n" pnm2ppa-1.13/text-fr.h0000644000076400007640000000734407431762567011537 00000000000000/*************************************************************************** text-fr.h - contains the french strings ------------------- begin : Thu Jan 13 2000 copyright : (C) 2000 by Andrew van der Stock email : ajv@greebo.net translator : b.alix@free.fr ***************************************************************************/ /*************************************************************************** * * * 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. * * * ***************************************************************************/ /* messages de cutswath.c */ /* 00 */ "ne peut allouer de mémoire pour les données\n", /* 01 */ "ne peut lire la marge supérieure\n", /* 02 */ "ne peut effacer la marge inférieure\n", /* 03 */ "ne peut lire la ligne suivante\n", /* 04 */ "ne peut allouer de mémoire pour ppa\n", /* 05 */ "erreur lors de l'appel à", /*suivi du nom de la fonction*/ /* 06 */ "code retour inconnu lors du switch\n", /* from ppa.c */ /* 07 */ "troncature des données buses à 6 lignes, (initiallement ", /*suivi du nombre */ /* messages de image.c */ /* 08 */ "ne peut créer le fichier gamma.ppm . Vérifiez les permissions\n", /* 09 */ "Entrée tronquée - EOF pendant la lecture de l'image:", /*suivi du format */ /* 10 */ "Erreur fatale - impossible de lire l'image en entrée\n", /* 11 */ "Erreur fatale - l'image en entrée a un pixel d'une valeur > 255\n", /* 12 */ "Erreur fatale! Impossible d'allouer un buffer mémoire!\n", /* 13 */ "Erreur fatale! L'image en entrée (pnm2ppa) n'est pas un image PNM\n", /* 14 */ /* removed */ /* 15 */ "L'imprimante ne peut imprimer sur cette taille de papier ", /*suivi de la taille */ /* 16 */ "la valeur maximale d'un pixel PNM devrait être 255, mais est : ", /*suivi de la valeur */ /* messages de ppa.c et pnm2ppa.c */ /* 17 */ "Version d'imprimante inconnue\n", /* 18 */ " Ne peut allouer de mémoire pour les données compressées\n", /* 19 */ "Début de la tâche d'impression\n", /* 20 */ "Impression de la page ", /*suivi du numéro de page*/ /* 21 */ "Fin du rendu de la page ", /*suivi du numéro de page*/ /* 22 */ "Aucune page imprimée!\n", /* 23 */ "Tâche d'impression terminée avec succès.\n", /* 24 */ "messages affichés sur la console\n", /* 25 */ "Veuillez configurer votre imprimante dans /etc/pnm2ppa.conf\n", /* 26 */ "ne peut ouvrir le fichier\n", /* 27 */ "taille de papier inconnue\n", /* 28 */ "paramètre non reconnu", /*non suivi de \n*/ /* 29 */ "à la ligne", /* suivi du numéro de ligne*/ /* 30 */ "erreur de traitement du fichier de configuration", /*non suivi de \n */ /* 31 */ "Fatal: argument inconnu\n" , /* 32 */ "Ne peut ouvrir le fichier PPA en sortie\n", /* 33 */ "Ne peut ouvrir le fichier PNM en entrée\n", /* 34 */ "version et date de création:", /*suivi du numéro de version et de sa date */ /* 35 */ "Color correction curve (Gamma) file exists, but is corrupt.\n", /* 36 */ "POSSIBLE BUFFER OVERFLOW ATTACK!!: length of a path specified as an option exceeds", /*followed by maximum allowed size */ "FATAL: mauvais message d'erreur\n" pnm2ppa-1.13/text-it.h0000644000076400007640000001014507431762567011535 00000000000000/*************************************************************************** text-it.h - contains the Italian strings ------------------- begin : Thu Jan 13 2000 copyright : (C) 2000 by Andrew van der Stock email : ajv@greebo.net Translated to Italian by Riccardo Murri , Fri Aug 11 18:34:09 CEST 2000 Tradotto in Italiano da Riccardo Murri , Fri Aug 11 18:34:09 CEST 2000 ***************************************************************************/ /*************************************************************************** * * * 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. * * * ***************************************************************************/ /* messages from cutswath.c */ /* 00 */ "impossibile allocare memoria per i dati\n", /* 01 */ "impossibile leggere il margine superiore\n", /* 02 */ "impossibile espellere il margine inferiore\n", /* FIXME: che vuol dire "clear bottom margin"? */ /* 03 */ "impossibile leggere la riga successiva\n", /* 04 */ "impossibile allocare memoria per il PPA\n", /* 05 */ "errore invocando la funzione", /*followed by function name*/ /* 06 */ "codice di ritorno dello scambio sconosciuto\n", /* FIXME: "switch" = "scambio"?? */ /* from ppa.c */ /* 07 */ "troncati i dati del beccuccio a 6 righe, (erano ", /* followed by number */ /* FIXME: nozzle data?? */ /* messages from image.c */ /* 08 */ "impossibile creare il file gamma.ppm. Controllare i permessi.\n", /* 09 */ "Input troncato - File terminato durante la lettura dell'immagine:", /*followed by format */ /* 10 */ "Errore critico - impossibile leggere l'immagine in ingresso\n", /* 11 */ "Errore critico - l'immagine in ingresso ha pixel con valore > 255\n", /* 12 */ "Errore critico! Impossibile allocare memoria per il buffer!\n", /* FIXME: "memoria tampone"? */ /* 13 */ "Errore critic! L'immagine in ingresso (pnm2ppa) non è un immagine PNM\n", /* 14 */ /* removed */ /* 15 */ "La stampante non può stampare su carta in formato ", /*followed by size*/ /* 16 */ "indice colore errato: il massimo è 255, il file contiene ", /*followed by value */ /* messages from ppa.c and pnm2ppa.c */ /* 17 */ "Versione della stampante sconosciuta\n", /* 18 */ "Impossibile allocare memoria per i dati compressi\n", /* 19 */ "Comincia il lavoro di stampa\n", /* 20 */ "Stampa in corso, pagina ", /*followed by page number*/ /* 21 */ "Composta la pagina ", /*followed by page number*/ /* 22 */ "Nessuna pagina stampata!\n", /* 23 */ "Stampa completata correttamente.\n", /* 24 */ "Informazioni dettagliate in console\n", /* 25 */ "Configurare la stampante in /etc/pnm2ppa.conf\n", /* 26 */ "impossibile aprire il file di configurazione\n", /* 27 */ "formato della carta sconosciuto\n", /* 28 */ "parametro non riconosciuto", /*not followed by /n */ /* 29 */ "alla linea", /* followed by line number */ /* 30 */ "errore nel file di configurazione", /* not followed by \n */ /* 31 */ "Errore critico: argomento sconosciuto\n" , /* 32 */ "Impossibile aprire il file di uscita PPA\n", /* 33 */ "Impossibile aprire il file di ingresso PNM\n", /* 34 */ "versione e data di compilazione:", /*followed by version number and date */ /* 35 */ "Color correction curve (Gamma) file exists, but is corrupt.\n", /* 36 */ "POSSIBLE BUFFER OVERFLOW ATTACK!!: length of a path specified as an option exceeds", /*followed by maximum allowed size */ "ERRORE CRITICO: messaggio di errore impossibile (bug nel programma)\n" pnm2ppa-1.13/text-nl.h0000644000076400007640000001174707431762567011543 00000000000000/*************************************************************************** text-nl.h - contains the Dutch strings ------------------- begin : Thu Jan 13 2000 copyright : (C) 2000 by Jimmy Tak email : fltak@studenten.net ***************************************************************************/ /*************************************************************************** * * * 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. * * * ***************************************************************************/ /* messages from cutswath.c */ /* could not malloc data storage */ /* 00 */ "er kon geen geheugen toegewezen worden voor de opslag van gegevens\n", /* could not read top margin */ /* 01 */ "de bovenste marge kon niet gelezen worden\n", /* could not clear bottom margin */ /* 02 */ "de onderste marge kon niet leeggemaakt worden\n", /* could not read next line */ /* 03 */ "de volgende regel kon niet gelezen worden\n", /* could not malloc ppa storage */ /* 04 */ "er kon geen geheugen toewijzen worden voor de ppa opslag\n", /* error calling */ /* 05 */ "fout tijdens het aanroepen van ", /*followed by function name*/ /* unknown return code in switch */ /* 06 */ "onbekende return code in switch\n", /* from ppa.c */ /* truncating nozzle data to 6 rows, (was */ /* 07 */ "spuitgat gegevens worden afgekapt tot 6 rijen, (het waren ", /* followed by number*/ /* messages from image.c */ /* Could not create gamma file. Check permissions */ /* 08 */ "gamma.ppm bestand kon niet worden gemaakt. Controleer de toegangsrechten\n", /* Truncated input - EOF while reading image: */ /* 09 */ "Afgekapte invoer - EOF tijdens het lezen van de afbeelding: ", /*followed by format*/ /* Fatal error - failed to read input image */ /* 10 */ "Fatale fout - invoer afbeelding kon niet gelezen worden\n", /* Fatal error - input image has pixel with value > 255 */ /* 11 */ "Fatale fout - invoer afbeelding heeft een pixel met een waarde groter dan 255\n", /* Fatal error! Unable to allocate buffer memory! */ /* 12 */ "Fatale fout! Kan geen buffer geheugen toewijzen!\n", /* Input image is not a supported PNM format */ /* 13 */ "Fatale fout! Invoer afbeelding (pnm2ppa) is niet een PNM indeling\n", /* Unknown PNM magic */ /* 14 */ /*removed*/ /* Printer cannot print on paper size */ /* 15 */ "De printer kan niet afdrukken op de papiergrootte ", /*followed by size */ /* maximum PNM pixel value must be 255, but is: */ /* 16 */ "maximale PNM pixel waarde moet 255 zijn, maar het is: ", /*followed by value*/ /* messages from ppa.c and pnm2ppa.c */ /* Unknown Printer version */ /* 17 */ "Onbekende printer versie\n", /* Could not malloc storage for compressed data */ /* 18 */ "Er kon geen geheugen toegewezen voor de opslag van gecomprimeerde gegevens\n", /* Starting print job */ /* 19 */ "Afdruk opdracht wordt gestart\n", /* Printing page */ /* 20 */ "Bezig met afdrukken van pagina ", /*followed by page number */ /* Finished rendering page */ /* 21 */ "Klaar met afbeelden van pagina ", /*followed by page number */ /* No pages printed! */ /* 22 */ "Geen pagina's afgedrukt!\n", /* Print job completed successfully. */ /* 23 */ "Afdruk opdracht is succesvol afgerond.\n", /* Verbose logging to console */ /* 24 */ "Uitgebreide logweergave in de console\n", /* Please configure your printer in /etc/pnm2ppa.conf */ /* 25 */ "Configureer aub uw printer in /etc/pnm2ppa.conf\n", /* couldn't open config file */ /* 26 */ "configuratie bestand kon niet geopend worden\n", /* unknown paper size */ /* 27 */ "onbekende papiergrootte\n", /* unrecognized parameter */ /* 28 */ "onbekende parameter", /*not followed by \n */ /* at line */ /* 29 */ "in rij ", /* followed by line number */ /* error parsing config file */ /* 30 */ "fout bij het interpreteren van het configuratie bestand", /* not followed by \n */ /* Fatal: unknown argument */ /* 31 */ "Fataal: onbekend argument\n", /* Could not open PPA output file */ /* 32 */ "PPA uitvoer bestand kon niet geopend worden\n", /* Could not open PNM input file */ /* 33 */ "PNM invoer bestand kon niet geopend worden\n", /* version and build date: */ /* 34 */ "versie en compileer datum: ", /*followed by version number and date*/ /* 35 */ "Color correction curve (Gamma) file exists, but is corrupt.\n", /* 36 */ "POSSIBLE BUFFER OVERFLOW ATTACK!!: length of a path specified as an option exceeds", /*followed by maximum allowed size*/ /* FATAL: Bad error message */ "FATAAL: Slechte foutmelding\n" pnm2ppa-1.13/gamma.h0000644000076400007640000000244207174257321011211 00000000000000/*************************************************************************** gamma.h - prototypes and stuff for gamma.c ------------------- begin : Thu Jan 13 2000 copyright : (C) 1998-2000 by pnm2ppa project email : ***************************************************************************/ /*************************************************************************** * * * 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. * * * ***************************************************************************/ #ifndef _GAMMA_H #define _GAMMA_H #include "image.h" /* empirical color correction curve */ int Make_GammaCurve ( double , double , double ); /* array of trial gamma values */ double GammaValue ( int ); /* produces color calibration page */ int ProduceGamma (image_t *, unsigned char *line ); #endif pnm2ppa-1.13/dither.h0000644000076400007640000000231607037364336011411 00000000000000/*************************************************************************** dither.h - function prototypes for dither.c ------------------- begin : Thu Jan 13 2000 copyright : (C) 2000 by the pnm2ppa project email : ***************************************************************************/ /*************************************************************************** * * * 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. * * * ***************************************************************************/ #ifndef _DITHER_H #define _DITHER_H void FS_Color_Dither (image_t * im, unsigned char *line); void HT_Black_Dither (image_t * im, unsigned char *line); void HT_Color_Dither (image_t * im, unsigned char *line); #endif /* ; */ pnm2ppa-1.13/hash_ink.h0000644000076400007640000000434307043673450011715 00000000000000/***************************************************************** hash_ink.h - contains hashed version of palette.h data ----------------- begin : Tue Jan 24 2000 copyright : (C) 2000 by the pmn2ppa project author : Klamer Schutte email : Schutte@fel.tno.nl ******************************************************************/ /*************************************************************************** * * * 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. * * * ***************************************************************************/ #ifndef HASH_INK_H #define HASH_INK_H "$Id: hash_ink.h,v 1.1 2000/01/26 22:37:28 klamer Exp $" /* * $Log: hash_ink.h,v $ * Revision 1.1 2000/01/26 22:37:28 klamer * Added hashing support in FS_Color_Dither. Gives (for file processed) * 6 fold speedup for normal mode, and is 1.5 times quicker with --eco * mode. (CPU time needed -- printer is slower on my computer.) * Note that a trade-off between memory and CPU usage is made; large * arrays are generated in hash_ink.c. A pending optimization is to reduce the * entries in size; the integer size object can be packed to unsigned chars, * and the values of x y z even into a single char -- reducing the size of that * structure from 7 32 bit words (on i386) to 2 words... * Printout results should not change for the code inserted now; * however, marginal differences may exist as the distance (defined by * color metric) is the same, but multiple solutions might give the * same distance... Note that the error diffusion dithering should correct * this in nearby pixels. * */ struct hash_ink { int data[3]; int x, y, z; struct hash_ink *next; }; extern struct hash_ink *arr_max4[], *arr_max1[]; extern int shift4, shift1; #endif pnm2ppa-1.13/pnm2ppa.h0000644000076400007640000000351511310765657011511 00000000000000/*************************************************************************** pnm2ppa.h - main program header file ------------------- begin : Thu Jan 13 2000 copyright : (C) 1998-2000 by pnm2ppa project email : ***************************************************************************/ /*************************************************************************** * * * 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. * * * ***************************************************************************/ #ifndef _PNM2PPA_H_ #define _PNM2PPA_H_ #ifdef __PNM2PPA_C__ static char *defaultcfgfile = SYSCONFDIR "/pnm2ppa.conf"; static char *defaultgammafile = SYSCONFDIR "/pnm2ppa.gamma"; static ppaPrinter_t printer; static struct option long_opts[] = { {"bw", 0, 0, 0}, {"fd", 0, 0, 0}, {"version", 0, 0, 0}, {"help", 0, 0, 'h'}, {"verbose", 0, 0, 0}, {"eco", 0, 0, 0}, {"noGamma", 0, 0, 0}, {"uni", 0, 0, 0 }, {"bi", 0, 0, 0 }, {"dpi300", 0, 0, 0}, {0, 0, 0, 0} }; #endif int ppa_print_page (ppaPrinter_t *printer, image_t *image); int print_pnm (FILE *fptr); void set_printer_specific_defaults (void); void show_usage (char *prog); void parm_version (char *arg); void parm_iversion (int arg); void dump_config (void); void read_config_file (char *fname); char * readPath( char * ); int main (int argc, char *argv[]); #endif pnm2ppa-1.13/enh-curve.h0000644000076400007640000000444507037364336012033 00000000000000/*************************************************************************** enh-curve.h - initial gamma correction table ------------------- begin : Thu Jan 13 2000 copyright : (C) 2000 by the pnm2ppa project email : ***************************************************************************/ /*************************************************************************** * * * 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. * * * ***************************************************************************/ unsigned char enh_curve[256] = { 0, 3, 5, 7, 9, 10, 12, 14, 15, 17, 19, 20, 22, 23, 24, 26, 27, 29, 30, 31, 33, 34, 35, 37, 38, 39, 40, 42, 43, 44, 45, 47, 48, 49, 50, 51, 53, 54, 55, 56, 57, 58, 60, 61, 62, 63, 64, 65, 66, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 132, 133, 134, 135, 136, 137, 138, 139, 140, 141, 142, 143, 144, 145, 146, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 165, 166, 167, 168, 169, 170, 171, 172, 173, 173, 174, 175, 176, 177, 178, 179, 180, 180, 181, 182, 183, 184, 185, 186, 187, 187, 188, 189, 190, 191, 192, 193, 193, 194, 195, 196, 197, 198, 199, 199, 200, 201, 202, 203, 204, 205, 205, 206, 207, 208, 209, 210, 211, 211, 212, 213, 214, 215, 216, 216, 217, 218, 219, 220, 221, 221, 222, 223, 224, 225, 226, 226, 227, 228, 229, 230, 230, 231, 232, 233, 234, 235, 235, 236, 237, 238, 239, 239, 240, 241, 242, 243, 244, 244, 245, 246, 247, 248, 248, 249, 250, 251, 252, 252, 253, 254, 255 }; pnm2ppa-1.13/Makefile.am0000644000076400007640000000416211310765657012016 00000000000000# # What is to be built # bin_PROGRAMS = \ pnm2ppa \ calibrate_ppa # build the parse_vlink tool on demand only if BUILD_PARSE_VLINK SUBDIRS = ppa_protocol endif # # Where to find the config files at runtime # AM_CPPFLAGS = -DSYSCONFDIR='"$(sysconfdir)"' # # Distribute these directories and files # EXTRA_DIST = \ Changelog \ README \ README.security \ pdq \ lpd \ sample_scripts \ stamp-h1 \ test.ps \ testpage-a4.ps \ testpage.ps \ testpages \ utils \ rhs-printfilters \ rpm \ docs \ make_hash_ink.c # # distribute and install the manpage # dist_man1_MANS = docs/en/pnm2ppa.1 MAINTAINERCLEANFILES = \ configure \ aclocal.m4 \ config.h.in \ Makefile.in # # distribute, but do not install # noinst_HEADERS = \ global.h \ image.h \ defaults.h \ pnmtools.h \ debug.h \ ppa.h \ ppa_syslog.h \ palette.h \ fscoeff.h \ lang.h \ text-cz.h \ text-en.h \ text-es.h \ text-fr.h \ text-it.h \ text-nl.h \ gamma.h \ dither.h \ hash_ink.h \ pnm2ppa.h \ enh-curve.h # # Other things to install # dist_sysconf_DATA = \ pnm2ppa.conf # # main filter program # pnm2ppa_SOURCES = \ pnm2ppa.c \ syslog.c \ ppa.c \ image.c \ dither.c \ cutswath.c \ gamma.c # part of pnm2ppa, but generated at build time nodist_pnm2ppa_SOURCES = \ hash_ink.c # part of pnm2ppa, but only if DEBUG is enabled if PNM2PPA_DEBUG pnm2ppa_SOURCES += debug.c endif # # calibration tool # calibrate_ppa_SOURCES = \ calibrate_ppa.c \ pnmtools.c \ gamma.c # create this file 'on the fly' hash_ink.c: make_hash_ink ./make_hash_ink 4 3 > hash_ink.c ./make_hash_ink 1 5 >> hash_ink.c CLEANFILES = hash_ink.c make_hash_ink # ------------------- cross compile relevant stuff --------------------------- # # We need to create a tool to generate the hash table. # This tool creates the 'hash_ink.c' source file (and must # run on the build host in case of cross compiling) # CC_FOR_BUILD = @CC_FOR_BUILD@ CFLAGS_FOR_BUILD = -O2 CPPFLAGS_FOR_BUILD = -I$(top_srcdir) LDFLAGS_FOR_BUILD = LDLIBS_FOR_BUILD = make_hash_ink: make_hash_ink.c $(CC_FOR_BUILD) $(CPPFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) -o $@ $< $(LDLIBS_FOR_BUILD) pnm2ppa-1.13/Makefile.in0000644000076400007640000006754311313235716012032 00000000000000# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = pnm2ppa$(EXEEXT) calibrate_ppa$(EXEEXT) # part of pnm2ppa, but only if DEBUG is enabled @PNM2PPA_DEBUG_TRUE@am__append_1 = debug.c subdir = . DIST_COMMON = README $(am__configure_deps) $(dist_man1_MANS) \ $(dist_sysconf_DATA) $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/config.h.in \ $(top_srcdir)/configure INSTALL config.guess config.sub \ depcomp install-sh missing ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h CONFIG_CLEAN_FILES = am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" \ "$(DESTDIR)$(sysconfdir)" binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(bin_PROGRAMS) am_calibrate_ppa_OBJECTS = calibrate_ppa.$(OBJEXT) pnmtools.$(OBJEXT) \ gamma.$(OBJEXT) calibrate_ppa_OBJECTS = $(am_calibrate_ppa_OBJECTS) calibrate_ppa_LDADD = $(LDADD) am__pnm2ppa_SOURCES_DIST = pnm2ppa.c syslog.c ppa.c image.c dither.c \ cutswath.c gamma.c debug.c @PNM2PPA_DEBUG_TRUE@am__objects_1 = debug.$(OBJEXT) am_pnm2ppa_OBJECTS = pnm2ppa.$(OBJEXT) syslog.$(OBJEXT) ppa.$(OBJEXT) \ image.$(OBJEXT) dither.$(OBJEXT) cutswath.$(OBJEXT) \ gamma.$(OBJEXT) $(am__objects_1) nodist_pnm2ppa_OBJECTS = hash_ink.$(OBJEXT) pnm2ppa_OBJECTS = $(am_pnm2ppa_OBJECTS) $(nodist_pnm2ppa_OBJECTS) pnm2ppa_LDADD = $(LDADD) DEFAULT_INCLUDES = -I.@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(calibrate_ppa_SOURCES) $(pnm2ppa_SOURCES) \ $(nodist_pnm2ppa_SOURCES) DIST_SOURCES = $(calibrate_ppa_SOURCES) $(am__pnm2ppa_SOURCES_DIST) RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \ html-recursive info-recursive install-data-recursive \ install-dvi-recursive install-exec-recursive \ install-html-recursive install-info-recursive \ install-pdf-recursive install-ps-recursive install-recursive \ installcheck-recursive installdirs-recursive pdf-recursive \ ps-recursive uninstall-recursive man1dir = $(mandir)/man1 NROFF = nroff MANS = $(dist_man1_MANS) am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; dist_sysconfDATA_INSTALL = $(INSTALL_DATA) DATA = $(dist_sysconf_DATA) HEADERS = $(noinst_HEADERS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive ETAGS = etags CTAGS = ctags DIST_SUBDIRS = ppa_protocol DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ { test ! -d $(distdir) \ || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -fr $(distdir); }; } DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2 GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ # ------------------- cross compile relevant stuff --------------------------- # # We need to create a tool to generate the hash table. # This tool creates the 'hash_ink.c' source file (and must # run on the build host in case of cross compiling) # CC_FOR_BUILD = @CC_FOR_BUILD@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ # build the parse_vlink tool on demand only @BUILD_PARSE_VLINK_TRUE@SUBDIRS = ppa_protocol # # Where to find the config files at runtime # AM_CPPFLAGS = -DSYSCONFDIR='"$(sysconfdir)"' # # Distribute these directories and files # EXTRA_DIST = \ Changelog \ README \ README.security \ pdq \ lpd \ sample_scripts \ stamp-h1 \ test.ps \ testpage-a4.ps \ testpage.ps \ testpages \ utils \ rhs-printfilters \ rpm \ docs \ make_hash_ink.c # # distribute and install the manpage # dist_man1_MANS = docs/en/pnm2ppa.1 MAINTAINERCLEANFILES = \ configure \ aclocal.m4 \ config.h.in \ Makefile.in # # distribute, but do not install # noinst_HEADERS = \ global.h \ image.h \ defaults.h \ pnmtools.h \ debug.h \ ppa.h \ ppa_syslog.h \ palette.h \ fscoeff.h \ lang.h \ text-cz.h \ text-en.h \ text-es.h \ text-fr.h \ text-it.h \ text-nl.h \ gamma.h \ dither.h \ hash_ink.h \ pnm2ppa.h \ enh-curve.h # # Other things to install # dist_sysconf_DATA = \ pnm2ppa.conf # # main filter program # pnm2ppa_SOURCES = pnm2ppa.c syslog.c ppa.c image.c dither.c cutswath.c \ gamma.c $(am__append_1) # part of pnm2ppa, but generated at build time nodist_pnm2ppa_SOURCES = \ hash_ink.c # # calibration tool # calibrate_ppa_SOURCES = \ calibrate_ppa.c \ pnmtools.c \ gamma.c CLEANFILES = hash_ink.c make_hash_ink CFLAGS_FOR_BUILD = -O2 CPPFLAGS_FOR_BUILD = -I$(top_srcdir) LDFLAGS_FOR_BUILD = LDLIBS_FOR_BUILD = all: config.h $(MAKE) $(AM_MAKEFLAGS) all-recursive .SUFFIXES: .SUFFIXES: .c .o .obj am--refresh: @: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \ cd $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) config.h: stamp-h1 @if test ! -f $@; then \ rm -f stamp-h1; \ $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ else :; fi stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status @rm -f stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status config.h $(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_srcdir) && $(AUTOHEADER) rm -f stamp-h1 touch $@ distclean-hdr: -rm -f config.h stamp-h1 install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ rm -f "$(DESTDIR)$(bindir)/$$f"; \ done clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) calibrate_ppa$(EXEEXT): $(calibrate_ppa_OBJECTS) $(calibrate_ppa_DEPENDENCIES) @rm -f calibrate_ppa$(EXEEXT) $(LINK) $(calibrate_ppa_OBJECTS) $(calibrate_ppa_LDADD) $(LIBS) pnm2ppa$(EXEEXT): $(pnm2ppa_OBJECTS) $(pnm2ppa_DEPENDENCIES) @rm -f pnm2ppa$(EXEEXT) $(LINK) $(pnm2ppa_OBJECTS) $(pnm2ppa_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/calibrate_ppa.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/cutswath.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/debug.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dither.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gamma.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hash_ink.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/image.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pnm2ppa.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pnmtools.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ppa.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/syslog.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` install-man1: $(man1_MANS) $(man_MANS) @$(NORMAL_INSTALL) test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)" @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.1*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ else file=$$i; fi; \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 1*) ;; \ *) ext='1' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst"; \ done uninstall-man1: @$(NORMAL_UNINSTALL) @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.1*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 1*) ;; \ *) ext='1' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " rm -f '$(DESTDIR)$(man1dir)/$$inst'"; \ rm -f "$(DESTDIR)$(man1dir)/$$inst"; \ done install-dist_sysconfDATA: $(dist_sysconf_DATA) @$(NORMAL_INSTALL) test -z "$(sysconfdir)" || $(MKDIR_P) "$(DESTDIR)$(sysconfdir)" @list='$(dist_sysconf_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(dist_sysconfDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(sysconfdir)/$$f'"; \ $(dist_sysconfDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(sysconfdir)/$$f"; \ done uninstall-dist_sysconfDATA: @$(NORMAL_UNINSTALL) @list='$(dist_sysconf_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(sysconfdir)/$$f'"; \ rm -f "$(DESTDIR)$(sysconfdir)/$$f"; \ done # This directory's subdirectories are mostly independent; you can cd # into them and run `make' without going through this Makefile. # To change the values of `make' variables: instead of editing Makefiles, # (1) if the variable is set in `config.status', edit `config.status' # (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): @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 \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" $(RECURSIVE_CLEAN_TARGETS): @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)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ rev=''; for subdir in $$list; do \ if test "$$subdir" = "."; then :; else \ rev="$$subdir $$rev"; \ fi; \ done; \ rev="$$rev ."; \ target=`echo $@ | sed s/-recursive//`; \ for subdir in $$rev; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done && test -z "$$fail" tags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ done ctags-recursive: list='$(SUBDIRS)'; for subdir in $$list; do \ test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ tags="$$tags $$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(am__remove_distdir) test -d $(distdir) || mkdir $(distdir) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ distdir=`$(am__cd) $(distdir) && pwd`; \ top_distdir=`$(am__cd) $(top_distdir) && pwd`; \ (cd $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$top_distdir" \ distdir="$$distdir/$$subdir" \ am__remove_distdir=: \ am__skip_length_check=: \ distdir) \ || exit 1; \ fi; \ done -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r $(distdir) dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir); chmod a+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && cd $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @cd $(distuninstallcheck_dir) \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile $(PROGRAMS) $(MANS) $(DATA) $(HEADERS) config.h installdirs: installdirs-recursive installdirs-am: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(sysconfdir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-recursive clean-am: clean-binPROGRAMS clean-generic mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-hdr distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive info: info-recursive info-am: install-data-am: install-man install-dvi: install-dvi-recursive install-exec-am: install-binPROGRAMS install-dist_sysconfDATA install-html: install-html-recursive install-info: install-info-recursive install-man: install-man1 install-pdf: install-pdf-recursive install-ps: install-ps-recursive installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-dist_sysconfDATA \ uninstall-man uninstall-man: uninstall-man1 .MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) install-am \ install-strip .PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \ all all-am am--refresh check check-am clean clean-binPROGRAMS \ clean-generic ctags ctags-recursive dist dist-all dist-bzip2 \ dist-gzip dist-shar dist-tarZ dist-zip distcheck distclean \ distclean-compile distclean-generic distclean-hdr \ distclean-tags distcleancheck distdir distuninstallcheck dvi \ dvi-am html html-am info info-am install install-am \ install-binPROGRAMS install-data install-data-am \ install-dist_sysconfDATA install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-man1 \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ installdirs-am maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \ ps ps-am tags tags-recursive uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-dist_sysconfDATA uninstall-man \ uninstall-man1 # create this file 'on the fly' hash_ink.c: make_hash_ink ./make_hash_ink 4 3 > hash_ink.c ./make_hash_ink 1 5 >> hash_ink.c make_hash_ink: make_hash_ink.c $(CC_FOR_BUILD) $(CPPFLAGS_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) -o $@ $< $(LDLIBS_FOR_BUILD) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: pnm2ppa-1.13/config.h.in0000644000076400007640000000533211313235715011773 00000000000000/* config.h.in. Generated from configure.ac by autoheader. */ /* debugging */ #undef DEBUG /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if your system has a GNU libc compatible `malloc' function, and to 0 otherwise. */ #undef HAVE_MALLOC /* Define to 1 if you have the `memmove' function. */ #undef HAVE_MEMMOVE /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `memset' function. */ #undef HAVE_MEMSET /* Define to 1 if stdbool.h conforms to C99. */ #undef HAVE_STDBOOL_H /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the `strcasecmp' function. */ #undef HAVE_STRCASECMP /* Define to 1 if you have the `strchr' function. */ #undef HAVE_STRCHR /* Define to 1 if you have the `strdup' function. */ #undef HAVE_STRDUP /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_PARAM_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if the system has the type `_Bool'. */ #undef HAVE__BOOL /* cech */ #undef LANG_CZ /* english */ #undef LANG_EN /* espanol */ #undef LANG_ES /* french */ #undef LANG_FR /* italian */ #undef LANG_IT /* dutch */ #undef LANG_NL /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* use the syslog feature */ #undef USE_SYSLOG /* Version number of package */ #undef VERSION /* absent */ #undef __NO_LOG_PERROR__ /* no syslog */ #undef __NO_SYSLOG__ /* Define to `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef __cplusplus #undef inline #endif /* Define to rpl_malloc if the replacement function should be used. */ #undef malloc /* Define to `unsigned int' if does not define. */ #undef size_t pnm2ppa-1.13/configure0000755000076400007640000061375311313235714011672 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.62 for pnm2ppa 1.13. # # Report bugs to . # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # PATH needs CR # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH if test "x$CONFIG_SHELL" = x; then if (eval ":") 2>/dev/null; then as_have_required=yes else as_have_required=no fi if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=\$LINENO as_lineno_2=\$LINENO test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } ") 2> /dev/null; then : else as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. case $as_dir in /*) for as_base in sh bash ksh sh5; do as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac done IFS=$as_save_IFS for as_shell in $as_candidate_shells $SHELL; do # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi : _ASEOF }; then CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi : (as_func_return () { (exit $1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = "$1" ); then : else exitcode=1 echo positional parameters were not saved. fi test $exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } _ASEOF }; then break fi fi done if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test $as_have_required = no; then echo This script requires a shell more modern than all the echo shells that I found on your system. Please install a echo modern shell, or manually run the script under such a echo shell if you do have one. { (exit 1); exit 1; } fi fi fi (eval "as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0") || { echo No shell found that supports shell functions. echo Please tell bug-autoconf@gnu.org about your system, echo including any error possibly output before this message. echo This can help us improve future autoconf versions. echo Configuration will now proceed without shell functions. } as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. Blame Lee # E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='pnm2ppa' PACKAGE_TARNAME='pnm2ppa' PACKAGE_VERSION='1.13' PACKAGE_STRING='pnm2ppa 1.13' PACKAGE_BUGREPORT='pnm2ppa-users@lists.sourceforge.net' ac_unique_file="ppa.c" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir localstatedir includedir oldincludedir docdir infodir htmldir dvidir pdfdir psdir libdir localedir mandir DEFS ECHO_C ECHO_N ECHO_T LIBS build_alias host_alias target_alias build build_cpu build_vendor build_os host host_cpu host_vendor host_os MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA am__isrc CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP INSTALL_STRIP_PROGRAM MKDIR_P mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE CC_FOR_BUILD CPP GREP EGREP LIBOBJS PNM2PPA_DEBUG_TRUE PNM2PPA_DEBUG_FALSE BUILD_PARSE_VLINK_TRUE BUILD_PARSE_VLINK_FALSE LTLIBOBJS' ac_subst_files='' ac_user_opts=' enable_option_checking enable_maintainer_mode enable_dependency_tracking enable_syslog enable_debug with_language enable_vlink ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 { (exit 1); exit 1; }; } ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 { (exit 1); exit 1; }; } ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 { (exit 1); exit 1; }; } ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 { (exit 1); exit 1; }; } ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { $as_echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { $as_echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) { $as_echo "$as_me: error: Unrecognized options: $ac_unrecognized_opts" >&2 { (exit 1); exit 1; }; } ;; *) $as_echo "$as_me: WARNING: Unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac { $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || { $as_echo "$as_me: error: Working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { $as_echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." { $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures pnm2ppa 1.13 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/pnm2ppa] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of pnm2ppa 1.13:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --enable-syslog enable syslog [default=yes] --enable-debug enable debugging [default=no] --enable-vlink enable building parse_vlink [default=no] Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-language=EN | CZ | ES | FR | IT | NL Compiled in language Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF pnm2ppa configure 1.13 generated by GNU Autoconf 2.62 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by pnm2ppa $as_me 1.13, which was generated by GNU Autoconf 2.62. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 $as_echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------------- ## ## File substitutions. ## ## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then ac_site_file1=$CONFIG_SITE elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test -r "$ac_site_file"; then { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:$LINENO: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:$LINENO: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 $as_echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_config_headers="$ac_config_headers config.h" ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 $as_echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} { (exit 1); exit 1; }; } fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || { { $as_echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 $as_echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} { (exit 1); exit 1; }; } { $as_echo "$as_me:$LINENO: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if test "${ac_cv_build+set}" = set; then $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && { { $as_echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 $as_echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 $as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} { (exit 1); exit 1; }; } fi { $as_echo "$as_me:$LINENO: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 $as_echo "$as_me: error: invalid value of canonical build" >&2;} { (exit 1); exit 1; }; };; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:$LINENO: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if test "${ac_cv_host+set}" = set; then $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 $as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} { (exit 1); exit 1; }; } fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 $as_echo "$as_me: error: invalid value of canonical host" >&2;} { (exit 1); exit 1; }; };; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5 $as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } # Check whether --enable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval else USE_MAINTAINER_MODE=no fi { $as_echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5 $as_echo "$USE_MAINTAINER_MODE" >&6; } if test $USE_MAINTAINER_MODE = yes; then MAINTAINER_MODE_TRUE= MAINTAINER_MODE_FALSE='#' else MAINTAINER_MODE_TRUE='#' MAINTAINER_MODE_FALSE= fi MAINT=$MAINTAINER_MODE_TRUE am__api_version='1.10' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:$LINENO: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:$LINENO: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". { { $as_echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&5 $as_echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&2;} { (exit 1); exit 1; }; } fi test "$2" = conftest.file ) then # Ok. : else { { $as_echo "$as_me:$LINENO: error: newly created file is older than distributed files! Check your system clock" >&5 $as_echo "$as_me: error: newly created file is older than distributed files! Check your system clock" >&2;} { (exit 1); exit 1; }; } fi { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { $as_echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi { $as_echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if test "${ac_cv_path_mkdir+set}" = set; then $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. test -d ./--version && rmdir ./--version MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:$LINENO: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } mkdir_p="$MKDIR_P" case $mkdir_p in [\\/$]* | ?:[\\/]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_AWK+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:$LINENO: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then { { $as_echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 $as_echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} { (exit 1); exit 1; }; } fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='pnm2ppa' VERSION='1.13' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_STRIP+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:$LINENO: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 $as_echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. AMTAR=${AMTAR-"${am_missing_run}tar"} am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' CFLAGS="${CFLAGS} -Wall -Wsign-compare -Wfloat-equal -Wformat-security -g" # Checks for programs. ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:$LINENO: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 $as_echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:$LINENO: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:$LINENO: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:$LINENO: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&5 $as_echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools whose name does not start with the host triplet. If you think this configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 $as_echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. $as_echo "$as_me:$LINENO: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { (ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi { $as_echo "$as_me:$LINENO: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } if test -z "$ac_file"; then $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 $as_echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:$LINENO: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 $as_echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi fi fi { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } { $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } { $as_echo "$as_me:$LINENO: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 $as_echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext { $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT { $as_echo "$as_me:$LINENO: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if test "${ac_cv_objext+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 $as_echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:$LINENO: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:$LINENO: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo done .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote="\"" _am_result=BSD fi fi { $as_echo "$as_me:$LINENO: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi depcc="$CC" am_compiler_list= { $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi { $as_echo "$as_me:$LINENO: checking if cross compiling" >&5 $as_echo_n "checking if cross compiling... " >&6; } if test "x$cross_compiling" = "xno"; then CC_FOR_BUILD=${CC_FOR_BUILD-${CC-gcc}} { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } else CC_FOR_BUILD=${CC_FOR_BUILD-gcc} { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } fi # # do we need libm for 'sqrt' and 'pow'? # { $as_echo "$as_me:$LINENO: checking for library containing sqrt" >&5 $as_echo_n "checking for library containing sqrt... " >&6; } if test "${ac_cv_search_sqrt+set}" = set; then $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char sqrt (); int main () { return sqrt (); ; return 0; } _ACEOF for ac_lib in '' m; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_search_sqrt=$ac_res else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext if test "${ac_cv_search_sqrt+set}" = set; then break fi done if test "${ac_cv_search_sqrt+set}" = set; then : else ac_cv_search_sqrt=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_search_sqrt" >&5 $as_echo "$ac_cv_search_sqrt" >&6; } ac_res=$ac_cv_search_sqrt if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi { $as_echo "$as_me:$LINENO: checking for library containing pow" >&5 $as_echo_n "checking for library containing pow... " >&6; } if test "${ac_cv_search_pow+set}" = set; then $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pow (); int main () { return pow (); ; return 0; } _ACEOF for ac_lib in '' m; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_search_pow=$ac_res else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext if test "${ac_cv_search_pow+set}" = set; then break fi done if test "${ac_cv_search_pow+set}" = set; then : else ac_cv_search_pow=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_search_pow" >&5 $as_echo "$ac_cv_search_pow" >&6; } ac_res=$ac_cv_search_pow if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi # # other things we rely on # for ac_func in memmove memset strcasecmp strchr strdup do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 $as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then eval "$as_ac_var=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if test `eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` = yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:$LINENO: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 $as_echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if test "${ac_cv_path_GREP+set}" = set; then $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then { { $as_echo "$as_me:$LINENO: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 $as_echo "$as_me: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:$LINENO: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if test "${ac_cv_path_EGREP+set}" = set; then $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then { { $as_echo "$as_me:$LINENO: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 $as_echo "$as_me: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if test "${ac_cv_header_stdc+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } if test `eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` = yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in sys/param.h do as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 $as_echo_n "checking $ac_header usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 $as_echo_n "checking $ac_header presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## -------------------------------------------------- ## ## Report this to pnm2ppa-users@lists.sourceforge.net ## ## -------------------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi if test `eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` = yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done { $as_echo "$as_me:$LINENO: checking for inline" >&5 $as_echo_n "checking for inline... " >&6; } if test "${ac_cv_c_inline+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifndef __cplusplus typedef int foo_t; static $ac_kw foo_t static_foo () {return 0; } $ac_kw foo_t foo () {return 0; } #endif _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_c_inline=$ac_kw else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext test "$ac_cv_c_inline" != no && break done fi { $as_echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 $as_echo "$ac_cv_c_inline" >&6; } case $ac_cv_c_inline in inline | yes) ;; *) case $ac_cv_c_inline in no) ac_val=;; *) ac_val=$ac_cv_c_inline;; esac cat >>confdefs.h <<_ACEOF #ifndef __cplusplus #define inline $ac_val #endif _ACEOF ;; esac for ac_header in stdlib.h do as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 $as_echo_n "checking $ac_header usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 $as_echo_n "checking $ac_header presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## -------------------------------------------------- ## ## Report this to pnm2ppa-users@lists.sourceforge.net ## ## -------------------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi if test `eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` = yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done { $as_echo "$as_me:$LINENO: checking for GNU libc compatible malloc" >&5 $as_echo_n "checking for GNU libc compatible malloc... " >&6; } if test "${ac_cv_func_malloc_0_nonnull+set}" = set; then $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then ac_cv_func_malloc_0_nonnull=no else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #if defined STDC_HEADERS || defined HAVE_STDLIB_H # include #else char *malloc (); #endif int main () { return ! malloc (0); ; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_malloc_0_nonnull=yes else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_malloc_0_nonnull=no fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_func_malloc_0_nonnull" >&5 $as_echo "$ac_cv_func_malloc_0_nonnull" >&6; } if test $ac_cv_func_malloc_0_nonnull = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_MALLOC 1 _ACEOF else cat >>confdefs.h <<\_ACEOF #define HAVE_MALLOC 0 _ACEOF case " $LIBOBJS " in *" malloc.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS malloc.$ac_objext" ;; esac cat >>confdefs.h <<\_ACEOF #define malloc rpl_malloc _ACEOF fi { $as_echo "$as_me:$LINENO: checking for stdbool.h that conforms to C99" >&5 $as_echo_n "checking for stdbool.h that conforms to C99... " >&6; } if test "${ac_cv_header_stdbool_h+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #ifndef bool "error: bool is not defined" #endif #ifndef false "error: false is not defined" #endif #if false "error: false is not 0" #endif #ifndef true "error: true is not defined" #endif #if true != 1 "error: true is not 1" #endif #ifndef __bool_true_false_are_defined "error: __bool_true_false_are_defined is not defined" #endif struct s { _Bool s: 1; _Bool t; } s; char a[true == 1 ? 1 : -1]; char b[false == 0 ? 1 : -1]; char c[__bool_true_false_are_defined == 1 ? 1 : -1]; char d[(bool) 0.5 == true ? 1 : -1]; bool e = &s; char f[(_Bool) 0.0 == false ? 1 : -1]; char g[true]; char h[sizeof (_Bool)]; char i[sizeof s.t]; enum { j = false, k = true, l = false * true, m = true * 256 }; /* The following fails for HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */ _Bool n[m]; char o[sizeof n == m * sizeof n[0] ? 1 : -1]; char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; # if defined __xlc__ || defined __GNUC__ /* Catch a bug in IBM AIX xlc compiler version 6.0.0.0 reported by James Lemley on 2005-10-05; see http://lists.gnu.org/archive/html/bug-coreutils/2005-10/msg00086.html This test is not quite right, since xlc is allowed to reject this program, as the initializer for xlcbug is not one of the forms that C requires support for. However, doing the test right would require a runtime test, and that would make cross-compilation harder. Let us hope that IBM fixes the xlc bug, and also adds support for this kind of constant expression. In the meantime, this test will reject xlc, which is OK, since our stdbool.h substitute should suffice. We also test this with GCC, where it should work, to detect more quickly whether someone messes up the test in the future. */ char digs[] = "0123456789"; int xlcbug = 1 / (&(digs + 5)[-2 + (bool) 1] == &digs[4] ? 1 : -1); # endif /* Catch a bug in an HP-UX C compiler. See http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html */ _Bool q = true; _Bool *pq = &q; int main () { *pq |= q; *pq |= ! q; /* Refer to every declared value, to avoid compiler optimizations. */ return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l + !m + !n + !o + !p + !q + !pq); ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_stdbool_h=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdbool_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdbool_h" >&5 $as_echo "$ac_cv_header_stdbool_h" >&6; } { $as_echo "$as_me:$LINENO: checking for _Bool" >&5 $as_echo_n "checking for _Bool... " >&6; } if test "${ac_cv_type__Bool+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_type__Bool=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if (sizeof (_Bool)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if (sizeof ((_Bool))) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type__Bool=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_type__Bool" >&5 $as_echo "$ac_cv_type__Bool" >&6; } if test $ac_cv_type__Bool = yes; then cat >>confdefs.h <<_ACEOF #define HAVE__BOOL 1 _ACEOF fi if test $ac_cv_header_stdbool_h = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_STDBOOL_H 1 _ACEOF fi { $as_echo "$as_me:$LINENO: checking for size_t" >&5 $as_echo_n "checking for size_t... " >&6; } if test "${ac_cv_type_size_t+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_type_size_t=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if (sizeof (size_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if (sizeof ((size_t))) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_size_t=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5 $as_echo "$ac_cv_type_size_t" >&6; } if test $ac_cv_type_size_t = yes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned int _ACEOF fi # # Some systems need a special library for 'getopt_long' # (for example MacOS and FreeBSD). # { $as_echo "$as_me:$LINENO: checking for library containing getopt_long" >&5 $as_echo_n "checking for library containing getopt_long... " >&6; } if test "${ac_cv_search_getopt_long+set}" = set; then $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char getopt_long (); int main () { return getopt_long (); ; return 0; } _ACEOF for ac_lib in '' gnugetopt iberty; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_search_getopt_long=$ac_res else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext if test "${ac_cv_search_getopt_long+set}" = set; then break fi done if test "${ac_cv_search_getopt_long+set}" = set; then : else ac_cv_search_getopt_long=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_search_getopt_long" >&5 $as_echo "$ac_cv_search_getopt_long" >&6; } ac_res=$ac_cv_search_getopt_long if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi # # check if the syslog feature is present # On some systems other than the libc is required to use this feature # { $as_echo "$as_me:$LINENO: checking for library containing syslog" >&5 $as_echo_n "checking for library containing syslog... " >&6; } if test "${ac_cv_search_syslog+set}" = set; then $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char syslog (); int main () { return syslog (); ; return 0; } _ACEOF for ac_lib in '' bsd socket inet; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_search_syslog=$ac_res else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext if test "${ac_cv_search_syslog+set}" = set; then break fi done if test "${ac_cv_search_syslog+set}" = set; then : else ac_cv_search_syslog=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_search_syslog" >&5 $as_echo "$ac_cv_search_syslog" >&6; } ac_res=$ac_cv_search_syslog if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi # do we have a syslog feature? if test "${ac_cv_search_syslog}" = "no"; then # disable its usage cat >>confdefs.h <<\_ACEOF #define __NO_SYSLOG__ 1 _ACEOF else # # okay, 'syslog' is present. But should we use it? # { $as_echo "$as_me:$LINENO: checking whether to enable syslog" >&5 $as_echo_n "checking whether to enable syslog... " >&6; } # Check whether --enable-syslog was given. if test "${enable_syslog+set}" = set; then enableval=$enable_syslog; case "$enableval" in y | yes) CONFIG_SYSLOG=yes ;; *) CONFIG_SYSLOG=no ;; esac else CONFIG_SYSLOG=yes fi { $as_echo "$as_me:$LINENO: result: ${CONFIG_SYSLOG}" >&5 $as_echo "${CONFIG_SYSLOG}" >&6; } if test "${CONFIG_SYSLOG}" = "yes"; then cat >>confdefs.h <<\_ACEOF #define USE_SYSLOG 1 _ACEOF else cat >>confdefs.h <<\_ACEOF #define __NO_SYSLOG__ 1 _ACEOF fi fi # # Some things have to be done in accordance to the operating system # { $as_echo "$as_me:$LINENO: checking operating system" >&5 $as_echo_n "checking operating system... " >&6; } case $host in *-linux*) { $as_echo "$as_me:$LINENO: result: Linux" >&5 $as_echo "Linux" >&6; } ;; *-solaris*) { $as_echo "$as_me:$LINENO: result: SOLARIS" >&5 $as_echo "SOLARIS" >&6; } cat >>confdefs.h <<\_ACEOF #define __NO_LOG_PERROR__ /**/ _ACEOF ;; *-BeOS*) { $as_echo "$as_me:$LINENO: result: BeOS" >&5 $as_echo "BeOS" >&6; } # On BeOS the LDFLAGS should not be used. AM_LDFLAGS="" ;; *-darwin*) { $as_echo "$as_me:$LINENO: result: Darwin/MacOS X" >&5 $as_echo "Darwin/MacOS X" >&6; } CFLAGS="${CFLAGS} -no-cpp-precomp -traditional-cpp" ;; *-bsd*) { $as_echo "$as_me:$LINENO: result: FreeBSD" >&5 $as_echo "FreeBSD" >&6; } ;; *) { $as_echo "$as_me:$LINENO: result: unsupported operating system, pnm2ppa may fail" >&5 $as_echo "unsupported operating system, pnm2ppa may fail" >&6; } esac # # Debugging # { $as_echo "$as_me:$LINENO: checking whether to enable debugging" >&5 $as_echo_n "checking whether to enable debugging... " >&6; } # Check whether --enable-debug was given. if test "${enable_debug+set}" = set; then enableval=$enable_debug; case "$enableval" in y | yes) CONFIG_DEBUG=yes ;; *) CONFIG_DEBUG=no ;; esac else CONFIG_DEBUG=no fi { $as_echo "$as_me:$LINENO: result: ${CONFIG_DEBUG}" >&5 $as_echo "${CONFIG_DEBUG}" >&6; } if test "${CONFIG_DEBUG}" = "yes"; then cat >>confdefs.h <<\_ACEOF #define DEBUG 1 _ACEOF if true; then PNM2PPA_DEBUG_TRUE= PNM2PPA_DEBUG_FALSE='#' else PNM2PPA_DEBUG_TRUE='#' PNM2PPA_DEBUG_FALSE= fi CFLAGS="${CFLAGS} -O1" else CFLAGS="${CFLAGS} -O2 -DNDEBUG" if false; then PNM2PPA_DEBUG_TRUE= PNM2PPA_DEBUG_FALSE='#' else PNM2PPA_DEBUG_TRUE='#' PNM2PPA_DEBUG_FALSE= fi fi # # define the compiled in language # { $as_echo "$as_me:$LINENO: checking which language is to be used" >&5 $as_echo_n "checking which language is to be used... " >&6; } # Check whether --with-language was given. if test "${with_language+set}" = set; then withval=$with_language; ppa_language="$withval" fi # english language is the default if test -z "${ppa_language}"; then # default is english ppa_language=EN fi case "${ppa_language}" in EN | en) cat >>confdefs.h <<\_ACEOF #define LANG_EN /**/ _ACEOF used_language="english" ;; CZ | en) cat >>confdefs.h <<\_ACEOF #define LANG_CZ /**/ _ACEOF used_language="cech" ;; ES | es) cat >>confdefs.h <<\_ACEOF #define LANG_ES /**/ _ACEOF used_language="espanol" ;; FR | fr) cat >>confdefs.h <<\_ACEOF #define LANG_FR /**/ _ACEOF used_language="french" ;; IT | it) cat >>confdefs.h <<\_ACEOF #define LANG_IT /**/ _ACEOF used_language="italian" ;; NL | nl) cat >>confdefs.h <<\_ACEOF #define LANG_NL /**/ _ACEOF used_language="dutch" ;; *) { { $as_echo "$as_me:$LINENO: error: Unsupported language" >&5 $as_echo "$as_me: error: Unsupported language" >&2;} { (exit 1); exit 1; }; } ;; esac { $as_echo "$as_me:$LINENO: result: ${used_language}" >&5 $as_echo "${used_language}" >&6; } { $as_echo "$as_me:$LINENO: checking whether to build the 'parse_vlink' tool" >&5 $as_echo_n "checking whether to build the 'parse_vlink' tool... " >&6; } # Check whether --enable-vlink was given. if test "${enable_vlink+set}" = set; then enableval=$enable_vlink; case "$enableval" in y | yes) CONFIG_VLINK=yes ;; *) CONFIG_VLINK=no ;; esac else CONFIG_VLINK=no fi { $as_echo "$as_me:$LINENO: result: ${CONFIG_VLINK}" >&5 $as_echo "${CONFIG_VLINK}" >&6; } if test "${CONFIG_VLINK}" = "yes"; then if true; then BUILD_PARSE_VLINK_TRUE= BUILD_PARSE_VLINK_FALSE='#' else BUILD_PARSE_VLINK_TRUE='#' BUILD_PARSE_VLINK_FALSE= fi else if false; then BUILD_PARSE_VLINK_TRUE= BUILD_PARSE_VLINK_FALSE='#' else BUILD_PARSE_VLINK_TRUE='#' BUILD_PARSE_VLINK_FALSE= fi fi ac_config_files="$ac_config_files Makefile ppa_protocol/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 $as_echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${PNM2PPA_DEBUG_TRUE}" && test -z "${PNM2PPA_DEBUG_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"PNM2PPA_DEBUG\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"PNM2PPA_DEBUG\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${PNM2PPA_DEBUG_TRUE}" && test -z "${PNM2PPA_DEBUG_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"PNM2PPA_DEBUG\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"PNM2PPA_DEBUG\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${BUILD_PARSE_VLINK_TRUE}" && test -z "${BUILD_PARSE_VLINK_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"BUILD_PARSE_VLINK\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"BUILD_PARSE_VLINK\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${BUILD_PARSE_VLINK_TRUE}" && test -z "${BUILD_PARSE_VLINK_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"BUILD_PARSE_VLINK\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"BUILD_PARSE_VLINK\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi : ${CONFIG_STATUS=./config.status} ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # PATH needs CR # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. Blame Lee # E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 # Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by pnm2ppa $as_me 1.13, which was generated by GNU Autoconf 2.62. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_version="\\ pnm2ppa config.status 1.13 configured by $0, generated by GNU Autoconf 2.62, with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2008 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac CONFIG_FILES="$CONFIG_FILES '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac CONFIG_HEADERS="$CONFIG_HEADERS '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header { $as_echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; };; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { $as_echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "ppa_protocol/Makefile") CONFIG_FILES="$CONFIG_FILES ppa_protocol/Makefile" ;; *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 $as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || { $as_echo "$as_me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=' ' ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 $as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 $as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` = $ac_delim_num; then break elif $ac_last_try; then { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 $as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\).*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\).*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5 $as_echo "$as_me: error: could not setup config files machinery" >&2;} { (exit 1); exit 1; }; } _ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/ s/:*\${srcdir}:*/:/ s/:*@srcdir@:*/:/ s/^\([^=]*=[ ]*\):*/\1/ s/:*$// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_t=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_t"; then break elif $ac_last_try; then { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_HEADERS" >&5 $as_echo "$as_me: error: could not make $CONFIG_HEADERS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] if (D_is_set[macro]) { # Preserve the white space surrounding the "#". prefix = substr(line, 1, index(line, defundef) - 1) print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", line, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 { { $as_echo "$as_me:$LINENO: error: could not setup config headers machinery" >&5 $as_echo "$as_me: error: could not setup config headers machinery" >&2;} { (exit 1); exit 1; }; } fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 $as_echo "$as_me: error: Invalid tag $ac_tag." >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 $as_echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac ac_file_inputs="$ac_file_inputs '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:$LINENO: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin" \ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 $as_echo "$as_me: error: could not create $ac_file" >&2;} { (exit 1); exit 1; }; } ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` { as_dir="$ac_dir" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 $as_echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p ' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 $as_echo "$as_me: error: could not create $ac_file" >&2;} { (exit 1); exit 1; }; } test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out" && rm -f "$tmp/out";; *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; esac \ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 $as_echo "$as_me: error: could not create $ac_file" >&2;} { (exit 1); exit 1; }; } ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" } >"$tmp/config.h" \ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 $as_echo "$as_me: error: could not create $ac_file" >&2;} { (exit 1); exit 1; }; } if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:$LINENO: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$tmp/config.h" "$ac_file" \ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 $as_echo "$as_me: error: could not create $ac_file" >&2;} { (exit 1); exit 1; }; } fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ || { { $as_echo "$as_me:$LINENO: error: could not create -" >&5 $as_echo "$as_me: error: could not create -" >&2;} { (exit 1); exit 1; }; } fi # Compute "$ac_file"'s index in $config_headers. _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in "$ac_file" | "$ac_file":* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for "$ac_file"" >`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:$LINENO: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || for mf in $CONFIG_FILES; do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed 10q "$mf" | grep '^#.*generated by automake' > /dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` { as_dir=$dirpart/$fdir case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 $as_echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ;; esac done # for ac_tag { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5 $as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:$LINENO: WARNING: Unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: Unrecognized options: $ac_unrecognized_opts" >&2;} fi pnm2ppa-1.13/INSTALL0000644000076400007640000000010407132525137010775 00000000000000English You can find the build instructions in ./docs/en/INSTALL pnm2ppa-1.13/config.guess0000755000076400007640000012626011313235716012275 00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, # Inc. timestamp='2006-07-02' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Per Bothner . # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # The plan is that this can be called by configure scripts if you # don't specify an explicit build system type. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep __ELF__ >/dev/null then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm:riscos:*:*|arm:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[45]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep __LP64__ >/dev/null then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) case ${UNAME_MACHINE} in pc98) echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; i*:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; x86:Interix*:[3456]*) echo i586-pc-interix${UNAME_RELEASE} exit ;; EM64T:Interix*:[3456]*) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; arm*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; cris:Linux:*:*) echo cris-axis-linux-gnu exit ;; crisv32:Linux:*:*) echo crisv32-axis-linux-gnu exit ;; frv:Linux:*:*) echo frv-unknown-linux-gnu exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; mips:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips #undef mipsel #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mipsel #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips #else CPU= #endif #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^CPU/{ s: ::g p }'`" test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips64 #undef mips64el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mips64el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips64 #else CPU= #endif #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^CPU/{ s: ::g p }'`" test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) echo or32-unknown-linux-gnu exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-gnu ;; PA8*) echo hppa2.0-unknown-linux-gnu ;; *) echo hppa-unknown-linux-gnu ;; esac exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent # problems with other programs or directories called `ld' in the path. # Set LC_ALL=C to ensure ld outputs messages in English. ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ | sed -ne '/supported targets:/!d s/[ ][ ]*/ /g s/.*supported targets: *// s/ .*// p'` case "$ld_supported_targets" in elf32-i386) TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" ;; a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" exit ;; coff-i386) echo "${UNAME_MACHINE}-pc-linux-gnucoff" exit ;; "") # Either a pre-BFD a.out linker (linux-gnuoldld) or # one that does not give us useful --help. echo "${UNAME_MACHINE}-pc-linux-gnuoldld" exit ;; esac # Determine whether the default compiler is a.out or elf eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include #ifdef __ELF__ # ifdef __GLIBC__ # if __GLIBC__ >= 2 LIBC=gnu # else LIBC=gnulibc1 # endif # else LIBC=gnulibc1 # endif #else #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) LIBC=gnu #else LIBC=gnuaout #endif #endif #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^LIBC/{ s: ::g p }'`" test x"${LIBC}" != x && { echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit } test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i386. echo i386-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: pnm2ppa-1.13/config.sub0000755000076400007640000007746011313235716011747 00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, # Inc. timestamp='2006-09-20' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray) os= basic_machine=$1 ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx \ | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64vr | mips64vrel \ | mips64orion | mips64orionel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | mt \ | msp430 \ | nios | nios2 \ | ns16k | ns32k \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | score \ | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ | z8k) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64vr-* | mips64vrel-* \ | mips64orion-* | mips64orionel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ | xstormy16-* | xtensa-* \ | ymp-* \ | z8k-*) ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; c90) basic_machine=c90-cray os=-unicos ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16c) basic_machine=cr16c-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; mvs) basic_machine=i370-ibm os=-mvs ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc) basic_machine=powerpc-unknown ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; tic55x | c55x*) basic_machine=tic55x-unknown os=-coff ;; tic6x | c6x*) basic_machine=tic6x-unknown os=-coff ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -zvmoe) os=-zvmoe ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: pnm2ppa-1.13/depcomp0000755000076400007640000004224611313235716011333 00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2006-10-15.18 # Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006 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., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try \`$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by `PROGRAMS ARGS'. object Object file output by `PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputing dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the `deleted header file' problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. tr ' ' ' ' < "$tmpdepfile" | ## Some versions of gcc put a space before the `:'. On the theory ## that the space means something, we add a space to the output as ## well. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like `#:fec' to the end of the # dependency line. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr ' ' ' ' >> $depfile echo >> $depfile # The second pass generates a dummy entry for each header file. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> $depfile else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts `$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. stripped=`echo "$object" | sed 's/\(.*\)\..*$/\1/'` tmpdepfile="$stripped.u" if test "$libtool" = yes; then "$@" -Wc,-M else "$@" -M fi stat=$? if test -f "$tmpdepfile"; then : else stripped=`echo "$stripped" | sed 's,^.*/,,'` tmpdepfile="$stripped.u" fi if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi if test -f "$tmpdepfile"; then outname="$stripped.o" # Each line is of the form `foo.o: dependent.h'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; icc) # Intel's C compiler understands `-MD -MF file'. However on # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c # ICC 7.0 will fill foo.d with something like # foo.o: sub/foo.c # foo.o: sub/foo.h # which is wrong. We want: # sub/foo.o: sub/foo.c # sub/foo.o: sub/foo.h # sub/foo.c: # sub/foo.h: # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using \ : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" # Add `dependent.h:' lines. sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in `foo.d' instead, so we check for that too. # Subdirectories are respected. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then # With Tru64 cc, shared objects can also be used to make a # static library. This mechanism is used in libtool 1.4 series to # handle both shared and static libraries in a single compilation. # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. # # With libtool 1.5 this exception was removed, and libtool now # generates 2 separate objects for the 2 libraries. These two # compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 tmpdepfile2=$dir$base.o.d # libtool 1.5 tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.o.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d tmpdepfile4=$dir$base.d "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for `:' # in the target name. This is to cope with DOS-style filenames: # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. "$@" $dashmflag | sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' ' ' < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # X makedepend shift cleared=no for arg in "$@"; do case $cleared in no) set ""; shift cleared=yes ;; esac case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix="`echo $object | sed 's/^.*\././'`" touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' ' ' | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o, # because we must use -o when running libtool. "$@" || exit $? IFS=" " for arg do case "$arg" in "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" echo " " >> "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: pnm2ppa-1.13/install-sh0000755000076400007640000003160011313235716011752 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2006-10-14.15 # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # Put in absolute file names if you don't have them in your path; # or use environment vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" posix_glob= posix_mkdir= # Desired mode of installed file. mode=0755 chmodcmd=$chmodprog chowncmd= chgrpcmd= stripcmd= rmcmd="$rmprog -f" mvcmd="$mvprog" src= dst= dir_arg= dstarg= no_target_directory= usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: -c (ignored) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. --help display this help and exit. --version display version info and exit. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) shift continue;; -d) dir_arg=true shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; --help) echo "$usage"; exit $?;; -m) mode=$2 shift shift case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -s) stripcmd=$stripprog shift continue;; -t) dstarg=$2 shift shift continue;; -T) no_target_directory=true shift continue;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac done if test $# -ne 0 && test -z "$dir_arg$dstarg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dstarg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dstarg" shift # fnord fi shift # arg dstarg=$arg done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then trap '(exit $?); exit' 1 2 13 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names starting with `-'. case $src in -*) src=./$src ;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dstarg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dstarg # Protect names starting with `-'. case $dst in -*) dst=./$dst ;; esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dstarg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writeable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix=/ ;; -*) prefix=./ ;; *) prefix= ;; esac case $posix_glob in '') if (set -f) 2>/dev/null; then posix_glob=true else posix_glob=false fi ;; esac oIFS=$IFS IFS=/ $posix_glob && set -f set fnord $dstdir shift $posix_glob && set +f IFS=$oIFS prefixes= for d do test -z "$d" && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \ && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \ && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \ && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # Now rename the file to the real destination. { $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null \ || { # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { if test -f "$dst"; then $doit $rmcmd -f "$dst" 2>/dev/null \ || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null \ && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }; }\ || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } else : fi } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } } || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: pnm2ppa-1.13/missing0000755000076400007640000002557711313235716011365 00000000000000#! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2006-05-10.23 # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006 # Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # 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., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' sed_minuso='s/.* -o \([^ ]*\).*/\1/p' # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi msg="missing on your system" case $1 in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 # Exit code 63 means version mismatch. This often happens # when the user try to use an ancient version of a tool on # a file that requires a minimum version. In this case we # we should proceed has if the program had been absent, or # if --run hadn't been passed. if test $? = 63; then run=: msg="probably too old" fi ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' autom4te touch the output file, or create a stub one automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file tar try tar, gnutar, gtar, then tar without non-portable flags yacc create \`y.tab.[ch]', if possible, from existing .[ch] Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; esac # Now exit if we have it, but it failed. Also exit now if we # don't have it and --version was passed (most likely to detect # the program). case $1 in lex|yacc) # Not GNU programs, they don't have --version. ;; tar) if test -n "$run"; then echo 1>&2 "ERROR: \`tar' requires --run" exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then exit 1 fi ;; *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then # Could not run --version or --help. This is probably someone # running `$TOOL --version' or `$TOOL --help' to check whether # $TOOL exists and not knowing $TOOL uses missing. exit 1 fi ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case $1 in aclocal*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case $f in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te) echo 1>&2 "\ WARNING: \`$1' is needed, but is $msg. You might have modified some files without having the proper tools for further handling them. You can get \`$1' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison|yacc) echo 1>&2 "\ WARNING: \`$1' $msg. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if test $# -ne 1; then eval LASTARG="\${$#}" case $LASTARG in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.h fi ;; esac fi if test ! -f y.tab.h; then echo >y.tab.h fi if test ! -f y.tab.c; then echo 'main() { return 0; }' >y.tab.c fi ;; lex|flex) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if test $# -ne 1; then eval LASTARG="\${$#}" case $LASTARG in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if test ! -f lex.yy.c; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit 1 fi ;; makeinfo) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." # The file to touch is that specified with -o ... file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -z "$file"; then # ... or it is the one specified with @setfilename ... infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n ' /^@setfilename/{ s/.* \([^ ]*\) *$/\1/ p q }' $infile` # ... or it is derived from the source name (dir/f.texi becomes f.info) test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info fi # If the file does not exist, the user really needs makeinfo; # let's fail without touching anything. test -f $file || exit 1 touch $file ;; tar) shift # We have already tried tar in the generic part. # Look for gnutar/gtar before invocation to avoid ugly error # messages. if (gnutar --version > /dev/null 2>&1); then gnutar "$@" && exit 0 fi if (gtar --version > /dev/null 2>&1); then gtar "$@" && exit 0 fi firstarg="$1" if shift; then case $firstarg in *o*) firstarg=`echo "$firstarg" | sed s/o//` tar "$firstarg" "$@" && exit 0 ;; esac case $firstarg in *h*) firstarg=`echo "$firstarg" | sed s/h//` tar "$firstarg" "$@" && exit 0 ;; esac fi echo 1>&2 "\ WARNING: I can't seem to be able to run \`tar' with the given arguments. You may want to install GNU tar or Free paxutils, or check the command line arguments." exit 1 ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and is $msg. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: pnm2ppa-1.13/calibrate_ppa.c0000644000076400007640000005674411310765657012731 00000000000000/*************************************************************************** calibrate_ppa.c - program to produce PPM data for pnm2ppa calibration ------------------- begin : Thu Oct 12 2000 copyright : (C) 1998-2000 by the pnm2ppa project email : ***************************************************************************/ /*************************************************************************** * * * 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. * * * ***************************************************************************/ #ifdef HAVE_CONFIG_H # include "config.h" #endif /* incorporates color features added by Bruno ALIX */ #include #include #include #include #include #include #define __PNM2PPA_C__ #define __CALIBRATE_PPA_C__ #include "global.h" #include "image.h" #include "defaults.h" #include "pnmtools.h" int make_ppm_file ( FILE * , image_t *, char *) ; int make_test_pattern ( FILE *, int, char * ); /* int black_maxlines = 300; */ int black_maxlines = 128; /*put this back to old value for now (duncan)*/ void show_usage (char *prog) { printf ("usage: %s [ options ] [ -o ]] \n\n", prog); printf (" Produces various PixMap (PPM) files used for calibrating pnm2ppa.\n\n"); printf (" NOTE: The size of a full-page PixMap is 100MB!!.\n"); printf (" These PixMaps should be piped directly to pnm2ppa, except in the case of\n"); printf (" the -g option, where the PixMap should be viewed or printed by other means.\n\n"); printf (" -g, --gamma produce gamma.ppm (10MB, used in color calibration).\n"); printf (" -h, --help displays this help text.\n"); printf (" -o output to file , \"-o -\" means stdout (default)\n"); printf (" -p create test pattern number \n"); printf (" --align pattern 0: align print heads. (default) \n"); printf (" --test pattern 1: test alignment. \n"); printf (" --clean pattern 2: clean print head. \n"); printf (" --center pattern 3: center paper. \n"); printf (" -s default papersize (a4, legal, letter = us (default))\n"); #if 0 printf (" -v Printer model:710=712=720=722;820;1000 (default:7xx)\n"); #endif printf ("\n"); } int main (int argc, char *argv[]) { int opt_index; image_t image ; char *progname = NULL; BOOLEAN use_stdout = true ; BOOLEAN gamma = false ; FILE *outFile = NULL ; int testPattern = 0; char *out_filepath = NULL; char c; static struct option long_opts[] = { {"gamma",0,0,'g'}, {"align",0,0,0}, {"test",0,0,0}, {"clean",0,0,0}, {"center",0,0,0}, {"help",0,0,'h'}, {0, 0, 0, 0} }; gWidth = LETTERWIDTH; gHeight = LETTERHEIGHT ; /* read through the optional arguments before tring to find filenames */ while ((c = getopt_long (argc, argv, "gho:p:s:v:", long_opts, &opt_index)) != EOF) { progname = *argv; switch (c) { case 0: /* long options */ switch (opt_index) { case 0: /* --gamma */ gamma = true; break; case 1: /* --align */ gamma = false; testPattern = 0; break; case 2: /* --test */ gamma = false; testPattern = 1; break; case 3: /* --clean */ gamma = false; testPattern = 2; break; case 4: /* --center */ gamma = false; testPattern = 3; break; case 5: /* --help */ show_usage (*argv); return 0; break; default: break; } break; case 'g': gamma = true; break; case 'h': show_usage (*argv); return 0; break; case 'o': if (strncmp (optarg, "-", MAXPATHLEN) == 0) { use_stdout = true ; } else { if ( strlen(optarg) < MAXPATHLEN ) { char filepath[MAXPATHLEN]; strncpy(filepath, optarg, MAXPATHLEN); out_filepath = filepath ; use_stdout = false ; } } break; case 'p': /* select alternate test pattern */ gamma = false; testPattern = atoi( optarg ); break; case 's': /* paper size stuffer */ if (!strncmp (optarg, "us", 2) || !strncmp (optarg, "letter", 6)) { gWidth = LETTERWIDTH; gHeight = LETTERHEIGHT; } else if (!strncmp (optarg, "legal", 5)) { gWidth = LEGALWIDTH; gHeight = LEGALHEIGHT; } else if (!strncmp (optarg, "a4", 2)) { gWidth = A4WIDTH; gHeight = A4HEIGHT; } else { fprintf(stderr,"%s: unknown paper size \"%s\"\n", progname, optarg); exit (0); } break; #if 0 case 'v': /* printer model */ if (!strncmp (optarg, "820", 3) || !strncmp (optarg, "1000", 4)) black_maxlines = 128; else if (!strncmp (optarg, "71", 2) || !strncmp (optarg, "72", 2)) /* black_maxlines = 300; */ black_maxlines = 128; /*reverted for the moment - Duncan */ else { fprintf(stderr,"%s: unknown printer model \"%s\"\n", progname, optarg); exit (0); } break; #endif default: exit (0); break; } } if (use_stdout) outFile = stdout; else { outFile = fopen( out_filepath , "w"); fprintf(stderr,"%s: writing requested PPM data to \"%s\"\n", progname, out_filepath); } if (outFile == NULL ) { fprintf(stderr,"%s: cannot open output file \"%s\"\n", progname, out_filepath); return 0; } if ( gamma ) { /* production of PixMap gamma.ppm */ make_ppm_file( outFile , &image, progname ); } else { /* make PixMap test patterns for printer */ make_test_pattern( outFile, testPattern, progname ) ; } fclose (outFile); return 1 ; } int make_ppm_file (FILE *outFile , image_t *image , char * progname) { unsigned char *line = NULL ; image->width = gWidth; image->height = gHeight; image->bufferCurLine = 0; fprintf (outFile, "P6\n#PPM (PixMap) Image for comparison with printed output of \"pnm2ppa -g\"\n%d %d\n255\n", image->width, 64 + image->height / 20); line = malloc (image->width * 3); if (!(line)) { fprintf(stderr,"%s: malloc failed\n", progname); exit (1); } else { while ( image->bufferCurLine < image->height) { if ( ProduceGamma (image, line )) { fwrite (line, sizeof (unsigned char), (image->width * 3), outFile); } image->bufferCurLine++; } free (line); } return 1; } /* various test patterns */ void centering_grid( void ); void make_big_x( void ); void make_vertical_line( void ); void color_alignment( void ); void check_alignment( void ); void head_cleaning( void ); void color_squares( void ); void centering( void ); /* color coding scheme used */ /* each color is coded on 2 bits of 1 byte rrggbbxx (light grey is for head cleaning) */ enum { WHITE = 0xfc, /* white 11 11 11 00 = 000 = (255,255,255) */ BLACK = 0x00, /* black 00 00 00 00 = 444 = (000,000,000) */ CYAN = 0xbc, /* cyan 10 11 11 00 = 100 = (128,255,255) */ MAGENTA = 0xec, /* magenta 11 10 11 00 = 010 = (255,128,255) */ YELLOW = 0xf8, /* yellow 11 11 10 00 = 001 = (255,255,128) */ RED = 0xc0, /* red 11 00 00 00 = 044 = (255,000,000) */ GREEN = 0x30, /* green 00 11 00 00 = 404 = (000,255,000) */ BLUE = 0x0c, /* blue 00 00 11 00 = 004 = (000,000,255) */ GREY = 0xa8 /* light grey 10 10 10 00 = 111 = (128,128,128) */ }; int make_test_pattern (FILE *outFile, int testPattern , char * progname ) { int x; int line, maxlines = 128 ; /* create the pattern in strips starting at line line, with a maximum number of lines maxlines in the strip. */ Width = 8*(gWidth/8); /* make Width a multiple of 8 */ Height = gHeight; /* pixel dimensions */ #if 0 Pwidth = Width ; Pheight = Height ; #endif /* each color is coded on 2 bits if 1 byte rrggbbxx */ fprintf(outFile,"P6\n# pnm2ppa calibration image\n%d %d\n255\n", Width,Height); for ( line = 0; line < Height ; line += maxlines ) { BitMap_topline = line; BitMap_bottomline = line + maxlines; if ( BitMap_bottomline > Height) BitMap_bottomline = Height; BitMap_Height = BitMap_bottomline - BitMap_topline; BitMap_Width = Width; color_bitmap = (char *)malloc(BitMap_Width*BitMap_Height); /* set strip to white */ memset(color_bitmap,0xff,(BitMap_Width*BitMap_Height)); switch(testPattern) { case 0: color_alignment(); break; case 1: check_alignment(); break; case 2: head_cleaning(); break; case 3: centering(); break; #if 0 case 4: centering_grid(); break; case 4: color_squares(); break; case 5: make_vertical_line(); break; case 6: make_big_x(); break; #endif default: fprintf(stderr,"%s: unknown test pattern (%d)\n",progname,testPattern); fprintf(stderr,"test pattern 0 : cartridge alignment (default)\n"); fprintf(stderr," 1 : check alignment\n"); fprintf(stderr," 2 : colored stripes, use for head cleaning\n"); fprintf(stderr," 3 : center paper \n"); return 1; } for(x=0; x 0 ; i-=2 ) { mask = ( 0x03 << i ); v = ((color_bitmap [x] & mask) >> i); switch(v) { case 0x00: /* 4 drops of ink */ v=0x00; break; case 0x01: /* 3 drops of ink */ v=0x08; break; case 0x02: /* 1 drops of ink */ v=0x80; break; case 0x03: /* 0 drops of ink */ v=0xff; } putc(v, outFile); } } free(color_bitmap); } return 0; } void centering_grid( void ) { /* this pattern is a grid that can be used for centering the page*/ int x,y; char buf[128]; for(x=0; x 0) sprintf(buf,"+%d",y-10); else sprintf(buf,"%d",y-10); setstring(y*200+hpos,vpos+400,buf,5); } setstring(Width/2 -200,vpos+500,"COLOFFSX",7); /* vertical black/color offset pattern */ vpos=1200; hpos=Width/2-2150; for (t=1;t<10;t++) { for(y=0;y<101;y++) { setpixel(t*400+hpos+y,vpos,BLACK); setpixel(t*400+hpos+105+y,vpos-5+t*1,BLUE); setpixel(t*400+hpos+105+y,vpos-5+t*1+1,BLUE); setpixel(t*400+hpos+210+y,vpos,BLACK); } if ((t-5) > 0) sprintf(buf,"+%d",t-5); else sprintf(buf,"%d",t-5); setstring(t*400+hpos+150,vpos+50,buf,5); } setstring(Width/2-200,vpos+150,"COLOFFSY",7); /* colorshear setting (left-to-right / right-to-left sweep offsets) */ hpos=Width/2-2000; vpos=2000; direction = 1; /* this is determined by whether sweep is L2R or R2L */ for(y=1;y<20;y++) { shear= direction*(y-10); for(x=0;x<128;x++) { setpixel(y*200+hpos,x+vpos+000,BLUE); setpixel(y*200+hpos+1,x+vpos+000,BLUE); setpixel(y*200+hpos+shear,x+vpos+128,BLUE); setpixel(y*200+hpos+1+shear,x+vpos+128,BLUE); setpixel(y*200+hpos,x+vpos+256,BLUE); setpixel(y*200+hpos+1,x+vpos+256,BLUE); setpixel(y*200+hpos+shear,x+vpos+384,BLUE); setpixel(y*200+hpos+1+shear,x+vpos+384,BLUE); setpixel(y*200+hpos,x+vpos+512,BLUE); setpixel(y*200+hpos+1,x+vpos+512,BLUE); } if ((y-10) > 0) sprintf(buf,"+%d",y-10); else sprintf(buf,"%d",y-10); setstring(y*200+hpos,vpos+650,buf,5); } setstring(Width/2-200,vpos+750,"COLORSHEAR ",7); /* blackshear setting (left-to-right / right-to-left sweep offsets) */ hpos=Width/2-2000; vpos=3500; direction = -1; /* this is determined by whether sweep is L2R or R2L */ for(y=1;y<20;y++) { shear = -direction*(y-10); for(x=0; x < black_maxlines ;x++) { setpixel(y*200+hpos,x+vpos+000,BLACK); setpixel(y*200+hpos+shear,x+vpos+black_maxlines,BLACK); setpixel(y*200+hpos,x+vpos+2*black_maxlines,BLACK); setpixel(y*200+hpos+shear,x+vpos+3*black_maxlines,BLACK); setpixel(y*200+hpos,x+vpos+4*black_maxlines,BLACK); } if ((y-10) > 0) sprintf(buf,"+%d",y-10); else sprintf(buf,"%d",y-10); setstring(y*200+hpos,vpos+650+5*(black_maxlines-128),buf,5); } vpos = vpos + 5*(black_maxlines -128) ; setstring(Width/2-200,vpos+750,"BLACKSHEAR ",7); hpos=Width/2; vpos=4800; for(x=0;x<640;x++) { setpixel(hpos,vpos+x,BLACK); setpixel(hpos,vpos+640+x,BLUE); } } void check_alignment( void ) { /* alignment verification pattern */ int x,y; int vpos, vpos1, vpos2; int hpos, hpos1,hpos2; /* cross */ vpos=1000; hpos=Width/2-384; hpos+=384; for (x=0;x 0; y-- ) { setpixel(y,y, BLACK); setpixel(Width-y,y, BLACK); setpixel(y,Height-y, BLACK); setpixel(Width-y,Height-y, BLACK); setpixel(y,Height/2, BLACK); setpixel(Width-y,Height/2, BLACK); } for (x = 0; x < Height; x++) setpixel(Width/2,x, BLACK ); for (z = 50; z < 601; z += 50) { for (x = z; x <= Height -z; x++) { setpixel(z,x,BLACK); setpixel(Width-z,x,BLACK); } for (y = z; y <= Width -z;y++) { setpixel(y,z,BLACK); setpixel(y,Height-z,BLACK); } sprintf(buf,"%d",z); setstring (Width/2-30,z-15,buf,5); setstring(Width/2-30,Height-z-15,buf,5); setstringv(z-15,Height/2-60,buf,5); setstringv(Width-z-15,Height/2-60,buf,5); } setstring(700,Height/2-100,"XOFFSET",7); setstring(Width/2-150,800,"YOFFSET",7); } void head_cleaning( void ) { /* test page for cleaning */ int x,y,a,b,c; int vpos; char buf[128]; vpos=100; for (y=0;y<2500;y++) { a=y%250 ; b=y/50 ; if (a==0) { for (x=0;x<300;x++) { setpixel ( y+100,x+vpos,BLACK); } } else { for (x=0;x<6;x++) { a=x*50+b*1 ; if (a>300) a=a-300; setpixel (y+100,a+vpos,BLACK); } } } for (a=50;a<301;a+=50) { sprintf (buf,"%d",a); setstring (2510+100,vpos-50+a,buf,3); } for (y=0;y<(240*8);y++) { a=y%240 ; b=y/30 ; vpos=500; if (a==0) { for (x=0;x<128;x++) { setpixel ( y+100,x+vpos,MAGENTA); setpixel ( y+100,x+vpos+128,YELLOW); setpixel ( y+100,x+vpos+256,CYAN); } } else { for (x=0;x<1;x++) { a=x*50+b*2 ; if (a>128) a=a-128; setpixel (y+100,a+vpos,MAGENTA); setpixel (y+100,a+vpos+128,YELLOW); setpixel (y+100,a+vpos+256,CYAN); } } } vpos=1300; for (y=0;y<3500;y++) { a=y/500; switch (a) { case 0 : b = RED; break; case 1 : b = MAGENTA; break; case 2 : b = BLUE; break; case 3 : b = CYAN; break; case 4 : b = GREEN; break; case 5 : b = YELLOW; break; case 6 : b = RED; break; } for (x=0;x<128;x++) { setpixel (y+100,x+vpos,b); } } /*grey*/ vpos=2000; for (y=100;y #include "pnmtools.h" /* setpixel(x,y,color) writes a pixel with bytecode color at (x,y)*/ void setpixel(int x,int y, unsigned char color ) { int charidx; if( y < BitMap_topline || y >= BitMap_bottomline ) return; if( x < 0 || x >= BitMap_Width ) return; charidx = (y-BitMap_topline)*BitMap_Width+x; color_bitmap[charidx] = color ; } /*setplus(x,y,s) writes a black "+" of size s centered at (x,y) */ void setplus(int x,int y,int s) { int i; for(i=0; i='0' ) for(xo=0; xo<5; xo++) for(yo=0; yo<8; yo++) if((charmap[c-'0'][xo]>>yo)&1) setblock(x+xo*s,y+yo*s,s); if(c<='Z' && c>='A') for(xo=0; xo<5; xo++) for(yo=0; yo<8; yo++) if((charmap[c-'A'+10][xo]>>yo)&1) setblock(x+xo*s,y+yo*s,s); if(c=='-') for(xo=0; xo<5; xo++) for(yo=0; yo<8; yo++) if((charmap[36][xo]>>yo)&1) setblock(x+xo*s,y+yo*s,s); if(c=='+') for(xo=0; xo<5; xo++) for(yo=0; yo<8; yo++) if((charmap[37][xo]>>yo)&1) setblock(x+xo*s,y+yo*s,s); } /* setstring(x,y,*p,s) writes the string *p starting at (x,y), in characters of size s. The letters of the string must belong to the alphabet (0-9,A-Z,+,-) supported by setchar() */ void setstring(int x,int y,char* s,int size) { char* p; int xo; for(xo=0, p=s; *p; xo+=((6*size)+1), p++) setchar(x+xo,y,*p,size); } /* like setstring, but writes vertically downwards*/ void setstringv(int x,int y,char* s,int size) { char* p; int yo; for(yo=0, p=s; *p; yo+=((7*size)+1), p++) setchar(x,y+yo,*p,size); } /* setCG(x,y) writes a "centering symbol" at (x,y) */ void setCG(int x,int y) { int xo,yo,zo; for(xo=0; xo<=50; xo++) { yo=sqrt(50.0*50.0-xo*xo); setpixel(x+xo,y+yo,1); setpixel(x+yo,y+xo,1); setpixel(x-1-xo,y-1-yo,1); setpixel(x-1-yo,y-1-xo,1); setpixel(x+xo,y-1-yo,1); setpixel(x-1-xo,y+yo,1); for(zo=0; zo=Width) return; if(y=BitMap_bottomline) return; for(i=0; i #include #include #include "global.h" #include "defaults.h" #include "image.h" #include "gamma.h" int Make_GammaCurve ( double Gamma_R, double Gamma_G, double Gamma_B) { /*color correction curve derived from Gamma_R, Gamma_G, Gamma_B . Gamma_R = Gamma_G = Gamma_B = 1 gives no correction*/ int i; for (i = 0; i < 256; i++) { gEnh_curve_r[i] = (int) (pow ((double) i / 256, Gamma_R) * 256); gEnh_curve_g[i] = (int) (pow ((double) i / 256, Gamma_G) * 256); gEnh_curve_b[i] = (int) (pow ((double) i / 256, Gamma_B) * 256); } return 0; } double GammaValue( int i ) { double Gamma; Gamma = (double) (1.0 - 0.033 * i); return Gamma; } int ProduceGamma (image_t *image, unsigned char *line ) { int i, j, q; double Gamma_R, Gamma_B, Gamma_G; /* produces a single line of the gamma calibration output */ /* increase j to the value for this line */ for (j = 0; j * (image->height / 20) < image->bufferCurLine - 150; j++); Gamma_R = Gamma_B = Gamma_G = GammaValue (j); Make_GammaCurve ( Gamma_R, Gamma_G, Gamma_B); memset (line, 0xff, image->width * 3); if (((image->bufferCurLine - 150) % (image->height / 20) > 64)) { for (i = 150; i < image->width / 4; i++) { q = (unsigned char) (255.0 * (i - 150) / (image->width / 4 - 150)); /* R */ line[3 * i] = q; line[3 * i + 1] = 0; line[3 * i + 2] = 0; /* G */ line[3 * (i + image->width / 4)] = 0; line[3 * (i + image->width / 4) + 1] = q; line[3 * (i + image->width / 4) + 2] = 0; /* B */ line[3 * (i + 2 * image->width / 4)] = 0; line[3 * (i + 2 * image->width / 4) + 1] = 0; line[3 * (i + 2 * image->width / 4) + 2] = q; } } else for (i = 150; i < image->width / 4; i += (image->width / 40 - 15)) { line[3 * i] = line[3 * i + 1] = line[3 * i + 2] = 0; line[3 * (i + image->width / 4) + 1] = line[3 * (i + image->width / 4)] = line[3 * (i + image->width / 4) + 2] = 0; line[3 * (i + 2 * image->width / 4) + 2] = line[3 * (i + 2 * image->width / 4)] = line[3 * (i + 2 * image->width / 4) + 1] = 0; line[3 * (i + 1)] = line[3 * (i + 1) + 1] = line[3 * (i + 1) + 2] = 0; line[3 * (i + 1 + image->width / 4) + 1] = line[3 * (i + 1 + image->width / 4)] = line[3 * (i + 1 + image->width / 4) + 2] = 0; line[3 * (i + 1 + 2 * image->width / 4) + 2] = line[3 * (i + 1 + 2 * image->width / 4)] = line[3 * (i + 1 + 2 * image->width / 4) + 1] = 0; } if ((j == 1) || (j == 2 && (image->height / 20) > 64)) { /* this line should be written to the ppm output file */ return 1; } return 0; } pnm2ppa-1.13/pnm2ppa.c0000644000076400007640000007017311310765657011510 00000000000000/*************************************************************************** pnm2ppa.c - program to print PNM input streams to PPA Deskjets ------------------- begin : Thu Jan 13 2000 copyright : (C) 1998-2000 by the pnm2ppa project email : ***************************************************************************/ /*************************************************************************** * * * 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. * * * ***************************************************************************/ #ifdef HAVE_CONFIG_H # include "config.h" #endif #include #include #include #include #include #include #include #define __PNM2PPA_C__ #include "ppa_syslog.h" #include "global.h" #include "image.h" #include "debug.h" #include "defaults.h" #include "ppa.h" #include "pnm2ppa.h" #include "gamma.h" #include "lang.h" double Gamma_R, Gamma_G, Gamma_B; int adjust_coloffsx, adjust_coloffsy; int print_pnm (FILE * fptr) { char line[1024]; image_t image; int numpages = 0, pagenum ; int res; int image_width; snprintf(syslog_message,message_size,"%s", gMessages[LOG_START]); wrap_syslog (LOG_INFO,"%s",syslog_message); ppa_init_job (&printer); while (initImage (&image, fptr)) { pagenum = numpages + 1; DPRINTF ("Initializing page %d...\n ", pagenum); ppa_init_page (&printer); DPRINTF ("Done!\n"); DPRINTF ("Loading page %d... \n", pagenum); ppa_load_page (&printer); DPRINTF ("Done!\n"); image_width = image.width * 3 * sizeof (int) ; DPRINTF ("image.width * 3 * sizeof(int)) == %d\n", image_width ); gErrVec = malloc (image_width ); if (!gErrVec) { snprintf(syslog_message,message_size,"print_pnm(): %s", gMessages[E_BADMALLOC]); wrap_syslog (LOG_CRIT, "%s",syslog_message); exit (1); } memset (gErrVec, 0x00, image_width ); gErrVec_bw = malloc (image_width ); if (!gErrVec_bw) { snprintf(syslog_message,message_size, "print_pnm(): %s", gMessages[E_BADMALLOC]); wrap_syslog (LOG_CRIT, "%s",syslog_message); exit (1); } memset (gErrVec_bw, 0x00, image_width ); snprintf(syslog_message,message_size, "%s %d (%s)\n", gMessages[LOG_PAGE], pagenum, gFormat); wrap_syslog (LOG_INFO, "%s",syslog_message); if ((res = ppa_print_page (&printer, &image)) != 0) { DPRINTF ("ppa_print_page returned %d!!\n", res); free (gErrVec); return res; } free (gErrVec); free (gErrVec_bw); snprintf(syslog_message,message_size, "%s %d\n", gMessages[LOG_FINISH], pagenum ); wrap_syslog (LOG_INFO, "%s",syslog_message); DPRINTF ("Ejecting page %d... \n", pagenum); ppa_eject_page (&printer); DPRINTF ("Ejected!\n"); /* eat any remaining whitespace */ if (image.version == P1_PBM) fgets (line, 1024, fptr); numpages++; if (gGammaMode) break; } if (numpages == 0) { snprintf(syslog_message,message_size,"%s" , gMessages[LOG_NOPAGES]); wrap_syslog (LOG_INFO, "%s",syslog_message); return 1; } ppa_end_print (&printer); snprintf(syslog_message,message_size,"%s" , gMessages[LOG_SUCCESS]); wrap_syslog (LOG_INFO, "%s",syslog_message); fclose (image.fptr); fclose (printer.fptr); return 0; } /* safe transcription of paths specified in user input */ char * readPath(char *input ) { char File_path[MAXPATHLEN]; char *path = NULL; /* security audit ajv 20001007; be very careful with input strings!*/ if (strlen(input) < MAXPATHLEN ) { if ( strncpy (File_path, input, MAXPATHLEN )) { /* a user-specifed file *File_path may later be opened; should any extra validation of this be performed now ? */ /* remember to free(path) after use! */ path = strdup(File_path); return path; } } else { snprintf(syslog_message,message_size,"%s %d\n", gMessages[E_BAD_PATH], MAXPATHLEN); wrap_syslog (LOG_CRIT,"%s",syslog_message); abort(); } return path; } /* this should be called when you need to set up the printer * object for a particular printer. */ void set_printer_specific_defaults (void) { if (printer.version != NOPRINTER && printer.version != HP7X0 && printer.version != HP820 && printer.version != HP1000) { snprintf(syslog_message,message_size, "set_printer_defaults(): %s", gMessages[E_PPA_UNKNOWN]); wrap_syslog (LOG_CRIT,"%s",syslog_message); exit (1); } printer.ColBwOffsX = gPrinterDefaults[printer.version].ColBwOffsX; printer.ColBwOffsY = gPrinterDefaults[printer.version].ColBwOffsY; printer.x_offset = gPrinterDefaults[printer.version].x_offset; printer.y_offset = gPrinterDefaults[printer.version].y_offset; printer.r2l_col_offset = gPrinterDefaults[printer.version].r2l_col_offset; printer.r2l_bw_offset = gPrinterDefaults[printer.version].r2l_bw_offset; printer.top_margin = gPrinterDefaults[printer.version].top_margin; printer.bottom_margin = gPrinterDefaults[printer.version].bottom_margin; printer.left_margin = gPrinterDefaults[printer.version].left_margin; printer.right_margin = gPrinterDefaults[printer.version].right_margin; printer.marg_diff = gPrinterDefaults[printer.version].marg_diff; printer.bufsize = gPrinterDefaults[printer.version].bufsize; printer.min_pagewidth = gPrinterDefaults[printer.version].min_pagewidth; printer.max_pagewidth = gPrinterDefaults[printer.version].max_pagewidth; printer.min_pageheight = gPrinterDefaults[printer.version].min_pageheight; printer.max_pageheight = gPrinterDefaults[printer.version].max_pageheight;} void show_usage (char *prog) { printf ("usage: %s [ options ] [-i ] [ -o ]] \n\n", prog); printf (" Prints a pnm- or pnmraw-format to HP720/820/1000-format .\n\n"); printf (" -b bottom margin in 1\"/600 (default: 150 = 0.25\")\n"); printf (" --bi forces bidirectional print head sweeps\n"); printf (" -B density of black ink (n = 0,1,2,3 or 4)\n"); printf (" --bw forces black/white output\n"); printf (" -d dumps the configuration to stdout\n"); printf (" --eco Econofast mode (uses less ink)\n"); printf (" --dpi300 Treat input resolution as 300dpi instead of 600dpi\n"); printf (" -f read printer settings from configuration file \n"); printf (" -F read color correction table from file \n"); printf (" --fd use fast dithering mode\n"); printf (" -g print color calibration page. See CALIBRATION.txt\n"); printf (" -h, --help displays this help text.\n"); printf (" -i input from file , \"-i -\" means stdin\n"); printf (" -l left margin in 1\"/600 (default: 150 = 0.25\")\n"); printf (" --noGamma suppresses any color correction\n"); printf (" -o output to file , \"-o -\" means stdout\n"); printf (" -p disable black ink cartridge\n"); printf (" -r right margin in 1\"/600 (default: 150 = 0.25\")\n"); printf (" -s default papersize (a4, legal, letter = us (default))\n"); printf (" -t top margin in 1\"/600 (default: 150 = 0.25\")\n"); printf (" --uni forces unidirectional print head sweeps\n"); printf (" -v set the printer model (710, 712, 720, 722, 820, or 1000)\n"); printf (" --verbose outputs syslog output to stderr as well\n"); printf (" --version Display the version of %s to the syslog\n", prog); printf (" -x vertical offset adjustment in 1\"/600\n"); printf (" -y horizontal offset adjustment in 1\"/600\n\n"); printf (" The -v option resets the margins and offset adjustments to the \n"); printf (" default values for that printer model. and default\n"); printf (" to stdin and stdout. '-' is a synonym for stdin and stdout.\n\n"); printf (" Configuration files specified with the '-f' parameter have the following\n format:\n\n"); printf (" # Comment\n"); printf (" \n"); printf (" \n"); printf (" [etc.]\n\n"); printf (" Valid keys include 'version', 'xoffset', 'yoffset', 'topmargin', 'leftmargin',\n"); printf (" 'rightmargin', 'bottommargin', 'blackness', 'papersize', or any non-null\n"); printf (" truncated version of these words. Valid values are the same as with \n"); printf (" the corresponding command-line parameters.\n"); printf (" Other keys that can be only set in the configuration file include:\n"); printf (" 'silent', 'verbose', 'log_info',\n"); printf (" 'unimode', 'blackshear', 'colorshear',\n"); printf (" 'RedGammaIdx','BlueGammaIdx', 'GreenGammaIdx',\n"); printf (" 'GammaR', 'GammaG', 'GammaB',\n"); printf (" 'ColOffsX', 'ColOffsY',\n"); printf (" 'black_ink', 'color_ink', 'cyan_ink', 'magenta_ink', 'yellow_ink',\n"); printf (" 'compression';\n"); printf (" see documentation in the sample configuration file for their usage.\n\n"); printf (" The order in which parameters are specified is important:\n"); printf (" the file %s, if it exists, is processed as a configuration\n", defaultcfgfile); printf (" file before any command-line parameters are processed.\n"); printf (" If an alternate configuration file is specified on the command line\n"); printf (" with the '-f' parameter, its contents are processed at that point.\n"); printf (" If a parameter is specified more than once, only its last value is used.\n\n"); } void parm_version (char *arg) { if (!strcasecmp (arg, "hp720") || !strcmp (arg, "720") || !strcasecmp (arg, "hp722") || !strcmp (arg, "722") || !strcasecmp (arg, "hp710") || !strcmp (arg, "710") || !strcasecmp (arg, "hp712") || !strcmp (arg, "712")) printer.version = HP7X0; else if (!strcasecmp (arg, "hp820") || !strcmp (arg, "820")) printer.version = HP820; else if (!strcasecmp (arg, "hp1000") || !strcmp (arg, "1000")) printer.version = HP1000; else { snprintf(syslog_message,message_size,"parm_version(): %s", gMessages[E_PPA_UNKNOWN]); wrap_syslog (LOG_CRIT,"%s",syslog_message); exit (1); } set_printer_specific_defaults (); } void parm_iversion (int arg) { switch (arg) { case 0: printer.version = NOPRINTER; break; case 720: case 722: case 710: case 712: printer.version = HP7X0; break; case 820: printer.version = HP820; break; case 1000: printer.version = HP1000; break; default: { snprintf(syslog_message,message_size,"parm_iversion(): %s", gMessages[E_PPA_UNKNOWN]); wrap_syslog (LOG_CRIT,"%s",syslog_message); exit (1); } } set_printer_specific_defaults (); } void dump_config (void) { printf ("pnm2ppa version " VERSION "\n\n"); printf ("Printer: "); switch (printer.version) { case HP7X0: printf ("HP 710c, 712c, 720c or 722c\n\n"); break; case HP820: printf ("HP820\n\n"); break; case HP1000: printf ("HP1000\n\n"); break; case NOPRINTER: default: printf ("unknown printer\n"); exit (1); } printf ("Color Head Offset Adjustments:\n ColOffsX: %d\n ColOffsY: %d\n\n", adjust_coloffsx, adjust_coloffsy); printf ("Offsets:\n xoffset: %d\n yoffset: %d\n\n", printer.x_offset, printer.y_offset); printf ("Shearing corrections for bidirectional printing (right_to_left):\n blackshear: %d\n colorshear: %d\n\n", printer.r2l_bw_offset, printer.r2l_col_offset); printf ("Margins:\n\ttop:\t%d\n\tbottom:\t%d\n", printer.top_margin, printer.bottom_margin); printf ("\tleft:\t%d\n\tright:\t%d\n\n", printer.left_margin, printer.right_margin); printf ("Gamma values:\n\tRed:\t%f\n\tGreen:\t%f\n\tBlue:\t%f\n", Gamma_R, Gamma_G, Gamma_B ); exit (0); } /* only let gSilent be set to switch off syslog from $SYSCONFDIR/etc/pnm2ppa.conf, and not from subsequent readings of config files */ BOOLEAN system_config_file ; void read_config_file (char *fname) { FILE *cfgfile = fopen (fname, "r"); char line[1024], key[14], buf[10]; int len, value, count, lineno = 1; if (!cfgfile) { snprintf(syslog_message,message_size,"read_config_file(): %s", gMessages[E_BADCONFIGFILE] ); wrap_syslog (LOG_CRIT,"%s",syslog_message); exit (1); } while (fgets (line, 1024, cfgfile)) { if (strchr (line, '#')) *strchr (line, '#') = 0; count = sscanf (line, "%13s%9s", key, buf); if (count == 2) { DPRINTF("config file %s: keyword %s value %s\n",fname,key,buf); } switch (count) { case 2: value = atoi (buf); len = strlen (key); if (!strncmp (key, "version", len)) parm_iversion (value); else if (!strncmp (key, "xoffset", len)) printer.x_offset = value; else if (!strncmp (key, "yoffset", len)) printer.y_offset = value; else if (!strncmp (key, "blackshear", len)) printer.r2l_bw_offset = value; else if (!strncmp (key, "colorshear", len)) printer.r2l_col_offset = value; else if (!strncmp (key, "dump", len)) dump_config (); else if (!strncmp (key, "topmargin", len)) printer.top_margin = value; else if (!strncmp (key, "leftmargin", len)) printer.left_margin = value; else if (!strncmp (key, "rightmargin", len)) printer.right_margin = value; else if (!strncmp (key, "bottommargin", len)) printer.bottom_margin = value; else if (!strncmp (key, "GammaR", len)) Gamma_R = atof(buf); else if (!strncmp (key, "GammaG", len)) Gamma_G = atof(buf); else if (!strncmp (key, "GammaB", len)) Gamma_B = atof(buf); else if (!strncmp (key, "RedGammaIdx", len)) Gamma_R = GammaValue(value); else if (!strncmp (key, "GreenGammaIdx", len)) Gamma_G = GammaValue(value); else if (!strncmp (key, "BlueGammaIdx", len)) Gamma_B = GammaValue(value); else if (!strncmp (key, "ColOffsX", len)) adjust_coloffsx = value; else if (!strncmp (key, "ColOffsY", len)) adjust_coloffsy = value; else if (!strncmp (key, "blackness", len)) gBlackness = value; else if (!strncmp (key, "unimode", len)) { if ( value ) gUnimode = true ; else gUnimode = false ; } else if (!strncmp (key, "black_ink", len)) { if ( value ) gBlack = true ; else gBlack = false ; } else if (!strncmp (key, "cyan_ink", len)) { if ( value ) gCyan = true ; else gCyan = false ; } else if (!strncmp (key, "magenta_ink", len)) { if ( value ) gMagenta = true ; else gMagenta = false ; } else if (!strncmp (key, "yellow_ink", len)) { if ( value ) gYellow = true ; else gYellow = false ; } else if (!strncmp (key, "color_ink", len)) { if ( value ) { gCyan = true ; gMagenta = true ; gYellow = true ; } else { gCyan = false ; gMagenta = false ; gYellow = false ; } } else if (!strncmp (key, "silent", len)) { if (system_config_file) { gSilent = true; wrap_closelog(); } } else if (!strncmp (key, "log_info", len)) { if (system_config_file) { if ( value ) gLogInfo = true ; else gLogInfo = false ; } } else if (!strncmp (key, "verbose", len)) { gVerbose = true; if (!(gSilent)) { wrap_closelog (); wrap_openlog ("pnm2ppa", 1); } snprintf(syslog_message,message_size, "pnm2ppa: %s", gMessages[LOG_VERBOSE]); wrap_syslog(LOG_INFO,"%s",syslog_message); } else if (!strncmp (key, "papersize", len)) { if (!strncmp (buf, "us", 2) || !strncmp (buf, "letter", 6)) { gWidth = LETTERWIDTH; gHeight = LETTERHEIGHT; } else if (!strncmp (buf, "legal", 5)) { gWidth = LEGALWIDTH; gHeight = LEGALHEIGHT; } else if (!strncmp (buf, "a4", 2)) { gWidth = A4WIDTH; gHeight = A4HEIGHT; } else { snprintf(syslog_message,message_size,"read_config_file(): %s", gMessages[E_BAD_PAPER] ); wrap_syslog (LOG_CRIT,"%s",syslog_message); exit (1); } } else if (!strncmp (key, "compression", len)) { if ( value ) gCompress = true ; else gCompress = false ; } else { snprintf(syslog_message,message_size,"read_config_file(): %s (%s %d)\n", gMessages[E_BADPARM] , gMessages[LINE],lineno ); wrap_syslog (LOG_CRIT,"%s",syslog_message); show_usage ("pnm2ppa"); exit (1); } case EOF: case 0: break; default: snprintf(syslog_message,message_size, "read_config_file(): %s %s %d\n", gMessages[E_PARSE_CONFIG], gMessages[LINE], lineno); wrap_syslog (LOG_CRIT,"%s",syslog_message); exit (1); } lineno++; } if (feof (cfgfile)) { fclose (cfgfile); return; } snprintf(syslog_message,message_size,"read_config_file(): %s\n", gMessages[E_PARSE_CONFIG]); wrap_syslog (LOG_CRIT,"%s",syslog_message); exit (1); } int main (int argc, char *argv[]) { int i, opt_index; FILE *in = NULL, *out = NULL, *gf = NULL; struct stat tmpstat; int c; BOOLEAN get_Gamma = true; char gammaFile[MAXPATHLEN]; char pnm_inputFile[MAXPATHLEN]; char ppa_outputFile[MAXPATHLEN]; BOOLEAN use_stdin = false; BOOLEAN use_stdout = false; BOOLEAN got_Input = false; BOOLEAN got_Output = false; BOOLEAN got_Gamma = false; gSilent = false; gVerbose = false; system_config_file = true; #ifdef __NO_SYSLOG__ gSilent = true; #endif strncpy(gammaFile,defaultgammafile,MAXPATHLEN); /* activate syslog */ if (!(gSilent)) { #ifdef DEBUG wrap_openlog( "pnm2ppa", 1); #else wrap_openlog( "pnm2ppa", 0); #endif } if (argc < 2) { show_usage (*argv); exit (0); } /* setup the printer object */ printer.version = HP7X0; set_printer_specific_defaults (); /* initialize global variables with default values */ gEcoMode = false; gWidth = LETTERWIDTH; gHeight = LETTERHEIGHT; gBlackness = 2; gPixmapMode = false; gGammaMode = false; gColorMode = true; gFastMode = false; gUnimode = false; g300 = false; gCompress = true; gLogInfo = false; /* no LOG_INFO syslog messages by default */ gBlack = true; gCyan = true; gMagenta = true; gYellow = true; Gamma_R = 1.0; Gamma_G = 1.0; Gamma_B = 1.0; adjust_coloffsx = 0; adjust_coloffsy = 0; if (!stat (defaultcfgfile, &tmpstat)) read_config_file (defaultcfgfile); system_config_file = false; /* read through the optional arguments before tring to find filenames */ while ((c = getopt_long (argc, argv, "F:B:b:df:ghi:l:o:pr:s:t:v:x:y:", long_opts, &opt_index)) != EOF) { switch (c) { case 0: /* long options */ switch (opt_index) { case 0: /* --bw Black & White */ gColorMode = false; #if 0 gEcoMode = false; /*this is not needed here (?) duncan*/ #endif gMaxPass = 1; break; case 1: /* --fd Fast Dither*/ gFastMode = true; gMaxPass = 1; break; case 2: /* --version (output to stderr, not syslog) */ fprintf(stderr,"%s %s %s %s %s\n", *argv, gMessages[LOG_VERSION], VERSION, __DATE__, __TIME__); exit (0); break; case 3: /* --help */ show_usage (*argv); return 0; break; case 4: /* --verbose */ gVerbose = true; if (!(gSilent)) { wrap_closelog (); wrap_openlog ("pnm2ppa", 1); } break; case 5: /* --eco */ gEcoMode = true; break; case 6: /* --noGamma */ get_Gamma = false; break; case 7: /* --uni */ gUnimode = true; break; case 8: /* --bi */ gUnimode=false; break; case 9: /* --dpi300 */ g300=true; break; default: snprintf(syslog_message,message_size,"main (): %s", gMessages[E_UNKNOWN_ARG]); wrap_syslog (LOG_CRIT,"%s",syslog_message); DPRINTF(" unknown longopt switch case should not happen"); return 1; break; } break; case 'b': printer.bottom_margin = atoi (optarg); break; case 'B': gBlackness = atoi(optarg); break; case 'd': dump_config (); break; case 'f': { char *configFile=NULL; configFile = readPath (optarg); if (configFile) { read_config_file (configFile); free(configFile); } } break; case 'F': { char *path=NULL; path = readPath (optarg); if (path) { strncpy(gammaFile,path,MAXPATHLEN); free(path); } } break; case 'g': gGammaMode = true; break; case 'h': show_usage (*argv); return 0; break; case 'i': if (strncmp (optarg, "-", MAXPATHLEN) == 0) { use_stdin = true; got_Input = true; } else { char *path=NULL; path = readPath (optarg); if (path) { strncpy(pnm_inputFile,path,MAXPATHLEN); free(path); use_stdin = false; got_Input = true; } } break; case 'l': printer.left_margin = atoi (optarg); break; case 'o': if (strncmp (optarg, "-", MAXPATHLEN) == 0) { use_stdout = true; got_Output = true; } else { char *path=NULL; path = readPath(optarg); if (path) { strncpy(ppa_outputFile,path,MAXPATHLEN); free(path); use_stdout = false ; got_Output = true; } } break; case 'p': gPixmapMode = true; break; case 'r': printer.right_margin = atoi (optarg); break; case 's': /* paper size stuffer (only used in -g mode ) */ if (!strncmp (optarg, "us", 2) || !strncmp (optarg, "letter", 6)) { gWidth = LETTERWIDTH; gHeight = LETTERHEIGHT; } else if (!strncmp (optarg, "legal", 5)) { gWidth = LEGALWIDTH; gHeight = LEGALHEIGHT; } else if (!strncmp (optarg, "a4", 2)) { gWidth = A4WIDTH; gHeight = A4HEIGHT; } else { snprintf(syslog_message,message_size,"main(): %s ", gMessages[E_BAD_PAPER] ); wrap_syslog (LOG_CRIT,"%s",syslog_message); return 1; } break; case 't': printer.top_margin = atoi (optarg); break; case 'v': parm_version (optarg); break; case 'x': printer.x_offset = atoi (optarg); break; case 'y': printer.y_offset = atoi (optarg); break; default: snprintf(syslog_message,message_size,"main(): %s", gMessages[E_UNKNOWN_ARG]); wrap_syslog (LOG_CRIT,"%s",syslog_message); return 1; break; } } /* open input stream, if already specified */ if (got_Input) { if (use_stdin) in = stdin; else { if ((in = fopen (pnm_inputFile, "rb")) == NULL) { snprintf(syslog_message,message_size,"main(): %s", gMessages[E_BAD_INPUT]); wrap_syslog (LOG_CRIT,"%s",syslog_message); return 1; } } } /* open output stream, if already specified */ if (got_Output) { if (use_stdout) out = stdout; else { if ((out = fopen (ppa_outputFile, "wb")) == NULL) { snprintf(syslog_message,message_size,"main(): %s", gMessages[E_BAD_OUTPUT] ); wrap_syslog (LOG_CRIT,"%s",syslog_message); return 1; } } } /* move on to the list argument*/ argc -= optind; argv += optind; /* if the user hasn't yet specified -i or -o, we see if there are any remaining arguments. Only allows both arguments to work here. This is a legacy option style used by pbm2ppa */ if (argc == 2 && !in && !out) { if (strncmp (argv[1], "-", MAXPATHLEN) == 0) { in = stdin; } else { if ((in = fopen (argv[0], "rb")) == NULL) { snprintf(syslog_message,message_size,"main(): %s", gMessages[E_BAD_INPUT]); wrap_syslog (LOG_CRIT,"%s",syslog_message); return 1; } } if (strncmp (argv[1], "-", MAXPATHLEN) == 0) { out = stdout; } else { if ((out = fopen (argv[1], "wb")) == NULL) { snprintf(syslog_message,message_size,"main(): %s", gMessages[E_BAD_OUTPUT]); wrap_syslog (LOG_CRIT,"%s",syslog_message); return 1; } } } /* if no input is specified, we terminate */ /* if the user doesn't specify output file, we make like a pipe*/ if (in == NULL) exit(0); if (out == NULL) out = stdout; printer.fptr = out; /* set minimum and maximum paper sizes for the printer (the DeskJet 1000C has different limits from other models ) */ gminWidth = printer.min_pagewidth ; gmaxWidth = printer.max_pagewidth ; gminHeight = printer.min_pageheight ; gmaxHeight = printer.max_pageheight ; /* set gMaxPass (number of sweeps for Floyd-Steenberg dithered color printing) */ gMaxPass = 1; if ( gColorMode && !(gEcoMode) ) gMaxPass = 4; /* adjust color/bw offsets (alignment corrections) */ printer.ColBwOffsY += adjust_coloffsy; printer.ColBwOffsX += adjust_coloffsx; /* initialize color correction curve (used in Floyd-Steenberg dithered color) */ /* initialize for no color correction */ for (i = 0; i < 256; i++) { gEnh_curve_r[i] = i; gEnh_curve_g[i] = i; gEnh_curve_b[i] = i; } /* if color correction is used */ if (get_Gamma) { gf = fopen (gammaFile, "rb"); if (gf == NULL) { DPRINTF ("Can't open gamma correction curve file %s!\n", gammaFile); } else { int num_read=0; got_Gamma = true ; /* read the gamma correction curve from gammaFile */ DPRINTF("main(): reading color correction curve from %s\n",gammaFile); num_read = fread (gEnh_curve_r, sizeof (int), 256, gf) ; DPRINTF(" num_read= %d\n",num_read); if ( num_read != 256 ) got_Gamma = false ; if (got_Gamma) { num_read = fread (gEnh_curve_g, sizeof (int), 256, gf); DPRINTF(" num_read= %d\n",num_read); if ( num_read != 256 ) got_Gamma = false ; } if (got_Gamma) { num_read = fread (gEnh_curve_b, sizeof (int), 256, gf) ; DPRINTF(" num_read= %d\n",num_read); if ( num_read != 256 ) got_Gamma = false ; } fclose (gf); if (!(got_Gamma)) { DPRINTF ("main(): Gamma curve data from %s is truncated.\n", gammaFile ); snprintf(syslog_message,message_size,"main(): %s", gMessages[E_BAD_GAMMAFILE]); wrap_syslog (LOG_CRIT,"%s",syslog_message); return 1; } } if ( !(got_Gamma) ) { /* use the empirical color correction curve parametrized by Gamma_R ,Gamma_G, Gamma_B */ DPRINTF("main(): using empirical color correction curve\n"); Make_GammaCurve ( Gamma_R, Gamma_G, Gamma_B); } } /* if printer version is set to NOPRINTER in pnm2ppa.conf */ if (printer.version == NOPRINTER) { snprintf(syslog_message,message_size,"pnm2ppa.conf: version 0; %s", gMessages[E_PPA_UNKNOWN]); wrap_syslog (LOG_CRIT,"%s",syslog_message); exit (1); } /* now do the work! */ return print_pnm (in); } pnm2ppa-1.13/syslog.c0000644000076400007640000000530511310765657011446 00000000000000/*************************************************************************** syslog.c - handles syslog messages ------------------- begin : Thu Jan 13 2000 copyright : (C) 1998-2000 by pnm2ppa project email : ***************************************************************************/ /*************************************************************************** * * * 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. * * * ***************************************************************************/ #ifdef HAVE_CONFIG_H # include "config.h" #endif /*Michael Mancini 16 Jan 2000 BeOS syslog() wrapper syslog.c modified Duncan Haldane Oct 2000. all syslog messages arrive here wrapped. */ #include #include "ppa_syslog.h" #include "global.h" BOOLEAN verbose = false ; /* For some reason, BeOS doesn't seem to implement syslog(), even though it is included with the system. Wierd. This wraps the syslog functions used and writes the info to the stderr stream, if __NO_SYSLOG__ is defined. */ void wrap_syslog(int log_pri, char *fmt, char *message ) { if (!(gSilent)) { #ifdef __NO_SYSLOG__ gVerbose = true; #else if (gLogInfo || log_pri != LOG_INFO) syslog ( log_pri , "%s", message ); else if(verbose) fprintf(stderr,"pnm2ppa: %s",message); #endif } if (gVerbose) { /* Send the syslog data to the stderr stream */ fprintf(stderr,"pnm2ppa: %s",message); } return ; } void wrap_openlog( char *ident, int level ) { #ifndef __NO_SYSLOG__ if ( level ) { /* level 1 also sends messages to stderr */ #ifdef __NO_LOG_PERROR__ /* for systems (e.g. Solaris) where LOG_PERROR is not valid */ openlog ( ident, LOG_CONS | LOG_PID, LOG_LPR); gVerbose = true; #else openlog ( ident, LOG_PERROR | LOG_CONS | LOG_PID, LOG_LPR); verbose = gVerbose; gVerbose = false; #endif } else { /* standard level 0, messages sent to syslog only */ openlog ( ident, LOG_CONS | LOG_PID, LOG_LPR); verbose = gVerbose; gVerbose = false; } #endif return; } void wrap_closelog( void) { #ifndef __NO_SYSLOG__ closelog(); #endif return; } pnm2ppa-1.13/ppa.c0000644000076400007640000004561011310765657010711 00000000000000/*************************************************************************** ppa.c - functions to handle PPA, SCP, and VLINK protocols ------------------- begin : Thu Jan 13 2000 copyright : (C) 1998-2000 by pnm2ppa project email : ***************************************************************************/ /*************************************************************************** * * * 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. * * * ***************************************************************************/ #ifdef HAVE_CONFIG_H # include "config.h" #endif #include #include #include #include #define __PPA_C__ #include "ppa_syslog.h" #include "global.h" #include "ppa.h" #include "debug.h" #include "lang.h" /* VLink packet structure: Bytes Description -------------------------------------------- 1 Packet-start marker (always '$') 1 Channel (0: image data, 1: commands/responses(*), 2: autostatus(*), 128: pacing(*)) 2 Data length (N) N [remaining data (e.g., SCP or SCP2 packet when Channel=1)] (*): responses, autostatus, and pacing are communicated from the printer to the computer, and may be safely ignored. */ void vlink_put (FILE * fptr, int channel, int length, void *data) { fputc ('$', fptr); fputc (channel, fptr); fputc (length >> 8, fptr); fputc (length & 0xFF, fptr); fwrite (data, length, 1, fptr); } /* SCP packet structure: Bytes Description -------------------------------------------- 2 Command specifier 2 Command reference number 1 Priority 1 padding? (always zero) 2 Data length (N) N [remaining data] ComSpec ComRef Command ------------------------------- 35 1 Initialize1 101 2 Initialize2 21 1 Initialize3 19 1 Handle Media 18 1 Print Sweep */ void scp_put (FILE * fptr, int comspec, int comref, int priority, int length, void *data) { /* encapsulate the vlink_put call in here, to avoid a memcpy */ fputc ('$', fptr); fputc (1, fptr); fputc ((length + 8) >> 8, fptr); fputc ((length + 8) & 0xFF, fptr); fputc (comspec >> 8, fptr); fputc (comspec & 0xFF, fptr); fputc (comref >> 8, fptr); fputc (comref & 0xFF, fptr); fputc (priority, fptr); fputc (0, fptr); fputc (length >> 8, fptr); fputc (length & 0xFF, fptr); fwrite (data, length, 1, fptr); } /* SCP2 packet structure: Bytes Description -------------------------------------------- 2 Command specifier 2 Packet length (N) 1 Priority 1 padding? (always zero) 2 Command reference number 4 Channel 0 buffer increment 4 version number? (always 00 02 00 00) N-16 [remaining data] ComSpec ComRef Command ------------------------------- 0x186 1 Initialize1 0x18f 2 Initialize2 0x183 1 Initialize3 0x181 1 Handle Media 0x180 1 Print Sweep */ void scp2_put (FILE * fptr, unsigned short comspec, unsigned short pkt_len_s16, unsigned char priority, unsigned short comref, unsigned data_len, void *data) { /* encapsulate the vlink_put call in here, to avoid a memcpy */ fputc ('$', fptr); fputc (1, fptr); fputc ((pkt_len_s16 + 16) >> 8, fptr); fputc ((pkt_len_s16 + 16), fptr); fputc (comspec >> 8, fptr); fputc (comspec, fptr); fputc ((pkt_len_s16 + 16) >> 8, fptr); fputc ((pkt_len_s16 + 16), fptr); fputc (priority, fptr); fputc (0, fptr); fputc (comref >> 8, fptr); fputc (comref, fptr); fputc (data_len >> 24, fptr); fputc (data_len >> 16, fptr); fputc (data_len >> 8, fptr); fputc (data_len, fptr); fputc (0, fptr); fputc (2, fptr); fputc (0, fptr); fputc (0, fptr); fwrite (data, pkt_len_s16, 1, fptr); } /* SCP3 packet structure: Bytes Description -------------------------------------------- 2 Command specifier 2 Packet length (N) 1 Priority 1 padding? (always zero) 2 Command reference number 4 Channel 0 buffer increment 4 version number? (always 01 04 00 00) N-16 [remaining data] ComSpec ComRef Command ------------------------------- 0x186 1 Initialize1 0x18C 16 Initialize Printer name 0x1A1 1 Initialize4? 0x18f 2 Initialize2 0x183 1 Initialize3 0x181 1 Handle Media 0x180 1 Print Sweep */ void scp3_put (FILE * fptr, unsigned short comspec, unsigned short pkt_len_s16, unsigned char priority, unsigned short comref, unsigned data_len, void *data) { /* encapsulate the vlink_put call in here, to avoid a memcpy */ fputc ('$', fptr); fputc (1, fptr); fputc ((pkt_len_s16 + 16) >> 8, fptr); fputc ((pkt_len_s16 + 16), fptr); fputc (comspec >> 8, fptr); fputc (comspec, fptr); fputc ((pkt_len_s16 + 16) >> 8, fptr); fputc ((pkt_len_s16 + 16), fptr); fputc (priority, fptr); fputc (0, fptr); fputc (comref >> 8, fptr); fputc (comref, fptr); fputc (data_len >> 24, fptr); fputc (data_len >> 16, fptr); fputc (data_len >> 8, fptr); fputc (data_len, fptr); fputc (1, fptr); fputc (4, fptr); fputc (0, fptr); fputc (0, fptr); fwrite (data, pkt_len_s16, 1, fptr); } void ppa_init_job (ppaPrinter_t * printer) { unsigned char init1[8] = { 0x00, 0x00, 0x01, 0xf4, 0x01, 0x00, 0x00, 0x00 }; unsigned char init2[4] = { 0xde, 0xad, 0xbe, 0xef }; unsigned char init3[8] = { 0xde, 0xad, 0xbe, 0xef, 0x02, 0x00, 0x00, 0x00 }; unsigned char init4[60] = "!!TAZ \x81*HP DeskJet 1000C Prin (Copy 2)*FILE!!\x00\x00\x00"; /* plus 0 terminator */ unsigned char init5[4] = { 0x01, 0x01, 0x00, 0x00 }; switch (printer->version) { case HP820: scp_put (printer->fptr, 35, 1, 7, sizeof (init1), init1); vlink_put (printer->fptr, 0, sizeof (init2), init2); scp_put (printer->fptr, 101, 2, 7, sizeof (init3), init3); break; case HP7X0: scp2_put (printer->fptr, 0x0186, sizeof (init1), 7, 1, 0, init1); vlink_put (printer->fptr, 0, sizeof (init2), init2); scp2_put (printer->fptr, 0x018f, sizeof (init3), 7, 2, 4, init3); break; case HP1000: scp3_put (printer->fptr, 0x0186, sizeof (init1), 7, 16, 0, init1); scp3_put (printer->fptr, 0x018C, sizeof (init4), 7, 1, 0, init4); scp3_put (printer->fptr, 0x01A1, sizeof (init5), 7, 1, 0, init5); vlink_put (printer->fptr, 0, sizeof (init2), init2); scp3_put (printer->fptr, 0x018f, sizeof (init3), 7, 2, 4, init3); break; default: snprintf(syslog_message,message_size,"ppa_init_job(): %s", gMessages[E_PPA_UNKNOWN]); wrap_syslog (LOG_CRIT,"%s",syslog_message); } } void ppa_end_print (ppaPrinter_t * printer) { unsigned char pageA[4] = { 0x05, 0x01, 0x03, 0x84 }; if (printer->version == HP1000) scp3_put (printer->fptr, 0x0181, sizeof (pageA), 7, 2, 0, pageA); } void ppa_init_page (ppaPrinter_t * printer) { unsigned char pageA[16] = { 0x28, 0x2d, 0x00, 0x41, 0x29, 0x2e, 0x00, 0x42, 0x29, 0x2e, 0x00, 0x42, 0x29, 0x2e, 0x00, 0x42 }; unsigned char pageB[16] = { 0x28, 0x2d, 0x00, 0x41, 0x2d, 0x32, 0x00, 0x46, 0x2d, 0x32, 0x00, 0x46, 0x2d, 0x32, 0x00, 0x46 }; switch (printer->version) { case HP820: scp_put (printer->fptr, 21, 1, 5, sizeof (pageA), pageA); break; case HP7X0: scp2_put (printer->fptr, 0x0183, sizeof (pageB), 5, 1, 0, pageB); break; case HP1000: scp3_put (printer->fptr, 0x0183, sizeof (pageA), 5, 1, 0, pageA); break; default: snprintf(syslog_message,message_size,"ppa_init_page(): %s", gMessages[E_PPA_UNKNOWN]); wrap_syslog (LOG_CRIT,"%s",syslog_message); } } void ppa_load_page (ppaPrinter_t * printer) { unsigned char loadA[4] = { 0x01, 0x01, 0x09, 0x60 }; unsigned char loadB[4] = { 0x01, 0x01, 0x12, 0xc0 }; unsigned char loadC[4] = { 0x01, 0x01, 0x07, 0x08 }; switch (printer->version) { case HP820: scp_put (printer->fptr, 19, 1, 7, sizeof (loadA), loadA); break; case HP7X0: scp2_put (printer->fptr, 0x0181, sizeof (loadB), 7, 1, 0, loadB); break; case HP1000: scp3_put (printer->fptr, 0x0181, sizeof (loadC), 7, 1, 0, loadC); break; default: snprintf(syslog_message,message_size, "ppa_load_page(): %s", gMessages[E_PPA_UNKNOWN]); wrap_syslog (LOG_CRIT,"%s",syslog_message); } } void ppa_eject_page (ppaPrinter_t * printer) { unsigned char loadA[4] = { 0x02, 0x01, 0x09, 0x60 }; unsigned char loadB[4] = { 0x02, 0x01, 0x12, 0xc0 }; unsigned char loadC[4] = { 0x02, 0x01, 0x07, 0x08 }; switch (printer->version) { case HP820: scp_put (printer->fptr, 19, 1, 7, sizeof (loadA), loadA); break; case HP7X0: scp2_put (printer->fptr, 0x0181, sizeof (loadB), 7, 1, 0, loadB); break; case HP1000: scp3_put (printer->fptr, 0x0181, sizeof (loadC), 7, 1, 0, loadC); break; default: snprintf(syslog_message,message_size, "ppa_eject_page(): %s", gMessages[E_PPA_UNKNOWN]); wrap_syslog (LOG_CRIT,"%s",syslog_message); } } int compress (unsigned char *in, int num_lines_d2, int final_len, unsigned char *iout) { unsigned char *out = iout; int I, len = num_lines_d2; unsigned compressed_len = 0; /* abandon compression if datasize expands! */ for (I = 0; I < final_len; I += num_lines_d2, in += num_lines_d2) { int i = 0; while (i < len) { /* Find the size of duplicate values */ int dup_len = 0; while ((i + dup_len < len) && (in[i + dup_len] == in[i])) { dup_len++; } /* See if we have enough zeros to be worth compressing. */ /* I figure one is enough. */ if ((dup_len >= 1) && (in[i] == 0)) { /* Output run of zeros. */ while (dup_len >= 128) { /* Max is 128 */ *out++ = 0x00; compressed_len++; if (compressed_len > final_len) return 0; i += 128; dup_len -= 128; } if (dup_len >= 1) { *out++ = dup_len; compressed_len++; if (compressed_len > final_len) return 0; i += dup_len; } /* See if we have enough non-zeros to be worth compressing. */ /* Here two should be enough. */ } else if (dup_len >= 2) { /* Output run of duplicates. */ while (dup_len >= 64) { /* Max is 64 */ *out++ = (char) 0x80; *out++ = (char) in[i]; compressed_len +=2; if (compressed_len > final_len) return 0; i += 64; dup_len -= 64; } if (dup_len >= 2) { *out++ = dup_len + 0x80; *out++ = in[i]; compressed_len +=2; if (compressed_len > final_len) return 0; i += dup_len; } } else { /* Look for two zeros, or three duplicates to end literal run. */ /* Note this is one more than the number to start a run. */ int lit_len = -1; int add_more = 1; while (add_more) { lit_len++; if (i + lit_len == len) add_more = 0; /* Always add more if we are near the very end. */ if (i + lit_len < len - 3) { char a = in[i + lit_len + 0]; char b = in[i + lit_len + 1]; char c = in[i + lit_len + 2]; /* See if there are enough zeros */ if ((a == b) && (b == 0)) add_more = 0; /* See if there are enough duplicates */ if ((a == b) && (b == c)) add_more = 0; } } /* Output run of literals. */ while (lit_len >= 64) { /* Max is 64 */ int j; *out++ = (char) 0xc0; compressed_len ++; for (j = i; j < i + 64; j++) { *out++ = in[j]; } compressed_len += 64; if (compressed_len > final_len) return 0; i += 64; lit_len -= 64; } if (lit_len) { int j; *out++ = lit_len + 0xc0; compressed_len ++; for (j = i; j < i + lit_len; j++) { *out++ = in[j]; } compressed_len += lit_len; if (compressed_len > final_len) return 0; i += lit_len; } } } } if (compressed_len > final_len) return 0; return out - iout; } static inline void packShort (int x, unsigned char *y) { y[0] = x >> 8; y[1] = x; } static inline void packLong (unsigned long x, unsigned char *y) { packShort(x >> 16, y); packShort(x, y + 2); #if 0 unsigned short t; t = (unsigned short) ((x & 0xffff0000) >> 16); packShort (t, y); packShort ((unsigned short) x & 0xffff, y + 2); #endif } /*#define do_compress_data (1) */ void ppa_print_sweep (ppaPrinter_t * printer, ppaSweepData_t * data) { unsigned char *pc, *tpc; unsigned i, datasize = data->data_size; unsigned char sweep_packet[144]; int sweep_packet_size; unsigned short HP7X0constants[] = { 0x8ca0, 0x4650, 0x12c0 }; unsigned short HP820constants[] = { 0x4650, 0x1c20, 0x0960 }; unsigned short HP1000constants[] = { 0x4650, 0x2328, 0x0708 }; unsigned short *constants; int nozzle_data_size; int MF; /* Multiplicative Factor -- quick hack */ unsigned char do_compress_data; DPRINTF("ppa_print_sweep(): Dir: %d Color: %d Size: %d Vpos: %d Hpos: %d,%d\n", data->direction, data->in_color, data->data_size, data->vertical_pos, data->left_margin, data->right_margin ); assert( ((data->direction == left_to_right) || (data->direction == right_to_left)) ); if (data->in_color && !gCompress ) do_compress_data = 0; else do_compress_data = 1; pc = data->image_data; DPRINTF(" ppa_print_sweep(): datasize= %d\n", datasize); if (do_compress_data) { unsigned compressed_datasize; if (!(pc = malloc ((datasize / 64 + 1) * 65))) { snprintf(syslog_message,message_size, "ppa_print_sweep(): %s", gMessages[E_PPA_BADMALLOC]); wrap_syslog (LOG_CRIT,"%s",syslog_message); exit (-1); } compressed_datasize = compress (data->image_data, data->nozzle_data->pins_used_d2, datasize, pc); if (!compressed_datasize) { /* compression would increase datsize ! */ free (pc); do_compress_data = 0; pc = data->image_data; } else { datasize = compressed_datasize; DPRINTF(" ppa_print_sweep():compressed datasize= %d\n", datasize); } } /* send image data 16k at a time */ for (i = 0, tpc = pc; i < datasize; tpc += 16384, i += 16384) { vlink_put (printer->fptr, 0, ((datasize - i) > 16384) ? 16384 : (datasize - i), tpc); } /* memory leak fix courtesy of John McKown */ if (do_compress_data && pc){ free (pc); pc = NULL; } /* construct sweep packet */ switch (printer->version) { case HP820: constants = HP820constants; MF = 1; break; case HP7X0: constants = HP7X0constants; MF = 2; break; case HP1000: constants = HP1000constants; MF = 1; break; default: snprintf(syslog_message,message_size, "ppa_print_sweep(): %s", gMessages[E_PPA_UNKNOWN]); wrap_syslog (LOG_CRIT,"%s",syslog_message); return; } sweep_packet[0] = 0; sweep_packet[1] = do_compress_data; sweep_packet[2] = data->direction == right_to_left ? 1 : 2; sweep_packet[3] = data->in_color ? 14 : 1; packLong (datasize, sweep_packet + 4); memset (sweep_packet + 8, 0, 8); if (data->in_color) packLong (MF * (data->vertical_pos + /*96+ */ printer->y_offset) /*+ 1*/, sweep_packet + 16); else packLong (MF * (data->vertical_pos + printer->y_offset), sweep_packet + 16); packShort (constants[0], sweep_packet + 20); packShort (MF * (data->left_margin + printer->x_offset) /*+ 1*/, sweep_packet + 22); packShort (MF * (data->right_margin + printer->x_offset) /*+ 1*/, sweep_packet + 24); if (data->in_color) packShort (0x2ee0, sweep_packet + 26); else packShort (constants[1], sweep_packet + 26); /* 2ee0 in color on 820 */ packShort (constants[2], sweep_packet + 28); packShort (0x100, sweep_packet + 30); if (data->next) { sweep_packet[32] = data->next->direction == right_to_left ? 1 : 2; sweep_packet[33] = data->next->in_color ? 14 : 1; packLong (MF * (data->next->vertical_pos + printer->y_offset), sweep_packet + 34); packShort (MF * (data->next->left_margin + printer->x_offset), sweep_packet + 38); packShort (MF * (data->next->right_margin + printer->x_offset), sweep_packet + 40); if (data->in_color) packShort (0x2ee0, sweep_packet + 42); else packShort (constants[1], sweep_packet + 42); /* 2ee0 in color on 820 */ packShort (constants[2], sweep_packet + 44); } else memset (sweep_packet + 32, 0, 14); sweep_packet[46] = 8; nozzle_data_size = data->nozzle_data_size; if (nozzle_data_size > 6) { snprintf(syslog_message,message_size, "ppa_print_sweep(): %s %d\n", gMessages[W_PPA_NOZZLE], nozzle_data_size); wrap_syslog (LOG_WARNING,"%s",syslog_message); nozzle_data_size = 6; } sweep_packet[47] = nozzle_data_size; for (pc = sweep_packet + 48, i = 0; i < nozzle_data_size; i++, pc += 16) { packShort (data->nozzle_data[i].DPI, pc); packShort (data->nozzle_data[i].pins_used_d2, pc + 2); packShort (data->nozzle_data[i].unused_pins_p1, pc + 4); packShort (data->nozzle_data[i].first_pin, pc + 6); packShort (data->nozzle_data[i].pins_used_d2, pc + 8); packShort (MF * (data->nozzle_data[i].left_margin + printer->x_offset), pc + 10); packShort (MF * (data->nozzle_data[i].right_margin + printer->x_offset), pc + 12); pc[14] = data->nozzle_data[i].nozzle_delay; pc[15] = 0; } sweep_packet_size = data->in_color ? 144 : 80; /* send sweep packet */ switch (printer->version) { case HP820: scp_put (printer->fptr, 18, 1, 7, sweep_packet_size, sweep_packet); break; case HP7X0: scp2_put (printer->fptr, 0x0180, sweep_packet_size, 7, 1, datasize, sweep_packet); break; case HP1000: scp3_put (printer->fptr, 0x0180, sweep_packet_size, 7, 1, datasize, sweep_packet); break; default: snprintf(syslog_message,message_size,"ppa_print_sweep(): %s", gMessages[E_PPA_UNKNOWN]); wrap_syslog (LOG_CRIT,"%s",syslog_message); return; } } void ppa_print_sweeps (ppaPrinter_t * printer, ppaSweepData_t * data) { ppaSweepData_t *current_sweep; for (current_sweep = data; current_sweep; current_sweep = current_sweep->next) ppa_print_sweep (printer, current_sweep); } pnm2ppa-1.13/image.c0000644000076400007640000011646411310765657011221 00000000000000/*************************************************************************** image.c - code for reading and parsing a pbm, pgm or ppm format file also, rgb -> cymk conversion and black separation ------------------- begin : Thu Jan 13 2000 copyright : (C) 2000 by pnm2ppa project email : ***************************************************************************/ /*************************************************************************** * * * 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. * * * ***************************************************************************/ #ifdef HAVE_CONFIG_H # include "config.h" #endif #include #include #include #define __IMAGE_C__ #include "ppa_syslog.h" #include "global.h" #include "defaults.h" #include "debug.h" #include "image.h" #include "gamma.h" #include "dither.h" #include "lang.h" #include int initImage (image_t *image, FILE *fptr) { char line[1024]; int colors = 0; int k, k1; image->fptr = fptr; image->version = none; image->blackCurLine = 0; image->colorCurLine = 0; image->bufferCurLine = 0; image->unread = 0; image->colors = 0; gCalibrate = false; gByteCount = 3; if (gGammaMode) { /* produce color calibration page, uses the default papersize */ image->version = P6_PPMRAW; image->width = gWidth; image->height = gHeight; g300 = false; } else { if (fgets (line, 1024, fptr) == NULL) return 0; line[strlen (line) - 1] = 0; /* we have to handle the six pnm formats . */ if (!strcmp (line, "P1")) { DPRINTF("input format is P1: pbm (ascii)\n"); image->version = P1_PBM; if (!gPixmapMode) { gColorMode = false ; gByteCount = 1; } else gFastMode = true; strcpy(gFormat,"BitMap"); } if (!strcmp (line, "P2")) { DPRINTF("input format is P2: pgm (ascii)\n"); image->version = P2_PGM; if (!gPixmapMode) { gColorMode = false ; gByteCount = 1; } else gFastMode = true; strcpy(gFormat,"GreyMap"); } if (!strcmp (line, "P3")) { DPRINTF("input format is P3: ppm (ascii)\n"); image->version = P3_PPM; strcpy(gFormat,"PixMap"); } if (!strcmp (line, "P4")) { DPRINTF("input format is P4: pbm (binary)\n"); image->version = P4_PBMRAW; if (!gPixmapMode) { gColorMode = false ; gByteCount = 1; } else gFastMode = true; strcpy(gFormat,"BitMap"); } if (!strcmp (line, "P5")) { DPRINTF("input format is P5: pgm (binary)\n"); image->version = P5_PGMRAW; if (!gPixmapMode) { gColorMode = false ; gByteCount = 1; } else gFastMode = true; strcpy(gFormat,"GreyMap"); } if (!strcmp (line, "P6")) { DPRINTF("input format is P6: ppm (binary)\n"); image->version = P6_PPMRAW; strcpy(gFormat,"PixMap"); } if (image->version == none) { DPRINTF("input format is not recognized as PNM\n"); snprintf(syslog_message,message_size,"initImage(): %s", gMessages[E_IM_BADFORMAT] ); wrap_syslog (LOG_CRIT,"%s",syslog_message); return 0; } /* initialize switch that is used to terminate further printing * if EOF is detected while reading the input image */ gTerminate = false ; do { if (fgets (line, 1024, fptr) == NULL) return 0; line[strlen (line) - 1] = 0; if (!strcmp (line, "# pnm2ppa calibration image")){ gCalibrate = true; g300 = false; DPRINTF("initImage(): Calibration Page input detected!\n"); } } while (line[0] == '#'); if (2 != sscanf (line, "%d %d", &image->width, &image->height)) return 0; /* use the image dimensions read from the pnm innput file to * set gWidth and gHeight, and test that these are accepatable * for the printer model * this will mean that any user input or default papersizes * will only be uses for calibration or gamma correction output * which is not generated by pnm imput */ /* if we treat the input as 300dpi, double image dimensions */ if(g300) { DPRINTF("300dpi input mode\n"); image->width *= 2; image->height *= 2; } gWidth = image->width ; gHeight = image->height ; /* test that papersize is acceptable */ if ( (gWidth > gmaxWidth ) || (gWidth < gminWidth ) || (gHeight > gmaxHeight ) || (gHeight < gminHeight ) ) { snprintf(syslog_message,message_size,"initImage(): %s %dx%d @600dpi\n", gMessages[E_IM_BADPAPERSIZE], gWidth, gHeight); wrap_syslog (LOG_CRIT,"%s",syslog_message); return 0; } switch(image->version) { case P2_PGM: case P3_PPM: case P5_PGMRAW: case P6_PPMRAW: if (fgets (line, 1024, fptr) == NULL) return 0; if (1 != sscanf (line, "%d", &colors)) return 0; /* colors should be 255, as the code is currently implemented */ if (colors != 255) { snprintf(syslog_message,message_size,"initImage(): %s %d\n", gMessages[E_IM_BADMAXVALUE], colors); wrap_syslog (LOG_CRIT,"%s",syslog_message); return 0; } break; case P1_PBM: case P4_PBMRAW: colors = 1; break; case none: default: snprintf(syslog_message,message_size,"initImage(): %s", gMessages[E_IM_BADFORMAT]); wrap_syslog (LOG_CRIT,"%s",syslog_message); return 0; break; } image->colors = colors ; DPRINTF( "initImage: width=%d, height=%d, colors = %d," " ByteCount = %d\n", image->width, image->height, image->colors, gByteCount); } /* initialize buffer */ image->bufsize = 8192; image->bufpos = 0; image->buflines = 0; image->buftype = empty; for (k = 0; k < gMaxPass; k++) { image->buffer[k] = malloc (image->bufsize); if (!image->buffer[k]) { for (k1 = 0; k1 < k; k1++) free (image->buffer[k1]); return 0; } } return 1; } int remallocBuffer (image_t *image, size_t bytes) { int linesize; unsigned char *newbuf; /* size_t newsize; */ int newsize ; int k; if (image->buftype == bitmap) linesize = (image->width + 7) / 8; else if (image->buftype == color) linesize = (image->width / 2 + 7) / 8 * 3; else linesize = 0; /* if space is adequate, do nothing */ if (image->bufpos + image->buflines * linesize + bytes < image->bufsize) return 0; /* if there's an offset, move the image at buffer[k][bufpos] to the * the beginning of the buffer, and reset the offset to 0. */ if (image->bufpos != 0) { DPRINTF("Moving image[k][bufpos] to image[k][0]\n"); for (k = 0; k < gMaxPass; k++) memmove (image->buffer[k], &image->buffer[k][image->bufpos], image->buflines * linesize); image->bufpos = 0; if (image->bufpos + image->buflines * linesize + bytes < image->bufsize) return 0; } /* calculate the number of bits and add one to double the needed memory size.*/ newsize = pow(2, (int)((log(image->buflines * linesize + bytes)/log(2))+1)); DPRINTF("resizing memory from %d bytes to %d bytes\n", image->bufsize, newsize); for (k=0; k < gMaxPass; k++) { newbuf = malloc(newsize); if ( ! newbuf ) { snprintf(syslog_message,message_size, "remallocBuffer(): %s", gMessages[E_BADMALLOC]); wrap_syslog (LOG_CRIT,"%s",syslog_message); exit (1); } memcpy(newbuf, image->buffer[k], image->buflines * linesize); free(image->buffer[k]); image->buffer[k] = newbuf; } image->bufsize = newsize; return 0; } BOOLEAN convert_black_data (image_t *image, unsigned char *line, unsigned char *black, BOOLEAN line_is_nonblank) { /* Lets document this - please correct anything incorrect here! (duncan, Feb 12 2000, updated July 2000) - The entries in line[] are written by one of the functions FS_Color_Dither(), HT_Color_Dither(), HT_Black_Dither() in dither.c - The entries in line[] represent the ( image->width ) pixels on a line. Each pixel is represented by three consecutive entries (line[i] , line [i + 1] ,line [i + 2] ) , where i = 0, 3, 6 , ... , < (image->width * 3) The three entries correspond to Cyan, Magenta, and Yellow ink. - entries in line[] take values 1, 2,...,(gMaxPass + 1) , 0 or 255, where gMaxPass is the maximum number of passes of the color print head. * gMaxPass is only used in Color mode (gColorMode=true) * In normal color mode (gEcomode=false, gFastmode=false) gMaxPass = 4 * In Economy mode (gEcoMode = true) gMaxPass = 1 * In Fast Color mode (gFastMode = true) gMaxPass = 1 - values line [] = 1, 2, ..., gMaxPass correspond to gMaxPass, gMaxPass-1, ..., 1 drops of ink of a given color (C, M,or Y). - the value line [] = 0 also means gMaxPass drops of ink - the value line [] > gMaxPass (usually = gMaxPass+1 or 255) means 0 drops of color ink. - an entry (0, 0, 0) corresponds to a black drop, which can either be a drop of black ink, or gMaxPass drops each of C,M and Y ink, If this is implemented with a drop of black ink, convert_black_data() changes (0,0,0) to (255,255,255), so it won't get repeated using colored ink by the following call to convert_color_data(). - whitespace is coded by (255,255,255). - triplication of bytes is switched off when gByteCount == 1 Color data is only printed on even lines. Black data is printed on even and odd lines, except in Black-and-White Economy mode (gColorMode=false, gEcoMode=true), when only even lines of black are printed. If the odd line is not printed, its black data is added to the next even line. */ /* FEB 2002 (duncan) try to clean this up for pictures vs. text. identify regions of black surrounded by white space as text ONLY if they are less that "textwidth" dots wide. Otherwise, they are treated as part of an image, and will try to use both ink types, if any color was found on the line. */ int i, j, k; unsigned char mask = 0x80; unsigned char *pos = black; int blackness ; BOOLEAN use_color = false; BOOLEAN has_black = false; /* max_text_width is arbitary: make it configurable? textwidth = maximum width of a black region that is printed only with black ink when color is present on the line, on the assumption it is text, not image. */ const int max_text_width = 8; /* color dots at 300dpi */ unsigned char curr_stuff= 0 ;/* 0 = white, 1 = not white (current pixel)*/ unsigned char remove_black = 1, have_color = 0; unsigned char first_black=0 , second_black=0 ; /*controls black ink density*/ blackness = gBlackness ; j = image->bufferCurLine ; /* black ink quantity control (duncan) */ /* this should be extended to control color ink printing of "black" pixels */ if ( blackness == 1 ) { /* one black ink drop, on even lines only */ if ( (j % 2) ) { first_black = 0 ; /* odd lines */ second_black = 0; } else { first_black = 0 ; /* even lines */ second_black = 1 ; } } else if ( blackness == 2 ) /* two black ink drops */ { if ( (j % 2) ) { first_black = 1 ; /* odd lines */ second_black = 0; } else { #if 0 first_black = 0 ; /* even lines */ second_black = 1 ; #endif /* treat odd and even lines the same, to avoid artifacts?*/ first_black = 1 ; /* even lines */ second_black = 0 ; } } else if ( blackness == 3 ) /* two drops on even lines, one on odd lines */ { first_black = 1; if ( j % 2 ) second_black = 0; /* odd lines */ else second_black = 1 ; /* even lines */ } else if (blackness == 4 ) /* two black ink drops, all lines */ { first_black = 1 ; second_black = 1 ; } else /* no black ink */ { first_black = 0 ; second_black = 0 ; } /* In Pixmap mode black ink cartridge is disabled (this should be renamed to (say) NoBlack mode ) */ if (gPixmapMode || !line_is_nonblank) memset (pos, 0x00, (image->width + 7) / 8); else { if (gColorMode && gByteCount ==3 ) /* beginning of code that assumes gByteCount == 3 */ { /* This is the most delicate situation, we (may) have both color * and black on the same line; * we want to: * - Print half of the black ink to avoid "wet" effect * - get a good "covering" black in pixmaps (neither too dense, * neither too sparse...) */ /* check for presence of color in the line */ for (i = 0; i < image->width * 3; i += 6) { if (line[i] != line[i+1] || line[i+1] != line[i+2]) { use_color = true; break; } } curr_stuff=0; for (i = 0; i < image->width * 3; i += 6) { if (mask == 0x80) *pos = 0; if (curr_stuff==0) { int black_width = 0; /* this is a test to see if the current non-whitespace * pixel is part of a region of black delineated by * whitespace (have_color=0) * or is in a region containing some * colored pixels (in this case have_color=1) */ if (! (line[i]>gMaxPass && /*if line is not white*/ line[i+1]> gMaxPass && line[i+2]>gMaxPass) ) { have_color=0; k=i; while ( (!(have_color)) && (kwidth * 3) && (! (line[k]>gMaxPass && line[k+1]> gMaxPass && line[k+2]>gMaxPass) )) { if ((line[k] && line[k]<=gMaxPass) || (line[k+1] && line[k+1]<=gMaxPass) || (line[k+2] && line[k+2]<=gMaxPass)) have_color=1; k+=6; black_width++; /* treat wide black regions as having color */ if (use_color && black_width > max_text_width) have_color=1; } if (have_color) remove_black=0; else remove_black=1; curr_stuff=1; } } if ( !(line[i] || line[i + 1] || line[i + 2])) { /* pixel is black; there are two possible * behaviors, depending on whether remove_black * is set by Drugo's new code above. * these behaviors may need some further * adjustments. */ if (gCalibrate || remove_black) { /* in this case the black region is * identified as delineated by whitespace * (probably = text?). * So print with black ink, * and no colored ink. To avoid using * too much black ink (wets paper) * first_black and second_black * are used as controls on amount * of black ink. */ if (first_black && gBlack ) *pos |= mask; /* one drop of black ink */ mask >>= 1; if (mask == 0) { pos++; mask = 0x80; } if (second_black && gBlack ) *pos |= mask; /* one drop of black ink */ /* suppress use of colored ink on this pixel */ line[i] = line[i + 1] = line[i + 2] = 255; line[i + 3] = line[i + 4] = line[i + 5] = 255; } else { /* this black region is bounded by a colored * region, and is probably part of an image. * so: print half strength black ink, and use * some colored ink. * * note: in EcoMode, only even lines are processed. * in normal mode, skip even lines. * j is the line number. */ if ( (j % 2 || gEcoMode ) && gBlack ) *pos |= mask;/* a drop of black, every second line */ mask >>= 1; if (mask == 0) { pos++; mask = 0x80; } /* reduce amount of colored ink to avoid wetting: * try resetting line[] to gMaxPass-1 * gives 2 passes of the color head in high quality, * (gMaxPass=4, line[] = 3), * 1 pass in ecoMode (gMaxPass = 1, line[] = 0) */ line[i] = line[i + 1] = line[i + 2] = gMaxPass-1; line[i + 3] = line[i + 4] = line[i + 5] = gMaxPass-1; } } else { /* pixel is not black */ mask >>= 1; if (mask == 0) { pos++; mask = 0x80; } if (line[i] > gMaxPass && line[i + 1] > gMaxPass && line[i + 2] > gMaxPass) { /* pixel is whitespace */ curr_stuff=0; } } mask >>= 1; if (mask == 0) { pos++; mask = 0x80; } } } /* end of code that assumes gByteCount == 3 */ else /* !gColorMode, gByteCount could be 1 or 3 */ { /* this next part is for printing in black and white only. * if !gColorMode, the line contains only black or white, so * we can print safely 1 drop out of 2 without any problem */ *pos = 0; for (i = 0 ; i < image->width *gByteCount ; i += 2*gByteCount ) { if (mask == 0x80) *pos = 0; if (!line[i]) /* black even pixel */ { if (first_black && gBlack) *pos |= mask; /* one drop of black ink */ mask >>= 1; if (mask == 0) { pos++; mask = 0x80; } if (second_black && gBlack) *pos |= mask; /* one drop of black ink */ } else /* blank even pixel */ { mask >>= 1; if (mask == 0) { pos++; mask = 0x80; } } mask >>= 1; /* odd pixels are left black */ if (mask == 0) { pos++; mask = 0x80; } } memset (line, 0xff, image->width ); } } if (!(gPixmapMode || !line_is_nonblank)) { unsigned char *p; for (p = black; p <= pos; p++) { if( *p ) { has_black = true; break; } } } return has_black; } BOOLEAN convert_color_data (image_t *image, unsigned char *line, unsigned char *color[], int c_off, BOOLEAN line_is_nonblank) { int i, k, j; unsigned char mask; unsigned char *pos; BOOLEAN has_color = false; j = 1; for (k = 0; k < gMaxPass; k++) { mask = 0x80; pos = &color[gMaxPass - j][c_off]; j++; memset (pos, 0x00, (image->width / 2 + 7) / 8 * 3); if (line_is_nonblank) for (i = 0; i < image->width * 3; i += 6) { if ((line[i] < gMaxPass - k + 1) && gCyan) pos[0] |= mask; if ((line[i + 1] < gMaxPass - k + 1) && gMagenta) pos[1] |= mask; if ((line[i + 2] < gMaxPass - k + 1) && gYellow) pos[2] |= mask; mask >>= 1; if (mask == 0) { pos += 3; mask = 0x80; } } if (line_is_nonblank && k == 0) { unsigned char *p; for (p = &color[gMaxPass -1][c_off]; p <= pos; p++) { if( *p) { has_color = true; break; } } } } return has_color; } /* read a line of data from the file and convert to the necessary format */ BOOLEAN read_line (image_t * image, unsigned char *black[], int b_off, unsigned char *color[], int c_off) { static unsigned char *oldline = NULL; /* take care to free this! */ unsigned char *prevline = NULL; /* take care to free this! */ unsigned char *line = NULL; /* take care to free this! */ int i, j, k ; int fread_eof = 0; BOOLEAN line_is_nonblank = true; static BOOLEAN prevline_is_nonblank = true; int image_width = image->width; const BOOLEAN repeat_line = (g300 && image->bufferCurLine %2); /* for 300dpi input (g300 is true) , the data is duplicated horizontally and vertically to convert it to 600dpi format. odd lines are copies of the preceeding even line, which was stored as "oldline" : */ if(g300) { image_width /= 2; if (repeat_line) { /* in 300dpi input mode, the data from the previous even line should be used again for this odd line*/ assert(oldline); line = oldline; oldline = NULL; } } if(!line) if (!(line = malloc (image->width * gByteCount))) { /* make this nicer... propagate upwards */ snprintf(syslog_message,message_size, "read_line(): %s", gMessages[E_BADMALLOC]); wrap_syslog (LOG_CRIT,"%s",syslog_message); if (oldline) free (oldline); exit (1); } /* All the six pnm input formats * (pbm, pbmraw, pgm, pgmraw, ppm, ppmraw ) * can be read from the input, and converted to * ppmraw format for further processing. */ if (!gGammaMode && !gTerminate && !repeat_line) { switch (image->version) { /* for completeness, the non-raw pnm formats are supported */ case P1_PBM: { /* read pbm format; convert to ppm format if gByteCount = 3 */ /* This is included for completeness, * but this implementation is PAINFULLY slow ! * is there a better way? * (YES, USE THE PPMRAW FORMAT ONLY !) */ int index = 0; int incr = gByteCount; if(g300) incr *= 2; for ( i = 0 ; i < image_width ; ) { switch( getc( image->fptr ) ) { case EOF: snprintf(syslog_message,message_size, "read_line(pbm,ascii): %s PBM\n", gMessages[E_IM_EOFREADLINE]); wrap_syslog (LOG_CRIT,"%s",syslog_message); /* input data is truncated; set gTerminate mode * and replace lost part of image with whitespace * until print run ends. */ gTerminate = true ; break; case '1': line[index] = 0; index += incr; i ++; break; case '0': line[index] = 255; index += incr; i ++; break; default : break; } } if(g300) { for ( j = 0 ; j < index ; j += incr ) line[j+gByteCount] = line[j]; } if (gByteCount == 3) { for (j = 0; j < index ; j += 3 ) line[j + 2]= line[j + 1] = line[j]; } } break; case P2_PGM: { /* read pgm format; convert to ppm format if gByteCount = 3 */ /* This is included for completeness, * but this implementation is PAINFULLY slow ! * is there a better way? * (YES, USE THE PGMRAW FORMAT ONLY !) */ int index = 0; unsigned int value ; int incr = gByteCount; if(g300) incr *= 2; for ( i = 0 ; i < image_width ; i ++ ) { switch(fscanf(image->fptr, "%u ", &value )) { case 1: break ; case EOF: snprintf(syslog_message,message_size,"read_line(pgm,ascii): %s PGM\n", gMessages[E_IM_EOFREADLINE]); wrap_syslog (LOG_CRIT,"%s",syslog_message); /* input data is truncated; set gTerminate mode * and replace lost part of image with whitespace * until print run ends. */ gTerminate = true ; break; default: snprintf(syslog_message,message_size,"read_line(pgm,ascii): %s", gMessages[E_IM_BADREADLINE]); wrap_syslog (LOG_CRIT,"%s",syslog_message); free (line); line = NULL; if (oldline) { free (oldline); oldline = NULL; } exit (1); break; } if(value <= 255) { line[index] = value; index += incr; } else { snprintf(syslog_message,message_size,"read_line(pgm,ascii): %s", gMessages[E_IM_BADIMAGE]); wrap_syslog (LOG_CRIT,"%s",syslog_message); free (line); if (oldline) free (oldline); exit (1); } } if(g300) { for ( j = 0 ; j < index ; j += incr ) line[j+gByteCount] = line[j]; } if (gByteCount == 3) { for (j = 0; j < index ; j += 3 ) line[j + 2]= line[j + 1] = line[j]; } } break; case P3_PPM: { /* read pbm format */ /* This is included for completeness, * but this implementation is PAINFULLY slow ! * is there a better way? * (YES, USE THE PPMRAW FORMAT ONLY !) */ unsigned int value ; int index = 0; assert(gByteCount == 3); for ( i = 0 ; i < image_width * 3 ; i ++ ) { switch (fscanf(image->fptr, "%u ", &value ) ) { case 1: break ; case EOF: snprintf(syslog_message,message_size,"read_line(ppm,ascii): %s PPM\n", gMessages[E_IM_EOFREADLINE]); wrap_syslog (LOG_CRIT,"%s",syslog_message); /* input data is truncated; set gTerminate mode * and replace lost part of image with whitespace * until print run ends. */ gTerminate = true ; break; default: snprintf(syslog_message,message_size,"read_line(ppm,ascii): %s", gMessages[E_IM_BADREADLINE]); wrap_syslog (LOG_CRIT,"%s",syslog_message); free (line); if (oldline) free (oldline); exit (1); break; } if(value <= 255){ if (g300) { line[index+3] = line[index] = value; index++; if(!(index %3)) index+=3; } else { line[index] = value ; index ++; } } else { snprintf(syslog_message,message_size,"read_line(ppm,ascii) %s", gMessages[E_IM_BADIMAGE]); wrap_syslog (LOG_CRIT,"%s",syslog_message); free (line); if (oldline) free (oldline); exit (1); } } } break; case P4_PBMRAW: /* read pbmraw format; convert to ppm format if gByteCount = 3 */ { int pbm_width, count, index=0; int incr = gByteCount; char* pbmraw_data; unsigned char mask[8] = { 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01 }; pbm_width = ( image_width + 7 ) / 8; if(g300) incr *= 2; if (! (pbmraw_data = malloc(pbm_width)) ) { snprintf(syslog_message,message_size,"read_line(pbmraw): %s", gMessages[E_BADMALLOC]); wrap_syslog (LOG_CRIT,"%s",syslog_message); if (oldline) free (oldline); free (line); exit (1); } count = fread(pbmraw_data, 1 , pbm_width, image->fptr); if (pbm_width == count) { /* success */ /* pbm raw format: 0=white, 1=black; * bits are stored eight per byte, high bit * first, low bit last. */ index = 0; for ( i = 0 ; i < image_width ; i ++ ) { k = i % 8 ; j = i / 8 ; if ( pbmraw_data[j] & mask[k] ) line[index] = 0; else line[index] = 255; index += incr; } free(pbmraw_data); } else { /* error reading line */ free(pbmraw_data); fread_eof=feof(image->fptr); clearerr(image->fptr); if (fread_eof) { snprintf(syslog_message,message_size,"read_line(pbmraw): %s PBMRAW\n", gMessages[E_IM_EOFREADLINE]); wrap_syslog (LOG_CRIT,"%s",syslog_message); /* input data is truncated; set gTerminate mode * and replace lost part of image with whitespace * until print run ends. */ gTerminate = true ; } else { snprintf(syslog_message,message_size,"read_line(pgmraw): %s", gMessages[E_IM_BADREADLINE]); wrap_syslog (LOG_CRIT,"%s",syslog_message); free (line); if (oldline) free (oldline); exit (1); } } if(g300) { for ( j = 0 ; j < index ; j += incr ) line[j + gByteCount] = line[j]; } if (gByteCount == 3) { for (j = 0; j < index ; j += 3 ) line[j + 2]= line[j + 1] = line[j]; } } break; case P5_PGMRAW: /* read pgmraw format; convert to ppm format if gByteCount = 3 */ { int index=0 ; char* pgm_data; int incr = gByteCount; if(g300) incr *= 2; pgm_data = malloc(image_width); if (!pgm_data) { snprintf(syslog_message,message_size,"read_line(pgmraw): %s", gMessages[E_BADMALLOC]); wrap_syslog (LOG_CRIT,"%s",syslog_message); free (line); if (oldline) free (oldline); exit (1); } if ( 1 == fread (pgm_data, image_width , 1, image->fptr) ) { /* success */ index = 0 ; for ( i = 0 ; i < image_width ; i ++ ) { line[index] = pgm_data[i] ; index += incr; } free(pgm_data); } else { /* error reading line */ free(pgm_data); fread_eof=feof(image->fptr); clearerr(image->fptr); if (fread_eof) { snprintf(syslog_message,message_size,"read_line:(pgmraw) %s PGMRAW\n", gMessages[E_IM_EOFREADLINE]); wrap_syslog (LOG_CRIT,"%s",syslog_message); /* input data is truncated; set gTerminate mode * and replace lost part of image with whitespace * until print run ends. */ gTerminate = true ; } else { snprintf(syslog_message,message_size,"read_line(pgmraw): %s", gMessages[E_IM_BADREADLINE]); wrap_syslog (LOG_CRIT,"%s",syslog_message); free (line); if (oldline) free (oldline); exit (1); } } if(g300) { for (j = 0 ; j < index ; j += incr ) line[j + gByteCount] = line[j]; } if (gByteCount == 3){ for (j = 0; j < index ; j += 3 ) line[j + 2]= line[j + 1] = line[j]; } } break; case P6_PPMRAW: /* read ppmraw format */ { assert(gByteCount == 3); if (1 != fread (line, image_width * 3, 1, image->fptr) ) { fread_eof=feof(image->fptr); clearerr(image->fptr); if (fread_eof) { snprintf(syslog_message,message_size,"read_line(ppmraw):%s \n", gMessages[E_IM_EOFREADLINE]); wrap_syslog (LOG_CRIT,"%s",syslog_message); /* input data is truncated; set gTerminate mode * and replace lost part of image with whitespace * until print run ends. */ gTerminate = true ; } else { snprintf(syslog_message,message_size,"read_line(ppmraw): %s", gMessages[E_IM_BADREADLINE]); wrap_syslog (LOG_CRIT,"%s",syslog_message); free (line); if (oldline) free (oldline); exit (1); } } /* if input data was at 300dpi, expand it to 600dpi format */ if(g300) { int j,k; for ( i = image_width - 1 ; i > 0 ; i--) { j = 3 * i ; k = 2 * j; line[ k + 3 ] = line[ k ] = line[ j ]; line[ k + 4 ] = line[ k + 1 ] = line[ j + 1 ]; line[ k + 5 ] = line[ k + 2 ] = line[ j + 2 ]; } line[3] = line[0]; line[4] = line[1]; line[5] = line[2]; } } break; case none: default: snprintf(syslog_message,message_size,"read_line(?): %s", gMessages[E_IM_BADFORMAT]); wrap_syslog (LOG_CRIT,"%s",syslog_message); free (line); if (oldline) free (oldline); exit (1); break; } } else if (gGammaMode) ProduceGamma (image, line ) ; /* generate color calibration page */ if ( gTerminate || image->bufferCurLine < image->top || image->bufferCurLine >= image->height - image->bottom ) { /* * gTerminate becomes true if EOF was obtained when a line was read . * The input image is incomplete . * Print only previously-read complete lines. * unread lines are replaced with blanks for the rest of the print run * * also blank out lines above the top margin, * or below the bottom margin. */ line_is_nonblank = false; memset(line, 0xff, image->width * gByteCount); } if(line_is_nonblank) { if (repeat_line) line_is_nonblank = prevline_is_nonblank ; else { /* crop image to left and right margins */ int imin = 0, imax = image->width * gByteCount; if(image->left > 0) { imin = image->left * gByteCount; memset(line,0xff, imin); } if(image->right > 0) { imax = (image->width - image->right) * gByteCount; memset(line + imax, 0xff, image->right * gByteCount); } /* check if cropped line is really nonblank */ line_is_nonblank = false; for ( i = imin ; i < imax ; i++ ) { if (line[i] != 255) { line_is_nonblank = true; break; } } } } /* mark line as read */ image->LineType[image->bufferCurLine] = image->LineType[image->bufferCurLine] | READLINE; if (!gTerminate && g300 && !repeat_line){ /* in 300dpi mode, store the data when bufferCurLine is even, to use it again for the next odd line at 600dpi */ if (!(prevline = malloc (image->width * gByteCount))) { /* make this nicer... propagate upwards */ snprintf(syslog_message,message_size, "read_line(): %s", gMessages[E_BADMALLOC]); wrap_syslog (LOG_CRIT,"%s",syslog_message); free(line); if (oldline) free (oldline); exit (1); } prevline_is_nonblank = line_is_nonblank; if (prevline_is_nonblank) memcpy(prevline, line, image->width * gByteCount); else memset(prevline, 0xff, image->width * gByteCount); } /* just to be safe ... */ if(gTerminate && oldline) { free(oldline); oldline = NULL; } /* process ALL non-blank lines to avoid artifacts (odd lines are only processed for black in *_Dither() functions ) hopefully, this minimal processing is quite fast */ if(line_is_nonblank) { image->LineType[image->bufferCurLine] = image->LineType[image->bufferCurLine] | NONBLANK; if (gColorMode) { if (gFastMode) HT_Color_Dither (image, line); else FS_Color_Dither (image, line); } else HT_Black_Dither (image, line); } /* if the current line is odd, we only need to return black data */ if (image->bufferCurLine % 2 == 1) { if ( (!gEcoMode || gColorMode) && !gPixmapMode ) { if (convert_black_data (image, line, &black[0][b_off],line_is_nonblank)) image->LineType[image->bufferCurLine] = image->LineType[image->bufferCurLine] | BLACKLINE; } else { /* in B&W EcoMode, or in PixmapMode, * don't print the odd line, but store it * (unless this is the last line!) */ if ( image->bufferCurLine + 1 < image->height ) { memset(&black[0] [b_off], 0x00, (image->width +7 ) / 8 ); oldline = malloc (image->width * gByteCount); memcpy(oldline, line, image->width * gByteCount); } } } else { /* return both black and color data on even lines */ /* note that convert_color_data must be called AFTER convert_black_data */ if ( oldline ) { /* add any black from previous unprinted odd line to next even line */ if (gByteCount == 3) { for ( i = 0; i < image->width * 3; i += 3 ) { if ( !oldline[i] && !oldline[i + 1] && !oldline[i + 2] ) line[i + 2] = line[i + 1] = line[i] = 0 ; } } else /* gByteCount = 1 */ { for ( i = 0; i < image->width ; i ++ ) { if ( !oldline[i] ) line[i] = 0 ; } } free(oldline); oldline = NULL; } if (convert_black_data (image, line, &black[0][b_off],line_is_nonblank)) image->LineType[image->bufferCurLine] = image->LineType[image->bufferCurLine] | BLACKLINE; if (gColorMode) if (convert_color_data (image, line, color, c_off,line_is_nonblank)) image->LineType[image->bufferCurLine] = image->LineType[image->bufferCurLine] | COLORLINE; } free (line); if(prevline) { assert(!oldline); oldline = prevline; } image->bufferCurLine++; return line_is_nonblank; } /* Drugo */ /* buffer a black line or two and return color data */ void buffer_black_line (image_t *image, unsigned char *data[], int offset) { int lines, linesize = (image->width + 7) / 8; BOOLEAN nonblank = false; int curline = image->bufferCurLine; /* if the current line is odd, we need to read 2 black lines */ if (image->bufferCurLine % 2 == 1) lines = 2; else lines = 1; remallocBuffer (image, linesize * lines); /* read_line into buffer and 'data' */ read_line (image, image->buffer, image->bufpos + image->buflines * linesize, data, offset); if (image->LineType[curline] & BLACKLINE) nonblank = true; image->buflines++; /* if we have to read 2 lines, then we haven't gotten any color data yet */ if (lines == 2) { curline++; read_line (image, image->buffer, image->bufpos + image->buflines * linesize, data, offset); image->buflines++; if (image->LineType[curline] & BLACKLINE) nonblank = true; } /* if no black data exists in buffer, advance blackCurLine */ if (image->buftype == empty && !nonblank ) { image->buflines = 0; image->blackCurLine += lines; ; } else image->buftype = bitmap; } /* buffer a color line and return black data */ void buffer_color_line (image_t *image, unsigned char *data[], int offset) { int linesize = (image->width / 2 + 7) / 8 * 3; BOOLEAN nonblank = false; int curline = image->bufferCurLine; /* if the current line is odd, we don't need to buffer any color data */ if (image->bufferCurLine % 2 == 1) { read_line (image, data, offset, NULL, 0); return; } /* we need to buffer 1 color line */ if (gColorMode) remallocBuffer (image, linesize); read_line (image, data, offset, image->buffer, image->bufpos + image->buflines * linesize); if (image->LineType[curline] & COLORLINE) nonblank = true; image->buflines++; /* if no color data exists in buffer, advance colorCurLine */ if (image->buftype == empty && !nonblank ) { image->buflines = 0; image->colorCurLine += 2; } else image->buftype = color; } /* Reads a single line of black image data into data which must be at least (image->width+7)/8 bytes of storage */ int im_black_readline (image_t *image, unsigned char *data[], int offset) { if (image->blackCurLine >= image->height) return 0; if (image->unread) { memcpy (data[0] + offset, image->revdata, (image->width + 7) / 8); image->blackCurLine++; image->unread = 0; free (image->revdata); return 1; } /* if there are buffered black lines, use one of them */ /* if there aren't buffered black lines, process the next line and */ /* buffer a color line */ if (image->buftype == bitmap) { memcpy (data[0] + offset, &image->buffer[0][image->bufpos], (image->width + 7) / 8); image->bufpos += (image->width + 7) / 8; if (--image->buflines == 0) { image->bufpos = 0; image->buftype = empty; } } else buffer_color_line (image, data, offset); image->blackCurLine++; return 1; } /* Reads a single line of color image data into data which must be at least (image->width/2+7)/8*3 bytes of storage */ int im_color_readline (image_t *image, unsigned char *data[], int offset) { int k; if (image->colorCurLine >= image->height) { DPRINTF ("im_color_readline returning 0 immediately!\n"); return 0; } /* if there are buffered color lines, use one of them */ /* if there aren't buffered color lines, process the next line and */ /* buffer a black line */ if (image->buftype == color) { for (k = 0; k < gMaxPass; k++) memcpy (data[k] + offset, &image->buffer[k][image->bufpos], 3 * ((image->width / 2 + 7) / 8)); image->bufpos += 3 * ((image->width / 2 + 7) / 8); image->buflines--; if (image->buflines == 0) { image->bufpos = 0; image->buftype = empty; } } else buffer_black_line (image, data, offset); image->colorCurLine += 2; return 1; } /* push a black line back into the buffer; we read too much! */ void im_unreadline (image_t * image, void *data) { /* can only store one line in the unread buffer */ if (image->unread) return; image->unread = 1; image->revdata = malloc ((image->width + 7) / 8); memcpy (image->revdata, data, (image->width + 7) / 8); image->blackCurLine--; } pnm2ppa-1.13/dither.c0000644000076400007640000003547011310765657011413 00000000000000/*************************************************************************** dither.c - floyd-steinberg & halftone dither routines ------------------- begin : Thu Jan 13 2000 copyright : (C) 1998-2000 by pnm2ppa project email : ***************************************************************************/ /*************************************************************************** * * * 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. * * * ***************************************************************************/ #ifdef HAVE_CONFIG_H # include "config.h" #endif #include #include #define __DITHER_C__ #include "global.h" #include "debug.h" #include "image.h" #include "fscoeff.h" #include "palette.h" #include "hash_ink.h" int ink_lookup(int R, int G, int B, int MaxPass, float *d, int *bx, int *by, int *bz, int *br, int *bg, int *bb) { /* Try to find correct color value in hashed structure instead of * exhaustive search in (MaxPass+1)^3 ink possibilities */ struct hash_ink **arr = 0, *cur; int r, g, b, h; float d1; int shift = 0; /* Keep the compiler quiet! */ /* *d = -1; */ if (MaxPass == 4) /* standard mode */ { arr = arr_max4; shift = shift4; } else if (MaxPass == 1) /* --eco mode */ { arr = arr_max1; shift = shift1; } /* Add here other supported MaxPass arrays */ if (arr == 0) /* not supported MaxPass value by int_lookup() */ return 0; r = R >> shift; g = G >> shift; b = B >> shift; h = (r << (16 - shift * 2)) + (g << (8-shift)) + (b); /* h e [0, 4096> for shift = 4 */ cur = arr[h]; while( cur != 0 ) /* the code added below is an edited copy of the code found below in FS_Color_Dither */ { r = (int) R - (int) cur->data[0]; g = (int) G - (int) cur->data[1]; b = (int) B - (int) cur->data[2]; d1 = /* 0.5 * */ r * r + g * g + b * b; if (d1 <= *d) { *d = d1; *bx = gMaxPass + 1 - cur->x; *by = gMaxPass + 1 - cur->y; *bz = gMaxPass + 1 - cur->z; *br = r; *bg = g; *bb = b; } cur = cur->next; } return MaxPass; } void FS_Color_Dither (image_t *image, unsigned char *line) { short dd; int i, i_max ; int x, bx, y, by, z, bz; float d, d1; int R, G, B, dr, dg, db; int br, bg, bb, r, g, b, oldr, oldb, oldg; static short *err_coeff_e = 0; static short *err_coeff_se = 0; static short *err_coeff_s = 0; static short *err_coeff_sw = 0; int MaxPass = 0; int *error; if (image->bufferCurLine % 2 == 1) { error = gErrVec_bw; } else { error = gErrVec; MaxPass = gMaxPass; } r = g = b = dr = dg = db = 0; br = r; bg = g; bb = b; if (err_coeff_e == NULL) { err_coeff_e = fs_err_coeff_e + 255; err_coeff_se = fs_err_coeff_se + 255; err_coeff_s = fs_err_coeff_s + 255; err_coeff_sw = fs_err_coeff_sw + 255; dd = 25; for (i = -255; i < 256; i++) { err_coeff_e[i] = i * 8 / dd; err_coeff_se[i] = i * 5 / dd; err_coeff_s[i] = i * 8 / dd; err_coeff_sw[i] = i * 4 / dd; } } /* Only even lines are treated for color ; pixels are treated in pairs, and reduced to 300dpi resolution */ i_max = image->width * 3 ; if (image->bufferCurLine % 2 == 0) { /*treatment of even lines */ for (i = 0; i < i_max ; i += 6) { oldr = br; oldb = bb; oldg = bg; br = bg = bb = 0; /* avoid the (0,0,0) entry for black if * no match is found (initial d too small) * use (1,1,1) instead (gMaxPass drops of each color) */ bx = by = bz = 1 ; /* if either of a pair of successive pixels is black, make both black (produces 300dpi black resolution) */ if ( (i+3) != i_max) { if ( !line[i + 3] && !line[i + 4] && !line[i + 5] ) line[i]= line[i + 1] = line[i + 2] = 0 ; } if ( !line[i] && !line[i + 1] && !line[i + 2] ) { /* pixel is black */ error[i + 0] = 0; error[i + 1] = 0; error[i + 2] = 0; dr = dg = db = 0; /* make next pixel black, too */ if ( (i + 3) != i_max ) { line[i + 3] = line[i + 4] = line[i + 5] = 0 ; } } else if (((line[i] < 255) || (line[i + 1] < 255) || (line[i + 2] < 255))) { /* pixel is colored */ /* find the "requested color by considering previous errors */ R = gEnh_curve_r[(int) (line[i] + line[i + 3]) / 2] + error[i] + dr; R = (R < 0 ? 0 : R); R = (R > 255 ? 255 : R); G = gEnh_curve_g[(int) (line[(i + 1)] + line[i + 4]) / 2] + error[i + 1] + dg; G = (G < 0 ? 0 : G); G = (G > 255 ? 255 : G); B = gEnh_curve_b[(int) (line[(i + 2)] + line[i + 5]) / 2] + error[i + 2] + db; B = (B < 0 ? 0 : B); B = (B > 255 ? 255 : B); /* * now convert this RGB value to drops of ink per pixel. * The table is set up as a hashing table . */ if (!gGammaMode) { br = R / 2; bg = G / 2; bb = B / 2; #if 0 d = ((2.0 + (float)R / 256.0) * R * R + 4 * G * G + (2 + (255.0 - (float)R) / 256.0) * B * B)*0.7; #endif if (gMaxPass == 4) { d = (R * R + G * G + B * B) * 1.3; } else { /* does the "1.3" need adjusting for gMaxPass = 1? * This sets "very dark" pixels to black. */ d = (R * R + G * G + B * B) * 1.3; } } else { /* this is for the special case when gamma.ppm is * being generated. */ d = 2147483647; /* just a large initial value */ } #ifdef CHECK_HASHING { /* code for checking correctness of hash_ink (by ink_lookup) Not sensible in production code! */ int sbx, sby, sbz, sbr, sbg, sbb; float sd; int s_result; sd = d; sbx = bx; sby = by; sbz = bz; sbr = br; sbg = bg; sbb = bb; s_result = ink_lookup(R, G, B, MaxPass, &sd, &sbx, &sby, &sbz, &sbr, &sbg, &sbb); #else if (! ink_lookup(R, G, B, MaxPass, &d, &bx, &by, &bz, &br, &bg, &bb)) { /* ink_lookup failed -- so use old code as fallback */ static int unsupported_flag = 0; if (unsupported_flag != MaxPass) { unsupported_flag = MaxPass; DPRINTF("WARNING:Unsupported MaxPass value %d by ink_lookup\n", MaxPass); } #endif /* this code scans the 625 (gMaxPass=4) or * 8 (gMaxPass=1) possible combinations of * (z,y,x) drops of (Cyan,Magenta,Yellow) ink * to best match the RGB value for the pixel, * using the tabulated values in hp_pal * in pallette.h */ for (z = 0; z < MaxPass + 1; z++) for (x = 0; x < MaxPass + 1; x++) for (y = 0; y < MaxPass + 1; y++) if (! (((x == 4) && (y > 2) && (z > 2)) || ((y == 4) && (x > 2) && (z > 2)) || ((z == 4) && (y > 2) && (x > 2)))) { #if 0 rmean = ((int) R + (int) hp_pal[4-x][4-y][4-z][0]) / 2; #endif r = (int) R - (int) hp_pal[4 - x][4 - y][4 - z] [0]; g = (int) G - (int) hp_pal[4 - x][4 - y][4 - z] [1]; b = (int) B - (int) hp_pal[4 - x][4 - y][4 - z] [2]; #if 0 d1 = (2.0 + (float)rmean / 256.0) * r * r + 4 * g * g + (2 + (255.0 - (float)rmean) / 256.0) * b * b; #endif d1 = /* 0.5 * */ r * r + g * g + b * b; /* the next test also excludes "too dark" * pixels with a small initial d value. */ if (d1 <= d) { d = d1; bx = gMaxPass + 1 - x; by = gMaxPass + 1 - y; bz = gMaxPass + 1 - z; br = r; bg = g; bb = b; } } #ifdef CHECK_HASHING if (s_result != 0) { /* if (d != sd) debug( R, G, B, d, gMaxPass + 1 - bx, gMaxPass + 1 - by, gMaxPass + 1 - bz ); */ assert(d == sd); /* The assertions below are deleted; there might be equivalent solutions (w.r.t. distance d) with different values for bx, by, bz assert(sbx == bx); assert(sby == by); assert(sbz == bz); assert(br == sbr); assert(bg == sbg); assert(bb == sbb); */ } } #else } #endif if ( true /* || (bx==0 && by==0 && bz==0) */ ) { /* careful! floats cannot be compared easily */ if (!(d == 0.0) && ((i + 8) < image->width * 3)) { dr = err_coeff_e[br]; dg = err_coeff_e[bg]; db = err_coeff_e[bb]; error[i + 0] = err_coeff_s[br]; error[i + 1] = err_coeff_s[bg]; error[i + 2] = err_coeff_s[bb]; if (i > 3) { error[i - 6] += err_coeff_sw[br]; error[i - 5] += err_coeff_sw[bg]; error[i - 4] += err_coeff_sw[bb]; } } else error[i + 0] = error[i + 1] = error[i + 2] = dr = dg = db = 0; } /* *Put in line[...] the times each color component *have to be printed * gMaxPass + 1 - bz = number of drops of Cyan * gMaxPass + 1 - by = number of drops of Magenta * gMaxPass + 1 - bx = number of drops of Yellow */ line[i] = (unsigned char) bz; line[i + 1] = (unsigned char) by; line[i + 2] = (unsigned char) bx; if ((i + 3) != i_max) { line[i + 3] = line[i]; line[i + 4] = line[i + 1]; line[i + 5] = line[i + 2]; } } else { /* pixel is white */ error[i + 0] = error[i + 1] = error[i + 2] = dr = dg = db = 0; line[i] = line[i + 1] = line[i + 2] = 255; if ( (i + 3) != i_max) { /* white out next pixel, */ line[i + 3] = line[i + 4] = line[i + 5] = 255; } } if (i < image->width * 3 - 8) { error[i] += err_coeff_se[oldr]; error[i + 1] += err_coeff_se[oldg]; error[i + 2] += err_coeff_se[oldb]; } } } else { /* treatment of odd lines (black only) */ for (i = 0; i < i_max ; i += 6) { /* if either of two successive pixels are black, make both black */ if ( (i+3) != i_max) { if ( !line[i + 3] && !line[i + 4] && !line[i + 5] ) line[i] = line[i + 1] = line[i + 2] = 0; else if ( !line[i] && !line[i + 1] && !line[i + 2] ) line[i + 3] = line[i + 4] = line[i + 5] = 0; } /* white out non-black pixels */ if ( line[i] || line[i + 1] || line[i + 2] ) { line[i] = line[i + 1] = line [i + 2] = 255 ; if ( (i+3) != i_max ) line[i + 3] = line[i + 4] = line [i + 5] = 255 ; } } } } void HT_Black_Dither (image_t *image, unsigned char *line) { int i, j = 0, k, i_max; unsigned int halftone_3[5][5] = { {120, 180, 450, 270, 30}, {240, 510, 720, 600, 330}, {420, 630, 750, 660, 390}, {360, 570, 690, 540, 210}, { 60, 300, 480, 150, 90} }; unsigned int halftone[5][5] = { { 40, 60, 150, 90, 10}, { 80, 170, 240, 200, 110}, {140, 210, 250, 220, 130}, {120, 190, 230, 180, 70}, { 20, 100, 160, 50, 30} }; k = image->bufferCurLine % 5; if (gByteCount == 3) { i_max = image->width * 3; for (i = 0; i < i_max ; i += 3) { /* make black pixels come in pairs */ if ( !(i % 6) && (i + 3) != i_max ) { if (!line[i] && !line[i + 1] && !line[i + 2] ) line[i + 3] = line [i + 4] = line[i + 5] = 0; else if (!line[i + 3] && !line[i + 4] && !line[i + 5] ) line[i] = line [i + 1] = line[i + 2] = 0; } if (line[i] + line[i + 1] + line[i + 2] < halftone_3[j][k]) line[i] = line[i + 1] = line[i + 2] = 0; else line[i] = line[i + 1] = line[i + 2] = 255; j++; j %= 4; } } else /* gByteCount = 1 */ { i_max = image->width; for (i = 0; i < i_max ; i++) { /* make black pixels come in pairs */ if ( !(i % 2) && (i + 1) != i_max ) { if (!line[i]) line[i + 1] = 0; else if (!line[i + 1] ) line[i] = 0; } if (line[i] < halftone[j][k]) line[i] = 0; else line[i] = 255; j++; j %= 4; } } } void HT_Color_Dither (image_t *image, unsigned char *line) { int i = 0, i_max; unsigned char halftoner[5][5] = { {40, 60, 150, 90, 10}, {80, 170, 240, 200, 110}, {140, 210, 250, 220, 130}, {120, 190, 230, 180, 70}, {20, 100, 160, 50, 30} }; unsigned char halftoneg[5][5] = { {40, 80, 140, 120, 20}, {60, 170, 210, 190, 100}, {150, 240, 250, 230, 160}, {90, 200, 220, 180, 50}, {10, 110, 130, 70, 30} }; unsigned char halftoneb[5][5] = { {100, 230, 220, 110, 40}, {60, 160, 180, 130, 80}, {150, 50, 70, 140, 170}, {240, 90, 30, 120, 210}, {200, 10, 20, 190, 250} }; /* Only even lines are evaluated ; pixels are treated in pairs, and reduced to 300dpi resolution */ i_max = image->width * 3 ; if (image->bufferCurLine % 2 == 0) { /* treatment of even lines */ for (i = 0; i < i_max ; i += 6) { /* if either of two successive pixels are black, make both black */ if ( (i+3) != i_max) { if ( !line[i + 3] && !line[i + 4] && !line[i + 5] ) line[i] = line[i + 1] = line[i + 2] = 0; } if (line[i] || line[i + 1] || line[i + 2]) if (image->bufferCurLine % 2 == 0) { if (line[i] < halftoner[i % 5][image->bufferCurLine % 5]) line[i] = 1; else line[i] = 255; if (line[i + 1] < halftoneg[i % 5][image->bufferCurLine % 5]) line[i + 1] = 1; else line[i + 1] = 255; if (line[i + 2] < halftoneb[i % 5][image->bufferCurLine % 5]) line[i + 2] = 1; else line[i + 2] = 255; } if ( (i+3) != i_max) { line[i + 3] = line[i]; line[i + 4] = line[i + 1]; line[i + 5] = line[i + 2]; } } } else { /* treatment of odd lines (black only) */ for (i = 0; i < i_max ; i += 6) { /* if either of two successive pixels are black, make both black */ if ( (i+3) != i_max) { if ( !line[i + 3] && !line[i + 4] && !line[i + 5] ) line[i] = line[i + 1] = line[i + 2] = 0; else if ( !line[i] && !line[i + 1] && !line[i + 2] ) line[i + 3] = line[i + 4] = line[i + 5] = 0; } /* white out non-black pixels */ if ( line[i] || line[i + 1] || line[i + 2] ) { line[i] = line[i + 1] = line [i + 2] = 255 ; if ( (i+3) != i_max ) line[i + 3] = line[i + 4] = line [i + 5] = 255 ; } } } } pnm2ppa-1.13/cutswath.c0000644000076400007640000020663311310765657011777 00000000000000/*********************************************************************** cutswath.c - function to cut a swath of a PNM file for PPA printers ------------------- begin : Thu Jan 13 2000 copyright : (C) 1998-2002 by the pnm2ppa project email : ***************************************************************************/ /*************************************************************************** * * * 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. * * * ***************************************************************************/ #ifdef HAVE_CONFIG_H # include "config.h" #endif #include #include #include #include #define __CUTSWATH_C__ #include "ppa_syslog.h" #include "global.h" #include "debug.h" #include "defaults.h" #include "ppa.h" #include "image.h" #include "lang.h" /* stores information of previous sweeps */ int prev_black_vpos , prev_black_dir; int prev_color_vpos , prev_color_dir; /* pointers to next sweep that will print, and waiting sweeps */ ppaSweepData_t *current_swath, *waiting_color, *waiting_black; /* stores info on printable limits of page */ ppaPageLimits_t ColorPageLimits; ppaPageLimits_t BlackPageLimits; int cut_im_black_swath (image_t *image, ppaPrinter_t *printer, ppaSweepData_t *sweep_data, int last_line); int cut_im_color_swath (image_t *image, ppaPrinter_t *printer, ppaSweepData_t *sweep_data[4]); /* Here, we should call cut_im_black_swath and cut_im_color_swath to begin. Then, we need to determine which of these swaths comes earlier on the page and print it first. Then we should re-call the appropriate cut_im_*_swath function to refill that buffer and repeat this procedure. NEW (Feb 2002) : Finally, the sweep data is sent one sweep at a time to ppa_print_sweep(), where the PPA instructions are produced... This will make any further improvements much easier (i.e, staggering the print swaths, in high quality color mode). */ int ppa_print_page (ppaPrinter_t *printer, image_t *image) { ppaSweepData_t sweeps[6]; ppaSweepData_t *prev = NULL, *curblack = NULL, *curcolor = NULL, *color[4] = {NULL, NULL, NULL, NULL}, *tmp = NULL, *unused = NULL, *waiting = NULL; int reload[2] = { 1, 1 }; int done[2] = { 0, 0 }; int found[2] = { 0, 0}; int j, k; int last_dir = unknown; int last_line; int color_sweep = 0, color_todo = 0; int color_byte_width, black_byte_width; BOOLEAN NoPrint = gTerminate; BOOLEAN color_done = false; ppaPageLimits_t * black_page_limit = &BlackPageLimits; ppaPageLimits_t * color_page_limit = &ColorPageLimits; /* read the data from the input file */ /* initialize page limits for this document */ /* vertical limits are in lines (1 line = 1dot at 600dpi), horizontal limits are in data bytes: 1 color data byte = 8 dots at 300dpi, 1 black data byte = 8 dots at 600dpi */ image->left = 0; image->right = 0; image->top = 0; image->bottom = 0; if(printer->left_margin > 0) image->left = printer->left_margin; if(printer->right_margin > 0) image->right = printer->right_margin; if(image->left >= image->width - image->right) NoPrint = true; if(printer->top_margin > 0) image->top = printer->top_margin; if(printer->bottom_margin > 0) image->bottom = printer->bottom_margin; if(image->top >= image->height - image->bottom) NoPrint = true; if(NoPrint) gTerminate = true; /* protect against invalid margin settings configured by users */ color_byte_width = (image->width / 2 + 7) / 8; color_page_limit->left = printer->left_margin / 2 / 8; if ( color_page_limit->left < 0 ) color_page_limit->left = 0 ; color_page_limit->right = (gWidth - printer->right_margin) / 2 / 8; if ( color_page_limit->right > color_byte_width ) color_page_limit->right = color_byte_width ; color_page_limit->bottom = gHeight - printer->bottom_margin ; if ( color_page_limit->bottom > gHeight) color_page_limit->bottom = gHeight ; if ( color_page_limit->bottom < 0 ) color_page_limit->bottom = 0; color_page_limit->top = printer->top_margin ; if ( color_page_limit->top < 0 ) color_page_limit->top = 0 ; if ( color_page_limit->top > color_page_limit->bottom ) color_page_limit->top = color_page_limit->bottom ; black_byte_width = (image->width + 7) / 8; black_page_limit->left = printer->left_margin / 8; if ( black_page_limit->left < 0 ) black_page_limit->left = 0; black_page_limit->right = ( gWidth - printer->right_margin ) / 8; if (black_page_limit->right > black_byte_width ) black_page_limit->right = black_byte_width; black_page_limit->bottom = color_page_limit->bottom; black_page_limit->top = color_page_limit->top; /* create an array for storing info about each line on this page */ if ((image->LineType = malloc (image->height)) == NULL) { snprintf(syslog_message,message_size,"ppa_print_page(): %s", gMessages[E_CS_BADMALLOC]); wrap_syslog (LOG_CRIT,"%s",syslog_message); return 0; } memset(image->LineType, 0x00, image->height); /* note: a full-size (all nozzles) color swath is 64 even lines (300dpi); a full-size (all nozzles) black swath is 300 lines (150 even + 150 odd); is is necessary to restrict black swath to 128 lines (64 even + 64 odd) on some printer models, when printing in dual inks, color+black ? HP7x0: NO, but there is some artifact at the begining of each black swath that does not immediately follow a black swath. (see the calibrate_ppa --align output....) so leave the setting at 128 in gColorMode for now. (duncan, 2000-10-24) HP820: YES flashes lights ... (maybe it will work if what produces the artifacts on HP7x0 is fixed..?) HP1000: ? */ DPRINTF("ppa_print_page(): begin page\n"); /* initialize global prev vertical position and direction markers, etc. */ prev_color_vpos = color_page_limit->top - 1; prev_black_vpos = black_page_limit->top - 1; prev_black_dir = prev_color_dir = unknown; for (k = 0; k < 6; k++) { sweeps[k].direction = unknown; sweeps[k].next = NULL; sweeps[k].image_data = NULL; sweeps[k].nozzle_data = NULL; } /* initialize sweep_data pointers */ curblack = &sweeps[0]; unused = &sweeps[1]; for (k = 0; k < gMaxPass; k++) color[k] = &sweeps[k+2]; /* when the cut_im_*_swath functions are called with the sweep direction = "unknown", they will assign the direction. if gMaxPass is even (i.e. != 1) , the initial value of color[0]->direction is ignored. the cut_im_*swath functions may also override the inital sweep directions in some other cases (e.g., unidirectional printing was requested). If gMaxPass is even, half of the gMaxPass color sweeps will be left_to_right, half will be right_to_left. In the present code (gMaxPass = 4) all these sweeps have the same vertical position. ppa_print_page() currently is based on the assumption that if gMaxPass is even. each r2L color sweep has a corresponding l2R sweep with the same vertical_pos. If this changes, it should be reworked. */ if ( !gColorMode){ done[1] = 1; prev_color_vpos = color_page_limit->bottom +1; } DPRINTF ("ppa_print_page: chkpt 1\n"); while (!done[0] || !done[1]){ /* to be safe, don't ever read beyond end of page */ if(image->blackCurLine >= gHeight) done[0] = 1; if(image->colorCurLine >= gHeight) color_done = 1; if(color_done && !color_todo) done[1] = 1; /* create a color swath */ if (reload[1] && !done[1]){ reload[1] = 0; current_swath = prev; waiting_color = NULL; curcolor = NULL; if(curblack->image_data) waiting_black = curblack; else waiting_black = NULL; if (color_todo){ color_sweep++; color_todo--; /* attempt to alternate direction */ if (!gUnimode && prev ){ BOOLEAN switch_dir=false; if ( !waiting || color[color_sweep]->vertical_pos <= waiting->vertical_pos){ if (color[color_sweep]->direction == prev->direction) switch_dir = true; } else if (color[color_sweep]->direction == waiting->direction) switch_dir = true; if (switch_dir){ for (j=1; j <= color_todo; j++){ if (color[color_sweep+j]->vertical_pos > color[color_sweep]->vertical_pos) break; if (color[color_sweep+j]->direction != color[color_sweep]->direction) { tmp = color[color_sweep]; color[color_sweep] = color[color_sweep+j]; color[color_sweep+j] = tmp; break; } } } } curcolor = color[color_sweep]; DPRINTF("*** loaded color[%d], dir=%d, vpos=%d, todo=%d\n", color_sweep,curcolor->direction, curcolor->vertical_pos, color_todo); #ifdef DEBUG for (k=0; k <= color_todo; k++){ DPRINTF(" %p [%d] dir=%d vpos=%d color=%d\n", color[color_sweep+k],k, color[color_sweep+k]->direction, color[color_sweep+k]->vertical_pos, color[color_sweep+k]->in_color); } #endif } else if (!color_done) switch (cut_im_color_swath (image, printer, color)) { case 0: snprintf(syslog_message,message_size, "ppa_print_page(): %s cut_im_color_swath()", gMessages[E_CS_ERROR]); wrap_syslog (LOG_CRIT,"%s",syslog_message); break; return 1; case 1: DPRINTF("ppa_print_page: cut_im_color_swath returned 1\n"); color_done = true; prev_color_vpos = color_page_limit->bottom +1; prev_color_dir = unknown;; break; case 2: /* count and sort non-NULL sweeps */ color_todo = 0; for (k=0; k < gMaxPass; k++){ if (color[k]->image_data) color_todo++; else { for (j=k+1; j < gMaxPass; j++){ if (color[j]->image_data){ tmp = color[j]; color[j] = color[k]; color[k] = tmp; break; } } } if (!color[k]->image_data) break; } /* sort by vertical_pos */ for (k=0; k < color_todo; k++) { int next = k; for (j = k+1; j < color_todo; j++){ if (color[j]->vertical_pos < color[next]->vertical_pos) next = j; } tmp = color[k]; color[k] = color[next]; color[next] = tmp; } /* attempt to alternate direction */ color_sweep = 0; color_todo--; if (!gUnimode && prev ){ BOOLEAN switch_dir=false; if ( !waiting || color[color_sweep]->vertical_pos < waiting->vertical_pos){ if (color[color_sweep]->direction == prev->direction) switch_dir = true; } else if (color[color_sweep]->direction == waiting->direction) switch_dir = true; if (switch_dir){ for (j=1; j <= color_todo; j++){ if (color[color_sweep+j]->vertical_pos > color[color_sweep]->vertical_pos) break; if (color[color_sweep+j]->direction != color[color_sweep]->direction){ tmp = color[color_sweep]; color[color_sweep] = color[color_sweep+j]; color[color_sweep+j] = tmp; break; } } } } curcolor = color[color_sweep]; found[1]=1; DPRINTF("*** loaded color[%d], dir=%d, vpos=%d, todo=%d\n", color_sweep,curcolor->direction, curcolor->vertical_pos, color_todo); #ifdef DEBUG for (k=0; k <= color_todo; k++){ DPRINTF(" %p [%d] dir=%d vpos=%d color=%d\n", color[color_sweep+k],k, color[color_sweep+k]->direction, color[color_sweep+k]->vertical_pos, color[color_sweep+k]->in_color); } #endif break; case 3: prev_color_dir = unknown; prev_color_vpos = color_page_limit->top - 1; reload[1]=1; found[1]=0; break; default: snprintf(syslog_message,message_size,"ppa_print_page(): %s ", gMessages[E_CS_BADSWITCH]); wrap_syslog (LOG_CRIT,"%s",syslog_message); return 1; } } /* create a black swath */ if (reload[0]){ reload[0] = 0; current_swath = prev; waiting_black = NULL; waiting_color = curcolor; if (gColorMode && !color_done) last_line = image->colorCurLine ; else last_line = image->height; switch (cut_im_black_swath (image, printer, curblack, last_line)){ case 0: snprintf(syslog_message,message_size,"ppa_print_page(): %s cut_im_black_swath()", gMessages[E_CS_ERROR]); wrap_syslog (LOG_CRIT,"%s",syslog_message); return 1; break; case 1: done[0] = 1; prev_black_vpos = black_page_limit->bottom +1; prev_black_dir = unknown;; break; case 2: found[0]=1; DPRINTF("*** loaded black, dir=%d, vpos=%d\n", curblack->direction, curblack->vertical_pos); #ifdef DEBUG DPRINTF(" %p [B] dir=%d vpos=%d color=%d\n", curblack, curblack->direction, curblack->vertical_pos, curblack->in_color); #endif break; case 3: prev_black_vpos = black_page_limit->top -1; prev_black_dir = unknown; reload[0]=1; found[0]=0; break; default: snprintf(syslog_message,message_size,"ppa_print_page(): %s", gMessages[E_CS_BADSWITCH]); wrap_syslog (LOG_CRIT,"%s",syslog_message); return 1; } } if (done[0] && done[1]) break; /* choose which swath (black or color) should print next */ if ( (!done[0] && found[0] && (color_done || !found[1] || curblack->vertical_pos < curcolor->vertical_pos)) ) { /* print the current black swath, if it exists and has a vertical_pos that is earlier any current color swath, that exists */ DPRINTF("ppa_print_page: chkpt 2\n"); reload[0] = 1; DPRINTF("ppa_print_page: chkpt 3\n"); if (prev){ prev->next = curblack; if (found[1] && !done[1]) waiting = curcolor; else waiting = NULL; #ifdef DEBUG DPRINTF("*** ppa_print_sweep 1, %p, dir=%d (last=%d)," "color=%d, vpos=%d, lines [%d-%d]\n", prev,prev->direction, last_dir, prev->in_color,prev->vertical_pos, prev->first_data_line,prev->last_data_line); #endif if(!NoPrint) ppa_print_sweep (printer, prev); if (!gUnimode && last_dir == prev->direction){ DPRINTF("***SWEEP DIRECTION DID NOT CHANGE!!!***\n"); } last_dir = prev->direction; free (prev->image_data); free (prev->nozzle_data); prev->image_data = NULL; prev->nozzle_data = NULL; /* move the current sweep into the 'prev' position */ tmp = curblack; curblack = prev; prev = tmp; } else { /* move the current sweep into the 'prev' position */ prev = curblack; assert (unused); curblack = unused; unused = NULL; } } else if ( (!done[1] && found[1]) ) { /* print the current color swath, if it exists */ DPRINTF("ppa_print_page: chkpt 4 \n"); reload[1] = 1; if (prev) { prev->next = curcolor; if (found[0] && !done[0]) waiting = curblack; else waiting = NULL; #ifdef DEBUG DPRINTF("*** ppa_print_sweep 2, %p, dir=%d (last=%d)," "color=%d, vpos=%d, lines [%d-%d]\n", prev,prev->direction, last_dir, prev->in_color,prev->vertical_pos, prev->first_data_line,prev->last_data_line); #endif if(!NoPrint) ppa_print_sweep (printer, prev); if (!gUnimode && last_dir == prev->direction){ DPRINTF("***SWEEP DIRECTION DID NOT CHANGE!!!***\n"); } last_dir = prev->direction; free (prev->image_data); free (prev->nozzle_data); prev->image_data = NULL; prev->nozzle_data = NULL; color[color_sweep] = prev; } else { assert (unused); color[color_sweep] = unused; unused = NULL; } /* move the current sweep into the 'prev' position */ prev = curcolor; } if(color_done && !color_todo) done[1] = 1; } DPRINTF ("ppa_print_page: chkpt 5\n"); if (prev) { DPRINTF ("ppa_print_page: chkpt 6 about to clear prev\n"); prev->next = NULL; #ifdef DEBUG DPRINTF("*** ppa_print_sweep 3, %p, dir=%d (last=%d)," "color=%d, vpos=%d, lines [%d-%d]\n", prev,prev->direction, last_dir, prev->in_color,prev->vertical_pos, prev->first_data_line,prev->last_data_line); #endif if(!NoPrint) ppa_print_sweep (printer, prev); if (!gUnimode && last_dir == prev->direction){ DPRINTF("***SWEEP DIRECTION DID NOT CHANGE!!!***\n"); } last_dir = prev->direction; free (prev->image_data); free (prev->nozzle_data); prev->image_data = NULL; prev->nozzle_data = NULL; DPRINTF ("ppa_print_page: chkpt 7 cleared prev\n"); } DPRINTF ("ppa_print_page: chkpt 8 Finish.\n"); for (k=0; k < gMaxPass; k++) free(image->buffer[k]); free(image->LineType); image->LineType = NULL; return 0; } /* cutswath functions */ unsigned char * l2r_black_sweep(unsigned char *place, unsigned char *data, int data_width, ppaSwathLimits_t * swath_limits); unsigned char * r2l_black_sweep(unsigned char *place, unsigned char *data, int data_width, ppaSwathLimits_t * swath_limits); unsigned char * l2r_color_sweep(unsigned char *place, unsigned char *data, int data_width, ppaSwathLimits_t * swath_limits); unsigned char * r2l_color_sweep(unsigned char *place, unsigned char *data, int data_width, ppaSwathLimits_t * swath_limits); int black_nozzle_data(ppaSweepData_t * sweep_data, int numlines, int margin_diff); int color_nozzle_data(ppaSweepData_t * sweep_data, int numlines); int read_black_image( unsigned char *data[], image_t *image, ppaPrinter_t *printer, int byte_width, int vpos_shift, int maxlines, ppaSwathLimits_t *swath_limits, int last_line); int read_color_image( unsigned char *data[], image_t *image, ppaPrinter_t *printer, int byte_width, int vpos_shift, int maxlines, ppaSwathLimits_t *swath_limits); /* Upon successful completion, sweep_data->image_data and sweep_data->nozzle_data have been set to pointers which this routine malloc()'d. */ /* Upon successful completion, all members of *sweep_data have been set except next. */ /* Returns: 0 if unsuccessful 1 if successful, but with non-printing result (end of page) 2 if successful, with printing result 3 if unsuccessful, exceeded buffer size */ int cut_im_black_swath (image_t *image, ppaPrinter_t *printer, ppaSweepData_t *sweep_data, int last_line) { unsigned char *data[4] = { NULL, NULL, NULL, NULL}; unsigned char *ppa, *place, *maxplace; int width, byte_width = (image->width + 7) / 8; int vpos_shift=600; /* "vertical position" = line number - vpos_shift */ int horizpos; ppaSwathLimits_t Swath_Limits; ppaSwathLimits_t *swath_limits = &Swath_Limits; int maxlines = 300; /* fixed by design of print head */ /* return if we are not yet allowed to read next part of black image */ if(image->blackCurLine >= last_line) return 3; /* if we need to use "legacy" mode for printing Calibration pages produced by calibrate_ppa, set maxlines = 128 as in pnm2ppa-1.04. */ if(gCalibrate && gColorMode) maxlines = 128; /* safeguard against the user freeing these */ sweep_data->image_data = NULL; sweep_data->nozzle_data = NULL; if ((data[0] = malloc (byte_width * maxlines)) == NULL) { snprintf(syslog_message,message_size,"cut_im_black_swath(): %s", gMessages[E_CS_BADMALLOC]); wrap_syslog (LOG_CRIT,"%s",syslog_message); return 0; } /* read in and analyze image data for a black swath */ { int retval = 0; retval = read_black_image( data, image, printer, byte_width, vpos_shift, maxlines, swath_limits, last_line); if(retval != 2) { free (data[0]); return retval; } } /* analysis of the image is now complete */ /* width of the swath in bytes */ /* change sweep params to ensure at least 4 bytes sweep width */ swath_limits->right += 3; swath_limits->left-- ; /* calculate vertical position */ sweep_data->vertical_pos = swath_limits->last_line + swath_limits->post_blanklines; /* subtract that 600 dot adjustment here */ sweep_data->vertical_pos -= vpos_shift; /* fix sweep direction (right_to_left or left_to_right) */ sweep_data->direction = unknown; /* always make left_to_right black sweeps if gUnimode is true */ /* also do this to avoid striping in multipass color print */ if (gUnimode || (gColorMode && !(gMaxPass %2) && !gCalibrate )) sweep_data->direction = left_to_right; else if (gCalibrate) { /* use legacy direction choosing method from pnm2ppa-1.04 */ if (prev_color_dir == unknown && prev_black_dir == unknown ) sweep_data->direction = left_to_right; else if (prev_black_vpos > prev_color_vpos || prev_color_vpos > sweep_data->vertical_pos ){ if (prev_black_dir == left_to_right) sweep_data->direction = right_to_left; else sweep_data->direction = left_to_right; } else { if (prev_color_dir == left_to_right) sweep_data->direction = right_to_left; else sweep_data->direction = left_to_right; } } else { int opposite_dir = unknown; if (current_swath) { if (prev_color_dir != unknown && prev_color_vpos < sweep_data->vertical_pos && current_swath->vertical_pos <= prev_color_vpos ) opposite_dir = prev_color_dir; else opposite_dir = current_swath->direction; } else { if (prev_black_dir != unknown) opposite_dir = prev_black_dir; else opposite_dir = right_to_left; } if (opposite_dir == right_to_left) sweep_data->direction = left_to_right; else if (opposite_dir == left_to_right) sweep_data->direction = right_to_left; } assert (sweep_data->direction != unknown); sweep_data->in_color = false; /* create sweep image_data "width" is horizontal swath width in bytes; will add 12 null bytes on each side of black swath */ width = swath_limits->right - swath_limits->left + 24; if ((ppa = malloc (width * swath_limits->numlines)) == NULL) { snprintf(syslog_message,message_size,"cut_im_black_swath(): %s", gMessages[E_CS_BADPPAMALLOC]); wrap_syslog (LOG_CRIT,"%s",syslog_message); free (data[0]); return 0; } place = ppa; if (sweep_data->direction == right_to_left) /* right-to-left */ maxplace = r2l_black_sweep(place, data[0], byte_width, swath_limits); else /* sweep_data->direction == left_to_right */ maxplace = l2r_black_sweep(place, data[0], byte_width, swath_limits); sweep_data->image_data = ppa; sweep_data->data_size = maxplace - ppa; sweep_data->first_data_line = swath_limits->first_line; sweep_data->last_data_line = swath_limits->last_line; sweep_data->pre_blanklines = swath_limits->pre_blanklines; sweep_data->post_blanklines = swath_limits->post_blanklines; /* done with data */ free (data[0]); horizpos = swath_limits->left * 8 ; horizpos += (sweep_data->direction == left_to_right) ? 1 : 0; if (sweep_data->direction == right_to_left ) horizpos += printer->r2l_bw_offset ;/* correct bidirectional shearing */ sweep_data->left_margin = horizpos; sweep_data->right_margin = horizpos + printer->marg_diff + width * 8; if (!black_nozzle_data(sweep_data, swath_limits->numlines, printer->marg_diff )) { DPRINTF("black_nozzle_data: malloc failed"); free(sweep_data->image_data); return 0; } prev_black_vpos = sweep_data->vertical_pos; prev_black_dir = sweep_data->direction; DPRINTF ("cut_im_black_swath: created swath, return 2\n"); return 2; } int read_black_image( unsigned char * data[], image_t *image, ppaPrinter_t *printer, int byte_width, int vpos_shift, int maxlines, ppaSwathLimits_t *swath_limits, int last_line) { BOOLEAN got_nonblank = false, after_color = false, ignore_color = false; int i, j; int max_vpos, min_vpos; int left, right; int numlines = 0; BOOLEAN blackline = true; int non_blanklines = 0, pre_blanklines = 0, post_blanklines = 0; ppaPageLimits_t *page_limit = &BlackPageLimits; min_vpos = image->blackCurLine - vpos_shift; max_vpos = BlackPageLimits.bottom - vpos_shift; /* test to see whether color swaths can be ignored */ if(!gColorMode || !(waiting_color || (current_swath && current_swath->in_color ) || image->colorCurLine < ColorPageLimits.bottom ) ) ignore_color = true; /* eat all lines that are below the lower margin */ if (image->blackCurLine >= page_limit->bottom ){ while (image->blackCurLine < image->height) if (!im_black_readline (image, data, 0)){ snprintf(syslog_message,message_size,"read_black_image(): %s", gMessages[E_CS_BADBOTMARG]); wrap_syslog (LOG_CRIT,"%s",syslog_message); return 0; } return 1; } left = page_limit->right - 1; right = page_limit->left; /* eat all beginning blank lines and then up to maxlines or lower margin */ while (( image->blackCurLine + pre_blanklines < page_limit->bottom) && (image->blackCurLine < last_line) && (numlines + pre_blanklines + post_blanklines < maxlines) && image->blackCurLine < max_vpos + vpos_shift && (!gColorMode || got_nonblank || ((image->buflines < MAXBUFFLINES) || (image->buftype == bitmap)))) { if (!im_black_readline (image, data, byte_width * numlines)) { snprintf(syslog_message,message_size,"read_black_image(): %s", gMessages[E_CS_BADNEXTLINE]); wrap_syslog (LOG_CRIT,"%s",syslog_message); return 0; } blackline = image->LineType[image->blackCurLine - 1] & BLACKLINE; if (!got_nonblank) { if (blackline){ for (i = page_limit->left ; i < page_limit->right; i++) { if (data[0][i]){ left = i; got_nonblank = true; right = i; for (j = page_limit->right - 1; j > left ; j--){ if (data[0][j]){ right = j; break; } } break; } } } if(got_nonblank) { /* begin a new swath;, nonblank pixels occur in * bytes "left" through "right", inclusive, * where * page_limit->left <= left <= right < page_limit->right. * This range will be expanded if necessary * as the swath is constructed */ DPRINTF("read_black_image: begin swath, line %d\n", image->blackCurLine ) ; numlines = 1; non_blanklines = 1; swath_limits->first_line = image->blackCurLine; min_vpos = image->blackCurLine - vpos_shift; max_vpos = min_vpos + maxlines - 1 ; /* fix to avoid flashing lights on HP820C: Empirical observation shows that on HP820C, a new swath cannot have a vertical_position that differs from the previous swath that was printed by 1, 2 or 3 lines. This problem does not occur on HP71x/72xC. */ if(current_swath && min_vpos < current_swath->vertical_pos + 4) min_vpos = current_swath->vertical_pos + 4; if(ignore_color) { if (max_vpos >= BlackPageLimits.bottom - vpos_shift + 20) max_vpos = BlackPageLimits.bottom - vpos_shift + 20; } else if( waiting_color) { if (max_vpos >= waiting_color->vertical_pos && waiting_color->vertical_pos >= min_vpos) { /* design this swath to have the same vertical_pos as the waiting color swath, and print immediately after it. */ pre_blanklines = max_vpos - waiting_color->vertical_pos; max_vpos = waiting_color->vertical_pos; min_vpos = max_vpos; after_color = true; } else if (max_vpos < waiting_color->vertical_pos) { /* design this swath to print before the waiting color swath, and to not be overprinted by the waiting color swath. */ if (max_vpos > waiting_color->vertical_pos - 4) max_vpos = waiting_color->vertical_pos - 4; assert (max_vpos >= min_vpos); if (last_line > waiting_color->first_data_line - 1 ) last_line = waiting_color->first_data_line - 1; if(max_vpos + vpos_shift + 1 - maxlines < swath_limits->first_line) { pre_blanklines = maxlines + swath_limits->first_line - max_vpos - vpos_shift - 1; } } else if (waiting_color->vertical_pos < min_vpos) { /* design this swath to print with vpos at least 4 greater than that of the waiting color swath. */ if (min_vpos < waiting_color->vertical_pos + 4) min_vpos = waiting_color->vertical_pos + 4; assert (max_vpos >= min_vpos); } } } } else { int newleft = left, newright = right; if (blackline) { /* find left-most nonblank */ for (i = page_limit->left ; i < left; i++){ if (data[0][byte_width * numlines + i]){ newleft = i; break; } } /* find right-most nonblank */ for (j = page_limit->right - 1; j > right; j--){ if (data[0][byte_width * numlines + j]){ newright = j; break; } } } numlines++; if (newright < newleft){ DPRINTF ("Code error! newleft=%d, newright=%d, left=%d, right=%d\n", newleft, newright, left, right); return 0; } /* if the next line might push us over the buffer size, stop here! */ /* ignore this test for the 720 right now. Will add better */ /* size-guessing for compressed data in the near future! */ if (numlines % 2 == 1 && printer->version != HP7X0) { int l = newleft, r = newright, w; l--; r += 3; w = r - l; if ((w + 24) * numlines > printer->bufsize){ numlines--; im_unreadline (image, data[0] + byte_width * numlines); break; } else { left = newleft; right = newright; if (blackline) non_blanklines = numlines; } } else { left = newleft; right = newright; if (blackline) non_blanklines = numlines; } } } if ((gColorMode) && (image->buflines >= MAXBUFFLINES) && (image->buftype == color)){ DPRINTF ("read_black_image: exceeding buffer size: buflines=%d, MAX=%d\n", image->buflines, MAXBUFFLINES); if ((!got_nonblank)){ return 3; } } if ((!got_nonblank)) { /* eat all lines that are below the lower margin */ if (image->blackCurLine >= page_limit->bottom ){ while (image->blackCurLine < image->height) if (!im_black_readline (image, data, 0)){ snprintf(syslog_message,message_size,"read_black_image(): %s", gMessages[E_CS_BADBOTMARG]); wrap_syslog (LOG_CRIT,"%s",syslog_message); return 0; } return 1; } if(image->blackCurLine == last_line) return 3; return 0; /* error, since didn't get to lower margin, yet blank */ } /* remove any blank lines at end of swath; */ swath_limits->last_line = image->blackCurLine; swath_limits->last_line += (non_blanklines - numlines); /* calculate number of blank lines added at top and bottom of swath */ numlines = non_blanklines; assert (swath_limits->last_line - vpos_shift <= max_vpos); if (swath_limits->last_line - vpos_shift > min_vpos) min_vpos = swath_limits->last_line - vpos_shift; post_blanklines = min_vpos - swath_limits->last_line + vpos_shift; numlines += post_blanklines; pre_blanklines = numlines % 2; numlines += pre_blanklines; DPRINTF("read_black_image: end swath, line %d numlines=%d= " " (%d,%d,%d) left=%d right=%d\n", image->blackCurLine, numlines, pre_blanklines, non_blanklines, post_blanklines, left, right) ; assert(pre_blanklines >= 0 && post_blanklines >= 0 && non_blanklines >= 0 && numlines <= maxlines && numlines % 2 == 0); swath_limits->left = left; swath_limits->right = right; swath_limits->numlines = numlines; swath_limits->non_blanklines = non_blanklines; swath_limits->pre_blanklines = pre_blanklines; swath_limits->post_blanklines = post_blanklines; return 2; } int black_nozzle_data(ppaSweepData_t *sweep_data, int numlines, int margin_diff ) { int i; ppaNozzleData_t nozzles[2]; for (i = 0; i < 2; i++) { nozzles[i].DPI = 600; nozzles[i].pins_used_d2 = numlines / 2; nozzles[i].unused_pins_p1 = 301 - numlines; nozzles[i].first_pin = 1; if (i == 0) { nozzles[i].left_margin = sweep_data->left_margin + margin_diff; nozzles[i].right_margin = sweep_data->right_margin; if (sweep_data->direction == right_to_left) nozzles[i].nozzle_delay = 0; else nozzles[i].nozzle_delay = 6; } else { nozzles[i].left_margin = sweep_data->left_margin; nozzles[i].right_margin = sweep_data->right_margin - margin_diff; if (sweep_data->direction == right_to_left) nozzles[i].nozzle_delay = 2; else nozzles[i].nozzle_delay = 0; } } sweep_data->nozzle_data_size = 2; sweep_data->nozzle_data = malloc (sizeof (nozzles)); if (sweep_data->nozzle_data == NULL) return 0; memcpy (sweep_data->nozzle_data, nozzles, sizeof (nozzles)); return 2; } unsigned char * r2l_black_sweep(unsigned char *place, unsigned char *data, int data_width, ppaSwathLimits_t * swath_limits) { int i, j , width, evenlines, oddlines; int left = swath_limits->left; int right = swath_limits->right; int non_blanklines = swath_limits->non_blanklines; int pre_blanklines = swath_limits->pre_blanklines; int post_blanklines = swath_limits->post_blanklines; int even_non_blanklines, even_pre_blanklines, even_post_blanklines; int odd_non_blanklines, odd_pre_blanklines, odd_post_blanklines; int start_even, start_odd; ppaPageLimits_t * page_limit = &BlackPageLimits; #ifdef DEBUG int data_size = data_width * swath_limits->non_blanklines; #endif even_pre_blanklines = odd_pre_blanklines = pre_blanklines / 2 ; even_non_blanklines = odd_non_blanklines = non_blanklines / 2 ; even_post_blanklines = odd_post_blanklines = post_blanklines / 2 ; start_even= 0; start_odd = 1; if ( (pre_blanklines %2 == 0) && !(non_blanklines % 2 == 0) && !(post_blanklines % 2 == 0) ){ even_non_blanklines++ ; odd_post_blanklines++; start_even= 0; start_odd = 1; } if ( !(pre_blanklines %2 == 0) && !(non_blanklines % 2 == 0) && (post_blanklines % 2 == 0)){ even_pre_blanklines++; odd_non_blanklines++; start_even= 1; start_odd = 0; } if ( !(pre_blanklines %2 == 0) && (non_blanklines % 2 == 0) && !(post_blanklines % 2 == 0)){ even_pre_blanklines++; odd_post_blanklines++; start_even= 1; start_odd = 0; } width = right - left ; evenlines = even_pre_blanklines + even_non_blanklines + even_post_blanklines; oddlines = odd_pre_blanklines + odd_non_blanklines + odd_post_blanklines; assert ( oddlines == evenlines ); /* place 0's in the first 12 columns */ memset (place, 0, evenlines * 12); place += evenlines * 12; for (i = width + 11; i >= 0; i--) { int x ; if (i >= 12){ x = i - 12; if( left + x < page_limit->left || left + x >= page_limit->right ) { /* never print data outside the limits */ memset (place, 0, evenlines); place += evenlines; } else { if ( even_pre_blanklines > 0) { /* first pre_blanklines lines are blank */ memset (place, 0, even_pre_blanklines) ; place += even_pre_blanklines ; } for (j = 0; j < even_non_blanklines; j++) { int index = ((j * 2) + start_even ) * data_width + left + x; #ifdef DEBUG if (!( index < data_size && index >= 0) ){ DPRINTF("index=%d, datasize= %d = %d x %d\n", index, data_size, data_width, swath_limits->non_blanklines); } assert ( index < data_size && index >= 0 ); #endif *place++ = data[index]; } if ( even_post_blanklines > 0 ) { /* last post_blanklines lines are blank */ memset (place, 0, even_post_blanklines) ; place += even_post_blanklines ; } } } else { memset (place, 0, evenlines); place += evenlines; } if (i < width) { x = i ; if( left + x < page_limit->left || left + x >= page_limit->right ) { /* never print data outside the limits */ memset (place, 0, evenlines); place += evenlines; } else { if ( odd_pre_blanklines > 0) { /* first pre_blanklines lines are blank */ memset (place, 0, odd_pre_blanklines) ; place += odd_pre_blanklines ; } for (j = 0; j < odd_non_blanklines; j++) { int index = ((j * 2) + start_odd ) * data_width + left + x; #ifdef DEBUG if (!( index < data_size && index >= 0) ){ DPRINTF("index=%d, datasize= %d = %d x %d\n", index, data_size, data_width, swath_limits->non_blanklines); } assert ( index < data_size && index >= 0 ); #endif *place++ = data[index]; } if ( odd_post_blanklines > 0 ){ /* last post_blanklines lines are blank */ memset (place, 0, odd_post_blanklines) ; place += odd_post_blanklines ; } } } else { memset (place, 0, evenlines); place += evenlines; } } /* place 0's in the last 12 columns */ memset (place, 0, evenlines * 12); place += evenlines * 12; return place; } unsigned char * l2r_black_sweep(unsigned char *place, unsigned char *data, int data_width, ppaSwathLimits_t * swath_limits) { int i, j , width, evenlines, oddlines; int left = swath_limits->left; int right = swath_limits->right; int non_blanklines = swath_limits->non_blanklines; int pre_blanklines = swath_limits->pre_blanklines; int post_blanklines = swath_limits->post_blanklines; int even_non_blanklines, even_pre_blanklines, even_post_blanklines; int odd_non_blanklines, odd_pre_blanklines, odd_post_blanklines; int start_even, start_odd; ppaPageLimits_t * page_limit = &BlackPageLimits; #ifdef DEBUG int data_size = data_width * swath_limits->non_blanklines; #endif even_pre_blanklines = odd_pre_blanklines = pre_blanklines / 2 ; even_non_blanklines = odd_non_blanklines = non_blanklines / 2 ; even_post_blanklines = odd_post_blanklines = post_blanklines / 2 ; start_even= 0; start_odd = 1; if ( (pre_blanklines %2 == 0) && !(non_blanklines % 2 == 0) && !(post_blanklines % 2 == 0)) { even_non_blanklines++ ; odd_post_blanklines++; start_even= 0; start_odd = 1; } if ( !(pre_blanklines %2 == 0) && !(non_blanklines % 2 == 0) && (post_blanklines % 2 == 0)) { even_pre_blanklines++; odd_non_blanklines++; start_even= 1; start_odd = 0; } if ( !(pre_blanklines %2 == 0) && (non_blanklines % 2 == 0) && !(post_blanklines % 2 == 0)) { even_pre_blanklines++; odd_post_blanklines++; start_even= 1; start_odd = 0; } width = right - left ; evenlines = even_pre_blanklines + even_non_blanklines + even_post_blanklines; oddlines = odd_pre_blanklines + odd_non_blanklines + odd_post_blanklines; assert ( oddlines == evenlines ); /* place 0's in the first 12 columns */ memset (place, 0, evenlines * 12); place += evenlines * 12; for (i = 0; i < width + 12; i++) { int x; if (i < width) { x = i; if( left + x < page_limit->left || left + x >= page_limit->right ) { /* never print data outside the limits */ memset (place, 0, evenlines); place += evenlines; } else { if ( odd_pre_blanklines > 0) { /* first pre_blanklines lines are blank */ memset (place, 0, odd_pre_blanklines) ; place += odd_pre_blanklines ; } for (j = 0; j < odd_non_blanklines; j++){ int index = ((j * 2) + start_odd) * data_width + left + x; #ifdef DEBUG if (!( index < data_size && index >= 0) ){ DPRINTF("index=%d, datasize= %d = %d x %d\n", index, data_size, data_width, swath_limits->non_blanklines); } assert ( index < data_size && index >= 0 ); #endif *place++ = data[index]; } if ( odd_post_blanklines > 0 ){ /* last post_blanklines lines are blank */ memset (place, 0, odd_post_blanklines) ; place += odd_post_blanklines ; } } } else { memset (place, 0, evenlines); place += evenlines; } if (i >= 12){ x = i - 12; if( left + x < page_limit->left || left + x >= page_limit->right ) { /* never print data outside the limits */ memset (place, 0, evenlines); place += evenlines; } else { if ( even_pre_blanklines > 0) { /* first pre_blanklines lines are blank */ memset (place, 0, even_pre_blanklines) ; place += even_pre_blanklines ; } for (j = 0; j < even_non_blanklines; j++) { int index = ((j * 2) + start_even) * data_width + left + x; #ifdef DEBUG if (!( index < data_size && index >= 0) ){ DPRINTF("index=%d, datasize= %d = %d x %d\n", index, data_size, data_width, swath_limits->non_blanklines); } assert ( index < data_size && index >= 0 ); #endif *place++ = data[index]; } if ( even_post_blanklines > 0 ){ /* last post_blanklines lines are blank */ memset (place, 0, even_post_blanklines) ; place += even_post_blanklines ; } } } else { memset (place, 0, evenlines); place += evenlines; } } /* place 0's in the last 12 columns */ memset (place, 0, evenlines * 12); place += evenlines * 12; return place; } int cut_im_color_swath (image_t *image, ppaPrinter_t *printer, ppaSweepData_t *sweep_data[4]) { unsigned char *data[4], *ppa, *place, *maxplace; int j, k; int width, byte_width =(image->width / 2 + 7) / 8; int vpos_shift=600; /* "vertical position" = line number - vpos_shift */ int sweep_dir, sweep_vpos; int horizpos; int maxlines = 64; /* fixed by design of print head */ ppaSwathLimits_t Swath_Limits; ppaSwathLimits_t *swath_limits = &Swath_Limits; ppaPageLimits_t *page_limit = &ColorPageLimits; place = NULL; ppa = NULL; maxplace = NULL; /* safeguard against the user freeing these */ for (k = 0; k < gMaxPass; k++) { sweep_data[k]->nozzle_data = NULL; sweep_data[k]->image_data = NULL; } DPRINTF ("byte_width * 3 * maxlines = %d\n", byte_width * 3 * maxlines); for (k = 0; k < gMaxPass; k++) { if ((data[k] = malloc ( byte_width * 3 * maxlines + 8)) == NULL){ snprintf(syslog_message,message_size,"cut_im_color_swath(): %s", gMessages[E_CS_BADMALLOC]); wrap_syslog (LOG_CRIT,"%s",syslog_message); return 0; } } /* read the image data from the input file */ { int retval; retval = read_color_image(data, image, printer, byte_width, vpos_shift, maxlines, swath_limits); if (retval != 2) { for (k = 0; k < gMaxPass; k++) free (data[k]); return retval; } } /* analysis of the image is now complete */ /* now determine vertical position of swath */ sweep_vpos = swath_limits->last_line + 2 * swath_limits->post_blanklines; sweep_vpos += printer->ColBwOffsY ; /* subtract that 600 dot adjustment here */ sweep_vpos -= vpos_shift; /* printing in the leftmost and rightmost bytes of the color * swath leads to problems, so expand the swath width to avoid * using these locations. Nothing will ever get printed in these * expanded ends of the swath. (They are either whitespace, * or outside the limits, where data is rejected below) */ swath_limits->left -= 2; swath_limits->right += 3; /* enforce a minimum swath width of 8 bytes */ if ( swath_limits->right - swath_limits->left < 8 ) { if (swath_limits->right > page_limit->left + 8 ) swath_limits->left = swath_limits->right - 8 ; else swath_limits->right = swath_limits->left + 8 ; } /* fix sweep direction (right_to_left or left_to_right) */ sweep_dir = unknown; if (gCalibrate && !gUnimode) { /* legacy pnm2ppa-1.04 method for choosing sweep direction */ if (prev_color_dir == unknown && prev_black_dir == unknown ) sweep_dir = left_to_right; else if ( prev_black_vpos > prev_color_vpos && prev_black_vpos < sweep_vpos ) { if (prev_black_dir == left_to_right) sweep_dir = right_to_left; else sweep_dir = left_to_right; } else { if (prev_color_dir == left_to_right) sweep_dir = right_to_left; else sweep_dir = left_to_right; } } else if (!gUnimode && gMaxPass % 2){ int opposite_dir = unknown; /* the correct sweep direction is not yet known, and must be guessed from sweep_vpos and the previous history (only for gMaxPass == 1) */ if (current_swath){ if (prev_black_dir != unknown && prev_black_vpos < sweep_vpos && current_swath->vertical_pos < prev_black_vpos ) opposite_dir = prev_black_dir; else opposite_dir = current_swath->direction; } else { /* must be at beginning of page, when prev is still NULL */ if (prev_black_dir != unknown ) opposite_dir = prev_black_dir; else /* this is the first time data was found */ opposite_dir= right_to_left; } if (opposite_dir == left_to_right) sweep_dir = right_to_left; else if (opposite_dir == right_to_left) sweep_dir = left_to_right; } /* create sweep_data for gMaxPass sweeps of the color print head */ for (k = 0; k < gMaxPass; k++) { sweep_data[k]->direction = sweep_dir; if(!gUnimode && !(gMaxPass %2 ) && !gCalibrate) { if( k %2 ) sweep_data[k]->direction = right_to_left; else sweep_data[k]->direction = left_to_right; } if (gUnimode){ if (gPixmapMode) sweep_data[k]->direction = left_to_right; else sweep_data[k]->direction = right_to_left; } assert ( sweep_data[k]->direction != unknown ); sweep_data[k]->vertical_pos = sweep_vpos; sweep_data[k]->in_color = true; sweep_data[k]->image_data = NULL; sweep_data[k]->first_data_line = swath_limits->first_line; sweep_data[k]->last_data_line = swath_limits->last_line; sweep_data[k]->pre_blanklines = swath_limits->pre_blanklines; sweep_data[k]->post_blanklines = swath_limits->post_blanklines; /* create sweep image_data */ width = swath_limits->right - swath_limits->left + 3; if ((ppa = malloc ( width * swath_limits->numlines * 3)) == NULL){ snprintf(syslog_message,message_size,"cut_im_color_swath(): %s", gMessages[E_CS_BADPPAMALLOC]); wrap_syslog (LOG_CRIT,"%s",syslog_message); for (j = k ; j < gMaxPass; j++) free (data[j]); /* free unprocessed data */ for (j = 0; j < k; j++){ free (sweep_data[j]->image_data); free (sweep_data[j]->nozzle_data); } return 0; } place = ppa; if (sweep_data[k]->direction == right_to_left) maxplace = r2l_color_sweep(place, data[k], byte_width, swath_limits); else /* sweep direction is left-to-right */ maxplace = l2r_color_sweep(place, data[k], byte_width, swath_limits); free (data[k]); /* finished with data[k] */ sweep_data[k]->image_data = ppa; sweep_data[k]->data_size = maxplace - ppa; /* left and right limits of sweep (looks like some tweaks have been made!) */ horizpos = (swath_limits->left - 7 ) * 8 * 2; horizpos += printer->ColBwOffsX - 600; horizpos += (sweep_data[k]->direction == left_to_right) ? 2 : 12 ; /*correct bidirectional shearing*/ if (sweep_data[k]->direction == right_to_left ) horizpos += printer->r2l_col_offset ; sweep_data[k]->left_margin = horizpos; sweep_data[k]->right_margin = horizpos + 0x74 + (width - 2 ) * 2 * 8; /* 0x74 used to be "printer->color_marg_diff" */ DPRINTF("sweep data: left_margin = %d, right margin = %d\n", sweep_data[k]->left_margin, sweep_data[k]->right_margin); if (!color_nozzle_data(sweep_data[k], swath_limits->numlines)){ DPRINTF("color_nozzle_data: malloc failed"); for (j=k; j < gMaxPass; j++) free(data[j]); for (j=0; j <= k; j++) free(sweep_data[k]->image_data); for (j = 0; j < k; j++) free(sweep_data[j]->nozzle_data); return 0; } prev_color_vpos = sweep_data[k]->vertical_pos; prev_color_dir = sweep_data[k]->direction; } DPRINTF ("cut_im_color_swath: created swath, return 2\n"); return 2; } int read_color_image( unsigned char *data[], image_t *image, ppaPrinter_t *printer, int byte_width, int vpos_shift, int maxlines, ppaSwathLimits_t *swath_limits) { int i, j; int numlines; int left, right; int non_blanklines = 0, pre_blanklines = 0, post_blanklines = 0 ; int min_vpos; BOOLEAN got_nonblank; ppaPageLimits_t *page_limit = &ColorPageLimits; BOOLEAN colorline = true;; /* Flashing lights happen on the HP820 if difference of consecutive vertical_pos of (different ink ?) sweeps is -3, -2, -1, 1 , 2 or 3! */ /* are there any circumstances which require that this swath has the same vertical_pos as current_swath? assume not, for the moment. */ min_vpos = image->colorCurLine - vpos_shift + printer->ColBwOffsY; if (current_swath && !current_swath->in_color ) { if(min_vpos < current_swath->vertical_pos + 4) min_vpos = current_swath->vertical_pos + 4; } if (waiting_black) { if(min_vpos < waiting_black->vertical_pos + 4) min_vpos = waiting_black->vertical_pos + 4; } /* eat all lines that are below the lower margin */ if (image->colorCurLine >= page_limit->bottom ) { while (image->colorCurLine < image->height) if (!im_color_readline (image, data, 0)){ snprintf(syslog_message,message_size,"read_color_image(): %s", gMessages[E_CS_BADBOTMARG]); wrap_syslog (LOG_CRIT,"%s",syslog_message); return 0; } DPRINTF (" read_color_image: return 1 on line %d\n", __LINE__); return 1; } left = page_limit->right - 1; right = page_limit->left; got_nonblank = false; numlines = 0; pre_blanklines = 0; post_blanklines = 0; /* eat all beginning blank lines and then up to maxlines or lower margin */ while ( ( image->colorCurLine + (2* pre_blanklines) < page_limit->bottom ) && ( (numlines + pre_blanklines + post_blanklines) < maxlines) && (got_nonblank || ((image->buflines < MAXBUFFLINES) || (image->buftype == color)))){ if (!im_color_readline (image, data, byte_width * 3 * numlines)) { snprintf(syslog_message,message_size,"read_color_image(): %s", gMessages[E_CS_BADNEXTLINE]); wrap_syslog (LOG_CRIT,"%s",syslog_message); return 0; } colorline = image->LineType[image->colorCurLine - 2] & COLORLINE; if (!got_nonblank){ if (colorline) { for (i = page_limit->left * 3; i < page_limit->right * 3; i++){ if ((data[gMaxPass - 1][i])){ left = i / 3; got_nonblank = true; right = left; for (j = page_limit->right * 3 - 1; j > left * 3 + 2; j--) { if ((data[gMaxPass - 1][j])){ right = j / 3; break; } } break; } } } if(got_nonblank) { /* begin a new swath;, nonblank pixels occur in * bytes "left" through "right", inclusive, * where * page_limit->left <= left <= right < page_limit->right. * This range will be expanded if necessary * as the swath is constructed */ DPRINTF("read_color_image: begin swath, line %d\n", image->colorCurLine ) ; numlines = 1; non_blanklines = 1; swath_limits->first_line = image->colorCurLine; /* We assume this is true! */ assert (image->colorCurLine - vpos_shift + printer->ColBwOffsY + -1 + ( 2 * maxlines) >= min_vpos); } } else { /* find left-most nonblank */ if (colorline) { for (i = page_limit->left * 3; i < left * 3; i++) { if ((data[gMaxPass - 1][byte_width * 3 * numlines + i])){ left = i / 3; break; } } /* find right-most nonblank */ for (j = page_limit->right * 3 - 1 ; j > right * 3 + 2 ; j--){ if ((data[gMaxPass - 1][byte_width * 3 * numlines + j])){ right = j / 3; break; } } } numlines++; if (colorline) non_blanklines = numlines; } } if ((image->buflines >= MAXBUFFLINES) && (image->buftype == bitmap)){ DPRINTF ("read_color_image: exceeding buffer size: image.buflines=%d, MAX=%d\n", image->buflines, MAXBUFFLINES); if ((!got_nonblank)) return 3; } if ((!got_nonblank)){ /* eat all lines that are below the lower margin */ if (image->colorCurLine >= page_limit->bottom){ while (image->colorCurLine < image->height) if (!im_color_readline (image, data, 0)){ snprintf(syslog_message,message_size,"read_color_image(): %s", gMessages[E_CS_BADBOTMARG]); wrap_syslog (LOG_CRIT,"%s",syslog_message); return 0; } DPRINTF ("read_color_image: return 1 on line %d; ccl: %d; height: %d\n", __LINE__, image->colorCurLine, page_limit->bottom ); return 1; } return 0; /* error, since didn't get to lower margin, yet blank */ } /* remove any blank lines at end of swath; */ swath_limits->last_line = image->colorCurLine; swath_limits->last_line += 2*(non_blanklines - numlines); numlines = non_blanklines; post_blanklines = 0; if(swath_limits->last_line - vpos_shift + printer->ColBwOffsY < min_vpos) post_blanklines = min_vpos + vpos_shift - printer->ColBwOffsY - swath_limits->last_line; numlines += post_blanklines; pre_blanklines = numlines % 2; numlines += pre_blanklines; DPRINTF("read_color_image: end swath, line %d numlines=%d= " " (%d,%d,%d) left=%d right=%d\n", image->colorCurLine, numlines, pre_blanklines, non_blanklines, post_blanklines, left, right) ; swath_limits->left = left; swath_limits->right = right; swath_limits->numlines = numlines; swath_limits->non_blanklines = non_blanklines; swath_limits->pre_blanklines = pre_blanklines; swath_limits->post_blanklines = post_blanklines; return 2; } int color_nozzle_data(ppaSweepData_t * sweep_data, int numlines) { int i; ppaNozzleData_t nozzles[6]; /* create nozzle data for sweep */ for (i = 0; i < 6; i++){ nozzles[i].DPI = 300; nozzles[i].pins_used_d2 = numlines / 2; nozzles[i].unused_pins_p1 = 65 - numlines; nozzles[i].first_pin = 1; if (i == 0){ nozzles[i].left_margin = sweep_data->left_margin + 0x74; nozzles[i].right_margin = sweep_data->right_margin; if (sweep_data->direction == right_to_left) nozzles[i].nozzle_delay = 0; else nozzles[i].nozzle_delay = 0; } if (i == 1){ nozzles[i].left_margin = sweep_data->left_margin + 0x64; nozzles[i].right_margin = sweep_data->right_margin - 0x10; if (sweep_data->direction == right_to_left) nozzles[i].nozzle_delay = 0; else nozzles[i].nozzle_delay = 0; } if (i == 2){ nozzles[i].left_margin = sweep_data->left_margin + 0x3A; nozzles[i].right_margin = sweep_data->right_margin -0x3A; if (sweep_data->direction == right_to_left) nozzles[i].nozzle_delay = 0x0A; else nozzles[i].nozzle_delay = 0x0A; } if (i == 3){ nozzles[i].left_margin = sweep_data->left_margin + 0x3A; nozzles[i].right_margin = sweep_data->right_margin - 0x3A; if (sweep_data->direction == right_to_left) nozzles[i].nozzle_delay = 0x0A; else nozzles[i].nozzle_delay = 0x0A; } if (i == 4){ nozzles[i].left_margin = sweep_data->left_margin + 0x10; nozzles[i].right_margin = sweep_data->right_margin - 0x64; if (sweep_data->direction == right_to_left) nozzles[i].nozzle_delay = 0x04; else nozzles[i].nozzle_delay = 0x04; } if (i == 5){ nozzles[i].left_margin = sweep_data->left_margin; nozzles[i].right_margin = sweep_data->right_margin - 0x74; if (sweep_data->direction == right_to_left) nozzles[i].nozzle_delay = 0x04; else nozzles[i].nozzle_delay = 0x04; } } sweep_data->nozzle_data_size = 6; sweep_data->nozzle_data = malloc (sizeof (nozzles)); if (sweep_data->nozzle_data == NULL) return 0; memcpy (sweep_data->nozzle_data, nozzles, sizeof (nozzles)); return 2; } #define GET_USABLE(A,i) (!(A[i] & 0x1)) #define GET_COLOR(A,i) ((A[i] >> 1) & 0x3); #define GET_ODD(A,i) ((A[i] >> 3) & 0x1); #define GET_X(A,i) ((A[i] >> 4)); #define UNUSABLE 1 #define CYAN (0<<1) #define MAGENTA (1<<1) #define YELLOW (2<<1) #define ODD (1<<3) #define EVEN (0<<3) #define XSHIFT 4 #define XPOS(x) ((x)<left; int right = swath_limits->right; int non_blanklines = swath_limits->non_blanklines; int pre_blanklines = swath_limits->pre_blanklines; int post_blanklines = swath_limits->post_blanklines; int even_non_blanklines, even_pre_blanklines, even_post_blanklines; int odd_non_blanklines, odd_pre_blanklines, odd_post_blanklines; int start_even, start_odd; ppaPageLimits_t * page_limit = &ColorPageLimits; #ifdef DEBUG int data_size = data_width * 3 * swath_limits->non_blanklines; #endif even_pre_blanklines = odd_pre_blanklines = pre_blanklines / 2 ; even_non_blanklines = odd_non_blanklines = non_blanklines / 2 ; even_post_blanklines = odd_post_blanklines = post_blanklines / 2 ; start_even= 0; start_odd = 1; if ( (pre_blanklines %2 == 0) && !(non_blanklines % 2 == 0) && !(post_blanklines % 2 == 0)) { even_non_blanklines++ ; odd_post_blanklines++; start_even= 0; start_odd = 1; } if ( !(pre_blanklines %2 == 0) && !(non_blanklines % 2 == 0) && (post_blanklines % 2 == 0)){ even_pre_blanklines++; odd_non_blanklines++; start_even= 1; start_odd = 0; } if ( !(pre_blanklines %2 == 0) && (non_blanklines % 2 == 0) && !(post_blanklines % 2 == 0)){ even_pre_blanklines++; odd_post_blanklines++; start_even= 1; start_odd = 0; } width = right - left ; evenlines = even_pre_blanklines + even_non_blanklines + even_post_blanklines; oddlines = odd_pre_blanklines + odd_non_blanklines + odd_post_blanklines; assert ( oddlines == evenlines ); for (i = 0; i < (width + 1) * 6 ; i++) { int color, x, odd, y; j = (width + 1) * 6 - 1 - i ; if (i < Left_size){ if (!GET_USABLE (Left_l2r, i)){ memset (place, 0x00, evenlines); place += evenlines; continue; } color = GET_COLOR (Left_l2r, i); odd = GET_ODD (Left_l2r, i); x = GET_X (Left_l2r, i); } else if ( j < Right_size ){ if (!GET_USABLE (Right_l2r, j)){ memset (place, 0x00, evenlines); place += evenlines; continue; } color = GET_COLOR (Right_l2r, j); odd = GET_ODD (Right_l2r, j); x = width -3 - GET_X (Right_l2r,j); } else { color = (i / 2 - 15) % 3; odd = i % 2; x = (i - 24) / 6 - 1 + odd + (color == 0 ? 0 :/* cyan */ color == 1 ? 4 :/* magenta */ 8); /* yellow */ } if (x + left < page_limit->left || x + left >= page_limit->right) { /* never print data that is outside the limits */ memset (place, 0x00, evenlines); place += evenlines; } else { int new_pre_blanklines , new_non_blanklines , new_post_blanklines; int new_start; if (odd) { /* odd lines */ new_pre_blanklines = odd_pre_blanklines ; new_non_blanklines = odd_non_blanklines ; new_post_blanklines = odd_post_blanklines ; new_start = start_odd; } else { /* even lines */ new_pre_blanklines = even_pre_blanklines ; new_non_blanklines = even_non_blanklines ; new_post_blanklines = even_post_blanklines ; new_start = start_even; } if ( new_pre_blanklines > 0 ) { /* first pre_blanklines lines are blank */ memset (place, 0x00, new_pre_blanklines ) ; place += new_pre_blanklines ; } for (y = 0; y < new_non_blanklines; y++) { int index = ((y * 2 + new_start) * data_width * 3 + (x + left ) * 3 + color); #ifdef DEBUG if (!( index < data_size && index >= 0) ){ DPRINTF("index=%d, datasize= %d = %d x %d\n", index, data_size, data_width, swath_limits->non_blanklines); } assert ( index < data_size && index >= 0 ); #endif *place++ = data[index]; } if ( new_post_blanklines > 0 ){ /* last post_blanklines lines are blank */ memset(place, 0x00, new_post_blanklines) ; place += new_post_blanklines ; } } } return place; } static int Right_r2l[] = { UNUSABLE, UNUSABLE, UNUSABLE, CYAN | EVEN | XPOS (0), UNUSABLE, CYAN | EVEN | XPOS (1), CYAN | ODD | XPOS (0), UNUSABLE, UNUSABLE, CYAN | EVEN | XPOS (2), CYAN | ODD | XPOS (1), UNUSABLE, UNUSABLE, CYAN | EVEN | XPOS (3), CYAN | ODD | XPOS (2), MAGENTA | EVEN | XPOS (0), UNUSABLE, CYAN | EVEN | XPOS (4), CYAN | ODD | XPOS (3), UNUSABLE, MAGENTA | EVEN | XPOS (1), MAGENTA | ODD | XPOS (0), CYAN | EVEN | XPOS (5), CYAN | ODD | XPOS (4), UNUSABLE, UNUSABLE, MAGENTA | EVEN | XPOS (2), MAGENTA | ODD | XPOS (1), CYAN | EVEN | XPOS (6), CYAN | ODD | XPOS (5), UNUSABLE, UNUSABLE, MAGENTA | EVEN | XPOS (3), MAGENTA | ODD | XPOS (2), CYAN | EVEN | XPOS (7), CYAN | ODD | XPOS (6), YELLOW | EVEN | XPOS (0), UNUSABLE, MAGENTA | EVEN | XPOS (4), MAGENTA | ODD | XPOS (3), CYAN | EVEN | XPOS (8), CYAN | ODD | XPOS (7) }; /* the final odd yellow swing buffer doesnt fit in right-to-left * color sweeps. Instead of redesigning the structure of the Left of * the sweep (If it works, dont fix it ...) * I'll just arrange that no printable data ever uses * this last position .. (the leftmost printed dot) (duncan) */ static int Left_r2l[] = { UNUSABLE,/*YELLOW | ODD | XPOS (0), this data doesnt fit, what to do?*/ YELLOW | ODD | XPOS (1), YELLOW | EVEN | XPOS (0), YELLOW | ODD | XPOS (2), YELLOW | EVEN | XPOS (1), YELLOW | ODD | XPOS (3), YELLOW | EVEN | XPOS (2), MAGENTA | ODD | XPOS (0), UNUSABLE, YELLOW | ODD | XPOS (4), YELLOW | EVEN | XPOS (3), MAGENTA | ODD | XPOS (1), MAGENTA | EVEN | XPOS (0), YELLOW | ODD | XPOS (5), YELLOW | EVEN | XPOS (4), MAGENTA | ODD | XPOS (2), MAGENTA | EVEN | XPOS (1), YELLOW | ODD | XPOS (6), YELLOW | EVEN | XPOS (5), UNUSABLE, MAGENTA | ODD | XPOS (3), MAGENTA | EVEN | XPOS (2), YELLOW | ODD | XPOS (7), YELLOW | EVEN | XPOS (6), CYAN | ODD | XPOS (0), UNUSABLE, MAGENTA | ODD | XPOS (4), MAGENTA | EVEN | XPOS (3), YELLOW | ODD | XPOS (8), YELLOW | EVEN | XPOS (7), CYAN | ODD | XPOS (1), CYAN | EVEN | XPOS (0) }; unsigned char * r2l_color_sweep(unsigned char *place, unsigned char *data, int data_width, ppaSwathLimits_t * swath_limits) { int i, j , width, evenlines, oddlines; int left = swath_limits->left; int right = swath_limits->right; int non_blanklines = swath_limits->non_blanklines; int pre_blanklines = swath_limits->pre_blanklines; int post_blanklines = swath_limits->post_blanklines; int even_non_blanklines, even_pre_blanklines, even_post_blanklines; int odd_non_blanklines, odd_pre_blanklines, odd_post_blanklines; int start_even, start_odd; ppaPageLimits_t * page_limit = &ColorPageLimits; #ifdef DEBUG int data_size = data_width * 3 * swath_limits->non_blanklines; #endif even_pre_blanklines = odd_pre_blanklines = pre_blanklines / 2 ; even_non_blanklines = odd_non_blanklines = non_blanklines / 2 ; even_post_blanklines = odd_post_blanklines = post_blanklines / 2 ; start_even= 0; start_odd = 1; if ( (pre_blanklines %2 == 0) && !(non_blanklines % 2 == 0) && !(post_blanklines % 2 == 0)) { even_non_blanklines++ ; odd_post_blanklines++; start_even= 0; start_odd = 1; } if ( !(pre_blanklines %2 == 0) && !(non_blanklines % 2 == 0) && (post_blanklines % 2 == 0)){ even_pre_blanklines++; odd_non_blanklines++; start_even= 1; start_odd = 0; } if ( !(pre_blanklines %2 == 0) && (non_blanklines % 2 == 0) && !(post_blanklines % 2 == 0)){ even_pre_blanklines++; odd_post_blanklines++; start_even= 1; start_odd = 0; } width = right - left ; evenlines = even_pre_blanklines + even_non_blanklines + even_post_blanklines; oddlines = odd_pre_blanklines + odd_non_blanklines + odd_post_blanklines; assert ( oddlines == evenlines ); for (i = (width + 1) * 6 - 1 ; i >= 0; i--) { int color, x, odd, y ; j = (width + 1) * 6 - 1 - i ; if (i < Left_size ){ if (!GET_USABLE (Left_r2l, i)){ memset (place, 0x00, evenlines); place += evenlines; continue; } odd = GET_ODD (Left_r2l, i ); color = GET_COLOR (Left_r2l, i); x = GET_X (Left_r2l, i ); } else if (j < Right_size ) { if (!GET_USABLE (Right_r2l,j)) { memset (place, 0x00, evenlines); place += evenlines; continue; } color = GET_COLOR (Right_r2l, j); odd = GET_ODD (Right_r2l, j); x = width - 3 - GET_X (Right_r2l, j); } else { color = (i / 2 - 15) % 3; odd = (i + 1) % 2; x = (i - 24) / 6 - 1 + odd + (color == 0 ? 0 :/* cyan */ color == 1 ? 4 :/* magenta */ 8); /* yellow */ } if (x + left < page_limit->left || x + left >= page_limit->right){ /* never print data that is outside the limits */ memset (place, 0x00, evenlines); place += evenlines; } else { int new_pre_blanklines , new_non_blanklines , new_post_blanklines; int new_start; if (odd) { /* odd lines */ new_pre_blanklines = odd_pre_blanklines ; new_non_blanklines = odd_non_blanklines ; new_post_blanklines = odd_post_blanklines ; new_start = start_odd; } else { /* even lines */ new_pre_blanklines = even_pre_blanklines ; new_non_blanklines = even_non_blanklines ; new_post_blanklines = even_post_blanklines ; new_start = start_even; } if ( new_pre_blanklines > 0 ) { /* first pre_blanklines lines are blank */ memset(place, 0x00, new_pre_blanklines ) ; place += new_pre_blanklines ; } for (y = 0; y < new_non_blanklines ; y++) { int index = ( (y * 2 + new_start) * data_width * 3 + (x + left ) * 3 + color ) ; #ifdef DEBUG if (!( index < data_size && index >= 0) ){ DPRINTF("index=%d, datasize= %d = %d x %d\n", index, data_size, data_width, swath_limits->non_blanklines); } assert ( index < data_size && index >= 0 ); #endif *place++ = data[index]; } if ( new_post_blanklines > 0 ){ /* last post_blanklines lines are blank */ memset(place, 0x00, new_post_blanklines ) ; place += new_post_blanklines ; } } } return place ; } pnm2ppa-1.13/debug.c0000644000076400007640000000242511310765657011214 00000000000000/*************************************************************************** debug.c - debug support routines for pnm2ppa ------------------- begin : Thu Jan 13 2000 copyright : (C) 2000 by Andrew van der Stock email : ajv@greebo.net ***************************************************************************/ /*************************************************************************** * * * 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. * * * ***************************************************************************/ #ifdef HAVE_CONFIG_H # include "config.h" #endif #ifdef DEBUG #include #include #define __DEBUG_C__ #include "debug.h" void DPRINTF (char *format, ...) { va_list p; va_start (p, format); vfprintf (stderr, format, p); va_end (p); } #endif pnm2ppa-1.13/Changelog0000644000076400007640000002704011310765657011574 0000000000000019991002 ajv created CVS repository 19991002 ajv Started work on debugging issues 19991003 ajv Moved main() to getopt for maintainability 19991003 ajv Added all the support files, and ported the calibration suite 19991003 ajv Removed multiple target support, debugged other printers Made recompilation to change things unnecessary 19991013 ajv Added internationalisation support Added English man page Reduced getopt() to *BSD friendly version Fixed a bug that ajv found, and Giorgio fixed Updated the usage to include build version and all arguments 19991020 ajv Added back '-' and post-option file parsing Added I18N stuff Added "verbose" option to output to stderr 19991021 giorgio Added all of Giorgio's patches Added X & Y offsets 19991021 ajv FreeBSD fixes in Makefile Documentation update, including man page 19991105 ajv Documentation update Dutch support - Jimmy Tak "letter" added as valid paper size - Ionutz Borcoman RedHat doco updated - Duncan Haldane 19991120 giorgio Much faster output Much better printing in dark regions compression reenabled for black mode --eco mode bug fixes 19991127 giorgio Changed back to standard Cartesian distance for colors Gamma correction tool (see separate archive) bug fixes in black printing 19991128 ajv re-merged with Giorgio's code base All patches from 19991105 are back updated shift sizes in pnm2ppa.conf fixed permission problem with make install fixed "verbose" and "dump" pnm2ppa.conf keywords 19991204 duncan "legal" (US Legal, 8.5in x 14in) added as a valid paper size - Duncan Haldane 20000113 ajv broke out image.c into several files in an attempt to add pgm support without major breakage 20000114 ajv Finally fixed annoying memory bug. Both MAXLINES and Max Buf Lines must agree. 20000120 klamer Patches to allow calibration to work again. mancini BeOS support duncan RedHat Print filters added to CVS tree ajv Fixed -v and moved yet another global into a struct 20000306 duncan Lots of little fixes; --fd working right now; bidirectional shearing adjustments added (user configurable entries "blackshear" and colorshear" in pnm2ppa.conf. 20000311 duncan added : -B n option and "blackness n" config file entry to control black ink density (drops per pixel n = 0,1,2,3,4 ) default is 2. Also there are now config file entries blackshear and colorshear for adjusting shearing in bidirectional printing. Fixed various bugs that broke HP820/1000 printing. 20000318 duncan Color EcoMode printing now uses bidirectional printsweeps (formerly only FastMode did this) If gMaxPass = 1, you now get bidirectional sweeps (in cut_im_color_swath() , cutswath.c) 20000326 duncan ** changes to dither.c: on odd lines, black is now processed (not color), even black pixels are duplicated, so if either of two successive pixels are black, they both are. Changes also fix Tim's report about blurry black/white boundaries. ** changes to image.c If the odd line is not printed (PixMap or EcoMode), image.c now stores the line, and adds the black parts to the next even line. This fixes a bug in where thin (one-pixel wide) black lines (like enscript borders) could be lost because black ink only printed every second pixel, and odd black lines were just copies of the preceeding even line which had been stored. 20000331 duncan added support for large papersizes 11x17 and a3 (for the 1000 series printers). Added a printer-specific max_pagewidth so papersizes that are too wide for a printer series will not print on that printer. 20000402 duncan tweaked bidirectional sweep shearing correction. (removed the +1 right-to-left black shift in cut_im_black_swath() in cutswath.c ). I am not sure if the shearing correction is model or individual printer-specific. (I suspect the second case, in which case it is a calibration issue (The HP Win9x software seems to have calibration adjustments for blackshear.) if any corrections turn out to be generic to a given printer family, (rather than specific to a particular printer) the default can be changed in defaults.h (the variables are: printer->r2l_bw_offset (=blackshear) printer->r2l_color_offset (=colorshear). 20000404 duncan added support for pbmraw and pgmraw formats. all three pnmraw formats now work. (changes in image.c, image.h ) 20000405 duncan added support for pgm, ppm, pbm nonraw formats. added papersize autoconfiguring from the pnm header, so all ghostscript papersizes are now supported (if the printer can accomodate them) The -s option now only controls the gammafile creation papersize. Made bidirectional printing the default (but this can be configured with a "unimode 1" in pnm2ppa.conf, or --uni, --bi command line options. 20000408 duncan graceful termination of print run if pnm input is truncated (i.e., if read_line() encounters EOF). printer no longer hangs. Moved text strings to lang.h/text-en.h 20000423 duncan clean up way things near sides of swath are handled in cutswath.c 20000710 duncan in FS_Color_Dither(), use line[]= (1,1,1) not (0,0,0) for black replacement of dark pixels for which no color match is found. (fixes flashing LED on certain images - those with no black - with --eco on HP820) (0,0,0) = black ink, (1,1,1) = gMaxPass drops of each color. 20000928 duncan in cutswath.c, if the vertical position of the black and color sweeps differed by 1 , 2 or 3 dots, HP820 got "flashing light syndrome". Fixed by testing for this possibility, and if found, by reducing numlines, and padding the top of a swath with an (even) number of blank lines to keep the height the same. (Thanks to Steven Elliott for reporting this bug, and testing the fix. 20001010 ajv made input of paths to gamma and config files secure against buffer overruns. duncan In -g mode, check that gamma.ppm is not a symbolic link, and is a regular file, before writing to it (but after opening it). 20001018 duncan clean up calibration program. now called calibrate_ppa. It does most calibration now. moved the job of writing gamma.ppm for color calibration to a new utility calibrate_ppa.c. pnm2ppa -g now just prints the corresponding test page. secured syslog messages. No user input is sent to syslog. syslog messages are wrapped, and can be suppressed with a new keyword "silent 1" in /etc/pnm2ppa.conf (but not in subsequently-read config files). all syslog activity now occurs in syslog.c. 20001106 reduce memory footprint of calibrate_ppa (it was 36MB!). 20001112 fix syslog silent/verbose usage; fix alignment pattern bug in calibrate_ppa. repaired the HP820 fix that got broken when the vertical offset was redefined by 600 dots... 20010829 duncan Change the preprocessor flag __BEOS__ to __NO_SYSLOG__ as it is not BeOS specific (it supresses use of the System Log) Added Makefile entries for Solaris, and an INSTALL.SOLARIS file. 20020211 duncan Cleanup C++-style comments (gives gcc compiler warnings) Small syslog.c/Makefile cleanups for Solaris. Minor documentation updates. Change a confusing syslog message about "unsupported PNM formats" so it is clear that the error was non-PNM input to pnm2ppa. Increase version to pnm2ppa-1.10 20020224 duncan Reworked cutswath.c and ppa.c so print sweeps are sent separately by ppa_print_page() in cutswath.c to ppa_print_sweep() in ppa.c (until now, they were going in groups of gMaxPass= 4 at a time in color high quality mode) This will now permit improvement of the print sweep pattern, and make the code easier to understand (easier to separate ppa stuff from image stuff) if someone wants to do a gimp-print PPA backend. 20020311 duncan lots more (incremental) reworking of cutswath.c; now it's pretty well modularized, reading the input image constructing the sweep data, constructing the nozzle data, are all done in separate functions now. Also, modified image.c so the the expansion of data to ppm format (three bytes per 8 dots) is not done for pgm or pbm input (unless the -p option which uses colored ink to make black, and disbles the black ink is used). a new global variable gByteCount = 1 or 3 distingushes the two types of intermediate data format. Also still TODO: I finally understood that the striping of black parts of the image when e.g. the gs example file "tiger.ps"is printed in high-quality mode is because the color and black sweeps are not aligned, so sometimes the color prints on top of black, sometimes the color prints underneath black. If both types of ink are to be used at the same place, the simple solution is probably to prevent black sweeps getting ahead of unprinted color in ppaprint_page() in cutswath.c. 20020526 duncan solved the striping problem; reworked cutswath.c so black ink is never overprinted by color ink. 20020601 duncan reworked the code that prevents color swaths and black swaths from having vertical_pos that differs by 1, 2 or 3 lines (needed for HP820C). (to go with the new swath-cutting algorithm). Added a method for recognising if input is a calibration page produced by calibrate_ppa, as these dont work correctly with the new swath-cutting algorithm. (will restore a "legacy-style" (pnm2ppa-1.04-style) method for printing input that is detected to be calibration pages) 20020610 duncan added a method for storing info on lines as they are read from the image. (whether they have black, and/or color data, etc.) Helps a lot! final fixes to calibrate_ppa. new code seems to work 20020623 duncan added a new command line option --dpi300 that interprets input resolution as 300dpi instead of 600dpi 20020930 duncan enable compression of (color) data by default (only compression of black data was previously enabled). added a configuration file keyword "compression" to switch it off, in case there are problems ... (color data compression seems to work on HP722C!) 20021005 duncan disable logging of informational syslog messages by default. They can (only) be reenabled by "log_info 1" in the default configuration file /etc/pnm2ppa.conf. (They will still go to stderr in "verbose" mode). 20021109 duncan make "version 0" in the config file set the printer type to NOPRINTER, and abort printing if this is not subsequently set to a valid printer model. 20091210 jrbeis fix getopt_long() usage for PowerPC Change the local file syslog.h to ppa_syslog.h to avoid any interference with the global syslog.h. 20091212 jrbeis Autotoolize the package, but do not change other code pnm2ppa-1.13/README.security0000644000076400007640000000717007342473416012511 00000000000000These notes are for the guidance of distributions that include pnm2ppa: --------------------------------------------------------------------- Notes on secure installation of pnm2ppa. What pnm2ppa does: 1. It attempts to open and read a configuration file "/etc/pnm2ppa.conf", and then any additional configuration files with paths specified by the -f command line option. These paths are checked to be shorter than MAXPATHLEN before they are used, otherwise pnm2ppa terminates. GNU getopt() is used to process options. 2. It opens an input file (-i option) to receive pnm data. The pnm format and page size is taken from the header. If the header does not correspond to a valid pnm format, the rest of the data is rejected, and pnm2ppa terminates. The input file path is checked to have a length less than MAXPATHLEN, as determined at compilation time. 3. It opens an output file (-o option) to send ppa data (for the printer). The output file path is checked to have a length less than MAXPATHLEN. 4. (unless the --noGamma option is specified) it tries to read color correction data from "/etc/pnm2ppa.gamma", or an alternate file with a path specified by the -F command line option. Such paths are also checked to be shorter than MAXPATHLEN before they are used. If this data exists, but is not successfully read, pnm2ppa terminates. (See COLOR.txt). 5. pnm2ppa opens and writes to the syslog with informational messages about its progress, or, if it terminates, with an error message. If it is working in --verbose mode, these messages are also sent to stderr. No strings derived from user input to pnm2ppa are included in syslog messages. Syslog messages must fit in a string of length < 128. They can be suppressed with a keyword "silent 1" in the default system configuration file (/etc/pnm2ppa.conf), but not from user-specified config files (from -f option). All syslog actions by pnm2ppa are "wrapped": message strings produces in the rest of the program are only sent to the syslog by code in syslog.c. This is also where openlog() and closelog() are called. ---------------------------------------------------------------------- Recommendations: -- do *NOT* install pnm2ppa suid/guid, if is possible that a "malicious user" might run it. The output file specified with the -o option could overwrite files to which the user has no write permission. -- since pnm2ppa works as an output filter for gs, it only needs the same privileges that gs would need. If lpr is available, pipe the pnm2ppa output though "lpr -l ..." to the appropriate printer rather than directly sending it to e.g. /dev/lp0 (in the latter case, write privileges on /dev/lp0 would be needed.) -------------------------------------------------------------- Other (optional) programs in the distribution: Do NOT install these suid/gid! calibrate_ppa.c: This is used to produce various ppmraw format PixMap images used with pnm2ppa for printer calibration. Note: these PixMaps are LARGE (100MB!!) and should generally be piped directly to pnm2ppa. THIS SHOULD USUALLY BE INSTALLED. parse_vlink.c a utility useful in debugging pnm2ppa that can interpret ppa format output instructions to the printer, whether produced by pnm2ppa, or captured from the Windows9x drivers. It is in the ppa_protocol subdirectory, and is not compiled by default. THIS IS NOT USUALY INSTALLED. pnm2ppa-1.13/pdq/0000777000076400007640000000000011313235642010614 500000000000000pnm2ppa-1.13/pdq/README.pdq0000644000076400007640000000362607505653400012206 00000000000000gs-pnm2ppa is a driver that integrates pnm2ppa into Jacob Langford's simple spool-free printing system PDQ ("Print, Don't Queue"). It will work for the following printers that use the PPA protocol: HP DeskJet 710C, 712C HP DeskJet 720C, 722C HP DeskJet 820Cse, 820Csi HP DeskJet 1000Cse, 1000Csi The printer must be installed LOCALLY on the host that runs pdq; translation to the PPA format that the printer accepts must be done on the host to which the printer is physically attached. gs-pnm2ppa cannot be used to print to a PPA printer that is accessed over a network. ------------------------------------------------------------- PDQ currently has a homepage at: http://pdq.sourceforge.net The latest release (as of September 2000) is pdq-2.2.1. ------------------------ After installing a version of pdq that does not include this driver, just copy the file "gs-pnm2ppa" into the pdq ghostscript driver directory (usually /etc/pdq/drivers/ghostscript/), and the file "dummy" into the interfaces directory (usually /etc/pdq/interfaces). You must be root to do this: cp gs-pnm2ppa /etc/pdq/drivers/ghostscript cp dummy /etc/pdq/interfaces Then run "xpdq" to setup the printer, selecting the driver "gs-pnm2ppa", and the interface "dummy". You must specify The local parallel printer port to which the printer is attached when configuring the driver. You must then return to the "driver option" screen and select the correct printer model and desired color mode. You may need to exit xpdq to activate the settings you just entered. Note that the user of the printer must have write permission to the port it is attached to. Thats all!. ------------------------------------------------------------------ The pnm2ppa homepage is at: http://sourceforge.net/projects/pnm2ppa send comments/bug reports about gs-pnm2ppa (but not pdq) to: pnm2ppa_advice@users.sourceforge.net pnm2ppa-1.13/pdq/dummy0000644000076400007640000000227007157616403011620 00000000000000# Copyright 2000 Duncan Haldane # # PDQ interface: dummy # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License version 2. # # 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. ############################################################ interface dummy { help = "Use this dummy interface if your printer is connected to a local parallel port of your computer, which is configured by a driver (e.g., gs-pnm2ppa) that bypasses the PDQ interface" argument { var = "PORT" desc = "Dummy device" help = "Do not change this setting" def_value = "/dev/null" } send_exec { echo "PDQ interface was bypassed" } } pnm2ppa-1.13/pdq/gs-pnm2ppa0000644000076400007640000002651507162203175012453 00000000000000# Copyright 2000 Duncan Haldane # # PDQ driver: gs-pnm2ppa # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License version 2. # # 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. # #################################################################### # v. 0.11 September 20, 2000 # # This is a pdq driver for use with pnm2ppa, a postfilter used in combination # with Ghostscript to print on HP DeskJet printers that use HP's proprietary # "host-based" PPA ("Printer Performance Architecture") protocol. # For information on pnm2ppa, see the pnm2ppa project homepage # at http://sourceforge.net/projects/pnm2ppa # # It is designed to work with Jacob Langford's PDQ ("Print, Don't Queue") # spool-free printing system (works with pdq-2.2.1). # (homepage: http://feynman.tam.uiuc.edu/pdq ) # # To add this to a pdq installation that does not already contain it, # simply copy this file into the pdq ghostscript drivers directory # (usually /etc/pdq/drivers/ghostscript/). # # The nnn.log file written by print job nnn in the .printjobs directory # records the GhostScript DRIVER and PaperSize used, and the set of options # passed to pnm2ppa. This information may be useful for troubleshooting, # and can be viewed with the Job->"Show details" feature of xpdq. # ##################################################################### driver "gs-pnm2ppa" { help "Designed for PostScript(tm) printing on HP DeskJet 710C, 712C, 720C, 722C, 820Cse, 820Cxi, 1000Cse, and 1000Cxi printers which use the PPA protocol. This driver can only print to a local parallel port to which the printer is attached, and which is specified as a (required) driver argument. The \"dummy\" PDQ interface should be used. Ghostscript \"pnmraw\" drivers are required, as well as the \"pnm2ppa\" postfilter (available from http://sourceforge.net/projects/pnm2ppa ). Uses enscript for text-to-PostScript conversion before printing text files." requires "gs pnm2ppa" required_args "LOCAL_PORT" verify_exec { (gs -h |grep -q pnmraw ) || (echo "Required Ghostscript driver \"pnmraw\" is not available." ; exit 1) } option { desc = "Printer model" var = PPA_PRINTER choice "DJ710" { value = "-v 710" desc = "HP DeskJet 710C, 712C" help = "Select this for HP 710C series DeskJet printers" } choice "DJ720" { value = "-v 720" desc = "HP DeskJet 720C, 722C" help = "Select this for HP 720C series DeskJet printers" } choice "DJ820" { value = "-v 820" desc = "HP DeskJet 820Cse, 820Cxi" help = "Select this for HP 820C series DeskJet printers" } choice "DJ1000" { value = "-v 1000" desc = "HP DeskJet 1000Cse, 1000Cxi" help = "Select this for HP 1000C series DeskJet printers" } } option { desc = "Standard color/print quality choices" var = PPA_MODE default_choice "ColorNormal" choice "BlackEconoFast" { value = "b1" desc = "Black and white, econofast mode" help = "Ink economy mode, with black ink only" } choice "BlackNormal" { value = "b2" desc = "Black and white, normal quality" help = "Normal printing, with black ink only" } choice "ColorEconoFast" { value = "c1" desc = "Color, econofast mode" help = "Ink economy mode (single pass of print head), with fast dithering option. Both color and black inks are used." } choice "ColorNormal" { value = "c5" desc = "Color, normal quality" help = "Ink economy mode (single pass of print head). Both color and black inks are used. " } choice "ColorBest" { value = "c3" desc = "Color, high quality" help = "Multiple passes of print head. Both color and black inks are used." } choice "ColorNormalNoBlack" { value = "c2" desc = "Color, normal quality, black ink disabled" help = "Ink economy mode (single pass of print head). \"Black\" is made by mixing colored inks: no black ink is used." } choice "ColorBestNoBlack" { value = "c4" desc = "Color, high quality, black ink disabled" help = "This is the best (but slowest) choice for color images. \"Black\" is made by mixing colored inks; no black ink is used. Prints unidirectionally." } } option { desc = "Force uni/bidirectional printing" var = PPA_UNIMODE default_choice "Bi" choice "Bi" { value = "" desc = "default choice" help = "Use Bidirectional printing (when this is faster)" } choice "Uni" { value = "--uni" desc = "force unidirectional print sweeps" help = "Unidirectional printing is slower, but may be best for images" } } option { var = PPA_BLACKNESS; desc = "black ink correction (for text)" default_choice "B2" choice "B0" { value = "-B 0" desc = "blackness=0" help = "No black ink is printed" } choice "B1" { value = "-B 1" desc = "blackness=1" help = "Reduced black ink density" } choice "B2" { value = "" desc = "blackness=2" help = "Default black ink density" } choice "B3" { value = "-B 3" desc = "blackness=3" help = "Increased black ink density" } choice "B4" { value = "-B 4" desc = "blackness=4" help = "Maximum black ink density (May cause wetting of paper!)" } } option { desc = "Color Correction (\"Gamma\" curves)." var = PPA_GAMMA default_choice "useGamma" choice "useGamma" { value = "" desc = "Use color correction" help = "Carry out color correction using an optional \"Gamma file\", or Gamma curves based on configuration file parameters. (see pnm2ppa documentation)" } choice "noGamma" { value = "--noGamma" desc = "No color correction" help = "Do not use any color correction curves." } } argument { var = "PPA_CONF" desc = "pnm2ppa configuration file" help = "Give the full path to the pnm2ppa configuration file you wish to use. See \"man pnm2ppa\", \"pnm2ppa -h\", or the example configuration file distributed with pnm2ppa for information about what can be configured there." def_value = "/etc/pnm2ppa.conf" } argument { var = "PPA_GAMMA_NORMAL" desc = "Gamma file (normal quality color)" help = "Give the full path to an optional color correction (\"Gamma curve\") file for use with normal quality mode color printing (see pnm2ppa documentation)." def_value = "" } argument { var = "PPA_GAMMA_HIQUAL" desc = "Gamma file (high quality color)" help = "Give the full path to an optional color correction (\"Gamma curve\") file for use with high-quality mode color printing (see pnm2ppa documentation)." def_value = "" } argument { var = "EXTRA_PPA_OPTS" desc = "Extra pnm2ppa options" help = "Enter any extra pnm2ppa options you wish to add: these will take precedence over other options set by this driver. See \"man pnm2ppa\" or \"pnm2ppa -h\" for a full description." def_value = "" } argument { var = "LOCAL_PORT" desc = "Local printer port" help = "pnm2ppa can only print to a printer attached to a local parallel port on the host system running this driver, and by-passes the \"interface\" in PDQ. (The \"dummy\" PDQ interface should be selected.) On Linux, parallel ports are called /dev/lp0, /dev/lp1,.... On other systems, consult your documentation. The parallel port used must be \"world-writable\" (i.e, the user must be able to write to it). " } argument { var = "PAPERSIZE" desc = "paper size" help = "Set this to a valid Ghostscript papersize: letter, legal, a3, a4, etc... (see \"man gs \" for full list). The papersize must of course be one compatible with the particular HP DeskJet model, or pnm2ppa will reject it." def_value = "letter" } argument { var = "ENSCRIPT_OPTS" desc = "enscript options" help = "enscript (if available) is used to convert text files to postscript before printing by pnm2ppa. Give enscript options, in particular \"--media=(papersize)\". Note that enscript papersize names (listed in the configuration file, usually /etc/enscript.cfg) are a little different from the Ghostscript papersize names. See \"man enscript\". If enscript is not available, you will only be able to print postscript files." def_value = "--no-header --media=Letterdj" } language_driver postscript {} # Nothing to do... language_driver text { convert_exec { if (enscript --help |grep -q sage); then enscript -o $OUTPUT \ -b "$FILENAME %W Page \$% of \$=" \ $ENSCRIPT_OPTS $INPUT exit 0 else echo "ABORTED: enscript needed to print text files, but not found" exit 1 fi } } filter_exec { PDQ_DRIVER="v0.11 September 20, 2000" echo "PDQ ghostscript driver gs-pnm2ppa $PDQ_DRIVER:" if [ "$PPA_MODE" = "b1" ]; then GS_DEVICE="pbmraw" PPA_COLOR="--bw --eco" elif [ "$PPA_MODE" = "b2" ]; then GS_DEVICE="pbmraw" PPA_COLOR="--bw" elif [ "$PPA_MODE" = "c1" ]; then GS_DEVICE="ppmraw" PPA_COLOR="--eco --fd" elif [ "$PPA_MODE" = "c2" ]; then GS_DEVICE="ppmraw" PPA_COLOR="-p --eco -F $PPA_GAMMA_NORMAL " elif [ "$PPA_MODE" = "c3" ]; then GS_DEVICE="ppmraw" PPA_COLOR=" -F $PPA_GAMMA_HIQUAL " elif [ "$PPA_MODE" = "c4" ]; then GS_DEVICE="ppmraw" PPA_COLOR="-p --uni -F $PPA_GAMMA_HIQUAL " elif [ "$PPA_MODE" = "c5" ]; then GS_DEVICE="ppmraw" PPA_COLOR="--eco -F $PPA_GAMMA_NORMAL " else echo "ABORTED: No valid Color choice found" exit 1 fi echo "Ghostscript: DEVICE=$GS_DEVICE, PaperSize=$PAPERSIZE" PPA_OPTIONS="$PPA_PRINTER" if [ -f $PPA_CONF ] ; then PPA_OPTIONS="$PPA_OPTIONS -f $PPA_CONF" else echo "WARNING: specified pnm2ppa configuration file \"$PPA_CONF\" not found!" fi PPA_OPTIONS="$PPA_OPTIONS $PPA_COLOR" PPA_OPTIONS="$PPA_OPTIONS $PPA_GAMMA" PPA_OPTIONS="$PPA_OPTIONS $PPA_UNIMODE" PPA_OPTIONS="$PPA_OPTIONS $PPA_BLACKNESS" PPA_OPTIONS="$PPA_OPTIONS $EXTRA_PPA_OPTS" echo "pnm2ppa options: $PPA_OPTIONS" echo "PPA output streamed directly to local port $LOCAL_PORT" gs \ -q -dBATCH -dSAFER -dNOPAUSE \ -sDEVICE=$GS_DEVICE \ -r600x600 \ -sPaperSize=$PAPERSIZE \ -sOutputFile=- \ $INPUT | pnm2ppa $PPA_OPTIONS -i - -o $LOCAL_PORT rm -f $INPUT rm -f $OUTPUT exit 0 } } pnm2ppa-1.13/lpd/0000777000076400007640000000000011313235642010607 500000000000000pnm2ppa-1.13/lpd/README.lpd0000644000076400007640000000205307176564577012211 00000000000000printcap contains BSD-style lpd printer descriptions for these printers: color (best quality color) coloreco (normal quality color) bw (best quality black) bweco (economy quality black) ascii (filter for printing ascii text files) The printcap entries say: use a log file (lf) and an accounting file (af), suppress form feeds (sf), suppress printing of burst page header (sh) and the maximum file size is unlimited (mx#0). Edit these if necessary. Then edit your /etc/printcap file to add the contents of printcap to it. (Just copy printcap to /etc/printcap, if no other printers are defined). Now Run the shell script lpdsetup, specifying your desired paper size, e.g.: ./lpdsetup letter ./lpdsetup legal ./lpdsetup a4 ./lpdsetup a3 This installs the filters in /usr/local/bin and creates the corresponding spool directories /var/spool/lpd/color, etc, You must be root to do this. You may wish to edit the options specified in the filter files color.if coloreco.if bw.if bweco.if ascii.if pnm2ppa-1.13/lpd/ascii.if0000644000076400007640000000032207176564577012160 00000000000000#! /bin/sh # for printing black and white text (ascii) files. FILTER="/usr/local/bin/bw.if" #FILTER="/usr/local/bin/bweco.if" #------enscript command line-------------------------- enscript -2rj -p- | $FILTER pnm2ppa-1.13/lpd/bw.if0000644000076400007640000000062207176564577011503 00000000000000#!/bin/sh # high quality black and white printing using pbm BitMap format. # uncomment or change these options as necessary #PAPER=letter #PAPER=legal #PAPER=a4 #PAPER=a3 #PPAOPTS="-B 2" PNM2PPA="/usr/local/bin/pnm2ppa" #------------------dont change below this line---------------------- gs -sDEVICE=pbmraw -sPAPERSIZE=$PAPER -q -dNOPAUSE -r600 -sOutputFile=- - | \ $PNM2PPA --bw $PPAOPTS -i - -o - pnm2ppa-1.13/lpd/bweco.if0000644000076400007640000000063507176564577012176 00000000000000#!/bin/sh # ink economy mode black and white printing using pbm BitMap format. # uncomment or change these options as necessary #PAPER=letter #PAPER=legal #PAPER=a4 #PAPER=a3 #PPAOPTS="-B 2" PNM2PPA="/usr/local/bin/pnm2ppa" #------------------dont change below this line---------------------- gs -sDEVICE=pbmraw -sPAPERSIZE=$PAPER -q -dNOPAUSE -r600 -sOutputFile=- - | \ $PNM2PPA --bw --eco $PPAOPTS -i - -o - pnm2ppa-1.13/lpd/color.if0000644000076400007640000000060207176564577012207 00000000000000#!/bin/sh # best quality color printing using ppm PixMap format. # uncomment or change these options as necessary #PAPER=letter #PAPER=legal #PAPER=a4 #PAPER=a3 #PPAOPTS="-p" PNM2PPA="/usr/local/bin/pnm2ppa" #------------------dont change below this line---------------------- gs -sDEVICE=ppmraw -sPAPERSIZE=$PAPER -q -dNOPAUSE -r600 -sOutputFile=- - | \ $PNM2PPA $PPAOPTS -i - -o - pnm2ppa-1.13/lpd/coloreco.if0000644000076400007640000000061507176564577012702 00000000000000#!/bin/sh # ink economy mode color printing using ppm PixMap format. # uncomment or change these options as necessary #PAPER=letter #PAPER=legal #PAPER=a4 #PAPER=a3 #PPAOPTS="--fd" PNM2PPA="/usr/local/bin/pnm2ppa" #------------------dont change below this line---------------------- gs -sDEVICE=ppmraw -sPAPERSIZE=$PAPER -q -dNOPAUSE -r600 -sOutputFile=- - | \ $PNM2PPA --eco $PPAOPTS -i - -o - pnm2ppa-1.13/lpd/lpdsetup0000755000076400007640000000114607176353610012323 00000000000000#!/bin/sh INSTALLDIR="/usr/local/bin" SPOOLDIR="/var/spool/lpd" PAPER=letter for paper in letter legal a3 a4 ; do if [ "$1" = "$paper" ] ; then PAPER=$paper fi done echo "PAPERSIZE used by ghostscript will be $PAPER" for PRINTER in color coloreco bw bweco ascii ; do SEDCMD="sed s/^#PAPER=$PAPER/PAPER=$PAPER/ $PRINTER.if" $SEDCMD > $INSTALLDIR/$PRINTER.if chmod 0755 $INSTALLDIR/$PRINTER.if if [ ! -d $SPOOLDIR/$PRINTER ] ; then mkdir -p $SPOOLDIR/$PRINTER touch $SPOOLDIR/$PRINTER/log touch $SPOOLDIR/$PRINTER/acct fi done pnm2ppa-1.13/lpd/printcap0000644000076400007640000000254407176342607012307 00000000000000# pnm2ppa printer descriptions for /etc/printcap # color printing, "normal quality" (economy) coloreco|lp:\ :lp=/dev/lp0:\ :sd=/var/spool/lpd/coloreco:\ :lf=/var/spool/lpd/coloreco/log:\ :af=/var/spool/lpd/coloreco/acct:\ :if=/usr/local/bin/coloreco.if:\ :la:mx#0:\ :sh:sf: # color printing, "best quality" color:\ :lp=/dev/lp0:\ :sd=/var/spool/lpd/color:\ :lf=/var/spool/lpd/color/log:\ :af=/var/spool/lpd/color/acct:\ :if=/usr/local/bin/color.if:\ :la:mx#0:\ :sh:sf: # black and white printing, "best quality" bw:\ :lp=/dev/lp0:\ :sd=/var/spool/lpd/bw:\ :lf=/var/spool/lpd/bw/log:\ :af=/var/spool/lpd/bw/acct:\ :if=/usr/local/bin/bw.if:\ :la:mx#0:\ :sh:sf: # black and white printing, "economy quality" bweco:\ :lp=/dev/lp0:\ :sd=/var/spool/lpd/bweco:\ :lf=/var/spool/lpd/bweco/log:\ :af=/var/spool/lpd/bweco/acct:\ :if=/usr/local/bin/bweco.if:\ :la:mx#0:\ :sh:sf: # filter for black and white printing of ascii (text) files. ascii:\ :lp=/dev/lp0:\ :sd=/var/spool/lpd/ascii:\ :lf=/var/spool/lpd/ascii/log:\ :af=/var/spool/lpd/ascii/acct:\ :if=/usr/local/bin/ascii.if:\ :la:mx#0:\ :sh:sf: pnm2ppa-1.13/sample_scripts/0000777000076400007640000000000011313235643013061 500000000000000pnm2ppa-1.13/sample_scripts/lprcolor0000755000076400007640000000017607546717064014602 00000000000000cat $1 | \ gs -sDEVICE=ppmraw -q -sPAPERSIZE=a4 -dNOPAUSE -r600 -sOutputFile=- - | \ pnm2ppa $2 $3 $4 $5 -i - -o /dev/lp0 pnm2ppa-1.13/sample_scripts/lprbw0000755000076400007640000000020607546717064014066 00000000000000cat $1 | \ gs -sDEVICE=pbmraw -q -sPAPERSIZE=a4 -dNOPAUSE -r600 -sOutputFile=- - | \ pnm2ppa --bw --eco $2 $3 $4 $5 -i - -o /dev/lp0 pnm2ppa-1.13/sample_scripts/lpreco0000755000076400007640000000020207546717064014220 00000000000000cat $1 | \ gs -sDEVICE=ppmraw -q -sPAPERSIZE=a4 -dNOPAUSE -r600 -sOutputFile=- - | \ pnm2ppa --eco $2 $3 $4 $5 -i - -o /dev/lp0 pnm2ppa-1.13/stamp-h10000644000076400007640000000002711313235733011321 00000000000000timestamp for config.h pnm2ppa-1.13/test.ps0000644000076400007640000005727007041463324011305 00000000000000%!PS-Adobe-2.0 %%Title: test.ps %%Creator: fig2dev Version 3.2 Patchlevel 1 %%CreationDate: Sun Nov 28 23:02:49 1999 %%For: klamer@thuiscomputer (Klamer Schutte) %%Orientation: Portrait %%BoundingBox: 149 175 446 666 %%Pages: 1 %%BeginSetup %%IncludeFeature: *PageSize A4 %%EndSetup %%Magnification: 1.0000 %%EndComments /$F2psDict 200 dict def $F2psDict begin $F2psDict /mtrx matrix put /col-1 {0 setgray} bind def /col0 {0.000 0.000 0.000 srgb} bind def /col1 {0.000 0.000 1.000 srgb} bind def /col2 {0.000 1.000 0.000 srgb} bind def /col3 {0.000 1.000 1.000 srgb} bind def /col4 {1.000 0.000 0.000 srgb} bind def /col5 {1.000 0.000 1.000 srgb} bind def /col6 {1.000 1.000 0.000 srgb} bind def /col7 {1.000 1.000 1.000 srgb} bind def /col8 {0.000 0.000 0.560 srgb} bind def /col9 {0.000 0.000 0.690 srgb} bind def /col10 {0.000 0.000 0.820 srgb} bind def /col11 {0.530 0.810 1.000 srgb} bind def /col12 {0.000 0.560 0.000 srgb} bind def /col13 {0.000 0.690 0.000 srgb} bind def /col14 {0.000 0.820 0.000 srgb} bind def /col15 {0.000 0.560 0.560 srgb} bind def /col16 {0.000 0.690 0.690 srgb} bind def /col17 {0.000 0.820 0.820 srgb} bind def /col18 {0.560 0.000 0.000 srgb} bind def /col19 {0.690 0.000 0.000 srgb} bind def /col20 {0.820 0.000 0.000 srgb} bind def /col21 {0.560 0.000 0.560 srgb} bind def /col22 {0.690 0.000 0.690 srgb} bind def /col23 {0.820 0.000 0.820 srgb} bind def /col24 {0.500 0.190 0.000 srgb} bind def /col25 {0.630 0.250 0.000 srgb} bind def /col26 {0.750 0.380 0.000 srgb} bind def /col27 {1.000 0.500 0.500 srgb} bind def /col28 {1.000 0.630 0.630 srgb} bind def /col29 {1.000 0.750 0.750 srgb} bind def /col30 {1.000 0.880 0.880 srgb} bind def /col31 {1.000 0.840 0.000 srgb} bind def end save 86.0 734.5 translate 1 -1 scale /cp {closepath} bind def /ef {eofill} bind def /gr {grestore} bind def /gs {gsave} bind def /sa {save} bind def /rs {restore} bind def /l {lineto} bind def /m {moveto} bind def /rm {rmoveto} bind def /n {newpath} bind def /s {stroke} bind def /sh {show} bind def /slc {setlinecap} bind def /slj {setlinejoin} bind def /slw {setlinewidth} bind def /srgb {setrgbcolor} bind def /rot {rotate} bind def /sc {scale} bind def /sd {setdash} bind def /ff {findfont} bind def /sf {setfont} bind def /scf {scalefont} bind def /sw {stringwidth} bind def /tr {translate} bind def /tnt {dup dup currentrgbcolor 4 -2 roll dup 1 exch sub 3 -1 roll mul add 4 -2 roll dup 1 exch sub 3 -1 roll mul add 4 -2 roll dup 1 exch sub 3 -1 roll mul add srgb} bind def /shd {dup dup currentrgbcolor 4 -2 roll mul 4 -2 roll mul 4 -2 roll mul srgb} bind def /reencdict 12 dict def /ReEncode { reencdict begin /newcodesandnames exch def /newfontname exch def /basefontname exch def /basefontdict basefontname findfont def /newfont basefontdict maxlength dict def basefontdict { exch dup /FID ne { dup /Encoding eq { exch dup length array copy newfont 3 1 roll put } { exch newfont 3 1 roll put } ifelse } { pop pop } ifelse } forall newfont /FontName newfontname put newcodesandnames aload pop 128 1 255 { newfont /Encoding get exch /.notdef put } for newcodesandnames length 2 idiv { newfont /Encoding get 3 1 roll put } repeat newfontname newfont definefont pop end } def /isovec [ 8#200 /grave 8#201 /acute 8#202 /circumflex 8#203 /tilde 8#204 /macron 8#205 /breve 8#206 /dotaccent 8#207 /dieresis 8#210 /ring 8#211 /cedilla 8#212 /hungarumlaut 8#213 /ogonek 8#214 /caron 8#220 /dotlessi 8#230 /oe 8#231 /OE 8#240 /space 8#241 /exclamdown 8#242 /cent 8#243 /sterling 8#244 /currency 8#245 /yen 8#246 /brokenbar 8#247 /section 8#250 /dieresis 8#251 /copyright 8#252 /ordfeminine 8#253 /guillemotleft 8#254 /logicalnot 8#255 /endash 8#256 /registered 8#257 /macron 8#260 /degree 8#261 /plusminus 8#262 /twosuperior 8#263 /threesuperior 8#264 /acute 8#265 /mu 8#266 /paragraph 8#267 /periodcentered 8#270 /cedilla 8#271 /onesuperior 8#272 /ordmasculine 8#273 /guillemotright 8#274 /onequarter 8#275 /onehalf 8#276 /threequarters 8#277 /questiondown 8#300 /Agrave 8#301 /Aacute 8#302 /Acircumflex 8#303 /Atilde 8#304 /Adieresis 8#305 /Aring 8#306 /AE 8#307 /Ccedilla 8#310 /Egrave 8#311 /Eacute 8#312 /Ecircumflex 8#313 /Edieresis 8#314 /Igrave 8#315 /Iacute 8#316 /Icircumflex 8#317 /Idieresis 8#320 /Eth 8#321 /Ntilde 8#322 /Ograve 8#323 /Oacute 8#324 /Ocircumflex 8#325 /Otilde 8#326 /Odieresis 8#327 /multiply 8#330 /Oslash 8#331 /Ugrave 8#332 /Uacute 8#333 /Ucircumflex 8#334 /Udieresis 8#335 /Yacute 8#336 /Thorn 8#337 /germandbls 8#340 /agrave 8#341 /aacute 8#342 /acircumflex 8#343 /atilde 8#344 /adieresis 8#345 /aring 8#346 /ae 8#347 /ccedilla 8#350 /egrave 8#351 /eacute 8#352 /ecircumflex 8#353 /edieresis 8#354 /igrave 8#355 /iacute 8#356 /icircumflex 8#357 /idieresis 8#360 /eth 8#361 /ntilde 8#362 /ograve 8#363 /oacute 8#364 /ocircumflex 8#365 /otilde 8#366 /odieresis 8#367 /divide 8#370 /oslash 8#371 /ugrave 8#372 /uacute 8#373 /ucircumflex 8#374 /udieresis 8#375 /yacute 8#376 /thorn 8#377 /ydieresis] def /Times-Roman /Times-Roman-iso isovec ReEncode /$F2psBegin {$F2psDict begin /$F2psEnteredState save def} def /$F2psEnd {$F2psEnteredState restore end} def %%EndProlog $F2psBegin 10 setmiterlimit n -1000 10312 m -1000 -1000 l 7000 -1000 l 7000 10312 l cp clip 0.06000 0.06000 sc %%Page: 1 1 % Polyline 7.500 slw n 3100 1250 m 3200 1250 l gs col0 s gr % Polyline n 3100 1300 m 3200 1300 l gs col0 s gr % Polyline n 3100 1350 m 3200 1350 l gs col0 s gr % Polyline n 3100 1450 m 3200 1450 l gs col0 s gr % Polyline n 3100 1500 m 3200 1500 l gs col0 s gr % Polyline n 3100 1550 m 3200 1550 l gs col0 s gr % Polyline n 3100 1650 m 3200 1650 l gs col0 s gr % Polyline n 3100 1700 m 3200 1700 l gs col0 s gr % Polyline n 3100 1750 m 3200 1750 l gs col0 s gr % Polyline n 3100 1850 m 3200 1850 l gs col0 s gr % Polyline n 3100 1900 m 3200 1900 l gs col0 s gr % Polyline n 3100 1950 m 3200 1950 l gs col0 s gr % Polyline n 3000 1200 m 3200 1200 l gs col0 s gr % Polyline n 3000 2000 m 3200 2000 l gs col0 s gr % Polyline n 3050 1400 m 3200 1400 l gs col0 s gr % Polyline n 3050 1600 m 3200 1600 l gs col0 s gr % Polyline n 3050 1800 m 3200 1800 l gs col0 s gr % Polyline n 3100 2050 m 3200 2050 l gs col0 s gr % Polyline n 3100 2100 m 3200 2100 l gs col0 s gr % Polyline n 3100 2150 m 3200 2150 l gs col0 s gr % Polyline n 3100 2250 m 3200 2250 l gs col0 s gr % Polyline n 3100 2300 m 3200 2300 l gs col0 s gr % Polyline n 3100 2350 m 3200 2350 l gs col0 s gr % Polyline n 3100 2450 m 3200 2450 l gs col0 s gr % Polyline n 3100 2500 m 3200 2500 l gs col0 s gr % Polyline n 3100 2550 m 3200 2550 l gs col0 s gr % Polyline n 3100 2650 m 3200 2650 l gs col0 s gr % Polyline n 3100 2700 m 3200 2700 l gs col0 s gr % Polyline n 3100 2750 m 3200 2750 l gs col0 s gr % Polyline n 3000 2000 m 3200 2000 l gs col0 s gr % Polyline n 3000 2800 m 3200 2800 l gs col0 s gr % Polyline n 3050 2200 m 3200 2200 l gs col0 s gr % Polyline n 3050 2400 m 3200 2400 l gs col0 s gr % Polyline n 3050 2600 m 3200 2600 l gs col0 s gr % Polyline n 3100 2850 m 3200 2850 l gs col0 s gr % Polyline n 3100 2900 m 3200 2900 l gs col0 s gr % Polyline n 3100 2950 m 3200 2950 l gs col0 s gr % Polyline n 3100 3050 m 3200 3050 l gs col0 s gr % Polyline n 3100 3100 m 3200 3100 l gs col0 s gr % Polyline n 3100 3150 m 3200 3150 l gs col0 s gr % Polyline n 3100 3250 m 3200 3250 l gs col0 s gr % Polyline n 3100 3300 m 3200 3300 l gs col0 s gr % Polyline n 3100 3350 m 3200 3350 l gs col0 s gr % Polyline n 3100 3450 m 3200 3450 l gs col0 s gr % Polyline n 3100 3500 m 3200 3500 l gs col0 s gr % Polyline n 3100 3550 m 3200 3550 l gs col0 s gr % Polyline n 3000 2800 m 3200 2800 l gs col0 s gr % Polyline n 3000 3600 m 3200 3600 l gs col0 s gr % Polyline n 3050 3000 m 3200 3000 l gs col0 s gr % Polyline n 3050 3200 m 3200 3200 l gs col0 s gr % Polyline n 3050 3400 m 3200 3400 l gs col0 s gr % Polyline n 3100 3650 m 3200 3650 l gs col0 s gr % Polyline n 3100 3700 m 3200 3700 l gs col0 s gr % Polyline n 3100 3750 m 3200 3750 l gs col0 s gr % Polyline n 3100 3850 m 3200 3850 l gs col0 s gr % Polyline n 3100 3900 m 3200 3900 l gs col0 s gr % Polyline n 3100 3950 m 3200 3950 l gs col0 s gr % Polyline n 3100 4050 m 3200 4050 l gs col0 s gr % Polyline n 3100 4100 m 3200 4100 l gs col0 s gr % Polyline n 3100 4150 m 3200 4150 l gs col0 s gr % Polyline n 3100 4250 m 3200 4250 l gs col0 s gr % Polyline n 3100 4300 m 3200 4300 l gs col0 s gr % Polyline n 3100 4350 m 3200 4350 l gs col0 s gr % Polyline n 3000 3600 m 3200 3600 l gs col0 s gr % Polyline n 3000 4400 m 3200 4400 l gs col0 s gr % Polyline n 3050 3800 m 3200 3800 l gs col0 s gr % Polyline n 3050 4000 m 3200 4000 l gs col0 s gr % Polyline n 3050 4200 m 3200 4200 l gs col0 s gr % Polyline n 3100 4450 m 3200 4450 l gs col0 s gr % Polyline n 3100 4500 m 3200 4500 l gs col0 s gr % Polyline n 3100 4550 m 3200 4550 l gs col0 s gr % Polyline n 3100 4650 m 3200 4650 l gs col0 s gr % Polyline n 3100 4700 m 3200 4700 l gs col0 s gr % Polyline n 3100 4750 m 3200 4750 l gs col0 s gr % Polyline n 3100 4850 m 3200 4850 l gs col0 s gr % Polyline n 3100 4900 m 3200 4900 l gs col0 s gr % Polyline n 3100 4950 m 3200 4950 l gs col0 s gr % Polyline n 3100 5050 m 3200 5050 l gs col0 s gr % Polyline n 3100 5100 m 3200 5100 l gs col0 s gr % Polyline n 3100 5150 m 3200 5150 l gs col0 s gr % Polyline n 3000 4400 m 3200 4400 l gs col0 s gr % Polyline n 3000 5200 m 3200 5200 l gs col0 s gr % Polyline n 3050 4600 m 3200 4600 l gs col0 s gr % Polyline n 3050 4800 m 3200 4800 l gs col0 s gr % Polyline n 3050 5000 m 3200 5000 l gs col0 s gr % Polyline n 3100 5250 m 3200 5250 l gs col0 s gr % Polyline n 3100 5300 m 3200 5300 l gs col0 s gr % Polyline n 3100 5350 m 3200 5350 l gs col0 s gr % Polyline n 3100 5450 m 3200 5450 l gs col0 s gr % Polyline n 3100 5500 m 3200 5500 l gs col0 s gr % Polyline n 3100 5550 m 3200 5550 l gs col0 s gr % Polyline n 3100 5650 m 3200 5650 l gs col0 s gr % Polyline n 3100 5700 m 3200 5700 l gs col0 s gr % Polyline n 3100 5750 m 3200 5750 l gs col0 s gr % Polyline n 3100 5850 m 3200 5850 l gs col0 s gr % Polyline n 3100 5900 m 3200 5900 l gs col0 s gr % Polyline n 3100 5950 m 3200 5950 l gs col0 s gr % Polyline n 3000 5200 m 3200 5200 l gs col0 s gr % Polyline n 3000 6000 m 3200 6000 l gs col0 s gr % Polyline n 3050 5400 m 3200 5400 l gs col0 s gr % Polyline n 3050 5600 m 3200 5600 l gs col0 s gr % Polyline n 3050 5800 m 3200 5800 l gs col0 s gr % Polyline n 3111 1200 m 3200 1200 l 3200 6000 l 3111 6000 l gs col0 s gr % Polyline n 5021 3651 m 4948 3651 l gs col4 s gr % Polyline n 5021 3602 m 4948 3602 l gs col4 s gr % Polyline n 5021 3553 m 4948 3553 l gs col4 s gr % Polyline n 5021 3502 m 4948 3502 l gs col4 s gr % Polyline n 5021 3402 m 4948 3402 l gs col4 s gr % Polyline n 5021 3353 m 4948 3353 l gs col4 s gr % Polyline n 5021 3304 m 4948 3304 l gs col4 s gr % Polyline n 5021 3252 m 4948 3252 l gs col4 s gr % Polyline n 5021 3153 m 4948 3153 l gs col4 s gr % Polyline n 5021 3105 m 4948 3105 l gs col4 s gr % Polyline n 5021 3055 m 4948 3055 l gs col4 s gr % Polyline n 5021 3002 m 4948 3002 l gs col4 s gr % Polyline n 5021 3902 m 4948 3902 l gs col4 s gr % Polyline n 5021 3849 m 4948 3849 l gs col4 s gr % Polyline n 5021 3798 m 4948 3798 l gs col4 s gr % Polyline n 5021 3749 m 4948 3749 l gs col4 s gr % Polyline n 5021 4152 m 4948 4152 l gs col4 s gr % Polyline n 5021 4102 m 4948 4102 l gs col4 s gr % Polyline n 5021 4049 m 4948 4049 l gs col4 s gr % Polyline n 5021 4000 m 4948 4000 l gs col4 s gr % Polyline n 5045 3951 m 4948 3951 l gs col4 s gr % Polyline n 5045 3702 m 4948 3702 l gs col4 s gr % Polyline n 5045 3453 m 4948 3453 l gs col4 s gr % Polyline n 5045 3202 m 4948 3202 l gs col4 s gr % Polyline n 5045 2950 m 4948 2950 l 4948 4200 l 5045 4200 l gs col4 s gr % Polyline n 4824 3674 m 4894 3674 l gs col0 s gr % Polyline n 4824 3624 m 4894 3624 l gs col0 s gr % Polyline n 4824 3577 m 4894 3577 l gs col0 s gr % Polyline n 4824 3529 m 4894 3529 l gs col0 s gr % Polyline n 4824 3432 m 4894 3432 l gs col0 s gr % Polyline n 4824 3385 m 4894 3385 l gs col0 s gr % Polyline n 4824 3338 m 4894 3338 l gs col0 s gr % Polyline n 4824 3288 m 4894 3288 l gs col0 s gr % Polyline n 4824 3193 m 4894 3193 l gs col0 s gr % Polyline n 4824 3147 m 4894 3147 l gs col0 s gr % Polyline n 4824 3098 m 4894 3098 l gs col0 s gr % Polyline n 4824 3051 m 4894 3051 l gs col0 s gr % Polyline n 4824 3913 m 4894 3913 l gs col0 s gr % Polyline n 4824 3863 m 4894 3863 l gs col0 s gr % Polyline n 4824 3815 m 4894 3815 l gs col0 s gr % Polyline n 4824 3766 m 4894 3766 l gs col0 s gr % Polyline n 4824 4154 m 4894 4154 l gs col0 s gr % Polyline n 4824 4106 m 4894 4106 l gs col0 s gr % Polyline n 4824 4055 m 4894 4055 l gs col0 s gr % Polyline n 4824 4008 m 4894 4008 l gs col0 s gr % Polyline n 4801 3960 m 4894 3960 l gs col0 s gr % Polyline n 4801 3721 m 4894 3721 l gs col0 s gr % Polyline n 4801 3482 m 4894 3482 l gs col0 s gr % Polyline n 4801 3242 m 4894 3242 l gs col0 s gr % Polyline n 4801 2998 m 4894 2998 l 4894 4200 l 4801 4200 l gs col0 s gr % Polyline n 2100 3600 m 2850 3600 l gs col1 s gr % Polyline n 3300 3600 m 4050 3600 l gs col14 s gr /Times-Roman-iso ff 180.00 scf sf 2925 3675 m gs 1 -1 sc (0) dup sw pop neg 0 rm col0 sh gr /Times-Roman-iso ff 180.00 scf sf 2925 2925 m gs 1 -1 sc (-400) dup sw pop neg 0 rm col0 sh gr /Times-Roman-iso ff 180.00 scf sf 2925 2100 m gs 1 -1 sc (-800) dup sw pop neg 0 rm col0 sh gr /Times-Roman-iso ff 180.00 scf sf 2925 1275 m gs 1 -1 sc (-1200) dup sw pop neg 0 rm col0 sh gr /Times-Roman-iso ff 180.00 scf sf 2925 4500 m gs 1 -1 sc (400) dup sw pop neg 0 rm col0 sh gr /Times-Roman-iso ff 180.00 scf sf 2925 5325 m gs 1 -1 sc (800) dup sw pop neg 0 rm col0 sh gr /Times-Roman-iso ff 180.00 scf sf 2925 6075 m gs 1 -1 sc (1200) dup sw pop neg 0 rm col0 sh gr /Times-Roman-iso ff 180.00 scf sf 4737 4286 m gs 1 -1 sc (0) dup sw pop neg 0 rm col0 sh gr /Times-Roman-iso ff 180.00 scf sf 4730 4039 m gs 1 -1 sc (5) dup sw pop neg 0 rm col0 sh gr /Times-Roman-iso ff 180.00 scf sf 4745 3836 m gs 1 -1 sc (10) dup sw pop neg 0 rm col0 sh gr /Times-Roman-iso ff 180.00 scf sf 4737 3574 m gs 1 -1 sc (15) dup sw pop neg 0 rm col0 sh gr /Times-Roman-iso ff 180.00 scf sf 4730 3334 m gs 1 -1 sc (20) dup sw pop neg 0 rm col0 sh gr /Times-Roman-iso ff 180.00 scf sf 4707 3094 m gs 1 -1 sc (25) dup sw pop neg 0 rm col0 sh gr % Polyline n 1175 8300 m 1175 8200 l gs col0 s gr % Polyline n 1225 8300 m 1225 8200 l gs col0 s gr % Polyline n 1275 8300 m 1275 8200 l gs col0 s gr % Polyline n 1375 8300 m 1375 8200 l gs col0 s gr % Polyline n 1425 8300 m 1425 8200 l gs col0 s gr % Polyline n 1475 8300 m 1475 8200 l gs col0 s gr % Polyline n 1575 8300 m 1575 8200 l gs col0 s gr % Polyline n 1625 8300 m 1625 8200 l gs col0 s gr % Polyline n 1675 8300 m 1675 8200 l gs col0 s gr % Polyline n 1775 8300 m 1775 8200 l gs col0 s gr % Polyline n 1825 8300 m 1825 8200 l gs col0 s gr % Polyline n 1875 8300 m 1875 8200 l gs col0 s gr % Polyline n 1125 8400 m 1125 8200 l gs col0 s gr % Polyline n 1925 8400 m 1925 8200 l gs col0 s gr % Polyline n 1325 8350 m 1325 8200 l gs col0 s gr % Polyline n 1525 8350 m 1525 8200 l gs col0 s gr % Polyline n 1725 8350 m 1725 8200 l gs col0 s gr % Polyline n 1975 8300 m 1975 8200 l gs col0 s gr % Polyline n 2025 8300 m 2025 8200 l gs col0 s gr % Polyline n 2075 8300 m 2075 8200 l gs col0 s gr % Polyline n 2175 8300 m 2175 8200 l gs col0 s gr % Polyline n 2225 8300 m 2225 8200 l gs col0 s gr % Polyline n 2275 8300 m 2275 8200 l gs col0 s gr % Polyline n 2375 8300 m 2375 8200 l gs col0 s gr % Polyline n 2425 8300 m 2425 8200 l gs col0 s gr % Polyline n 2475 8300 m 2475 8200 l gs col0 s gr % Polyline n 2575 8300 m 2575 8200 l gs col0 s gr % Polyline n 2625 8300 m 2625 8200 l gs col0 s gr % Polyline n 2675 8300 m 2675 8200 l gs col0 s gr % Polyline n 1925 8400 m 1925 8200 l gs col0 s gr % Polyline n 2725 8400 m 2725 8200 l gs col0 s gr % Polyline n 2125 8350 m 2125 8200 l gs col0 s gr % Polyline n 2325 8350 m 2325 8200 l gs col0 s gr % Polyline n 2525 8350 m 2525 8200 l gs col0 s gr % Polyline n 2775 8300 m 2775 8200 l gs col0 s gr % Polyline n 2825 8300 m 2825 8200 l gs col0 s gr % Polyline n 2875 8300 m 2875 8200 l gs col0 s gr % Polyline n 2975 8300 m 2975 8200 l gs col0 s gr % Polyline n 3025 8300 m 3025 8200 l gs col0 s gr % Polyline n 3075 8300 m 3075 8200 l gs col0 s gr % Polyline n 3175 8300 m 3175 8200 l gs col0 s gr % Polyline n 3225 8300 m 3225 8200 l gs col0 s gr % Polyline n 3275 8300 m 3275 8200 l gs col0 s gr % Polyline n 3375 8300 m 3375 8200 l gs col0 s gr % Polyline n 3425 8300 m 3425 8200 l gs col0 s gr % Polyline n 3475 8300 m 3475 8200 l gs col0 s gr % Polyline n 2725 8400 m 2725 8200 l gs col0 s gr % Polyline n 3525 8400 m 3525 8200 l gs col0 s gr % Polyline n 2925 8350 m 2925 8200 l gs col0 s gr % Polyline n 3125 8350 m 3125 8200 l gs col0 s gr % Polyline n 3325 8350 m 3325 8200 l gs col0 s gr % Polyline n 3575 8300 m 3575 8200 l gs col0 s gr % Polyline n 3625 8300 m 3625 8200 l gs col0 s gr % Polyline n 3675 8300 m 3675 8200 l gs col0 s gr % Polyline n 3775 8300 m 3775 8200 l gs col0 s gr % Polyline n 3825 8300 m 3825 8200 l gs col0 s gr % Polyline n 3875 8300 m 3875 8200 l gs col0 s gr % Polyline n 3975 8300 m 3975 8200 l gs col0 s gr % Polyline n 4025 8300 m 4025 8200 l gs col0 s gr % Polyline n 4075 8300 m 4075 8200 l gs col0 s gr % Polyline n 4175 8300 m 4175 8200 l gs col0 s gr % Polyline n 4225 8300 m 4225 8200 l gs col0 s gr % Polyline n 4275 8300 m 4275 8200 l gs col0 s gr % Polyline n 3525 8400 m 3525 8200 l gs col0 s gr % Polyline n 4325 8400 m 4325 8200 l gs col0 s gr % Polyline n 3725 8350 m 3725 8200 l gs col0 s gr % Polyline n 3925 8350 m 3925 8200 l gs col0 s gr % Polyline n 4125 8350 m 4125 8200 l gs col0 s gr % Polyline n 4375 8300 m 4375 8200 l gs col0 s gr % Polyline n 4425 8300 m 4425 8200 l gs col0 s gr % Polyline n 4475 8300 m 4475 8200 l gs col0 s gr % Polyline n 4575 8300 m 4575 8200 l gs col0 s gr % Polyline n 4625 8300 m 4625 8200 l gs col0 s gr % Polyline n 4675 8300 m 4675 8200 l gs col0 s gr % Polyline n 4775 8300 m 4775 8200 l gs col0 s gr % Polyline n 4825 8300 m 4825 8200 l gs col0 s gr % Polyline n 4875 8300 m 4875 8200 l gs col0 s gr % Polyline n 4975 8300 m 4975 8200 l gs col0 s gr % Polyline n 5025 8300 m 5025 8200 l gs col0 s gr % Polyline n 5075 8300 m 5075 8200 l gs col0 s gr % Polyline n 4325 8400 m 4325 8200 l gs col0 s gr % Polyline n 5125 8400 m 5125 8200 l gs col0 s gr % Polyline n 4525 8350 m 4525 8200 l gs col0 s gr % Polyline n 4725 8350 m 4725 8200 l gs col0 s gr % Polyline n 4925 8350 m 4925 8200 l gs col0 s gr % Polyline n 5175 8300 m 5175 8200 l gs col0 s gr % Polyline n 5225 8300 m 5225 8200 l gs col0 s gr % Polyline n 5275 8300 m 5275 8200 l gs col0 s gr % Polyline n 5375 8300 m 5375 8200 l gs col0 s gr % Polyline n 5425 8300 m 5425 8200 l gs col0 s gr % Polyline n 5475 8300 m 5475 8200 l gs col0 s gr % Polyline n 5575 8300 m 5575 8200 l gs col0 s gr % Polyline n 5625 8300 m 5625 8200 l gs col0 s gr % Polyline n 5675 8300 m 5675 8200 l gs col0 s gr % Polyline n 5775 8300 m 5775 8200 l gs col0 s gr % Polyline n 5825 8300 m 5825 8200 l gs col0 s gr % Polyline n 5875 8300 m 5875 8200 l gs col0 s gr % Polyline n 5125 8400 m 5125 8200 l gs col0 s gr % Polyline n 5925 8400 m 5925 8200 l gs col0 s gr % Polyline n 5325 8350 m 5325 8200 l gs col0 s gr % Polyline n 5525 8350 m 5525 8200 l gs col0 s gr % Polyline n 5725 8350 m 5725 8200 l gs col0 s gr % Polyline n 1125 8289 m 1125 8200 l 5925 8200 l 5925 8289 l gs col0 s gr % Polyline n 3576 6379 m 3576 6452 l gs col4 s gr % Polyline n 3527 6379 m 3527 6452 l gs col4 s gr % Polyline n 3478 6379 m 3478 6452 l gs col4 s gr % Polyline n 3427 6379 m 3427 6452 l gs col4 s gr % Polyline n 3327 6379 m 3327 6452 l gs col4 s gr % Polyline n 3278 6379 m 3278 6452 l gs col4 s gr % Polyline n 3229 6379 m 3229 6452 l gs col4 s gr % Polyline n 3177 6379 m 3177 6452 l gs col4 s gr % Polyline n 3078 6379 m 3078 6452 l gs col4 s gr % Polyline n 3030 6379 m 3030 6452 l gs col4 s gr % Polyline n 2980 6379 m 2980 6452 l gs col4 s gr % Polyline n 2927 6379 m 2927 6452 l gs col4 s gr % Polyline n 3827 6379 m 3827 6452 l gs col4 s gr % Polyline n 3774 6379 m 3774 6452 l gs col4 s gr % Polyline n 3723 6379 m 3723 6452 l gs col4 s gr % Polyline n 3674 6379 m 3674 6452 l gs col4 s gr % Polyline n 4077 6379 m 4077 6452 l gs col4 s gr % Polyline n 4027 6379 m 4027 6452 l gs col4 s gr % Polyline n 3974 6379 m 3974 6452 l gs col4 s gr % Polyline n 3925 6379 m 3925 6452 l gs col4 s gr % Polyline n 3876 6355 m 3876 6452 l gs col4 s gr % Polyline n 3627 6355 m 3627 6452 l gs col4 s gr % Polyline n 3378 6355 m 3378 6452 l gs col4 s gr % Polyline n 3127 6355 m 3127 6452 l gs col4 s gr % Polyline n 2875 6355 m 2875 6452 l 4125 6452 l 4125 6355 l gs col4 s gr % Polyline n 3599 6576 m 3599 6506 l gs col0 s gr % Polyline n 3549 6576 m 3549 6506 l gs col0 s gr % Polyline n 3502 6576 m 3502 6506 l gs col0 s gr % Polyline n 3454 6576 m 3454 6506 l gs col0 s gr % Polyline n 3357 6576 m 3357 6506 l gs col0 s gr % Polyline n 3310 6576 m 3310 6506 l gs col0 s gr % Polyline n 3263 6576 m 3263 6506 l gs col0 s gr % Polyline n 3213 6576 m 3213 6506 l gs col0 s gr % Polyline n 3118 6576 m 3118 6506 l gs col0 s gr % Polyline n 3072 6576 m 3072 6506 l gs col0 s gr % Polyline n 3023 6576 m 3023 6506 l gs col0 s gr % Polyline n 2976 6576 m 2976 6506 l gs col0 s gr % Polyline n 3838 6576 m 3838 6506 l gs col0 s gr % Polyline n 3788 6576 m 3788 6506 l gs col0 s gr % Polyline n 3740 6576 m 3740 6506 l gs col0 s gr % Polyline n 3691 6576 m 3691 6506 l gs col0 s gr % Polyline n 4079 6576 m 4079 6506 l gs col0 s gr % Polyline n 4031 6576 m 4031 6506 l gs col0 s gr % Polyline n 3980 6576 m 3980 6506 l gs col0 s gr % Polyline n 3933 6576 m 3933 6506 l gs col0 s gr % Polyline n 3885 6599 m 3885 6506 l gs col0 s gr % Polyline n 3646 6599 m 3646 6506 l gs col0 s gr % Polyline n 3407 6599 m 3407 6506 l gs col0 s gr % Polyline n 3167 6599 m 3167 6506 l gs col0 s gr % Polyline n 2923 6599 m 2923 6506 l 4125 6506 l 4125 6599 l gs col0 s gr % Polyline n 3525 9300 m 3525 8550 l gs col1 s gr % Polyline n 3525 8100 m 3525 7350 l gs col14 s gr /Times-Roman-iso ff 180.00 scf sf 3600 8475 m gs 1 -1 sc 90.0 rot (0) dup sw pop neg 0 rm col0 sh gr /Times-Roman-iso ff 180.00 scf sf 2850 8475 m gs 1 -1 sc 90.0 rot (-400) dup sw pop neg 0 rm col0 sh gr /Times-Roman-iso ff 180.00 scf sf 2025 8475 m gs 1 -1 sc 90.0 rot (-800) dup sw pop neg 0 rm col0 sh gr /Times-Roman-iso ff 180.00 scf sf 1200 8475 m gs 1 -1 sc 90.0 rot (-1200) dup sw pop neg 0 rm col0 sh gr /Times-Roman-iso ff 180.00 scf sf 4425 8475 m gs 1 -1 sc 90.0 rot (400) dup sw pop neg 0 rm col0 sh gr /Times-Roman-iso ff 180.00 scf sf 5250 8475 m gs 1 -1 sc 90.0 rot (800) dup sw pop neg 0 rm col0 sh gr /Times-Roman-iso ff 180.00 scf sf 6000 8475 m gs 1 -1 sc 90.0 rot (1200) dup sw pop neg 0 rm col0 sh gr /Times-Roman-iso ff 180.00 scf sf 4211 6663 m gs 1 -1 sc 90.0 rot (0) dup sw pop neg 0 rm col0 sh gr /Times-Roman-iso ff 180.00 scf sf 3964 6670 m gs 1 -1 sc 90.0 rot (5) dup sw pop neg 0 rm col0 sh gr /Times-Roman-iso ff 180.00 scf sf 3761 6655 m gs 1 -1 sc 90.0 rot (10) dup sw pop neg 0 rm col0 sh gr /Times-Roman-iso ff 180.00 scf sf 3499 6663 m gs 1 -1 sc 90.0 rot (15) dup sw pop neg 0 rm col0 sh gr /Times-Roman-iso ff 180.00 scf sf 3259 6670 m gs 1 -1 sc 90.0 rot (20) dup sw pop neg 0 rm col0 sh gr /Times-Roman-iso ff 180.00 scf sf 3019 6693 m gs 1 -1 sc 90.0 rot (25) dup sw pop neg 0 rm col0 sh gr % Polyline n 1200 1200 m 2400 1200 l 2400 2400 l 1200 2400 l cp gs col0 s gr % Polyline n 1350 1350 m 2250 1350 l 2250 2250 l 1350 2250 l cp gs col4 s gr % Polyline n 1500 1500 m 2100 1500 l 2100 2100 l 1500 2100 l cp gs col2 s gr % Polyline n 1650 1650 m 1950 1650 l 1950 1950 l 1650 1950 l cp gs col1 s gr % Polyline n 1200 1200 m 2400 2400 l gs col0 s gr % Polyline n 1200 2400 m 2400 1200 l gs col6 s gr $F2psEnd rs showpage pnm2ppa-1.13/testpage-a4.ps0000644000076400007640000001565607132534510012443 00000000000000%!PS-Adobe-2.0 %%Title: testpage-a4.fig %%Creator: fig2dev Version 3.2.3 Patchlevel %%CreationDate: Tue Jul 11 01:57:38 2000 %%For: root@desktop.localdomain (root) %%Orientation: Portrait %%Pages: 1 %%BoundingBox: 0 0 595 842 %%BeginSetup %%IncludeFeature: *PageSize A4 %%EndSetup %%Magnification: 1.0000 %%EndComments /$F2psDict 200 dict def $F2psDict begin $F2psDict /mtrx matrix put /col-1 {0 setgray} bind def /col0 {0.000 0.000 0.000 srgb} bind def /col1 {0.000 0.000 1.000 srgb} bind def /col2 {0.000 1.000 0.000 srgb} bind def /col3 {0.000 1.000 1.000 srgb} bind def /col4 {1.000 0.000 0.000 srgb} bind def /col5 {1.000 0.000 1.000 srgb} bind def /col6 {1.000 1.000 0.000 srgb} bind def /col7 {1.000 1.000 1.000 srgb} bind def /col8 {0.000 0.000 0.560 srgb} bind def /col9 {0.000 0.000 0.690 srgb} bind def /col10 {0.000 0.000 0.820 srgb} bind def /col11 {0.530 0.810 1.000 srgb} bind def /col12 {0.000 0.560 0.000 srgb} bind def /col13 {0.000 0.690 0.000 srgb} bind def /col14 {0.000 0.820 0.000 srgb} bind def /col15 {0.000 0.560 0.560 srgb} bind def /col16 {0.000 0.690 0.690 srgb} bind def /col17 {0.000 0.820 0.820 srgb} bind def /col18 {0.560 0.000 0.000 srgb} bind def /col19 {0.690 0.000 0.000 srgb} bind def /col20 {0.820 0.000 0.000 srgb} bind def /col21 {0.560 0.000 0.560 srgb} bind def /col22 {0.690 0.000 0.690 srgb} bind def /col23 {0.820 0.000 0.820 srgb} bind def /col24 {0.500 0.190 0.000 srgb} bind def /col25 {0.630 0.250 0.000 srgb} bind def /col26 {0.750 0.380 0.000 srgb} bind def /col27 {1.000 0.500 0.500 srgb} bind def /col28 {1.000 0.630 0.630 srgb} bind def /col29 {1.000 0.750 0.750 srgb} bind def /col30 {1.000 0.880 0.880 srgb} bind def /col31 {1.000 0.840 0.000 srgb} bind def end save newpath 0 842 moveto 0 0 lineto 595 0 lineto 595 842 lineto closepath clip newpath 0.0 841.5 translate 1 -1 scale /cp {closepath} bind def /ef {eofill} bind def /gr {grestore} bind def /gs {gsave} bind def /sa {save} bind def /rs {restore} bind def /l {lineto} bind def /m {moveto} bind def /rm {rmoveto} bind def /n {newpath} bind def /s {stroke} bind def /sh {show} bind def /slc {setlinecap} bind def /slj {setlinejoin} bind def /slw {setlinewidth} bind def /srgb {setrgbcolor} bind def /rot {rotate} bind def /sc {scale} bind def /sd {setdash} bind def /ff {findfont} bind def /sf {setfont} bind def /scf {scalefont} bind def /sw {stringwidth} bind def /tr {translate} bind def /tnt {dup dup currentrgbcolor 4 -2 roll dup 1 exch sub 3 -1 roll mul add 4 -2 roll dup 1 exch sub 3 -1 roll mul add 4 -2 roll dup 1 exch sub 3 -1 roll mul add srgb} bind def /shd {dup dup currentrgbcolor 4 -2 roll mul 4 -2 roll mul 4 -2 roll mul srgb} bind def /$F2psBegin {$F2psDict begin /$F2psEnteredState save def} def /$F2psEnd {$F2psEnteredState restore end} def $F2psBegin %%Page: 1 1 10 setmiterlimit 0.06299 0.06299 sc %%Page: 1 1 /Times-Bold ff 375.00 scf sf 2385 3285 m gs 1 -1 sc (To adjust the offsets in the) col0 sh gr /Times-Bold ff 375.00 scf sf 1800 4725 m gs 1 -1 sc (change xoff and yoff until this page is) col0 sh gr /Times-Bold ff 375.00 scf sf 1800 5400 m gs 1 -1 sc (printed correctly centered on the paper.) col0 sh gr /Times-Bold ff 375.00 scf sf 1800 4005 m gs 1 -1 sc (/etc/pnm2ppa.conf configuration file,) col0 sh gr % Polyline 7.500 slw n 2250 7200 m 2869 7200 l 2869 7500 l 2250 7500 l cp gs col10 1.00 shd ef gr gs col-1 s gr % Polyline n 3488 7200 m 4106 7200 l 4106 7500 l 3488 7500 l cp gs col6 1.00 shd ef gr gs col-1 s gr % Polyline n 4106 7200 m 4725 7200 l 4725 7500 l 4106 7500 l cp gs col5 1.00 shd ef gr gs col-1 s gr % Polyline n 4725 7200 m 5344 7200 l 5344 7500 l 4725 7500 l cp gs col26 1.00 shd ef gr gs col-1 s gr % Polyline n 5344 7200 m 5963 7200 l 5963 7500 l 5344 7500 l cp gs col31 1.00 shd ef gr gs col-1 s gr % Polyline n 5963 7200 m 6581 7200 l 6581 7500 l 5963 7500 l cp gs col3 1.00 shd ef gr gs col-1 s gr % Polyline n 2869 7200 m 3488 7200 l 3488 7500 l 2869 7500 l cp gs col20 1.00 shd ef gr gs col-1 s gr % Polyline n 6581 7200 m 7200 7200 l 7200 7500 l 6581 7500 l cp gs col2 1.00 shd ef gr gs col-1 s gr /Helvetica-Bold ff 150.00 scf sf 5034 7800 m gs 1 -1 sc (Brown) dup sw pop 2 div neg 0 rm col-1 sh gr /Helvetica-Bold ff 150.00 scf sf 5653 7800 m gs 1 -1 sc (Gold) dup sw pop 2 div neg 0 rm col-1 sh gr /Helvetica-Bold ff 150.00 scf sf 6891 7800 m gs 1 -1 sc (Green) dup sw pop 2 div neg 0 rm col-1 sh gr /Helvetica-Bold ff 150.00 scf sf 3797 7800 m gs 1 -1 sc (Yellow) dup sw pop 2 div neg 0 rm col-1 sh gr /Helvetica-Bold ff 150.00 scf sf 3178 7800 m gs 1 -1 sc (Red) dup sw pop 2 div neg 0 rm col-1 sh gr /Helvetica-Bold ff 150.00 scf sf 2559 7800 m gs 1 -1 sc (Blue) dup sw pop 2 div neg 0 rm col-1 sh gr /Helvetica-Bold ff 150.00 scf sf 4416 7800 m gs 1 -1 sc (Purple) dup sw pop 2 div neg 0 rm col-1 sh gr /Helvetica-Bold ff 150.00 scf sf 6272 7800 m gs 1 -1 sc (Cyan) dup sw pop 2 div neg 0 rm col-1 sh gr % Polyline 15.000 slw n 450 450 m 9000 450 l 9000 12915 l 450 12915 l cp gs col-1 s gr % Polyline n 900 900 m 8550 900 l 8550 12465 l 900 12465 l cp gs col-1 s gr /Times-Roman ff 180.00 scf sf 4725 1095 m gs 1 -1 sc (2cm) dup sw pop 2 div neg 0 rm col-1 sh gr /Times-Roman ff 180.00 scf sf 4725 12825 m gs 1 -1 sc (1cm) dup sw pop 2 div neg 0 rm col-1 sh gr /Times-Roman ff 180.00 scf sf 4725 12345 m gs 1 -1 sc (2cm) dup sw pop 2 div neg 0 rm col-1 sh gr /Times-Roman ff 180.00 scf sf 1110 7485 m gs 1 -1 sc (2cm) dup sw pop 2 div neg 0 rm col-1 sh gr /Times-Roman ff 180.00 scf sf 675 7485 m gs 1 -1 sc (1cm) dup sw pop 2 div neg 0 rm col-1 sh gr /Times-Roman ff 180.00 scf sf 8310 7485 m gs 1 -1 sc (2cm) dup sw pop 2 div neg 0 rm col-1 sh gr /Times-Roman ff 180.00 scf sf 8820 7485 m gs 1 -1 sc (1cm) dup sw pop 2 div neg 0 rm col-1 sh gr /Helvetica-Bold ff 270.00 scf sf 4725 6420 m gs 1 -1 sc (Here are some other colors; they) dup sw pop 2 div neg 0 rm col-1 sh gr /Helvetica-Bold ff 270.00 scf sf 4725 6765 m gs 1 -1 sc (will appear as greys on a B&W printer...) dup sw pop 2 div neg 0 rm col-1 sh gr /Helvetica-Bold ff 270.00 scf sf 4725 9225 m gs 1 -1 sc (are spaced at 1cm and 2cm) dup sw pop 2 div neg 0 rm col-1 sh gr /Helvetica-Bold ff 270.00 scf sf 4725 8880 m gs 1 -1 sc (The boxes bordering this page) dup sw pop 2 div neg 0 rm col-1 sh gr /Helvetica-Bold ff 270.00 scf sf 4725 9600 m gs 1 -1 sc (from the sides of the paper.) dup sw pop 2 div neg 0 rm col-1 sh gr /Helvetica-Bold ff 270.00 scf sf 4725 10500 m gs 1 -1 sc (It is not unusual for the 1cm bottom margin) dup sw pop 2 div neg 0 rm col-1 sh gr /Helvetica-Bold ff 270.00 scf sf 4725 10845 m gs 1 -1 sc (not to show. Many printers cannot) dup sw pop 2 div neg 0 rm col-1 sh gr /Helvetica-Bold ff 270.00 scf sf 4725 11190 m gs 1 -1 sc (print that close to the bottom of the page.) dup sw pop 2 div neg 0 rm col-1 sh gr /Helvetica-Bold ff 270.00 scf sf 4725 2445 m gs 1 -1 sc (PostScript Test Page \(A4\)) dup sw pop 2 div neg 0 rm col-1 sh gr /Times-Roman ff 180.00 scf sf 4725 630 m gs 1 -1 sc (1cm) dup sw pop 2 div neg 0 rm col-1 sh gr $F2psEnd rs showpage pnm2ppa-1.13/testpage.ps0000644000076400007640000001537007132534510012132 00000000000000%!PS-Adobe-2.0 %%Title: testpage.fig %%Creator: fig2dev Version 3.2.3 Patchlevel %%CreationDate: Tue Jul 11 01:57:38 2000 %%For: root@desktop.localdomain (root) %%Orientation: Portrait %%Pages: 1 %%BoundingBox: 0 0 612 792 %%BeginSetup %%IncludeFeature: *PageSize Letter %%EndSetup %%Magnification: 1.0000 %%EndComments /$F2psDict 200 dict def $F2psDict begin $F2psDict /mtrx matrix put /col-1 {0 setgray} bind def /col0 {0.000 0.000 0.000 srgb} bind def /col1 {0.000 0.000 1.000 srgb} bind def /col2 {0.000 1.000 0.000 srgb} bind def /col3 {0.000 1.000 1.000 srgb} bind def /col4 {1.000 0.000 0.000 srgb} bind def /col5 {1.000 0.000 1.000 srgb} bind def /col6 {1.000 1.000 0.000 srgb} bind def /col7 {1.000 1.000 1.000 srgb} bind def /col8 {0.000 0.000 0.560 srgb} bind def /col9 {0.000 0.000 0.690 srgb} bind def /col10 {0.000 0.000 0.820 srgb} bind def /col11 {0.530 0.810 1.000 srgb} bind def /col12 {0.000 0.560 0.000 srgb} bind def /col13 {0.000 0.690 0.000 srgb} bind def /col14 {0.000 0.820 0.000 srgb} bind def /col15 {0.000 0.560 0.560 srgb} bind def /col16 {0.000 0.690 0.690 srgb} bind def /col17 {0.000 0.820 0.820 srgb} bind def /col18 {0.560 0.000 0.000 srgb} bind def /col19 {0.690 0.000 0.000 srgb} bind def /col20 {0.820 0.000 0.000 srgb} bind def /col21 {0.560 0.000 0.560 srgb} bind def /col22 {0.690 0.000 0.690 srgb} bind def /col23 {0.820 0.000 0.820 srgb} bind def /col24 {0.500 0.190 0.000 srgb} bind def /col25 {0.630 0.250 0.000 srgb} bind def /col26 {0.750 0.380 0.000 srgb} bind def /col27 {1.000 0.500 0.500 srgb} bind def /col28 {1.000 0.630 0.630 srgb} bind def /col29 {1.000 0.750 0.750 srgb} bind def /col30 {1.000 0.880 0.880 srgb} bind def /col31 {1.000 0.840 0.000 srgb} bind def end save newpath 0 792 moveto 0 0 lineto 612 0 lineto 612 792 lineto closepath clip newpath 0.0 792.0 translate 1 -1 scale /cp {closepath} bind def /ef {eofill} bind def /gr {grestore} bind def /gs {gsave} bind def /sa {save} bind def /rs {restore} bind def /l {lineto} bind def /m {moveto} bind def /rm {rmoveto} bind def /n {newpath} bind def /s {stroke} bind def /sh {show} bind def /slc {setlinecap} bind def /slj {setlinejoin} bind def /slw {setlinewidth} bind def /srgb {setrgbcolor} bind def /rot {rotate} bind def /sc {scale} bind def /sd {setdash} bind def /ff {findfont} bind def /sf {setfont} bind def /scf {scalefont} bind def /sw {stringwidth} bind def /tr {translate} bind def /tnt {dup dup currentrgbcolor 4 -2 roll dup 1 exch sub 3 -1 roll mul add 4 -2 roll dup 1 exch sub 3 -1 roll mul add 4 -2 roll dup 1 exch sub 3 -1 roll mul add srgb} bind def /shd {dup dup currentrgbcolor 4 -2 roll mul 4 -2 roll mul 4 -2 roll mul srgb} bind def /$F2psBegin {$F2psDict begin /$F2psEnteredState save def} def /$F2psEnd {$F2psEnteredState restore end} def $F2psBegin %%Page: 1 1 10 setmiterlimit 0.06000 0.06000 sc %%Page: 1 1 /Times-Bold ff 300.00 scf sf 2175 3075 m gs 1 -1 sc (To adjust the offsets in the configuration file) col0 sh gr /Times-Bold ff 300.00 scf sf 2175 3390 m gs 1 -1 sc (/etc/pnm2ppa.conf, change the values of xoff) col0 sh gr /Times-Bold ff 300.00 scf sf 2175 3705 m gs 1 -1 sc (and yoff until this page is printed correctly ) col0 sh gr /Times-Bold ff 300.00 scf sf 2175 4020 m gs 1 -1 sc (centered on the paper.) col0 sh gr % Polyline 7.500 slw n 2400 7200 m 3000 7200 l 3000 7500 l 2400 7500 l cp gs col10 1.00 shd ef gr gs col-1 s gr % Polyline n 3600 7200 m 4200 7200 l 4200 7500 l 3600 7500 l cp gs col6 1.00 shd ef gr gs col-1 s gr % Polyline n 4200 7200 m 4800 7200 l 4800 7500 l 4200 7500 l cp gs col5 1.00 shd ef gr gs col-1 s gr % Polyline n 4800 7200 m 5400 7200 l 5400 7500 l 4800 7500 l cp gs col26 1.00 shd ef gr gs col-1 s gr % Polyline n 5400 7200 m 6000 7200 l 6000 7500 l 5400 7500 l cp gs col31 1.00 shd ef gr gs col-1 s gr % Polyline n 6000 7200 m 6600 7200 l 6600 7500 l 6000 7500 l cp gs col3 1.00 shd ef gr gs col-1 s gr % Polyline n 3000 7200 m 3600 7200 l 3600 7500 l 3000 7500 l cp gs col20 1.00 shd ef gr gs col-1 s gr % Polyline n 6600 7200 m 7200 7200 l 7200 7500 l 6600 7500 l cp gs col2 1.00 shd ef gr gs col-1 s gr /Helvetica-Bold ff 150.00 scf sf 5100 7800 m gs 1 -1 sc (Brown) dup sw pop 2 div neg 0 rm col-1 sh gr /Helvetica-Bold ff 150.00 scf sf 5700 7800 m gs 1 -1 sc (Gold) dup sw pop 2 div neg 0 rm col-1 sh gr /Helvetica-Bold ff 150.00 scf sf 6900 7800 m gs 1 -1 sc (Green) dup sw pop 2 div neg 0 rm col-1 sh gr /Helvetica-Bold ff 150.00 scf sf 3900 7800 m gs 1 -1 sc (Yellow) dup sw pop 2 div neg 0 rm col-1 sh gr /Helvetica-Bold ff 150.00 scf sf 3300 7800 m gs 1 -1 sc (Red) dup sw pop 2 div neg 0 rm col-1 sh gr /Helvetica-Bold ff 150.00 scf sf 2700 7800 m gs 1 -1 sc (Blue) dup sw pop 2 div neg 0 rm col-1 sh gr /Helvetica-Bold ff 150.00 scf sf 4500 7800 m gs 1 -1 sc (Purple) dup sw pop 2 div neg 0 rm col-1 sh gr /Helvetica-Bold ff 150.00 scf sf 6300 7800 m gs 1 -1 sc (Cyan) dup sw pop 2 div neg 0 rm col-1 sh gr /Helvetica-Bold ff 270.00 scf sf 4800 2100 m gs 1 -1 sc (Postscript Test Page \(US Letter paper\)) dup sw pop 2 div neg 0 rm col-1 sh gr % Polyline 15.000 slw n 600 600 m 9600 600 l 9600 12600 l 600 12600 l cp gs col-1 s gr % Polyline n 1200 1200 m 9000 1200 l 9000 12000 l 1200 12000 l cp gs col-1 s gr /Times-Roman ff 180.00 scf sf 4800 12375 m gs 1 -1 sc (0.5") col-1 sh gr /Times-Roman ff 180.00 scf sf 4725 900 m gs 1 -1 sc (0.5") col-1 sh gr /Times-Roman ff 180.00 scf sf 4800 11850 m gs 1 -1 sc (1") col-1 sh gr /Times-Roman ff 180.00 scf sf 4800 1500 m gs 1 -1 sc (1") col-1 sh gr /Times-Roman ff 180.00 scf sf 750 7500 m gs 1 -1 sc (0.5") col-1 sh gr /Times-Roman ff 180.00 scf sf 1350 7500 m gs 1 -1 sc (1") col-1 sh gr /Times-Roman ff 180.00 scf sf 8700 7500 m gs 1 -1 sc (1") col-1 sh gr /Times-Roman ff 180.00 scf sf 9225 7500 m gs 1 -1 sc (0.5") col-1 sh gr /Helvetica-Bold ff 270.00 scf sf 4800 6420 m gs 1 -1 sc (Here are some other colors; they) dup sw pop 2 div neg 0 rm col-1 sh gr /Helvetica-Bold ff 270.00 scf sf 4800 6765 m gs 1 -1 sc (will appear as greys on a B&W printer...) dup sw pop 2 div neg 0 rm col-1 sh gr /Helvetica-Bold ff 270.00 scf sf 4800 9225 m gs 1 -1 sc (are spaced at 0.5" and 1") dup sw pop 2 div neg 0 rm col-1 sh gr /Helvetica-Bold ff 270.00 scf sf 4800 8880 m gs 1 -1 sc (The boxes bordering this page) dup sw pop 2 div neg 0 rm col-1 sh gr /Helvetica-Bold ff 270.00 scf sf 4800 9600 m gs 1 -1 sc (from the sides of the paper.) dup sw pop 2 div neg 0 rm col-1 sh gr /Helvetica-Bold ff 270.00 scf sf 4800 10500 m gs 1 -1 sc (It is not unusual for the 0.5" bottom margin) dup sw pop 2 div neg 0 rm col-1 sh gr /Helvetica-Bold ff 270.00 scf sf 4800 10845 m gs 1 -1 sc (not to show. Many printers cannot) dup sw pop 2 div neg 0 rm col-1 sh gr /Helvetica-Bold ff 270.00 scf sf 4800 11190 m gs 1 -1 sc (print that close to the bottom of the page.) dup sw pop 2 div neg 0 rm col-1 sh gr $F2psEnd rs showpage pnm2ppa-1.13/testpages/0000777000076400007640000000000011313235643012030 500000000000000pnm2ppa-1.13/testpages/test.fig0000644000076400007640000005553107132536571013433 00000000000000#FIG 3.2 Portrait Center Inches A4 100.00 Single -2 1200 2 6 2100 1125 5100 6075 6 3000 1200 3200 6000 6 3000 1200 3200 2000 6 3100 1250 3200 1350 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3100 1250 3200 1250 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3100 1300 3200 1300 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3100 1350 3200 1350 -6 6 3100 1450 3200 1550 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3100 1450 3200 1450 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3100 1500 3200 1500 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3100 1550 3200 1550 -6 6 3100 1650 3200 1750 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3100 1650 3200 1650 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3100 1700 3200 1700 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3100 1750 3200 1750 -6 6 3100 1850 3200 1950 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3100 1850 3200 1850 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3100 1900 3200 1900 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3100 1950 3200 1950 -6 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3000 1200 3200 1200 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3000 2000 3200 2000 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3050 1400 3200 1400 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3050 1600 3200 1600 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3050 1800 3200 1800 -6 6 3000 2000 3200 2800 6 3100 2050 3200 2150 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3100 2050 3200 2050 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3100 2100 3200 2100 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3100 2150 3200 2150 -6 6 3100 2250 3200 2350 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3100 2250 3200 2250 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3100 2300 3200 2300 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3100 2350 3200 2350 -6 6 3100 2450 3200 2550 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3100 2450 3200 2450 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3100 2500 3200 2500 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3100 2550 3200 2550 -6 6 3100 2650 3200 2750 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3100 2650 3200 2650 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3100 2700 3200 2700 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3100 2750 3200 2750 -6 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3000 2000 3200 2000 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3000 2800 3200 2800 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3050 2200 3200 2200 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3050 2400 3200 2400 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3050 2600 3200 2600 -6 6 3000 2800 3200 3600 6 3100 2850 3200 2950 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3100 2850 3200 2850 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3100 2900 3200 2900 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3100 2950 3200 2950 -6 6 3100 3050 3200 3150 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3100 3050 3200 3050 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3100 3100 3200 3100 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3100 3150 3200 3150 -6 6 3100 3250 3200 3350 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3100 3250 3200 3250 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3100 3300 3200 3300 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3100 3350 3200 3350 -6 6 3100 3450 3200 3550 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3100 3450 3200 3450 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3100 3500 3200 3500 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3100 3550 3200 3550 -6 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3000 2800 3200 2800 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3000 3600 3200 3600 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3050 3000 3200 3000 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3050 3200 3200 3200 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3050 3400 3200 3400 -6 6 3000 3600 3200 4400 6 3100 3650 3200 3750 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3100 3650 3200 3650 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3100 3700 3200 3700 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3100 3750 3200 3750 -6 6 3100 3850 3200 3950 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3100 3850 3200 3850 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3100 3900 3200 3900 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3100 3950 3200 3950 -6 6 3100 4050 3200 4150 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3100 4050 3200 4050 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3100 4100 3200 4100 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3100 4150 3200 4150 -6 6 3100 4250 3200 4350 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3100 4250 3200 4250 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3100 4300 3200 4300 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3100 4350 3200 4350 -6 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3000 3600 3200 3600 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3000 4400 3200 4400 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3050 3800 3200 3800 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3050 4000 3200 4000 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3050 4200 3200 4200 -6 6 3000 4400 3200 5200 6 3100 4450 3200 4550 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3100 4450 3200 4450 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3100 4500 3200 4500 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3100 4550 3200 4550 -6 6 3100 4650 3200 4750 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3100 4650 3200 4650 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3100 4700 3200 4700 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3100 4750 3200 4750 -6 6 3100 4850 3200 4950 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3100 4850 3200 4850 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3100 4900 3200 4900 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3100 4950 3200 4950 -6 6 3100 5050 3200 5150 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3100 5050 3200 5050 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3100 5100 3200 5100 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3100 5150 3200 5150 -6 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3000 4400 3200 4400 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3000 5200 3200 5200 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3050 4600 3200 4600 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3050 4800 3200 4800 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3050 5000 3200 5000 -6 6 3000 5200 3200 6000 6 3100 5250 3200 5350 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3100 5250 3200 5250 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3100 5300 3200 5300 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3100 5350 3200 5350 -6 6 3100 5450 3200 5550 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3100 5450 3200 5450 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3100 5500 3200 5500 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3100 5550 3200 5550 -6 6 3100 5650 3200 5750 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3100 5650 3200 5650 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3100 5700 3200 5700 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3100 5750 3200 5750 -6 6 3100 5850 3200 5950 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3100 5850 3200 5850 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3100 5900 3200 5900 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3100 5950 3200 5950 -6 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3000 5200 3200 5200 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3000 6000 3200 6000 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3050 5400 3200 5400 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3050 5600 3200 5600 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3050 5800 3200 5800 -6 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 4 3111 1200 3200 1200 3200 6000 3111 6000 -6 6 4800 2904 5046 4200 6 4948 2904 5046 4200 6 4948 3502 5021 3651 2 1 0 1 4 7 100 0 -1 0.000 0 0 7 0 0 2 5021 3651 4948 3651 2 1 0 1 4 7 100 0 -1 0.000 0 0 7 0 0 2 5021 3602 4948 3602 2 1 0 1 4 7 100 0 -1 0.000 0 0 7 0 0 2 5021 3553 4948 3553 2 1 0 1 4 7 100 0 -1 0.000 0 0 7 0 0 2 5021 3502 4948 3502 -6 6 4948 3252 5021 3402 2 1 0 1 4 7 100 0 -1 0.000 0 0 7 0 0 2 5021 3402 4948 3402 2 1 0 1 4 7 100 0 -1 0.000 0 0 7 0 0 2 5021 3353 4948 3353 2 1 0 1 4 7 100 0 -1 0.000 0 0 7 0 0 2 5021 3304 4948 3304 2 1 0 1 4 7 100 0 -1 0.000 0 0 7 0 0 2 5021 3252 4948 3252 -6 6 4948 3002 5021 3153 2 1 0 1 4 7 100 0 -1 0.000 0 0 7 0 0 2 5021 3153 4948 3153 2 1 0 1 4 7 100 0 -1 0.000 0 0 7 0 0 2 5021 3105 4948 3105 2 1 0 1 4 7 100 0 -1 0.000 0 0 7 0 0 2 5021 3055 4948 3055 2 1 0 1 4 7 100 0 -1 0.000 0 0 7 0 0 2 5021 3002 4948 3002 -6 6 4948 3749 5021 3902 2 1 0 1 4 7 100 0 -1 0.000 0 0 7 0 0 2 5021 3902 4948 3902 2 1 0 1 4 7 100 0 -1 0.000 0 0 7 0 0 2 5021 3849 4948 3849 2 1 0 1 4 7 100 0 -1 0.000 0 0 7 0 0 2 5021 3798 4948 3798 2 1 0 1 4 7 100 0 -1 0.000 0 0 7 0 0 2 5021 3749 4948 3749 -6 6 4948 4000 5021 4152 2 1 0 1 4 7 100 0 -1 0.000 0 0 7 0 0 2 5021 4152 4948 4152 2 1 0 1 4 7 100 0 -1 0.000 0 0 7 0 0 2 5021 4102 4948 4102 2 1 0 1 4 7 100 0 -1 0.000 0 0 7 0 0 2 5021 4049 4948 4049 2 1 0 1 4 7 100 0 -1 0.000 0 0 7 0 0 2 5021 4000 4948 4000 -6 2 1 0 1 4 7 100 0 -1 0.000 0 0 7 0 0 2 5045 3951 4948 3951 2 1 0 1 4 7 100 0 -1 0.000 0 0 7 0 0 2 5045 3702 4948 3702 2 1 0 1 4 7 100 0 -1 0.000 0 0 7 0 0 2 5045 3453 4948 3453 2 1 0 1 4 7 100 0 -1 0.000 0 0 7 0 0 2 5045 3202 4948 3202 2 1 0 1 4 7 100 0 -1 0.000 0 0 7 0 0 4 5045 2950 4948 2950 4948 4200 5045 4200 -6 6 4800 2953 4898 4200 6 4800 3502 4898 3702 2 1 0 1 0 7 100 0 -1 0.000 0 0 7 0 0 2 4824 3674 4894 3674 2 1 0 1 0 7 100 0 -1 0.000 0 0 7 0 0 2 4824 3624 4894 3624 2 1 0 1 0 7 100 0 -1 0.000 0 0 7 0 0 2 4824 3577 4894 3577 2 1 0 1 0 7 100 0 -1 0.000 0 0 7 0 0 2 4824 3529 4894 3529 -6 6 4800 3253 4898 3453 2 1 0 1 0 7 100 0 -1 0.000 0 0 7 0 0 2 4824 3432 4894 3432 2 1 0 1 0 7 100 0 -1 0.000 0 0 7 0 0 2 4824 3385 4894 3385 2 1 0 1 0 7 100 0 -1 0.000 0 0 7 0 0 2 4824 3338 4894 3338 2 1 0 1 0 7 100 0 -1 0.000 0 0 7 0 0 2 4824 3288 4894 3288 -6 6 4800 3002 4898 3202 2 1 0 1 0 7 100 0 -1 0.000 0 0 7 0 0 2 4824 3193 4894 3193 2 1 0 1 0 7 100 0 -1 0.000 0 0 7 0 0 2 4824 3147 4894 3147 2 1 0 1 0 7 100 0 -1 0.000 0 0 7 0 0 2 4824 3098 4894 3098 2 1 0 1 0 7 100 0 -1 0.000 0 0 7 0 0 2 4824 3051 4894 3051 -6 6 4800 3751 4898 3951 2 1 0 1 0 7 100 0 -1 0.000 0 0 7 0 0 2 4824 3913 4894 3913 2 1 0 1 0 7 100 0 -1 0.000 0 0 7 0 0 2 4824 3863 4894 3863 2 1 0 1 0 7 100 0 -1 0.000 0 0 7 0 0 2 4824 3815 4894 3815 2 1 0 1 0 7 100 0 -1 0.000 0 0 7 0 0 2 4824 3766 4894 3766 -6 6 4800 4000 4898 4200 2 1 0 1 0 7 100 0 -1 0.000 0 0 7 0 0 2 4824 4154 4894 4154 2 1 0 1 0 7 100 0 -1 0.000 0 0 7 0 0 2 4824 4106 4894 4106 2 1 0 1 0 7 100 0 -1 0.000 0 0 7 0 0 2 4824 4055 4894 4055 2 1 0 1 0 7 100 0 -1 0.000 0 0 7 0 0 2 4824 4008 4894 4008 -6 2 1 0 1 0 7 100 0 -1 0.000 0 0 7 0 0 2 4801 3960 4894 3960 2 1 0 1 0 7 100 0 -1 0.000 0 0 7 0 0 2 4801 3721 4894 3721 2 1 0 1 0 7 100 0 -1 0.000 0 0 7 0 0 2 4801 3482 4894 3482 2 1 0 1 0 7 100 0 -1 0.000 0 0 7 0 0 2 4801 3242 4894 3242 2 1 0 1 0 7 100 0 -1 0.000 0 0 7 0 0 4 4801 2998 4894 2998 4894 4200 4801 4200 -6 -6 2 1 0 1 1 7 100 0 -1 0.000 0 0 -1 0 0 2 2100 3600 2850 3600 2 1 0 1 14 7 100 0 -1 0.000 0 0 -1 0 0 2 3300 3600 4050 3600 4 2 0 100 0 0 12 0.0000 4 135 90 2925 3675 0\001 4 2 0 100 0 0 12 0.0000 4 135 375 2925 2925 -400\001 4 2 0 100 0 0 12 0.0000 4 135 375 2925 2100 -800\001 4 2 0 100 0 0 12 0.0000 4 135 465 2925 1275 -1200\001 4 2 0 100 0 0 12 0.0000 4 135 270 2925 4500 400\001 4 2 0 100 0 0 12 0.0000 4 135 270 2925 5325 800\001 4 2 0 100 0 0 12 0.0000 4 135 360 2925 6075 1200\001 4 2 0 100 0 0 12 0.0000 4 135 90 4737 4286 0\001 4 2 0 100 0 0 12 0.0000 4 135 90 4730 4039 5\001 4 2 0 100 0 0 12 0.0000 4 135 180 4745 3836 10\001 4 2 0 100 0 0 12 0.0000 4 135 180 4737 3574 15\001 4 2 0 100 0 0 12 0.0000 4 135 180 4730 3334 20\001 4 2 0 100 0 0 12 0.0000 4 135 180 4707 3094 25\001 -6 6 1050 6300 6000 9300 6 1125 8175 5925 8400 6 1125 8175 1950 8400 6 1125 8175 1275 8325 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 1175 8300 1175 8200 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 1225 8300 1225 8200 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 1275 8300 1275 8200 -6 6 1350 8175 1500 8325 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 1375 8300 1375 8200 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 1425 8300 1425 8200 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 1475 8300 1475 8200 -6 6 1575 8175 1725 8325 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 1575 8300 1575 8200 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 1625 8300 1625 8200 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 1675 8300 1675 8200 -6 6 1725 8175 1875 8325 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 1775 8300 1775 8200 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 1825 8300 1825 8200 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 1875 8300 1875 8200 -6 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 1125 8400 1125 8200 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 1925 8400 1925 8200 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 1325 8350 1325 8200 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 1525 8350 1525 8200 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 1725 8350 1725 8200 -6 6 1875 8175 2775 8400 6 1950 8175 2100 8325 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 1975 8300 1975 8200 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 2025 8300 2025 8200 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 2075 8300 2075 8200 -6 6 2175 8175 2325 8325 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 2175 8300 2175 8200 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 2225 8300 2225 8200 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 2275 8300 2275 8200 -6 6 2325 8175 2475 8325 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 2375 8300 2375 8200 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 2425 8300 2425 8200 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 2475 8300 2475 8200 -6 6 2550 8175 2700 8325 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 2575 8300 2575 8200 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 2625 8300 2625 8200 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 2675 8300 2675 8200 -6 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 1925 8400 1925 8200 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 2725 8400 2725 8200 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 2125 8350 2125 8200 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 2325 8350 2325 8200 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 2525 8350 2525 8200 -6 6 2700 8175 3525 8400 6 2775 8175 2925 8325 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 2775 8300 2775 8200 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 2825 8300 2825 8200 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 2875 8300 2875 8200 -6 6 2925 8175 3075 8325 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 2975 8300 2975 8200 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3025 8300 3025 8200 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3075 8300 3075 8200 -6 6 3150 8175 3300 8325 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3175 8300 3175 8200 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3225 8300 3225 8200 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3275 8300 3275 8200 -6 6 3375 8175 3525 8325 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3375 8300 3375 8200 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3425 8300 3425 8200 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3475 8300 3475 8200 -6 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 2725 8400 2725 8200 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3525 8400 3525 8200 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 2925 8350 2925 8200 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3125 8350 3125 8200 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3325 8350 3325 8200 -6 6 3525 8175 4350 8400 6 3525 8175 3675 8325 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3575 8300 3575 8200 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3625 8300 3625 8200 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3675 8300 3675 8200 -6 6 3750 8175 3900 8325 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3775 8300 3775 8200 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3825 8300 3825 8200 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3875 8300 3875 8200 -6 6 3975 8175 4125 8325 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3975 8300 3975 8200 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 4025 8300 4025 8200 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 4075 8300 4075 8200 -6 6 4125 8175 4275 8325 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 4175 8300 4175 8200 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 4225 8300 4225 8200 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 4275 8300 4275 8200 -6 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3525 8400 3525 8200 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 4325 8400 4325 8200 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3725 8350 3725 8200 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 3925 8350 3925 8200 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 4125 8350 4125 8200 -6 6 4275 8175 5175 8400 6 4350 8175 4500 8325 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 4375 8300 4375 8200 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 4425 8300 4425 8200 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 4475 8300 4475 8200 -6 6 4575 8175 4725 8325 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 4575 8300 4575 8200 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 4625 8300 4625 8200 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 4675 8300 4675 8200 -6 6 4725 8175 4875 8325 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 4775 8300 4775 8200 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 4825 8300 4825 8200 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 4875 8300 4875 8200 -6 6 4950 8175 5100 8325 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 4975 8300 4975 8200 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 5025 8300 5025 8200 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 5075 8300 5075 8200 -6 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 4325 8400 4325 8200 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 5125 8400 5125 8200 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 4525 8350 4525 8200 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 4725 8350 4725 8200 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 4925 8350 4925 8200 -6 6 5100 8175 5925 8400 6 5175 8175 5325 8325 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 5175 8300 5175 8200 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 5225 8300 5225 8200 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 5275 8300 5275 8200 -6 6 5325 8175 5475 8325 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 5375 8300 5375 8200 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 5425 8300 5425 8200 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 5475 8300 5475 8200 -6 6 5550 8175 5700 8325 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 5575 8300 5575 8200 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 5625 8300 5625 8200 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 5675 8300 5675 8200 -6 6 5775 8175 5925 8325 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 5775 8300 5775 8200 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 5825 8300 5825 8200 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 5875 8300 5875 8200 -6 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 5125 8400 5125 8200 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 5925 8400 5925 8200 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 5325 8350 5325 8200 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 5525 8350 5525 8200 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 5725 8350 5725 8200 -6 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 4 1125 8289 1125 8200 5925 8200 5925 8289 -6 6 2850 6300 4125 6600 6 2850 6300 4125 6525 6 3375 6375 3600 6525 2 1 0 1 4 7 100 0 -1 0.000 0 0 7 0 0 2 3576 6379 3576 6452 2 1 0 1 4 7 100 0 -1 0.000 0 0 7 0 0 2 3527 6379 3527 6452 2 1 0 1 4 7 100 0 -1 0.000 0 0 7 0 0 2 3478 6379 3478 6452 2 1 0 1 4 7 100 0 -1 0.000 0 0 7 0 0 2 3427 6379 3427 6452 -6 6 3150 6375 3375 6525 2 1 0 1 4 7 100 0 -1 0.000 0 0 7 0 0 2 3327 6379 3327 6452 2 1 0 1 4 7 100 0 -1 0.000 0 0 7 0 0 2 3278 6379 3278 6452 2 1 0 1 4 7 100 0 -1 0.000 0 0 7 0 0 2 3229 6379 3229 6452 2 1 0 1 4 7 100 0 -1 0.000 0 0 7 0 0 2 3177 6379 3177 6452 -6 6 2925 6375 3150 6525 2 1 0 1 4 7 100 0 -1 0.000 0 0 7 0 0 2 3078 6379 3078 6452 2 1 0 1 4 7 100 0 -1 0.000 0 0 7 0 0 2 3030 6379 3030 6452 2 1 0 1 4 7 100 0 -1 0.000 0 0 7 0 0 2 2980 6379 2980 6452 2 1 0 1 4 7 100 0 -1 0.000 0 0 7 0 0 2 2927 6379 2927 6452 -6 6 3600 6375 3900 6525 2 1 0 1 4 7 100 0 -1 0.000 0 0 7 0 0 2 3827 6379 3827 6452 2 1 0 1 4 7 100 0 -1 0.000 0 0 7 0 0 2 3774 6379 3774 6452 2 1 0 1 4 7 100 0 -1 0.000 0 0 7 0 0 2 3723 6379 3723 6452 2 1 0 1 4 7 100 0 -1 0.000 0 0 7 0 0 2 3674 6379 3674 6452 -6 6 3900 6375 4125 6525 2 1 0 1 4 7 100 0 -1 0.000 0 0 7 0 0 2 4077 6379 4077 6452 2 1 0 1 4 7 100 0 -1 0.000 0 0 7 0 0 2 4027 6379 4027 6452 2 1 0 1 4 7 100 0 -1 0.000 0 0 7 0 0 2 3974 6379 3974 6452 2 1 0 1 4 7 100 0 -1 0.000 0 0 7 0 0 2 3925 6379 3925 6452 -6 2 1 0 1 4 7 100 0 -1 0.000 0 0 7 0 0 2 3876 6355 3876 6452 2 1 0 1 4 7 100 0 -1 0.000 0 0 7 0 0 2 3627 6355 3627 6452 2 1 0 1 4 7 100 0 -1 0.000 0 0 7 0 0 2 3378 6355 3378 6452 2 1 0 1 4 7 100 0 -1 0.000 0 0 7 0 0 2 3127 6355 3127 6452 2 1 0 1 4 7 100 0 -1 0.000 0 0 7 0 0 4 2875 6355 2875 6452 4125 6452 4125 6355 -6 6 2850 6450 4125 6600 6 3450 6450 3600 6600 2 1 0 1 0 7 100 0 -1 0.000 0 0 7 0 0 2 3599 6576 3599 6506 2 1 0 1 0 7 100 0 -1 0.000 0 0 7 0 0 2 3549 6576 3549 6506 2 1 0 1 0 7 100 0 -1 0.000 0 0 7 0 0 2 3502 6576 3502 6506 2 1 0 1 0 7 100 0 -1 0.000 0 0 7 0 0 2 3454 6576 3454 6506 -6 6 3150 6450 3375 6600 2 1 0 1 0 7 100 0 -1 0.000 0 0 7 0 0 2 3357 6576 3357 6506 2 1 0 1 0 7 100 0 -1 0.000 0 0 7 0 0 2 3310 6576 3310 6506 2 1 0 1 0 7 100 0 -1 0.000 0 0 7 0 0 2 3263 6576 3263 6506 2 1 0 1 0 7 100 0 -1 0.000 0 0 7 0 0 2 3213 6576 3213 6506 -6 6 2925 6450 3150 6600 2 1 0 1 0 7 100 0 -1 0.000 0 0 7 0 0 2 3118 6576 3118 6506 2 1 0 1 0 7 100 0 -1 0.000 0 0 7 0 0 2 3072 6576 3072 6506 2 1 0 1 0 7 100 0 -1 0.000 0 0 7 0 0 2 3023 6576 3023 6506 2 1 0 1 0 7 100 0 -1 0.000 0 0 7 0 0 2 2976 6576 2976 6506 -6 6 3675 6450 3900 6600 2 1 0 1 0 7 100 0 -1 0.000 0 0 7 0 0 2 3838 6576 3838 6506 2 1 0 1 0 7 100 0 -1 0.000 0 0 7 0 0 2 3788 6576 3788 6506 2 1 0 1 0 7 100 0 -1 0.000 0 0 7 0 0 2 3740 6576 3740 6506 2 1 0 1 0 7 100 0 -1 0.000 0 0 7 0 0 2 3691 6576 3691 6506 -6 6 3900 6450 4125 6600 2 1 0 1 0 7 100 0 -1 0.000 0 0 7 0 0 2 4079 6576 4079 6506 2 1 0 1 0 7 100 0 -1 0.000 0 0 7 0 0 2 4031 6576 4031 6506 2 1 0 1 0 7 100 0 -1 0.000 0 0 7 0 0 2 3980 6576 3980 6506 2 1 0 1 0 7 100 0 -1 0.000 0 0 7 0 0 2 3933 6576 3933 6506 -6 2 1 0 1 0 7 100 0 -1 0.000 0 0 7 0 0 2 3885 6599 3885 6506 2 1 0 1 0 7 100 0 -1 0.000 0 0 7 0 0 2 3646 6599 3646 6506 2 1 0 1 0 7 100 0 -1 0.000 0 0 7 0 0 2 3407 6599 3407 6506 2 1 0 1 0 7 100 0 -1 0.000 0 0 7 0 0 2 3167 6599 3167 6506 2 1 0 1 0 7 100 0 -1 0.000 0 0 7 0 0 4 2923 6599 2923 6506 4125 6506 4125 6599 -6 -6 2 1 0 1 1 7 100 0 -1 0.000 0 0 -1 0 0 2 3525 9300 3525 8550 2 1 0 1 14 7 100 0 -1 0.000 0 0 -1 0 0 2 3525 8100 3525 7350 4 2 0 100 0 0 12 1.5708 4 135 90 3600 8475 0\001 4 2 0 100 0 0 12 1.5708 4 135 375 2850 8475 -400\001 4 2 0 100 0 0 12 1.5708 4 135 375 2025 8475 -800\001 4 2 0 100 0 0 12 1.5708 4 135 465 1200 8475 -1200\001 4 2 0 100 0 0 12 1.5708 4 135 270 4425 8475 400\001 4 2 0 100 0 0 12 1.5708 4 135 270 5250 8475 800\001 4 2 0 100 0 0 12 1.5708 4 135 360 6000 8475 1200\001 4 2 0 100 0 0 12 1.5708 4 135 90 4211 6663 0\001 4 2 0 100 0 0 12 1.5708 4 135 90 3964 6670 5\001 4 2 0 100 0 0 12 1.5708 4 135 180 3761 6655 10\001 4 2 0 100 0 0 12 1.5708 4 135 180 3499 6663 15\001 4 2 0 100 0 0 12 1.5708 4 135 180 3259 6670 20\001 4 2 0 100 0 0 12 1.5708 4 135 180 3019 6693 25\001 -6 2 2 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 5 1200 1200 2400 1200 2400 2400 1200 2400 1200 1200 2 2 0 1 4 7 100 0 -1 0.000 0 0 -1 0 0 5 1350 1350 2250 1350 2250 2250 1350 2250 1350 1350 2 2 0 1 2 7 100 0 -1 0.000 0 0 -1 0 0 5 1500 1500 2100 1500 2100 2100 1500 2100 1500 1500 2 2 0 1 1 7 100 0 -1 0.000 0 0 -1 0 0 5 1650 1650 1950 1650 1950 1950 1650 1950 1650 1650 2 1 0 1 0 7 100 0 -1 0.000 0 0 -1 0 0 2 1200 1200 2400 2400 2 1 0 1 6 7 100 0 -1 0.000 0 0 -1 0 0 2 1200 2400 2400 1200 pnm2ppa-1.13/testpages/testpage-a4.fig0000644000076400007640000000555407132536571014572 00000000000000#FIG 3.2 Portrait Center Metric Letter 100.00 Single -2 1200 2 6 2250 7200 7200 8100 2 2 0 1 -1 10 0 0 20 0.000 0 0 -1 0 0 5 2250 7200 2869 7200 2869 7500 2250 7500 2250 7200 2 2 0 1 -1 6 0 0 20 0.000 0 0 -1 0 0 5 3488 7200 4106 7200 4106 7500 3488 7500 3488 7200 2 2 0 1 -1 5 0 0 20 0.000 0 0 -1 0 0 5 4106 7200 4725 7200 4725 7500 4106 7500 4106 7200 2 2 0 1 -1 26 0 0 20 0.000 0 0 -1 0 0 5 4725 7200 5344 7200 5344 7500 4725 7500 4725 7200 2 2 0 1 -1 31 0 0 20 0.000 0 0 -1 0 0 5 5344 7200 5963 7200 5963 7500 5344 7500 5344 7200 2 2 0 1 -1 3 0 0 20 0.000 0 0 -1 0 0 5 5963 7200 6581 7200 6581 7500 5963 7500 5963 7200 2 2 0 1 -1 20 0 0 20 0.000 0 0 -1 0 0 5 2869 7200 3488 7200 3488 7500 2869 7500 2869 7200 2 2 0 1 -1 2 0 0 20 0.000 0 0 -1 0 0 5 6581 7200 7200 7200 7200 7500 6581 7500 6581 7200 4 1 -1 0 0 18 10 0.0000 4 120 465 5034 7800 Brown\001 4 1 -1 0 0 18 10 0.0000 4 120 345 5653 7800 Gold\001 4 1 -1 0 0 18 10 0.0000 4 120 450 6891 7800 Green\001 4 1 -1 0 0 18 10 0.0000 4 120 525 3797 7800 Yellow\001 4 1 -1 0 0 18 10 0.0000 4 120 285 3178 7800 Red\001 4 1 -1 0 0 18 10 0.0000 4 120 330 2559 7800 Blue\001 4 1 -1 0 0 18 10 0.0000 4 150 480 4416 7800 Purple\001 4 1 -1 0 0 18 10 0.0000 4 150 390 6272 7800 Cyan\001 -6 2 2 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 5 450 450 9000 450 9000 12915 450 12915 450 450 2 2 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 5 900 900 8550 900 8550 12465 900 12465 900 900 4 1 -1 0 0 0 12 0.0000 4 135 315 4725 1095 2cm\001 4 1 -1 0 0 0 12 0.0000 4 135 315 4725 12825 1cm\001 4 1 -1 0 0 0 12 0.0000 4 135 315 4725 12345 2cm\001 4 1 -1 0 0 0 12 0.0000 4 135 315 1110 7485 2cm\001 4 1 -1 0 0 0 12 0.0000 4 135 315 675 7485 1cm\001 4 1 -1 0 0 0 12 0.0000 4 135 315 8310 7485 2cm\001 4 1 -1 0 0 0 12 0.0000 4 135 315 8820 7485 1cm\001 4 1 -1 0 0 18 18 0.0000 4 270 4335 4725 6420 Here are some other colors; they\001 4 1 -1 0 0 18 18 0.0000 4 270 5175 4725 6765 will appear as greys on a B&W printer...\001 4 1 -1 0 0 18 18 0.0000 4 270 3555 4725 9225 are spaced at 1cm and 2cm\001 4 1 -1 0 0 18 18 0.0000 4 270 4095 4725 8880 The boxes bordering this page\001 4 1 -1 0 0 18 18 0.0000 4 270 3690 4725 9600 from the sides of the paper.\001 4 1 -1 0 0 18 18 0.0000 4 270 5640 4725 10500 It is not unusual for the 1cm bottom margin\001 4 1 -1 0 0 18 18 0.0000 4 270 4470 4725 10845 not to show. Many printers cannot\001 4 1 -1 0 0 18 18 0.0000 4 270 5520 4725 11190 print that close to the bottom of the page.\001 4 1 -1 0 0 18 18 0.0000 4 270 3405 4725 2445 PostScript Test Page (A4)\001 4 1 -1 0 0 0 12 0.0000 4 135 315 4725 630 1cm\001 4 0 0 50 0 2 25 0.0000 4 330 4200 2385 3285 To adjust the offsets in the\001 4 0 0 50 0 2 25 0.0000 4 330 5895 1800 4725 change xoff and yoff until this page is\001 4 0 0 50 0 2 25 0.0000 4 330 6345 1800 5400 printed correctly centered on the paper.\001 4 0 0 50 0 2 25 0.0000 4 330 5880 1800 4005 /etc/pnm2ppa.conf configuration file,\001 pnm2ppa-1.13/testpages/testpage.fig0000644000076400007640000000565007132536571014265 00000000000000#FIG 3.2 Portrait Center Inches Letter 100.00 Single -2 1200 2 6 2400 7200 7200 8100 2 2 0 1 -1 10 0 0 20 0.000 0 0 -1 0 0 5 2400 7200 3000 7200 3000 7500 2400 7500 2400 7200 2 2 0 1 -1 6 0 0 20 0.000 0 0 -1 0 0 5 3600 7200 4200 7200 4200 7500 3600 7500 3600 7200 2 2 0 1 -1 5 0 0 20 0.000 0 0 -1 0 0 5 4200 7200 4800 7200 4800 7500 4200 7500 4200 7200 2 2 0 1 -1 26 0 0 20 0.000 0 0 -1 0 0 5 4800 7200 5400 7200 5400 7500 4800 7500 4800 7200 2 2 0 1 -1 31 0 0 20 0.000 0 0 -1 0 0 5 5400 7200 6000 7200 6000 7500 5400 7500 5400 7200 2 2 0 1 -1 3 0 0 20 0.000 0 0 -1 0 0 5 6000 7200 6600 7200 6600 7500 6000 7500 6000 7200 2 2 0 1 -1 20 0 0 20 0.000 0 0 -1 0 0 5 3000 7200 3600 7200 3600 7500 3000 7500 3000 7200 2 2 0 1 -1 2 0 0 20 0.000 0 0 -1 0 0 5 6600 7200 7200 7200 7200 7500 6600 7500 6600 7200 4 1 -1 0 0 18 10 0.0000 4 120 465 5100 7800 Brown\001 4 1 -1 0 0 18 10 0.0000 4 120 345 5700 7800 Gold\001 4 1 -1 0 0 18 10 0.0000 4 120 450 6900 7800 Green\001 4 1 -1 0 0 18 10 0.0000 4 120 525 3900 7800 Yellow\001 4 1 -1 0 0 18 10 0.0000 4 120 285 3300 7800 Red\001 4 1 -1 0 0 18 10 0.0000 4 120 330 2700 7800 Blue\001 4 1 -1 0 0 18 10 0.0000 4 150 480 4500 7800 Purple\001 4 1 -1 0 0 18 10 0.0000 4 150 390 6300 7800 Cyan\001 -6 6 2175 1875 7425 2175 4 1 -1 0 0 18 18 0.0000 4 270 5115 4800 2100 Postscript Test Page (US Letter paper)\001 -6 2 2 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 5 600 600 9600 600 9600 12600 600 12600 600 600 2 2 0 2 -1 7 0 0 -1 0.000 0 0 -1 0 0 5 1200 1200 9000 1200 9000 12000 1200 12000 1200 1200 4 0 -1 0 0 0 12 0.0000 4 135 300 4800 12375 0.5"\001 4 0 -1 0 0 0 12 0.0000 4 135 300 4725 900 0.5"\001 4 0 -1 0 0 0 12 0.0000 4 135 165 4800 11850 1"\001 4 0 -1 0 0 0 12 0.0000 4 135 165 4800 1500 1"\001 4 0 -1 0 0 0 12 0.0000 4 135 300 750 7500 0.5"\001 4 0 -1 0 0 0 12 0.0000 4 135 165 1350 7500 1"\001 4 0 -1 0 0 0 12 0.0000 4 135 165 8700 7500 1"\001 4 0 -1 0 0 0 12 0.0000 4 135 300 9225 7500 0.5"\001 4 1 -1 0 0 18 18 0.0000 4 270 4335 4800 6420 Here are some other colors; they\001 4 1 -1 0 0 18 18 0.0000 4 270 5175 4800 6765 will appear as greys on a B&W printer...\001 4 1 -1 0 0 18 18 0.0000 4 270 3270 4800 9225 are spaced at 0.5" and 1"\001 4 1 -1 0 0 18 18 0.0000 4 270 4095 4800 8880 The boxes bordering this page\001 4 1 -1 0 0 18 18 0.0000 4 270 3690 4800 9600 from the sides of the paper.\001 4 1 -1 0 0 18 18 0.0000 4 270 5610 4800 10500 It is not unusual for the 0.5" bottom margin\001 4 1 -1 0 0 18 18 0.0000 4 270 4470 4800 10845 not to show. Many printers cannot\001 4 1 -1 0 0 18 18 0.0000 4 270 5520 4800 11190 print that close to the bottom of the page.\001 4 0 0 50 0 2 20 0.0000 4 255 5355 2175 3075 To adjust the offsets in the configuration file\001 4 0 0 50 0 2 20 0.0000 4 255 5340 2175 3390 /etc/pnm2ppa.conf, change the values of xoff\001 4 0 0 50 0 2 20 0.0000 4 255 5220 2175 3705 and yoff until this page is printed correctly \001 4 0 0 50 0 2 20 0.0000 4 255 2685 2175 4020 centered on the paper.\001 pnm2ppa-1.13/utils/0000777000076400007640000000000011313235643011171 500000000000000pnm2ppa-1.13/utils/Linux/0000777000076400007640000000000011313235643012270 500000000000000pnm2ppa-1.13/utils/Linux/detect_ppa0000755000076400007640000000761207400334755014256 00000000000000#!/bin/sh # script for testing installation of a PPA printer, v0.5 20000908 # (C) 2000,2001 The pnm2ppa project # Requires Linux 2.2.x kernels with parport autoprobe support. # Now updated for 2.4.x kernels too. # assumes all parallel ports are in the range 0-7 (0-15 in 2.4 kernels) # (as linux/include/parport.h sets PARPORT_MAX=8) (=16 in 2.4) MODPROBE="/sbin/modprobe" PROC_PARPORT="/proc/parport" PARPORT="" PARPORT_LIST="0 1 2 3 4 5 6 7" echo "*** Script for testing installation of PPA printers on Linux " echo " (requires 2.2.x kernel or later)" supported="710 720 820 1000" if [ -e /proc/sys/dev/parport ] ; then echo "*** 2.4.x kernel: found /proc/sys/dev/parport/" PROC_PARPORT="/proc/sys/dev/parport" PARPORT="parport" PARPORT_LIST="0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15" else if [ "$($MODPROBE -l parport_probe.o )" = "" ] ; then echo "*** kernel module parport_probe.o not found:" echo "*** IEEE-1284 autodetection not supported by this Linux kernel" exit 1 fi fi if ! $($MODPROBE -r ) ; then echo "*** Error: cannot load/unload kernel module(s) " echo " You must run this script as root " exit 1 fi # (re)probe the parport: $MODPROBE -r lp # unload the lowlevel parport driver #(probably only ARCH=pc is OK for PPA printers?) for ARCH in amiga arc atari ax mfc3 pc ; do $MODPROBE -r parport_$ARCH done $MODPROBE lp if [ -e $PROC_PARPORT ] ; then found=0 found_ppa=0 ppa_printer="" for n in $PARPORT_LIST ; do if [ -e $PROC_PARPORT/$PARPORT$n/autoprobe ] ; then found=1 echo " " echo "Device found at parallel port $n (usually /dev/lp$n )" echo "IEEE-1284 autoprobe reports:" cat $PROC_PARPORT/$PARPORT$n/autoprobe report=$(cat $PROC_PARPORT/$PARPORT$n/autoprobe) for printer in $supported ; do if $(echo $report |grep -e "DESKJET $printer" >/dev/null) ; then found_ppa=1 text=" type=$printer, port=$n;" ppa_printer=$ppa_printer$text fi done fi done echo " " if [ "$found_ppa" = 0 ] ; then echo "No supported PPA printers attached to parallel port(s) were found" echo "(Make sure the printer's power cable is connected!!)" else echo "Supported PPA printers found on parallel ports:" echo $ppa_printer echo "printers on parallel port are by default accessed by printing to /dev/lp" echo "(unless this was explictly changed when loading the parport module)" fi else echo "*** Error: /proc/parport does not exist:" echo "*** Cannot autoprobe IEEE-1284 parallel port devices." echo "(This requires 2.2.x kernels with IEEE-1284 autoprobe support)" echo "A IEEE-1284 bidirectional parallel port cable is also required" echo "*** Possible causes of error:" echo " 1. You are running an older Linux kernel (2.0.x or earlier)" echo " -- this does NOT mean that you cannot make your PPA printer" echo " work; however, this test script will not work." echo " 2. Check that the printer is properly connected to a parallel" echo " port, with a bidirectional IEEE-1284 cable, and is switched" echo " on. (If your printer works under MS Windows(tm), you have " echo " the correct cable.)" echo " 3. If \"lsmod\" shows that the lp, parport and parport_probe" echo " modules are loaded, but not the architecture-dependent " echo " module parport_pc, you may need to add a line " echo " alias parport_lowlevel parport_pc " echo " to your /etc/conf.modules file (needed for RedHat 6.1)." echo " " echo " (modules for other architectures exist, e.g., parport_ax for " echo " Sun Ultra/AX, but it is not clear whether PPA printers " echo " will work on such hardware (let us know if you try...))" exit 0 fi pnm2ppa-1.13/utils/Linux/test_ppa0000755000076400007640000001527307201641745013766 00000000000000#!/bin/sh # test_ppa v 1.03 # designed for Red Hat Linux systems BINDIR=/usr/bin CONFIG_DIR=/etc echo "*** Test/Calibration page printing utility for HP DeskJet PPA printers" echo " Give PPA printer model ( 710 | 712 | 720 | 722 | 820 | 1000 ):" read response printer="" if $(echo $response | grep -e "710" > /dev/null ) ; then printer=710 elif $(echo $response | grep -e "712" > /dev/null ) ; then printer=710 elif $(echo $response | grep -e "720" > /dev/null ) ; then printer=720 elif $(echo $response | grep -e "722" > /dev/null ) ; then printer=720 elif $(echo $response | grep -e "820" > /dev/null ) ; then printer=820 elif $(echo $response | grep -e "1000" > /dev/null ) ; then printer=1000 fi if [ "$printer" = "" ] ; then echo "*** Error: printer model $response is not a valid PPA printer" exit 0 fi echo " Give desired paper size ( letter | legal | a4 ):" read response paper="" case $response in letter | Letter | us | US ) paper="letter" page="/usr/lib/rhs/rhs-printfilters/testpage.ps" ;; esac case $response in legal | Legal ) paper="legal" page="/usr/lib/rhs/rhs-printfilters/testpage.ps" ;; esac case $response in a4 | A4 ) paper="a4" page="/usr/lib/rhs/rhs-printfilters/testpage-a4.ps" ;; esac if [ "$paper" = "" ] ; then echo "*** Error: $response is not a valid paper size" exit 0 fi echo " Give desired printer port /dev/lpn, n = (0 | 1 | 2):" read response port="INVALID PORT" case $response in 0 | 1 | 2 ) port="/dev/lp$response" ;; esac case $response in "/dev/lp0" | "/dev/lp1" | "/dev/lp2" ) port=$response ;; esac if ! [ -e "$port" ] ; then echo "*** Error: printer port $port does not exist" exit 0 fi GSDEVICE=ppmraw DRIVER=pnm2ppa CALIB=calibrate_ppa CFG=$pnm2ppa_conf OPTS="--verbose" color="" if [ "$DRIVER" = "pnm2ppa" ] ; then echo " *** pnm2ppa can print in color or black-and-white" echo " test in color (1) or black-and-white (2)? [1 | 2] (1):" read response if [ "$response" = "2" ] ; then color="--bw" fi fi if ! [ -f $BINDIR/$DRIVER ] ; then echo "*** Error: $BINDIR/$DRIVER was not found" echo " is it correctly installed?" exit 0 fi if ! $(eval "which $DRIVER | grep -e $BINDIR/$DRIVER >/dev/null 2>&1 " ) ; then echo "*** WARNING: the PPA driver $DRIVER found in your path " echo " is not $BINDIR/$DRIVER; \"which $DRIVER\" reports:" which $DRIVER echo " move or delete this other copy of $DRIVER (exit) " exit 0 fi CFG=$CONFIG_DIR/${DRIVER}.conf if [ -f $CFG ] ; then echo " *** Configuration file $CFG will be used " cfg="-f $CFG" else echo " *** No configuration file $CFG found" cfg="" fi if [ -f $page ] ; then echo " *** Do you wish to print a test page ? [Y | N] (N):" read response case $response in y | Y | yes | Yes ) eval "cat $page | gs -q \ -sDEVICE=$GSDEVICE -dNOPAUSE -r600 -sPAPERSIZE=$paper \ -sOutputFile=- -| $BINDIR/$DRIVER $OPTS -v $printer $cfg $color -s $paper \ - - > $port" ;; esac fi echo " *** Do you wish to print the offset calibration page ? [Y | N] (N):" read response case $response in y | Y | yes | Yes ) if ! [ -f $BINDIR/$CALIB ] ; then echo "*** Error: $BINDIR/$CALIB was not found" echo " is it correctly installed?" exit 0 fi if ! $(eval "which $CALIB | grep -e $BINDIR/$CALIB >/dev/null" ) ; then echo "*** WARNING: the calibration program $CALIB found in your path " echo " is not $BINDIR/$CALIB; \"which $CALIB\" reports:" which $CALIB echo " move or delete this other copy of $CALIB (exit) " exit 0 fi echo " see the file CALIBRATION.txt for details of its use" echo " " eval "$CALIB -s $paper --center | $BINDIR/$DRIVER $OPTS -v $printer $cfg --bw \ - - > $port" ;; esac echo " *** Do you wish to print the alignment calibration page ? [Y | N] (N):" read response case $response in y | Y | yes | Yes ) if ! [ -f $BINDIR/$CALIB ] ; then echo "*** Error: $BINDIR/$CALIB was not found" echo " is it correctly installed?" exit 0 fi if ! $(eval "which $CALIB | grep -e $BINDIR/$CALIB >/dev/null" ) ; then echo "*** WARNING: the calibration program $CALIB found in your path " echo " is not $BINDIR/$CALIB; \"which $CALIB\" reports:" which $CALIB echo " move or delete this other copy of $CALIB (exit) " exit 0 fi echo " see the file CALIBRATION.txt for details of its use" eval "$CALIB -s $paper --align | $BINDIR/$DRIVER $OPTS -v $printer $cfg --fd \ - - > $port" ;; esac echo " *** Do you wish to print the alignment test page ? [Y | N] (N):" read response case $response in y | Y | yes | Yes ) if ! [ -f $BINDIR/$CALIB ] ; then echo "*** Error: $BINDIR/$CALIB was not found" echo " is it correctly installed?" exit 0 fi if ! $(eval "which $CALIB | grep -e $BINDIR/$CALIB >/dev/null" ) ; then echo "*** WARNING: the calibration program $CALIB found in your path " echo " is not $BINDIR/$CALIB; \"which $CALIB\" reports:" which $CALIB echo " move or delete this other copy of $CALIB (exit) " exit 0 fi echo " see the file CALIBRATION.txt for details of its use" eval "$CALIB -s $paper --test | $BINDIR/$DRIVER $OPTS -v $printer $cfg --fd \ - - > $port" ;; esac echo " *** Do you wish to print a color-ink head-cleaning page ? [Y | N] (N):" read response case $response in y | Y | yes | Yes ) if ! [ -f $BINDIR/$CALIB ] ; then echo "*** Error: $BINDIR/$CALIB was not found" echo " is it correctly installed?" exit 0 fi if ! $(eval "which $CALIB | grep -e $BINDIR/$CALIB >/dev/null" ) ; then echo "*** WARNING: the calibration program $CALIB found in your path " echo " is not $BINDIR/$CALIB; \"which $CALIB\" reports:" which $CALIB echo " move or delete this other copy of $CALIB (exit) " exit 0 fi echo " see the file CALIBRATION.txt for details of its use" eval "$CALIB -s $paper --clean | $BINDIR/$DRIVER $OPTS -v $printer $cfg -p \ - - > $port" ;; esac echo " *** Do you wish to print a black-ink head-cleaning page ? [Y | N] (N):" read response case $response in y | Y | yes | Yes ) if ! [ -f $BINDIR/$CALIB ] ; then echo "*** Error: $BINDIR/$CALIB was not found" echo " is it correctly installed?" exit 0 fi if ! $(eval "which $CALIB | grep -e $BINDIR/$CALIB >/dev/null" ) ; then echo "*** WARNING: the calibration program $CALIB found in your path " echo " is not $BINDIR/$CALIB; \"which $CALIB\" reports:" which $CALIB echo " move or delete this other copy of $CALIB (exit) " exit 0 fi echo " see the file CALIBRATION.txt for details of its use" eval "$CALIB -s $paper --clean | $BINDIR/$DRIVER $OPTS -v $printer $cfg --bw \ - - > $port" ;; esac pnm2ppa-1.13/rhs-printfilters/0000777000076400007640000000000011313235643013350 500000000000000pnm2ppa-1.13/rhs-printfilters/README.ppa0000644000076400007640000000506207162177340014734 00000000000000 ********************************************** The updates here are scheduled for future inclusion in: rhs-printfilters-1.72 ********************************************** (1) If you have a printtool < 3.44 system (Red Hat 6.1 or earlier, Mandrake 7.0 or earlier) just get the updated RPMS rhs-printfilters-1.57-4ppa4.i386.rpm (for Red Hat) rhs-printfilters-1.58-4ppa5mdk.i386.rpm (for Mandrake) from http://sourceforge.net/projects/pnm2ppa . (For older Red Hat or Mandrake systems, you may need to rebuild the source RPMs.) These RPMS already incorporate the changes described here, so just install the appropriate one. ------------------ (2) If you have printtool 3.44 or greater, but rhs-printfilters >= 1.61 and < 1.72 (Red Hat 6.2, Mandrake 7.1) you may wish to manually update the files /usr/lib/rhs/rhs-printfilters/printerdb /usr/lib/rhs/rhs-printfilters/ppaprint as described here. This will provide improved functionality of pnm2ppa configuration using printtool. (3) Future releases of Red Hat or Mandrake will probably include rhs-printfilters >= 1.72, so these changes will already be made. ================================================================= Instructions. (Red Hat 6.2, Mandrake 7.1) (a) replace /usr/lib/rhs/rhs-printfilters/ppaprint . (as root:) cd /usr/lib/rhs/rhs-printfilters copy ppaprint-latest and printerdb-ppa to this directory, if necessary. (if you installed pnm2ppa-1.0 from a RPM they should be there already). mv ppaprint ppaprint-old mv ppaprint-latest ppaprint chmod 0755 ppaprint (b) update printerdb. Save your current printerdb: cp printerdb printerdb-saved Now edit printerdb to replace the PPA printer entries with the updated ones from printerdb-ppa. Use your favorite editor to cut out the older PPA printer entries from printerdb, and paste in the contents of printerdb-ppa in their place. **TIP: for this to work, the PPA Printer entries in your old printerdb must say "GSDriver: ppa" and *NOT* "GSDriver: pnmraw" (which is an older printerdb style meant for printtool < 3.44). "ppa" is not a true GS driver name, but a dummy device name added to the list of available drivers by printtool >= 3.44 after it has detected that pnm2ppa is installed. ------- Note that these manually-made changes may be lost whenever the rhs-printfilters rpm is updated using the rpm utility. Eventually, they will be incorporated in newer "official" releases of rhs-printfilters-1.72 or above, as they are released. pnm2ppa-1.13/rhs-printfilters/ppaprint0000755000076400007640000000773707204420653015066 00000000000000#!/bin/sh # ppaprint v2.12 July 7, 2000 # # make pnm2ppa (or pbm2ppa) command line for postprocessing to produce PPA # output for HP's PPA printers (DeskJet 710, 720, 820, 1000 series). # # Duncan Haldane, the pnm2ppa project, # see also http://sourceforge.net/projects/pnm2ppa # BINDIR=/usr/bin CONFIG_DIR=/etc PPA_CONFIG=$1 PAPERSIZE=$2 RESOLUTION=$3 EXTRA_GS_OPTIONS=$@ for arg in $1 $2 $3 ; do EXTRA_GS_OPTIONS=$(echo "${EXTRA_GS_OPTIONS}" | eval "sed -e 's/^.*$arg//'") done if ! [ "$RESOLUTION" = "600x600" ] ; then echo "Error - ppaprint: unsupported RESOLUTION=$RESOLUTION" exit 1 fi # extract any extra PPA options from $EXTRA_GS_OPTIONS: # format is $EXTRA_GS_OPTIONS= "(gs_options)PPA(ppa_options)" EXTRA_PPA_OPTIONS="" if echo $EXTRA_GS_OPTIONS | grep -e "PPA" >/dev/null 2>&1 ; then EXTRA_PPA_OPTIONS=$EXTRA_GS_OPTIONS EXTRA_GS_OPTIONS=$(echo "${EXTRA_GS_OPTIONS}" | sed -e 's/PPA.*$//' ) EXTRA_PPA_OPTIONS=$(echo "${EXTRA_PPA_OPTIONS}" | sed -e 's/^.*PPA//') fi # identify paper size if [ "$PAPERSIZE" = "letter" ]; then PPA_PAPERSIZE="-s letter" elif [ "$PAPERSIZE" = "a4" ]; then PPA_PAPERSIZE="-s a4" elif [ "$PAPERSIZE" = "legal" ]; then PPA_PAPERSIZE="-s legal" else PPA_PAPERSIZE="-s letter" fi # identify printer type # (at present, a type 710 is treated as a type 720 in printerdb) if echo $PPA_CONFIG | grep -e "ppa710" > /dev/null 2>&1 ; then PPA_PRINTER="-v 710" elif echo $PPA_CONFIG | grep -e "ppa720" > /dev/null 2>&1 ; then PPA_PRINTER="-v 720" elif echo $PPA_CONFIG | grep -e "ppa820" > /dev/null 2>&1 ; then PPA_PRINTER="-v 820" elif echo $PPA_CONFIG | grep -e "ppa1000" > /dev/null 2>&1 ; then PPA_PRINTER="-v 1000" fi PPA_OPTIONS="$PPA_PAPERSIZE $EXTRA_PPA_OPTIONS" if echo $PPA_CONFIG | grep -e "pbm" >/dev/null 2>&1 ; then # use the old pbm2ppa Black-and-White-only driver # first check that old pbm2ppa driver is installed if ! $BINDIR/pbm2ppa -h > /dev/null 2>&1 ; then echo "Error - ppaprint: pbm2ppa driver was not found" exit 1 fi # assemble the pbm2ppa command line: GSDEVICE=pbmraw PPA_CONF="$CONFIG_DIR/pbm2ppa.conf" if [ -f $PPA_CONF ] ; then PPA_CONF="-f $PPA_CONF" else PPA_CONF="" fi PPA_OPTIONS="$PPA_PRINTER $PPA_CONF $PPA_OPTIONS" PPA="$BINDIR/pbm2ppa $PPA_OPTIONS - - " else # use the new pnm2ppa driver with color support # first check that new pnm2ppa driver is installed if ! $BINDIR/pnm2ppa -h > /dev/null 2>&1 ; then echo "Error - ppaprint: pnm2ppa driver was not found" exit 1 fi # papersize is no longer needed by pnm2ppa >= 0.99 # (the papersize is now taken from the pnm input file header). PPA_PAPERSIZE="" # all pnm formats are now supported by pnm2ppa >= 0.99 # -- use ppmraw for color-enabled printing # -- use pbmraw in --bw black and white modes. # identify color option if echo $PPA_CONFIG | grep -e "ppa.*0b1" > /dev/null 2>&1 ; then GSDEVICE=pbmraw PPA_COLOR="--bw --eco" elif echo $PPA_CONFIG | grep -e "ppa.*0b2" > /dev/null 2>&1 ; then GSDEVICE=pbmraw PPA_COLOR="--bw" elif echo $PPA_CONFIG | grep -e "ppa.*0c1" > /dev/null 2>&1 ; then GSDEVICE=ppmraw PPA_COLOR="--eco --fd" elif echo $PPA_CONFIG | grep -e "ppa.*0c2" > /dev/null 2>&1 ; then GSDEVICE=ppmraw PPA_COLOR="-p --eco" elif echo $PPA_CONFIG | grep -e "ppa.*0c3" > /dev/null 2>&1 ; then GSDEVICE=ppmraw PPA_COLOR="" elif echo $PPA_CONFIG | grep -e "ppa.*0c4" > /dev/null 2>&1 ; then GSDEVICE=ppmraw PPA_COLOR="-p --uni" elif echo $PPA_CONFIG | grep -e "ppa.*0c5" > /dev/null 2>&1 ; then GSDEVICE=ppmraw PPA_COLOR="--eco" fi # assemble the pnm2ppa command line: PPA_CONF="$CONFIG_DIR/pnm2ppa.conf" if [ -f $PPA_CONF ] ; then PPA_CONF="-f $PPA_CONF" else PPA_CONF="" fi PPA_OPTIONS="$PPA_PRINTER $PPA_CONF $PPA_COLOR $PPA_OPTIONS" PPA="$BINDIR/pnm2ppa $PPA_OPTIONS -i - -o - " fi echo "-sDEVICE=$GSDEVICE $EXTRA_GS_OPTIONS - | $PPA " exit 0 pnm2ppa-1.13/rhs-printfilters/printerdb-ppa0000644000076400007640000001255307204420653015765 00000000000000 # # this is for the pnm2ppa driver for the HP DeskJet PPA (720) # StartEntry: HP DeskJet 720 GSDriver: ppa # to use with rhs-printfilters < 1.62 and printtool < 3.44 # comment out the above line and uncomment the line below # GSDriver: pnmraw Description: {HP DeskJet 710/720 series (PPA)} About: { \ IMPORTANT: Do *NOT* check \ the "Fast text printing (non-PS printers only)" box. \ \ These drivers are for DeskJet 710C, 712C, 720C, 722C printers \ which use HP's proprietary PPA protocol instead of PCL. \ Postscript images are converted by ghostscript into \ "Portable PixMap" (color) or "Portable BitMap" (black) formats \ and then converted to PPA instructions by the pnm2ppa \ post-processor. \ (The older black-only pbm2ppa post-processor is also \ provided as a legacy alternative.) \ You may add PPA processor options \ after a "PPA" separator in the "extra GS options" box,\ in the format: " gs_options PPA ppa_options "; \ type "pnm2ppa -h" or "pbm2ppa -h" to list the options. \ \ The primary site for the PPA driver is the pnm2ppa \ project at http://sourceforge.net/projects/pnm2ppa .\ } Resolution: {600} {600} {} BitsPerPixel: {ppa720b1} {Black and white, econofast mode} BitsPerPixel: {ppa720b2} {Black and white, normal quality} BitsPerPixel: {ppa720c1} {Color, econofast mode} BitsPerPixel: {ppa720c5} {Color, normal quality} BitsPerPixel: {ppa720c3} {Color, high quality} BitsPerPixel: {ppa720c2} {Color, normal quality, black ink disabled} BitsPerPixel: {ppa720c4} {Color, high quality, black ink disabled} BitsPerPixel: {ppa720pbm} {Black and white, legacy pbm2ppa driver} EndEntry # # this is for the pnm2ppa driver for the HP DeskJet PPA (820) # StartEntry: HP DeskJet 820 GSDriver: ppa # to use with rhs-printfilters < 1.62 and printtool < 3.44 # comment out the above line and uncomment the line below # GSDriver: pnmraw Description: {HP DeskJet 820 series (PPA)} About: { \ IMPORTANT: Do *NOT* check \ the "Fast text printing (non-PS printers only)" box. \ \ This driver is for HP 820Cse, 820Cxi printers \ which use HP's proprietary PPA protocol instead of PCL. \ Postscript images are converted by ghostscript into \ "Portable PixMap" (color) or "Portable BitMap" (black) formats \ and then converted to PPA instructions by the pnm2ppa \ post-processor. \ (The older black-only pbm2ppa post-processor is also \ provided as a legacy alternative.) \ You may add PPA processor options \ after a "PPA" separator in the "extra GS options" box,\ in the format: " gs_options PPA ppa_options "; \ type "pnm2ppa -h" or "pbm2ppa -h" to list the options. \ \ The primary site for the PPA driver is the pnm2ppa \ project at http://sourceforge.net/projects/pnm2ppa .\ } Resolution: {600} {600} {} BitsPerPixel: {ppa820b1} {Black and white, econofast mode} BitsPerPixel: {ppa820b2} {Black and white, normal quality} BitsPerPixel: {ppa820c1} {Color, econofast mode} BitsPerPixel: {ppa820c5} {Color, normal quality} BitsPerPixel: {ppa820c3} {Color, high quality} BitsPerPixel: {ppa820c2} {Color, normal quality, black ink disabled} BitsPerPixel: {ppa820c4} {Color, high quality, black ink disabled} BitsPerPixel: {ppa820pbm} {Black and white, legacy pbm2ppa driver} EndEntry # # this is for the pnm2ppa driver for the HP DeskJet PPA (1000) # StartEntry: HP DeskJet 1000 GSDriver: ppa # to use with rhs-printfilters < 1.62 and printtool < 3.44 # comment out the above line and uncomment the line below # GSDriver: pnmraw Description: {HP DeskJet 1000 series (PPA)} About: { \ IMPORTANT: Do *NOT* check \ the "Fast text printing (non-PS printers only)" box. \ \ This driver is for HP 1000Cse, 1000Cxi printers \ which use HP's proprietary PPA protocol instead of PCL. \ Postscript images are converted by ghostscript into \ "Portable PixMap" (color) or "Portable BitMap" (black) formats \ and then converted to PPA instructions by the pnm2ppa \ post-processor. \ (The older black-only pbm2ppa post-processor is also \ provided as a legacy alternative.) \ You may add PPA processor options \ after a "PPA" separator in the "extra GS options" box,\ in the format: " gs_options PPA ppa_options "; \ type "pnm2ppa -h" or "pbm2ppa -h" to list the options. \ \ The primary site for the PPA driver is the pnm2ppa \ project at http://sourceforge.net/projects/pnm2ppa .\ } Resolution: {600} {600} {} BitsPerPixel: {ppa1000b1} {Black and white, econofast mode} BitsPerPixel: {ppa1000b2} {Black and white, normal quality} BitsPerPixel: {ppa1000c1} {Color, econofast mode} BitsPerPixel: {ppa1000c5} {Color, normal quality} BitsPerPixel: {ppa1000c3} {Color, high quality} BitsPerPixel: {ppa1000c2} {Color, normal quality, black ink disabled} BitsPerPixel: {ppa1000c4} {Color, high quality, black ink disabled} BitsPerPixel: {ppa1000pbm} {Black and white, legacy pbm2ppa driver} EndEntry pnm2ppa-1.13/rhs-printfilters/ps-to-printer.fpi0000755000076400007640000000764107050545620016524 00000000000000#!/bin/sh # # convert ps to the format required by the printer on this queue # # if the printer is a PostScript printer, just cat it through # if the printer uses ghostscript, we'll run it now # if the printer is neither, we die (with good message to someone) # # location of the ppaprint script FPIDIR=/usr/lib/rhs/rhs-printfilters/ # # read in PostScript configuration settings # source ${SPOOLDIR}/postscript.cfg # # see if we should reverse order # # support will be added for this in the future # psorder needed and is part of netatalk, which we dont currently ship # if [ "$PAPERSIZE" = "letter" ]; then mpage_paper="Letter" elif [ "$PAPERSIZE" = "a4" ]; then mpage_paper="A4" elif [ "$PAPERSIZE" = "legal" ]; then mpage_paper="Legal" else mpage_paper="Letter" fi # # weird case - some PS doesnt get handled by mpage well # so we allow nup=1 to just cat PS to printer w/o mpage interferring # if [ "$NUP" = "1" ]; then border="-o" mpage_cmd="cat -" else border="" mpage_cmd="mpage -b$mpage_paper $border -$NUP -m${RTLFTMAR}lr -m${TOPBOTMAR}tb" fi # # if the driver is # "POSTSCRIPT" it means the printer handles Postscript natively, # no need to run gs. # "TEXT" it means the printer cannot handle PS input # "uniprint" use the driver set by COLOR in postscript.cfg # "ppa" use the driver and postprocessor returned by ppaprint if [ "$GSDEVICE" = "POSTSCRIPT" ]; then eval $mpage_cmd elif [ "$GSDEVICE" = "TEXT" ]; then echo "Error - ps-to-printer.fpi - this printer cannot print postscript" echo " and ghostscript does not have support" exit 1 # # We're using ghostscript with "uniprint" command line style, # $COLOR holds filename of driver parameters (filename.upp) # Since real driver name is stored in *.upp files, this style can # activate traditional drivers provided you create corresponding # *.upp files, entry to printdb, and compile ghostscript with uniprint. # ( Without compiling uniprint in ghostscript, this script will filter # out all uniprint entries in printdb including fake ones for # traditional drivers ) # elif [ "$GSDEVICE" = "uniprint" ]; then # Set default *.upp driver (your default printer upp driver here) if [ "$COLOR" = "" ]; then COLOR="stcany" echo "No filename for parameters given. Assume $COLOR." fi # eval "$mpage_cmd | gs -q @$COLOR.upp \ -sPAPERSIZE=$PAPERSIZE \ -sOutputFile=- \ $EXTRA_GS_OPTIONS \ -" # support for HP DeskJet PPA printers (710, 720, 820, 1000 series). # assemble the PPA postprocessor command line using the ppaprint script. # GSDEVICE is selected from among the pnm devices. # $EXTRA_GS_OPTIONS is processed to remove PPA options. # PPA configuration is encoded in $COLOR # (use the GSDEVICE=ppa test when Red Hat have modified printtool # to recognise printerdb entries with GSDEVICE=ppa ....) #elif [ "$GSDEVICE" = "ppa" ]; then # (until then, test $COLOR instead ....) elif echo $COLOR | grep -e "ppa" > /dev/null 2>&1 ; then PPA=$FPIDIR/ppaprint PPA_CMD=$(eval "$PPA $COLOR $PAPERSIZE $RESOLUTION $EXTRA_GS_OPTIONS ") if ! echo $PPA_CMD | grep -e "Error" > /dev/null 2>&1 ; then eval "$mpage_cmd | sed \"s/[(]%%.*%%[)].*flush//g\" | \ gs -q \ -r$RESOLUTION \ -sPAPERSIZE=$PAPERSIZE \ -dNOPAUSE \ -dSAFER \ -sOutputFile=- \ $PPA_CMD" else echo "Error - ps-to-printer.fpi - PPA postprocessor error:" echo $PPA_CMD exit 1 fi else # We're using ghostscript in traditional manner eval "$mpage_cmd | sed \"s/[(]%%.*%%[)].*flush//g\" | \ gs -q -sDEVICE=$GSDEVICE \ -r$RESOLUTION \ -sPAPERSIZE=$PAPERSIZE \ -dNOPAUSE \ -dSAFER \ -sOutputFile=- \ $COLOR \ $EXTRA_GS_OPTIONS \ -" fi # # # see if we need to send a form feed to eject the page from printer # if [ "$PS_SEND_EOF" = "YES" ]; then printf "\004" fi exit 0 pnm2ppa-1.13/rpm/0000777000076400007640000000000011313235643010627 500000000000000pnm2ppa-1.13/rpm/redhat/0000777000076400007640000000000011313235643012076 500000000000000pnm2ppa-1.13/rpm/redhat/pnm2ppa-redhat.patch0000644000076400007640000000244007563304142015660 00000000000000diff -uNr pnm2ppa-1.11/Makefile pnm2ppa-1.11-redhat/Makefile --- pnm2ppa-1.11/Makefile Sat Oct 5 21:27:36 2002 +++ pnm2ppa-1.11-redhat/Makefile Sat Nov 9 17:08:45 2002 @@ -11,7 +11,7 @@ #compiler and linker options: CC=gcc -CFLAGS=-Wall -pedantic -O2 +CFLAGS=$(RPM_OPT_FLAGS) LDFLAGS=-lm INSTALL=install diff -uNr pnm2ppa-1.11/pnm2ppa.conf pnm2ppa-1.11-redhat/pnm2ppa.conf --- pnm2ppa-1.11/pnm2ppa.conf Sat Nov 9 16:47:47 2002 +++ pnm2ppa-1.11-redhat/pnm2ppa.conf Sat Nov 9 17:11:20 2002 @@ -15,7 +15,7 @@ # will be used. The printer version can also be set with the command line # option e.g., "-v 720". -version 0 # REMOVE THIS ENTRY to make 720 the default printer model!!! +#version 0 # REMOVE THIS ENTRY to make 720 the default printer model!!! #version 720 # 710, 712, 722 also acceptable #version 820 #version 1000 @@ -41,7 +41,7 @@ # (Informational messages will still always be sent to stderr in "verbose" # mode, even if log_info is not set.) -log_info 1 # <= COMMENT THIS OUT TO GET THE NEW DEFAULT BEHAVIOR! +#log_info 1 # <= UNCOMMENT THIS TO GET THE OLD (pre v1.11) BEHAVIOR! # Note: the "silent 1" and "log_info" keywords are only accepted from the # system configuration file (/etc/pnm2ppa.conf), and not from configuration pnm2ppa-1.13/rpm/redhat/pnm2ppa.spec0000644000076400007640000000705007563304142014250 00000000000000%define _mandir /usr/share/man Name: pnm2ppa Summary: Drivers for printing to HP PPA printers Serial: 1 Obsoletes: ppa Version: 1.11 Release: 1rh7x URL: http://sourceforge.net/projects/pnm2ppa Source: http://download.sourceforge.net/pnm2ppa/pnm2ppa-%{version}.tar.gz Patch3: pnm2ppa-redhat.patch Copyright: GPL Group: Applications/Publishing Buildroot: /var/tmp/pnm2ppa-buildroot %define topdir pnm2ppa-%{version} %description pnm2ppa is a color driver for HP PPA host-based printers such as the HP710C, 712C, 720C, 722C, 820Cse, 820Cxi, 1000Cse, and 1000Cxi. It accepts ghostscript output in PNM formats, and sends it to the printer in PPA format. Install pnm2ppa if you have a PPA printer and need to print. For further information, see the pnm2ppa project homepage at http://sourceforge.net/projects/pnm2ppa . %prep rm -rf $RPM_BUILD_ROOT %setup -q -n %{topdir} %patch3 -p1 -b .rh %build make %install install -d $RPM_BUILD_ROOT/usr/bin install -d $RPM_BUILD_ROOT/etc install -d $RPM_BUILD_ROOT%{_mandir}/man1 make BINDIR=$RPM_BUILD_ROOT/usr/bin CONFDIR=$RPM_BUILD_ROOT/etc \ MANDIR=$RPM_BUILD_ROOT%{_mandir}/man1 install install -m 0755 utils/Linux/detect_ppa $RPM_BUILD_ROOT/usr/bin/ install -m 0755 utils/Linux/test_ppa $RPM_BUILD_ROOT/usr/bin/ chmod 644 docs/en/LICENSE #---omit this section from Official RedHat/Mandrake releases!-------------- install -d $RPM_BUILD_ROOT/usr/lib/rhs/rhs-printfilters install -m 0755 rhs-printfilters/ppaprint $RPM_BUILD_ROOT/usr/lib/rhs/rhs-printfilters/ppaprint-latest install -m 0644 rhs-printfilters/printerdb-ppa $RPM_BUILD_ROOT/usr/lib/rhs/rhs-printfilters install -m 0644 rhs-printfilters/README.ppa $RPM_BUILD_ROOT/usr/lib/rhs/rhs-printfilters #------------------------------------------------- %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root) %doc docs/en/CREDITS docs/en/INSTALL docs/en/LICENSE docs/en/README %doc docs/en/RELEASE-NOTES docs/en/TODO %doc docs/en/INSTALL.REDHAT.txt docs/en/COLOR.txt docs/en/CALIBRATION.txt %doc docs/en/INSTALL.REDHAT.html docs/en/COLOR.html docs/en/CALIBRATION.html %doc docs/en/PPA_networking* %doc test.ps /usr/bin/pnm2ppa /usr/bin/calibrate_ppa /usr/bin/test_ppa /usr/bin/detect_ppa %{_mandir}/man1/pnm2ppa.1* %config /etc/pnm2ppa.conf #---omit from RedHat-------------------- #%doc docs/en/INSTALL.MANDRAKE.html docs/en/INSTALL.MANDRAKE.txt #------omit from Official RedHat/Mandrake releases! #/usr/lib/rhs/rhs-printfilters/ppaprint-latest #/usr/lib/rhs/rhs-printfilters/printerdb-ppa #/usr/lib/rhs/rhs-printfilters/README.ppa #----------------------------------------- %changelog * Sat Oct 9 2002 Duncan Haldane - 1.11 release * Thu Jun 27 2002 Duncan Haldane - removed pbm2ppa for 1.10 (pre) release * Mon Jun 11 2002 Duncan Haldane - updated for 1.10 (pre) release. * Tue Nov 24 2000 Duncan Haldane - updated for 1.04 release. * Tue Oct 24 2000 Duncan Haldane - updated for 1.01 release; calibrate renamed to calibrate_ppa. * Tue Jul 11 2000 Duncan Haldane - updated for 1.0 release. * Sun Apr 09 2000 - added optional updated rhs-printfilter files * Thu Feb 10 2000 Bill Nottingham - adopt upstream package * Sun Feb 6 2000 - new pnm2ppa release, and add pbm2ppa driver. * Thu Jan 7 2000 - created rpm pnm2ppa-1.13/make_hash_ink.c0000644000076400007640000002637711310765657012723 00000000000000/***************************************************************** make_hash_ink.h -generate hashed version of palette.h data ----------------- begin : Tue Jan 24 2000 copyright : (C) 2000 by the pmn2ppa project author : Klamer Schutte email : Schutte@fel.tno.nl ******************************************************************/ /*************************************************************************** * * * 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. * * * ***************************************************************************/ #ifdef HAVE_CONFIG_H # include "config.h" #endif #include #include #include #include "palette.h" #include "hash_ink.h" #define SHIFTED (1 << (shift)) #define NOTSHIFTED (1 << (8 - shift)) #define ENTRIES_ARR (NOTSHIFTED * NOTSHIFTED * NOTSHIFTED) int MaxPass; struct entry { int xyz; union { int entry_nr; struct hash_ink *hi; } u; struct entry *next; /* this list is sorted on xyz; lowest xyz first */ }; struct entry_list { struct entry *entries; int num_entries; struct entry_list *next; /* this list is sorted in num_entries; lowest numbers first */ } *start_list = 0; inline int calc_xyz( struct hash_ink *hi ) { /* if these assertions fail the result is not unique */ assert(hi->x < (1 << 3)); assert(hi->y < (1 << 3)); return hi->x + (hi->y << 3) + (hi->z << 6); } int add_entry2( struct entry *e, int n, struct entry **ptr_to ) { struct entry_list *cel, **prev_ptr, *new_el; struct entry *ce1, *ce2; static int this_entry = 0; int next_entry; assert(n > 0); prev_ptr = &start_list; for(cel = start_list; cel != 0; prev_ptr = &(cel->next), cel = cel->next) { if (cel->num_entries < n) continue; if (cel->num_entries > n) break; for(ce1 = cel->entries, ce2 = e; ce1 != 0; ce1 = ce1->next, ce2 = ce2->next) { assert(ce2 != 0); if (ce1->xyz != ce2->xyz) goto next_cel; } /* OK, we have found the correct entry. Delete set *e, and return the entry number */ for(ce1 = e; ce1 != 0; ce1 = ce2) { ce2 = ce1->next; free(ce1); } if (ptr_to != 0) *ptr_to = cel->entries; return cel->entries->u.entry_nr; next_cel: ; } /* Hmmm. The set e is not found. Add the first item to the set, and recursively attempt it for its tail... */ new_el = (struct entry_list *) malloc(sizeof(struct entry_list)); /* printf(" New el %x assigned to %x\n", new_el, prev_ptr); */ *prev_ptr = new_el; new_el->entries = e; new_el->num_entries = n; /* printf("new el next = %x\n", cel); */ new_el->next = cel; if (e->next != 0) next_entry = add_entry2( e->next, n-1, &(e->next)); else next_entry = -1; printf("\t/* %d */\t{ { %d, %d, %d}, %d, %d, %d, ", this_entry, e->u.hi->data[0], e->u.hi->data[1], e->u.hi->data[2], e->u.hi->x, e->u.hi->y, e->u.hi->z ); if (next_entry == -1) printf("0 },\n"); else printf("&entries%d[%d] },\n", MaxPass, next_entry); e->u.entry_nr = this_entry++; if (ptr_to != 0) *ptr_to = e; return e->u.entry_nr; } int add_entry( struct hash_ink *hi ) { /* First, convert the hash_ink set to a entry set Second, check start_list if it is contained (done in add_entry2()) If contained: return the entry number Else: add to start_list */ struct entry *first = 0, *cur, *loop, **prev_ptr; struct hash_ink *chi; int res; int n = 0; /* n == number of entries in this set */ for(chi = hi; chi != 0; chi = chi->next) { n++; cur = (struct entry *) malloc( sizeof(struct entry) ); cur->xyz = calc_xyz( chi ); cur->u.hi = chi; prev_ptr = &first; for(loop = first; loop != 0; loop = loop->next) { if (loop->xyz >= cur->xyz) { cur->next = loop; *prev_ptr = cur; break; } prev_ptr = &(loop->next); } if (loop == 0) { cur->next = 0; *prev_ptr = cur; } } res = add_entry2( first, n, 0 ); for(chi = hi; chi != 0; ) { struct hash_ink *nhi = chi->next; free(chi); chi = nhi; } return res; } int main(int argc, char *argv[] ) { /* int MaxPass; */ int x, y, z, r, g, b; int ra, ga, ba, rd, gd, bd; float dmin = -1, dmax = -1, d1; struct hash_ink /* **arr, */ *first, *prev, *cur; int i, n; int shift; int *entries_arr; if (argc != 3) fprintf(stderr, "Usage: %s MaxPass shift >> hash_ink.c\n", argv[0]); MaxPass = atoi(argv[1]); shift = atoi(argv[2]); /* arr = (struct hash_ink **) malloc( sizeof(struct hash_ink*) * ENTRIES_ARR ); for(i = 0; i < ENTRIES_ARR; i++) arr[i] = 0; */ entries_arr = (int *) malloc(sizeof(int) * ENTRIES_ARR); for(i = 0; i < ENTRIES_ARR; i++) entries_arr[i] = -1; printf("/* generated by %s %s %s */\n\n", argv[0], argv[1], argv[2] ); printf("#include \"hash_ink.h\"\n\n"); printf("int shift%d = %d;\n\n", MaxPass, shift); printf("static struct hash_ink entries%d[] = {\n", MaxPass); i = 0; for(r=0; r < 256; r += SHIFTED) for(g=0; g < 256; g += SHIFTED) for(b=0; b < 256; b += SHIFTED) { int rr = r >> shift; int gg = g >> shift; int bb = b >> shift; int h = (rr << (16 - shift * 2)) + (gg << (8-shift)) + bb; /* fprintf(stderr, "%d %d %d -> %d %d %d -> %d\n", r, g, b, rr, gg, bb, h );*/ first = (struct hash_ink *) malloc( sizeof(struct hash_ink)); /* arr[h]->x = i++; */ cur = first; cur->next = 0; /* Now, calculate the dmin for hash entry h. Fill in *first with minimal values */ dmin = -1; for(ra = 0; ra < SHIFTED; ra+=(SHIFTED-1)) for(ga = 0; ga < SHIFTED; ga += (SHIFTED-1)) for(ba = 0; ba < SHIFTED; ba += (SHIFTED -1)) { int R = r + ra; int G = g + ga; int B = b + ba; int new_dmin = 0; for (z = 0; z < MaxPass + 1; z++) for (x = 0; x < MaxPass + 1; x++) for (y = 0; y < MaxPass + 1; y++) if (! (((x == 4) && (y > 2) && (z > 2)) || ((y == 4) && (x > 2) && (z > 2)) || ((z == 4) && (y > 2) && (x > 2)))) { rd = (int) R - (int) hp_pal[4 - x][4 - y][4 - z] [0]; gd = (int) G - (int) hp_pal[4 - x][4 - y][4 - z] [1]; bd = (int) B - (int) hp_pal[4 - x][4 - y][4 - z] [2]; d1 = /* 0.5 * */ rd * rd + gd * gd + bd * bd; if ((dmin < 0) || (d1 < dmin)) { /* fprintf(stderr, "Found min %f, %d, %d, %d (%f, %d, %d %d)\n", d1, x, y, z, dmin, cur->x, cur->y, cur->z); */ cur->data[0] = hp_pal[4 - x][4 - y][4 - z][0]; cur->data[1] = hp_pal[4 - x][4 - y][4 - z][1]; cur->data[2] = hp_pal[4 - x][4 - y][4 - z][2]; cur->x = x; cur->y = y; cur->z = z; dmin = d1; new_dmin = 1; } } } /* Now, calculate the dmax for hash entry h. Fill in *first with minimal values */ dmax = -1; for(ra = 0; ra < SHIFTED; ra+=(SHIFTED-1)) for(ga = 0; ga < SHIFTED; ga += (SHIFTED-1)) for(ba = 0; ba < SHIFTED; ba += (SHIFTED-1)) { int R = r + ra; int G = g + ga; int B = b + ba; z = cur->z; y = cur->y; x = cur->x; { rd = (int) R - (int) hp_pal[4 - x][4 - y][4 - z] [0]; gd = (int) G - (int) hp_pal[4 - x][4 - y][4 - z] [1]; bd = (int) B - (int) hp_pal[4 - x][4 - y][4 - z] [2]; d1 = /* 0.5 * */ rd * rd + gd * gd + bd * bd; if (d1 > dmax) { /* fprintf(stderr, "Found max %f, %d, %d, %d (%f, %f)\n", d1, x, y, z, dmax, dmin); */ cur->data[0] = hp_pal[4 - x][4 - y][4 - z][0]; cur->data[1] = hp_pal[4 - x][4 - y][4 - z][1]; cur->data[2] = hp_pal[4 - x][4 - y][4 - z][2]; cur->x = x; cur->y = y; cur->z = z; dmax = d1; } } } /* Now, for every {x,y,z} for which d1 is smaller then dmax add this entry to the *first (as a linked list!) */ prev = cur; n = 0; for (z = 0; z < MaxPass + 1; z++) for (x = 0; x < MaxPass + 1; x++) for (y = 0; y < MaxPass + 1; y++) { if (! (((x == 4) && (y > 2) && (z > 2)) || ((y == 4) && (x > 2) && (z > 2)) || ((z == 4) && (y > 2) && (x > 2)))) { for(ra = 0; ra < SHIFTED; ra+=(SHIFTED-1)) for(ga = 0; ga < SHIFTED; ga += (SHIFTED-1)) for(ba = 0; ba < SHIFTED; ba += (SHIFTED-1)) { int R = r + ra; int G = g + ga; int B = b + ba; rd = (int) R - (int) hp_pal[4 - x][4 - y][4 - z] [0]; gd = (int) G - (int) hp_pal[4 - x][4 - y][4 - z] [1]; bd = (int) B - (int) hp_pal[4 - x][4 - y][4 - z] [2]; d1 = /* 0.5 * */ rd * rd + gd * gd + bd * bd; if ((d1 < dmax) && (!((x == first->x) && (y == first->y) && (z == first->z)))) { struct hash_ink *cur = (struct hash_ink *) malloc( sizeof(struct hash_ink) ); prev->next = cur; cur->next = 0; prev = cur; /* fprintf(stderr, "Added min %f, %d, %d, %d (%f, %f, %d, %d %d)\n", d1, x, y, z, dmin, dmax, first->x, first->y, first->z); */ cur->data[0] = hp_pal[4 - x][4 - y][4 - z][0]; cur->data[1] = hp_pal[4 - x][4 - y][4 - z][1]; cur->data[2] = hp_pal[4 - x][4 - y][4 - z][2]; cur->x = x; cur->y = y; cur->z = z; n++; goto next_xyz; /* break out of ra gb ba loops */ } } } next_xyz: ; } /* fprintf(stderr, "%d %d %d (%d): found %d %d %d (%d,%d,%d) (%f, %f) * %d\n", r, g, b, h, first->x, first->y, first->z, first->data[0], first->data[1], first->data[2], dmin, dmax, n ); */ entries_arr[h] = add_entry(first); } #ifdef notdef printf("#include \"hash_ink.h\"\n\n"); printf("int shift%d = %d;\n\n", MaxPass, shift); printf("static struct hash_ink entries%d[] = {\n", MaxPass); n = 0; for(i = 0; i < ENTRIES_ARR; i++) { printf("\t{ {%d, %d, %d}, %d, %d, %d, ", arr[i]->data[0], arr[i]->data[1], arr[i]->data[2], arr[i]->x, arr[i]->y, arr[i]->z ); n++; cur = arr[i]->next; while( cur != 0 ) { printf(" &entries%d[%d] },\n", MaxPass, n); printf("\t\t{ { %d, %d, %d} , %d, %d, %d, ", cur->data[0], cur->data[1], cur->data[2], cur->x, cur->y, cur->z ); n++; cur = cur->next; } printf(" 0 },\n"); } #endif printf("};\n\n"); printf("struct hash_ink *arr_max%d[] = {", MaxPass); n = 0; for(i = 0; i < ENTRIES_ARR; i++) { printf("\t&entries%d[%d], \n", MaxPass, entries_arr[i]); #ifdef notdef n++; cur = arr[i]->next; while( cur != 0) { n++; cur = cur->next; } #endif } printf("};\n\n/* end of file generated by %s %s %s (%d entries) */\n\n", argv[0], argv[1], argv[2], n); return 0; } pnm2ppa-1.13/ppa_protocol/0000777000076400007640000000000011313235740012530 500000000000000pnm2ppa-1.13/ppa_protocol/Makefile.am0000644000076400007640000000030211310765657014507 00000000000000bin_PROGRAMS = \ parse_vlink parse_vlink_SOURCES = \ parse_vlink.c EXTRA_DIST = \ protocol.html \ scp_720.html \ scp_820cse.html \ sweep_data.html MAINTAINERCLEANFILES = \ Makefile.in pnm2ppa-1.13/ppa_protocol/Makefile.in0000644000076400007640000003144011313235716014516 00000000000000# Makefile.in generated by automake 1.10 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = parse_vlink$(EXEEXT) subdir = ppa_protocol DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/config.h CONFIG_CLEAN_FILES = am__installdirs = "$(DESTDIR)$(bindir)" binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) PROGRAMS = $(bin_PROGRAMS) am_parse_vlink_OBJECTS = parse_vlink.$(OBJEXT) parse_vlink_OBJECTS = $(am_parse_vlink_OBJECTS) parse_vlink_LDADD = $(LDADD) DEFAULT_INCLUDES = -I. -I$(top_builddir)@am__isrc@ depcomp = $(SHELL) $(top_srcdir)/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ SOURCES = $(parse_vlink_SOURCES) DIST_SOURCES = $(parse_vlink_SOURCES) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CC_FOR_BUILD = @CC_FOR_BUILD@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ parse_vlink_SOURCES = \ parse_vlink.c EXTRA_DIST = \ protocol.html \ scp_720.html \ scp_820cse.html \ sweep_data.html MAINTAINERCLEANFILES = \ Makefile.in all: all-am .SUFFIXES: .SUFFIXES: .c .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign ppa_protocol/Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign ppa_protocol/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ $(INSTALL_PROGRAM_ENV) $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ rm -f "$(DESTDIR)$(bindir)/$$f"; \ done clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) parse_vlink$(EXEEXT): $(parse_vlink_OBJECTS) $(parse_vlink_DEPENDENCIES) @rm -f parse_vlink$(EXEEXT) $(LINK) $(parse_vlink_OBJECTS) $(parse_vlink_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parse_vlink.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'` ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) ' { files[$$0] = 1; } \ END { for (i in files) print i; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) clean: clean-am clean-am: clean-binPROGRAMS clean-generic mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-exec-am: install-binPROGRAMS install-html: install-html-am install-info: install-info-am install-man: install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic ctags distclean distclean-compile \ distclean-generic distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-compile \ mostlyclean-generic pdf pdf-am ps ps-am tags uninstall \ uninstall-am uninstall-binPROGRAMS # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: pnm2ppa-1.13/ppa_protocol/parse_vlink.c0000644000076400007640000000474007174176312015143 00000000000000#include void parse_scp (FILE *fptr, int length, unsigned long *pos) { int comspec, comref, priority, blank, dlen, i, numbytes; printf (" ** Encapsulated SCP packet found **\n"); comspec = (getc (fptr) << 8) | getc (fptr); comref = (getc (fptr) << 8) | getc (fptr); priority = getc (fptr); blank = getc (fptr); dlen = (getc (fptr) << 8) | getc (fptr); *pos += 8; printf (" Command specifier: %d (0x%X)\n", comspec, comspec); if (dlen != length - 8 || comspec == 0x186) { printf (" ++ Detected HP 720/1000 format\n"); printf (" Command reference #: %d\n", dlen); dlen = length - 16; numbytes = (getc(fptr)<<24) | (getc(fptr)<<16) | (getc(fptr)<<8) | getc(fptr); getc (fptr); getc (fptr); getc (fptr); getc (fptr); *pos += 8; printf (" Data consumed: %d\n", numbytes); } else { printf (" Data length: %d\n", dlen); printf (" Command reference #: %d (0x%X)\n", comref, comref); } printf (" Priority: %d\n", priority); /* print out data packet */ printf (" Data: (pos=%08lx)\n ", *pos); for (i = 0; i < dlen; i++) { if (i != 0 && i % 16 == 0) printf ("\n "); else if (i != 0 && i % 8 == 0) printf (" "); printf ("%02X ", getc (fptr)); } *pos += dlen; printf ("\n"); } int main (int argc, char *argv[]) { FILE *fptr; unsigned long pos = 0; if (argc != 2) { fprintf (stderr, "Usage: %s \n", argv[0]); return 1; } if (strcmp(argv[1], "-") == 0) fptr = stdin; else if ((fptr = fopen (argv[1], "rb")) == NULL) { fprintf (stderr, "Couldn't open file %s\n", argv[1]); return 1; } while (1) { int channel, length, i, ch; if ((ch = getc (fptr)) != '$') { if (ch == EOF) return 0; fprintf (stderr, "Couldn't find VLink Start of Packet mark\n"); return 1; } pos++; printf ("\nVLink Packet start found\n"); channel = getc (fptr); printf ("Channel: %d\n", channel); pos++; length = (getc (fptr) << 8) | getc (fptr); printf ("Packet Length: %d\n", length); pos += 2; if (channel == 1 && length >= 8) parse_scp (fptr, length, &pos); else { FILE *f2; if ((f2 = fopen ("lastdata", "wb")) == NULL) for (i = 0; i < length; i++) getc (fptr); else for (i = 0; i < length; i++) putc (getc (fptr), f2); pos += length; fclose (f2); } } fclose (fptr); } pnm2ppa-1.13/ppa_protocol/protocol.html0000644000076400007640000000662307174176312015213 00000000000000 PPA for the masses

Protocol

Copyright © 1998 Tim Norman

Disclaimer: This information may not be accurate. It has been compiled by me from experimentation and other means that may be prone to error.

The PPA protocol is actually composed of two protocols: a lower-level packet protocol called VLink and the Sleek Control Protocol (SCP). The VLink protocol regulates all data transfered back and forth between the printer and the computer. SCP sends command sequences to tell the printer to do things like load a sheet of paper, eject, and print a sweep.

Although PPA is a bi-directional protocol, I have mainly concentrated on its uni-directional component. It is not required for the host to be aware of the bi-directional nature of the device, which makes this easy to do.

All values are stored in big-endian format.

Note added: the utility program parse_vlink is a simple utility to step through the individual Vlink packets in a PPA stream. It also decodes the SCP packets and prints the information encoded in them.

VLink

VLink is a very simple protocol:

BytesDescription
1The character '$'
1Channel. Several channels are used:
0Image Data
1Commands and responses
2Autostatus
128Periodic Ring Buffer Pacing
2Length of packet
nPacket data

When image data is sent over the image data channel, it takes a form that is very close to how it is presented to the print head mechanism. The code in ppa.c best describes how this data is organized. I will also attempt to explain the PPA sweep data.

The image data may also be optionally compressed. I have not yet worked out the details of the compression method, though it seems similar to the compression used for the PCL protocol. My code currently generates uncompressed data only.

Note that there is a limit to the amount of data that can be sent to the printer. If you overflow that limit, the printer will get confused. This is why print_pbm uses only 150 of the 300 black nozzles; using all of them would overflow the printer's data buffer. I hope to improve this in the future with compression and multiple sweeps per line. This limit is somewhere around 100k for the Deskjet 820Cse.

(added 09/28/2000, by duncan_haldane@users.sourceforge.net): Printing on HP820 with pnmn2ppa-1.0 fails with flashing lignt syndrome if the vertical position of two successive sweeps differs by 1, 2, or 3 dots. (This was observed for the case when one sweep is black , the other is color). If the two sweeps have the same vertical position (as in Windows 9x printing, its OK)

SCP

SCP is the protocol that controls the printer's actions. I will describe several of the commands that I use in my software.

It appears that SCP differs depending on the series of printer that is being used.

820Cse SCP

720 series SCP

pnm2ppa-1.13/ppa_protocol/scp_720.html0000644000076400007640000001361707174176312014530 00000000000000 PRINT_SWEEP specification

HP 720 SCP protocol

Following is the probable specification for the SCP protocol on 720 printers. Thanks to Jim Peterson and Ben Boule for much of this information.

BytesDescription
2Command specifier
2Packet length (N)
1Priority
1Blank (always zero)
2Command reference number
4Number of channel 0 bytes this packet processes
4Always (00 02 00 00) - version number?
N-16Data, including parameters to this command

Several of the commands are described below:

CS=0x186, CR=1 (INIT_COM ?)

This is some sort of initialization command. It probably initializes the communications channel, since it is always the first packet sent by the windows driver. It's data consists of 8 bytes that I have only seen as:

  00 00 01 F4 01 00 00 00

CS=0x18F, CR=2 (INIT_DATA ?)

This is another initialization command. It is sent once at the beginning of each file printed, after the INIT_COM packet. It is preceded by a 4-byte VLink packet sent to channel 0. This suggests that it somehow initializes the data channel of the printer (thus our temporary name). This packet typically contains the values: DE AD BE EF. The data portion of this command usually contains the following 8 bytes:

  DE AD BE EF 02 00 00 00

CS=0x183, CR=1 (INIT_PAGE ?)

This command is sent each time before a page is loaded. It appears to set some parameters for the page, possibly the minimum and maximum horizontal positions for each of the four pens (?). The only data I have seen it contain is the following:

  28 2D 00 41 2D 32 00 46  2D 32 00 46 2D 32 00 46

CS=0x181, CR=1 (HANDLE_MEDIA)

This is the command that handles loading and ejecting of pages.

11=load, 2=eject
1?? usually 0x01
2usually 0x12C0 (4800 decimal), perhaps the horizontal position to place the print-head while loading/ejecting the page. 4800 corresponds to 8" from the left.

CS=0x180, CR=1 (PRINT_SWEEP)

This is the print sweep command. It causes the print head to print a sweep of data (which has previously been sent over channel 0).

The PRINT_SWEEP command controls the print head while printing data on a page. It can take on two forms, one when printing with the black nozzles, and one when printing with the color nozzles. The black form is described in the most detail here, since it is what I have devoted the most attention to.

Following is the format of the first 48 bytes of data for this command:

BytesDescription
1always 0x00
11 = compressed, 0 = not compressed
12 = left-to-right, 1 = right-to-left
11 = black, 0xE = CMY colors
4Compressed size of data
8Typically 0


4Signed number representing vertical position
2Usually 0x8CA0 (36000 decimal)
2Horizontal position for left margin in dots
2Horizontal position for right margin in dots
20x5DC0 (24000) for econo/normal, 0x4650 (18000) for best quality
2Usually 0x12C0 (4800)
2Usually 0x0100 - has something to do with horizontal placement


1If 0, this is the last sweep on the page; the next 12 bytes are ignored. Otherwise, this field predicts the print head direction for the next PRINT_SWEEP command
1Prediction of number of colors in next PRINT_SWEEP (0x01 or 0x0E)
4Vertical position of next sweep
2Horizontal position for left margin in next sweep
2Horizontal position for right margin in next sweep
2Predicts the third-to-last word (2-byte value) of the next sweep packet - 0x5DC0
2Usually 0x12C0 - predicts the second-to-last word of the next sweep packet
10x08
1Number of 16-byte rows to follow this header. This is 2 for black and 6 for CMY.

Following this header are sets of 16-byte rows to describe how to handle the nozzles. The odd nozzles are described by the first row, and the even nozzles are described by the second row.

BytesDescription
2DPI (dots per inch) - 300 or 600
2Half of the total number of pins used
2Number of unused pins + 1
2First pin to start printing with, typically 1
2Half of the total number of pins used
2Left margin in dots. For black printing, this is always 0x02 greater for the odd pins (first set) than the even pins
2Right margin in dots.
1Some sort of delay before this set of nozzles starts firing. For black, odd nozzle is 07, even is 00. For color, the first set of nozzles is 04, the next set is 06, and the last set is 00
10

pnm2ppa-1.13/ppa_protocol/scp_820cse.html0000644000076400007640000001366307441604370015222 00000000000000 PRINT_SWEEP specification

HP 820Cse SCP protocol

Following is the probable specification for the SCP protocol on 820 printers. There seem to be minor differences with the 820Cxi printer, and the protocol header is changed for 720 series printers.

BytesDescription
2Command specifier
2Command reference number
1Priority
1Blank
2Length of data
nData, including parameters to this command

Several of the commands are described below:

CS=35, CR=1 (INIT_COM ?)

This is some sort of initialization command. It probably initializes the communications channel, since it is always the first packet sent by the windows driver. It's data consists of 8 bytes that I have only seen as:

  00 00 01 F4 01 00 00 00

CS=101, CR=2 (INIT_DATA ?)

This is another initialization command. It is sent once at the beginning of each file printed, after the INIT_COM packet. It is preceded by a 4-byte VLink packet sent to channel 0. This suggests that it somehow initializes the data channel of the printer (thus our temporary name). This packet typically contains the values: DE AD BE EF. The data portion of this command usually contains the following 8 bytes:

  DE AD BE EF 02 00 00 00

CS=21, CR=1 (INIT_PAGE ?)

This command is sent each time before a page is loaded. It appears to set some parameters for the page, possibly the minimum and maximum horizontal positions for each of the four pens (?). The only data I have seen it contain is the following:

  28 2D 00 41 29 2E 00 42  29 2E 00 42 29 2E 00 42

CS=19, CR=1 (HANDLE_MEDIA)

This is the command that handles loading and ejecting of pages.

11=load, 2=eject
1?? usually 0x01
2usually 0x0960 (2400 decimal), perhaps the horizontal position to place the print-head while loading/ejecting the page. 2400 corresponds to 4" from the left, which is about the center of the page for 8.5" pages.

CS=18, CR=1 (PRINT_SWEEP)

This is the print sweep command. It causes the print head to print a sweep of data (which has previously been sent over channel 0).

The PRINT_SWEEP command controls the print head while printing data on a page. It can take on two forms, one when printing with the black nozzles, and one when printing with the color nozzles. The black form is described in the most detail here, since it is what I have devoted the most attention to.

Following is the format of the first 48 bytes of data for this command:

BytesDescription
1always 0x00
11 = compressed, 0 = not compressed
12 = left-to-right, 1 = right-to-left
11 = black, 0xE = CMY colors
4Compressed size of data
8Typically 0


4Signed number representing vertical position
2Usually 0x4650 (18000 decimal)
2Horizontal position for left margin in dots
2Horizontal position for right margin in dots
20x1C20 (7200) for black data or 0x2EE0 (12000) for color data
2Usually 0x0960 (2400)
2Usually 0x0100 - has something to do with horizontal placement


1If 0, this is the last sweep on the page; the next 12 bytes are ignored. Otherwise, this field predicts the print head direction for the next PRINT_SWEEP command
1Prediction of number of colors in next PRINT_SWEEP (0x01 or 0x0E)
4Vertical position of next sweep
2Horizontal position for left margin in next sweep
2Horizontal position for right margin in next sweep
2Predicts the third-to-last word (2-byte value) of the next sweep packet - 0x1C20 for black, 0x2EE0 for color
2Usually 0x0960 - predicts the second-to-last word of the next sweep packet
10x08
1Number of 16-byte rows to follow this header. This is 2 for black and 6 for CMY.

Following this header are sets of 16-byte rows to describe how to handle the nozzles. The odd nozzles are described by the first row, and the even nozzles are described by the second row.

BytesDescription
2DPI (dots per inch) - 300 or 600
2Half of the total number of pins used
2Number of unused pins + 1
2First pin to start printing with, typically 1
2Half of the total number of pins used
2Left margin in dots. For black printing, this is always 0x62 greater for the odd pins (first set) than the even pins
2Right margin in dots.
1Some sort of delay before this set of nozzles starts firing. See code for more details.
10
pnm2ppa-1.13/ppa_protocol/sweep_data.html0000644000076400007640000001635707476162744015504 00000000000000 PRINT_SWEEP specification

Sweep data explanation

It took me quite a while to understand the explanation of the sweep data from the HP Journal articles, so I will try to explain it in a little clearer terms here.

The swing buffer separation applies for black as well as CMY sweeps. I have only deciphered the ordering for the black data, however.

What's a sweep?

Let's first start off by describing how the nozzles on the printhead are arranged.

For the black nozzles, there are 300 total nozzles. They are numbered from 1 to 300. There are two columns of nozzles - odd and even. The odd colum consists of 150 nozzles separated by 1/300 of an inch. The even column is similar, but it is shifted down 1/600 of an inch from the odd column. Thus, we can get 300 dpi by printing with one column and 600 dpi by printing "between the lines" with the other column.

For the color nozzles, each color (CMY - cyan, magenta, yellow) has 64 nozzles. They are split into two columns of 32 nozzles each. The odd column has nozzles separated by 1/150 of an inch, and the even column has the same set of nozzles, but shifted 1/300 of an inch down. This allows us to get 300 dpi color. (This may differ slightly on printers other than the 820Cse)

When the printer prints a graphical image, it must convert the image data into a form that it can understand. The first task is to separate the image into swaths. Let us assume that we have a black-and-white bitmap that is X pixels wide and Y pixels tall that we want to send to the printer. We must cut this into several swaths, each of a certain height. For example, we might choose to cut it into swaths that are 300 pixels high (1/2 an inch). This produces a series of bitmaps that are X by 300 pixels in dimension.

With this swath data, we can now produce a series of sweeps. A sweep is simply a set of data that tells the printhead how to move across the page and what data to print. For each swath, there may be only one sweep, or there may be multiple sweeps.

Formatting the sweep data

The sweep data is formatted in a very specific way so that the printer can understand it. The first thing that we need to do is convert the bitmap data into the correct form. The form that is required looks like this:

Columns 0-7Columns 8-15... Columns ceil(X/8)*8-8 to ceil(X/8)*8-1
Byte 0Byte 1...Byte ceil(X/8)-1
Byte ceil(X/8)Byte ceil(X/8)+1...Byte 2*ceil(X/8)-1
............

Each of the 8 bit values are packed into a byte in big-endian order.

To give a more concrete example, assume we have a sweep that is 64 pixels wide and 8 pixels tall. Here is what our data organization will look like:

Col 0-7Col 8-15Col 16-23Col 24-31Col 32-39Col 40-47Col 48-55Col 56-63
Row 0 Byte 0Byte 1Byte 2Byte 3Byte 4Byte 5Byte 6Byte 7
Row 1Byte 8Byte 9Byte 10Byte 11Byte 12Byte 13Byte 14Byte 15
Row 2Byte 16Byte 17Byte 18Byte 19Byte 20Byte 21Byte 22Byte 23
Row 3Byte 24Byte 25Byte 26Byte 27Byte 28Byte 29Byte 30Byte 31
Row 4Byte 32Byte 33Byte 34Byte 35Byte 36Byte 37Byte 38Byte 39
Row 5Byte 40Byte 41Byte 42Byte 43Byte 44Byte 45Byte 46Byte 47
Row 6Byte 48Byte 49Byte 50Byte 51Byte 52Byte 53Byte 54Byte 55
Row 7Byte 56Byte 57Byte 58Byte 59Byte 60Byte 61Byte 62Byte 63

Our next task is to separate this data into swing buffers. Since the odd and even nozzles on the printhead are physically separated, we must extract the appropriate rows of pixels to give to the printer. Two swing buffers are created for each column of bytes. The first is the odd swing buffer, and the second is the even swing buffer. These correspond to which pins will be printing the data. Thus, the odd swing buffer for the first column in the above example would look like this: (Note added: from inspection of the pbm2ppa and pnm2mma code, this seems to be the even swing buffer, not the odd one (?))

Byte 0
Byte 16
Byte 32
Byte 48

And the even swing buffer looks like this: (Note added: this seems to be the odd swing buffer (?))

Byte 8
Byte 24
Byte 40
Byte 56

Ordering the swing buffers

Now we have odd and even swing buffers for each of the columns in the print sweep. The next thing for us to do is order these swing buffers and send them to the printer.

From experimentation, I have determined the ordering for the black data on the 820Cse.

  1. First, the odd swing buffers for the left 12 columns are sent as sweep data.
  2. Next, the odd swing buffer for the 13th column is sent, followed by the even swing buffer for the first column. This alternates until we run out of odd swing buffers.
  3. Finally, the even swing buffers for the last 12 columns are sent.

From experimentation, it seems that the values of the first and last 12 columns of data MUST be all 0's. Otherwise, strange results occur, including the repetition of a single swing buffer across the whole sweep.

Here is a quick reference for the ordering of the swing buffer data, assuming X columns of data.

Odd swing buffer for column 0
Odd swing buffer for column 1
...
Odd swing buffer for column 11
Odd swing buffer for column 12
Even swing buffer for column 0
Odd swing buffer for column 13
Even swing buffer for column 1
...
Odd swing buffer for column X-1
Even swing buffer for column X-13
Even swing buffer for column X-12
Even swing buffer for column X-11
...
Even swing buffer for column X-1

For different printers and color printing, the number of columns to send before we start interleaving seems to vary.