|
|
62d711 |
diff --git a/Makefile.am b/Makefile.am
|
|
|
62d711 |
index 62a25d3..2c4d6f8 100644
|
|
|
62d711 |
--- a/Makefile.am
|
|
|
62d711 |
+++ b/Makefile.am
|
|
|
62d711 |
@@ -3,7 +3,7 @@
|
|
|
62d711 |
#
|
|
|
62d711 |
# (c) 2004-2015 Copyright HP Development Company, LP
|
|
|
62d711 |
# Author: David Suffield, Naga Samrat Chowdary Narla, Sarbeswar Meher
|
|
|
62d711 |
-INCLUDES = -Iip -Iio/hpmud -Iscan/sane -Iprnt/hpijs -Icommon/
|
|
|
62d711 |
+INCLUDES = -Iip -Iio/hpmud -Iscan/sane -Iprnt/hpijs -Icommon/ -Iprotocol
|
|
|
62d711 |
CFLAGS+= -DCONFDIR=\"$(hplip_confdir)\"
|
|
|
62d711 |
CXXFLAGS+= -DCONFDIR=\"$(hplip_confdir)\"
|
|
|
62d711 |
|
|
|
62d711 |
@@ -304,7 +304,7 @@ dist_pcard_DATA = pcard/__init__.py pcard/photocard.py
|
|
|
62d711 |
pcardextdir = $(pyexecdir)
|
|
|
62d711 |
pcardext_LTLIBRARIES = pcardext.la
|
|
|
62d711 |
pcardext_la_LDFLAGS = -module -avoid-version
|
|
|
62d711 |
-pcardext_la_SOURCES = pcard/pcardext/pcardext.c pcard/fat.c
|
|
|
62d711 |
+pcardext_la_SOURCES = pcard/pcardext/pcardext.c pcard/fat.c pcard/pcardext/pcardext.h
|
|
|
62d711 |
pcardext_la_CFLAGS = -I$(PYTHONINCLUDEDIR)
|
|
|
62d711 |
|
|
|
62d711 |
# prnt
|
|
|
62d711 |
@@ -316,7 +316,7 @@ lib_LTLIBRARIES += libhpipp.la
|
|
|
62d711 |
#hpipp_LTLIBRARIES = hpipp.la
|
|
|
62d711 |
#hpipp_la_LDFLAGS = -module -avoid-version
|
|
|
62d711 |
libhpipp_la_SOURCES = protocol/hp_ipp.c protocol/hp_ipp.h protocol/hp_ipp_i.h
|
|
|
62d711 |
-libhpipp_la_CFLAGS = -DCONFDIR=\"$(hplip_confdir)\"
|
|
|
62d711 |
+libhpipp_la_CFLAGS = -DCONFDIR=\"$(hplip_confdir)\" -D_GNU_SOURCE
|
|
|
62d711 |
libhpipp_la_LDFLAGS = -version-info 0:1:0
|
|
|
62d711 |
libhpipp_la_LIBADD = libhpmud.la
|
|
|
62d711 |
|
|
|
62d711 |
diff --git a/common/utils.c b/common/utils.c
|
|
|
62d711 |
index d8ecee9..def4e47 100644
|
|
|
62d711 |
--- a/common/utils.c
|
|
|
62d711 |
+++ b/common/utils.c
|
|
|
62d711 |
@@ -1,5 +1,9 @@
|
|
|
62d711 |
+#ifndef _GNU_SOURCE
|
|
|
62d711 |
+#define _GNU_SOURCE
|
|
|
62d711 |
+#endif
|
|
|
62d711 |
+
|
|
|
62d711 |
#include "utils.h"
|
|
|
62d711 |
-#include "string.h"
|
|
|
62d711 |
+#include <string.h>
|
|
|
62d711 |
#include <dlfcn.h>
|
|
|
62d711 |
#include <sys/stat.h>
|
|
|
62d711 |
#include <errno.h>
|
|
|
62d711 |
diff --git a/io/hpmud/hpmud.c b/io/hpmud/hpmud.c
|
|
|
62d711 |
index 0eb6fff..358f279 100644
|
|
|
62d711 |
--- a/io/hpmud/hpmud.c
|
|
|
62d711 |
+++ b/io/hpmud/hpmud.c
|
|
|
62d711 |
@@ -759,6 +759,7 @@ enum HPMUD_RESULT hpmud_get_dstat(HPMUD_DEVICE dd, struct hpmud_dstat *ds)
|
|
|
62d711 |
}
|
|
|
62d711 |
|
|
|
62d711 |
strncpy(ds->uri, msp->device[dd].uri, sizeof(ds->uri));
|
|
|
62d711 |
+ ds->uri[sizeof(ds->uri)-1] = '\0';
|
|
|
62d711 |
ds->io_mode = msp->device[dd].io_mode;
|
|
|
62d711 |
ds->channel_cnt = msp->device[dd].channel_cnt;
|
|
|
62d711 |
ds->mlc_up = msp->device[dd].mlc_up;
|
|
|
62d711 |
diff --git a/io/hpmud/jd.c b/io/hpmud/jd.c
|
|
|
62d711 |
index 06f5072..20df27a 100644
|
|
|
62d711 |
--- a/io/hpmud/jd.c
|
|
|
62d711 |
+++ b/io/hpmud/jd.c
|
|
|
62d711 |
@@ -31,6 +31,7 @@
|
|
|
62d711 |
#endif
|
|
|
62d711 |
|
|
|
62d711 |
#include <signal.h>
|
|
|
62d711 |
+#include <stdlib.h>
|
|
|
62d711 |
#include "hpmud.h"
|
|
|
62d711 |
#include "hpmudi.h"
|
|
|
62d711 |
|
|
|
62d711 |
diff --git a/io/hpmud/model.c b/io/hpmud/model.c
|
|
|
62d711 |
index 4ea8990..a917d69 100644
|
|
|
62d711 |
--- a/io/hpmud/model.c
|
|
|
62d711 |
+++ b/io/hpmud/model.c
|
|
|
62d711 |
@@ -117,6 +117,7 @@ static int ReadConfig()
|
|
|
62d711 |
if (rcbuf[0] == '[')
|
|
|
62d711 |
{
|
|
|
62d711 |
strncpy(section, rcbuf, sizeof(section)); /* found new section */
|
|
|
62d711 |
+ section[sizeof(section)-1] = '\0';
|
|
|
62d711 |
continue;
|
|
|
62d711 |
}
|
|
|
62d711 |
|
|
|
62d711 |
@@ -125,6 +126,7 @@ static int ReadConfig()
|
|
|
62d711 |
if ((strncasecmp(section, "[dirs]", 6) == 0) && (strcasecmp(key, "home") == 0))
|
|
|
62d711 |
{
|
|
|
62d711 |
strncpy(homedir, value, sizeof(homedir));
|
|
|
62d711 |
+ homedir[sizeof(homedir)-1] = '\0';
|
|
|
62d711 |
break; /* done */
|
|
|
62d711 |
}
|
|
|
62d711 |
}
|
|
|
62d711 |
diff --git a/io/hpmud/musb.c b/io/hpmud/musb.c
|
|
|
62d711 |
index 6e99c15..755493e 100644
|
|
|
62d711 |
--- a/io/hpmud/musb.c
|
|
|
62d711 |
+++ b/io/hpmud/musb.c
|
|
|
62d711 |
@@ -775,7 +775,7 @@ static int device_id(int fd, unsigned char *buffer, int size)
|
|
|
62d711 |
len = size-1; /* leave byte for zero termination */
|
|
|
62d711 |
if (len > 2)
|
|
|
62d711 |
len -= 2;
|
|
|
62d711 |
- memcpy(buffer, buffer+2, len); /* remove length */
|
|
|
62d711 |
+ memmove(buffer, buffer+2, len); /* remove length */
|
|
|
62d711 |
buffer[len]=0;
|
|
|
62d711 |
DBG("read actual device_id successfully fd=%d len=%d\n", fd, len);
|
|
|
62d711 |
|
|
|
62d711 |
diff --git a/io/hpmud/pp.c b/io/hpmud/pp.c
|
|
|
62d711 |
index 74c5fdc..021d627 100644
|
|
|
62d711 |
--- a/io/hpmud/pp.c
|
|
|
62d711 |
+++ b/io/hpmud/pp.c
|
|
|
62d711 |
@@ -632,7 +632,7 @@ static int device_id(int fd, char *buffer, int size)
|
|
|
62d711 |
len = size-1; /* leave byte for zero termination */
|
|
|
62d711 |
if (len > 2)
|
|
|
62d711 |
len -= 2;
|
|
|
62d711 |
- memcpy(buffer, buffer+2, len); /* remove length */
|
|
|
62d711 |
+ memmove(buffer, buffer+2, len); /* remove length */
|
|
|
62d711 |
buffer[len]=0;
|
|
|
62d711 |
|
|
|
62d711 |
DBG("read actual device_id successfully fd=%d len=%d\n", fd, len);
|
|
|
62d711 |
diff --git a/pcard/fat.c b/pcard/fat.c
|
|
|
62d711 |
index caa383f..e1425c0 100644
|
|
|
62d711 |
--- a/pcard/fat.c
|
|
|
62d711 |
+++ b/pcard/fat.c
|
|
|
62d711 |
@@ -519,14 +519,17 @@ int FatFreeSpace(void)
|
|
|
62d711 |
|
|
|
62d711 |
int FatDiskAttributes( PHOTO_CARD_ATTRIBUTES * pa )
|
|
|
62d711 |
{
|
|
|
62d711 |
- strncpy( pa->OEMID, bpb.OEMID, 8 );
|
|
|
62d711 |
+ strncpy(pa->OEMID, bpb.OEMID, sizeof(pa->OEMID));
|
|
|
62d711 |
+ pa->OEMID[sizeof(pa->OEMID)-1] = '\0';
|
|
|
62d711 |
pa->BytesPerSector = bpb.BytesPerSector;
|
|
|
62d711 |
pa->SectorsPerCluster = bpb.SectorsPerCluster;
|
|
|
62d711 |
pa->ReservedSectors = bpb.ReservedSectors;
|
|
|
62d711 |
pa->SectorsPerFat = bpb.SectorsPerFat;
|
|
|
62d711 |
pa->RootEntries = bpb.RootEntries;
|
|
|
62d711 |
- strncpy( pa->SystemID, (char *)bpb.SystemID, 8 );
|
|
|
62d711 |
- strncpy( pa->VolumeLabel, (char *)bpb.VolumeLabel, 11 );
|
|
|
62d711 |
+ strncpy(pa->SystemID, (char *)bpb.SystemID, sizeof(pa->SystemID));
|
|
|
62d711 |
+ pa->SystemID[sizeof(pa->SystemID)-1] = '\0';
|
|
|
62d711 |
+ strncpy(pa->VolumeLabel, (char *)bpb.VolumeLabel, sizeof(pa->VolumeLabel));
|
|
|
62d711 |
+ pa->VolumeLabel[sizeof(pa->VolumeLabel)-1] = '\0';
|
|
|
62d711 |
pa->WriteProtect = da.WriteProtect;
|
|
|
62d711 |
|
|
|
62d711 |
return 0;
|
|
|
62d711 |
@@ -741,6 +744,7 @@ int FatSetCWD(char *dir)
|
|
|
62d711 |
return 1;
|
|
|
62d711 |
|
|
|
62d711 |
strncpy(cwd.Name, fa.Name, sizeof(cwd.Name));
|
|
|
62d711 |
+ cwd.Name[sizeof(cwd.Name)-1] = '\0';
|
|
|
62d711 |
cwd.StartSector = ConvertClusterToSector(fa.StartCluster);
|
|
|
62d711 |
cwd.CurrSector = cwd.StartSector;
|
|
|
62d711 |
cwd.StartCluster = fa.StartCluster;
|
|
|
62d711 |
diff --git a/prnt/hpcups/genPCLm.cpp b/prnt/hpcups/genPCLm.cpp
|
|
|
62d711 |
index c0cdc73..4db4bde 100644
|
|
|
62d711 |
--- a/prnt/hpcups/genPCLm.cpp
|
|
|
62d711 |
+++ b/prnt/hpcups/genPCLm.cpp
|
|
|
62d711 |
@@ -1237,11 +1237,16 @@ void PCLmGenerator::writeJobTicket()
|
|
|
62d711 |
char orientation[256];
|
|
|
62d711 |
char duplex[256];
|
|
|
62d711 |
char colorthemes[256];
|
|
|
62d711 |
- strncpy(colorthemes,getColorThemesString(m_pPCLmSSettings->colorTheme),256);
|
|
|
62d711 |
- strncpy(inputBin,getInputBinString(m_pPCLmSSettings->userInputBin),256);
|
|
|
62d711 |
- strncpy(outputBin,getOutputBin(m_pPCLmSSettings->userOutputBin),256);
|
|
|
62d711 |
- strncpy(orientation,getOrientationString(m_pPCLmSSettings->userOrientation),256);
|
|
|
62d711 |
- strncpy(duplex,getDuplexString(currDuplexDisposition),256);
|
|
|
62d711 |
+ strncpy(colorthemes,getColorThemesString(m_pPCLmSSettings->colorTheme), sizeof(colorthemes));
|
|
|
62d711 |
+ colorthemes[sizeof(colorthemes)-1] = '\0';
|
|
|
62d711 |
+ strncpy(inputBin,getInputBinString(m_pPCLmSSettings->userInputBin), sizeof(inputBin));
|
|
|
62d711 |
+ inputBin[sizeof(inputBin)-1] = '\0';
|
|
|
62d711 |
+ strncpy(outputBin,getOutputBin(m_pPCLmSSettings->userOutputBin), sizeof(outputBin));
|
|
|
62d711 |
+ outputBin[sizeof(outputBin)-1] = '\0';
|
|
|
62d711 |
+ strncpy(orientation,getOrientationString(m_pPCLmSSettings->userOrientation), sizeof(orientation));
|
|
|
62d711 |
+ orientation[sizeof(orientation)-1] = '\0';
|
|
|
62d711 |
+ strncpy(duplex,getDuplexString(currDuplexDisposition), sizeof(duplex));
|
|
|
62d711 |
+ duplex[sizeof(duplex)-1] = '\0';
|
|
|
62d711 |
|
|
|
62d711 |
snprintf(pOutStr,OUT_STR_SIZE,"%% genPCLm (Ver: %f)\n",PCLM_Ver); writeStr2OutBuff(pOutStr);
|
|
|
62d711 |
snprintf(pOutStr,OUT_STR_SIZE,"%%============= Job Ticket =============\n"); writeStr2OutBuff(pOutStr);
|
|
|
62d711 |
@@ -1635,7 +1640,10 @@ int PCLmGenerator::StartPage(PCLmPageSetup *PCLmPageContent, void **pOutBuffer,
|
|
|
62d711 |
}
|
|
|
62d711 |
|
|
|
62d711 |
if(strlen(PCLmPageContent->mediaSizeName))
|
|
|
62d711 |
- strncpy(currMediaName,PCLmPageContent->mediaSizeName,256);
|
|
|
62d711 |
+ {
|
|
|
62d711 |
+ strncpy(currMediaName,PCLmPageContent->mediaSizeName, sizeof(currMediaName));
|
|
|
62d711 |
+ currMediaName[sizeof(currMediaName)-1] = '\0';
|
|
|
62d711 |
+ }
|
|
|
62d711 |
|
|
|
62d711 |
currStripHeight=PCLmPageContent->stripHeight;
|
|
|
62d711 |
if(!currStripHeight)
|
|
|
62d711 |
diff --git a/prnt/hpijs/context2.cpp b/prnt/hpijs/context2.cpp
|
|
|
62d711 |
index c3df482..19490b1 100644
|
|
|
62d711 |
--- a/prnt/hpijs/context2.cpp
|
|
|
62d711 |
+++ b/prnt/hpijs/context2.cpp
|
|
|
62d711 |
@@ -1302,6 +1302,7 @@ DRIVER_ERROR PrintContext::SelectDevice
|
|
|
62d711 |
if(0 == strnlen((const char *)pSS->strDevID, DevIDBuffSize))
|
|
|
62d711 |
{
|
|
|
62d711 |
strncpy((char *)pSS->strDevID,szDeviceId,DevIDBuffSize);
|
|
|
62d711 |
+ pSS->strDevID[sizeof(pSS->strDevID)-1] = '\0';
|
|
|
62d711 |
}
|
|
|
62d711 |
thePrinter = pPFI->CreatePrinter (pSS, familyHandle);
|
|
|
62d711 |
if (thePrinter->constructor_error != NO_ERROR)
|
|
|
62d711 |
diff --git a/prnt/hpijs/systemservices.cpp b/prnt/hpijs/systemservices.cpp
|
|
|
62d711 |
index 95f5a64..f5b4bb5 100644
|
|
|
62d711 |
--- a/prnt/hpijs/systemservices.cpp
|
|
|
62d711 |
+++ b/prnt/hpijs/systemservices.cpp
|
|
|
62d711 |
@@ -396,7 +396,10 @@ void SystemServices::AdjustIO(IO_MODE IM, const char* model)
|
|
|
62d711 |
IOMode.bDevID =IM.bDevID && IOMode.bDevID;
|
|
|
62d711 |
|
|
|
62d711 |
if (model)
|
|
|
62d711 |
+ {
|
|
|
62d711 |
strncpy(strModel,model, sizeof(strModel));
|
|
|
62d711 |
+ strModel[sizeof(strModel)-1] = '\0';
|
|
|
62d711 |
+ }
|
|
|
62d711 |
}
|
|
|
62d711 |
|
|
|
62d711 |
APDK_END_NAMESPACE
|
|
|
62d711 |
diff --git a/prnt/hpps/hppsfilter.c b/prnt/hpps/hppsfilter.c
|
|
|
62d711 |
index 5879a70..d246041 100644
|
|
|
62d711 |
--- a/prnt/hpps/hppsfilter.c
|
|
|
62d711 |
+++ b/prnt/hpps/hppsfilter.c
|
|
|
62d711 |
@@ -230,13 +230,13 @@ static void WriteHeader(char **argument)
|
|
|
62d711 |
/* Writing Header Information
|
|
|
62d711 |
argument[1] = JOB ID , argument[2]= USERNAME, argument[3] = TITLE */
|
|
|
62d711 |
hpwrite("\x1b%-12345X@PJL JOBNAME=", strlen("\x1b%-12345X@PJL JOBNAME="));
|
|
|
62d711 |
- sprintf(buffer, "hplip_%s_%s\x0a", argument[2], argument[1]);
|
|
|
62d711 |
+ snprintf(buffer, MAX_BUFFER-1, "hplip_%s_%s\x0a", argument[2], argument[1]);
|
|
|
62d711 |
hpwrite(buffer, strlen(buffer));
|
|
|
62d711 |
memset(buffer, 0, sizeof(buffer));
|
|
|
62d711 |
- sprintf(buffer, "@PJL SET USERNAME=\"%s\"\x0a", argument[2]);
|
|
|
62d711 |
+ snprintf(buffer, MAX_BUFFER-1, "@PJL SET USERNAME=\"%s\"\x0a", argument[2]);
|
|
|
62d711 |
hpwrite(buffer, strlen(buffer));
|
|
|
62d711 |
memset(buffer, 0, sizeof(buffer));
|
|
|
62d711 |
- sprintf(buffer, "@PJL SET JOBNAME=\"%s\"\x0a", argument[3]);
|
|
|
62d711 |
+ snprintf(buffer, MAX_BUFFER-1, "@PJL SET JOBNAME=\"%s\"\x0a", argument[3]);
|
|
|
62d711 |
hpwrite(buffer, strlen(buffer));
|
|
|
62d711 |
fprintf(stderr, "HP PS filter func = WriteHeader : WRITING PJL HEADER INFO\n");
|
|
|
62d711 |
return;
|
|
|
62d711 |
diff --git a/protocol/discovery/mdns.c b/protocol/discovery/mdns.c
|
|
|
62d711 |
index abca295..8dd6fa5 100644
|
|
|
62d711 |
--- a/protocol/discovery/mdns.c
|
|
|
62d711 |
+++ b/protocol/discovery/mdns.c
|
|
|
62d711 |
@@ -31,6 +31,10 @@
|
|
|
62d711 |
#include <netinet/in.h>
|
|
|
62d711 |
#include <netdb.h>
|
|
|
62d711 |
#include <arpa/inet.h>
|
|
|
62d711 |
+#include <unistd.h>
|
|
|
62d711 |
+#include <ctype.h>
|
|
|
62d711 |
+#include <stdio.h>
|
|
|
62d711 |
+#include <stdlib.h>
|
|
|
62d711 |
#include "mdns.h"
|
|
|
62d711 |
|
|
|
62d711 |
/* Convert "www.google.com" to "3www6google3com". */
|
|
|
62d711 |
diff --git a/protocol/hp_ipp.h b/protocol/hp_ipp.h
|
|
|
62d711 |
index 3853f84..de76202 100644
|
|
|
62d711 |
--- a/protocol/hp_ipp.h
|
|
|
62d711 |
+++ b/protocol/hp_ipp.h
|
|
|
62d711 |
@@ -166,5 +166,10 @@ int getCupsPrinters(printer_t **printer_list);
|
|
|
62d711 |
HPIPP_RESULT parseResponseHeader(char* header, int *content_length, int *chunked, int* header_size);
|
|
|
62d711 |
HPIPP_RESULT prepend_http_header(raw_ipp *raw_request);
|
|
|
62d711 |
enum HPMUD_RESULT sendUSBRequest(char *buf, int size, raw_ipp *responseptr, char * device_uri);
|
|
|
62d711 |
+void _releaseCupsInstance();
|
|
|
62d711 |
+int addCupsPrinter(char *name, char *device_uri, char *location, char *ppd_file, char *model, char *info);
|
|
|
62d711 |
+int delCupsPrinter(char *pr_name);
|
|
|
62d711 |
+int setDefaultCupsPrinter(char *pr_name);
|
|
|
62d711 |
+int controlCupsPrinter(char *pr_name, int op);
|
|
|
62d711 |
|
|
|
62d711 |
# endif //_IPP_H
|
|
|
62d711 |
diff --git a/scan/sane/bb_ledm.c b/scan/sane/bb_ledm.c
|
|
|
62d711 |
index b233d1e..7ba0edf 100644
|
|
|
62d711 |
--- a/scan/sane/bb_ledm.c
|
|
|
62d711 |
+++ b/scan/sane/bb_ledm.c
|
|
|
62d711 |
@@ -26,6 +26,7 @@
|
|
|
62d711 |
# include "http.h"
|
|
|
62d711 |
# include "xml.h"
|
|
|
62d711 |
# include <stdlib.h>
|
|
|
62d711 |
+# include <unistd.h>
|
|
|
62d711 |
|
|
|
62d711 |
# include <stdint.h>
|
|
|
62d711 |
|
|
|
62d711 |
diff --git a/scan/sane/common.h b/scan/sane/common.h
|
|
|
62d711 |
index 0f67542..e496a74 100644
|
|
|
62d711 |
--- a/scan/sane/common.h
|
|
|
62d711 |
+++ b/scan/sane/common.h
|
|
|
62d711 |
@@ -36,7 +36,7 @@
|
|
|
62d711 |
#define _STRINGIZE(x) #x
|
|
|
62d711 |
#define STRINGIZE(x) _STRINGIZE(x)
|
|
|
62d711 |
|
|
|
62d711 |
-#define BUG(args...) {syslog(LOG_ERR, __FILE__ " " STRINGIZE(__LINE__) ": " args); DBG(2, __FILE__ " " STRINGIZE(__LINE__) ": " args);}
|
|
|
62d711 |
+#define BUG_SCAN(args...) {syslog(LOG_ERR, __FILE__ " " STRINGIZE(__LINE__) ": " args); DBG(2, __FILE__ " " STRINGIZE(__LINE__) ": " args);}
|
|
|
62d711 |
#define BUG_DUMP(data, size) bugdump((data), (size))
|
|
|
62d711 |
#define BUG_SZ(args...) {syslog(LOG_ERR, args); DBG(2, args);}
|
|
|
62d711 |
|
|
|
62d711 |
diff --git a/scan/sane/escl.c b/scan/sane/escl.c
|
|
|
62d711 |
index af45bff..4f59b21 100644
|
|
|
62d711 |
--- a/scan/sane/escl.c
|
|
|
62d711 |
+++ b/scan/sane/escl.c
|
|
|
62d711 |
@@ -795,7 +795,7 @@ SANE_Status escl_control_option(SANE_Handle handle, SANE_Int option, SANE_Action
|
|
|
62d711 |
//DBG8("escl_control_option (option=%s) action=%d\n", ps->option[option].name, action);
|
|
|
62d711 |
if (stat != SANE_STATUS_GOOD)
|
|
|
62d711 |
{
|
|
|
62d711 |
- BUG("control_option failed: option=%s action=%s\n", ps->option[option].name, action==SANE_ACTION_GET_VALUE ? "get" : action==SANE_ACTION_SET_VALUE ? "set" : "auto");
|
|
|
62d711 |
+ BUG_SCAN("control_option failed: option=%s action=%s\n", ps->option[option].name, action==SANE_ACTION_GET_VALUE ? "get" : action==SANE_ACTION_SET_VALUE ? "set" : "auto");
|
|
|
62d711 |
}
|
|
|
62d711 |
|
|
|
62d711 |
return stat;
|
|
|
62d711 |
@@ -1102,7 +1102,7 @@ void escl_close(SANE_Handle handle)
|
|
|
62d711 |
|
|
|
62d711 |
if (ps == NULL || ps != session)
|
|
|
62d711 |
{
|
|
|
62d711 |
- BUG("invalid sane_close\n");
|
|
|
62d711 |
+ BUG_SCAN("invalid sane_close\n");
|
|
|
62d711 |
return;
|
|
|
62d711 |
}
|
|
|
62d711 |
|
|
|
62d711 |
diff --git a/scan/sane/hpaio.c b/scan/sane/hpaio.c
|
|
|
62d711 |
index ae34cfb..ffde2ad 100644
|
|
|
62d711 |
--- a/scan/sane/hpaio.c
|
|
|
62d711 |
+++ b/scan/sane/hpaio.c
|
|
|
62d711 |
@@ -41,6 +41,7 @@
|
|
|
62d711 |
#include "soap.h"
|
|
|
62d711 |
#include "soapht.h"
|
|
|
62d711 |
#include "marvell.h"
|
|
|
62d711 |
+#include "mdns.h"
|
|
|
62d711 |
#include "hpaio.h"
|
|
|
62d711 |
#include "ledm.h"
|
|
|
62d711 |
#include "sclpml.h"
|
|
|
62d711 |
diff --git a/scan/sane/http.c b/scan/sane/http.c
|
|
|
62d711 |
index 800df91..45668cd 100644
|
|
|
62d711 |
--- a/scan/sane/http.c
|
|
|
62d711 |
+++ b/scan/sane/http.c
|
|
|
62d711 |
@@ -36,6 +36,7 @@
|
|
|
62d711 |
#include <string.h>
|
|
|
62d711 |
#include <syslog.h>
|
|
|
62d711 |
#include <ctype.h>
|
|
|
62d711 |
+#include <unistd.h>
|
|
|
62d711 |
#include "hpmud.h"
|
|
|
62d711 |
#include "http.h"
|
|
|
62d711 |
|
|
|
62d711 |
diff --git a/scan/sane/io.c b/scan/sane/io.c
|
|
|
62d711 |
index 4508458..7bbddea 100755
|
|
|
62d711 |
--- a/scan/sane/io.c
|
|
|
62d711 |
+++ b/scan/sane/io.c
|
|
|
62d711 |
@@ -50,7 +50,7 @@ int __attribute__ ((visibility ("hidden"))) InitDbus(void)
|
|
|
62d711 |
|
|
|
62d711 |
if (dbus_error_is_set(&dbus_err))
|
|
|
62d711 |
{
|
|
|
62d711 |
- BUG("dBus Connection Error (%s)!\n", dbus_err.message);
|
|
|
62d711 |
+ BUG_SCAN("dBus Connection Error (%s)!\n", dbus_err.message);
|
|
|
62d711 |
dbus_error_free(&dbus_err);
|
|
|
62d711 |
}
|
|
|
62d711 |
|
|
|
62d711 |
@@ -79,7 +79,7 @@ int __attribute__ ((visibility ("hidden"))) SendScanEvent(char *device_uri, int
|
|
|
62d711 |
|
|
|
62d711 |
if (NULL == msg)
|
|
|
62d711 |
{
|
|
|
62d711 |
- BUG("dbus message is NULL!\n");
|
|
|
62d711 |
+ BUG_SCAN("dbus message is NULL!\n");
|
|
|
62d711 |
return 0;
|
|
|
62d711 |
}
|
|
|
62d711 |
|
|
|
62d711 |
@@ -94,7 +94,7 @@ int __attribute__ ((visibility ("hidden"))) SendScanEvent(char *device_uri, int
|
|
|
62d711 |
|
|
|
62d711 |
if (!dbus_connection_send(dbus_conn, msg, NULL))
|
|
|
62d711 |
{
|
|
|
62d711 |
- BUG("dbus message send failed!\n");
|
|
|
62d711 |
+ BUG_SCAN("dbus message send failed!\n");
|
|
|
62d711 |
return 0;
|
|
|
62d711 |
}
|
|
|
62d711 |
|
|
|
62d711 |
diff --git a/scan/sane/ledm.c b/scan/sane/ledm.c
|
|
|
62d711 |
index 9a1ff02..07ab5b0 100644
|
|
|
62d711 |
--- a/scan/sane/ledm.c
|
|
|
62d711 |
+++ b/scan/sane/ledm.c
|
|
|
62d711 |
@@ -802,7 +802,7 @@ SANE_Status ledm_control_option(SANE_Handle handle, SANE_Int option, SANE_Action
|
|
|
62d711 |
|
|
|
62d711 |
if (stat != SANE_STATUS_GOOD)
|
|
|
62d711 |
{
|
|
|
62d711 |
- BUG("control_option failed: option=%s action=%s\n", ps->option[option].name, action==SANE_ACTION_GET_VALUE ? "get" : action==SANE_ACTION_SET_VALUE ? "set" : "auto");
|
|
|
62d711 |
+ BUG_SCAN("control_option failed: option=%s action=%s\n", ps->option[option].name, action==SANE_ACTION_GET_VALUE ? "get" : action==SANE_ACTION_SET_VALUE ? "set" : "auto");
|
|
|
62d711 |
}
|
|
|
62d711 |
|
|
|
62d711 |
return stat;
|
|
|
62d711 |
@@ -1067,7 +1067,7 @@ void ledm_close(SANE_Handle handle)
|
|
|
62d711 |
|
|
|
62d711 |
if (ps == NULL || ps != session)
|
|
|
62d711 |
{
|
|
|
62d711 |
- BUG("invalid sane_close\n");
|
|
|
62d711 |
+ BUG_SCAN("invalid sane_close\n");
|
|
|
62d711 |
return;
|
|
|
62d711 |
}
|
|
|
62d711 |
|
|
|
62d711 |
diff --git a/scan/sane/marvell.c b/scan/sane/marvell.c
|
|
|
62d711 |
index ad267a3..236f7c9 100644
|
|
|
62d711 |
--- a/scan/sane/marvell.c
|
|
|
62d711 |
+++ b/scan/sane/marvell.c
|
|
|
62d711 |
@@ -134,7 +134,7 @@ static int get_ip_data(struct marvell_session *ps, SANE_Byte *data, SANE_Int max
|
|
|
62d711 |
|
|
|
62d711 |
if (!ps->ip_handle)
|
|
|
62d711 |
{
|
|
|
62d711 |
- BUG("invalid ipconvert state\n");
|
|
|
62d711 |
+ BUG_SCAN("invalid ipconvert state\n");
|
|
|
62d711 |
goto bugout;
|
|
|
62d711 |
}
|
|
|
62d711 |
|
|
|
62d711 |
@@ -335,7 +335,7 @@ static struct marvell_session *create_session()
|
|
|
62d711 |
|
|
|
62d711 |
if ((ps = malloc(sizeof(struct marvell_session))) == NULL)
|
|
|
62d711 |
{
|
|
|
62d711 |
- BUG("malloc failed: %m\n");
|
|
|
62d711 |
+ BUG_SCAN("malloc failed: %m\n");
|
|
|
62d711 |
return NULL;
|
|
|
62d711 |
}
|
|
|
62d711 |
memset(ps, 0, sizeof(struct marvell_session));
|
|
|
62d711 |
@@ -402,7 +402,7 @@ SANE_Status marvell_open(SANE_String_Const device, SANE_Handle *handle)
|
|
|
62d711 |
|
|
|
62d711 |
if (session)
|
|
|
62d711 |
{
|
|
|
62d711 |
- BUG("session in use\n");
|
|
|
62d711 |
+ BUG_SCAN("session in use\n");
|
|
|
62d711 |
return SANE_STATUS_DEVICE_BUSY;
|
|
|
62d711 |
}
|
|
|
62d711 |
|
|
|
62d711 |
@@ -431,7 +431,7 @@ SANE_Status marvell_open(SANE_String_Const device, SANE_Handle *handle)
|
|
|
62d711 |
|
|
|
62d711 |
if (hpmud_open_device(session->uri, ma.mfp_mode, &session->dd) != HPMUD_R_OK)
|
|
|
62d711 |
{
|
|
|
62d711 |
- BUG("unable to open device %s\n", session->uri);
|
|
|
62d711 |
+ BUG_SCAN("unable to open device %s\n", session->uri);
|
|
|
62d711 |
goto bugout;
|
|
|
62d711 |
|
|
|
62d711 |
free(session);
|
|
|
62d711 |
@@ -441,7 +441,7 @@ SANE_Status marvell_open(SANE_String_Const device, SANE_Handle *handle)
|
|
|
62d711 |
|
|
|
62d711 |
if (hpmud_open_channel(session->dd, HPMUD_S_MARVELL_SCAN_CHANNEL, &session->cd) != HPMUD_R_OK)
|
|
|
62d711 |
{
|
|
|
62d711 |
- BUG("unable to open %s channel %s\n", HPMUD_S_MARVELL_SCAN_CHANNEL, session->uri);
|
|
|
62d711 |
+ BUG_SCAN("unable to open %s channel %s\n", HPMUD_S_MARVELL_SCAN_CHANNEL, session->uri);
|
|
|
62d711 |
stat = SANE_STATUS_DEVICE_BUSY;
|
|
|
62d711 |
goto bugout;
|
|
|
62d711 |
}
|
|
|
62d711 |
@@ -554,7 +554,7 @@ void marvell_close(SANE_Handle handle)
|
|
|
62d711 |
|
|
|
62d711 |
if (ps == NULL || ps != session)
|
|
|
62d711 |
{
|
|
|
62d711 |
- BUG("invalid sane_close\n");
|
|
|
62d711 |
+ BUG_SCAN("invalid sane_close\n");
|
|
|
62d711 |
return;
|
|
|
62d711 |
}
|
|
|
62d711 |
|
|
|
62d711 |
@@ -849,7 +849,7 @@ SANE_Status marvell_control_option(SANE_Handle handle, SANE_Int option, SANE_Act
|
|
|
62d711 |
stat = SANE_STATUS_GOOD;
|
|
|
62d711 |
break;
|
|
|
62d711 |
}
|
|
|
62d711 |
- BUG("value=%d brymin=%d brymax=%d\n", *int_value, ps->bryRange.min, ps->bryRange.max);
|
|
|
62d711 |
+ BUG_SCAN("value=%d brymin=%d brymax=%d\n", *int_value, ps->bryRange.min, ps->bryRange.max);
|
|
|
62d711 |
}
|
|
|
62d711 |
else
|
|
|
62d711 |
{ /* Set default. */
|
|
|
62d711 |
@@ -866,7 +866,7 @@ SANE_Status marvell_control_option(SANE_Handle handle, SANE_Int option, SANE_Act
|
|
|
62d711 |
|
|
|
62d711 |
if (stat != SANE_STATUS_GOOD)
|
|
|
62d711 |
{
|
|
|
62d711 |
- BUG("control_option failed: option=%s action=%s\n", ps->option[option].name,
|
|
|
62d711 |
+ BUG_SCAN("control_option failed: option=%s action=%s\n", ps->option[option].name,
|
|
|
62d711 |
action==SANE_ACTION_GET_VALUE ? "get" : action==SANE_ACTION_SET_VALUE ? "set" : "auto");
|
|
|
62d711 |
}
|
|
|
62d711 |
|
|
|
62d711 |
@@ -905,7 +905,7 @@ SANE_Status marvell_start(SANE_Handle handle)
|
|
|
62d711 |
|
|
|
62d711 |
if (set_extents(ps))
|
|
|
62d711 |
{
|
|
|
62d711 |
- BUG("invalid extents: tlx=%d brx=%d tly=%d bry=%d minwidth=%d minheight%d maxwidth=%d maxheight=%d\n",
|
|
|
62d711 |
+ BUG_SCAN("invalid extents: tlx=%d brx=%d tly=%d bry=%d minwidth=%d minheight%d maxwidth=%d maxheight=%d\n",
|
|
|
62d711 |
ps->currentTlx, ps->currentTly, ps->currentBrx, ps->currentBry, ps->min_width, ps->min_height, ps->tlxRange.max, ps->tlyRange.max);
|
|
|
62d711 |
stat = SANE_STATUS_INVAL;
|
|
|
62d711 |
goto bugout;
|
|
|
62d711 |
@@ -963,7 +963,7 @@ SANE_Status marvell_start(SANE_Handle handle)
|
|
|
62d711 |
/* Open image processor. */
|
|
|
62d711 |
if ((ret = ipOpen(pXform-xforms, xforms, 0, &ps->ip_handle)) != IP_DONE)
|
|
|
62d711 |
{
|
|
|
62d711 |
- BUG("unable open image processor: err=%d\n", ret);
|
|
|
62d711 |
+ BUG_SCAN("unable open image processor: err=%d\n", ret);
|
|
|
62d711 |
stat = SANE_STATUS_INVAL;
|
|
|
62d711 |
goto bugout;
|
|
|
62d711 |
}
|
|
|
62d711 |
@@ -1023,7 +1023,7 @@ SANE_Status marvell_read(SANE_Handle handle, SANE_Byte *data, SANE_Int maxLength
|
|
|
62d711 |
|
|
|
62d711 |
if(ret & (IP_INPUT_ERROR | IP_FATAL_ERROR))
|
|
|
62d711 |
{
|
|
|
62d711 |
- BUG("ipConvert error=%x\n", ret);
|
|
|
62d711 |
+ BUG_SCAN("ipConvert error=%x\n", ret);
|
|
|
62d711 |
goto bugout;
|
|
|
62d711 |
}
|
|
|
62d711 |
|
|
|
62d711 |
diff --git a/scan/sane/sclpml.c b/scan/sane/sclpml.c
|
|
|
62d711 |
index 9a5975f..dc8b32c 100644
|
|
|
62d711 |
--- a/scan/sane/sclpml.c
|
|
|
62d711 |
+++ b/scan/sane/sclpml.c
|
|
|
62d711 |
@@ -30,6 +30,7 @@
|
|
|
62d711 |
#include <unistd.h>
|
|
|
62d711 |
#include <fcntl.h>
|
|
|
62d711 |
#include <string.h>
|
|
|
62d711 |
+#include <sys/time.h>
|
|
|
62d711 |
#include "sane.h"
|
|
|
62d711 |
#include "saneopts.h"
|
|
|
62d711 |
#include "common.h"
|
|
|
62d711 |
@@ -2090,7 +2091,7 @@ void sclpml_close(SANE_Handle handle)
|
|
|
62d711 |
DBG(8, "sane_hpaio_close(): %s %d\n", __FILE__, __LINE__);
|
|
|
62d711 |
if (hpaio == NULL || hpaio != session)
|
|
|
62d711 |
{
|
|
|
62d711 |
- BUG("invalid sane_close\n");
|
|
|
62d711 |
+ BUG_SCAN("invalid sane_close\n");
|
|
|
62d711 |
return;
|
|
|
62d711 |
}
|
|
|
62d711 |
|
|
|
62d711 |
diff --git a/scan/sane/soap.c b/scan/sane/soap.c
|
|
|
62d711 |
index 07106fe..0d22e52 100644
|
|
|
62d711 |
--- a/scan/sane/soap.c
|
|
|
62d711 |
+++ b/scan/sane/soap.c
|
|
|
62d711 |
@@ -142,7 +142,7 @@ static int get_ip_data(struct soap_session *ps, SANE_Byte *data, SANE_Int maxLen
|
|
|
62d711 |
|
|
|
62d711 |
if (!ps->ip_handle)
|
|
|
62d711 |
{
|
|
|
62d711 |
- BUG("invalid ipconvert state\n");
|
|
|
62d711 |
+ BUG_SCAN("invalid ipconvert state\n");
|
|
|
62d711 |
goto bugout;
|
|
|
62d711 |
}
|
|
|
62d711 |
|
|
|
62d711 |
@@ -219,7 +219,7 @@ static struct soap_session *create_session()
|
|
|
62d711 |
|
|
|
62d711 |
if ((ps = malloc(sizeof(struct soap_session))) == NULL)
|
|
|
62d711 |
{
|
|
|
62d711 |
- BUG("malloc failed: %m\n");
|
|
|
62d711 |
+ BUG_SCAN("malloc failed: %m\n");
|
|
|
62d711 |
return NULL;
|
|
|
62d711 |
}
|
|
|
62d711 |
memset(ps, 0, sizeof(struct soap_session));
|
|
|
62d711 |
@@ -418,7 +418,7 @@ SANE_Status soap_open(SANE_String_Const device, SANE_Handle *handle)
|
|
|
62d711 |
|
|
|
62d711 |
if (session)
|
|
|
62d711 |
{
|
|
|
62d711 |
- BUG("session in use\n");
|
|
|
62d711 |
+ BUG_SCAN("session in use\n");
|
|
|
62d711 |
return SANE_STATUS_DEVICE_BUSY;
|
|
|
62d711 |
}
|
|
|
62d711 |
|
|
|
62d711 |
@@ -434,7 +434,7 @@ SANE_Status soap_open(SANE_String_Const device, SANE_Handle *handle)
|
|
|
62d711 |
|
|
|
62d711 |
if (hpmud_open_device(session->uri, ma.mfp_mode, &session->dd) != HPMUD_R_OK)
|
|
|
62d711 |
{
|
|
|
62d711 |
- BUG("unable to open device %s\n", session->uri);
|
|
|
62d711 |
+ BUG_SCAN("unable to open device %s\n", session->uri);
|
|
|
62d711 |
goto bugout;
|
|
|
62d711 |
|
|
|
62d711 |
free(session);
|
|
|
62d711 |
@@ -519,7 +519,7 @@ void soap_close(SANE_Handle handle)
|
|
|
62d711 |
|
|
|
62d711 |
if (ps == NULL || ps != session)
|
|
|
62d711 |
{
|
|
|
62d711 |
- BUG("invalid sane_close\n");
|
|
|
62d711 |
+ BUG_SCAN("invalid sane_close\n");
|
|
|
62d711 |
return;
|
|
|
62d711 |
}
|
|
|
62d711 |
|
|
|
62d711 |
@@ -824,7 +824,7 @@ SANE_Status soap_control_option(SANE_Handle handle, SANE_Int option, SANE_Action
|
|
|
62d711 |
|
|
|
62d711 |
if (stat != SANE_STATUS_GOOD)
|
|
|
62d711 |
{
|
|
|
62d711 |
- BUG("control_option failed: option=%s action=%s\n", ps->option[option].name,
|
|
|
62d711 |
+ BUG_SCAN("control_option failed: option=%s action=%s\n", ps->option[option].name,
|
|
|
62d711 |
action==SANE_ACTION_GET_VALUE ? "get" : action==SANE_ACTION_SET_VALUE ? "set" : "auto");
|
|
|
62d711 |
}
|
|
|
62d711 |
|
|
|
62d711 |
@@ -862,7 +862,7 @@ SANE_Status soap_start(SANE_Handle handle)
|
|
|
62d711 |
ps->user_cancel = 0;
|
|
|
62d711 |
if (set_extents(ps))
|
|
|
62d711 |
{
|
|
|
62d711 |
- BUG("invalid extents: tlx=%d brx=%d tly=%d bry=%d minwidth=%d minheight%d maxwidth=%d maxheight=%d\n",
|
|
|
62d711 |
+ BUG_SCAN("invalid extents: tlx=%d brx=%d tly=%d bry=%d minwidth=%d minheight%d maxwidth=%d maxheight=%d\n",
|
|
|
62d711 |
ps->currentTlx, ps->currentTly, ps->currentBrx, ps->currentBry, ps->min_width, ps->min_height, ps->tlxRange.max, ps->tlyRange.max);
|
|
|
62d711 |
stat = SANE_STATUS_INVAL;
|
|
|
62d711 |
goto bugout;
|
|
|
62d711 |
@@ -913,7 +913,7 @@ SANE_Status soap_start(SANE_Handle handle)
|
|
|
62d711 |
/* Open image processor. */
|
|
|
62d711 |
if ((ret = ipOpen(pXform-xforms, xforms, 0, &ps->ip_handle)) != IP_DONE)
|
|
|
62d711 |
{
|
|
|
62d711 |
- BUG("unable open image processor: err=%d\n", ret);
|
|
|
62d711 |
+ BUG_SCAN("unable open image processor: err=%d\n", ret);
|
|
|
62d711 |
stat = SANE_STATUS_INVAL;
|
|
|
62d711 |
goto bugout;
|
|
|
62d711 |
}
|
|
|
62d711 |
@@ -955,7 +955,7 @@ SANE_Status soap_start(SANE_Handle handle)
|
|
|
62d711 |
|
|
|
62d711 |
if (ret & (IP_INPUT_ERROR | IP_FATAL_ERROR | IP_DONE))
|
|
|
62d711 |
{
|
|
|
62d711 |
- BUG("ipConvert error=%x\n", ret);
|
|
|
62d711 |
+ BUG_SCAN("ipConvert error=%x\n", ret);
|
|
|
62d711 |
stat = SANE_STATUS_IO_ERROR;
|
|
|
62d711 |
goto bugout;
|
|
|
62d711 |
}
|
|
|
62d711 |
@@ -1007,7 +1007,7 @@ SANE_Status soap_read(SANE_Handle handle, SANE_Byte *data, SANE_Int maxLength, S
|
|
|
62d711 |
|
|
|
62d711 |
if(ret & (IP_INPUT_ERROR | IP_FATAL_ERROR))
|
|
|
62d711 |
{
|
|
|
62d711 |
- BUG("ipConvert error=%x\n", ret);
|
|
|
62d711 |
+ BUG_SCAN("ipConvert error=%x\n", ret);
|
|
|
62d711 |
goto bugout;
|
|
|
62d711 |
}
|
|
|
62d711 |
|
|
|
62d711 |
diff --git a/scan/sane/soapht.c b/scan/sane/soapht.c
|
|
|
62d711 |
index 269ab21..139100d 100644
|
|
|
62d711 |
--- a/scan/sane/soapht.c
|
|
|
62d711 |
+++ b/scan/sane/soapht.c
|
|
|
62d711 |
@@ -136,7 +136,7 @@ static int get_ip_data(struct soap_session *ps, SANE_Byte *data, SANE_Int maxLen
|
|
|
62d711 |
|
|
|
62d711 |
if (!ps->ip_handle)
|
|
|
62d711 |
{
|
|
|
62d711 |
- BUG("invalid ipconvert state\n");
|
|
|
62d711 |
+ BUG_SCAN("invalid ipconvert state\n");
|
|
|
62d711 |
goto bugout;
|
|
|
62d711 |
}
|
|
|
62d711 |
|
|
|
62d711 |
@@ -435,7 +435,7 @@ static struct soap_session *create_session()
|
|
|
62d711 |
|
|
|
62d711 |
if ((ps = malloc(sizeof(struct soap_session))) == NULL)
|
|
|
62d711 |
{
|
|
|
62d711 |
- BUG("malloc failed: %m\n");
|
|
|
62d711 |
+ BUG_SCAN("malloc failed: %m\n");
|
|
|
62d711 |
return NULL;
|
|
|
62d711 |
}
|
|
|
62d711 |
memset(ps, 0, sizeof(struct soap_session));
|
|
|
62d711 |
@@ -459,7 +459,7 @@ SANE_Status soapht_open(SANE_String_Const device, SANE_Handle *handle)
|
|
|
62d711 |
|
|
|
62d711 |
if (session)
|
|
|
62d711 |
{
|
|
|
62d711 |
- BUG("session in use\n");
|
|
|
62d711 |
+ BUG_SCAN("session in use\n");
|
|
|
62d711 |
return SANE_STATUS_DEVICE_BUSY;
|
|
|
62d711 |
}
|
|
|
62d711 |
|
|
|
62d711 |
@@ -475,7 +475,7 @@ SANE_Status soapht_open(SANE_String_Const device, SANE_Handle *handle)
|
|
|
62d711 |
|
|
|
62d711 |
if (hpmud_open_device(session->uri, ma.mfp_mode, &session->dd) != HPMUD_R_OK)
|
|
|
62d711 |
{
|
|
|
62d711 |
- BUG("unable to open device %s\n", session->uri);
|
|
|
62d711 |
+ BUG_SCAN("unable to open device %s\n", session->uri);
|
|
|
62d711 |
goto bugout;
|
|
|
62d711 |
|
|
|
62d711 |
free(session);
|
|
|
62d711 |
@@ -554,7 +554,7 @@ void soapht_close(SANE_Handle handle)
|
|
|
62d711 |
|
|
|
62d711 |
if (ps == NULL || ps != session)
|
|
|
62d711 |
{
|
|
|
62d711 |
- BUG("invalid sane_close\n");
|
|
|
62d711 |
+ BUG_SCAN("invalid sane_close\n");
|
|
|
62d711 |
return;
|
|
|
62d711 |
}
|
|
|
62d711 |
|
|
|
62d711 |
@@ -904,7 +904,7 @@ SANE_Status soapht_control_option(SANE_Handle handle, SANE_Int option, SANE_Acti
|
|
|
62d711 |
|
|
|
62d711 |
if (stat != SANE_STATUS_GOOD)
|
|
|
62d711 |
{
|
|
|
62d711 |
- BUG("control_option failed: option=%s action=%s\n", ps->option[option].name,
|
|
|
62d711 |
+ BUG_SCAN("control_option failed: option=%s action=%s\n", ps->option[option].name,
|
|
|
62d711 |
action==SANE_ACTION_GET_VALUE ? "get" : action==SANE_ACTION_SET_VALUE ? "set" : "auto");
|
|
|
62d711 |
}
|
|
|
62d711 |
|
|
|
62d711 |
@@ -946,7 +946,7 @@ SANE_Status soapht_start(SANE_Handle handle)
|
|
|
62d711 |
|
|
|
62d711 |
if (set_extents(ps))
|
|
|
62d711 |
{
|
|
|
62d711 |
- BUG("invalid extents: tlx=%d brx=%d tly=%d bry=%d minwidth=%d minheight%d maxwidth=%d maxheight=%d\n",
|
|
|
62d711 |
+ BUG_SCAN("invalid extents: tlx=%d brx=%d tly=%d bry=%d minwidth=%d minheight%d maxwidth=%d maxheight=%d\n",
|
|
|
62d711 |
ps->currentTlx, ps->currentTly, ps->currentBrx, ps->currentBry, ps->min_width, ps->min_height, ps->tlxRange.max, ps->tlyRange.max);
|
|
|
62d711 |
stat = SANE_STATUS_INVAL;
|
|
|
62d711 |
goto bugout;
|
|
|
62d711 |
@@ -1032,7 +1032,7 @@ SANE_Status soapht_start(SANE_Handle handle)
|
|
|
62d711 |
/* Open image processor. */
|
|
|
62d711 |
if ((ret = ipOpen(pXform-xforms, xforms, 0, &ps->ip_handle)) != IP_DONE)
|
|
|
62d711 |
{
|
|
|
62d711 |
- BUG("unable open image processor: err=%d\n", ret);
|
|
|
62d711 |
+ BUG_SCAN("unable open image processor: err=%d\n", ret);
|
|
|
62d711 |
stat = SANE_STATUS_INVAL;
|
|
|
62d711 |
goto bugout;
|
|
|
62d711 |
}
|
|
|
62d711 |
@@ -1075,7 +1075,7 @@ SANE_Status soapht_start(SANE_Handle handle)
|
|
|
62d711 |
|
|
|
62d711 |
if (ret & (IP_INPUT_ERROR | IP_FATAL_ERROR | IP_DONE))
|
|
|
62d711 |
{
|
|
|
62d711 |
- BUG("ipConvert error=%x\n", ret);
|
|
|
62d711 |
+ BUG_SCAN("ipConvert error=%x\n", ret);
|
|
|
62d711 |
stat = SANE_STATUS_IO_ERROR;
|
|
|
62d711 |
goto bugout;
|
|
|
62d711 |
}
|
|
|
62d711 |
@@ -1124,7 +1124,7 @@ SANE_Status soapht_read(SANE_Handle handle, SANE_Byte *data, SANE_Int maxLength,
|
|
|
62d711 |
|
|
|
62d711 |
if(ret & (IP_INPUT_ERROR | IP_FATAL_ERROR))
|
|
|
62d711 |
{
|
|
|
62d711 |
- BUG("ipConvert error=%x\n", ret);
|
|
|
62d711 |
+ BUG_SCAN("ipConvert error=%x\n", ret);
|
|
|
62d711 |
goto bugout;
|
|
|
62d711 |
}
|
|
|
62d711 |
|