[PD-dev] [ pure-data-Patches-1358937 ] class loader for non alpha-numeric classnames

SourceForge.net noreply at sourceforge.net
Sat Dec 31 21:24:50 CET 2005


Patches item #1358937, was opened at 2005-11-17 04:52
Message generated for change (Comment added) made by millerpuckette
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=478072&aid=1358937&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-dev
Group: wishlist
Status: Open
Resolution: None
Priority: 5
Submitted By: IOhannes m zmölnig (zmoelnig)
Assigned to: Miller Puckette (millerpuckette)
Summary: class loader for non alpha-numeric classnames

Initial Comment:
object-names containing non-alphanumerics like [||~]
can (sometimes) be not represented on filesystems (e.g.
"|" is a forbidden character) and more often they
cannot be used to construct a valid setup-function
("||~_setup" or "||_tilde_setup" are really bad).
the way the "~" is handled, is non-generic and thus
sub-optimal.

as a solution me and hcs proposed an encoding into
alphanumeric-values, using a hexadecimal representation
of all characters but [0-9A-Za-z_] (e.g. "+" is ascii
43 and is thus represented by "0x2b" (hex-value all
lowercase and prepended with "0x")

e.g. if we have a new class "mtx_||", pd first attempts
to find a file called "mtx_||.dll". if it succeeds, it
will try to call the "mtx_||_setup()" function.
if that fails we suggest to try and call a function
"setup_mtx_0x7c0x7c()" (the keyword setup is now at the
beginning of the function-name, in order to prevent the
names starting with numbers and in order to distinguish
between the normal setup-methods).
if no "mtx_||.dll" can be found, pd should then search
for a file "mtx_0x7c0x7c.dll" (guaranteed to be
representable on any filesystem); search this file for
the 2 setup-functions.
if all fails try to find "mtx_||.pd" and then
"mtx_0x7c0x7c.pd"

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

>Comment By: Miller Puckette (millerpuckette)
Date: 2005-12-31 12:24

Message:
Logged In: YES 
user_id=313747

It's ugly, but I think it's really needed anyway.  It would
also be good someday to fix abstractions to do this too. 
Anyway, I took it for upcoming version 0.40

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

Comment By: IOhannes m zmölnig (zmoelnig)
Date: 2005-11-17 04:54

Message:
Logged In: YES 
user_id=564396

attached is a patch against s_loader.c, s_class.c and
m_stuff.h that achieves this functionality

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

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




More information about the Pd-dev mailing list