From 45f84a569c1f15fd76f36199061eed41f5f1587f Mon Sep 17 00:00:00 2001 From: pobrn Date: Wed, 12 Aug 2020 12:29:36 +0200 Subject: [PATCH] respect 'local_only' parameter of sane_get_devices() Certain backends do network scans even if the 'local_only' parameter for 'sane_get_devices()' is true. Fix that. Changes: 1. Modify 'sanei_configure_attach()' so that backend specific data may be passed to the 'attach()' function. 2. Use this in certain backends to pass the value of the 'local_only' parameter so that network related activities are only carried out when the value is false. --- backend/dell1600n_net.c | 7 +++-- backend/epson2.c | 32 +++++++++++--------- backend/epsonds.c | 31 +++++++++++-------- backend/escl/escl.c | 6 ++-- backend/genesys/genesys.cpp | 6 ++-- backend/kodakaio.c | 42 ++++++++++++++------------ backend/magicolor.c | 46 ++++++++++++++++------------- backend/p5.c | 6 ++-- backend/p5.h | 3 +- backend/pixma/pixma.c | 9 +++--- backend/rts8891.c | 7 +++-- backend/umax_pp.c | 5 ++-- backend/xerox_mfp.c | 5 ++-- include/sane/sanei_config.h | 4 ++- sanei/sanei_config.c | 5 ++-- testsuite/sanei/sanei_config_test.c | 36 +++++++++++----------- 16 files changed, 143 insertions(+), 107 deletions(-) diff --git a/backend/dell1600n_net.c b/backend/dell1600n_net.c index c8717d49b..6d808b533 100644 --- a/backend/dell1600n_net.c +++ b/backend/dell1600n_net.c @@ -288,8 +288,7 @@ sane_exit (void) /***********************************************************/ SANE_Status -sane_get_devices (const SANE_Device *** device_list, - SANE_Bool __sane_unused__ local_only) +sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only) { int ret; @@ -312,6 +311,10 @@ sane_get_devices (const SANE_Device *** device_list, sock = 0; pDevice = NULL; optYes = 1; + + if (local_only) + return ret; + InitComBuf (&queryPacket); /* clear previous results */ diff --git a/backend/epson2.c b/backend/epson2.c index e6f678675..85a759964 100644 --- a/backend/epson2.c +++ b/backend/epson2.c @@ -813,10 +813,11 @@ attach_one_pio(const char *dev) } static SANE_Status -attach_one_config(SANEI_Config __sane_unused__ *config, const char *line) +attach_one_config(SANEI_Config __sane_unused__ *config, const char *line, + void *data) { int vendor, product; - + SANE_Bool local_only = *(SANE_Bool*) data; int len = strlen(line); DBG(7, "%s: len = %d, line = %s\n", __func__, len, line); @@ -847,13 +848,16 @@ attach_one_config(SANEI_Config __sane_unused__ *config, const char *line) } else if (strncmp(line, "net", 3) == 0) { - /* remove the "net" sub string */ - const char *name = sanei_config_skip_whitespace(line + 3); + if (!local_only) { + /* remove the "net" sub string */ + const char *name = + sanei_config_skip_whitespace(line + 3); - if (strncmp(name, "autodiscovery", 13) == 0) - e2_network_discovery(); - else - attach_one_net(name); + if (strncmp(name, "autodiscovery", 13) == 0) + e2_network_discovery(); + else + attach_one_net(name); + } } else if (strncmp(line, "pio", 3) == 0) { @@ -889,14 +893,14 @@ free_devices(void) } static void -probe_devices(void) +probe_devices(SANE_Bool local_only) { DBG(5, "%s\n", __func__); free_devices(); sanei_configure_attach(EPSON2_CONFIG_FILE, NULL, - attach_one_config); + attach_one_config, &local_only); } SANE_Status @@ -926,14 +930,14 @@ sane_exit(void) } SANE_Status -sane_get_devices(const SANE_Device ***device_list, SANE_Bool __sane_unused__ local_only) +sane_get_devices(const SANE_Device ***device_list, SANE_Bool local_only) { Epson_Device *dev; int i; DBG(5, "%s\n", __func__); - probe_devices(); + probe_devices(local_only); devlist = malloc((num_devices + 1) * sizeof(devlist[0])); if (!devlist) { @@ -1470,7 +1474,7 @@ sane_open(SANE_String_Const name, SANE_Handle *handle) /* probe if empty device name provided */ if (l == 0) { - probe_devices(); + probe_devices(SANE_FALSE); if (first_dev == NULL) { DBG(1, "no device detected\n"); @@ -1507,7 +1511,7 @@ sane_open(SANE_String_Const name, SANE_Handle *handle) */ if (first_dev == NULL) - probe_devices(); + probe_devices(SANE_FALSE); s = device_detect(name, SANE_EPSON_NODEV, 0, &status); if (s == NULL) { diff --git a/backend/epsonds.c b/backend/epsonds.c index f2af220c4..1d557c926 100644 --- a/backend/epsonds.c +++ b/backend/epsonds.c @@ -481,10 +481,11 @@ attach_one_net(const char *dev) static SANE_Status -attach_one_config(SANEI_Config __sane_unused__ *config, const char *line) +attach_one_config(SANEI_Config __sane_unused__ *config, const char *line, + void *data) { int vendor, product; - + SANE_Bool local_only = *(SANE_Bool*) data; int len = strlen(line); DBG(7, "%s: len = %d, line = %s\n", __func__, len, line); @@ -513,13 +514,16 @@ attach_one_config(SANEI_Config __sane_unused__ *config, const char *line) } else if (strncmp(line, "net", 3) == 0) { - /* remove the "net" sub string */ - const char *name = sanei_config_skip_whitespace(line + 3); + if (!local_only) { + /* remove the "net" sub string */ + const char *name = + sanei_config_skip_whitespace(line + 3); - if (strncmp(name, "autodiscovery", 13) == 0) - e2_network_discovery(); - else - attach_one_net(name); + if (strncmp(name, "autodiscovery", 13) == 0) + e2_network_discovery(); + else + attach_one_net(name); + } } else { DBG(0, "unable to parse config line: %s\n", line); @@ -545,12 +549,13 @@ free_devices(void) } static void -probe_devices(void) +probe_devices(SANE_Bool local_only) { DBG(5, "%s\n", __func__); free_devices(); - sanei_configure_attach(EPSONDS_CONFIG_FILE, NULL, attach_one_config); + sanei_configure_attach(EPSONDS_CONFIG_FILE, NULL, + attach_one_config, &local_only); } /**** SANE API ****/ @@ -581,14 +586,14 @@ sane_exit(void) } SANE_Status -sane_get_devices(const SANE_Device ***device_list, SANE_Bool __sane_unused__ local_only) +sane_get_devices(const SANE_Device ***device_list, SANE_Bool local_only) { int i; epsonds_device *dev; DBG(5, "** %s\n", __func__); - probe_devices(); + probe_devices(local_only); devlist = malloc((num_devices + 1) * sizeof(devlist[0])); if (!devlist) { @@ -793,7 +798,7 @@ sane_open(SANE_String_Const name, SANE_Handle *handle) /* probe if empty device name provided */ if (name[0] == '\0') { - probe_devices(); + probe_devices(SANE_FALSE); if (first_dev == NULL) { DBG(1, "no devices detected\n"); diff --git a/backend/escl/escl.c b/backend/escl/escl.c index c40fd985f..1ad315114 100644 --- a/backend/escl/escl.c +++ b/backend/escl/escl.c @@ -383,7 +383,8 @@ sane_exit(void) * \return escl_add_in_list(escl_device) if the parsing worked, SANE_STATUS_GOOD otherwise. */ static SANE_Status -attach_one_config(SANEI_Config __sane_unused__ *config, const char *line) +attach_one_config(SANEI_Config __sane_unused__ *config, const char *line, + void __sane_unused__ *data) { int port = 0; SANE_Status status; @@ -487,7 +488,8 @@ sane_get_devices(const SANE_Device ***device_list, SANE_Bool local_only) if (device_list == NULL) return (SANE_STATUS_INVAL); - status = sanei_configure_attach(ESCL_CONFIG_FILE, NULL, attach_one_config); + status = sanei_configure_attach(ESCL_CONFIG_FILE, NULL, + attach_one_config, NULL); if (status != SANE_STATUS_GOOD) return (status); escl_devices(&status); diff --git a/backend/genesys/genesys.cpp b/backend/genesys/genesys.cpp index 9d80cfadf..997d5c43b 100644 --- a/backend/genesys/genesys.cpp +++ b/backend/genesys/genesys.cpp @@ -5186,7 +5186,8 @@ static SANE_Status attach_one_device(SANE_String_Const devname) noexcept // this function is passed to C API, it must not throw static SANE_Status -config_attach_genesys(SANEI_Config __sane_unused__ *config, const char *devname) noexcept +config_attach_genesys(SANEI_Config __sane_unused__ *config, const char *devname, + void __sane_unused__ *data) noexcept { /* the devname has been processed and is ready to be used * directly. Since the backend is an USB only one, we can @@ -5214,7 +5215,8 @@ static void probe_genesys_devices() config.values = nullptr; config.count = 0; - auto status = sanei_configure_attach(GENESYS_CONFIG_FILE, &config, config_attach_genesys); + auto status = sanei_configure_attach(GENESYS_CONFIG_FILE, &config, + config_attach_genesys, NULL); if (status == SANE_STATUS_ACCESS_DENIED) { dbg.vlog(DBG_error0, "Critical error: Couldn't access configuration file '%s'", GENESYS_CONFIG_FILE); diff --git a/backend/kodakaio.c b/backend/kodakaio.c index 9a7a8b441..d880078b6 100644 --- a/backend/kodakaio.c +++ b/backend/kodakaio.c @@ -2513,10 +2513,11 @@ attach_one_net(const char *dev, unsigned int model) } static SANE_Status -attach_one_config(SANEI_Config __sane_unused__ *config, const char *line) +attach_one_config(SANEI_Config __sane_unused__ *config, const char *line, + void *data) { int vendor, product, timeout; - + SANE_Bool local_only = *(SANE_Bool*) data; int len = strlen(line); DBG(7, "%s: len = %d, line = %s\n", __func__, len, line); @@ -2550,27 +2551,30 @@ attach_one_config(SANEI_Config __sane_unused__ *config, const char *line) } else if (strncmp(line, "net", 3) == 0) { - /* remove the "net" sub string */ - const char *name = sanei_config_skip_whitespace(line + 3); - char IP[1024]; - unsigned int model = 0; + if (!local_only) { + /* remove the "net" sub string */ + const char *name = + sanei_config_skip_whitespace(line + 3); + char IP[1024]; + unsigned int model = 0; - if (strncmp(name, "autodiscovery", 13) == 0) { + if (strncmp(name, "autodiscovery", 13) == 0) { -#if WITH_AVAHI - DBG (30, "%s: Initiating network autodiscovery via avahi\n", __func__); - kodak_network_discovery(NULL); -#else - DBG (20, "%s: Network autodiscovery not done because not configured with avahi.\n", __func__); -#endif + #if WITH_AVAHI + DBG (30, "%s: Initiating network autodiscovery via avahi\n", __func__); + kodak_network_discovery(NULL); + #else + DBG (20, "%s: Network autodiscovery not done because not configured with avahi.\n", __func__); + #endif - } else if (sscanf(name, "%s %x", IP, &model) == 2) { - DBG(30, "%s: Using network device on IP %s, forcing model 0x%x\n", __func__, IP, model); - attach_one_net(IP, model); - } else { + } else if (sscanf(name, "%s %x", IP, &model) == 2) { + DBG(30, "%s: Using network device on IP %s, forcing model 0x%x\n", __func__, IP, model); + attach_one_net(IP, model); + } else { DBG(1, "%s: net entry %s may be a host name?\n", __func__, name); attach_one_net(name, 0); } + } } else if (sscanf(line, "snmp-timeout %i\n", &timeout)) { /* Timeout for auto network discovery */ @@ -2646,7 +2650,7 @@ sane_exit(void) } SANE_Status -sane_get_devices(const SANE_Device ***device_list, SANE_Bool __sane_unused__ local_only) +sane_get_devices(const SANE_Device ***device_list, SANE_Bool local_only) { Kodak_Device *dev, *s, *prev=0; int i; @@ -2662,7 +2666,7 @@ sane_get_devices(const SANE_Device ***device_list, SANE_Bool __sane_unused__ loc /* Read the config, mark each device as found, possibly add new devs */ sanei_configure_attach(KODAKAIO_CONFIG_FILE, NULL, - attach_one_config); + attach_one_config, &local_only); /*delete missing scanners from list*/ for (s = first_dev; s;) { diff --git a/backend/magicolor.c b/backend/magicolor.c index 0b079fa31..886dbabda 100644 --- a/backend/magicolor.c +++ b/backend/magicolor.c @@ -2157,10 +2157,11 @@ attach_one_net(const char *dev, unsigned int model) } static SANE_Status -attach_one_config(SANEI_Config __sane_unused__ *config, const char *line) +attach_one_config(SANEI_Config __sane_unused__ *config, const char *line, + void *data) { int vendor, product, timeout; - + SANE_Bool local_only = *(SANE_Bool*) data; int len = strlen(line); DBG(7, "%s: len = %d, line = %s\n", __func__, len, line); @@ -2189,24 +2190,27 @@ attach_one_config(SANEI_Config __sane_unused__ *config, const char *line) } else if (strncmp(line, "net", 3) == 0) { - /* remove the "net" sub string */ - const char *name = sanei_config_skip_whitespace(line + 3); - char IP[1024]; - unsigned int model = 0; + if (!local_only) { + /* remove the "net" sub string */ + const char *name = + sanei_config_skip_whitespace(line + 3); + char IP[1024]; + unsigned int model = 0; - if (strncmp(name, "autodiscovery", 13) == 0) { - DBG (50, "%s: Initiating network autodiscovervy via SNMP\n", __func__); - mc_network_discovery(NULL); - } else if (sscanf(name, "%s %x", IP, &model) == 2) { - DBG(50, "%s: Using network device on IP %s, forcing model 0x%x\n", __func__, IP, model); - attach_one_net(IP, model); - } else { - /* use SNMP to detect the type. If not successful, - * add the host with model type 0 */ - DBG(50, "%s: Using network device on IP %s, trying to autodetect model\n", __func__, IP); - if (mc_network_discovery(name)==0) { - DBG(1, "%s: Autodetecting device model failed, using default model\n", __func__); - attach_one_net(name, 0); + if (strncmp(name, "autodiscovery", 13) == 0) { + DBG (50, "%s: Initiating network autodiscovervy via SNMP\n", __func__); + mc_network_discovery(NULL); + } else if (sscanf(name, "%s %x", IP, &model) == 2) { + DBG(50, "%s: Using network device on IP %s, forcing model 0x%x\n", __func__, IP, model); + attach_one_net(IP, model); + } else { + /* use SNMP to detect the type. If not successful, + * add the host with model type 0 */ + DBG(50, "%s: Using network device on IP %s, trying to autodetect model\n", __func__, IP); + if (mc_network_discovery(name)==0) { + DBG(1, "%s: Autodetecting device model failed, using default model\n", __func__); + attach_one_net(name, 0); + } } } @@ -2279,7 +2283,7 @@ sane_exit(void) } SANE_Status -sane_get_devices(const SANE_Device ***device_list, SANE_Bool __sane_unused__ local_only) +sane_get_devices(const SANE_Device ***device_list, SANE_Bool local_only) { Magicolor_Device *dev, *s, *prev=0; int i; @@ -2295,7 +2299,7 @@ sane_get_devices(const SANE_Device ***device_list, SANE_Bool __sane_unused__ loc /* Read the config, mark each device as found, possibly add new devs */ sanei_configure_attach(MAGICOLOR_CONFIG_FILE, NULL, - attach_one_config); + attach_one_config, &local_only); /*delete missing scanners from list*/ for (s = first_dev; s;) { diff --git a/backend/p5.c b/backend/p5.c index d4b572477..d61e39c44 100644 --- a/backend/p5.c +++ b/backend/p5.c @@ -1566,7 +1566,8 @@ probe_p5_devices (void) config.count = NUM_CFG_OPTIONS; /* generic configure and attach function */ - status = sanei_configure_attach (P5_CONFIG_FILE, &config, config_attach); + status = sanei_configure_attach (P5_CONFIG_FILE, &config, + config_attach, NULL); /* free allocated options */ for (i = 0; i < NUM_CFG_OPTIONS; i++) { @@ -1590,7 +1591,8 @@ probe_p5_devices (void) * SANE_STATUS_INVAL in case of error */ static SANE_Status -config_attach (SANEI_Config * config, const char *devname) +config_attach (SANEI_Config __sane_unused__ * config, const char *devname, + void __sane_unused__ *data) { /* currently, the config is a global variable so config is useless here */ /* the correct thing would be to have a generic sanei_attach_matching_devices diff --git a/backend/p5.h b/backend/p5.h index eae62f7f1..27bd59ed1 100644 --- a/backend/p5.h +++ b/backend/p5.h @@ -195,7 +195,8 @@ typedef struct P5_Session static SANE_Status probe_p5_devices (void); static P5_Model *probe (const char *devicename); -static SANE_Status config_attach (SANEI_Config * config, const char *devname); +static SANE_Status config_attach (SANEI_Config * config, const char *devname, + void *data); static SANE_Status attach_p5 (const char *name, SANEI_Config * config); static SANE_Status init_options (struct P5_Session *session); static SANE_Status compute_parameters (struct P5_Session *session); diff --git a/backend/pixma/pixma.c b/backend/pixma/pixma.c index c32907cf4..75617e209 100644 --- a/backend/pixma/pixma.c +++ b/backend/pixma/pixma.c @@ -159,10 +159,11 @@ static void mark_all_button_options_cached ( struct pixma_sane_t * ss ) ss -> button_option_is_cached[i] = 1; } -static SANE_Status config_attach_pixma(SANEI_Config * config, const char *devname) +static SANE_Status config_attach_pixma(SANEI_Config __sane_unused__ * config, + const char *devname, + void __sane_unused__ *data) { int i; - UNUSED(config); for (i=0; i < (MAX_CONF_DEVICES -1); i++) { if(conf_devices[i] == NULL) @@ -1656,8 +1657,8 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize) config.descriptors = NULL; config.values = NULL; - if (sanei_configure_attach(PIXMA_CONFIG_FILE, &config, config_attach_pixma) != - SANE_STATUS_GOOD) + if (sanei_configure_attach(PIXMA_CONFIG_FILE, &config, + config_attach_pixma, NULL) != SANE_STATUS_GOOD) PDBG(pixma_dbg(2, "Could not read pixma configuration file: %s\n", PIXMA_CONFIG_FILE)); diff --git a/backend/rts8891.c b/backend/rts8891.c index 93018abb7..e699bcc93 100644 --- a/backend/rts8891.c +++ b/backend/rts8891.c @@ -217,7 +217,7 @@ static Rts8891_Config rtscfg; /* ------------------------------------------------------------------------- */ static SANE_Status probe_rts8891_devices (void); static SANE_Status config_attach_rts8891 (SANEI_Config * config, - const char *devname); + const char *devname, void *data); static SANE_Status attach_rts8891 (const char *name); static SANE_Status set_lamp_brightness (struct Rts8891_Device *dev, int level); @@ -2374,7 +2374,7 @@ probe_rts8891_devices (void) /* generic configure and attach function */ status = sanei_configure_attach (RTS8891_CONFIG_FILE, &config, - config_attach_rts8891); + config_attach_rts8891, NULL); /* free allocated options */ for (i = 0; i < NUM_CFG_OPTIONS; i++) { @@ -2398,7 +2398,8 @@ probe_rts8891_devices (void) * SANE_STATUS_INVAL in case of error */ static SANE_Status -config_attach_rts8891 (SANEI_Config * config, const char *devname) +config_attach_rts8891 (SANEI_Config * config, const char *devname, + void __sane_unused__ *data) { /* currently, the config is a global variable so config is useless here */ /* the correct thing would be to have a generic sanei_attach_matching_devices diff --git a/backend/umax_pp.c b/backend/umax_pp.c index 16adbe386..dfc791398 100644 --- a/backend/umax_pp.c +++ b/backend/umax_pp.c @@ -419,7 +419,8 @@ umax_pp_auto_attach (SANEI_Config * config, SANE_Int safe) * device name to use for attach try. */ static SANE_Status -umax_pp_configure_attach (SANEI_Config * config, const char *devname) +umax_pp_configure_attach (SANEI_Config * config, const char *devname, + void __sane_unused__ *data) { const char *lp; SANE_Char *token; @@ -961,7 +962,7 @@ sane_init (SANE_Int * version_code, SANE_Auth_Callback authorize) /* generic configure and attach function */ status = sanei_configure_attach (UMAX_PP_CONFIG_FILE, &config, - umax_pp_configure_attach); + umax_pp_configure_attach, NULL); /* free option descriptors */ for (i = 0; i < NUM_CFG_OPTIONS; i++) diff --git a/backend/xerox_mfp.c b/backend/xerox_mfp.c index f5fd70ef9..bfcce410f 100644 --- a/backend/xerox_mfp.c +++ b/backend/xerox_mfp.c @@ -1028,7 +1028,8 @@ list_one_device(SANE_String_Const devname) /* SANE API ignores return code of this callback */ static SANE_Status -list_conf_devices(UNUSED(SANEI_Config *config), const char *devname) +list_conf_devices(SANEI_Config __sane_unused__ *config, const char *devname, + void __sane_unused__ *data) { return tr_from_devname(devname)->configure_device(devname, list_one_device); } @@ -1080,7 +1081,7 @@ sane_get_devices(const SANE_Device *** device_list, SANE_Bool local) config.count = 0; config.descriptors = NULL; config.values = NULL; - sanei_configure_attach(XEROX_CONFIG_FILE, &config, list_conf_devices); + sanei_configure_attach(XEROX_CONFIG_FILE, &config, list_conf_devices, NULL); for (dev_count = 0, dev = devices_head; dev; dev = dev->next) dev_count++; diff --git a/include/sane/sanei_config.h b/include/sane/sanei_config.h index 3a6016736..44b79f071 100644 --- a/include/sane/sanei_config.h +++ b/include/sane/sanei_config.h @@ -166,7 +166,9 @@ typedef struct extern SANE_Status sanei_configure_attach ( const char *config_file, SANEI_Config *config, - SANE_Status (*config_attach)(SANEI_Config *config, const char *devname) + SANE_Status (*config_attach)(SANEI_Config *config, const char *devname, + void *data), + void *data ); /** Return the list of config directories, extracted from the SANE_CONFIG_DIR diff --git a/sanei/sanei_config.c b/sanei/sanei_config.c index 0eaee9afb..b5b558a8b 100644 --- a/sanei/sanei_config.c +++ b/sanei/sanei_config.c @@ -239,7 +239,8 @@ sanei_config_read (char *str, int n, FILE *stream) SANE_Status sanei_configure_attach (const char *config_file, SANEI_Config * config, SANE_Status (*attach) (SANEI_Config * config, - const char *devname)) + const char *devname, void *data), + void *data) { SANE_Char line[PATH_MAX]; SANE_Char *token, *string; @@ -443,7 +444,7 @@ sanei_configure_attach (const char *config_file, SANEI_Config * config, DBG (3, "sanei_configure_attach: trying to attach with '%s'\n", lp2); if(attach!=NULL) - attach (config, lp2); + attach (config, lp2, data); } } diff --git a/testsuite/sanei/sanei_config_test.c b/testsuite/sanei/sanei_config_test.c index ea0043320..34b1881d2 100644 --- a/testsuite/sanei/sanei_config_test.c +++ b/testsuite/sanei/sanei_config_test.c @@ -63,7 +63,8 @@ static const SANE_String_Const string_list[] = static char *lastdevname = NULL; static SANE_Status -check_config_attach (SANEI_Config * config, const char *devname) +check_config_attach (SANEI_Config * config, const char *devname, + void __sane_unused__ *data) { /* silence compiler warning for now */ if (config == NULL) @@ -97,7 +98,8 @@ inexistent_config (void) config.descriptors = NULL; config.values = NULL; status = sanei_configure_attach (CONFIG_PATH - "/data/inexistent.conf", &config, NULL); + "/data/inexistent.conf", &config, + NULL, NULL); /* check results */ assert (status != SANE_STATUS_GOOD); @@ -114,7 +116,7 @@ null_config (void) status = sanei_configure_attach (CONFIG_PATH "/data/umax_pp.conf", NULL, - check_config_attach); + check_config_attach, NULL); /* check results */ assert (status == SANE_STATUS_GOOD); @@ -130,7 +132,7 @@ null_attach (void) SANE_Status status; status = sanei_configure_attach (CONFIG_PATH - "/data/umax_pp.conf", NULL, NULL); + "/data/umax_pp.conf", NULL, NULL, NULL); /* check results */ assert (status == SANE_STATUS_GOOD); @@ -151,7 +153,7 @@ empty_config (void) config.values = NULL; status = sanei_configure_attach (CONFIG_PATH "/data/empty.conf", - &config, check_config_attach); + &config, check_config_attach, NULL); /* check results */ assert (status == SANE_STATUS_GOOD); @@ -206,7 +208,7 @@ string_option (void) /* configure and attach */ status = sanei_configure_attach (CONFIG_PATH "/data/string.conf", - &config, check_config_attach); + &config, check_config_attach, NULL); /* check results */ assert (status == SANE_STATUS_GOOD); @@ -250,7 +252,7 @@ int_option (void) /* configure and attach */ status = sanei_configure_attach (CONFIG_PATH "/data/int.conf", &config, - check_config_attach); + check_config_attach, NULL); /* check results */ assert (status == SANE_STATUS_GOOD); @@ -293,7 +295,7 @@ wrong_range_int_option (void) /* configure and attach */ status = sanei_configure_attach (CONFIG_PATH "/data/wrong-range.conf", - &config, check_config_attach); + &config, check_config_attach, NULL); /* check results */ assert (status == SANE_STATUS_INVAL); @@ -336,7 +338,7 @@ word_array_option (void) /* configure and attach */ status = sanei_configure_attach (CONFIG_PATH "/data/word-array.conf", - &config, check_config_attach); + &config, check_config_attach, NULL); /* check results */ assert (status == SANE_STATUS_GOOD); @@ -382,7 +384,7 @@ string_list_option (void) /* configure and attach */ status = sanei_configure_attach (CONFIG_PATH "/data/string-list.conf", - &config, check_config_attach); + &config, check_config_attach, NULL); /* check results */ assert (status == SANE_STATUS_GOOD); @@ -428,7 +430,7 @@ wrong_string_list_option (void) status = sanei_configure_attach (CONFIG_PATH "/data/wrong-string-list.conf", &config, - check_config_attach); + check_config_attach, NULL); /* check results */ assert (status == SANE_STATUS_INVAL); @@ -563,7 +565,7 @@ umax_pp (void) /* configure and attach */ status = sanei_configure_attach (CONFIG_PATH "/data/umax_pp.conf", - &config, check_config_attach); + &config, check_config_attach, NULL); /* check results */ assert (status == SANE_STATUS_GOOD); @@ -631,7 +633,7 @@ wrong_bool_option (void) /* configure and attach */ status = sanei_configure_attach (CONFIG_PATH "/data/wrong-boolean.conf", - &config, check_config_attach); + &config, check_config_attach, NULL); /* check results */ assert (status == SANE_STATUS_INVAL); @@ -696,7 +698,7 @@ bool_option (void) /* configure and attach */ status = sanei_configure_attach (CONFIG_PATH "/data/boolean.conf", - &config, check_config_attach); + &config, check_config_attach, NULL); /* check results */ assert (status == SANE_STATUS_GOOD); @@ -767,7 +769,7 @@ fixed_option (void) /* configure and attach */ status = sanei_configure_attach (CONFIG_PATH "/data/fixed.conf", - &config, check_config_attach); + &config, check_config_attach, NULL); /* check results */ assert (status == SANE_STATUS_GOOD); @@ -814,7 +816,7 @@ wrong_fixed_option (void) /* configure and attach */ status = sanei_configure_attach (CONFIG_PATH "/data/wrong-fixed.conf", - &config, check_config_attach); + &config, check_config_attach, NULL); /* check results */ assert (status == SANE_STATUS_INVAL); @@ -852,7 +854,7 @@ snapscan (void) /* configure and attach */ status = sanei_configure_attach (CONFIG_PATH "/data/snapscan.conf", - &config, check_config_attach); + &config, check_config_attach, NULL); /* check results */ assert (status == SANE_STATUS_GOOD);