]> gitweb.hhaalo.de Git - sane-kds-s2000w-net.git/commitdiff
add image data in handler
authorBastian Dehn <hhaalo@arcor.de>
Sun, 10 Mar 2024 14:08:56 +0000 (15:08 +0100)
committerBastian Dehn <hhaalo@arcor.de>
Sun, 10 Mar 2024 14:08:56 +0000 (15:08 +0100)
src/kds_s2000w_handler.c
src/kds_s2000w_handler.h

index efc837a6919e2b7a00cb120f8982a4f20faa84df..04be8316e26bd49c6cc9484998de8ff4b4664733 100644 (file)
@@ -171,6 +171,7 @@ handler* init_handler()
        h->current_scan_status = malloc(sizeof(scanstatus));
        h->current_metadata = malloc(sizeof(metadata));
        h->read_info = malloc(sizeof(readinfo));
+       h->image = malloc(sizeof(imagedata));
 
        h->sessionid = 0;
        h->state = NOTCONNECTED;
@@ -194,6 +195,8 @@ handler* init_handler()
        h->read_info->read_size = 0;
        h->read_info->readed_bytes_per_line = 0;
        h->read_info->readed_lines = 0;
+       h->image->size = 0;
+       h->image->data = NULL;
 
        return h;
 }
@@ -209,6 +212,10 @@ void free_handler(handler* h)
        h->current_metadata = NULL;
        free(h->read_info);
        h->read_info = NULL;
+       free(h->image->data);
+       h->image->data = NULL;
+       free(h->image);
+       h->image = NULL;
        free(h);
        h = NULL;
 }
index 24aa94ed1c9b6c49e65293757bce7913a6da92a0..a4ded974e0edc880c5377b6cb94b035e527d3902 100644 (file)
@@ -11,6 +11,11 @@ enum {
        RELOAD_PARAMS = 4
 };
 
+typedef struct {
+       int size;
+       void* data;
+} imagedata;
+
 typedef struct {
        int format;
        int channels;
@@ -46,6 +51,7 @@ typedef struct {
        scanstatus* current_scan_status;
        metadata* current_metadata;
        readinfo* read_info;
+       imagedata* image;
 } handler;
 
 handler* init_handler();