Page 1 of 1

Plugin API update (v2.5.2)

PostPosted: Sun Nov 04, 2007 8:32 am
by Aaron
Hi All,

I've released the updated 'Zeolite' plugin API that should be used with the forthcoming L3DT release 2.5b. The main changes are the addition of some functions for creating maps in the project, the addition of several signed/unsigned integer and vector variable types.

You can read the change-long and download the API from here:

http://www.bundysoft.com/docs/doku.php?id=zeolite:changes#v2.5.2

Cheerio,
Aaron.

Broken zeofunc_Execute

PostPosted: Sun Nov 18, 2007 3:17 am
by carldt
Why did you do this in the public section of the class declaration?

Code: Select all
   //ZVAR   zeofunc_Execute(ZFUNC hFunc, ZLIST hArgList);
   bool   zeofunc_Execute2(ZFUNC hFunc, ZLIST hArgList, ZVAR* ppRval);


Extensions that rely on CExtAPI::zeofunc_Execute need to be rewritten now.

I couldn't see this marked as deprecated in your ChangeLog.

PostPosted: Sun Nov 18, 2007 3:40 am
by Aaron
Hi Carl,

zeofunc_Execute was replaced by zeofunc_Execute2 for Zeolite v2.3, back in March. The reason for the change was that zeofunc_Execute was not thread-safe. The second version requires the user to supply the variable to contain the return value, which is threadsafe, whereas the first version used a shared, internal variable to store the return value, and returned a handle to that. If that function was called simultaneously in two threads, one may incorrectly pick up the return value of the other. Basically, zeofunc_Execute was a mistake, and could not be fixed without changing the prototype (thus zeofunc_Execute2).

The down-side to zeofunc_Execute2 is that users must now manually create and initialise the return value variable before passing it to the function. If this is a problem, I suggest having a look at the CzFunc helper class. It makes using zeofuncs much easier, and I always use it in preference to the CExtAPI::zeofunc_ functions.

By the way, older plugins that used zeofunc_Execute will still work, because zeofunc_Execute is still available in L3DT for plugins that ask for it (i.e. those compiled before Zeolite v2.3.) If this function is still required, you can un-comment the relevant code from the CExtAPI header and source files. However, this is not recommended as a long-term solution.

Best regards,
Aaron.