[PD] pdstring feature requests...

Bryan Jurish moocow at ling.uni-potsdam.de
Thu Jul 26 14:40:55 CEST 2007


moin,

On 2007-07-26 10:06:11, IOhannes m zmoelnig <zmoelnig at iem.at> appears to
have written:
> Bryan Jurish wrote:
>> at some point, IOhannes m zmoelnig <zmoelnig at iem.at> appears to
>> have written:
> so i would be quite content if [any2string] would add nothing by itself
> and leave the user to manually append a terminating sequence.

now implemented and checked into cvs as pdstring-v0.05.  the magic
incantation is:

 [any2string BUFSIZE -1],

where "BUFSIZE" is the initial (object-local) buffer size, it can be 0
or less to use the default (which I've increased from 32 to 256).

>> and I don't really feel up to writing a whole pd parser
>> from scratch at the moment.
> 
> well, there is no need to do so.

sorry, it was way too late last night -- there is now rudimentary
message-separation in [string2any]: it will separate messages on a
single end-of-string (EOS) character, specified just like for [any2string]:

 [string2any BUFSIZE 0]

will separate messages on NUL-bytes.  Inlets and outlets have been added
to protect the innocent, and the defaults are backwards-compatibile.

> however, i will just write an object that searches lists for given
> sublists and splits them accordingly.

that's probably best -- I don't really want to add multiple-character
EOS parsing to the [pdstring] stuff, but the single-character version
struck me as a pretty sensible way to deal with NUL bytes at least.

> i only need a name....

how about [list_tokenize] ?

> so BUSIZE would be the initialy buffersize (which would be adjusted as
> longer messages come along)?

that's how it is now -- the static version (not built by default, in
pdstring/src/any2string_static.c) allocates a single object-local buffer
of user-specified size on object instantiation and never dynamically
allocates memory in its message-handling routines (it will spit out an
error if the buffer overflows).

>>> 109 097 114 109 111 115 101 116 115
>> ... with prehensile tails,
> 
> i thought it was goeldi's?
... also.  and big hair.

Callithrix jacchus,
	Bryan

-- 
Bryan Jurish                           "There is *always* one more bug."
jurish at ling.uni-potsdam.de      -Lubarsky's Law of Cybernetic Entomology




More information about the Pd-list mailing list