lua-users home
lua-l archive

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

I'm trying to use lua in a non-standard environment that does not have access to anything like the typical file system and cannot use the I/O functions declared in C stdio.h. We also use a proprietary API to dynamically load C libraries. Therefore I need to replace the package loader functions in package.loaders with a special loader that is written in C. I understand how to write the loader function. What process do you recommend for installing this function in package.loaders and deleting the "standard" loaders loader_Lua, loader_C, and loader_Croot? I'd like to make the fewest possible changes to the lua source itself.

The approach I thought of was to add a new statically-linked library to the lualibs list in linit.c and do the replacement in the library initialization code.