lua-users home
lua-l archive

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


Since you're going to have to write a thin C layer on top of the existing C API
to expose those functions to Lua, I think it is easiest to add type-checking
there. Perhaps a helper function such as
	luaL_checkargs(L,"istf")
would be appropriate. This function would check the number and type of the
arguments by scanning the given string (i=int, s=string, t=table, f=float;
you get the idea).

This could also be easily done automatically with a tool like toLua or a simple
Lua script (I've used such scripts to write wrappers for mapm and pdflib).
--lhf