[PD-dev] [ pure-data-Patches-1353230 ] class loader hook
SourceForge.net
noreply at sourceforge.net
Thu Jan 5 13:11:01 CET 2006
Patches item #1353230, was opened at 2005-11-10 16:40
Message generated for change (Settings changed) made by zmoelnig
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: Closed
>Resolution: Accepted
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: Miller Puckette (millerpuckette)
Date: 2005-12-31 21:54
Message:
Logged In: YES
user_id=313747
Had to fool with this and the "altname" patch to get them to
work together. Should be working now (but I have no non-C
externs to test this on...)
----------------------------------------------------------------------
Comment By: Thomas Grill (xovo)
Date: 2005-11-23 12: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 12: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