If the layout and allocation routines are changed, this could be a
solution. Define this structure:
static struct req
{
int fd;
u_int running:1, done:1;
SANE_Status status;
size_t *dst_len;
void *dst;
struct req *next;
struct {
struct sg_header hdr;
/* Make sure this is the last element, the real size
is SG_BIG_BUFF and machine dependant */
u_int8_t data[1];
} cdb;
}
And allocate it like this:
struct req *current_req = malloc(sizeof(struct req) - 1 + SG_BIG_BUFF);
Then you can use the structure as normal, and the buffer size is
dynamic.
-- ##> Petter Reinholdtsen <## | pere@td.org.uit.no O- <SCRIPT Language="Javascript">window.close()</SCRIPT> http://www.hungry.com/~pere/ | Go Mozilla, go! Go!
-- Source code, list archive, and docs: http://www.mostang.com/sane/ To unsubscribe: echo unsubscribe sane-devel | mail majordomo@mostang.com