[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Embedding LUA in a .so
- From: Maxime Petazzoni <maxime.petazzoni@...>
- Date: Fri, 10 Mar 2006 16:18:32 +0100
Is there a simple and esthetic way to embed Lua source code into a C
source file ? My problem is that I'd like to bundle in a .so that
cannot open another file (with luaL_openfile) for example.
My first thought is to put the Lua chunk into a big ugly #define line,
such as :
#define LUA_CODE "print('hello, world')"
And then use loadbuffer and run the compiled chunk, but it's a bit
hard to escape the Lua chunk code from a separate file so it can be
safely included in the #define line.
Any hints or previous experience ?
Maxime Petazzoni (http://www.bulix.org)
-- gone crazy, back soon. leave message.
Description: Digital signature