kopia lustrzana https://gitlab.com/sane-project/backends
Added resource manager library support.
rodzic
542c63509a
commit
ab64285ff9
Plik diff jest za duży
Load Diff
11
configure.in
11
configure.in
|
@ -113,6 +113,16 @@ AC_CHECK_HEADERS(fcntl.h unistd.h libc.h sys/dsreq.h sys/select.h \
|
|||
AC_CHECK_HEADERS([asm/io.h],,,[#include <sys/types.h>])
|
||||
SANE_CHECK_MISSING_HEADERS
|
||||
|
||||
AC_CHECK_HEADER(resmgr.h,[
|
||||
AC_CHECK_LIB(
|
||||
resmgr,
|
||||
rsm_open_device,[
|
||||
AC_DEFINE(HAVE_RESMGR,1,[define if you have the resmgr library"])
|
||||
LIBS="$LIBS -lresmgr"
|
||||
]
|
||||
)
|
||||
])
|
||||
|
||||
dnl ***********************************************************************
|
||||
dnl Checks for types and structures
|
||||
dnl ***********************************************************************
|
||||
|
@ -464,6 +474,7 @@ echo "Configuration: `eval eval echo ${sysconfdir}`"
|
|||
echo "Libraries: `eval eval echo ${libdir}`"
|
||||
echo "Binaries: `eval eval echo ${bindir}` and `eval eval echo ${sbindir}`"
|
||||
echo "Manpages: `eval eval echo ${mandir}`"
|
||||
echo "Documentation: `eval eval echo ${docdir}`"
|
||||
echo "-> Network parameters:"
|
||||
if test "${SANED}" = "saned" ; then
|
||||
echo "Build saned: yes"
|
||||
|
|
|
@ -80,6 +80,10 @@
|
|||
#define MACOSX_INTERFACE 17
|
||||
#define WIN32_INTERFACE 18
|
||||
|
||||
#ifdef HAVE_RESMGR
|
||||
# include <resmgr.h>
|
||||
#endif
|
||||
|
||||
#if defined (HAVE_SCSI_SG_H)
|
||||
# define USE LINUX_INTERFACE
|
||||
# include <scsi/sg.h>
|
||||
|
@ -768,13 +772,17 @@ static int sg_version = 0;
|
|||
static SANE_Status
|
||||
get_max_buffer_size (const char *file)
|
||||
{
|
||||
int fd;
|
||||
int fd = -1;
|
||||
int buffersize = SCSIBUFFERSIZE, i;
|
||||
size_t len;
|
||||
char *cc, *cc1, buf[32];
|
||||
|
||||
#ifdef HAVE_RESMGR
|
||||
fd = rsm_open_device(file, O_RDWR);
|
||||
#endif
|
||||
|
||||
fd = open (file, O_RDWR);
|
||||
if (fd == -1)
|
||||
fd = open (file, O_RDWR);
|
||||
|
||||
if (fd > 0)
|
||||
{
|
||||
|
@ -1232,7 +1240,13 @@ sanei_scsi_open (const char *dev, int *fdp,
|
|||
}
|
||||
#endif /* defined(SGIOCSTL) || (USE == SOLARIS_INTERFACE) */
|
||||
|
||||
fd = open (dev, O_RDWR | O_EXCL
|
||||
fd = -1;
|
||||
#ifdef HAVE_RESMGR
|
||||
fd = rsm_open_device(dev, O_RDWR | O_EXCL | O_NONBLOCK);
|
||||
#endif
|
||||
|
||||
if (fd == -1)
|
||||
fd = open (dev, O_RDWR | O_EXCL
|
||||
#if USE == LINUX_INTERFACE
|
||||
| O_NONBLOCK
|
||||
#endif
|
||||
|
@ -2472,7 +2486,12 @@ issue (struct req *req)
|
|||
dnp->base + guess_devnum);
|
||||
else
|
||||
snprintf (name, name_len, "%s%d", dnp->prefix, guess_devnum);
|
||||
dev_fd = open (name, O_RDWR | O_NONBLOCK);
|
||||
dev_fd = -1;
|
||||
#ifdef HAVE_RESMGR
|
||||
dev_fd = rsm_open_device (name, O_RDWR | O_NONBLOCK);
|
||||
#endif
|
||||
if (dev_fd == -1)
|
||||
dev_fd = open (name, O_RDWR | O_NONBLOCK);
|
||||
if (dev_fd >= 0)
|
||||
{
|
||||
lx_sg_dev_base = k;
|
||||
|
|
|
@ -55,6 +55,9 @@
|
|||
#include <stdio.h>
|
||||
#include <dirent.h>
|
||||
|
||||
#ifdef HAVE_RESMGR
|
||||
#include <resmgr.h>
|
||||
#endif
|
||||
#ifdef HAVE_LIBUSB
|
||||
#include <usb.h>
|
||||
#endif /* HAVE_LIBUSB */
|
||||
|
@ -268,7 +271,12 @@ sanei_usb_init (void)
|
|||
if (strlen (dir_name) + strlen (dir_entry->d_name) + 1 > sizeof (devname))
|
||||
continue;
|
||||
sprintf (devname, "%s%s", dir_name, dir_entry->d_name);
|
||||
fd = open (devname, O_RDWR);
|
||||
fd = -1;
|
||||
#ifdef HAVE_RESMGR
|
||||
fd = rsm_open_device (devname, O_RDWR);
|
||||
#endif
|
||||
if (fd == -1)
|
||||
fd = open (devname, O_RDWR);
|
||||
if (fd < 0)
|
||||
{
|
||||
DBG (5, "sanei_usb_init: couldn't open %s: %s\n", devname,
|
||||
|
@ -700,7 +708,12 @@ sanei_usb_open (SANE_String_Const devname, SANE_Int * dn)
|
|||
{
|
||||
long int flag;
|
||||
/* Using kernel scanner driver */
|
||||
devices[devcount].fd = open (devname, O_RDWR);
|
||||
devices[devcount].fd = -1;
|
||||
#ifdef HAVE_RESMGR
|
||||
devices[devcount].fd = rsm_open_device (devname, O_RDWR);
|
||||
#endif
|
||||
if (devices[devcount].fd == -1)
|
||||
devices[devcount].fd = open (devname, O_RDWR);
|
||||
if (devices[devcount].fd < 0)
|
||||
{
|
||||
SANE_Status status = SANE_STATUS_INVAL;
|
||||
|
|
Ładowanie…
Reference in New Issue