lua-users home
lua-l archive

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

>Now if I find out how this bin2c binding of Lua code to an executable is done

See etc/README, reproduced below:

        This program converts files to byte arrays that are automatically
        run with lua_dobuffer. This allows C programs to include all necessary
        Lua code, even in precompiled form. Even if the code is included in
        source form, bin2c is useful because it avoids the hassle of having to
        quote special characters in C strings.
        Example of usage: Run bin2c file1 file2 ... > init.h. Then, in your C
        program, just do #include "init.h" anywhere in the *body* of a
        function. This will be equivalent to calling
                lua_dofile(L,"file1"); lua_dofile(L,"file2"); ...
        Note that the Lua state is called "L". If you use a different name,
        say "mystate", just #define L mystate before #include "init.h".