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 bin2c.com file on SimTel that does something very similar, only
without adding the do_buffer calls to actually load the code into the
lua-state..

I now compiled the bin2c.c from the Lua-distro, and everything works very
fine...
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 :)

-Martin

----- Original Message -----
From: "Luiz Henrique de Figueiredo" <lhf@tecgraf.puc-rio.br>
To: "Multiple recipients of list" <lua-l@tecgraf.puc-rio.br>
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
done
>
> 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
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".
>
> --lhf
>