]> gitweb.hhaalo.de Git - sane-kds-s2000w-net.git/commitdiff
change debug name convention
authorBastian Dehn <hhaalo@arcor.de>
Sat, 25 Jan 2025 16:43:51 +0000 (17:43 +0100)
committerBastian Dehn <hhaalo@arcor.de>
Sat, 25 Jan 2025 16:43:51 +0000 (17:43 +0100)
src/kds_s2000w_client.c
src/kds_s2000w_debug.c
src/kds_s2000w_debug.h
src/kds_s2000w_handler.c
src/kds_s2000w_handler_opts.c
src/kds_s2000w_image_converter.c
src/kds_s2000w_net.c
src/kds_s2000w_option_descriptors.c

index a167e78dfffbd0f089c4dfea58d407d8412c250d..afd7418cc4b37ee12f28d06ebeedfc3a314312b3 100644 (file)
@@ -34,7 +34,7 @@ void _kds_s2000w_client_print_error_status(CURL* curl)
        if (header == NULL)
                return;
 
-       debug_printf(ERROR, header->value);
+       kds_s2000w_debug_printf(ERROR, header->value);
 }
 
 void _kds_s2000w_client_print_error_result(CURLcode result)
@@ -44,17 +44,17 @@ void _kds_s2000w_client_print_error_result(CURLcode result)
 
        size_t len = strlen(errbuf);
        if (len > 0) {
-               debug_printf(ERROR, errbuf);
+               kds_s2000w_debug_printf(ERROR, errbuf);
                errbuf[0] = 0;
                return;
        }
 
-       debug_printf(ERROR, curl_easy_strerror(result));
+       kds_s2000w_debug_printf(ERROR, curl_easy_strerror(result));
 }
 
 void _kds_s2000w_client_stream_to_response(char* mem, response* resp, size_t* size)
 {
-       debug_printf(ALL, "kds_s2000w_client_stream_to_response");
+       kds_s2000w_debug_printf(ALL, "kds_s2000w_client_stream_to_response");
 
        size_t incl_null_term = *size + 1;
        resp->data = realloc(resp->data, sizeof(char) * incl_null_term);
@@ -73,7 +73,7 @@ void _kds_s2000w_client_set_ssl_verification_off(CURL* curl)
 
 void kds_s2000w_client_init()
 {
-       debug_printf(ALL, "kds_s2000w_client_init");
+       kds_s2000w_debug_printf(ALL, "kds_s2000w_client_init");
 
        char* config_stream = kds_s2000w_config_read(CONFIG_FILE);
        config = kds_s2000w_load_config(config_stream);
@@ -87,7 +87,7 @@ void kds_s2000w_client_init()
 
 void kds_s2000w_client_free()
 {
-       debug_printf(ALL, "kds_s2000w_client_free");
+       kds_s2000w_debug_printf(ALL, "kds_s2000w_client_free");
 
        kds_s2000w_config_free(config);
        config = NULL;
@@ -98,7 +98,7 @@ void kds_s2000w_client_free()
 
 response* kds_s2000w_client_response_init()
 {
-       debug_printf(ALL, "kds_s2000w_client_response_init");
+       kds_s2000w_debug_printf(ALL, "kds_s2000w_client_response_init");
 
        response* resp = malloc(sizeof(response));
        resp->data = NULL;
@@ -110,7 +110,7 @@ response* kds_s2000w_client_response_init()
 
 void kds_s2000w_client_response_free(response* resp)
 {
-       debug_printf(ALL, "kds_s2000w_client_response_free");
+       kds_s2000w_debug_printf(ALL, "kds_s2000w_client_response_free");
 
        if (resp == NULL)
                return;
@@ -123,7 +123,7 @@ void kds_s2000w_client_response_free(response* resp)
 
 int kds_s2000w_client_open_session(response* resp)
 {
-       debug_printf(ALL, "kds_s2000w_client_open_session");
+       kds_s2000w_debug_printf(ALL, "kds_s2000w_client_open_session");
 
        curl_easy_reset(curl);
 
@@ -182,7 +182,7 @@ int kds_s2000w_client_open_session(response* resp)
 
 void kds_s2000w_client_close_session(int64_t sessionid)
 {
-       debug_printf(ALL, "kds_s2000w_client_close_session");
+       kds_s2000w_debug_printf(ALL, "kds_s2000w_client_close_session");
 
        curl_easy_reset(curl);
 
@@ -222,7 +222,7 @@ void kds_s2000w_client_close_session(int64_t sessionid)
 
 int kds_s2000w_client_get_capabilities(response* resp)
 {
-       debug_printf(ALL, "kds_s2000w_client_get_capabilities");
+       kds_s2000w_debug_printf(ALL, "kds_s2000w_client_get_capabilities");
 
        curl_easy_reset(curl);
 
@@ -275,7 +275,7 @@ int kds_s2000w_client_get_capabilities(response* resp)
 
 int kds_s2000w_client_status_session(int64_t sessionid, response* resp)
 {
-       debug_printf(ALL, "kds_s2000w_client_status_session");
+       kds_s2000w_debug_printf(ALL, "kds_s2000w_client_status_session");
 
        join_thread();
        wait_seconds(&config->heartbeat);
@@ -337,7 +337,7 @@ int kds_s2000w_client_status_session(int64_t sessionid, response* resp)
 
 int kds_s2000w_client_start_scan(int64_t sessionid, response* resp)
 {
-       debug_printf(ALL, "kds_s2000w_client_start_scan");
+       kds_s2000w_debug_printf(ALL, "kds_s2000w_client_start_scan");
 
        curl_easy_reset(curl);
 
@@ -397,7 +397,7 @@ int kds_s2000w_client_start_scan(int64_t sessionid, response* resp)
 
 int kds_s2000w_client_stop_scan(int64_t sessionid, response* resp)
 {
-       debug_printf(ALL, "kds_s2000w_client_stop_scan");
+       kds_s2000w_debug_printf(ALL, "kds_s2000w_client_stop_scan");
 
        curl_easy_reset(curl);
 
@@ -457,7 +457,7 @@ int kds_s2000w_client_stop_scan(int64_t sessionid, response* resp)
 
 int kds_s2000w_client_get_image(int64_t sessionid, int img_number, response* resp)
 {
-       debug_printf(ALL, "kds_s2000w_client_get_image");
+       kds_s2000w_debug_printf(ALL, "kds_s2000w_client_get_image");
 
        curl_easy_reset(curl);
 
@@ -521,7 +521,7 @@ int kds_s2000w_client_get_image(int64_t sessionid, int img_number, response* res
 
 int kds_s2000w_client_delete_image(int64_t sessionid, int img_number, response* resp)
 {
-       debug_printf(ALL, "kds_s2000w_client_delete_image");
+       kds_s2000w_debug_printf(ALL, "kds_s2000w_client_delete_image");
 
        curl_easy_reset(curl);
 
@@ -585,7 +585,7 @@ int kds_s2000w_client_delete_image(int64_t sessionid, int img_number, response*
 
 int kds_s2000w_client_get_option(int64_t sessionid, response* resp)
 {
-       debug_printf(ALL, "kds_s2000w_client_get_option");
+       kds_s2000w_debug_printf(ALL, "kds_s2000w_client_get_option");
 
        curl_easy_reset(curl);
 
@@ -644,7 +644,7 @@ int kds_s2000w_client_get_option(int64_t sessionid, response* resp)
 
 int kds_s2000w_client_set_option(int64_t sessionid, response* resp)
 {
-       debug_printf(ALL, "kds_s2000w_client_set_option");
+       kds_s2000w_debug_printf(ALL, "kds_s2000w_client_set_option");
 
        curl_easy_reset(curl);
 
index 32e47f912720cf41333d560045de4278c8d61250..9c3a0596e43acdea8ba634294b94549812702aa7 100644 (file)
@@ -37,7 +37,7 @@ int _get_log_level() {
        return atoi(log_level);
 }
 
-void debug_printf(int level, const char* message)
+void kds_s2000w_debug_printf(int level, const char* message)
 {
        if (level > _get_log_level())
                return;
@@ -50,7 +50,7 @@ void debug_printf(int level, const char* message)
        fprintf(stdout, "%s: %s\n", debug_string(level) , message);
 }
 
-void debug_printf_int(int level, const char* message, int value)
+void kds_s2000w_debug_printf_int(int level, const char* message, int value)
 {
        if (level > _get_log_level())
                return;
@@ -63,7 +63,7 @@ void debug_printf_int(int level, const char* message, int value)
        fprintf(stdout, "%s: %s: %i\n", debug_string(level), message, value);
 }
 
-void debug_printf_long(int level, const char* message, long value)
+void kds_s2000w_debug_printf_long(int level, const char* message, long value)
 {
        if (level > _get_log_level())
                return;
@@ -76,7 +76,7 @@ void debug_printf_long(int level, const char* message, long value)
        fprintf(stdout, "%s: %s: %li\n", debug_string(level), message, value);
 }
 
-void debug_messure_memory_usage(int level)
+void kds_s2000w_debug_messure_memory_usage(int level)
 {
        if (level > _get_log_level())
                return;
index 3b1e9e98edf844302afe529a96abd54261b82b9d..33ad45fed2e64d3cad23fde43fb118401907e4a3 100644 (file)
@@ -9,8 +9,8 @@
 #define DEBUG 5
 #define ALL 6
 
-void debug_printf(int level, const char* message);
-void debug_printf_int(int level, const char* message, int value);
-void debug_printf_long(int level, const char* message, long value);
-void debug_messure_memory_usage(int level);
+void kds_s2000w_debug_printf(int level, const char* message);
+void kds_s2000w_debug_printf_int(int level, const char* message, int value);
+void kds_s2000w_debug_printf_long(int level, const char* message, long value);
+void kds_s2000w_debug_messure_memory_usage(int level);
 #endif
\ No newline at end of file
index 7bb5b0bd49315ec362983ef9d1c95b6fa6e9d887..559b4b0ff17b4d915653dee97fbc58828bfb5357 100644 (file)
@@ -11,7 +11,7 @@
 
 int _sane_kds_s2000w_net_find_first_data_byte(imagedata* image)
 {
-       debug_printf(ALL, "sane_kds_s2000w_net_find_first_data_byte");
+       kds_s2000w_debug_printf(ALL, "sane_kds_s2000w_net_find_first_data_byte");
 
        char* data = image->data;
        int header_spaces = 3;
@@ -35,7 +35,7 @@ int _sane_kds_s2000w_net_find_first_data_byte(imagedata* image)
 
 handler* init_handler()
 {
-       debug_printf(ALL, "init handler");
+       kds_s2000w_debug_printf(ALL, "init handler");
 
        handler* h = malloc(sizeof(handler));
        h->current_scanner_config = NULL;
@@ -61,7 +61,7 @@ handler* init_handler()
 
 void free_handler(handler* h)
 {
-       debug_printf(ALL, "free handler");
+       kds_s2000w_debug_printf(ALL, "free handler");
 
        if (h == NULL)
                return;
@@ -82,7 +82,7 @@ void free_handler(handler* h)
 
 void reset_handler(handler* h)
 {
-       debug_printf(ALL, "reset handler");
+       kds_s2000w_debug_printf(ALL, "reset handler");
 
        if (h == NULL)
                return;
@@ -101,7 +101,7 @@ void reset_handler(handler* h)
 
 void kds_s2000w_handler_get_current_metadata(handler* h, metadata* params)
 {
-       debug_printf(ALL, "get_current_metadata");
+       kds_s2000w_debug_printf(ALL, "get_current_metadata");
 
        h->read_info->read_size = 0;
 
@@ -156,7 +156,7 @@ void kds_s2000w_handler_get_current_metadata(handler* h, metadata* params)
                kds_s2000w_convert_tiff_to_pnm(scanner_image, image);
        }
 
-       debug_printf_int(DEBUG, "size of pnm image", image->size);
+       kds_s2000w_debug_printf_int(DEBUG, "size of pnm image", image->size);
 
        if (params->depth == 1)
                params->bytes_per_line = channels * floor((params->pixels_per_line + 7) / 8);
@@ -176,7 +176,7 @@ void kds_s2000w_handler_get_current_metadata(handler* h, metadata* params)
 
 void kds_s2000w_handler_delete_current_image(handler* h)
 {
-       debug_printf(ALL, "delete_current_image");
+       kds_s2000w_debug_printf(ALL, "delete_current_image");
 
        response* resp = kds_s2000w_client_response_init();
        kds_s2000w_client_delete_image(h->sessionid, h->current_scan_status->current_image_number, resp);
@@ -188,7 +188,7 @@ void kds_s2000w_handler_delete_current_image(handler* h)
 
 void kds_s2000w_handler_download_current_image(handler* h)
 {
-       debug_printf(ALL, "download_current_image");
+       kds_s2000w_debug_printf(ALL, "download_current_image");
 
        free(h->image->data);
        h->image->data = NULL;
@@ -207,14 +207,14 @@ void kds_s2000w_handler_download_current_image(handler* h)
 
 void kds_s2000w_net_handler_get_current_scan_status(handler* h)
 {
-       debug_printf(ALL, "get_current_scan_status");
+       kds_s2000w_debug_printf(ALL, "get_current_scan_status");
 
        if (h->current_scan_status->available_images > 1)
                return;
 
        response* resp = kds_s2000w_client_response_init();
        kds_s2000w_client_status_session(h->sessionid, resp);
-       debug_printf(DEBUG, resp->data);
+       kds_s2000w_debug_printf(DEBUG, resp->data);
 
        json_object* status_resp_obj = json_tokener_parse(resp->data);
        json_object* status_obj = json_object_object_get(status_resp_obj, "Status");
@@ -254,7 +254,7 @@ void kds_s2000w_handler_recreate_session(handler* h)
        value_object = NULL;
        json_object_put(sessionJson);
        sessionJson = NULL;
-       debug_printf_long(INFO, "SessionId", h->sessionid);
+       kds_s2000w_debug_printf_long(INFO, "SessionId", h->sessionid);
 
        // set old config parameters
        kds_s2000w_client_response_free(resp);
@@ -273,7 +273,7 @@ void kds_s2000w_handler_recreate_session(handler* h)
 
 void kds_s2000w_handler_open(const char* devicename, void** handle)
 {
-       debug_printf(ALL, "kds_s2000w_handler_open");
+       kds_s2000w_debug_printf(ALL, "kds_s2000w_handler_open");
 
        if (strcmp(devicename, "kds_s2000w_net") != 0)
                return;
@@ -321,7 +321,7 @@ void kds_s2000w_handler_open(const char* devicename, void** handle)
        json_object* value_object = NULL;
        json_object_object_get_ex(h->current_scanner_config, "SessionId", &value_object);
        h->sessionid = json_object_get_int64(value_object);
-       debug_printf_long(INFO, "SessionId", h->sessionid);
+       kds_s2000w_debug_printf_long(INFO, "SessionId", h->sessionid);
        value_object = NULL;
 
        json_object_put(h->current_scanner_config);
@@ -332,7 +332,7 @@ void kds_s2000w_handler_open(const char* devicename, void** handle)
 
 void kds_s2000w_handler_close(handler* h)
 {
-       debug_printf(ALL, "kds_s2000w_handler_close");
+       kds_s2000w_debug_printf(ALL, "kds_s2000w_handler_close");
 
        json_object_put(h->current_scanner_config);
        h->current_scanner_config = NULL;
@@ -349,7 +349,7 @@ void kds_s2000w_handler_close(handler* h)
 
 void kds_s2000w_handler_start_scan(handler* h)
 {
-       debug_printf(ALL, "kds_s2000w_handler_start_scan");
+       kds_s2000w_debug_printf(ALL, "kds_s2000w_handler_start_scan");
 
        response* resp = kds_s2000w_client_response_init();
        kds_s2000w_client_start_scan(h->sessionid, resp);
@@ -360,7 +360,7 @@ void kds_s2000w_handler_start_scan(handler* h)
 
 void kds_s2000w_handler_stop_scan(handler* h)
 {
-       debug_printf(ALL, "kds_s2000w_handler_stop_scan");
+       kds_s2000w_debug_printf(ALL, "kds_s2000w_handler_stop_scan");
 
        response* resp = kds_s2000w_client_response_init();
        kds_s2000w_client_stop_scan(h->sessionid, resp);
index 86d602758c250a077fd54035c59ba7effa5896ca..d26a105b2afb5e3f726b638453bac682ff05e77e 100644 (file)
@@ -41,7 +41,7 @@ void _load_options(handler* h)
        int result = kds_s2000w_client_get_option(h->sessionid, resp);
 
        if (result != 0 || resp->code != 200) {
-               debug_printf_int(ERROR, "load options response code", resp->code);
+               kds_s2000w_debug_printf_int(ERROR, "load options response code", resp->code);
                kds_s2000w_client_response_free(resp);
                resp = NULL;
                return;
@@ -89,7 +89,7 @@ void _set_options(handler* h)
        resp->data = memcpy(resp->data, json_string, resp->size);
        kds_s2000w_client_set_option(h->sessionid, resp);
        if (resp->code != 200)
-               debug_printf_int(ERROR, "set options response code", resp->code);
+               kds_s2000w_debug_printf_int(ERROR, "set options response code", resp->code);
 
        kds_s2000w_client_response_free(resp);
        resp = NULL;
@@ -114,7 +114,7 @@ void kds_s2000w_handler_get_option(handler* h, int option, void* value, int* inf
                        config = json_object_object_get(h->current_scanner_config, "Configuration");
                        int* int_value_ptr = (int*) value;
                        *int_value_ptr = json_object_object_length(config);
-                       debug_printf_int(DEBUG, "option numbers", *int_value_ptr);
+                       kds_s2000w_debug_printf_int(DEBUG, "option numbers", *int_value_ptr);
                        break;
                case 2:
                        value_object = json_object_object_get(config, "ScanSource");
index 6878fd5301d71b313052df3fb7579772276c6a36..f943768acfd112397dce558918988a43f03bc623 100644 (file)
@@ -19,18 +19,18 @@ void kds_s2000w_convert_to_pnm_with_depth(blobdata* in,
        int depth,
        const char* format)
 {
-       debug_printf(ALL, "kds_s2000w_convert_to_pnm_With_depth");
+       kds_s2000w_debug_printf(ALL, "kds_s2000w_convert_to_pnm_With_depth");
 
        ExceptionInfo* exception = AcquireExceptionInfo();
        ImageInfo* image_info = CloneImageInfo(NULL);
 
        sprintf(image_info->filename, "streamin.%s", format);
-       debug_printf(DEBUG, image_info->filename);
+       kds_s2000w_debug_printf(DEBUG, image_info->filename);
 
        Image* input_image = BlobToImage(image_info, in->data, in->size , exception);
 
        if (exception->severity != UndefinedException) {
-               debug_printf(ERROR, GetExceptionMessage(exception->error_number));
+               kds_s2000w_debug_printf(ERROR, GetExceptionMessage(exception->error_number));
                CatchException(exception);
        }
 
@@ -68,21 +68,21 @@ void kds_s2000w_convert_to_pnm_with_depth(blobdata* in,
 
 void kds_s2000w_convert_jpg_to_pnm_with_depth(blobdata* in, blobdata* out, int depth)
 {
-       debug_printf(ALL, "kds_s2000w_convert_jpg_to_pnm_With_depth");
+       kds_s2000w_debug_printf(ALL, "kds_s2000w_convert_jpg_to_pnm_With_depth");
 
        kds_s2000w_convert_to_pnm_with_depth(in, out, depth, "jpg");
 }
 
 void kds_s2000w_convert_tiff_to_pnm(blobdata* in, blobdata* out)
 {
-       debug_printf(ALL, "kds_s2000w_convert_tiff_to_pnm");
+       kds_s2000w_debug_printf(ALL, "kds_s2000w_convert_tiff_to_pnm");
 
        kds_s2000w_convert_to_pnm_with_depth(in, out, -1, "tiff");
 }
 
 void kds_s2000w_metadata_from_image(blobdata* image, image_metadata* mdata)
 {
-       debug_printf(ALL, "kds_s2000w_metadata_from_image");
+       kds_s2000w_debug_printf(ALL, "kds_s2000w_metadata_from_image");
 
        ExceptionInfo* exception = AcquireExceptionInfo();
        ImageInfo* image_info = CloneImageInfo(NULL);
@@ -91,7 +91,7 @@ void kds_s2000w_metadata_from_image(blobdata* image, image_metadata* mdata)
        Image* input_image = BlobToImage(image_info, image->data, image->size , exception);
 
        if (exception->severity != UndefinedException) {
-               debug_printf(ERROR, GetExceptionMessage(exception->error_number));
+               kds_s2000w_debug_printf(ERROR, GetExceptionMessage(exception->error_number));
                CatchException(exception);
        }
 
index 47d87c1aa45b36daa62f912979cb5858f272fbcc..a02f945f0324ac03eab93d7014082db95acd56f3 100644 (file)
@@ -15,7 +15,7 @@ SANE_Device device_info;
 
 SANE_Status sane_kds_s2000w_net_init(SANE_Int* version_code, SANE_Auth_Callback authorize)
 {
-       debug_printf(ALL, "sane_kds_s2000w_net_init");
+       kds_s2000w_debug_printf(ALL, "sane_kds_s2000w_net_init");
 
        *version_code = SANE_VERSION_CODE(MAJOR, MINOR, PATCH);
 
@@ -24,13 +24,13 @@ SANE_Status sane_kds_s2000w_net_init(SANE_Int* version_code, SANE_Auth_Callback
 
 void sane_kds_s2000w_net_exit(void)
 {
-       debug_printf(ALL, "sane_kds_s2000w_net_exit");
+       kds_s2000w_debug_printf(ALL, "sane_kds_s2000w_net_exit");
 }
 
 SANE_Status sane_kds_s2000w_net_get_devices(SANE_Device*** device_list,
        SANE_Bool local_only)
 {
-       debug_printf(ALL, "sane_kds_s2000w_net_get_devices");
+       kds_s2000w_debug_printf(ALL, "sane_kds_s2000w_net_get_devices");
 
        if (local_only)
                return SANE_STATUS_NO_MEM;
@@ -48,7 +48,7 @@ SANE_Status sane_kds_s2000w_net_get_devices(SANE_Device*** device_list,
 SANE_Status sane_kds_s2000w_net_open(SANE_String_Const devicename,
        SANE_Handle* handle)
 {
-       debug_printf(ALL, "sane_kds_s2000w_net_open");
+       kds_s2000w_debug_printf(ALL, "sane_kds_s2000w_net_open");
 
        if (strcmp(devicename, "kds_s2000w_net") != 0)
                return SANE_STATUS_INVAL;
@@ -76,7 +76,7 @@ SANE_Status sane_kds_s2000w_net_open(SANE_String_Const devicename,
 
 void sane_kds_s2000w_net_close(SANE_Handle handle)
 {
-       debug_printf(ALL, "sane_kds_s2000w_net_close");
+       kds_s2000w_debug_printf(ALL, "sane_kds_s2000w_net_close");
 
        handler* h = (handler*) handle;
        if (h == NULL || h->state != OPENED)
@@ -89,7 +89,7 @@ void sane_kds_s2000w_net_close(SANE_Handle handle)
 const SANE_Option_Descriptor* sane_kds_s2000w_net_get_option_descriptor(
        SANE_Handle handle, SANE_Int option)
 {
-       debug_printf(ALL, "sane_kds_s2000w_net_get_option_descriptor");
+       kds_s2000w_debug_printf(ALL, "sane_kds_s2000w_net_get_option_descriptor");
 
        return kds_s2000w_option_get_descriptor(option);
 }
@@ -97,7 +97,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)
 {
-       debug_printf(ALL, "sane_kds_s2000w_net_control_option");
+       kds_s2000w_debug_printf(ALL, "sane_kds_s2000w_net_control_option");
 
        handler* h = (handler*) handle;
        if (action == SANE_ACTION_GET_VALUE)
@@ -111,12 +111,12 @@ SANE_Status sane_kds_s2000w_net_control_option(SANE_Handle handle,
 
 void sane_kds_s2000w_net_cancel(SANE_Handle handle)
 {
-       debug_printf(ALL, "sane_kds_s2000w_net_cancel");
+       kds_s2000w_debug_printf(ALL, "sane_kds_s2000w_net_cancel");
 
        handler* h = (handler*) handle;
 
        if (h->read_info->cancel > 0) {
-               debug_printf(DEBUG, "scan completed canceled");
+               kds_s2000w_debug_printf(DEBUG, "scan completed canceled");
                reset_handler(h);
                kds_s2000w_handler_recreate_session(h);
                return;
@@ -125,19 +125,19 @@ void sane_kds_s2000w_net_cancel(SANE_Handle handle)
        kds_s2000w_net_handler_get_current_scan_status(h);
 
        if (h->current_scan_status->complete_scanned > 0) {
-               debug_printf(DEBUG, "scan completed");
+               kds_s2000w_debug_printf(DEBUG, "scan completed");
                reset_handler(h);
                return;
        }
 
        if (h->current_scan_status->available_images <= 0) {
-               debug_printf(DEBUG, "scan completed no availible images");
+               kds_s2000w_debug_printf(DEBUG, "scan completed no availible images");
                reset_handler(h);
                kds_s2000w_handler_recreate_session(h);
                return;
        }
 
-       debug_printf(DEBUG, "scan canceled");
+       kds_s2000w_debug_printf(DEBUG, "scan canceled");
        h->read_info->cancel = 1;
        kds_s2000w_handler_stop_scan(h);
 }
@@ -145,19 +145,19 @@ void sane_kds_s2000w_net_cancel(SANE_Handle handle)
 SANE_Status sane_kds_s2000w_net_get_parameters(SANE_Handle handle,
        SANE_Parameters* params)
 {
-       debug_printf(ALL, "sane_kds_s2000w_net_get_parameters");
+       kds_s2000w_debug_printf(ALL, "sane_kds_s2000w_net_get_parameters");
 
        handler* h = (handler*) handle;
 
        kds_s2000w_handler_get_current_metadata(h, (metadata*) params);
 
-       debug_messure_memory_usage(DEBUG);
+       kds_s2000w_debug_messure_memory_usage(DEBUG);
        return SANE_STATUS_GOOD;
 }
 
 SANE_Status sane_kds_s2000w_net_start(SANE_Handle handle)
 {
-       debug_printf(ALL, "sane_kds_s2000w_net_start");
+       kds_s2000w_debug_printf(ALL, "sane_kds_s2000w_net_start");
 
        handler* h = (handler*) handle;
 
@@ -190,14 +190,14 @@ SANE_Status sane_kds_s2000w_net_start(SANE_Handle handle)
                return SANE_STATUS_GOOD;
        }
 
-       debug_messure_memory_usage(DEBUG);
+       kds_s2000w_debug_messure_memory_usage(DEBUG);
        return SANE_STATUS_GOOD;
 }
 
 SANE_Status sane_kds_s2000w_net_read(SANE_Handle handle, SANE_Byte* data,
        SANE_Int max_length, SANE_Int* length)
 {
-       debug_printf(ALL, "sane_kds_s2000w_net_read");
+       kds_s2000w_debug_printf(ALL, "sane_kds_s2000w_net_read");
 
        handler* h = (handler*) handle;
 
@@ -222,14 +222,14 @@ SANE_Status sane_kds_s2000w_net_read(SANE_Handle handle, SANE_Byte* data,
 SANE_Status sane_kds_s2000w_net_set_io_mode(SANE_Handle handle,
        SANE_Bool non_blocking)
 {
-       debug_printf(ALL, "sane_kds_s2000w_net_set_io_mode");
+       kds_s2000w_debug_printf(ALL, "sane_kds_s2000w_net_set_io_mode");
 
        return SANE_STATUS_UNSUPPORTED;
 }
 
 SANE_Status sane_kds_s2000w_net_get_select_fd(SANE_Handle handle, SANE_Int* fd)
 {
-       debug_printf(ALL, "sane_kds_s2000w_net_get_select_fd");
+       kds_s2000w_debug_printf(ALL, "sane_kds_s2000w_net_get_select_fd");
 
        return SANE_STATUS_UNSUPPORTED;
 }
\ No newline at end of file
index 4870f29174360fc7701346b6015aa3282692c210..aa214a533ace950b56467997f9834ec90b9a9534 100644 (file)
@@ -27,7 +27,7 @@ SANE_String_Const* constraint_scan_source = NULL;
 
 SANE_Option_Descriptor _kds_s2000w_option_descriptor_standard_group()
 {
-       debug_printf(ALL, "kds_s2000w_option_descriptor_standard_group");
+       kds_s2000w_debug_printf(ALL, "kds_s2000w_option_descriptor_standard_group");
 
        SANE_Option_Descriptor descriptor = {
                SANE_NAME_STANDARD,
@@ -45,7 +45,7 @@ SANE_Option_Descriptor _kds_s2000w_option_descriptor_standard_group()
 
 SANE_Option_Descriptor _kds_s2000w_option_descriptor_geometry_group()
 {
-       debug_printf(ALL, "kds_s2000w_option_descriptor_scan_area_group");
+       kds_s2000w_debug_printf(ALL, "kds_s2000w_option_descriptor_scan_area_group");
 
        SANE_Option_Descriptor descriptor = {
                SANE_NAME_GEOMETRY,
@@ -63,7 +63,7 @@ SANE_Option_Descriptor _kds_s2000w_option_descriptor_geometry_group()
 
 SANE_Option_Descriptor _kds_s2000w_option_descriptor_num_options()
 {
-       debug_printf(ALL, "kds_s2000w_option_descriptor_num_options");
+       kds_s2000w_debug_printf(ALL, "kds_s2000w_option_descriptor_num_options");
 
        SANE_Option_Descriptor descriptor = {
                SANE_NAME_NUM_OPTIONS,
@@ -81,7 +81,7 @@ SANE_Option_Descriptor _kds_s2000w_option_descriptor_num_options()
 
 SANE_Option_Descriptor _kds_s2000w_option_descriptor_dpi()
 {
-       debug_printf(ALL, "kds_s2000w_option_descriptor_dpi");
+       kds_s2000w_debug_printf(ALL, "kds_s2000w_option_descriptor_dpi");
 
        SANE_Option_Descriptor descriptor = {
                SANE_NAME_SCAN_RESOLUTION,
@@ -100,7 +100,7 @@ SANE_Option_Descriptor _kds_s2000w_option_descriptor_dpi()
 
 SANE_Option_Descriptor _kds_s2000w_option_descriptor_scanside()
 {
-       debug_printf(ALL, "kds_s2000w_option_descriptor_scanside");
+       kds_s2000w_debug_printf(ALL, "kds_s2000w_option_descriptor_scanside");
 
        constraint_scanside = malloc(sizeof(SANE_String_Const*) * 3);
        constraint_scanside[0] = "Simplex";
@@ -124,7 +124,7 @@ SANE_Option_Descriptor _kds_s2000w_option_descriptor_scanside()
 
 SANE_Option_Descriptor _kds_s2000w_option_descriptor_color_mode()
 {
-       debug_printf(ALL, "kds_s2000w_option_descriptor_color_mode");
+       kds_s2000w_debug_printf(ALL, "kds_s2000w_option_descriptor_color_mode");
 
        constraint_colormode = malloc(sizeof(SANE_String_Const*) * 4);
        constraint_colormode[0] = "Color";
@@ -149,7 +149,7 @@ SANE_Option_Descriptor _kds_s2000w_option_descriptor_color_mode()
 
 SANE_Option_Descriptor _kds_s2000w_option_descriptor_skip_blank_pages()
 {
-       debug_printf(ALL, "kds_s2000w_option_descriptor_skip_blank_pages");
+       kds_s2000w_debug_printf(ALL, "kds_s2000w_option_descriptor_skip_blank_pages");
 
        SANE_Option_Descriptor descriptor = {
                "skip-blank-pages",
@@ -167,7 +167,7 @@ SANE_Option_Descriptor _kds_s2000w_option_descriptor_skip_blank_pages()
 
 SANE_Option_Descriptor _kds_s2000w_option_descriptor_color_drop()
 {
-       debug_printf(ALL, "kds_s2000w_option_descriptor_color_drop");
+       kds_s2000w_debug_printf(ALL, "kds_s2000w_option_descriptor_color_drop");
 
        constraint_colordrop = malloc(sizeof(SANE_String_Const*) * 9);
        constraint_colordrop[0] = "None";
@@ -197,7 +197,7 @@ SANE_Option_Descriptor _kds_s2000w_option_descriptor_color_drop()
 
 SANE_Option_Descriptor _kds_s2000w_option_descriptor_color_drop_out_aggressiveness()
 {
-       debug_printf(ALL, "kds_s2000w_option_descriptor_color_drop_out_aggressiveness");
+       kds_s2000w_debug_printf(ALL, "kds_s2000w_option_descriptor_color_drop_out_aggressiveness");
 
        SANE_Option_Descriptor descriptor = {
                "colordropoutaggressiveness",
@@ -216,7 +216,7 @@ SANE_Option_Descriptor _kds_s2000w_option_descriptor_color_drop_out_aggressivene
 
 SANE_Option_Descriptor _kds_s2000w_option_descriptor_color_auto_brightness_mode()
 {
-       debug_printf(ALL, "kds_s2000w_option_descriptor_color_auto_brightness_mode");
+       kds_s2000w_debug_printf(ALL, "kds_s2000w_option_descriptor_color_auto_brightness_mode");
 
        constraint_color_auto_brightnessmode = malloc(sizeof(SANE_String_Const*) * 3);
        constraint_color_auto_brightnessmode[0] = "None";
@@ -240,7 +240,7 @@ SANE_Option_Descriptor _kds_s2000w_option_descriptor_color_auto_brightness_mode(
 
 SANE_Option_Descriptor _kds_s2000w_option_descriptor_color_balance_mode()
 {
-       debug_printf(ALL, "kds_s2000w_option_descriptor_color_balance_mode");
+       kds_s2000w_debug_printf(ALL, "kds_s2000w_option_descriptor_color_balance_mode");
 
        constraint_color_balance_mode = malloc(sizeof(SANE_String_Const*) * 5);
        constraint_color_balance_mode[0] = "None";
@@ -266,7 +266,7 @@ SANE_Option_Descriptor _kds_s2000w_option_descriptor_color_balance_mode()
 
 SANE_Option_Descriptor _kds_s2000w_option_descriptor_color_balancea_agressiveness()
 {
-       debug_printf(ALL, "kds_s2000w_option_descriptor_color_balancea_agressiveness");
+       kds_s2000w_debug_printf(ALL, "kds_s2000w_option_descriptor_color_balancea_agressiveness");
 
        SANE_Option_Descriptor descriptor = {
                "colorbalanceaggressiveness",
@@ -285,7 +285,7 @@ SANE_Option_Descriptor _kds_s2000w_option_descriptor_color_balancea_agressivenes
 
 SANE_Option_Descriptor _kds_s2000w_option_descriptor_color_balance_red()
 {
-       debug_printf(ALL, "kds_s2000w_option_descriptor_color_balance_red");
+       kds_s2000w_debug_printf(ALL, "kds_s2000w_option_descriptor_color_balance_red");
 
        SANE_Option_Descriptor descriptor = {
                "colorbalancered",
@@ -304,7 +304,7 @@ SANE_Option_Descriptor _kds_s2000w_option_descriptor_color_balance_red()
 
 SANE_Option_Descriptor _kds_s2000w_option_descriptor_color_balance_green()
 {
-       debug_printf(ALL, "kds_s2000w_option_descriptor_color_balance_green");
+       kds_s2000w_debug_printf(ALL, "kds_s2000w_option_descriptor_color_balance_green");
 
        SANE_Option_Descriptor descriptor = {
                "colorbalancegreen",
@@ -323,7 +323,7 @@ SANE_Option_Descriptor _kds_s2000w_option_descriptor_color_balance_green()
 
 SANE_Option_Descriptor _kds_s2000w_option_descriptor_color_balance_blue()
 {
-       debug_printf(ALL, "kds_s2000w_option_descriptor_color_balance_blue");
+       kds_s2000w_debug_printf(ALL, "kds_s2000w_option_descriptor_color_balance_blue");
 
        SANE_Option_Descriptor descriptor = {
                "colorbalanceblue",
@@ -342,7 +342,7 @@ SANE_Option_Descriptor _kds_s2000w_option_descriptor_color_balance_blue()
 
 SANE_Option_Descriptor _kds_s2000w_option_descriptor_foreground_boldness_mode()
 {
-       debug_printf(ALL, "kds_s2000w_option_descriptor_foreground_boldness_mode");
+       kds_s2000w_debug_printf(ALL, "kds_s2000w_option_descriptor_foreground_boldness_mode");
 
        constraint_foreground_boldness_mode = malloc(sizeof(SANE_String_Const*) * 4);
        constraint_foreground_boldness_mode[0] = "None";
@@ -367,7 +367,7 @@ SANE_Option_Descriptor _kds_s2000w_option_descriptor_foreground_boldness_mode()
 
 SANE_Option_Descriptor _kds_s2000w_option_descriptor_foreground_boldness_aggressiveness()
 {
-       debug_printf(ALL, "kds_s2000w_option_descriptor_foreground_boldness_aggressiveness");
+       kds_s2000w_debug_printf(ALL, "kds_s2000w_option_descriptor_foreground_boldness_aggressiveness");
 
        SANE_Option_Descriptor descriptor = {
                "foreground-boldness-aggressiveness",
@@ -386,7 +386,7 @@ SANE_Option_Descriptor _kds_s2000w_option_descriptor_foreground_boldness_aggress
 
 SANE_Option_Descriptor _kds_s2000w_option_descriptor_background_smoothing_mode()
 {
-       debug_printf(ALL, "kds_s2000w_option_descriptor_background_smoothing_mode");
+       kds_s2000w_debug_printf(ALL, "kds_s2000w_option_descriptor_background_smoothing_mode");
 
        constraint_background_smoothing_mode = malloc(sizeof(SANE_String_Const*) * 4);
        constraint_background_smoothing_mode[0] = "None";
@@ -411,7 +411,7 @@ SANE_Option_Descriptor _kds_s2000w_option_descriptor_background_smoothing_mode()
 
 SANE_Option_Descriptor _kds_s2000w_option_descriptor_background_smoothing_aggressiveness()
 {
-       debug_printf(ALL, "kds_s2000w_option_descriptor_background_smoothing_aggressiveness");
+       kds_s2000w_debug_printf(ALL, "kds_s2000w_option_descriptor_background_smoothing_aggressiveness");
 
        SANE_Option_Descriptor descriptor = {
                "background-smoothing-aggressiveness",
@@ -430,7 +430,7 @@ SANE_Option_Descriptor _kds_s2000w_option_descriptor_background_smoothing_aggres
 
 SANE_Option_Descriptor _kds_s2000w_option_descriptor_binarization_contrast()
 {
-       debug_printf(ALL, "kds_s2000w_option_descriptor_binarization_contrast");
+       kds_s2000w_debug_printf(ALL, "kds_s2000w_option_descriptor_binarization_contrast");
 
        SANE_Option_Descriptor descriptor = {
                SANE_NAME_CONTRAST,
@@ -449,7 +449,7 @@ SANE_Option_Descriptor _kds_s2000w_option_descriptor_binarization_contrast()
 
 SANE_Option_Descriptor _kds_s2000w_option_descriptor_scan_source()
 {
-       debug_printf(ALL, "kds_s2000w_option_descriptor_scan_source");
+       kds_s2000w_debug_printf(ALL, "kds_s2000w_option_descriptor_scan_source");
 
        constraint_scan_source = malloc(sizeof(SANE_String_Const*) * 4);
        constraint_scan_source[0] = "DocumentFeeder";
@@ -474,7 +474,7 @@ SANE_Option_Descriptor _kds_s2000w_option_descriptor_scan_source()
 
 SANE_Option_Descriptor _kds_s2000w_option_descriptor_config_reset()
 {
-       debug_printf(ALL, "kds_s2000w_option_descriptor_config_reset");
+       kds_s2000w_debug_printf(ALL, "kds_s2000w_option_descriptor_config_reset");
 
        SANE_Option_Descriptor descriptor = {
                "config-reset",
@@ -492,7 +492,7 @@ SANE_Option_Descriptor _kds_s2000w_option_descriptor_config_reset()
 
 void kds_s2000w_option_descriptor_init_option_descriptors()
 {
-       debug_printf(ALL, "kds_s2000w_option_descriptor_init_option_descriptors");
+       kds_s2000w_debug_printf(ALL, "kds_s2000w_option_descriptor_init_option_descriptors");
 
        descriptor_array = malloc(sizeof(SANE_Option_Descriptor) * MAX_OPTION_COUNT);
        descriptor_array[0] = _kds_s2000w_option_descriptor_num_options();
@@ -521,7 +521,7 @@ void kds_s2000w_option_descriptor_init_option_descriptors()
 
 void kds_s2000w_option_descriptor_free_option_descriptors()
 {
-       debug_printf(ALL, "kds_s2000w_option_descriptor_free_option_descriptors");
+       kds_s2000w_debug_printf(ALL, "kds_s2000w_option_descriptor_free_option_descriptors");
 
        free(constraint_scanside);
        constraint_scanside = NULL;
@@ -549,7 +549,7 @@ void kds_s2000w_option_descriptor_free_option_descriptors()
 
 SANE_Option_Descriptor* kds_s2000w_option_get_descriptor(int option)
 {
-       debug_printf(ALL, "kds_s2000w_option_get_descriptor");
+       kds_s2000w_debug_printf(ALL, "kds_s2000w_option_get_descriptor");
 
        if (option >= MAX_OPTION_COUNT)
                return NULL;