here is the lua_reg structure as it appears in lua.pas:
Code:
type
luaL_reg = record
name: PChar;
func: lua_CFunction;
end;
PluaL_reg = ^luaL_reg;
var
luaL_openlib: procedure(L: Plua_State; const lr: PluaL_reg; nup: Integer); cdecl;
and this as in lauxlib.h:
Code:
typedef struct luaL_reg {
const char *name;
lua_CFunction func;
} luaL_reg;
LUALIB_API void luaL_openlib (lua_State *L, const char *libname,
const luaL_reg *l, int nup);
I hope this helps explaining the problem....
Also:
Code:
typedef struct lua_State lua_State;
typedef int (*lua_CFunction) (lua_State *L);
is in delphi:
Code:
type
Plua_State = Pointer;
lua_CFunction = function(L: Plua_State): Integer; cdecl;
This last thing is known to work ok.
Bookmarks