M
matevz bradac
Hi,
I'm trying to implement delayed function execution,
similar to OpenGL's display lists. It looks something
like this:
beginList ();
fcn1 ();
fcn2 ();
.
.
endList ();
The functions between beginList() and endList() are not
executed, but rather compiled to a list, which may be run
sometime in the future - by calling execList().
One of the fcn()s that can be used in the list should allow
the programmer to call an arbitrary function with variable
arguments (we know they are all long ints), e.g.:
void fcnX (void (*fcnToCall)(), long numArgs, ...)
When execList() is called, fcnToCall (numArgs, ...) should
be executed. The problem is, how do I store variable args
for future use? I know they're all long ints, so this should
be somehow helpful, but I can't figure it out. Do I have to
remember/copy the stack and is this possible in C, or must it
be done in assembly?
regards,
matevz
I'm trying to implement delayed function execution,
similar to OpenGL's display lists. It looks something
like this:
beginList ();
fcn1 ();
fcn2 ();
.
.
endList ();
The functions between beginList() and endList() are not
executed, but rather compiled to a list, which may be run
sometime in the future - by calling execList().
One of the fcn()s that can be used in the list should allow
the programmer to call an arbitrary function with variable
arguments (we know they are all long ints), e.g.:
void fcnX (void (*fcnToCall)(), long numArgs, ...)
When execList() is called, fcnToCall (numArgs, ...) should
be executed. The problem is, how do I store variable args
for future use? I know they're all long ints, so this should
be somehow helpful, but I can't figure it out. Do I have to
remember/copy the stack and is this possible in C, or must it
be done in assembly?
regards,
matevz