From: Bastian Dehn Date: Tue, 5 May 2026 12:01:48 +0000 (+0200) Subject: change method debug with __func__ X-Git-Tag: v1.1.30^2~12 X-Git-Url: https://gitweb.hhaalo.de/?a=commitdiff_plain;h=e966ef6e87b24f7f6c1f998584b82c556788fc7f;p=sane-kds-s2000w-net.git change method debug with __func__ --- diff --git a/src/kds_s2000w_client.c b/src/kds_s2000w_client.c index 8477524..c004d8e 100644 --- a/src/kds_s2000w_client.c +++ b/src/kds_s2000w_client.c @@ -241,7 +241,7 @@ char* _kds_s2000w_client_append_image_number_to_str(uint8_t image_number, const void kds_s2000w_client_init(const client_config_t* config) { - kds_s2000w_debug_printf(ALL, "kds_s2000w_client_init"); + kds_s2000w_debug_printf(ALL, __func__); kds_s2000w_client_config = malloc(sizeof(client_config_t)); kds_s2000w_client_config->scanner_url = _kds_s2000w_client_strdup(config->scanner_url); @@ -253,7 +253,7 @@ void kds_s2000w_client_init(const client_config_t* config) void kds_s2000w_client_free() { - kds_s2000w_debug_printf(ALL, "kds_s2000w_client_free"); + kds_s2000w_debug_printf(ALL, __func__); free(kds_s2000w_client_config->scanner_url); kds_s2000w_client_config->scanner_url = NULL; @@ -266,7 +266,7 @@ void kds_s2000w_client_free() response_t* kds_s2000w_client_response_init() { - kds_s2000w_debug_printf(ALL, "kds_s2000w_client_response_init"); + kds_s2000w_debug_printf(ALL, __func__); response_t* resp = malloc(sizeof(response_t)); if (resp == NULL) @@ -281,7 +281,7 @@ response_t* kds_s2000w_client_response_init() void kds_s2000w_client_response_free(response_t* resp) { - kds_s2000w_debug_printf(ALL, "kds_s2000w_client_response_free"); + kds_s2000w_debug_printf(ALL, __func__); if (resp == NULL) return; @@ -293,7 +293,7 @@ void kds_s2000w_client_response_free(response_t* resp) uint8_t kds_s2000w_client_open_session(response_t* resp) { - kds_s2000w_debug_printf(ALL, "kds_s2000w_client_open_session"); + kds_s2000w_debug_printf(ALL, __func__); curl_param_t* param = _kds_s2000w_client_param_init(0); if (param == NULL) @@ -330,7 +330,7 @@ uint8_t kds_s2000w_client_open_session(response_t* resp) void kds_s2000w_client_close_session(int64_t sessionid) { - kds_s2000w_debug_printf(ALL, "kds_s2000w_client_close_session"); + kds_s2000w_debug_printf(ALL, __func__); curl_param_t* param = _kds_s2000w_client_param_init(sessionid); if (param == NULL) @@ -352,7 +352,7 @@ void kds_s2000w_client_close_session(int64_t sessionid) uint8_t kds_s2000w_client_get_capabilities(response_t* resp) { - kds_s2000w_debug_printf(ALL, "kds_s2000w_client_get_capabilities"); + kds_s2000w_debug_printf(ALL, __func__); curl_param_t* param = _kds_s2000w_client_param_init(0); if (param == NULL) @@ -380,7 +380,7 @@ uint8_t kds_s2000w_client_get_capabilities(response_t* resp) uint8_t kds_s2000w_client_status_session(int64_t sessionid, response_t* resp) { - kds_s2000w_debug_printf(ALL, "kds_s2000w_client_status_session"); + kds_s2000w_debug_printf(ALL, __func__); kds_s2000w_heartbeat_join_thread(); kds_s2000w_heartbeat_wait_seconds(&kds_s2000w_client_config->heartbeat); @@ -410,7 +410,7 @@ uint8_t kds_s2000w_client_status_session(int64_t sessionid, response_t* resp) uint8_t kds_s2000w_client_start_scan(int64_t sessionid) { - kds_s2000w_debug_printf(ALL, "kds_s2000w_client_start_scan"); + kds_s2000w_debug_printf(ALL, __func__); curl_param_t* param = _kds_s2000w_client_param_init(sessionid); if (param == NULL) @@ -436,7 +436,7 @@ uint8_t kds_s2000w_client_start_scan(int64_t sessionid) uint8_t kds_s2000w_client_stop_scan(int64_t sessionid) { - kds_s2000w_debug_printf(ALL, "kds_s2000w_client_stop_scan"); + kds_s2000w_debug_printf(ALL, __func__); curl_param_t* param = _kds_s2000w_client_param_init(sessionid); if (param == NULL) @@ -462,7 +462,7 @@ uint8_t kds_s2000w_client_stop_scan(int64_t sessionid) uint8_t kds_s2000w_client_get_image(int64_t sessionid, uint8_t img_number, response_t* resp) { - kds_s2000w_debug_printf(ALL, "kds_s2000w_client_get_image"); + kds_s2000w_debug_printf(ALL, __func__); curl_param_t* param = _kds_s2000w_client_param_init(sessionid); if (param == NULL) @@ -491,7 +491,7 @@ uint8_t kds_s2000w_client_get_image(int64_t sessionid, uint8_t img_number, respo uint8_t kds_s2000w_client_delete_image(int64_t sessionid, uint8_t img_number) { - kds_s2000w_debug_printf(ALL, "kds_s2000w_client_delete_image"); + kds_s2000w_debug_printf(ALL, __func__); curl_param_t* param = _kds_s2000w_client_param_init(sessionid); if (param == NULL) @@ -519,7 +519,7 @@ uint8_t kds_s2000w_client_delete_image(int64_t sessionid, uint8_t img_number) uint8_t kds_s2000w_client_get_option(int64_t sessionid, response_t* resp) { - kds_s2000w_debug_printf(ALL, "kds_s2000w_client_get_option"); + kds_s2000w_debug_printf(ALL, __func__); curl_param_t* param = _kds_s2000w_client_param_init(sessionid); if (param == NULL) @@ -546,7 +546,7 @@ uint8_t kds_s2000w_client_get_option(int64_t sessionid, response_t* resp) uint8_t kds_s2000w_client_set_option(int64_t sessionid, response_t* resp) { - kds_s2000w_debug_printf(ALL, "kds_s2000w_client_set_option"); + kds_s2000w_debug_printf(ALL, __func__); curl_param_t* param = _kds_s2000w_client_param_init(sessionid); if (param == NULL) diff --git a/src/kds_s2000w_handler.c b/src/kds_s2000w_handler.c index 98e0d9d..a363986 100644 --- a/src/kds_s2000w_handler.c +++ b/src/kds_s2000w_handler.c @@ -13,7 +13,7 @@ uint32_t _kds_s2000w_handler_find_first_data_byte(const imagedata_t* image) { - kds_s2000w_debug_printf(ALL, "sane_kds_s2000w_net_find_first_data_byte"); + kds_s2000w_debug_printf(ALL, __func__); const char* data = (const char*) image->data; uint8_t header_spaces = 3; @@ -51,7 +51,7 @@ client_config_t* _kds_s2000w_handler_convert_config(program_config_t* config) void _kds_s2000w_handler_load_config(handler_t* h) { - kds_s2000w_debug_printf(ALL, "kds_s2000w_handler_load_config"); + kds_s2000w_debug_printf(ALL, __func__); char* config_stream = kds_s2000w_config_read(CONFIG_FILE); if (config_stream == NULL) @@ -181,7 +181,7 @@ connection_state_t _kds_s2000w_handler_connect(handler_t* h) handler_t* kds_s2000w_handler_init() { - kds_s2000w_debug_printf(ALL, "init handler"); + kds_s2000w_debug_printf(ALL, __func__); handler_t* h = malloc(sizeof(handler_t)); if (h == NULL) @@ -229,7 +229,7 @@ handler_t* kds_s2000w_handler_init() void kds_s2000w_handler_free(handler_t* h) { - kds_s2000w_debug_printf(ALL, "free handler"); + kds_s2000w_debug_printf(ALL, __func__); if (h == NULL) return; @@ -251,7 +251,7 @@ void kds_s2000w_handler_free(handler_t* h) void kds_s2000w_handler_reset(handler_t* h) { - kds_s2000w_debug_printf(ALL, "reset handler"); + kds_s2000w_debug_printf(ALL, __func__); if (h == NULL) return; @@ -269,7 +269,7 @@ void kds_s2000w_handler_reset(handler_t* h) connection_state_t kds_s2000w_handler_open(void** handle) { - kds_s2000w_debug_printf(ALL, "kds_s2000w_handler_open"); + kds_s2000w_debug_printf(ALL, __func__); handler_t* h = kds_s2000w_handler_init(); if (h == NULL) { @@ -285,7 +285,7 @@ connection_state_t kds_s2000w_handler_open(void** handle) void kds_s2000w_handler_close(handler_t* h) { - kds_s2000w_debug_printf(ALL, "kds_s2000w_handler_close"); + kds_s2000w_debug_printf(ALL, __func__); if (h == NULL) return; @@ -336,21 +336,21 @@ void kds_s2000w_handler_recreate_session(handler_t* h) void kds_s2000w_handler_start_scan(const handler_t* h) { - kds_s2000w_debug_printf(ALL, "kds_s2000w_handler_start_scan"); + kds_s2000w_debug_printf(ALL, __func__); kds_s2000w_client_start_scan(h->sessionid); } void kds_s2000w_handler_stop_scan(const handler_t* h) { - kds_s2000w_debug_printf(ALL, "kds_s2000w_handler_stop_scan"); + kds_s2000w_debug_printf(ALL, __func__); kds_s2000w_client_stop_scan(h->sessionid); } void kds_s2000w_handler_get_current_metadata(handler_t* h, metadata_t* params) { - kds_s2000w_debug_printf(ALL, "get_current_metadata"); + kds_s2000w_debug_printf(ALL, __func__); h->scan_status->read_bytes = 0; @@ -392,7 +392,7 @@ void kds_s2000w_handler_get_current_metadata(handler_t* h, metadata_t* params) void kds_s2000w_handler_get_current_scan_status(handler_t* h) { - kds_s2000w_debug_printf(ALL, "get_current_scan_status"); + kds_s2000w_debug_printf(ALL, __func__); if (h->scan_status->available_images > 1) return; @@ -420,7 +420,7 @@ void kds_s2000w_handler_get_current_scan_status(handler_t* h) void kds_s2000w_handler_download_current_image(handler_t* h) { - kds_s2000w_debug_printf(ALL, "download_current_image"); + kds_s2000w_debug_printf(ALL, __func__); free(h->image->data); h->image->data = NULL; @@ -439,7 +439,7 @@ void kds_s2000w_handler_download_current_image(handler_t* h) void kds_s2000w_handler_delete_current_image(handler_t* h) { - kds_s2000w_debug_printf(ALL, "delete_current_image"); + kds_s2000w_debug_printf(ALL, __func__); kds_s2000w_client_delete_image(h->sessionid, h->scan_status->image_number); h->scan_status->available_images--; diff --git a/src/kds_s2000w_image_converter_magick.c b/src/kds_s2000w_image_converter_magick.c index 23c4159..1b16bbc 100644 --- a/src/kds_s2000w_image_converter_magick.c +++ b/src/kds_s2000w_image_converter_magick.c @@ -15,7 +15,7 @@ void _kds_s2000w_image_converter_to_pnm(blobdata_t* in, blobdata_t* out, const char* format) { - kds_s2000w_debug_printf(ALL, "kds_s2000w_convert_to_pnm_With_depth"); + kds_s2000w_debug_printf(ALL, __func__); ExceptionInfo* exception = AcquireExceptionInfo(); ImageInfo* image_info = CloneImageInfo(NULL); @@ -56,7 +56,7 @@ void _kds_s2000w_image_converter_to_pnm(blobdata_t* in, image_metadata_t* kds_s2000w_image_converter_get_metadata(blobdata_t* image) { - kds_s2000w_debug_printf(ALL, "kds_s2000w_metadata_from_image"); + kds_s2000w_debug_printf(ALL, __func__); image_metadata_t* mdata = malloc(sizeof(image_metadata_t)); if (mdata == NULL) @@ -89,7 +89,7 @@ image_metadata_t* kds_s2000w_image_converter_get_metadata(blobdata_t* image) void kds_s2000w_image_converter_to_pnm(blobdata_t* in, blobdata_t* out) { - kds_s2000w_debug_printf(ALL, "kds_s2000w_image_converter_pnm"); + kds_s2000w_debug_printf(ALL, __func__); if (kds_s2000w_image_type_check_is_jpeg(in)) { _kds_s2000w_image_converter_to_pnm(in, out, "jpg"); diff --git a/src/kds_s2000w_image_converter_netpbm.c b/src/kds_s2000w_image_converter_netpbm.c index 72039b4..69fef90 100644 --- a/src/kds_s2000w_image_converter_netpbm.c +++ b/src/kds_s2000w_image_converter_netpbm.c @@ -84,7 +84,7 @@ toff_t _kds_s2000w_image_converter_tiff_size(thandle_t handler) uint32_t _kds_s2000w_image_converter_find_char(const blobdata_t* image, uint32_t start, const char cfind) { - kds_s2000w_debug_printf(ALL, "kds_s2000w_image_converter_find_char"); + kds_s2000w_debug_printf(ALL, __func__); const char* image_data = (const char*) image->data; @@ -98,7 +98,7 @@ uint32_t _kds_s2000w_image_converter_find_char(const blobdata_t* image, uint32_t uint32_t _kds_s2000w_image_converter_get_number_from_substring(const char* data, uint32_t start, uint32_t end) { - kds_s2000w_debug_printf(ALL, "kds_s2000w_image_converter_get_number_from_substring"); + kds_s2000w_debug_printf(ALL, __func__); char* number_buffer = malloc(sizeof(char) * MAXBUFFER); if (number_buffer == NULL) @@ -138,7 +138,7 @@ void _kds_s2000w_image_converter_tiff_metadata(blobdata_t* image, image_metadata void _kds_s2000w_image_converter_pnm_metadata(const blobdata_t* image, image_metadata_t* mdata) { - kds_s2000w_debug_printf(ALL, "kds_s2000w_image_converter_pnm_metadata"); + kds_s2000w_debug_printf(ALL, __func__); const char* image_data = (const char*) image->data; @@ -156,7 +156,7 @@ void _kds_s2000w_image_converter_pnm_metadata(const blobdata_t* image, image_met void _kds_s2000w_image_converter_jpeg_metadata(blobdata_t* image, image_metadata_t* mdata) { - kds_s2000w_debug_printf(ALL, "kds_s2000w_image_converter_jpeg_metadata"); + kds_s2000w_debug_printf(ALL, __func__); struct jpeg_decompress_struct cinfo; struct jpeg_error_mgr err; @@ -188,7 +188,7 @@ void _kds_s2000w_image_converter_write_bw_pnm(const uint8_t* data, uint32_t height, FILE* pnm_stream) { - kds_s2000w_debug_printf(ALL, "kds_s2000w_image_converter_write_bw_pnm"); + kds_s2000w_debug_printf(ALL, __func__); size_t bit_width = width * BYTE_BITS; bit** pixels = pbm_allocarray(bit_width, height); @@ -221,7 +221,7 @@ void _kds_s2000w_image_converter_write_pnm(const uint8_t* data, enum imgformat format, FILE* pnm_stream) { - kds_s2000w_debug_printf(ALL, "kds_s2000w_image_converter_write_pnm"); + kds_s2000w_debug_printf(ALL, __func__); xel** pixels = pnm_allocarray(width, height); for (uint32_t i = 0; i < height; i++) { @@ -259,7 +259,7 @@ void _kds_s2000w_image_converter_gray_or_color_jpg_to_pnm(j_decompress_ptr cinfo FILE* pnm_stream, enum imgformat format) { - kds_s2000w_debug_printf(ALL, "kds_s2000w_image_converter_jpg_to_pnm"); + kds_s2000w_debug_printf(ALL, __func__); size_t decompress_size = format * cinfo->output_width * cinfo->output_height; uint8_t* decompress_data = malloc(sizeof(uint8_t) * decompress_size); @@ -283,7 +283,7 @@ void _kds_s2000w_image_converter_gray_or_color_jpg_to_pnm(j_decompress_ptr cinfo image_metadata_t* kds_s2000w_image_converter_get_metadata(blobdata_t* image) { - kds_s2000w_debug_printf(ALL, "kds_s2000w_image_converter_metadata_from_scanner_image"); + kds_s2000w_debug_printf(ALL, __func__); if (image->size < 2) return NULL; @@ -314,7 +314,7 @@ image_metadata_t* kds_s2000w_image_converter_get_metadata(blobdata_t* image) void _kds_s2000w_image_converter_jpg_to_pnm(blobdata_t* in, blobdata_t* out) { - kds_s2000w_debug_printf(ALL, "kds_s2000w_image_converter_jpg_to_pnm"); + kds_s2000w_debug_printf(ALL, __func__); if (!kds_s2000w_image_type_check_is_jpeg(in)) return; @@ -351,7 +351,7 @@ void _kds_s2000w_image_converter_jpg_to_pnm(blobdata_t* in, blobdata_t* out) void _kds_s2000w_image_converter_tiff_to_pnm(blobdata_t* in, blobdata_t* out) { - kds_s2000w_debug_printf(ALL, "kds_s2000w_image_converter_tiff_to_pnm"); + kds_s2000w_debug_printf(ALL, __func__); tiff_reader_t* tiff_handler = malloc(sizeof(tiff_reader_t)); if (tiff_handler == NULL) @@ -421,7 +421,7 @@ void _kds_s2000w_image_converter_tiff_to_pnm(blobdata_t* in, blobdata_t* out) void kds_s2000w_image_converter_to_pnm(blobdata_t* in, blobdata_t* out) { - kds_s2000w_debug_printf(ALL, "kds_s2000w_image_converter_pnm"); + kds_s2000w_debug_printf(ALL, __func__); if (kds_s2000w_image_type_check_is_jpeg(in)) { _kds_s2000w_image_converter_jpg_to_pnm(in, out); diff --git a/src/kds_s2000w_net.c b/src/kds_s2000w_net.c index 85f7bf9..2d6016b 100644 --- a/src/kds_s2000w_net.c +++ b/src/kds_s2000w_net.c @@ -14,7 +14,7 @@ SANE_Device** kds_s2000w_device_info_ptr = NULL; SANE_Status sane_kds_s2000w_net_init(SANE_Int* version_code, SANE_Auth_Callback authorize) { - kds_s2000w_debug_printf(ALL, "sane_kds_s2000w_net_init"); + kds_s2000w_debug_printf(ALL, __func__); kds_s2000w_debug_printf_version(INFO, NAME, MAJOR, MINOR, PATCH); *version_code = SANE_VERSION_CODE(MAJOR, MINOR, PATCH); @@ -24,7 +24,7 @@ SANE_Status sane_kds_s2000w_net_init(SANE_Int* version_code, SANE_Auth_Callback void sane_kds_s2000w_net_exit(void) { - kds_s2000w_debug_printf(ALL, "sane_kds_s2000w_net_exit"); + kds_s2000w_debug_printf(ALL, __func__); if (kds_s2000w_device_info_ptr == NULL) return; @@ -38,7 +38,7 @@ void sane_kds_s2000w_net_exit(void) SANE_Status sane_kds_s2000w_net_get_devices(SANE_Device*** device_list, SANE_Bool local_only) { - kds_s2000w_debug_printf(ALL, "sane_kds_s2000w_net_get_devices"); + kds_s2000w_debug_printf(ALL, __func__); if (kds_s2000w_device_info_ptr != NULL) { *device_list = kds_s2000w_device_info_ptr; @@ -69,7 +69,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) { - kds_s2000w_debug_printf(ALL, "sane_kds_s2000w_net_open"); + kds_s2000w_debug_printf(ALL, __func__); if (strcmp(devicename, NAME) != 0) return SANE_STATUS_INVAL; @@ -106,7 +106,7 @@ SANE_Status sane_kds_s2000w_net_open(SANE_String_Const devicename, void sane_kds_s2000w_net_close(SANE_Handle handle) { - kds_s2000w_debug_printf(ALL, "sane_kds_s2000w_net_close"); + kds_s2000w_debug_printf(ALL, __func__); if (handle == NULL) return; @@ -118,7 +118,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) { - kds_s2000w_debug_printf(ALL, "sane_kds_s2000w_net_get_option_descriptor"); + kds_s2000w_debug_printf(ALL, __func__); return kds_s2000w_option_descriptors_get_by_number(option); } @@ -126,7 +126,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) { - kds_s2000w_debug_printf(ALL, "sane_kds_s2000w_net_control_option"); + kds_s2000w_debug_printf(ALL, __func__); handler_t* h = (handler_t*) handle; if (action == SANE_ACTION_GET_VALUE) @@ -142,7 +142,7 @@ SANE_Status sane_kds_s2000w_net_control_option(SANE_Handle handle, SANE_Status sane_kds_s2000w_net_get_parameters(SANE_Handle handle, SANE_Parameters* params) { - kds_s2000w_debug_printf(ALL, "sane_kds_s2000w_net_get_parameters"); + kds_s2000w_debug_printf(ALL, __func__); handler_t* h = (handler_t*) handle; @@ -154,7 +154,7 @@ SANE_Status sane_kds_s2000w_net_get_parameters(SANE_Handle handle, SANE_Status sane_kds_s2000w_net_start(SANE_Handle handle) { - kds_s2000w_debug_printf(ALL, "sane_kds_s2000w_net_start"); + kds_s2000w_debug_printf(ALL, __func__); handler_t* h = (handler_t*) handle; @@ -189,7 +189,7 @@ SANE_Status sane_kds_s2000w_net_start(SANE_Handle handle) SANE_Status sane_kds_s2000w_net_read(SANE_Handle handle, SANE_Byte* data, SANE_Int max_length, SANE_Int* length) { - kds_s2000w_debug_printf(ALL, "sane_kds_s2000w_net_read"); + kds_s2000w_debug_printf(ALL, __func__); handler_t* h = (handler_t*) handle; @@ -214,7 +214,7 @@ SANE_Status sane_kds_s2000w_net_read(SANE_Handle handle, SANE_Byte* data, void sane_kds_s2000w_net_cancel(SANE_Handle handle) { - kds_s2000w_debug_printf(ALL, "sane_kds_s2000w_net_cancel"); + kds_s2000w_debug_printf(ALL, __func__); handler_t* h = (handler_t*) handle; @@ -246,7 +246,7 @@ void sane_kds_s2000w_net_cancel(SANE_Handle handle) SANE_Status sane_kds_s2000w_net_set_io_mode(SANE_Handle handle, SANE_Bool non_blocking) { - kds_s2000w_debug_printf(ALL, "sane_kds_s2000w_net_set_io_mode"); + kds_s2000w_debug_printf(ALL, __func__); return SANE_STATUS_UNSUPPORTED; } @@ -254,7 +254,7 @@ SANE_Status sane_kds_s2000w_net_set_io_mode(SANE_Handle handle, // cppcheck-suppress constParameterPointer SANE_Status sane_kds_s2000w_net_get_select_fd(SANE_Handle handle, SANE_Int* fd) { - kds_s2000w_debug_printf(ALL, "sane_kds_s2000w_net_get_select_fd"); + kds_s2000w_debug_printf(ALL, __func__); return SANE_STATUS_UNSUPPORTED; } \ No newline at end of file