lua-users home
lua-l archive

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


Obviously you could do some basic string matching on the script to
clip it to the appropriate length.  You could also do something pretty
basic like:


// in C
lua_pushboolean(L, 1);
lua_setglobal(L, "global_var_set_by_app")


--internal functions:
function internal1() end
function internal2() end

--function called by C/C++:
function filter(a,b)
 internal1()
 internal2()
end

--code to allow the script to run stand-alone:
if(not global_var_set_by_app) then
   a = 1
   b = 2
   filter(a,b)
end