#include "kds_s2000w_debug.h"
#endif
+#define SPACE 0x0a
+
int _sane_kds_s2000w_net_find_first_data_byte(imagedata* image)
{
#ifndef NODEBUG
if (strncmp(data, "P4", 2) == 0)
header_spaces = 2;
- const char space = 0x0a;
int space_count = 0;
int byte_count = 0;
while(space_count < header_spaces && byte_count < image->size) {
- if (data[byte_count] == space)
+ if (data[byte_count] == SPACE)
space_count++;
byte_count++;
*version_code = SANE_VERSION_CODE(MAJOR, MINOR, PATCH);
kds_s2000w_option_descriptor_init_option_descriptors();
+
return SANE_STATUS_GOOD;
}
debug_printf(ALL, "sane_kds_s2000w_net_get_devices");
#endif
- SANE_Device** own_device_list = NULL;
- SANE_Device* device_info = NULL;
if (local_only)
return SANE_STATUS_NO_MEM;
- own_device_list = malloc(sizeof(SANE_Device*) * 2);
- device_info = malloc(sizeof(SANE_Device));
+ SANE_Device** own_device_list = malloc(sizeof(SANE_Device*) * 2);
+ SANE_Device* device_info = malloc(sizeof(SANE_Device));
device_info->name = "kds_s2000w_net";
device_info->vendor = "Kodak";
device_info->model = "Kodak Alaris s2000w series";
handler* h = (handler*) handle;
h->read_info->cancel = 1;
kds_s2000w_handler_stop_scan(h);
+
return;
}
for (int i = 0; i < 30; i++) {
kds_s2000w_handler_get_parameters(h);
+
if (h->current_metadata->valid)
break;
}
return SANE_STATUS_GOOD;
}
+ // last frame
free(h->scanner_image->data);
h->scanner_image->data = NULL;
h->scanner_image->size = 0;