Thread: C++ Plugins
View Single Post
BAILOPAN
Join Date: Jan 2004
Old 10-17-2004 , 14:33  
Reply With Quote #2

MetaEng works by attaching interfaces to a central API. This API has functions like "LoadPlugin" and "ForwardCall", trivial things that are necessary for basic scripting functionality.

For example, the C++ "scripting engine" loads a plugin with LoadLibrary/dlopen. It hooks a call with GetProcAddress/dlsym. It gets function natives through a metaeng utility pointer.

You will see once I get a basic MetaEng structure in CVS, it's quite simple. The only complex part are the scripting engines, which themselves can get quite complicated.

One of the big obstacles I just solved was variadic calling (i.e. the opposite of va_arg, pushing variable numbers of arbitrary parameters). So you'll see that making C/C++ plugins will actually be quite simple (there will be a nice little SDK).

MetaEng has a central repository for a big function map, which includes native and forwarded functions (technically these are the same thing). Because of this, there is no distinction between modules and plugins. But I'll try to separate things for organization...

it's pretty complicated, I'm hoping it will work
BAILOPAN is offline