lua-users home
lua-l archive

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


Luiz Henrique de Figueiredo wrote:
I was embedding Lua into an RTOS and needed to add my own user libraries. I decided to modify linit.c to allow me to hook in another set of libraries. My question is, what would be the best way to add your own libraries as I can not dynamically load the libraries. I have attached my modified version of linit.c in hopes you can enlighten me on a better method.

If the user libraries are statically defined, the simplest way is just
to add entries to lualibs. If they are dynamically defined, then your
solution seems ok.
--lhf


One of my other goals is to not have the developer be required to modify any Lua source to adapt the scripting language to his project. If many different projects use the same Lua archives, the developer would be required to copy or ifdef linit.c to add different libs. Anyway this is a goal and it appears very doable, but it would require someone replacing/merging linit.c each time a new release of Lua is available.

I would still like to figure out a clean way to allow the developer to remove libs from lualibs for projects which do not require all of the features/modules. Currently it appears someone would have to ifdef or edit the linit.c file.

Was the intent for the developer to copy and/or modify linit.c for each project which required more or different libs?

Thanks again for you input,
--Keith