[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: run a lua page (cgilua) in command line
- From: Javier Guerra <javier@...>
- Date: Tue, 22 Nov 2005 19:03:35 -0500
On Tuesday 22 November 2005 5:34 pm, Jorge Renato Machin Ibarra wrote:
> Javier:
>
> I only want to do some testing... I thought that I only have to load some
> modules and call a function or something like that ( I'm lua beginner ).
ok, it's not difficult; but it needs some studying of the sources.
CGILua is structured as follows:
1) a launcher
2) CGILua libraries
3) CGILua pages
the first one is different for each webserver, the other two are constant. I
think the easiest to use for learning is the plain CGI launcher. if your
embedded webserver can call CGI processes, you should be able to make this
one work. of course, after that you'd like to create your own embedded
launcher.
the cgi launcher has two parts: a C file "_cgi.c" and a lua script "cgi.lua".
the first one is compiled to an executable that gets the environment
variables and stdi/o streams and calls the cgi.lua script. the script sets
up the SAPI environment (used and documented by CGILua) and calls
cgilua.main()
that's all!
to make it work in your webserver, just make it call a short script that sets
up the SAPI table with the functions needed to interface to your C++ code.
--
Javier
Attachment:
pgprFldOIigBY.pgp
Description: PGP signature