]> gitweb.hhaalo.de Git - sane-kds-s2000w-net.git/commitdiff
init device by open method
authorBastian Dehn <hhaalo@arcor.de>
Sat, 20 Jan 2024 16:55:34 +0000 (17:55 +0100)
committerBastian Dehn <hhaalo@arcor.de>
Sat, 20 Jan 2024 16:55:34 +0000 (17:55 +0100)
src/kds_s2000w_net.c

index 6159b611fa5cc478d4afd4c6fca820ff07081f2d..6f827fea6c0513839541993d9e63ce7ea2abf094 100644 (file)
@@ -7,25 +7,9 @@ SANE_Option_Descriptor* optionDescripor = NULL;
 
 SANE_Status _sane_kds_s2000w_net_init(SANE_Int* version_code, SANE_Auth_Callback authorize)
 {
-       if (version_code == NULL) {
-               printf("init: verson_code pointer is NULL\n");
-               return SANE_STATUS_INVAL;
-       }
-
-       if (authorize == NULL) {
-               printf("init: verson_code pointer is NULL\n");
-               return SANE_STATUS_INVAL;
-       }
-
-       device = malloc(sizeof(SANE_Device));
-       device->name = "kds_s2000w_net";
-       device->vendor = "Kodak";
-       device->model = "Kodak Alaris s2000w series";
-       device->type = "document scanner";
+       printf("init: kds_s2000w_net init\n");
 
        *version_code = SANE_VERSION_CODE(1, 0, 0);
-       printf("init: version_code %ui\n", version_code);
-       printf("init: kds_s2000w_net init\n");
 
        return SANE_STATUS_GOOD;
 }
@@ -42,16 +26,14 @@ void _sane_kds_s2000w_net_exit(void)
 SANE_Status _sane_kds_s2000w_net_get_devices(SANE_Device*** device_list,
        SANE_Bool local_only)
 {
-       if (device_list == NULL) {
-               printf("device list pointer is null\n");
-       }
-
-       if (local_only) {
-               return SANE_STATUS_INVAL;
-       }
-
        printf("kds_s2000w_net get devices\n");
 
+       device = malloc(sizeof(SANE_Device));
+       device->name = "kds_s2000w_net";
+       device->vendor = "Kodak";
+       device->model = "Kodak Alaris s2000w series";
+       device->type = "document scanner";
+
        **device_list = device;
 
        return SANE_STATUS_GOOD;