From: Thomas Pollak <thomas.pollak@ha...> - 2012-07-17 11:28:44
Date: Mon, 16 Jul 2012 14:34:26 +0200
From: Laurent MARZULLO <laurent.marzullo@...>
Subject: [Swig-user] Calling LUA function from C++
Content-Type: text/plain; charset=ISO-8859-1
I've got a C++ program that call some LUA functions at some point in the program.
The C++ program accept incoming connection on a socket, and do it's server job, speaking with the client etc, etc.
When receiving some kind of request from the Client, I would like to call a LUA function call "SendPlace", taking in parameter a "UserObject". This "UserObject", and all related method for this type was generated with SWIG ...
I will try to be more clear :
I've got a function in LUA:
-- lua --
function SendPlace ( obj1 )
obj1.AddObject( ... some data ... ); end
In a swig interface file, I've define this:
void AddObject( ... some data ... ); };
I've generated the module, and I would like to call the "SendPlace"
with a UserObject as parameter. But this type is defined in a .cc and there's no header.
Could someone tell me if this is possible or not with SWIG generated code?
Thank you very much
I achieved that by writing a small program which extracts a header out of the c file.
Get latest updates about Open Source Projects, Conferences and News.