[PD-dev] [ pure-data-Patches-1353230 ] class loader hook

SourceForge.net noreply at sourceforge.net
Wed Nov 23 12:20:10 CET 2005


Patches item #1353230, was opened at 2005-11-10 15:40
Message generated for change (Comment added) made by xovo
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=478072&aid=1353230&group_id=55736

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: puredata
Group: wishlist
Status: Open
Resolution: None
Priority: 5
Submitted By: Thomas Grill (xovo)
Assigned to: Nobody/Anonymous (nobody)
Summary: class loader hook

Initial Comment:
Hi all,
i'd like to propose a loader hook functionality, so
that external logic can be used if the loading of a PD
external binary object has failed.
This opens up two possibilites:
1) it allows to use external objects written in
languages other than C (above all scripting languages)
which cannot provide an exposed class_setup function to
be used in the same way as traditional C-coded externals.
2) it allows to create external object functionality
more dynamically, since the exact name need not be
known (and fixed into binary) beforehand.

The attached patch is for s_loader.c. The sys_loader
function would still have to be exposed in m_pd.h

gr~~~

----------------------------------------------------------------------

>Comment By: Thomas Grill (xovo)
Date: 2005-11-23 11:20

Message:
Logged In: YES 
user_id=350252

small usage example:
(a "cil" external has to be loaded in PD to invoke the
cil_setup function)

static int loader(char *dirname,char *classname)
{
    // TODO: check the classname, if it's in our scope
    // return 0 if it isn't

    // here we could load some binaries, like in
sys_load_lib_internal
    // or we could just create new pd classes, like in
typical xxx_setup functions

    // ok, class has been loaded
    return 1;
}

void cil_setup()
{
    // install our class loader
    ::sys_loader(loader);
}


----------------------------------------------------------------------

Comment By: Thomas Grill (xovo)
Date: 2005-11-23 11:12

Message:
Logged In: YES 
user_id=350252

here's a "diff -uw" patch from the pd root directory
involving both m_pd.h and s_loader.c


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=478072&aid=1353230&group_id=55736




More information about the Pd-dev mailing list