From f10e1862d0baec7ce3e738c4685d377001483d30 Mon Sep 17 00:00:00 2001 From: Bastian Dehn Date: Fri, 19 Jan 2024 18:35:08 +0100 Subject: [PATCH] init sane --- src/kds_s2000w_net.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/kds_s2000w_net.c b/src/kds_s2000w_net.c index 8dfe816..efc7411 100644 --- a/src/kds_s2000w_net.c +++ b/src/kds_s2000w_net.c @@ -2,8 +2,20 @@ #include #include -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, void* value, SANE_Int* info) { printf("kds_s2000w_net control option\n"); -- 2.39.5