lua-users home
lua-l archive

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

Thank you!
I had some confusion as I searched for this tool (bin2c) on the net and
found a file on SimTel that does something very similar, only
without adding the do_buffer calls to actually load the code into the

I now compiled the bin2c.c from the Lua-distro, and everything works very
I have here a Win32 exe with all relevant libs included for XML-RPC
(luaSocket1.4 and lxp) plus all needed .lua files compiled in.
Debug version is aroung 500KB and the Release version is 272KB !

So now please excuse me as I need to do some hoppiung around in circles :)


----- Original Message -----
From: "Luiz Henrique de Figueiredo" <>
To: "Multiple recipients of list" <>
Sent: Tuesday, November 27, 2001 5:40 PM
Subject: Re: XMLRPC 0.0 for Lua

> >Now if I find out how this bin2c binding of Lua code to an executable is
> See etc/README, reproduced below:
> bin2c.c
>         This program converts files to byte arrays that are automatically
>         run with lua_dobuffer. This allows C programs to include all
>         Lua code, even in precompiled form. Even if the code is included
>         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
>         say "mystate", just #define L mystate before #include "init.h".
> --lhf