if (strcmp(devicename, "kds_s2000w_net") != 0)
return;
- handler* h = NULL;
- h = malloc(sizeof(handler));
- *handle = h;
+ handler* h = malloc(sizeof(handler));
+ h->current_scan_status = malloc(sizeof(scan_status));
+ h->current_metadata = malloc(sizeof(metadata));
+ h->read_info = malloc(sizeof(readinfo));
h->sessionid = 0;
h->state = NOTCONNECTED;
- h->current_scan_status = malloc(sizeof(scan_status));
- h->current_scan_status->current_image_number = 0;
+ h->current_scan_status->current_image_number = 1;
h->current_scan_status->available_images = 0;
h->current_scan_status->downloaded_images = 0;
h->current_scan_status->complete_scanned = 0;
- h->current_metadata = malloc(sizeof(metadata));
- h->current_metadata->format = 0;
- h->current_metadata->is_last = 0;
+ h->current_metadata->format = 1;
+ h->current_metadata->is_last = 1;
h->current_metadata->size = 0;
h->current_metadata->bytes_per_line = 0;
h->current_metadata->pixels_per_line = 0;
h->current_metadata->lines = 0;
- h->current_metadata->depth = 0;
+ h->current_metadata->depth = 8;
h->current_metadata->valid = 0;
h->current_metadata->scanned_all_complete = 0;
h->current_metadata->image = NULL;
- h->read_info = malloc(sizeof(readinfo));
h->read_info->scan_started = 0;
h->read_info->cancel = 0;
h->read_info->read_size = 0;
h->read_info->readed_bytes_per_line = 0;
h->read_info->readed_lines = 0;
+ *handle = h;
+
init_gamma_table();
image.size = 0;
image.data = NULL;
pnm_image.size = 0;
pnm_image.data = NULL;
- h->sessionid = 0;
- h->state = NOTCONNECTED;
resp = kds_s2000w_client_response_init();
int result = kds_s2000w_client_open_session("hhaalo", resp);
kds_s2000w_client_response_free(resp);
resp = NULL;
- h->current_scan_status->current_image_number = 1;
- h->current_scan_status->available_images = 0;
- h->current_scan_status->downloaded_images = 0;
- h->current_scan_status->complete_scanned = 0;
- h->current_metadata->scanned_all_complete = 0;
return;
}