--- In
plua@..., kevinjardine <no_reply@...> wrote:
>
> in case anyone asks, I did try
> loadlib("TestLib2","test")
> loadlib("test","test")
> loadlib("test","TestLib2")
> as well as
> loadlib("TestLib2","TestLib2")
> All failed.
Since Plua 2.0b4, loadlib is the standard loadlib function present in
Lua 5.0. For an usage example, look at the LuaCalc.lua application
inside plua-2.0.examples.zip:
local l3dinit = loadlib("3dlib2","init")
if not l3dinit then
gui.alert("This app requires 3dlib2.prc")
os.exit()
end
l3dinit()
You must test if the function returned by loadlib is not null and then
call it to initialize the library. Also look at the PluaLibInit
function inside 3dlib.c in libkit. This is the C function that is
called when you call l3dinit in the example. The second argument is
supposed to be a C function name ("init" in this example), but PalmOS
does not support this. So inside PluaLibInit you can choose what
funtion to return based on the name argument.
Regards,
Marcio.