lua-users home
lua-l archive

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

On Fri, Jan 22, 2010 at 3:53 PM, Peter Cawley <> wrote:
> On Fri, Jan 22, 2010 at 12:51 PM, Pavel Shevaev <> wrote:
>> While I know how to require 'macro'
>> library before any parsing in cli mode(using -l switch) I don't know
>> how to achieve it using Lua C api.
> You can just do a literal translation of require"macro" into the C API:
> lua_getglobal(L, "require");
> lua_pushliteral(L, "macro");
> lua_call(L, 1, 0);

It worked like a charm. Thank you all guys for being nice with a n00bie ;)

Best regards, Pavel