]> gitweb.hhaalo.de Git - sane-kds-s2000w-net.git/commitdiff
init sane
authorBastian Dehn <hhaalo@arcor.de>
Fri, 19 Jan 2024 17:35:08 +0000 (18:35 +0100)
committerBastian Dehn <hhaalo@arcor.de>
Fri, 19 Jan 2024 17:35:08 +0000 (18:35 +0100)
src/kds_s2000w_net.c

index 8dfe81626806b7fa86eab9162f9ebb088d21efb1..efc7411449fae2284464d71f66afd530ca27687c 100644 (file)
@@ -2,8 +2,20 @@
 #include <stdlib.h>
 #include <sane/sane.h>
 
-SANE_Status _sane_kds_s2000w_net_init(SANE_Int * version_code, SANE_Auth_Callback authorize)
+SANE_Status _sane_kds_s2000w_net_init(SANE_Int* version_code, SANE_Auth_Callback authorize)
 {
+       if (version_code == NULL) {
+               printf("verson_code pointer is NULL\n");
+               return SANE_STATUS_INVAL;
+       }
+
+       if (authorize == NULL) {
+               printf("verson_code pointer is NULL\n");
+               return SANE_STATUS_INVAL;
+       }
+
+       *version_code = SANE_VERSION_CODE(1, 0, 0);
+       printf("version_code %d", version_code);
        printf("kds_s2000w_net init\n");
 
        return SANE_STATUS_GOOD;
@@ -18,6 +30,8 @@ SANE_Status _sane_kds_s2000w_net_get_devices(SANE_String_Const devicename,
        SANE_Handle* handle)
 {
        printf("kds_s2000w_net get devices\n");
+
+       return SANE_STATUS_GOOD;
 }
 
 SANE_Status _sane_kds_s2000w_net_open(SANE_String_Const devicename,
@@ -40,7 +54,7 @@ const SANE_Option_Descriptor* _sane_kds_s2000w_net_get_option_descriptor(
 }
 
 SANE_Status _sane_kds_s2000w_net_control_option(SANE_Handle handle,
-       SANE_Int option, SANE_Action action, void *value, SANE_Int* info)
+       SANE_Int option, SANE_Action action, voidvalue, SANE_Int* info)
 {
        printf("kds_s2000w_net control option\n");