diff options
author | Bryan Jurish <mukau@users.sourceforge.net> | 2009-01-27 21:39:35 +0000 |
---|---|---|
committer | Bryan Jurish <mukau@users.sourceforge.net> | 2009-01-27 21:39:35 +0000 |
commit | 4be9db3a7bee4bb8c254ae26253a7ed70390589b (patch) | |
tree | e5c0a042275473c1a8a3d8ae5ab86495507450b4 /src/bytes2any.c | |
parent | 561c134e4ab3b0c746b79b26d305ae0c19e1ed4c (diff) |
+ delegated optional single-object-external mish-mash to src/Makefile.am using AM_CONDITIONAL
+ for --enable-object-externals builds, install actual links for 'any2string', 'string2any' aliases
- requires corresponding setup() routines in *bytes*
+ added printbytes, printwchars objects
svn path=/trunk/externals/moocow/pdstring/; revision=10661
Diffstat (limited to 'src/bytes2any.c')
-rw-r--r-- | src/bytes2any.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/src/bytes2any.c b/src/bytes2any.c index e4b3715..a7dc5b2 100644 --- a/src/bytes2any.c +++ b/src/bytes2any.c @@ -55,10 +55,12 @@ #define BYTES2ANY_DEFAULT_BUFLEN PDSTRING_DEFAULT_BUFLEN /*===================================================================== - * Constants + * Constants & Globals *=====================================================================*/ static char *bytes2any_banner = "bytes2any: pdstring version " PACKAGE_VERSION " by Bryan Jurish"; +static int BYTES2ANY_INITIALIZED = 0; + /*===================================================================== * Structures and Types: any2string *=====================================================================*/ @@ -196,6 +198,8 @@ static void bytes2any_free(t_bytes2any *x) */ void bytes2any_setup_guts(void) { + if (BYTES2ANY_INITIALIZED) return; + //-- class bytes2any_class = class_new(gensym("bytes2any"), (t_newmethod)bytes2any_new, @@ -206,14 +210,16 @@ void bytes2any_setup_guts(void) 0); //-- alias - class_addcreator((t_newmethod)bytes2any_new, gensym("bytes2any"), A_GIMME, 0); + class_addcreator((t_newmethod)bytes2any_new, gensym("string2any"), A_GIMME, 0); //-- methods class_addanything(bytes2any_class, (t_method)bytes2any_anything); - //-- help symbol //class_sethelpsymbol(bytes2any_class, gensym("bytes2any-help.pd")); //-- breaks pd-extended help lookup + + //-- set flag + BYTES2ANY_INITIALIZED = 1; } /*-------------------------------------------------------------------- @@ -224,3 +230,12 @@ void bytes2any_setup(void) post(bytes2any_banner); bytes2any_setup_guts(); } + +/*-------------------------------------------------------------------- + * setup (string2any alias) + */ +void string2any_setup(void) { + post("string2any_setup(): WARNING: names are in flux!"); + post("string2any_setup(): Prefer [bytes2any] over [string2any]."); + bytes2any_setup(); +} |