diff -Naur a/base/sixext.py b/base/sixext.py --- a/base/sixext.py 2024-05-22 06:33:43.000000000 +0200 +++ b/base/sixext.py 2025-03-01 17:32:00.305660842 +0100 @@ -110,11 +110,11 @@ def to_string_utf8(s): - return s.decode("utf-8") + return s.decode("utf-8", 'ignore') def to_string_latin(s): - return s.decode("latin-1") + return s.decode("latin-1", 'ignore') def to_unicode(s, enc=None): diff -Naur a/configure.in b/configure.in --- a/configure.in 2024-05-22 06:33:43.000000000 +0200 +++ b/configure.in 2025-03-01 17:37:01.545574805 +0100 @@ -618,7 +618,7 @@ if test "$class_driver" = "no" && test "$hpijs_only_build" = "no" && test "$hpcups_only_build" = "no"; then AC_CHECK_LIB([cups], [cupsDoFileRequest], [LIBS="$LIBS"], [AC_MSG_ERROR([cannot find libcups support], 9)]) - AC_CHECK_HEADERS(cups/cups.h, ,[AC_MSG_ERROR([cannot find cups-devel support], 3)]) + AC_CHECK_HEADERS(cups/cups.h cups/ppd.h, ,[AC_MSG_ERROR([cannot find cups-devel support], 3)]) if test "$libusb01_build" = "yes"; then AC_CHECK_LIB([usb], [usb_init], [LIBS="$LIBS"], [AC_MSG_ERROR([cannot find libusb support], 2)]) AC_CHECK_HEADERS(usb.h, ,[AC_MSG_ERROR([cannot find libusb-devel support], 11)]) @@ -628,17 +628,29 @@ fi fi -SAVE_CPPFLAGS="$CPPFLAGS" -CFLAGS=`python-config --includes` -if [ $? -eq 0 ] -then - echo $FLAGS -else -CFLAGS=`python3-config --includes` - if [ $? -eq 0 ] - then - echo $FLAGS - fi +AC_PATH_PROG(python3_config_path, python3-config, [AC_MSG_ERROR([python3-config not installed], 6)]) + +PYTHON_INCLUDES=`$python3_config_path --includes` +if test "X$PYTHON_INCLUDES" = "X" ; then + AC_MSG_ERROR([Cannot get Python includes via python3-config], 6) +fi + +PYTHON_LIBS=`$python3_config_path --libs` +if test "X$PYTHON_LIBS" = "X" ; then + AC_MSG_ERROR([Cannot get Python libs via python3-config], 6) +fi + +SAVE_CFLAGS=$CFLAGS +SAVE_LIBS=$LIBS + +CFLAGS="$CFLAGS $PYTHON_INCLUDES" +LIBS="$LIBS $PYTHON_LIBS" + +AC_TRY_LINK(,[ ], AC_MSG_RESULT(yes); python_includes="ok", AC_MSG_ERROR([no: PYTHON DISABLED], 6)) + +if test "X$python_includes" != "Xok" ; then + CFLAGS="$SAVE_CFLAGS" + LIBS="$SAVE_LIBS" fi #CFLAGS=`(python-config --includes)` @@ -664,7 +676,6 @@ AS_IF([test "x$FOUND_HEADER" != "xyes"], [AC_MSG_ERROR([cannot find python-devel support], 6)]) fi -CFLAGS="$save_CFLAGS" if test "$hpijs_only_build" = "no" && test "$scan_build" = "yes" && test "$hpcups_only_build" = "no"; then AC_CHECK_LIB([sane], [sane_open], [LIBS="$LIBS"], [AC_MSG_ERROR([cannot find sane-backends-devel support (or --disable-scan-build)], 12)]) diff -Naur a/createPPD.sh b/createPPD.sh --- a/createPPD.sh 2024-05-22 06:33:43.000000000 +0200 +++ b/createPPD.sh 2025-03-01 17:38:18.443070552 +0100 @@ -55,16 +55,16 @@ else cp prnt/ps/hp-postscript*.ppd ppd/classppd/ps for i in ppd/classppd/ps/*.ppd; do - gzip -c "$i" > "$i.gz" + gzip -nc "$i" > "$i.gz" done fi #cp prnt/spd/*.ppd ppd/classppd/hpcups/. #cp prnt/ps/hp-postscript*.ppd.gz ppd/classppd/ps for i in ppd/classppd/hpcups/*.ppd; do - gzip -c "$i" > "$i.gz" + gzip -nc "$i" > "$i.gz" done #for i in ppd/classppd/ps/*.ppd; do - # gzip -c "$i" > "$i.gz" + # gzip -nc "$i" > "$i.gz" #done cat > class_cups_drv.inc < "$i.gz" + gzip -nc "$i" > "$i.gz" done install -d ppd/hpijs diff -Naur a/Makefile.am b/Makefile.am --- a/Makefile.am 2024-05-22 06:33:43.000000000 +0200 +++ b/Makefile.am 2025-03-01 17:43:42.496564980 +0100 @@ -167,7 +167,7 @@ dist_hplip_SCRIPTS = hpssd.py __init__.py hpdio.py endif #HPLIP_CLASS_DRIVER -dist_noinst_DATA += prnt/drv/hpijs.drv.in.template prnt/drv/hpcups.drv.in.template prnt/hpcups/libImageProcessor-x86_64.so prnt/hpcups/libImageProcessor-x86_32.so +dist_noinst_DATA += prnt/drv/hpijs.drv.in.template prnt/drv/hpcups.drv.in.template dist_noinst_DATA += prnt/ipp-usb/HPLIP.conf dist_noinst_SCRIPTS += dat2drv.py install.py hplip-install init-suse-firewall init-iptables-firewall class_rpm_build.sh hplipclassdriver.spec createPPD.sh Makefile_dat2drv hpijs-drv @@ -597,7 +597,7 @@ prnt/hpcups/ImageProcessor.h hpcups_CXXFLAGS = $(APDK_ENDIAN_FLAG) $(DBUS_CFLAGS) -hpcups_LDADD = -L./prnt/hpcups/ -ljpeg -ldl -lImageProcessor -lcups -lcupsimage -lz $(DBUS_LIBS) +hpcups_LDADD = -L./prnt/hpcups/ -ljpeg -ldl -lcups -lcupsimage -lz $(DBUS_LIBS) #else #hpcupsdir = $(cupsfilterdir) #hpcups_PROGRAMS = hpcups @@ -695,20 +695,6 @@ install-data-hook: if HPLIP_BUILD - if [ \( "$(UNAME)" = "x86_64" -a -d "$(libdir)/" \) ]; then \ - cp prnt/hpcups/libImageProcessor-x86_64.so $(libdir)/ ; \ - chmod 775 $(libdir)/libImageProcessor-x86_64.so ; \ - ln -sf $(libdir)/libImageProcessor-x86_64.so $(libdir)/libImageProcessor.so ; \ - fi; \ - if [ \( \( "$(UNAME)" = "i686" -o "$(UNAME)" = "i386" \) -a -d "$(libdir)/" \) ]; then \ - cp prnt/hpcups/libImageProcessor-x86_32.so $(libdir)/ ; \ - chmod 775 $(libdir)/libImageProcessor-x86_32.so ; \ - ln -sf $(libdir)/libImageProcessor-x86_32.so $(libdir)/libImageProcessor.so ; \ - fi - if [ -d "/usr/share/ipp-usb/quirks/" ]; then \ - echo "ipp-usb directory exists"; \ - cp prnt/ipp-usb/HPLIP.conf /usr/share/ipp-usb/quirks/ ; \ - fi if !HPLIP_CLASS_DRIVER # If scanner build, add hpaio entry to sane dll.conf. if [ "$(scan_build)" = "yes" ]; then \ @@ -720,15 +706,15 @@ echo "Adding hpaio entry to /etc/sane.d/dll.conf." ; \ echo hpaio >>$(DESTDIR)/etc/sane.d/dll.conf ; \ fi; \ - if [ \( "$(UNAME)" = "x86_64" -a -d "$(libdir)/x86_64-linux-gnu/sane" \) ]; then \ - ln -sf $(libdir)/sane/libsane-hpaio.so $(libdir)/x86_64-linux-gnu/sane/ ; \ - ln -sf $(libdir)/sane/libsane-hpaio.so.1 $(libdir)/x86_64-linux-gnu/sane/ ; \ + if [ \( "$(UNAME)" = "x86_64" -a -d "$(DESTDIR)$(libdir)/x86_64-linux-gnu/sane" \) ]; then \ + ln -sf $(libdir)/sane/libsane-hpaio.so $(DESTDIR)$(libdir)/x86_64-linux-gnu/sane/ ; \ + ln -sf $(libdir)/sane/libsane-hpaio.so.1 $(DESTDIR)$(libdir)/x86_64-linux-gnu/sane/ ; \ fi; \ - if [ \( \( "$(UNAME)" = "i686" -o "$(UNAME)" = "i386" \) -a -d "$(libdir)/i386-linux-gnu" \) ]; then \ - ln -sf $(libdir)/libhpmud.so.0.0.6 $(libdir)/i386-linux-gnu/libhpmud.so ; \ - ln -sf $(libdir)/libhpmud.so.0.0.6 $(libdir)/i386-linux-gnu/libhpmud.so.0 ; \ - ln -sf $(libdir)/sane/libsane-hpaio.so.1.0.0 $(libdir)/i386-linux-gnu/sane/libsane-hpaio.so.1 ; \ - ln -sf $(libdir)/sane/libsane-hpaio.so.1.0.0 $(libdir)/i386-linux-gnu/sane/libsane-hpaio.so ; \ + if [ \( \( "$(UNAME)" = "i686" -o "$(UNAME)" = "i386" \) -a -d "$(DESTDIR)$(libdir)/i386-linux-gnu" \) ]; then \ + ln -sf $(libdir)/libhpmud.so.0.0.6 $(DESTDIR)$(libdir)/i386-linux-gnu/libhpmud.so ; \ + ln -sf $(libdir)/libhpmud.so.0.0.6 $(DESTDIR)$(libdir)/i386-linux-gnu/libhpmud.so.0 ; \ + ln -sf $(libdir)/sane/libsane-hpaio.so.1.0.0 $(DESTDIR)$(libdir)/i386-linux-gnu/sane/libsane-hpaio.so.1 ; \ + ln -sf $(libdir)/sane/libsane-hpaio.so.1.0.0 $(DESTDIR)$(libdir)/i386-linux-gnu/sane/libsane-hpaio.so ; \ fi \ fi endif #HPLIP_CLASS_DRIVER diff -Naur a/Makefile.in b/Makefile.in --- a/Makefile.in 2024-05-22 06:42:34.000000000 +0200 +++ b/Makefile.in 2025-03-01 17:49:20.263541595 +0100 @@ -10236,19 +10236,19 @@ install-data-hook: -@HPLIP_BUILD_TRUE@ if [ \( "$(UNAME)" = "x86_64" -a -d "$(libdir)/" \) ]; then \ -@HPLIP_BUILD_TRUE@ cp prnt/hpcups/libImageProcessor-x86_64.so $(libdir)/ ; \ -@HPLIP_BUILD_TRUE@ chmod 775 $(libdir)/libImageProcessor-x86_64.so ; \ -@HPLIP_BUILD_TRUE@ ln -sf $(libdir)/libImageProcessor-x86_64.so $(libdir)/libImageProcessor.so ; \ +@HPLIP_BUILD_TRUE@ if [ \( "$(UNAME)" = "x86_64" -a -d "$(DESTDIR)$(libdir)/" \) ]; then \ +@HPLIP_BUILD_TRUE@ cp prnt/hpcups/libImageProcessor-x86_64.so $(DESTDIR)$(libdir)/ ; \ +@HPLIP_BUILD_TRUE@ chmod 775 $(DESTDIR)$(libdir)/libImageProcessor-x86_64.so ; \ +@HPLIP_BUILD_TRUE@ ln -sf $(libdir)/libImageProcessor-x86_64.so $(DESTDIR)$(libdir)/libImageProcessor.so ; \ @HPLIP_BUILD_TRUE@ fi; \ -@HPLIP_BUILD_TRUE@ if [ \( \( "$(UNAME)" = "i686" -o "$(UNAME)" = "i386" \) -a -d "$(libdir)/" \) ]; then \ -@HPLIP_BUILD_TRUE@ cp prnt/hpcups/libImageProcessor-x86_32.so $(libdir)/ ; \ -@HPLIP_BUILD_TRUE@ chmod 775 $(libdir)/libImageProcessor-x86_32.so ; \ -@HPLIP_BUILD_TRUE@ ln -sf $(libdir)/libImageProcessor-x86_32.so $(libdir)/libImageProcessor.so ; \ +@HPLIP_BUILD_TRUE@ if [ \( \( "$(UNAME)" = "i686" -o "$(UNAME)" = "i386" \) -a -d "$(DESTDIR)$(libdir)/" \) ]; then \ +@HPLIP_BUILD_TRUE@ cp prnt/hpcups/libImageProcessor-x86_32.so $(DESTDIR)$(libdir)/ ; \ +@HPLIP_BUILD_TRUE@ chmod 775 $(DESTDIR)$(libdir)/libImageProcessor-x86_32.so ; \ +@HPLIP_BUILD_TRUE@ ln -sf $(libdir)/libImageProcessor-x86_32.so $(DESTDIR)$(libdir)/libImageProcessor.so ; \ @HPLIP_BUILD_TRUE@ fi -@HPLIP_BUILD_TRUE@ if [ -d "/usr/share/ipp-usb/quirks/" ]; then \ +@HPLIP_BUILD_TRUE@ if [ -d "$(DESTDIR)/usr/share/ipp-usb/quirks/" ]; then \ @HPLIP_BUILD_TRUE@ echo "ipp-usb directory exists"; \ -@HPLIP_BUILD_TRUE@ cp prnt/ipp-usb/HPLIP.conf /usr/share/ipp-usb/quirks/ ; \ +@HPLIP_BUILD_TRUE@ cp prnt/ipp-usb/HPLIP.conf $(DESTDIR)/usr/share/ipp-usb/quirks/ ; \ @HPLIP_BUILD_TRUE@ fi # If scanner build, add hpaio entry to sane dll.conf. @HPLIP_BUILD_TRUE@@HPLIP_CLASS_DRIVER_FALSE@ if [ "$(scan_build)" = "yes" ]; then \ @@ -10260,15 +10260,15 @@ @HPLIP_BUILD_TRUE@@HPLIP_CLASS_DRIVER_FALSE@ echo "Adding hpaio entry to /etc/sane.d/dll.conf." ; \ @HPLIP_BUILD_TRUE@@HPLIP_CLASS_DRIVER_FALSE@ echo hpaio >>$(DESTDIR)/etc/sane.d/dll.conf ; \ @HPLIP_BUILD_TRUE@@HPLIP_CLASS_DRIVER_FALSE@ fi; \ -@HPLIP_BUILD_TRUE@@HPLIP_CLASS_DRIVER_FALSE@ if [ \( "$(UNAME)" = "x86_64" -a -d "$(libdir)/x86_64-linux-gnu/sane" \) ]; then \ -@HPLIP_BUILD_TRUE@@HPLIP_CLASS_DRIVER_FALSE@ ln -sf $(libdir)/sane/libsane-hpaio.so $(libdir)/x86_64-linux-gnu/sane/ ; \ -@HPLIP_BUILD_TRUE@@HPLIP_CLASS_DRIVER_FALSE@ ln -sf $(libdir)/sane/libsane-hpaio.so.1 $(libdir)/x86_64-linux-gnu/sane/ ; \ +@HPLIP_BUILD_TRUE@@HPLIP_CLASS_DRIVER_FALSE@ if [ \( "$(UNAME)" = "x86_64" -a -d "$(DESTDIR)$(libdir)/x86_64-linux-gnu/sane" \) ]; then \ +@HPLIP_BUILD_TRUE@@HPLIP_CLASS_DRIVER_FALSE@ ln -sf $(libdir)/sane/libsane-hpaio.so $(DESTDIR)$(libdir)/x86_64-linux-gnu/sane/ ; \ +@HPLIP_BUILD_TRUE@@HPLIP_CLASS_DRIVER_FALSE@ ln -sf $(libdir)/sane/libsane-hpaio.so.1 $(DESTDIR)$(libdir)/x86_64-linux-gnu/sane/ ; \ @HPLIP_BUILD_TRUE@@HPLIP_CLASS_DRIVER_FALSE@ fi; \ -@HPLIP_BUILD_TRUE@@HPLIP_CLASS_DRIVER_FALSE@ if [ \( \( "$(UNAME)" = "i686" -o "$(UNAME)" = "i386" \) -a -d "$(libdir)/i386-linux-gnu" \) ]; then \ -@HPLIP_BUILD_TRUE@@HPLIP_CLASS_DRIVER_FALSE@ ln -sf $(libdir)/libhpmud.so.0.0.6 $(libdir)/i386-linux-gnu/libhpmud.so ; \ -@HPLIP_BUILD_TRUE@@HPLIP_CLASS_DRIVER_FALSE@ ln -sf $(libdir)/libhpmud.so.0.0.6 $(libdir)/i386-linux-gnu/libhpmud.so.0 ; \ -@HPLIP_BUILD_TRUE@@HPLIP_CLASS_DRIVER_FALSE@ ln -sf $(libdir)/sane/libsane-hpaio.so.1.0.0 $(libdir)/i386-linux-gnu/sane/libsane-hpaio.so.1 ; \ -@HPLIP_BUILD_TRUE@@HPLIP_CLASS_DRIVER_FALSE@ ln -sf $(libdir)/sane/libsane-hpaio.so.1.0.0 $(libdir)/i386-linux-gnu/sane/libsane-hpaio.so ; \ +@HPLIP_BUILD_TRUE@@HPLIP_CLASS_DRIVER_FALSE@ if [ \( \( "$(UNAME)" = "i686" -o "$(UNAME)" = "i386" \) -a -d "$(DESTDIR)$(libdir)/i386-linux-gnu" \) ]; then \ +@HPLIP_BUILD_TRUE@@HPLIP_CLASS_DRIVER_FALSE@ ln -sf $(libdir)/libhpmud.so.0.0.6 $(DESTDIR)$(libdir)/i386-linux-gnu/libhpmud.so ; \ +@HPLIP_BUILD_TRUE@@HPLIP_CLASS_DRIVER_FALSE@ ln -sf $(libdir)/libhpmud.so.0.0.6 $(DESTDIR)$(libdir)/i386-linux-gnu/libhpmud.so.0 ; \ +@HPLIP_BUILD_TRUE@@HPLIP_CLASS_DRIVER_FALSE@ ln -sf $(libdir)/sane/libsane-hpaio.so.1.0.0 $(DESTDIR)$(libdir)/i386-linux-gnu/sane/libsane-hpaio.so.1 ; \ +@HPLIP_BUILD_TRUE@@HPLIP_CLASS_DRIVER_FALSE@ ln -sf $(libdir)/sane/libsane-hpaio.so.1.0.0 $(DESTDIR)$(libdir)/i386-linux-gnu/sane/libsane-hpaio.so ; \ @HPLIP_BUILD_TRUE@@HPLIP_CLASS_DRIVER_FALSE@ fi \ @HPLIP_BUILD_TRUE@@HPLIP_CLASS_DRIVER_FALSE@ fi # Create hp-xxx commands in bindir. diff -Naur a/prnt/hpcups/CommonDefinitions.h b/prnt/hpcups/CommonDefinitions.h --- a/prnt/hpcups/CommonDefinitions.h 2024-05-22 06:33:43.000000000 +0200 +++ b/prnt/hpcups/CommonDefinitions.h 2025-03-01 17:50:29.247619132 +0100 @@ -40,6 +40,7 @@ #include #include #include +#include #include #include #include diff -Naur a/prnt/hpijs/hpcupsfax.cpp b/prnt/hpijs/hpcupsfax.cpp --- a/prnt/hpijs/hpcupsfax.cpp 2024-05-22 06:33:43.000000000 +0200 +++ b/prnt/hpijs/hpcupsfax.cpp 2025-03-01 17:52:28.708907980 +0100 @@ -43,6 +43,7 @@ #include #include #include +#include #include #include #ifdef FALSE diff -Naur a/prnt/hpps/pserror.c b/prnt/hpps/pserror.c --- a/prnt/hpps/pserror.c 2024-05-22 06:33:43.000000000 +0200 +++ b/prnt/hpps/pserror.c 2025-03-01 18:02:45.395600653 +0100 @@ -24,7 +24,7 @@ void message(int flags, char *format, ...) { va_list args ; - static column = 0 ; /* current screen column for message wrap */ + static int column = 0 ; /* current screen column for message wrap */ char msgbuf[MAX_MESSAGE] ; /* buffer in which to put the message */ char *bufptr = msgbuf ; /* message buffer pointer */ diff -Naur a/scan/sane/hpaio.c b/scan/sane/hpaio.c --- a/scan/sane/hpaio.c 2024-05-22 06:33:44.000000000 +0200 +++ b/scan/sane/hpaio.c 2025-03-01 18:18:48.159555576 +0100 @@ -50,6 +50,7 @@ #include "sclpml.h" #include "escl.h" #include "io.h" +#include "orblite.h" #include "orblitei.h" @@ -378,7 +379,7 @@ ResetDeviceList(&DeviceList); DevDiscovery(localOnly); *deviceList = (const SANE_Device **)DeviceList; - SANE_Device*** devList; + const SANE_Device*** devList; orblite_get_devices(devList, localOnly); return SANE_STATUS_GOOD; diff -Naur a/scan/sane/orblite.c b/scan/sane/orblite.c --- a/scan/sane/orblite.c 2024-05-22 06:33:44.000000000 +0200 +++ b/scan/sane/orblite.c 2025-03-01 18:25:35.944049732 +0100 @@ -19,10 +19,14 @@ #undef NDEBUG #include "orblitei.h" #include "orblite.h"//Added New +#include #include #include "utils.h" #include "io.h" +#define DEBUG_DECLARE_ONLY +#include "sanei_debug.h" + #ifdef __cplusplus } #endif @@ -63,28 +67,28 @@ SANE_NAME_SCAN_TL_X, SANE_TITLE_SCAN_TL_X, SANE_DESC_SCAN_TL_X, // name, title, desc SANE_TYPE_FIXED, SANE_UNIT_MM, sizeof(SANE_Fixed),// type, unit, size SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT, // cap(ability) - SANE_CONSTRAINT_RANGE, (SANE_Char**)&SANE_rangeLeft // constraint_type, constraint + SANE_CONSTRAINT_RANGE, (const SANE_Char**)&SANE_rangeLeft // constraint_type, constraint }, { SANE_NAME_SCAN_TL_Y, SANE_TITLE_SCAN_TL_Y, SANE_DESC_SCAN_TL_Y, // name, title, desc SANE_TYPE_FIXED, SANE_UNIT_MM, sizeof(SANE_Fixed),// type, unit, size SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT, // cap(ability) - SANE_CONSTRAINT_RANGE, (SANE_Char**)&SANE_rangeTop // constraint_type, constraint + SANE_CONSTRAINT_RANGE, (const SANE_Char**)&SANE_rangeTop // constraint_type, constraint }, { SANE_NAME_SCAN_BR_X, SANE_TITLE_SCAN_BR_X, SANE_DESC_SCAN_BR_X, // name, title, desc SANE_TYPE_FIXED, SANE_UNIT_MM, sizeof(SANE_Fixed),// type, unit, size SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT, // cap(ability) - SANE_CONSTRAINT_RANGE, (SANE_Char**)&SANE_rangeRight // constraint_type, constraint + SANE_CONSTRAINT_RANGE, (const SANE_Char**)&SANE_rangeRight // constraint_type, constraint }, { SANE_NAME_SCAN_BR_Y, SANE_TITLE_SCAN_BR_Y, SANE_DESC_SCAN_BR_Y, // name, title, desc SANE_TYPE_FIXED, SANE_UNIT_MM, sizeof(SANE_Fixed),// type, unit, size SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT, // cap(ability) - SANE_CONSTRAINT_RANGE, (SANE_Char**)&SANE_rangeBottom // constraint_type, constraint + SANE_CONSTRAINT_RANGE, (const SANE_Char**)&SANE_rangeBottom // constraint_type, constraint }, // optResolution, // resolution group @@ -92,7 +96,7 @@ SANE_NAME_SCAN_RESOLUTION, SANE_TITLE_SCAN_RESOLUTION, SANE_DESC_SCAN_RESOLUTION, // name, title, desc SANE_TYPE_INT, SANE_UNIT_DPI, sizeof(SANE_Word), // type, unit, size, SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT, // cap(ability) - SANE_CONSTRAINT_WORD_LIST, (SANE_Char**)SANE_resolutions // constraint type, constraint + SANE_CONSTRAINT_WORD_LIST, (const SANE_Char**)SANE_resolutions // constraint type, constraint }, // optMode, // color/depth group @@ -100,7 +104,7 @@ SANE_NAME_SCAN_MODE, SANE_TITLE_SCAN_MODE, SANE_DESC_SCAN_MODE, // name, title, desc SANE_TYPE_STRING, SANE_UNIT_NONE, 256, // type, unit, size, SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT, // cap(ability) - SANE_CONSTRAINT_STRING_LIST, (SANE_Char**)SANE_modes // constraint type, constraint + SANE_CONSTRAINT_STRING_LIST, (const SANE_Char**)SANE_modes // constraint type, constraint }, // optSource, @@ -108,7 +112,7 @@ SANE_NAME_SCAN_SOURCE, SANE_TITLE_SCAN_SOURCE, SANE_DESC_SCAN_SOURCE, // name, title, desc SANE_TYPE_STRING, SANE_UNIT_NONE, 256, // type, unit, size, SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT, // cap(ability) - SANE_CONSTRAINT_STRING_LIST, (SANE_Char**)SANE_sources // constraint type, constraint + SANE_CONSTRAINT_STRING_LIST, (const SANE_Char**)SANE_sources // constraint type, constraint }, // optPaperSize, @@ -116,7 +120,7 @@ SANE_NAME_PAPER_SIZE, SANE_TITLE_PAPER_SIZE, SANE_DESC_PAPER_SIZE, // name, title, desc SANE_TYPE_STRING, SANE_UNIT_NONE, 256, // type, unit, size, SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT, // cap(ability) - SANE_CONSTRAINT_STRING_LIST, (SANE_Char**)SANE_paper_sizes // constraint type, constraint + SANE_CONSTRAINT_STRING_LIST, (const SANE_Char**)SANE_paper_sizes // constraint type, constraint }, // optPaperSize, @@ -124,7 +128,7 @@ SANE_NAME_PAPER_SIZE, SANE_TITLE_PAPER_SIZE, SANE_DESC_PAPER_SIZE, // name, title, desc SANE_TYPE_INT, SANE_UNIT_DPI, sizeof(SANE_Word), // type, unit, size, SANE_CAP_SOFT_SELECT | SANE_CAP_SOFT_DETECT, // cap(ability) - SANE_CONSTRAINT_WORD_LIST, (SANE_Char**)SANE_resolutions // constraint type, constraint + SANE_CONSTRAINT_WORD_LIST, (const SANE_Char**)SANE_resolutions // constraint type, constraint }, #ifdef NOTDEF // default template @@ -193,27 +197,6 @@ } -static int bb_unload(SANE_THandle ps) -{ - _DBG("Calling orblite bb_unload: \n"); - if (ps->bb_handle) - { - dlclose(ps->bb_handle); - ps->bb_handle = NULL; - } - if (ps->hpmud_handle) - { - dlclose(ps->hpmud_handle); - ps->hpmud_handle = NULL; - } -// if (ps->math_handle) -// { -// dlclose(ps->math_handle); -// ps->math_handle = NULL; -// } - return 0; -} - SANE_Status orblite_init (SANE_Int * version_code, SANE_Auth_Callback authorize) { @@ -273,6 +256,7 @@ SANE_Auth_Callback authorize; const SANE_Device *** device_list; SANE_Bool local_only; + void * temp_handle; // Allocate handle, set all handle values to zero @@ -304,7 +288,9 @@ if (stat != SANE_STATUS_GOOD) return stat; - stat = g_handle->bb_orblite_open(devicename, &g_handle); + temp_handle = g_handle; + stat = g_handle->bb_orblite_open(devicename, &temp_handle); + g_handle = temp_handle; if (stat == SANE_STATUS_GOOD) *handle = g_handle; diff -Naur a/scan/sane/sclpml.c b/scan/sane/sclpml.c --- a/scan/sane/sclpml.c 2024-05-22 06:33:44.000000000 +0200 +++ b/scan/sane/sclpml.c 2025-03-01 18:12:53.195637886 +0100 @@ -46,6 +46,9 @@ #define DEBUG_DECLARE_ONLY #include "sanei_debug.h" +/* This file is not built with _GNU_SOURCE. */ +char *strcasestr(const char *, const char *); + //# define SCLPML_DEBUG # ifdef SCLPML_DEBUG # define _DBG(args...) syslog(LOG_INFO, __FILE__ " " STRINGIZE(__LINE__) ": " args) diff -Naur a/upgrade.py b/upgrade.py --- a/upgrade.py 2024-05-22 06:33:44.000000000 +0200 +++ b/upgrade.py 2025-03-01 17:53:15.242743387 +0100 @@ -208,6 +208,9 @@ if os.getenv("HPLIP_DEBUG"): log.set_level('debug') +log.error("HPLIP upgrade is disabled by NuTyX for security reasons. Please use cards to upgrade.") +clean_exit(1) + for o, a in opts: if o in ('-h', '--help'): usage()