From ccfc476a07e396d78b4a3579373b775d724e78ab Mon Sep 17 00:00:00 2001 From: Benoit Juin Date: Thu, 24 Nov 2022 12:08:29 +0100 Subject: [PATCH] Prepare backend build files --- .gitignore | 4 ++ backend/Makefile.am | 25 +++++++++-- backend/lexmark_x2600.c | 81 +++++++++++++++++++++++++++++++++++ backend/lexmark_x2600.conf.in | 2 + backend/lexmark_x2600.h | 5 +++ configure.ac | 3 +- doc/Makefile.am | 4 +- doc/sane-lexmark_x2600.man | 0 8 files changed, 117 insertions(+), 7 deletions(-) create mode 100644 backend/lexmark_x2600.c create mode 100644 backend/lexmark_x2600.conf.in create mode 100644 backend/lexmark_x2600.h create mode 100644 doc/sane-lexmark_x2600.man diff --git a/.gitignore b/.gitignore index bd3b38363..e5451942c 100644 --- a/.gitignore +++ b/.gitignore @@ -58,3 +58,7 @@ test-suite.log # `make dist` artifacts /sane-backends-*.tar.gz + +# editor temp files +*~ +\#*\# diff --git a/backend/Makefile.am b/backend/Makefile.am index 35ad206f9..5f2587bf9 100644 --- a/backend/Makefile.am +++ b/backend/Makefile.am @@ -75,8 +75,8 @@ BACKEND_CONFS= abaton.conf agfafocus.conf apple.conf artec.conf \ epson.conf epsonds.conf escl.conf fujitsu.conf genesys.conf \ gphoto2.conf gt68xx.conf hp3900.conf hp4200.conf hp5400.conf \ hp.conf hpsj5s.conf hs2p.conf ibm.conf kodak.conf kodakaio.conf\ - kvs1025.conf \ - leo.conf lexmark.conf ma1509.conf magicolor.conf \ + kvs1025.conf leo.conf lexmark.conf lexmark_x2600.conf \ + ma1509.conf magicolor.conf \ matsushita.conf microtek2.conf microtek.conf mustek.conf \ mustek_pp.conf mustek_usb.conf nec.conf net.conf \ p5.conf \ @@ -173,7 +173,7 @@ be_convenience_libs = libabaton.la libagfafocus.la \ libhp5400.la libhp5590.la libhpljm1005.la \ libhpsj5s.la libhs2p.la libibm.la libkodak.la libkodakaio.la\ libkvs1025.la libkvs20xx.la libkvs40xx.la \ - libleo.la liblexmark.la libma1509.la libmagicolor.la \ + libleo.la liblexmark.la liblexmark_x2600.la libma1509.la libmagicolor.la \ libmatsushita.la libmicrotek.la libmicrotek2.la \ libmustek.la libmustek_pp.la libmustek_usb.la \ libmustek_usb2.la libnec.la libnet.la \ @@ -208,7 +208,7 @@ be_dlopen_libs = libsane-abaton.la libsane-agfafocus.la \ libsane-hpsj5s.la libsane-hs2p.la libsane-ibm.la libsane-kodak.la libsane-kodakaio.la\ libsane-kvs1025.la libsane-kvs20xx.la libsane-kvs40xx.la \ libsane-leo.la \ - libsane-lexmark.la libsane-ma1509.la libsane-magicolor.la \ + libsane-lexmark.la libsane-lexmark_x2600.la libsane-ma1509.la libsane-magicolor.la \ libsane-matsushita.la libsane-microtek.la libsane-microtek2.la \ libsane-mustek.la libsane-mustek_pp.la libsane-mustek_usb.la \ libsane-mustek_usb2.la libsane-nec.la libsane-net.la \ @@ -1147,6 +1147,23 @@ EXTRA_DIST += lexmark.conf.in # TODO: Why are these distributed but not compiled? EXTRA_DIST += lexmark_models.c lexmark_sensors.c +liblexmark_x2600_la_SOURCES = lexmark_x2600.c lexmark_x2600.h +liblexmark_x2600_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=lexmark_x2600 + +nodist_libsane_lexmark_x2600_la_SOURCES = lexmark_x2600-s.c +libsane_lexmark_x2600_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=lexmark_x2600 +libsane_lexmark_x2600_la_LDFLAGS = $(DIST_SANELIBS_LDFLAGS) +libsane_lexmark_x2600_la_LIBADD = $(COMMON_LIBS) \ + liblexmark_x2600.la \ + ../sanei/sanei_init_debug.lo \ + ../sanei/sanei_constrain_value.lo \ + ../sanei/sanei_config.lo \ + ../sanei/sanei_config2.lo \ + sane_strstatus.lo \ + ../sanei/sanei_scsi.lo \ + $(SCSI_LIBS) $(RESMGR_LIBS) +EXTRA_DIST += lexmark_x2600.conf.in + libma1509_la_SOURCES = ma1509.c ma1509.h libma1509_la_CPPFLAGS = $(AM_CPPFLAGS) -DBACKEND_NAME=ma1509 diff --git a/backend/lexmark_x2600.c b/backend/lexmark_x2600.c new file mode 100644 index 000000000..9ae918dee --- /dev/null +++ b/backend/lexmark_x2600.c @@ -0,0 +1,81 @@ +#include "lexmark_x2600.h" +#include "../include/sane/sanei_backend.h" + +SANE_Status +sane_init (SANE_Int *vc, SANE_Auth_Callback cb) +{ + return ENTRY(init) (vc, cb); +} + +SANE_Status +sane_get_devices (const SANE_Device ***dl, SANE_Bool local) +{ + return ENTRY(get_devices) (dl, local); +} + +SANE_Status +sane_open (SANE_String_Const name, SANE_Handle *h) +{ + return ENTRY(open) (name, h); +} + +const SANE_Option_Descriptor * +sane_get_option_descriptor (SANE_Handle h, SANE_Int opt) +{ + return ENTRY(get_option_descriptor) (h, opt); +} + +SANE_Status +sane_control_option (SANE_Handle h, SANE_Int opt, SANE_Action act, + void *val, SANE_Word *info) +{ + return ENTRY(control_option) (h, opt, act, val, info); +} + +SANE_Status +sane_get_parameters (SANE_Handle h, SANE_Parameters *parms) +{ + return ENTRY(get_parameters) (h, parms); +} + +SANE_Status +sane_start (SANE_Handle h) +{ + return ENTRY(start) (h); +} + +SANE_Status +sane_read (SANE_Handle h, SANE_Byte *buf, SANE_Int maxlen, SANE_Int *lenp) +{ + return ENTRY(read) (h, buf, maxlen, lenp); +} + +SANE_Status +sane_set_io_mode (SANE_Handle h, SANE_Bool non_blocking) +{ + return ENTRY(set_io_mode) (h, non_blocking); +} + +SANE_Status +sane_get_select_fd (SANE_Handle h, SANE_Int *fdp) +{ + return ENTRY(get_select_fd) (h, fdp); +} + +void +sane_cancel (SANE_Handle h) +{ + ENTRY(cancel) (h); +} + +void +sane_close (SANE_Handle h) +{ + ENTRY(close) (h); +} + +void +sane_exit (void) +{ + ENTRY(exit) (); +} diff --git a/backend/lexmark_x2600.conf.in b/backend/lexmark_x2600.conf.in new file mode 100644 index 000000000..c0308228a --- /dev/null +++ b/backend/lexmark_x2600.conf.in @@ -0,0 +1,2 @@ +# X26xx series +usb 0x043d 0x011d diff --git a/backend/lexmark_x2600.h b/backend/lexmark_x2600.h new file mode 100644 index 000000000..69499d0b3 --- /dev/null +++ b/backend/lexmark_x2600.h @@ -0,0 +1,5 @@ +#ifndef LEXMARK_X2600_H +#define LEXMARK_X2600_H + + +#endif /* LEXMARK_X2600_H */ diff --git a/configure.ac b/configure.ac index a763be518..85a611e1d 100644 --- a/configure.ac +++ b/configure.ac @@ -645,7 +645,7 @@ ALL_BACKENDS="abaton agfafocus apple artec artec_eplus48u as6e \ dell1600n_net dmc epjitsu epson epson2 epsonds escl fujitsu \ genesys gphoto2 gt68xx hp hp3500 hp3900 hp4200 hp5400 \ hp5590 hpsj5s hpljm1005 hs2p ibm kodak kodakaio kvs1025 kvs20xx \ - kvs40xx leo lexmark ma1509 magicolor \ + kvs40xx leo lexmark lexmark_x2600 ma1509 magicolor \ matsushita microtek microtek2 mustek mustek_pp \ mustek_usb mustek_usb2 nec net niash pie pieusb pint \ pixma plustek plustek_pp qcam ricoh ricoh2 rts8891 s9036 \ @@ -707,6 +707,7 @@ AC_SUBST(BACKEND_LIBS_ENABLED) AM_CONDITIONAL(WITH_GENESYS_TESTS, test xyes = x$with_genesys_tests) AM_CONDITIONAL(INSTALL_UMAX_PP_TOOLS, test xyes = x$install_umax_pp_tools) + AC_ARG_VAR(PRELOADABLE_BACKENDS, [list of backends to preload into single DLL]) if test "${enable_preload}" = "auto"; then if test "${enable_shared}" = "no" || test "${enable_dynamic}" != "yes"; then diff --git a/doc/Makefile.am b/doc/Makefile.am index 7dbbfaf15..083a0f4c7 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -38,7 +38,7 @@ BACKEND_5MANS = sane-abaton.5 sane-agfafocus.5 sane-apple.5 sane-as6e.5 \ sane-hp5590.5 sane-hpljm1005.5 sane-cardscan.5 sane-hp3900.5 \ sane-epjitsu.5 sane-hs2p.5 sane-canon_dr.5 sane-xerox_mfp.5 \ sane-rts8891.5 sane-coolscan3.5 sane-kvs1025.5 sane-kvs20xx.5 \ - sane-kvs40xx.5 sane-p5.5 sane-magicolor.5 + sane-kvs40xx.5 sane-p5.5 sane-magicolor.5 sane-lexmark_x2600.5 EXTRA_DIST += sane-abaton.man sane-agfafocus.man sane-apple.man sane-as6e.man \ sane-canon_lide70.man \ @@ -64,7 +64,7 @@ EXTRA_DIST += sane-abaton.man sane-agfafocus.man sane-apple.man sane-as6e.man \ sane-cardscan.man sane-hp3900.man sane-epjitsu.man sane-hs2p.man \ sane-canon_dr.man sane-xerox_mfp.man sane-rts8891.man \ sane-coolscan3.man sane-kvs1025.man sane-kvs20xx.man sane-kvs40xx.man \ - sane-p5.man sane-magicolor.man + sane-p5.man sane-magicolor.man sane-lexmark_x2600.man man7_MANS = sane.7 EXTRA_DIST += sane.man diff --git a/doc/sane-lexmark_x2600.man b/doc/sane-lexmark_x2600.man new file mode 100644 index 000000000..e69de29bb