- changed status to closed
Custom block initializers
Issue #69
resolved
It would be useful if the block XML file had a second function block where the user could declare initialization code. For example (simplified):
<block>
...
<function type="init" name="f_someblock_init"><![CDATA[
data->somearray = malloc(data->sa_len);
for(i = sa_len; i--;)
// stuff
]]></function>
Which could render a function that would be called from init_dsp_objects() with the same data struct pointer as the sample function.
Comments (3)
-
-
- changed status to resolved
-
I tried to add a "custom" function, but only get static declaration follows non-static declaration errors. The function itself is listed in the dynamically generated section of emul.c. The same function (copied from dynamic genaration) works as expected when it is included in the template file.
Should the dynamic generation already work or is this a bug (software version 0.5.3; OSX)?
- Log in to comment
Very nice Proposal ! Added ! Additionally user can create custom function with parameters and return type in order to make use of it inside the main callback function.