summaryrefslogtreecommitdiff
path: root/include/sane
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2020-02-02 17:13:01 +0100
committerJörg Frings-Fürst <debian@jff-webhosting.net>2020-02-02 17:13:01 +0100
commitffa8801644a7d53cc1c785e3450f794c07a14eb0 (patch)
tree8d72a18a9a08b9151d12badcb1c78ce06a059f62 /include/sane
parent1687222e1b9e74c89cafbb5910e72d8ec7bfd40f (diff)
New upstream version 1.0.29upstream/1.0.29
Diffstat (limited to 'include/sane')
-rw-r--r--include/sane/sanei_usb.h51
-rw-r--r--include/sane/sanei_wire.h2
-rw-r--r--include/sane/saneopts.h4
3 files changed, 54 insertions, 3 deletions
diff --git a/include/sane/sanei_usb.h b/include/sane/sanei_usb.h
index ce389ca..1c1699d 100644
--- a/include/sane/sanei_usb.h
+++ b/include/sane/sanei_usb.h
@@ -180,6 +180,57 @@ struct sanei_usb_dev_descriptor
SANE_Byte max_packet_size;
};
+/** Initialize sanei_usb for replay testing.
+
+ Initializes sanei_usb for testing by mocking whole USB stack. This function
+ must be called before sanei_usb_init().
+
+ The sanei_usb subsystem also implements a "development mode". It modifies
+ the XML data file with the actual commands of the test run and attemps to
+ proceed testing until a mismatching input command is found for which
+ input data is required.
+
+ A <known_commands_end/> node in the data XML file will cause sanei_usb not
+ to continue to the subsequent command in the XML file and instead it will
+ prepend all output commands before that node before an output command is
+ encountered.
+
+ @param path Path to the XML data file.
+ @param development_mode Enables development mode.
+ */
+extern SANE_Status sanei_usb_testing_enable_replay(SANE_String_Const path,
+ int development_mode);
+
+/** Initialize sanei_usb for recording.
+ *
+ * Initializes sanei_usb for recording communication with the scanner. This
+ * function must be called before sanei_usb_init().
+ *
+ * @param path Path to the XML data file.
+ * @param be_name The name of the backend to enable recording for.
+ */
+extern SANE_Status sanei_usb_testing_enable_record(SANE_String_Const path,
+ SANE_String_Const be_name);
+
+/** Returns backend name for testing.
+ *
+ * Returns backend name for the file registered in sanei_usb_testing_enable.
+ * The caller is responsible for freeing it.
+ */
+extern SANE_String sanei_usb_testing_get_backend();
+
+/** Returns SANE_TRUE if replay testing mode is enabled, i.e. whether we are working with fake
+ * scan data.
+ */
+extern SANE_Bool sanei_usb_is_replay_mode_enabled();
+
+/** Records a debug message in the captured USB data if testing mode is enabled. If testing mode
+ * is not enabled, this function does nothing.
+ *
+ * @param msg Message to record
+ */
+extern void sanei_usb_testing_record_message(SANE_String_Const message);
+
/** Initialize sanei_usb.
*
* Call this before any other sanei_usb function.
diff --git a/include/sane/sanei_wire.h b/include/sane/sanei_wire.h
index 95be5cf..679814e 100644
--- a/include/sane/sanei_wire.h
+++ b/include/sane/sanei_wire.h
@@ -96,7 +96,7 @@ Wire;
extern void sanei_w_init (Wire *w, void (*codec_init)(Wire *));
extern void sanei_w_exit (Wire *w);
extern void sanei_w_space (Wire *w, size_t howmuch);
-extern void sanei_w_void (Wire *w);
+extern void sanei_w_void (Wire *w, void *);
extern void sanei_w_byte (Wire *w, SANE_Byte *v);
extern void sanei_w_char (Wire *w, SANE_Char *v);
extern void sanei_w_word (Wire *w, SANE_Word *v);
diff --git a/include/sane/saneopts.h b/include/sane/saneopts.h
index 37ba177..4a4b8cc 100644
--- a/include/sane/saneopts.h
+++ b/include/sane/saneopts.h
@@ -243,7 +243,7 @@
/* Descriptive/help strings for above options: */
#define SANE_DESC_NUM_OPTIONS \
SANE_I18N("Read-only option that specifies how many options a specific " \
-"devices supports.")
+"device supports.")
#define SANE_DESC_STANDARD SANE_I18N("Source, mode and resolution options")
#define SANE_DESC_GEOMETRY SANE_I18N("Scan area and media size options")
@@ -412,7 +412,7 @@ SANE_I18N("Analog gamma-correction for blue")
#define SANE_DESC_ANALOG_GAMMA_BIND \
SANE_I18N("In RGB-mode use same values for each color")
#define SANE_DESC_WARMUP \
-SANE_I18N("Warmup lamp before scanning")
+SANE_I18N("Warm up lamp before scanning")
#define SANE_DESC_CAL_EXPOS_TIME \
SANE_I18N("Define exposure-time for calibration")
#define SANE_DESC_CAL_EXPOS_TIME_R \