summaryrefslogtreecommitdiff
path: root/print/hplip3
diff options
context:
space:
mode:
authorDoug Barton <dougb@FreeBSD.org>2006-05-26 23:50:11 +0000
committerDoug Barton <dougb@FreeBSD.org>2006-05-26 23:50:11 +0000
commit9ab82d60d82105cd57c38a2d3d2b00edfb534148 (patch)
tree128cf726daa92cd9ce854d84bb2725df07e1cb8d /print/hplip3
parentUpdate portsnap to version 1.1, to reflect three months of development in (diff)
Fix port to work on RELENG_4.
Submitted by: Anish Mistry <amistry@am-productions.biz> (maintainer)
Notes
Notes: svn path=/head/; revision=163558
Diffstat (limited to 'print/hplip3')
-rw-r--r--print/hplip3/Makefile3
-rw-r--r--print/hplip3/files/patch-0.9.11-2-official276
-rw-r--r--print/hplip3/files/patch-backend_hp_hp.c19
-rw-r--r--print/hplip3/files/patch-io_hpiod_dot4.cpp19
-rw-r--r--print/hplip3/files/patch-io_hpiod_mlc.cpp19
-rw-r--r--print/hplip3/files/patch-pcard_fat.c14
-rw-r--r--print/hplip3/files/patch-pcard_pcardext_pcardext.c29
-rw-r--r--print/hplip3/files/patch-prnt_cupsext_cupsext.c95
-rw-r--r--print/hplip3/files/patch-prnt_hpijs_hpijsfax.cpp18
-rw-r--r--print/hplip3/files/patch-scan_sane-mfpdtf.c70
-rw-r--r--print/hplip3/files/patch-scan_sane-pml.c20
-rw-r--r--print/hplip3/files/patch-scan_sane_hpaio.c63
-rw-r--r--print/hplip3/files/patch-scan_sane_io.c38
13 files changed, 679 insertions, 4 deletions
diff --git a/print/hplip3/Makefile b/print/hplip3/Makefile
index 1ff6eaf54e9a..f2d136778fb3 100644
--- a/print/hplip3/Makefile
+++ b/print/hplip3/Makefile
@@ -45,7 +45,7 @@ PLIST_SUB+= PORTVERSION=${PORTVERSION} IJSVER=2.1.10
.include <bsd.port.pre.mk>
.if ${OSVERSION} < 500000
-BROKEN= does not compile
+USE_AUTOTOOLS= automake:19:env autoconf:259:env aclocal:19:env
.endif
.if exists(${LOCALBASE}/bin/pylupdate)
@@ -82,6 +82,7 @@ post-patch:
${WRKSRC}/*.py \
${WRKSRC}/*/*.py \
${WRKSRC}/*/*/*.py
+ @${REINPLACE_CMD} 's|-lpthread|${PTHREAD_LIBS}|g' ${WRKSRC}/configure
.if defined(NOPORTDOCS)
@${REINPLACE_CMD} -e 's|install-data-am: install-docDATA|install-data-am:|g' \
${WRKSRC}/prnt/hpijs/Makefile.in
diff --git a/print/hplip3/files/patch-0.9.11-2-official b/print/hplip3/files/patch-0.9.11-2-official
new file mode 100644
index 000000000000..f991bdbf8fcf
--- /dev/null
+++ b/print/hplip3/files/patch-0.9.11-2-official
@@ -0,0 +1,276 @@
+diff -uNr hplip-0.9.11.old/data/xml/models.xml data/xml/models.xml
+--- hplip-0.9.11.old/data/xml/models.xml 2006-05-08 12:27:06.000000000 -0700
++++ data/xml/models.xml 2006-05-12 15:30:54.754891424 -0700
+@@ -7797,6 +7797,84 @@
+ </r0>
+ </model>
+
++<model name="PSC_950">
++ <id>MFG:Hewlett-Packard;MDL:PSC 900 Series;SKU:PSC 950;CMD:2,PCL,PML;CLASS:PRINTER;DESCRIPTION:Hewlett-Packard PSC 900 Series;1284.3M:f7f,f7f;1284.4DL:4d,4e,1;SERN:MY15U31143WP;VSTATUS:$AU0$AU0,ff,DN,PENF,CUT,K0,C0,SM,NR,KP066,CP095;AiO:00;DW-PCL;</id>
++ <icon>PSC_900_Series.png</icon>
++ <support type="2"/>
++ <case-model>
++ </case-model>
++ <io support="2" mode="1" control="0" mfp-mode="2" scan-port="0"/>
++ <align type="9"/>
++ <clean type="3"/>
++ <color-cal type="0"/>
++ <status type="1"/>
++ <scan type="1"/>
++ <fax type="0"/>
++ <pcard type="1"/>
++ <copy type="0"/>
++ <tech class="DJ9xx" type="2"/>
++ <embedded-server type="0"/>
++ <panel-check type="1"/>
++ <linefeed-cal type="0"/>
++ <pq-diag type="0"/>
++ <r0>
++ <agent1 kind="3" type="1" sku="15 (C6615DN)"/>
++ <agent2 kind="3" type="2" sku="78 (C6578AN / C6578DN)"/>
++ </r0>
++</model>
++
++<model name="PSC_950vr">
++ <id>MFG:Hewlett-Packard;MDL:PSC 900 Series;SKU:PSC 950;CMD:2,PCL,PML;CLASS:PRINTER;DESCRIPTION:Hewlett-Packard PSC 900 Series;1284.3M:f7f,f7f;1284.4DL:4d,4e,1;SERN:MY15U31143WP;VSTATUS:$AU0$AU0,ff,DN,PENF,CUT,K0,C0,SM,NR,KP066,CP095;AiO:00;DW-PCL;</id>
++ <icon>PSC_900_Series.png</icon>
++ <support type="2"/>
++ <case-model>
++ </case-model>
++ <io support="2" mode="1" control="0" mfp-mode="2" scan-port="0"/>
++ <align type="9"/>
++ <clean type="3"/>
++ <color-cal type="0"/>
++ <status type="1"/>
++ <scan type="1"/>
++ <fax type="0"/>
++ <pcard type="1"/>
++ <copy type="0"/>
++ <tech class="DJ9xx" type="2"/>
++ <embedded-server type="0"/>
++ <panel-check type="1"/>
++ <linefeed-cal type="0"/>
++ <pq-diag type="0"/>
++ <r0>
++ <agent1 kind="3" type="1" sku="15 (C6615DN)"/>
++ <agent2 kind="3" type="2" sku="78 (C6578AN / C6578DN)"/>
++ </r0>
++</model>
++
++<model name="PSC_950xi">
++ <id>MFG:Hewlett-Packard;MDL:PSC 900 Series;SKU:PSC 950;CMD:2,PCL,PML;CLASS:PRINTER;DESCRIPTION:Hewlett-Packard PSC 900 Series;1284.3M:f7f,f7f;1284.4DL:4d,4e,1;SERN:MY15U31143WP;VSTATUS:$AU0$AU0,ff,DN,PENF,CUT,K0,C0,SM,NR,KP066,CP095;AiO:00;DW-PCL;</id>
++ <icon>PSC_900_Series.png</icon>
++ <support type="2"/>
++ <case-model>
++ </case-model>
++ <io support="2" mode="1" control="0" mfp-mode="2" scan-port="0"/>
++ <align type="9"/>
++ <clean type="3"/>
++ <color-cal type="0"/>
++ <status type="1"/>
++ <scan type="1"/>
++ <fax type="0"/>
++ <pcard type="1"/>
++ <copy type="0"/>
++ <tech class="DJ9xx" type="2"/>
++ <embedded-server type="0"/>
++ <panel-check type="1"/>
++ <linefeed-cal type="0"/>
++ <pq-diag type="0"/>
++ <r0>
++ <agent1 kind="3" type="1" sku="15 (C6615DN)"/>
++ <agent2 kind="3" type="2" sku="78 (C6578AN / C6578DN)"/>
++ </r0>
++</model>
++
+ <model name="Photosmart_2570_series">
+ <id></id>
+ <icon>psc_2300_series.png</icon>
+diff -uNr hplip-0.9.11.old/prnt/hpijs/colormatch.cpp prnt/hpijs/colormatch.cpp
+--- hplip-0.9.11.old/prnt/hpijs/colormatch.cpp 2006-05-09 11:04:30.000000000 -0700
++++ prnt/hpijs/colormatch.cpp 2006-05-11 16:17:17.000000000 -0700
+@@ -221,15 +221,21 @@
+ {
+ for (unsigned int r = 0; r < 9; r++)
+ {
++#ifndef NDEBUG
+ unsigned long ul_RedMapPtr = r * 9 * 9;
++#endif
+ for (unsigned int g = 0; g < 9; g++)
+ {
++#ifndef NDEBUG
+ unsigned long ul_GreenMapPtr = g * 9;
++#endif
+ for (unsigned int b = 0; b < 9; b++)
+ {
+ unsigned long mapptr = b + (g * 9) + (r * 9 * 9); // get address in map
++#ifndef NDEBUG
+ unsigned long ul_MapPtr = b + ul_GreenMapPtr + ul_RedMapPtr;
+ ASSERT(mapptr == ul_MapPtr);
++#endif
+ // put r,g,b in monitor range
+ unsigned int oldR = r * 255 >> 3;
+ unsigned int oldG = g * 255 >> 3;
+diff -uNr hplip-0.9.11.old/prnt/hpijs/hpijs.cpp prnt/hpijs/hpijs.cpp
+--- hplip-0.9.11.old/prnt/hpijs/hpijs.cpp 2006-02-23 14:31:17.000000000 -0800
++++ prnt/hpijs/hpijs.cpp 2006-05-12 15:44:27.509333968 -0700
+@@ -177,7 +177,7 @@
+ char *tail;
+ int status = 0;
+ char svalue[IJS_MAX_PARAM+1];
+- float w, h;
++ float w, h, dx, dy;
+
+ /* Sanity check input value. */
+ if (value_size > IJS_MAX_PARAM)
+@@ -256,8 +256,12 @@
+ }
+ else
+ {
++
++ dx = w > pSS->PaperWidth ? w - pSS->PaperWidth : pSS->PaperWidth - w;
++ dy = h > pSS->PaperHeight ? h - pSS->PaperHeight : pSS->PaperHeight - h;
++
+ /* Middle of print Job, ignore paper size if same. */
+- if (!(w == pSS->PaperWidth && h == pSS->PaperHeight))
++ if ((dx > 0.03) || (dy > 0.03))
+ {
+ pSS->FirstRaster = 1; /* force new Job */
+ pSS->PaperWidth = w; /* set new paper size */
+@@ -272,19 +276,19 @@
+ }
+ else if (!strcmp (key, "Quality:Quality"))
+ {
+- pSS->Quality = strtol(svalue, &tail, 10);
++ pSS->Quality = (QUALITY_MODE) strtol(svalue, &tail, 10);
+ }
+ else if (!strcmp (key, "Quality:MediaType"))
+ {
+- pSS->MediaType = strtol(svalue, &tail, 10);
++ pSS->MediaType = (MEDIATYPE) strtol(svalue, &tail, 10);
+ }
+ else if (!strcmp (key, "Quality:ColorMode"))
+ {
+- pSS->ColorMode = strtol(svalue, &tail, 10);
++ pSS->ColorMode = (COLORMODE) strtol(svalue, &tail, 10);
+ }
+ else if (!strcmp (key, "Quality:PenSet"))
+ {
+- pSS->PenSet = strtol(svalue, &tail, 10);
++ pSS->PenSet = (PEN_TYPE) strtol(svalue, &tail, 10);
+ }
+ else if (!strcmp (key, "Quality:FullBleed"))
+ {
+diff -uNr hplip-0.9.11.old/prnt/hpijs/ljfastraster.cpp prnt/hpijs/ljfastraster.cpp
+--- hplip-0.9.11.old/prnt/hpijs/ljfastraster.cpp 2006-05-09 11:04:30.000000000 -0700
++++ prnt/hpijs/ljfastraster.cpp 2006-05-11 16:34:57.000000000 -0700
+@@ -1215,7 +1215,7 @@
+
+ m_compressedsize = 2 * inputsize * INDY_STRIP_HEIGHT;
+ BOOL bRet = Compress (compressBuf,
+- (uint32_t *) &m_compressedsize,
++ &m_compressedsize,
+ pbyInputImageBuffer,
+ inputsize,
+ m_lCurrCDRasterRow,
+diff -uNr hplip-0.9.11.old/prnt/hpijs/ljfastraster.h prnt/hpijs/ljfastraster.h
+--- hplip-0.9.11.old/prnt/hpijs/ljfastraster.h 2006-05-09 11:04:30.000000000 -0700
++++ prnt/hpijs/ljfastraster.h 2006-05-11 16:34:57.000000000 -0700
+@@ -32,6 +32,7 @@
+ #ifndef APDK_LJFASTRASTER_H
+ #define APDK_LJFASTRASTER_H
+
++#include "global_types.h"
+
+ APDK_BEGIN_NAMESPACE
+ /*!
+@@ -136,7 +137,7 @@
+ long m_lCurrBlockHeight;
+ long m_lPrinterRasterRow; // Current printer raster row.
+
+- unsigned long m_compressedsize;
++ uint32_t m_compressedsize;
+ BOOL m_bCompressed;
+ float m_fRatio;
+ HPUInt8 *pbySeedRow;
+diff -uNr hplip-0.9.11.old/prnt/hpijs/ljjetready.cpp prnt/hpijs/ljjetready.cpp
+--- hplip-0.9.11.old/prnt/hpijs/ljjetready.cpp 2006-05-09 11:04:30.000000000 -0700
++++ prnt/hpijs/ljjetready.cpp 2006-05-11 15:49:52.000000000 -0700
+@@ -473,7 +473,7 @@
+ //-----------------------------------------------------------------------------
+ DRIVER_ERROR HeaderLJJetReady::MapPCLMediaTypeToString (MEDIATYPE eM)
+ {
+- DRIVER_ERROR err;
++ DRIVER_ERROR err = SYSTEM_ERROR;
+ BYTE szPlain[] = {"\xC8\xC1\x05\x00Plain\xF8\x27"};
+ BYTE szPhoto[] = {"\xC8\xC1\x05\x00Gloss\xF8\x27"};
+
+diff -uNr hplip-0.9.11.old/prnt/hpijs/services.cpp prnt/hpijs/services.cpp
+--- hplip-0.9.11.old/prnt/hpijs/services.cpp 2006-02-23 14:31:47.000000000 -0800
++++ prnt/hpijs/services.cpp 2006-05-12 15:44:44.645728840 -0700
+@@ -46,6 +46,12 @@
+
+ int UXServices::InitDuplexBuffer()
+ {
++ /* Free buffer if new page size in middle of print job. */
++ if (RastersOnPage)
++ delete [] RastersOnPage;
++ if (KRastersOnPage)
++ delete [] KRastersOnPage;
++
+ /* Calculate duplex page buffer */
+ CurrentRaster = ph.height - 1; /* Height = physical page in pixels */
+ RastersOnPage = (BYTE **) new BYTE[(ph.height) * sizeof (BYTE *)];
+@@ -270,12 +276,13 @@
+ }
+ }
+
+- Quality = 0; /* normal */
+- MediaType = 0; /* plain */
+- ColorMode = 2; /* color */
++ Quality = QUALITY_NORMAL;
++ MediaType = MEDIA_PLAIN;
++ ColorMode = COLOR;
+ PenSet = DUMMY_PEN;
+
+ RastersOnPage = 0;
++ KRastersOnPage = 0;
+ pPC = NULL;
+ pJob = NULL;
+ Duplex = 0;
+@@ -294,6 +301,8 @@
+ {
+ if (RastersOnPage)
+ delete [] RastersOnPage;
++ if (KRastersOnPage)
++ delete [] KRastersOnPage;
+ if (hpFD >= 0)
+ hplip_CloseHP(hpFD);
+ hplip_Exit();
+diff -uNr hplip-0.9.11.old/prnt/hpijs/services.h prnt/hpijs/services.h
+--- hplip-0.9.11.old/prnt/hpijs/services.h 2005-09-14 10:19:08.000000000 -0700
++++ prnt/hpijs/services.h 2006-05-12 15:44:40.360380312 -0700
+@@ -35,6 +35,8 @@
+ #include <stdio.h>
+ #include <math.h>
+
++#include "global_types.h"
++
+ APDK_USING_NAMESPACE
+
+ class UXServices:public SystemServices
+@@ -123,10 +125,10 @@
+ const float *Margin;
+ int Model; /* selected device: -1=no, 1=yes */
+ int OutputPath; /* open file descriptor */
+- int Quality; /* 0=normal, 1=draft, 2=best */
+- int MediaType; /* 0=plain, 1=premium, 2=photo */
+- int ColorMode; /* 0=grey_k, 1=grey_cmy, 2=color */
+- int PenSet; /* 0=black_pen, 1=color_pen, 2=both_pens, 3=mdl_pen, 4=mdl_both */
++ QUALITY_MODE Quality;
++ MEDIATYPE MediaType;
++ COLORMODE ColorMode;
++ PEN_TYPE PenSet;
+ int MediaPosition;
+ float PaperWidth; /* physical width in inches */
+ float PaperHeight; /* physical height in inches */
diff --git a/print/hplip3/files/patch-backend_hp_hp.c b/print/hplip3/files/patch-backend_hp_hp.c
new file mode 100644
index 000000000000..8c13c66c2590
--- /dev/null
+++ b/print/hplip3/files/patch-backend_hp_hp.c
@@ -0,0 +1,19 @@
+--- backend/hp/hp.c.orig Tue May 23 15:18:48 2006
++++ backend/hp/hp.c Tue May 23 15:19:33 2006
+@@ -427,6 +427,7 @@
+ int len, vstatus, cnt;
+ char buf[BUFFER_SIZE+HEADER_SIZE];
+ MsgAttributes ma;
++ int hd=-1, channel=-1, n, total, retry=0, size;
+
+ if (argc > 1)
+ {
+@@ -474,8 +475,6 @@
+ }
+ copies = atoi(argv[4]);
+ }
+-
+- int hd=-1, channel=-1, n, total, retry=0, size;
+
+ hplip_Init();
+
diff --git a/print/hplip3/files/patch-io_hpiod_dot4.cpp b/print/hplip3/files/patch-io_hpiod_dot4.cpp
new file mode 100644
index 000000000000..62ebdadeae36
--- /dev/null
+++ b/print/hplip3/files/patch-io_hpiod_dot4.cpp
@@ -0,0 +1,19 @@
+--- io/hpiod/dot4.cpp.orig Tue May 23 15:30:04 2006
++++ io/hpiod/dot4.cpp Tue May 23 15:32:37 2006
+@@ -78,6 +78,7 @@
+ Dot4Channel *pC=NULL;
+ int i, len, size;
+ unsigned char socket;
++ static int cnt=0;
+
+ pCmd = (DOT4Cmd *)buf;
+
+@@ -130,7 +131,7 @@
+ Dot4ForwardReply(fd, (unsigned char *)pCreditReply, sizeof(DOT4CreditReply));
+ break;
+ case DOT4_CREDIT_REQUEST:
+- static int cnt=0;
++ cnt=0;
+ pCreditReq = (DOT4CreditRequest *)buf;
+ if (cnt++ < 5)
+ syslog(LOG_ERR, "unexpected DOT4CreditRequest: cmd=%x, hid=%x, pid=%x, maxcredit=%d: %s %d\n", pCreditReq->cmd,
diff --git a/print/hplip3/files/patch-io_hpiod_mlc.cpp b/print/hplip3/files/patch-io_hpiod_mlc.cpp
new file mode 100644
index 000000000000..a2c186607052
--- /dev/null
+++ b/print/hplip3/files/patch-io_hpiod_mlc.cpp
@@ -0,0 +1,19 @@
+--- io/hpiod/mlc.cpp.orig Tue May 23 15:27:16 2006
++++ io/hpiod/mlc.cpp Tue May 23 15:29:40 2006
+@@ -73,6 +73,7 @@
+ MLCError *pError;
+ MlcChannel *pC;
+ int i, len, size;
++ static int cnt=0;
+
+ pCmd = (MLCCmd *)buf;
+
+@@ -122,7 +123,7 @@
+ MlcForwardReply(fd, (unsigned char *)pCreditReply, sizeof(MLCCreditReply));
+ break;
+ case MLC_CREDIT_REQUEST:
+- static int cnt=0;
++ cnt = 0;
+ pCreditReq = (MLCCreditRequest *)buf;
+ if (cnt++ < 5)
+ syslog(LOG_ERR, "unexpected MLCCreditRequest: cmd=%x, hid=%x, pid=%x, credit=%d: %s %d\n", pCreditReq->cmd,
diff --git a/print/hplip3/files/patch-pcard_fat.c b/print/hplip3/files/patch-pcard_fat.c
new file mode 100644
index 000000000000..805b9ba39d47
--- /dev/null
+++ b/print/hplip3/files/patch-pcard_fat.c
@@ -0,0 +1,14 @@
+--- pcard/fat.c.orig Tue May 23 15:25:02 2006
++++ pcard/fat.c Tue May 23 15:25:54 2006
+@@ -27,7 +27,11 @@
+ \*****************************************************************************/
+
+ #include <stdlib.h>
++#ifdef __FreeBSD__
++#include <inttypes.h>
++#else
+ #include <stdint.h>
++#endif
+ #include <stdio.h>
+ #include <string.h>
+ #include <unistd.h>
diff --git a/print/hplip3/files/patch-pcard_pcardext_pcardext.c b/print/hplip3/files/patch-pcard_pcardext_pcardext.c
new file mode 100644
index 000000000000..4c531f92d1f2
--- /dev/null
+++ b/print/hplip3/files/patch-pcard_pcardext_pcardext.c
@@ -0,0 +1,29 @@
+--- pcard/pcardext/pcardext.c.orig Tue May 23 15:43:36 2006
++++ pcard/pcardext/pcardext.c Tue May 23 15:44:43 2006
+@@ -80,6 +80,7 @@
+
+ PyObject * pcardext_mount( PyObject * self, PyObject * args )
+ {
++ int i;
+ if( !PyArg_ParseTuple( args, "OO", &readsectorFunc, &writesectorFunc ) )
+ {
+ return Py_BuildValue( "i", 1 );
+@@ -93,7 +94,7 @@
+ Py_INCREF( readsectorFunc );
+ Py_INCREF( writesectorFunc );
+
+- int i = FatInit();
++ i = FatInit();
+ /*char buf[1024];
+ sprintf( buf, "print 'FatInit()=%d\n'", i );
+ PyRun_SimpleString( buf );*/
+@@ -111,8 +112,8 @@
+ PyObject * pcardext_ls( PyObject * self, PyObject * args )
+ {
+ PyObject * file_list;
+- file_list = PyList_New(0);
+ FILE_ATTRIBUTES fa;
++ file_list = PyList_New(0);
+
+ FatDirBegin( &fa );
+
diff --git a/print/hplip3/files/patch-prnt_cupsext_cupsext.c b/print/hplip3/files/patch-prnt_cupsext_cupsext.c
new file mode 100644
index 000000000000..02351d5d2a7c
--- /dev/null
+++ b/print/hplip3/files/patch-prnt_cupsext_cupsext.c
@@ -0,0 +1,95 @@
+--- prnt/cupsext/cupsext.c.orig Tue May 23 15:45:57 2006
++++ prnt/cupsext/cupsext.c Tue May 23 15:49:34 2006
+@@ -253,11 +253,23 @@
+
+ PyObject * getPrinters( PyObject * self, PyObject * args )
+ {
++ int max_count;
++ char * device_uri;
++ char * printer_uri;
++ char * info;
++ char * location;
++ char * make_model;
++ char * name;
++ /*char * ppd_name;*/
++ cups_ptype_t type;
++ ipp_pstate_t state;
++ int i = 0;
+ http_t *http=NULL; /* HTTP object */
+ ipp_t *request=NULL; /* IPP request object */
+ ipp_t *response=NULL; /* IPP response object */
+ ipp_attribute_t *attr; /* Current IPP attribute */
+ PyObject * printer_list;
++ printer_Object * printer;
+ cups_lang_t * language;
+ static const char * attrs[] = /* Requested attributes */
+ {
+@@ -300,7 +312,7 @@
+ goto abort;
+ }
+
+- int max_count = 0;
++ max_count = 0;
+
+ for ( attr = ippFindAttribute(response, "printer-name", IPP_TAG_NAME),
+ max_count = 0;
+@@ -311,16 +323,7 @@
+
+ printer_list = PyList_New( max_count );
+
+- char * device_uri;
+- char * printer_uri;
+- char * info;
+- char * location;
+- char * make_model;
+- char * name;
+- /*char * ppd_name;*/
+- cups_ptype_t type;
+- ipp_pstate_t state;
+- int i = 0;
++ i = 0;
+
+ for (attr = response->attrs; attr != NULL; attr = attr->next)
+ {
+@@ -392,7 +395,6 @@
+ continue;
+ }
+
+- printer_Object * printer;
+ printer = (printer_Object *)_newPrinter( device_uri, name, printer_uri, location, make_model,
+ info, state/*, ppd_name*/ );
+ PyList_SET_ITEM( printer_list, i, (PyObject *)printer );
+@@ -925,13 +927,13 @@
+ PyObject * getPPD( PyObject * self, PyObject * args )
+ {
+ char * printer;
++ const char * ppd;
+
+ if ( !PyArg_ParseTuple( args, "z", &printer ) )
+ {
+ return Py_BuildValue( "" ); // None
+ }
+
+- const char * ppd;
+ ppd = cupsGetPPD( (const char *)printer );
+
+ return Py_BuildValue( "s", ppd );
+@@ -941,16 +943,16 @@
+
+ PyObject * getPPDOption( PyObject * self, PyObject * args )
+ {
++ char * option;
++ ppd_choice_t * marked_choice;
+ if( ppd_file != NULL )
+ {
+- char * option;
+
+ if ( !PyArg_ParseTuple( args, "z", &option ) )
+ {
+ return Py_BuildValue( "" ); // None
+ }
+
+- ppd_choice_t * marked_choice;
+ marked_choice = ppdFindMarkedChoice( ppd_file, option );
+
+ if (marked_choice == NULL )
diff --git a/print/hplip3/files/patch-prnt_hpijs_hpijsfax.cpp b/print/hplip3/files/patch-prnt_hpijs_hpijsfax.cpp
index 60453cb6c9a3..7a3675b9cdba 100644
--- a/print/hplip3/files/patch-prnt_hpijs_hpijsfax.cpp
+++ b/print/hplip3/files/patch-prnt_hpijs_hpijsfax.cpp
@@ -1,6 +1,18 @@
---- prnt/hpijs/hpijsfax.cpp.orig Sat Apr 1 16:35:53 2006
-+++ prnt/hpijs/hpijsfax.cpp Sat Apr 1 16:37:36 2006
-@@ -297,8 +297,8 @@
+--- prnt/hpijs/hpijsfax.cpp.orig Tue Feb 21 13:19:54 2006
++++ prnt/hpijs/hpijsfax.cpp Fri May 26 11:56:49 2006
+@@ -39,7 +39,11 @@
+ #include <string.h>
+ #include <unistd.h>
+ #include <fcntl.h>
++#ifdef __FreeBSD__
++#include <inttypes.h>
++#else
+ #include <stdint.h>
++#endif
+ #include <time.h>
+ #include <sys/time.h>
+ #include <math.h>
+@@ -297,8 +301,8 @@
memset (&tv, 0, sizeof (tv));
gettimeofday (&tv, NULL);
diff --git a/print/hplip3/files/patch-scan_sane-mfpdtf.c b/print/hplip3/files/patch-scan_sane-mfpdtf.c
new file mode 100644
index 000000000000..2d97133a3ffd
--- /dev/null
+++ b/print/hplip3/files/patch-scan_sane-mfpdtf.c
@@ -0,0 +1,70 @@
+--- scan/sane/mfpdtf.c.orig Tue May 23 15:07:49 2006
++++ scan/sane/mfpdtf.c Tue May 23 15:10:30 2006
+@@ -156,10 +156,10 @@
+
+ int MfpdtfReadService( Mfpdtf_t mfpdtf )
+ {
+- DBG( 0, "MfpdtfReadService() ______________________________ deviceid=%d, channelid=%d ______________________________\n", mfpdtf->deviceid, mfpdtf->channelid );
+-
+ int result = 0;
+- int datalen, blockLength, headerLength;
++ int datalen, blockLength, headerLength, r;
++
++ DBG( 0, "MfpdtfReadService() ______________________________ deviceid=%d, channelid=%d ______________________________\n", mfpdtf->deviceid, mfpdtf->channelid );
+
+ if( mfpdtf->read.fixedBlockBytesRemaining <= 0 )
+ {
+@@ -171,7 +171,7 @@
+
+ //READ( &mfpdtf->read.fixedHeader, datalen );
+
+- int r = MfpdtfReadGeneric( mfpdtf, (unsigned char *)&mfpdtf->read.fixedHeader, datalen );
++ r = MfpdtfReadGeneric( mfpdtf, (unsigned char *)&mfpdtf->read.fixedHeader, datalen );
+
+ if( r!= datalen )
+ {
+@@ -209,7 +209,7 @@
+
+ //READ( mfpdtf->read.pVariantHeader, datalen );
+
+- int r = MfpdtfReadGeneric( mfpdtf, (unsigned char *)mfpdtf->read.pVariantHeader, datalen );
++ r = MfpdtfReadGeneric( mfpdtf, (unsigned char *)mfpdtf->read.pVariantHeader, datalen );
+
+ if( r!= datalen )
+ {
+@@ -261,7 +261,7 @@
+
+ //READ( &id, datalen );
+
+- int r = MfpdtfReadGeneric( mfpdtf, (unsigned char *)&id, datalen );
++ r = MfpdtfReadGeneric( mfpdtf, (unsigned char *)&id, datalen );
+
+ if( r!= datalen )
+ {
+@@ -280,7 +280,7 @@
+ DBG( 0, "********************************** RASTER RECORD **********************************.\n" );
+ //READ( &mfpdtf->read.imageRasterDataHeader, datalen );
+
+- int r = MfpdtfReadGeneric( mfpdtf, (unsigned char *)&mfpdtf->read.imageRasterDataHeader, datalen );
++ r = MfpdtfReadGeneric( mfpdtf, (unsigned char *)&mfpdtf->read.imageRasterDataHeader, datalen );
+
+ if( r!= datalen )
+ {
+@@ -302,7 +302,7 @@
+ DBG( 0, "********************************** SOP RECORD **********************************.\n" );
+ //READ( &mfpdtf->read.imageStartPageRecord, datalen );
+
+- int r = MfpdtfReadGeneric( mfpdtf, (unsigned char *)&mfpdtf->read.imageStartPageRecord, datalen );
++ r = MfpdtfReadGeneric( mfpdtf, (unsigned char *)&mfpdtf->read.imageStartPageRecord, datalen );
+
+ if( r!= datalen )
+ {
+@@ -322,7 +322,7 @@
+ DBG( 0, "********************************** EOP RECORD **********************************.\n" );
+ //READ( &mfpdtf->read.imageEndPageRecord, datalen );
+
+- int r = MfpdtfReadGeneric( mfpdtf, (unsigned char *)&mfpdtf->read.imageEndPageRecord, datalen );
++ r = MfpdtfReadGeneric( mfpdtf, (unsigned char *)&mfpdtf->read.imageEndPageRecord, datalen );
+
+ if( r!= datalen )
+ {
diff --git a/print/hplip3/files/patch-scan_sane-pml.c b/print/hplip3/files/patch-scan_sane-pml.c
new file mode 100644
index 000000000000..0bb93d4eb03a
--- /dev/null
+++ b/print/hplip3/files/patch-scan_sane-pml.c
@@ -0,0 +1,20 @@
+--- scan/sane/pml.c.orig Tue May 23 15:13:18 2006
++++ scan/sane/pml.c Tue May 23 15:13:55 2006
+@@ -725,7 +725,7 @@
+ IP_IMAGE_TRAITS traits;
+ IP_XFORM_SPEC xforms[IP_MAX_XFORMS], * pXform = xforms;
+ int stat = SANE_STATUS_DEVICE_BUSY;
+- int i, bsize, state, wResult, index, r;
++ int i, bsize, state, wResult, index, r, mmWidth;
+ int oldStuff = (hpaio->preDenali || hpaio->fromDenali || hpaio->denali) ? 1 : 0;
+
+ if (hpaio->cmd_channelid < 0)
+@@ -919,7 +919,7 @@
+ hpaio->scanParameters.lines = MILLIMETERS_TO_PIXELS(hpaio->bryRange.max, hpaio->effectiveResolution);
+ }
+
+- int mmWidth = PIXELS_TO_MILLIMETERS(traits.iPixelsPerRow, hpaio->effectiveResolution);
++ mmWidth = PIXELS_TO_MILLIMETERS(traits.iPixelsPerRow, hpaio->effectiveResolution);
+
+ /* Set up X_CROP xform. */
+ pXform->aXformInfo[IP_CROP_LEFT].dword = MILLIMETERS_TO_PIXELS( hpaio->effectiveTlx, hpaio->effectiveResolution );
diff --git a/print/hplip3/files/patch-scan_sane_hpaio.c b/print/hplip3/files/patch-scan_sane_hpaio.c
new file mode 100644
index 000000000000..a3422498486e
--- /dev/null
+++ b/print/hplip3/files/patch-scan_sane_hpaio.c
@@ -0,0 +1,63 @@
+--- scan/sane/hpaio.c.orig Tue May 23 15:40:36 2006
++++ scan/sane/hpaio.c Tue May 23 15:08:07 2006
+@@ -1632,10 +1632,11 @@
+ extern SANE_Status sane_hpaio_get_parameters( SANE_Handle handle,
+ SANE_Parameters * pParams )
+ {
+- DBG( 0, "\nhpaio: sane_hpaio_get_parameters()\n" );
+-
+ hpaioScanner_t hpaio = ( hpaioScanner_t ) handle;
+ char * s = "";
++
++ DBG( 0, "\nhpaio: sane_hpaio_get_parameters()\n" );
++
+ if( !hpaio->hJob )
+ {
+ *pParams = hpaio->prescanParameters;
+@@ -2100,8 +2101,6 @@
+ extern SANE_Status sane_hpaio_open( SANE_String_Const devicename,
+ SANE_Handle * pHandle )
+ {
+- DBG( 0, "\nhpaio:sane_hpaio_open(%s) *******************************************************************************************\n", devicename );
+-
+ SANE_Status retcode = SANE_STATUS_INVAL;
+ hpaioScanner_t hpaio = 0;
+ int r;
+@@ -2114,6 +2113,7 @@
+ char devname[256];
+ MsgAttributes ma;
+
++ DBG( 0, "\nhpaio:sane_hpaio_open(%s) *******************************************************************************************\n", devicename );
+ hpaio = hpaioFindScanner( devicename );
+
+ if( hpaio )
+@@ -2878,6 +2878,8 @@
+ IP_IMAGE_TRAITS traits;
+ IP_XFORM_SPEC xforms[IP_MAX_XFORMS], * pXform = xforms;
+ WORD wResult;
++ int lines, pixelsPerLine;
++ int log_output;
+
+ DBG( 0, "\nhpaio: sane_hpaio_start() ******************************************************************************************* \n" );
+
+@@ -2953,8 +2955,6 @@
+
+ // if( hpaio->scannerType == SCANNER_TYPE_SCL )
+ // {
+- int lines, pixelsPerLine;
+-
+ /* Inquire exact image dimensions. */
+ if( SclInquire( hpaio->deviceid, hpaio->scan_channelid, SCL_CMD_INQUIRE_DEVICE_PARAMETER, SCL_INQ_NUMBER_OF_SCAN_LINES,
+ &lines, 0, 0 ) == SANE_STATUS_GOOD )
+@@ -2979,9 +2979,9 @@
+ MfpdtfReadStart( hpaio->mfpdtf ); /* inits mfpdtf */
+
+ #ifdef HPAIO_DEBUG
+- int log_output=1;
++ log_output=1;
+ #else
+- int log_output=0;
++ log_output=0;
+ #endif
+
+ if( log_output )
diff --git a/print/hplip3/files/patch-scan_sane_io.c b/print/hplip3/files/patch-scan_sane_io.c
new file mode 100644
index 000000000000..4a553d26fefb
--- /dev/null
+++ b/print/hplip3/files/patch-scan_sane_io.c
@@ -0,0 +1,38 @@
+--- scan/sane/io.c.orig Tue May 23 15:15:04 2006
++++ scan/sane/io.c Tue May 23 15:17:40 2006
+@@ -210,6 +210,13 @@
+ {
+ char message[ BUFFER_SIZE ];
+ MsgAttributes ma;
++ int remaining;
++ char *p;
++ int state = 0;
++ int d = 0;
++ char * uri = NULL;
++ char * mdl = NULL;
++
+
+ int len = sprintf( message, "msg=ProbeDevicesFiltered\nbus=%s\nfilter=scan\nformat=default\n",
+ "usb,cups,par" );
+@@ -228,18 +235,14 @@
+
+ hplip_ParseMsg( message, len, &ma );
+
+- int d = 0;
+- char * uri = NULL;
+- char * mdl = NULL;
+-
+ if( ma.ndevice > 0 )
+ {
+ *devices = malloc( sizeof( SANE_Device * ) * ( ma.ndevice + 1 ) );
+
+- int remaining = ma.length;
+- char *p = (char *)ma.data;
++ remaining = ma.length;
++ p = (char *)ma.data;
+
+- int state = 0;
++ state = 0;
+
+ while( remaining > 0 && *p != '\0' && d < ma.ndevice )
+ {