lua-users home
lua-l archive

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


>Actually, it is often overlooked, but such an example is shipped with the
>source distribution of Lua.
>It it called lua.c... I use it as framework for my sample.

lua.c is rather complicated because it's an interactive program: it has to
handle command line options, interrupt signals, multi-line interactive input,
and more.

The distribution also contains a very simple minimal example at etc/min.c
which is probably much easier to understand and extend. (The etc/ directory
contains several goodies that are likely overlooked...)

On the other hand, lua.c is the right program to extend if you simply want to
add your library. There's a LUA_USERINIT macro for this.
--lhf