lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Tue, Jun 02, 1998 at 05:31:55AM -0300, Dan Marks wrote:
> The idea is that when a dynamic library of subroutines is loaded, or
> some interface is loaded (e.g. IDL) then instead of having to generate
> code manually to bind each C function or interface call to the desired
> subroutine, we automatically build a parameter list on the fly and
> push it on to the stack.  By casting the desired function to a generic
> function call type, we can pass our bag of parameters to the function
> and have them interpreted as the normal arguments to the function.
> Using this scheme, we could load in a dynamic link library on the fly
> and with just a string or table to specify its parameters, generate
> a function call to it.

I've actually considered doing this exact thing, because I want to be able
to easily publish type checked C functions to lua without generating stubs
for every one. However, I hadn't implemented it..

Your calling of the generic function isn't portable (for example, it would
break with register calling conventions). Is there some way to use stdarg to
get C to portably call a function with a built up argument list? 

Very cool stuff dan. :)

-- 
David Jeske (N9LCA) + http://www.chat.net/~jeske/ + jeske@chat.net