int select(char* table, char*columns, char* where, <va_list of
variables for data retrieval>)
Can you provide an example of how to pass the va_list parameters to the
C code so I can retreive the data? I suppose I could write callback
functions and seperate data structures but I'd like to stay as close to
the original code as possible.
How are these variables used? Are they used in scanf style (pointers to
locations?) or are they used as "rvalues", which can only be read, but
never assigned? If the former, you probably can't do it without jumping
through more hoops then it's worth. In the later, you might just be able
to get away with dirty tricks using the knowledge of how the stack is
organized. DO NOT DO THIS! Whoever will have to look at your program
afterwards will curse and all your progeny.
In general, this is quite a hard problem, since you will muck with
the stack layout (which is a disaster waiting to happen, and about as
importable as it gets). Are you sure you can not get away with a static
version of the function? va_list is, as defined, pretty much a read-only
structure, and creating one on the fly is not really intended.
If i where you, i would build an intermediate layer, instead of trying to
force-fit these parts together. But... your program, your problem, your
endless grief.