diff -Naur hplip-3.25.8.orig/io/hpmud/musb.c hplip-3.25.8.modified/io/hpmud/musb.c
--- hplip-3.25.8.orig/io/hpmud/musb.c	2026-01-16 08:22:56.465594662 -0500
+++ hplip-3.25.8.modified/io/hpmud/musb.c	2026-01-16 08:23:26.454146741 -0500
@@ -31,6 +31,11 @@
 #include <stdlib.h>
 #include "utils.h"
 
+/* rkm mods */
+/* for gettimeofday: */
+#include </usr/include/sys/time.h>
+/* end rkm mods */
+
 
 mud_device_vf __attribute__ ((visibility ("hidden"))) musb_mud_device_vf =
 {
diff -Naur hplip-3.25.8.orig/io/hpmud/musb_libusb01.c hplip-3.25.8.modified/io/hpmud/musb_libusb01.c
--- hplip-3.25.8.orig/io/hpmud/musb_libusb01.c	2026-01-16 08:22:56.465460390 -0500
+++ hplip-3.25.8.modified/io/hpmud/musb_libusb01.c	2026-01-16 08:23:26.451576311 -0500
@@ -30,6 +30,11 @@
 #include <dlfcn.h>
 #include "utils.h"
 
+/* rkm mods */
+/* for gettimeofday: */
+#include </usr/include/sys/time.h>
+/* end rkm mods */
+
 mud_device_vf __attribute__ ((visibility ("hidden"))) musb_mud_device_vf =
 {
     .read = musb_read,
diff -Naur hplip-3.25.8.orig/io/hpmud/pp.c hplip-3.25.8.modified/io/hpmud/pp.c
--- hplip-3.25.8.orig/io/hpmud/pp.c	2026-01-16 08:22:56.465547078 -0500
+++ hplip-3.25.8.modified/io/hpmud/pp.c	2026-01-16 08:23:26.456719991 -0500
@@ -29,6 +29,11 @@
 #include "hpmud.h"
 #include "hpmudi.h"
 
+/* rkm mods */
+/* for gettimeofday: */
+#include </usr/include/sys/time.h>
+/* end rkm mods */
+
 mud_device_vf __attribute__ ((visibility ("hidden"))) pp_mud_device_vf = 
 {
    .read = pp_read,
diff -Naur hplip-3.25.8.orig/pcard/pcardext/pcardext.c hplip-3.25.8.modified/pcard/pcardext/pcardext.c
--- hplip-3.25.8.orig/pcard/pcardext/pcardext.c	2026-01-16 08:22:56.479086361 -0500
+++ hplip-3.25.8.modified/pcard/pcardext/pcardext.c	2026-01-16 08:23:26.466812939 -0500
@@ -39,6 +39,13 @@
 #define PY_SSIZE_T_MIN INT_MIN
 #endif
 
+/* rkm mods */
+void PyString_AsStringAndSize(PyObject * result,char** rkm_at_result_str,void* rkm_len);
+long int PyInt_AS_LONG(void* rkm_result);
+void* PyString_FromStringAndSize(char* rkm_buffer,int rkm_len);
+PyObject *  Py_InitModule4(void *rkm_message,PyMethodDef * rkm_pcardext_methods,void* rkm_pcardext_documentation,void* rkm_pointer,int rkm_PYTHON_API_VERSION);
+/* end rkm mods */
+
 int verbose=0;
 
 PyObject * readsectorFunc = NULL;
diff -Naur hplip-3.25.8.orig/prnt/cupsext/cupsext.c hplip-3.25.8.modified/prnt/cupsext/cupsext.c
--- hplip-3.25.8.orig/prnt/cupsext/cupsext.c	2026-01-16 08:22:56.434220435 -0500
+++ hplip-3.25.8.modified/prnt/cupsext/cupsext.c	2026-01-16 08:23:26.443687107 -0500
@@ -89,6 +89,14 @@
 #include "hp_ipp.h"
 #include "utils.h"
 
+/* rkm mods: */
+void _releaseCupsInstance();
+int addCupsPrinter(char *name, char *device_uri, char *location, char *ppd_file, char *model, char *info);
+int delCupsPrinter(char *pr_name);
+int setDefaultCupsPrinter(char *pr_name);
+int controlCupsPrinter(char *pr_name, int op);
+/* end rkm mods */
+
 /* Ref: PEP 353 (Python 2.5) */
 #if PY_VERSION_HEX < 0x02050000
 typedef int Py_ssize_t;
diff -Naur hplip-3.25.8.orig/prnt/hpcups/HPCupsFilter.cpp hplip-3.25.8.modified/prnt/hpcups/HPCupsFilter.cpp
--- hplip-3.25.8.orig/prnt/hpcups/HPCupsFilter.cpp	2026-01-16 08:22:56.438777534 -0500
+++ hplip-3.25.8.modified/prnt/hpcups/HPCupsFilter.cpp	2026-01-16 08:23:26.459082417 -0500
@@ -44,6 +44,11 @@
 
 #define HP_FILE_VERSION_STR    "03.09.08.0"
 
+/* rkm mods */
+/* for gettimeofday: */
+#include </usr/include/sys/time.h>
+/* end rkm mods */
+
 static HPCupsFilter    filter;
 
 
diff -Naur hplip-3.25.8.orig/prnt/hpps/pserror.c hplip-3.25.8.modified/prnt/hpps/pserror.c
--- hplip-3.25.8.orig/prnt/hpps/pserror.c	2026-01-16 08:22:56.455005509 -0500
+++ hplip-3.25.8.modified/prnt/hpps/pserror.c	2026-01-16 08:23:26.469125275 -0500
@@ -24,7 +24,10 @@
 void message(int flags, char *format, ...)
 {
   va_list args ;
-  static column = 0 ;		/* current screen column for message wrap */
+/* rkm mods */
+/*  static column = 0 ; */      /* current screen column for message wrap */
+  static int column = 0 ;       /* current screen column for message wrap */
+/* end rkm mods */
   char msgbuf[MAX_MESSAGE] ;	/* buffer in which to put the message */
   char *bufptr = msgbuf ;	/* message buffer pointer */
 
diff -Naur hplip-3.25.8.orig/scan/sane/bb_ledm.c hplip-3.25.8.modified/scan/sane/bb_ledm.c
--- hplip-3.25.8.orig/scan/sane/bb_ledm.c	2026-01-16 08:22:56.461110364 -0500
+++ hplip-3.25.8.modified/scan/sane/bb_ledm.c	2026-01-16 08:23:26.446281148 -0500
@@ -29,6 +29,10 @@
 
 # include <stdint.h>
 
+/* rkm mods: */
+# include <unistd.h>
+/* end rkm mods */
+
 # define _STRINGIZE(x) #x
 # define STRINGIZE(x) _STRINGIZE(x)
 
diff -Naur hplip-3.25.8.orig/scan/sane/hpaio.c hplip-3.25.8.modified/scan/sane/hpaio.c
--- hplip-3.25.8.orig/scan/sane/hpaio.c	2026-01-16 08:22:56.460929612 -0500
+++ hplip-3.25.8.modified/scan/sane/hpaio.c	2026-01-16 08:23:26.448971009 -0500
@@ -52,6 +52,21 @@
 #include "io.h"
 #include "orblitei.h"
 
+/* rkm mods: */
+# include "sane.h"
+SANE_Status orblite_init (SANE_Int * version_code, SANE_Auth_Callback authorize);
+SANE_Status orblite_get_devices (SANE_Device *** device_list, SANE_Bool local_only);
+void orblite_exit (void);
+SANE_Status orblite_open (SANE_String_Const devicename, SANE_Handle * handle);
+void orblite_close (SANE_Handle handle);
+const SANE_Option_Descriptor * orblite_get_option_descriptor (SANE_Handle handle, SANE_Int option );
+SANE_Status orblite_control_option (SANE_Handle handle, SANE_Int option, SANE_Action action, void *value, SANE_Int * info);
+SANE_Status orblite_get_parameters (SANE_Handle handle, SANE_Parameters * params);
+SANE_Status orblite_start (SANE_Handle handle);
+SANE_Status orblite_read (SANE_Handle handle, SANE_Byte * data, SANE_Int max_length, SANE_Int * length);
+void orblite_cancel (SANE_Handle handle);
+/* end rkm mods */
+
 
 #define DEBUG_DECLARE_ONLY
 #include "sanei_debug.h"
diff -Naur hplip-3.25.8.orig/scan/sane/http.c hplip-3.25.8.modified/scan/sane/http.c
--- hplip-3.25.8.orig/scan/sane/http.c	2026-01-16 08:22:56.461162788 -0500
+++ hplip-3.25.8.modified/scan/sane/http.c	2026-01-16 08:23:26.464401762 -0500
@@ -58,6 +58,11 @@
 
 #define EXCEPTION_TIMEOUT 45 /* seconds */
 
+/* rkm mods */
+/* for usleep: */
+#include <unistd.h>
+/* end rkm mods */
+
 enum HTTP_STATE
 {
    HS_ACTIVE = 1,
diff -Naur hplip-3.25.8.orig/scan/sane/ledmi.h hplip-3.25.8.modified/scan/sane/ledmi.h
--- hplip-3.25.8.orig/scan/sane/ledmi.h	2026-01-16 08:22:56.461035756 -0500
+++ hplip-3.25.8.modified/scan/sane/ledmi.h	2026-01-16 08:23:26.471584966 -0500
@@ -162,8 +162,10 @@
 int bb_open(struct ledm_session*);
 int bb_close(struct ledm_session*);
 int bb_get_parameters(struct ledm_session*, SANE_Parameters*, int);
-int bb_is_paper_in_adf();         /* 0 = no paper in adf, 1 = paper in adf, -1 = error */
+/* rkm mods: */
+int bb_is_paper_in_adf(struct ledm_session *ps);         /* 0 = no paper in adf, 1 = paper in adf, -1 = error */
 SANE_Status bb_start_scan(struct ledm_session*);
+/* end rkm mods */
 int bb_get_image_data(struct ledm_session*, int); 
 int bb_end_page(struct ledm_session*, int);
 int bb_end_scan(struct ledm_session* , int);
diff -Naur hplip-3.25.8.orig/scan/sane/orblite.c hplip-3.25.8.modified/scan/sane/orblite.c
--- hplip-3.25.8.orig/scan/sane/orblite.c	2026-01-16 08:22:56.461136201 -0500
+++ hplip-3.25.8.modified/scan/sane/orblite.c	2026-01-16 08:23:26.474019764 -0500
@@ -45,6 +45,12 @@
 
 static struct t_SANE *g_handle = NULL;
 
+/* rkm mods: */
+/* Replaced every instance of "SANE_Char**" with "void *" */
+void _DBG(void *rkm_message);
+void dlclose(void *rkm_p);
+/* end rkm mods */
+
 SANE_Option_Descriptor	DefaultOrbOptions[] = {
 	/* name, title, desc,
 	 * type, unit, size, cap,
@@ -63,28 +69,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, (void *)&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, (void *)&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, (void *)&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, (void *)&SANE_rangeBottom  // constraint_type, constraint
 	},
    
 	// optResolution,                                       // resolution group  
@@ -92,7 +98,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, (void *)SANE_resolutions // constraint type, constraint
 	},
 
 	// optMode,                                            // color/depth group
@@ -100,7 +106,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, (void *)SANE_modes   // constraint type, constraint
 	},
  
 	// optSource, 
@@ -108,7 +114,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, (void *)SANE_sources   // constraint type, constraint
 	},
  
 	// optPaperSize, 
@@ -116,7 +122,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, (void *)SANE_paper_sizes   // constraint type, constraint
 	},
  
 	// optPaperSize, 
@@ -124,7 +130,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, (void *)SANE_resolutions // constraint type, constraint
 	},
 #ifdef NOTDEF
 // default template
@@ -303,8 +309,10 @@
 	stat = g_handle->bb_orblite_get_devices(device_list, local_only);
 	if (stat != SANE_STATUS_GOOD)
 		return stat;
-
-	stat = g_handle->bb_orblite_open(devicename, &g_handle);
+/* rkm mods: */
+/*	stat = g_handle->bb_orblite_open(devicename, &g_handle); */
+	stat = g_handle->bb_orblite_open(devicename,handle);
+/* end rkm mods */
 	if (stat == SANE_STATUS_GOOD)
 		*handle = g_handle;
 
diff -Naur hplip-3.25.8.orig/scan/sane/sclpml.c hplip-3.25.8.modified/scan/sane/sclpml.c
--- hplip-3.25.8.orig/scan/sane/sclpml.c	2026-01-16 08:22:56.461592414 -0500
+++ hplip-3.25.8.modified/scan/sane/sclpml.c	2026-01-16 08:23:26.461783292 -0500
@@ -46,6 +46,11 @@
 #define DEBUG_DECLARE_ONLY
 #include "sanei_debug.h"
 
+/* rkm mods */
+/* for gettimeofday: */
+#include </usr/include/sys/time.h>
+/* end rkm mods */
+
 //# define  SCLPML_DEBUG
 # ifdef SCLPML_DEBUG
    # define _DBG(args...) syslog(LOG_INFO, __FILE__ " " STRINGIZE(__LINE__) ": " args)
