[PD-dev] Problem with renaming setup functions

Thomas Mayer thomas at residuum.org
Sat Nov 16 00:10:28 CET 2013


Hi,

On 15.11.2013 19:28, Thomas Mayer wrote:
> On 15.11.2013 10:43, IOhannes m zmölnig wrote:
>> i'm not sure what you want to acchieve.
> 
> I want to achieve a common naming convention for the setup function of
> all objects in my library, currently some have the name of
> <object>_setup, some setup_<object>.
> 
>> it seems that you are creating an object [json-encode], which (since it
>> is not loaded yet) will make Pd look for a file named "json-encode.dll"
>> and once it found it, it will look in the dll for an entry function
>> named "setup_json0x2dencode".
> 
> When I try to rename the function rest_setup() to setup_rest(), Pd tells me
> 
>  rest
> error: ... couldn't create
> error: load_object: Symbol "rest_setup" not found
> 
> Does Pd have a cache of setup functions? I am using
> Pd 0.44.0-extended-20130611

I guess, I have found it in s_loader.c lines 129ff:

    if (hexmunge)
    {
        memmove(symname+6, symname, strlen(symname)+1);
        strncpy(symname, "setup_", 6);
    }
    else strcat(symname, "_setup");


So, for objects that need a special character converted to hex, the
setup function must be called setup_<object>, while for other objects
the setup function must be called <object>_setup.

This is kind of confusing.

Thanks,
Thomas

-- 
"In an era when everything can be surveiled, all we have left is
politeness."
(Major Napier in: Neal Stephenson: The Diamond Age)
http://www.residuum.org/



More information about the Pd-dev mailing list