"Allen" <allen-terri-ng@att.SPAM.net> wrote in message
news:WMwZa.95236$0v4.6549963@bgtnsc04-news.ops.worldnet.att.net...[color=blue]
> Hi listigerBiber, all,
>[color=green]
> > One way to implement a C interface which I have used quite a lot is to[/color]
> make[color=green]
> > each plugin have only one function. The function returns a pointer to a[/color][/color]
C[color=blue][color=green]
> > struct which has nothing but function pointers.[/color]
>
> id's QuakeII engine (GPL) uses a very similar method. The loading
> module and loaded module exchange references through one function call.
>
> struct import
> {
> //lots of pointers to funcs in other module
> } Ii;
>
> struct export
> {
> //lots more pointers to funcs in current module
> }Ie;
>
> //init pointers in Ie to local functions you want to access in other[/color]
module[color=blue]
>
> __declspec(dllexport) import GetAPI(export Ie); //defined in other
> module--platform specific interface
> Ii = GetAPI(Ie); //this func saves off the Ie info and then inits the[/color]
Ii[color=blue]
> pointers to its local funcs to be accessed in the calling module
>
>
> I have a different method for doing the same thing. I made a global
> data tree where each node looks like:
>
> struct Glob
> {
> char szName[MAX_STRING];
> DWORD dwFlags; //valid fields and requests
> char szValue[MAX_STRING];
> int iValue;
> float fValue;
> void* pVoid;
> PGLOB pParentGlob;
> PGLOB pLeftGlob;
> PGLOB pRightGlob;
> };
>
> Then, pointers to my equivalent of the above import/export structs[/color]
would[color=blue]
> be placed in Glob::pVoid for all to access.
>
> HTH
> --
>
> Best wishes,
> Allen
>
> No SPAM in my email !!
>[/color]
Funny you should mention QuakeII. I'm the author of the QuakeII mods WoD7
and WoD8. :) But as you say, it was iD software that wrote the stuff you're
talking about.
Guess in this context I'll use my real sig, including my QuakeII clan name
LOL
--
Cycho{HHR}
http://home.rochester.rr.com/cyhome/