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);
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;
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)
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;
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)
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)
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)
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);
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)
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)
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)
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)
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)
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)
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;
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)
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)
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;
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;
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) {
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;
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;
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;
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;
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--;
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);
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)
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");
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;
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)
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;
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;
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);
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++) {
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);
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;
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;
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)
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);
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);
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;
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;
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;
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;
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);
}
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)
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;
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;
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;
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;
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;
}
// 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