[PD-cvs] SF.net SVN: pure-data:[10661] trunk/externals/moocow/pdstring

mukau at users.sourceforge.net mukau at users.sourceforge.net
Tue Jan 27 22:39:36 CET 2009


Revision: 10661
          http://pure-data.svn.sourceforge.net/pure-data/?rev=10661&view=rev
Author:   mukau
Date:     2009-01-27 21:39:35 +0000 (Tue, 27 Jan 2009)

Log Message:
-----------
+ 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

Modified Paths:
--------------
    trunk/externals/moocow/pdstring/Makefile.in
    trunk/externals/moocow/pdstring/config/Makefile.in
    trunk/externals/moocow/pdstring/configure
    trunk/externals/moocow/pdstring/configure.ac
    trunk/externals/moocow/pdstring/src/Makefile.am
    trunk/externals/moocow/pdstring/src/Makefile.in
    trunk/externals/moocow/pdstring/src/any2bytes.c
    trunk/externals/moocow/pdstring/src/bytes2any.c
    trunk/externals/moocow/pdstring/src/pdstring-help.pd
    trunk/externals/moocow/pdstring/src/pdstring.c
    trunk/externals/moocow/pdstring/src/pdstringUtils.h
    trunk/externals/moocow/pdstring/src/wchars2any-help.pd

Added Paths:
-----------
    trunk/externals/moocow/pdstring/src/pdstringUtils.c
    trunk/externals/moocow/pdstring/src/printbytes-help.pd
    trunk/externals/moocow/pdstring/src/printbytes-test.pd
    trunk/externals/moocow/pdstring/src/printbytes.c
    trunk/externals/moocow/pdstring/src/printwchars-help.pd
    trunk/externals/moocow/pdstring/src/printwchars-test.pd
    trunk/externals/moocow/pdstring/src/printwchars.c
    trunk/externals/moocow/pdstring/src/stringalias-test.pd

Modified: trunk/externals/moocow/pdstring/Makefile.in
===================================================================
--- trunk/externals/moocow/pdstring/Makefile.in	2009-01-27 09:19:55 UTC (rev 10660)
+++ trunk/externals/moocow/pdstring/Makefile.in	2009-01-27 21:39:35 UTC (rev 10661)
@@ -112,6 +112,7 @@
 LFLAGS = @LFLAGS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
+LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
 MAINT = @MAINT@
 MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
@@ -127,11 +128,12 @@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PDEXT = @PDEXT@
-PD_OBJECT_EXTERNALS = @PD_OBJECT_EXTERNALS@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 STRIP = @STRIP@
 VERSION = @VERSION@
+WANT_OBJECT_EXTERNALS_FALSE = @WANT_OBJECT_EXTERNALS_FALSE@
+WANT_OBJECT_EXTERNALS_TRUE = @WANT_OBJECT_EXTERNALS_TRUE@
 WFLAGS = @WFLAGS@
 ac_ct_CC = @ac_ct_CC@
 am__fastdepCC_FALSE = @am__fastdepCC_FALSE@

Modified: trunk/externals/moocow/pdstring/config/Makefile.in
===================================================================
--- trunk/externals/moocow/pdstring/config/Makefile.in	2009-01-27 09:19:55 UTC (rev 10660)
+++ trunk/externals/moocow/pdstring/config/Makefile.in	2009-01-27 21:39:35 UTC (rev 10661)
@@ -85,6 +85,7 @@
 LFLAGS = @LFLAGS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
+LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
 MAINT = @MAINT@
 MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
@@ -100,11 +101,12 @@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PDEXT = @PDEXT@
-PD_OBJECT_EXTERNALS = @PD_OBJECT_EXTERNALS@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 STRIP = @STRIP@
 VERSION = @VERSION@
+WANT_OBJECT_EXTERNALS_FALSE = @WANT_OBJECT_EXTERNALS_FALSE@
+WANT_OBJECT_EXTERNALS_TRUE = @WANT_OBJECT_EXTERNALS_TRUE@
 WFLAGS = @WFLAGS@
 ac_ct_CC = @ac_ct_CC@
 am__fastdepCC_FALSE = @am__fastdepCC_FALSE@

Modified: trunk/externals/moocow/pdstring/configure
===================================================================
--- trunk/externals/moocow/pdstring/configure	2009-01-27 09:19:55 UTC (rev 10660)
+++ trunk/externals/moocow/pdstring/configure	2009-01-27 21:39:35 UTC (rev 10661)
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.61 for pdstring 0.08.
+# Generated by GNU Autoconf 2.61 for pdstring 0.09.
 #
 # Report bugs to <moocow at ling.uni-potsdam.de>.
 #
@@ -574,8 +574,8 @@
 # Identity of this package.
 PACKAGE_NAME='pdstring'
 PACKAGE_TARNAME='pdstring'
-PACKAGE_VERSION='0.08'
-PACKAGE_STRING='pdstring 0.08'
+PACKAGE_VERSION='0.09'
+PACKAGE_STRING='pdstring 0.09'
 PACKAGE_BUGREPORT='moocow at ling.uni-potsdam.de'
 
 ac_default_prefix=/usr/local
@@ -653,6 +653,7 @@
 CCDEPMODE
 am__fastdepCC_TRUE
 am__fastdepCC_FALSE
+LN_S
 AFLAGS
 DFLAGS
 IFLAGS
@@ -665,7 +666,8 @@
 MAINTAINER_MODE_TRUE
 MAINTAINER_MODE_FALSE
 MAINT
-PD_OBJECT_EXTERNALS
+WANT_OBJECT_EXTERNALS_TRUE
+WANT_OBJECT_EXTERNALS_FALSE
 pddir
 pddocdir
 pdincludedir
@@ -1184,7 +1186,7 @@
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures pdstring 0.08 to adapt to many kinds of systems.
+\`configure' configures pdstring 0.09 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1250,7 +1252,7 @@
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of pdstring 0.08:";;
+     short | recursive ) echo "Configuration of pdstring 0.09:";;
    esac
   cat <<\_ACEOF
 
@@ -1346,7 +1348,7 @@
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-pdstring configure 0.08
+pdstring configure 0.09
 generated by GNU Autoconf 2.61
 
 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1360,7 +1362,7 @@
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by pdstring $as_me 0.08, which was
+It was created by pdstring $as_me 0.09, which was
 generated by GNU Autoconf 2.61.  Invocation command line was
 
   $ $0 $@
@@ -2035,7 +2037,7 @@
 
 # Define the identity of the package.
  PACKAGE=pdstring
- VERSION=0.08
+ VERSION=0.09
 
 
 cat >>confdefs.h <<_ACEOF
@@ -3359,6 +3361,16 @@
 
 test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
+{ echo "$as_me:$LINENO: checking whether ln -s works" >&5
+echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6; }
+LN_S=$as_ln_s
+if test "$LN_S" = "ln -s"; then
+  { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no, using $LN_S" >&5
+echo "${ECHO_T}no, using $LN_S" >&6; }
+fi
 
 
 
@@ -3376,6 +3388,7 @@
 
 
 
+
 { echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5
 echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6; }
     # Check whether --enable-maintainer-mode was given.
@@ -3571,10 +3584,7 @@
     ;;
 esac
 
-##------- PD externals: hack EXEEXT?
-PD_LIB_EXTERNALS="pdstring"
-PD_OBJ_EXTERNALS="any2bytes bytes2any bytes2wchars wchars2bytes"
-
+##------- Enable single-object externals?
 # Check whether --enable-object-externals was given.
 if test "${enable_object_externals+set}" = set; then
   enableval=$enable_object_externals; want_objext="$enableval"
@@ -3585,30 +3595,35 @@
 { echo "$as_me:$LINENO: checking whether to build single-object externals" >&5
 echo $ECHO_N "checking whether to build single-object externals... $ECHO_C" >&6; }
 
-##-- always build lib
-PD_OBJECT_EXTERNALS="pdstring${buildext}"
-
 if test "$want_objext" != "no" ; then
   ##-- single-objects
   { echo "$as_me:$LINENO: result: yes" >&5
 echo "${ECHO_T}yes" >&6; }
-  for ext in $PD_OBJ_EXTERNALS ; do
-    PD_OBJECT_EXTERNALS="$PD_OBJECT_EXTERNALS ${ext}${buildext}"
-  done
 
 cat >>confdefs.h <<\_ACEOF
 #define PDSTRING_OBJECT_EXTERNALS 1
 _ACEOF
 
 else
-  ##-- libs
+  ##-- lib only
   { echo "$as_me:$LINENO: result: no" >&5
 echo "${ECHO_T}no" >&6; }
 fi
 
+##-- add automake conditional for object externals
 
 
+if test "$want_objext" != "no"; then
+  WANT_OBJECT_EXTERNALS_TRUE=
+  WANT_OBJECT_EXTERNALS_FALSE='#'
+else
+  WANT_OBJECT_EXTERNALS_TRUE='#'
+  WANT_OBJECT_EXTERNALS_FALSE=
+fi
 
+
+
+
 # Check whether --with-pd-dir was given.
 if test "${with_pd_dir+set}" = set; then
   withval=$with_pd_dir; pddir="$withval"
@@ -3732,6 +3747,10 @@
 fi
 
 
+if test "$GCC" = "yes"; then
+   WFLAGS="-Wall -Winline -W -Wno-unused"
+fi
+
 ##vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
 ## compiled
 
@@ -3747,6 +3766,8 @@
 ## /compiled
 ##^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
+
+
 ##vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
 ## BEGIN machine-dependent variables
 
@@ -3935,6 +3956,13 @@
 Usually this means the macro was only invoked conditionally." >&2;}
    { (exit 1); exit 1; }; }
 fi
+if test -z "${WANT_OBJECT_EXTERNALS_TRUE}" && test -z "${WANT_OBJECT_EXTERNALS_FALSE}"; then
+  { { echo "$as_me:$LINENO: error: conditional \"WANT_OBJECT_EXTERNALS\" was never defined.
+Usually this means the macro was only invoked conditionally." >&5
+echo "$as_me: error: conditional \"WANT_OBJECT_EXTERNALS\" was never defined.
+Usually this means the macro was only invoked conditionally." >&2;}
+   { (exit 1); exit 1; }; }
+fi
 
 : ${CONFIG_STATUS=./config.status}
 ac_clean_files_save=$ac_clean_files
@@ -4235,7 +4263,7 @@
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by pdstring $as_me 0.08, which was
+This file was extended by pdstring $as_me 0.09, which was
 generated by GNU Autoconf 2.61.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -4288,7 +4316,7 @@
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF
 ac_cs_version="\\
-pdstring config.status 0.08
+pdstring config.status 0.09
 configured by $0, generated by GNU Autoconf 2.61,
   with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
 
@@ -4542,6 +4570,7 @@
 CCDEPMODE!$CCDEPMODE$ac_delim
 am__fastdepCC_TRUE!$am__fastdepCC_TRUE$ac_delim
 am__fastdepCC_FALSE!$am__fastdepCC_FALSE$ac_delim
+LN_S!$LN_S$ac_delim
 AFLAGS!$AFLAGS$ac_delim
 DFLAGS!$DFLAGS$ac_delim
 IFLAGS!$IFLAGS$ac_delim
@@ -4554,7 +4583,8 @@
 MAINTAINER_MODE_TRUE!$MAINTAINER_MODE_TRUE$ac_delim
 MAINTAINER_MODE_FALSE!$MAINTAINER_MODE_FALSE$ac_delim
 MAINT!$MAINT$ac_delim
-PD_OBJECT_EXTERNALS!$PD_OBJECT_EXTERNALS$ac_delim
+WANT_OBJECT_EXTERNALS_TRUE!$WANT_OBJECT_EXTERNALS_TRUE$ac_delim
+WANT_OBJECT_EXTERNALS_FALSE!$WANT_OBJECT_EXTERNALS_FALSE$ac_delim
 pddir!$pddir$ac_delim
 pddocdir!$pddocdir$ac_delim
 pdincludedir!$pdincludedir$ac_delim
@@ -4564,7 +4594,7 @@
 LTLIBOBJS!$LTLIBOBJS$ac_delim
 _ACEOF
 
-  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 94; then
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 96; then
     break
   elif $ac_last_try; then
     { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
@@ -4583,7 +4613,7 @@
 
 cat >>$CONFIG_STATUS <<_ACEOF
 cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof
-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
 _ACEOF
 sed '
 s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
@@ -4596,8 +4626,6 @@
 ' >>$CONFIG_STATUS <conf$$subs.sed
 rm -f conf$$subs.sed
 cat >>$CONFIG_STATUS <<_ACEOF
-:end
-s/|#_!!_#|//g
 CEOF$ac_eof
 _ACEOF
 
@@ -4845,7 +4873,7 @@
 s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
 s&@INSTALL@&$ac_INSTALL&;t t
 $ac_datarootdir_hack
-" $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out
+" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed 's/|#_!!_#|//g' >$tmp/out
 
 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
   { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&

Modified: trunk/externals/moocow/pdstring/configure.ac
===================================================================
--- trunk/externals/moocow/pdstring/configure.ac	2009-01-27 09:19:55 UTC (rev 10660)
+++ trunk/externals/moocow/pdstring/configure.ac	2009-01-27 21:39:35 UTC (rev 10661)
@@ -4,7 +4,7 @@
 
 dnl Some handy macros
 define([THE_PACKAGE_NAME],    [pdstring])
-define([THE_PACKAGE_VERSION], [0.08])
+define([THE_PACKAGE_VERSION], [0.09])
 define([THE_PACKAGE_AUTHOR],  [moocow at ling.uni-potsdam.de])
 
 AC_INIT(THE_PACKAGE_NAME, THE_PACKAGE_VERSION, THE_PACKAGE_AUTHOR)
@@ -36,6 +36,7 @@
 dnl
 AC_PROG_CC
 AC_PROG_INSTALL
+AC_PROG_LN_S
 AC_PREFIX_DEFAULT(/usr/local)
 
 dnl
@@ -96,34 +97,27 @@
     ;;
 esac
 
-##------- PD externals: hack EXEEXT?
-PD_LIB_EXTERNALS="pdstring"
-PD_OBJ_EXTERNALS="any2bytes bytes2any bytes2wchars wchars2bytes"
-
+##------- Enable single-object externals?
 AC_ARG_ENABLE(object-externals,
 	AC_HELP_STRING([--enable-object-externals], [Whether to build single-object externals (default=no)]),
 	[want_objext="$enableval"],
 	[want_objext="no"])
 AC_MSG_CHECKING([whether to build single-object externals])
 
-##-- always build lib
-PD_OBJECT_EXTERNALS="pdstring${buildext}"
-
 if test "$want_objext" != "no" ; then
   ##-- single-objects
   AC_MSG_RESULT(yes)
-  for ext in $PD_OBJ_EXTERNALS ; do
-    PD_OBJECT_EXTERNALS="$PD_OBJECT_EXTERNALS ${ext}${buildext}"
-  done
   AC_DEFINE(PDSTRING_OBJECT_EXTERNALS,1,
      [Define this if you are building single-object externals])
 else
-  ##-- libs
+  ##-- lib only
   AC_MSG_RESULT(no)
 fi
-AC_SUBST(PD_OBJECT_EXTERNALS)
 
+##-- add automake conditional for object externals
+AM_CONDITIONAL(WANT_OBJECT_EXTERNALS, [test "$want_objext" != "no"])
 
+
 dnl
 dnl pd-directory/ies
 dnl 
@@ -182,6 +176,10 @@
 fi
 AC_SUBST(DEBUG)
 
+if test "$GCC" = "yes"; then
+   WFLAGS="-Wall -Winline -W -Wno-unused"
+fi
+
 ##vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
 ## compiled
 AC_DEFINE_UNQUOTED(PDSTRING_DATE,  "`date`",         [Date this external was configured])
@@ -189,6 +187,8 @@
 ## /compiled
 ##^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
 
+
+
 ##vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
 ## BEGIN machine-dependent variables
 

Modified: trunk/externals/moocow/pdstring/src/Makefile.am
===================================================================
--- trunk/externals/moocow/pdstring/src/Makefile.am	2009-01-27 09:19:55 UTC (rev 10660)
+++ trunk/externals/moocow/pdstring/src/Makefile.am	2009-01-27 21:39:35 UTC (rev 10661)
@@ -27,7 +27,16 @@
 #-----------------------------------------------------------------------
 
 ## --- externals
-pdexterns_PROGRAMS = @PD_OBJECT_EXTERNALS@
+pdexterns_PROGRAMS = pdstring
+if WANT_OBJECT_EXTERNALS
+ pdexterns_PROGRAMS += \
+	any2bytes \
+	bytes2any \
+	bytes2wchars \
+	wchars2bytes \
+	printbytes \
+	printwchars
+endif
 
 ## --- possible externals
 EXTRA_PROGRAMS = \
@@ -35,7 +44,9 @@
 	any2bytes \
 	bytes2any \
 	bytes2wchars \
-	wchars2bytes
+	wchars2bytes \
+	printbytes \
+	printwchars
 
 ## --- patches
 pdexterns_DATA = \
@@ -52,24 +63,54 @@
 	any2wchars-help.pd \
 	wchars2any-help.pd
 
+	printbytes-help.pd 
+	printwchars-help.pd
 
+
 #-----------------------------------------------------------------------
 # sources
 #-----------------------------------------------------------------------
 
-any2bytes_SOURCES = any2bytes.c mooPdUtils.h pdstringUtils.h
+any2bytes_SOURCES = any2bytes.c mooPdUtils.h pdstringUtils.h pdstringUtils.c
 
-bytes2any_SOURCES = bytes2any.c mooPdUtils.h pdstringUtils.h
+bytes2any_SOURCES = bytes2any.c mooPdUtils.h pdstringUtils.h pdstringUtils.c
 
-bytes2wchars_SOURCES = bytes2wchars.c mooPdUtils.h pdstringUtils.h
+bytes2wchars_SOURCES = bytes2wchars.c mooPdUtils.h pdstringUtils.h pdstringUtils.c
 
-wchars2bytes_SOURCES = wchars2bytes.c mooPdUtils.h pdstringUtils.h
+wchars2bytes_SOURCES = wchars2bytes.c mooPdUtils.h pdstringUtils.h pdstringUtils.c
 
-pdstring_SOURCES = pdstring.c mooPdUtils.h pdstringUtils.h
+printbytes_SOURCES = printbytes.c mooPdUtils.h pdstringUtils.h pdstringUtils.c
 
-pdstring.$(OBJECT): $(any2bytes_SOURCES) $(bytes2any_SOURCES) $(bytes2wchars_SOURCES) $(wchars2bytes_SOURCES)
+printwchars_SOURCES = printwchars.c mooPdUtils.h pdstringUtils.h pdstringUtils.c
 
+pdstring_SOURCES = pdstring.c mooPdUtils.h pdstringUtils.h pdstringUtils.c
+
 #-----------------------------------------------------------------------
+# aliases via install hook
+#-----------------------------------------------------------------------
+
+if WANT_OBJECT_EXTERNALS
+all-local:
+	rm -f any2string.$(PDEXT)
+	rm -f string2any.$(PDEXT)
+	$(LN_S) any2bytes.$(PDEXT) any2string.$(PDEXT)
+	$(LN_S) bytes2any.$(PDEXT) string2any.$(PDEXT)
+endif
+
+install-data-hook:
+	rm -f $(pdexternsdir)/any2string.$(PDEXT)
+	rm -f $(pdexternsdir)/string2any.$(PDEXT)
+if WANT_OBJECT_EXTERNALS
+	$(LN_S) any2bytes.$(PDEXT) $(pdexternsdir)/any2string.$(PDEXT)
+	$(LN_S) bytes2any.$(PDEXT) $(pdexternsdir)/string2any.$(PDEXT)
+endif
+
+uninstall-local:
+	rm -f $(pdexternsdir)/any2string.$(PDEXT)
+	rm -f $(pdexternsdir)/string2any.$(PDEXT)
+
+
+#-----------------------------------------------------------------------
 # external compilation : flags
 #-----------------------------------------------------------------------
 DEFS    = @DEFS@
@@ -78,7 +119,7 @@
 IFLAGS  = @IFLAGS@
 LFLAGS  = @LFLAGS@
 OFLAGS  = @OFLAGS@
-WFLAGS  = -Wall -Winline
+WFLAGS  = @WFLAGS@
 
 #GLIB_IFLAGS = @GLIB_IFLAGS@
 #GLIB_LFLAGS = @GLIB_LFLAGS@
@@ -86,16 +127,12 @@
 AM_CPPFLAGS = $(IFLAGS) $(GLIB_IFLAGS) $(DFLAGS)
 AM_CFLAGS   = $(OFLAGS) $(WFLAGS) $(AFLAGS)
 
-pdstring_LDFLAGS = $(LFLAGS)
+AM_LDFLAGS ?= $(LFLAGS)
 
-bytes2any_LDFLAGS = $(LFLAGS)
+#pdstring_LDFLAGS = $(LFLAGS)
+#bytes2any_LDFLAGS = $(LFLAGS)
+##string2any_LDFLAGS = $(bytes2any_LDFLAGS)
 
-any2bytes_LDFLAGS = $(LFLAGS)
-
-bytes2wchars_LDFLAGS = $(LFLAGS)
-
-wchars2bytes_LDFLAGS = $(LFLAGS)
-
 #-----------------------------------------------------------------------
 # Variables: cleanup
 #-----------------------------------------------------------------------

Modified: trunk/externals/moocow/pdstring/src/Makefile.in
===================================================================
--- trunk/externals/moocow/pdstring/src/Makefile.in	2009-01-27 09:19:55 UTC (rev 10660)
+++ trunk/externals/moocow/pdstring/src/Makefile.in	2009-01-27 21:39:35 UTC (rev 10661)
@@ -49,9 +49,18 @@
 NORMAL_UNINSTALL = :
 PRE_UNINSTALL = :
 POST_UNINSTALL = :
-pdexterns_PROGRAMS = @PD_OBJECT_EXTERNALS@
+pdexterns_PROGRAMS = pdstring$(EXEEXT) $(am__EXEEXT_1)
+ at WANT_OBJECT_EXTERNALS_TRUE@am__append_1 = \
+ at WANT_OBJECT_EXTERNALS_TRUE@	any2bytes \
+ at WANT_OBJECT_EXTERNALS_TRUE@	bytes2any \
+ at WANT_OBJECT_EXTERNALS_TRUE@	bytes2wchars \
+ at WANT_OBJECT_EXTERNALS_TRUE@	wchars2bytes \
+ at WANT_OBJECT_EXTERNALS_TRUE@	printbytes \
+ at WANT_OBJECT_EXTERNALS_TRUE@	printwchars
+
 EXTRA_PROGRAMS = pdstring$(EXEEXT) any2bytes$(EXEEXT) \
-	bytes2any$(EXEEXT) bytes2wchars$(EXEEXT) wchars2bytes$(EXEEXT)
+	bytes2any$(EXEEXT) bytes2wchars$(EXEEXT) wchars2bytes$(EXEEXT) \
+	printbytes$(EXEEXT) printwchars$(EXEEXT)
 subdir = src
 SUBDIRS =
 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
@@ -63,23 +72,37 @@
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = config.h
 CONFIG_CLEAN_FILES =
+ at WANT_OBJECT_EXTERNALS_TRUE@am__EXEEXT_1 = any2bytes$(EXEEXT) \
+ at WANT_OBJECT_EXTERNALS_TRUE@	bytes2any$(EXEEXT) \
+ at WANT_OBJECT_EXTERNALS_TRUE@	bytes2wchars$(EXEEXT) \
+ at WANT_OBJECT_EXTERNALS_TRUE@	wchars2bytes$(EXEEXT) \
+ at WANT_OBJECT_EXTERNALS_TRUE@	printbytes$(EXEEXT) \
+ at WANT_OBJECT_EXTERNALS_TRUE@	printwchars$(EXEEXT)
 am__installdirs = "$(DESTDIR)$(pdexternsdir)" "$(DESTDIR)$(pddocdir)" \
 	"$(DESTDIR)$(pdexternsdir)"
 pdexternsPROGRAMS_INSTALL = $(INSTALL_PROGRAM)
 PROGRAMS = $(pdexterns_PROGRAMS)
-am_any2bytes_OBJECTS = any2bytes.$(OBJEXT)
+am_any2bytes_OBJECTS = any2bytes.$(OBJEXT) pdstringUtils.$(OBJEXT)
 any2bytes_OBJECTS = $(am_any2bytes_OBJECTS)
 any2bytes_LDADD = $(LDADD)
-am_bytes2any_OBJECTS = bytes2any.$(OBJEXT)
+am_bytes2any_OBJECTS = bytes2any.$(OBJEXT) pdstringUtils.$(OBJEXT)
 bytes2any_OBJECTS = $(am_bytes2any_OBJECTS)
 bytes2any_LDADD = $(LDADD)
-am_bytes2wchars_OBJECTS = bytes2wchars.$(OBJEXT)
+am_bytes2wchars_OBJECTS = bytes2wchars.$(OBJEXT) \
+	pdstringUtils.$(OBJEXT)
 bytes2wchars_OBJECTS = $(am_bytes2wchars_OBJECTS)
 bytes2wchars_LDADD = $(LDADD)
-am_pdstring_OBJECTS = pdstring.$(OBJEXT)
+am_pdstring_OBJECTS = pdstring.$(OBJEXT) pdstringUtils.$(OBJEXT)
 pdstring_OBJECTS = $(am_pdstring_OBJECTS)
 pdstring_LDADD = $(LDADD)
-am_wchars2bytes_OBJECTS = wchars2bytes.$(OBJEXT)
+am_printbytes_OBJECTS = printbytes.$(OBJEXT) pdstringUtils.$(OBJEXT)
+printbytes_OBJECTS = $(am_printbytes_OBJECTS)
+printbytes_LDADD = $(LDADD)
+am_printwchars_OBJECTS = printwchars.$(OBJEXT) pdstringUtils.$(OBJEXT)
+printwchars_OBJECTS = $(am_printwchars_OBJECTS)
+printwchars_LDADD = $(LDADD)
+am_wchars2bytes_OBJECTS = wchars2bytes.$(OBJEXT) \
+	pdstringUtils.$(OBJEXT)
 wchars2bytes_OBJECTS = $(am_wchars2bytes_OBJECTS)
 wchars2bytes_LDADD = $(LDADD)
 DEFAULT_INCLUDES = -I. -I$(srcdir) -I.
@@ -91,9 +114,11 @@
 LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
 SOURCES = $(any2bytes_SOURCES) $(bytes2any_SOURCES) \
 	$(bytes2wchars_SOURCES) $(pdstring_SOURCES) \
+	$(printbytes_SOURCES) $(printwchars_SOURCES) \
 	$(wchars2bytes_SOURCES)
 DIST_SOURCES = $(any2bytes_SOURCES) $(bytes2any_SOURCES) \
 	$(bytes2wchars_SOURCES) $(pdstring_SOURCES) \
+	$(printbytes_SOURCES) $(printwchars_SOURCES) \
 	$(wchars2bytes_SOURCES)
 RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
 	html-recursive info-recursive install-data-recursive \
@@ -150,6 +175,7 @@
 LFLAGS = @LFLAGS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
+LN_S = @LN_S@
 LTLIBOBJS = @LTLIBOBJS@
 MAINT = @MAINT@
 MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
@@ -169,12 +195,13 @@
 # Flags and variables
 #-----------------------------------------------------------------------
 PDEXT = @PDEXT@
-PD_OBJECT_EXTERNALS = @PD_OBJECT_EXTERNALS@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
 STRIP = @STRIP@
 VERSION = @VERSION@
-WFLAGS = -Wall -Winline
+WANT_OBJECT_EXTERNALS_FALSE = @WANT_OBJECT_EXTERNALS_FALSE@
+WANT_OBJECT_EXTERNALS_TRUE = @WANT_OBJECT_EXTERNALS_TRUE@
+WFLAGS = @WFLAGS@
 ac_ct_CC = @ac_ct_CC@
 am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
 am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
@@ -232,22 +259,22 @@
 #-----------------------------------------------------------------------
 # sources
 #-----------------------------------------------------------------------
-any2bytes_SOURCES = any2bytes.c mooPdUtils.h pdstringUtils.h
-bytes2any_SOURCES = bytes2any.c mooPdUtils.h pdstringUtils.h
-bytes2wchars_SOURCES = bytes2wchars.c mooPdUtils.h pdstringUtils.h
-wchars2bytes_SOURCES = wchars2bytes.c mooPdUtils.h pdstringUtils.h
-pdstring_SOURCES = pdstring.c mooPdUtils.h pdstringUtils.h
+any2bytes_SOURCES = any2bytes.c mooPdUtils.h pdstringUtils.h pdstringUtils.c
+bytes2any_SOURCES = bytes2any.c mooPdUtils.h pdstringUtils.h pdstringUtils.c
+bytes2wchars_SOURCES = bytes2wchars.c mooPdUtils.h pdstringUtils.h pdstringUtils.c
+wchars2bytes_SOURCES = wchars2bytes.c mooPdUtils.h pdstringUtils.h pdstringUtils.c
+printbytes_SOURCES = printbytes.c mooPdUtils.h pdstringUtils.h pdstringUtils.c
+printwchars_SOURCES = printwchars.c mooPdUtils.h pdstringUtils.h pdstringUtils.c
+pdstring_SOURCES = pdstring.c mooPdUtils.h pdstringUtils.h pdstringUtils.c
 
 #GLIB_IFLAGS = @GLIB_IFLAGS@
 #GLIB_LFLAGS = @GLIB_LFLAGS@
 AM_CPPFLAGS = $(IFLAGS) $(GLIB_IFLAGS) $(DFLAGS)
 AM_CFLAGS = $(OFLAGS) $(WFLAGS) $(AFLAGS)
-pdstring_LDFLAGS = $(LFLAGS)
-bytes2any_LDFLAGS = $(LFLAGS)
-any2bytes_LDFLAGS = $(LFLAGS)
-bytes2wchars_LDFLAGS = $(LFLAGS)
-wchars2bytes_LDFLAGS = $(LFLAGS)
 
+#pdstring_LDFLAGS = $(LFLAGS)
+#bytes2any_LDFLAGS = $(LFLAGS)
+
 #-----------------------------------------------------------------------
 # Variables: cleanup
 #-----------------------------------------------------------------------
@@ -366,6 +393,12 @@
 pdstring$(EXEEXT): $(pdstring_OBJECTS) $(pdstring_DEPENDENCIES) 
 	@rm -f pdstring$(EXEEXT)
 	$(LINK) $(pdstring_LDFLAGS) $(pdstring_OBJECTS) $(pdstring_LDADD) $(LIBS)
+printbytes$(EXEEXT): $(printbytes_OBJECTS) $(printbytes_DEPENDENCIES) 
+	@rm -f printbytes$(EXEEXT)
+	$(LINK) $(printbytes_LDFLAGS) $(printbytes_OBJECTS) $(printbytes_LDADD) $(LIBS)
+printwchars$(EXEEXT): $(printwchars_OBJECTS) $(printwchars_DEPENDENCIES) 
+	@rm -f printwchars$(EXEEXT)
+	$(LINK) $(printwchars_LDFLAGS) $(printwchars_OBJECTS) $(printwchars_LDADD) $(LIBS)
 wchars2bytes$(EXEEXT): $(wchars2bytes_OBJECTS) $(wchars2bytes_DEPENDENCIES) 
 	@rm -f wchars2bytes$(EXEEXT)
 	$(LINK) $(wchars2bytes_LDFLAGS) $(wchars2bytes_OBJECTS) $(wchars2bytes_LDADD) $(LIBS)
@@ -380,6 +413,9 @@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/bytes2any.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/bytes2wchars.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pdstring.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pdstringUtils.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/printbytes.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/printwchars.Po at am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/wchars2bytes.Po at am__quote@
 
 .c.o:
@@ -607,7 +643,8 @@
 	done
 check-am: all-am
 check: check-recursive
-all-am: Makefile $(PROGRAMS) $(DATA) config.h
+ at WANT_OBJECT_EXTERNALS_FALSE@all-local:
+all-am: Makefile $(PROGRAMS) $(DATA) config.h all-local
 installdirs: installdirs-recursive
 installdirs-am:
 	for dir in "$(DESTDIR)$(pdexternsdir)" "$(DESTDIR)$(pddocdir)" "$(DESTDIR)$(pdexternsdir)"; do \
@@ -662,6 +699,8 @@
 
 install-data-am: install-pddocDATA install-pdexternsDATA \
 	install-pdexternsPROGRAMS
+	@$(NORMAL_INSTALL)
+	$(MAKE) $(AM_MAKEFLAGS) install-data-hook
 
 install-exec-am:
 
@@ -689,31 +728,54 @@
 
 ps-am:
 
-uninstall-am: uninstall-info-am uninstall-pddocDATA \
+uninstall-am: uninstall-info-am uninstall-local uninstall-pddocDATA \
 	uninstall-pdexternsDATA uninstall-pdexternsPROGRAMS
 
 uninstall-info: uninstall-info-recursive
 
-.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am check check-am \
-	clean clean-generic clean-pdexternsPROGRAMS clean-recursive \
-	ctags ctags-recursive distclean distclean-compile \
-	distclean-generic distclean-hdr distclean-recursive \
-	distclean-tags distdir dvi dvi-am html html-am info info-am \
-	install install-am install-data install-data-am install-exec \
-	install-exec-am install-info install-info-am install-man \
-	install-pddocDATA install-pdexternsDATA \
-	install-pdexternsPROGRAMS install-strip installcheck \
-	installcheck-am installdirs installdirs-am maintainer-clean \
-	maintainer-clean-generic maintainer-clean-local \
-	maintainer-clean-recursive mostlyclean mostlyclean-compile \
-	mostlyclean-generic mostlyclean-recursive pdf pdf-am ps ps-am \
-	tags tags-recursive uninstall uninstall-am uninstall-info-am \
-	uninstall-pddocDATA uninstall-pdexternsDATA \
-	uninstall-pdexternsPROGRAMS
+.PHONY: $(RECURSIVE_TARGETS) CTAGS GTAGS all all-am all-local check \
+	check-am clean clean-generic clean-pdexternsPROGRAMS \
+	clean-recursive ctags ctags-recursive distclean \
+	distclean-compile distclean-generic distclean-hdr \
+	distclean-recursive distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-data-hook install-exec install-exec-am \
+	install-info install-info-am install-man install-pddocDATA \
+	install-pdexternsDATA install-pdexternsPROGRAMS install-strip \
+	installcheck installcheck-am installdirs installdirs-am \
+	maintainer-clean maintainer-clean-generic \
+	maintainer-clean-local maintainer-clean-recursive mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-recursive \
+	pdf pdf-am ps ps-am tags tags-recursive uninstall uninstall-am \
+	uninstall-info-am uninstall-local uninstall-pddocDATA \
+	uninstall-pdexternsDATA uninstall-pdexternsPROGRAMS
 
 
-pdstring.$(OBJECT): $(any2bytes_SOURCES) $(bytes2any_SOURCES) $(bytes2wchars_SOURCES) $(wchars2bytes_SOURCES)
+	printbytes-help.pd 
+	printwchars-help.pd
 
+#-----------------------------------------------------------------------
+# aliases via install hook
+#-----------------------------------------------------------------------
+
+ at WANT_OBJECT_EXTERNALS_TRUE@all-local:
+ at WANT_OBJECT_EXTERNALS_TRUE@	rm -f any2string.$(PDEXT)
+ at WANT_OBJECT_EXTERNALS_TRUE@	rm -f string2any.$(PDEXT)
+ at WANT_OBJECT_EXTERNALS_TRUE@	$(LN_S) any2bytes.$(PDEXT) any2string.$(PDEXT)
+ at WANT_OBJECT_EXTERNALS_TRUE@	$(LN_S) bytes2any.$(PDEXT) string2any.$(PDEXT)
+
+install-data-hook:
+	rm -f $(pdexternsdir)/any2string.$(PDEXT)
+	rm -f $(pdexternsdir)/string2any.$(PDEXT)
+ at WANT_OBJECT_EXTERNALS_TRUE@	$(LN_S) any2bytes.$(PDEXT) $(pdexternsdir)/any2string.$(PDEXT)
+ at WANT_OBJECT_EXTERNALS_TRUE@	$(LN_S) bytes2any.$(PDEXT) $(pdexternsdir)/string2any.$(PDEXT)
+
+uninstall-local:
+	rm -f $(pdexternsdir)/any2string.$(PDEXT)
+	rm -f $(pdexternsdir)/string2any.$(PDEXT)
+
+AM_LDFLAGS ?= $(LFLAGS)
+
 maintainer-clean-local:
 	rm -rf autom4te.cache
 

Modified: trunk/externals/moocow/pdstring/src/any2bytes.c
===================================================================
--- trunk/externals/moocow/pdstring/src/any2bytes.c	2009-01-27 09:19:55 UTC (rev 10660)
+++ trunk/externals/moocow/pdstring/src/any2bytes.c	2009-01-27 21:39:35 UTC (rev 10661)
@@ -71,6 +71,8 @@
 } t_any2bytes;
 
 
+static int ANY2BYTES_INITIALIZED = 0;
+
 /*=====================================================================
  * Constants
  *=====================================================================*/
@@ -151,14 +153,16 @@
  */
 void any2bytes_setup_guts(void)
 {
+  if (ANY2BYTES_INITIALIZED) return;
+
   //-- class
   any2bytes_class = class_new(gensym("any2bytes"),
-			       (t_newmethod)any2bytes_new,
-			       (t_method)any2bytes_free,
-			       sizeof(t_any2bytes),
-			       CLASS_DEFAULT,
-			       A_GIMME,                   //-- initial_bufsize, eos_char
-			       0);
+			      (t_newmethod)any2bytes_new,
+			      (t_method)any2bytes_free,
+			      sizeof(t_any2bytes),
+			      CLASS_DEFAULT,
+			      A_GIMME,                   //-- initial_bufsize, eos_char
+			      0);
 
   //-- alias
   class_addcreator((t_newmethod)any2bytes_new, gensym("any2string"), A_GIMME, 0);
@@ -168,6 +172,9 @@
   
   //-- help symbol
   //class_sethelpsymbol(any2bytes_class, gensym("any2bytes-help.pd")); //-- breaks pd-extended help lookup
+
+  //-- set flag
+  ANY2BYTES_INITIALIZED = 1;
 }
 
 
@@ -179,3 +186,12 @@
   post(any2bytes_banner);
   any2bytes_setup_guts();
 }
+
+/*--------------------------------------------------------------------
+ * setup (any2string alias)
+ */
+void any2string_setup(void) {
+  post("any2string_setup(): WARNING: names are in flux!");
+  post("any2string_setup(): Prefer [any2bytes] over [any2string].");
+  any2bytes_setup();
+}

Modified: trunk/externals/moocow/pdstring/src/bytes2any.c
===================================================================
--- trunk/externals/moocow/pdstring/src/bytes2any.c	2009-01-27 09:19:55 UTC (rev 10660)
+++ trunk/externals/moocow/pdstring/src/bytes2any.c	2009-01-27 21:39:35 UTC (rev 10661)
@@ -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 @@
  */
 void bytes2any_setup_guts(void)
 {
+  if (BYTES2ANY_INITIALIZED) return;
+
   //-- class
   bytes2any_class = class_new(gensym("bytes2any"),
 			       (t_newmethod)bytes2any_new,
@@ -206,14 +210,16 @@
 			       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 @@
   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();
+}

Modified: trunk/externals/moocow/pdstring/src/pdstring-help.pd
===================================================================
--- trunk/externals/moocow/pdstring/src/pdstring-help.pd	2009-01-27 09:19:55 UTC (rev 10660)
+++ trunk/externals/moocow/pdstring/src/pdstring-help.pd	2009-01-27 21:39:35 UTC (rev 10661)
@@ -1,20 +1,20 @@
-#N canvas 163 18 501 441 10;
-#X text 196 400 Bryan Jurish <moocow at ling.uni-potsdam.de>;
+#N canvas 193 20 501 441 10;
+#X text 199 414 Bryan Jurish <moocow at ling.uni-potsdam.de>;
 #X text 54 3 [pdstring] library : byte and wide-character strings;
 #X obj 51 76 bytes2any;
 #X obj 51 52 any2bytes;
 #X text 148 77 convert byte strings to pd messages;
 #X text 148 53 convert pd messages to byte strings;
-#X obj 45 142 bytes2wchars;
-#X text 147 143 convert byte strings to wide character strings;
-#X obj 45 168 wchars2bytes;
-#X text 148 169 convert wide character strings to byte strings;
-#X text 22 121 BYTES <-> WIDE CHARACTERS;
+#X obj 43 154 bytes2wchars;
+#X text 145 155 convert byte strings to wide character strings;
+#X obj 43 180 wchars2bytes;
+#X text 146 181 convert wide character strings to byte strings;
+#X text 20 133 BYTES <-> WIDE CHARACTERS;
 #X text 26 33 BYTES <-> PD MESSAGES;
-#X text 20 211 WIDE CHARACTERS <-> PD MESSAGES;
-#X text 145 233 convert pd messages to wide character strings;
-#X text 146 259 convert wide character strings to pd messages;
-#X text 18 369 SEE ALSO:;
+#X text 18 233 WIDE CHARACTERS <-> PD MESSAGES;
+#X text 143 255 convert pd messages to wide character strings;
+#X text 144 281 convert wide character strings to pd messages;
+#X text 21 383 SEE ALSO:;
 #N canvas 0 0 584 308 pdstring-bytes 0;
 #X floatatom 56 81 8 0 0 0 - - -;
 #X symbolatom 46 59 10 0 0 0 - - -;
@@ -71,7 +71,7 @@
 #X connect 11 0 10 0;
 #X connect 11 0 13 0;
 #X connect 13 0 12 0;
-#X restore 87 368 pd pdstring-bytes;
+#X restore 90 382 pd pdstring-bytes;
 #N canvas 0 0 584 308 pdstring-wchars 0;
 #X floatatom 56 81 8 0 0 0 - - -;
 #X symbolatom 46 59 10 0 0 0 - - -;
@@ -94,10 +94,14 @@
 #X connect 11 0 10 0;
 #X connect 11 0 12 0;
 #X connect 12 0 8 0;
-#X restore 217 368 pd pdstring-wchars;
-#X obj 43 232 any2wchars;
-#X obj 43 258 wchars2any;
-#X obj 355 368 locale;
-#X text 18 303 NOTE:;
-#X text 26 319 Wide character support requires locale support to be
+#X restore 220 382 pd pdstring-wchars;
+#X obj 41 254 any2wchars;
+#X obj 41 280 wchars2any;
+#X obj 356 382 locale;
+#X text 21 317 NOTE:;
+#X text 29 333 Wide character support requires locale support to be
 enabled \, e.g. by the [locale] external.;
+#X obj 51 100 printbytes;
+#X obj 43 203 printwchars;
+#X text 148 203 print wide character strings to pd console;
+#X text 149 100 print byte strings to pd console;

Modified: trunk/externals/moocow/pdstring/src/pdstring.c
===================================================================
--- trunk/externals/moocow/pdstring/src/pdstring.c	2009-01-27 09:19:55 UTC (rev 10660)
+++ trunk/externals/moocow/pdstring/src/pdstring.c	2009-01-27 21:39:35 UTC (rev 10661)
@@ -61,6 +61,9 @@
 # include "bytes2wchars.c"
 # include "wchars2bytes.c"
 
+# include "printbytes.c"
+# include "printwchars.c"
+
 //# include "bytes2array.c"
 //# include "array2bytes.c"
 #endif
@@ -94,10 +97,14 @@
 #ifndef PDSTRING_OBJECT_EXTERNALS
   any2bytes_setup_guts();
   bytes2any_setup_guts();
+
   bytes2wchars_setup_guts();
   wchars2bytes_setup_guts();
+
   //bytes2array_setup_guts();
   //array2bytes_setup_guts();
+  printbytes_setup_guts();
+  printwchars_setup_guts();
 #endif
 
   pdstring_class = class_new(gensym("pdstring"),

Added: trunk/externals/moocow/pdstring/src/pdstringUtils.c
===================================================================
--- trunk/externals/moocow/pdstring/src/pdstringUtils.c	                        (rev 0)
+++ trunk/externals/moocow/pdstring/src/pdstringUtils.c	2009-01-27 21:39:35 UTC (rev 10661)
@@ -0,0 +1,450 @@
+/* -*- Mode: C -*- */
+/*=============================================================================*\
+ * File: pdstringUtils.c
+ * Author: Bryan Jurish <moocow at ling.uni-potsdam.de>
+ * Description: pdstring: common utilities
+ *
+ * Copyright (c) 2009 Bryan Jurish.
+ *
+ * For information on usage and redistribution, and for a DISCLAIMER OF ALL
+ * WARRANTIES, see the file "COPYING", in this distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ *=============================================================================*/
+
+#ifndef PDSTRING_UTILS_C
+#define PDSTRING_UTILS_C
+
+#include <string.h>
+#include <m_pd.h>
+#include <stdlib.h>
+#include "mooPdUtils.h"
+#include "pdstringUtils.h"
+
+/*=====================================================================
+ * Debugging
+ *=====================================================================*/
+#define PDSTRING_UTILS_DEBUG 1
+//#undef  PDSTRING_UTILS_DEBUG
+
+#ifdef PDSTRING_UTILS_DEBUG
+# define PDSDEBUG(x) x
+#else
+# define PDSDEBUG(x)
+#endif
+
+/*=====================================================================
+ * Constants : see header
+ *=====================================================================*/
+
+/*=====================================================================
+ * Structures & Types : see header
+ *=====================================================================*/
+
+/*=====================================================================
+ * Initialization
+ *=====================================================================*/
+
+/*---------------------------------------------------------------------
+ * bytes
+ */
+PDSTRING_STATIC void pdstring_bytes_clear(t_pdstring_bytes *b)
+{
+  if (b->b_alloc) freebytes(b->b_buf, (b->b_alloc)*sizeof(unsigned char));
+  b->b_buf   = NULL;
+  b->b_len   = 0;
+  b->b_alloc = 0;
+}
+PDSTRING_STATIC void pdstring_bytes_realloc(t_pdstring_bytes *b, size_t n)
+{
+  pdstring_bytes_clear(b);
+  b->b_buf   = n ? (unsigned char*)getbytes(n*sizeof(unsigned char)) : NULL;
+  b->b_alloc = n;
+}
+PDSTRING_STATIC void pdstring_bytes_init(t_pdstring_bytes *b, size_t n)
+{
+  pdstring_bytes_clear(b);
+  pdstring_bytes_realloc(b,n);
+}
+
+/*---------------------------------------------------------------------
+ * wchars
+ */
+PDSTRING_STATIC void pdstring_wchars_clear(t_pdstring_wchars *w)
+{
+  if (w->w_alloc) freebytes(w->w_buf, (w->w_alloc)*sizeof(wchar_t));
+  w->w_buf   = NULL;
+  w->w_len   = 0;
+  w->w_alloc = 0;
+}
+PDSTRING_STATIC void pdstring_wchars_realloc(t_pdstring_wchars *w, size_t n)
+{
+  pdstring_wchars_clear(w);
+  w->w_buf   = n ? (wchar_t*)getbytes(n*sizeof(wchar_t)) : NULL;
+  w->w_alloc = n;
+}
+PDSTRING_STATIC void pdstring_wchars_init(t_pdstring_wchars *w, size_t n)
+{
+  pdstring_wchars_clear(w);
+  pdstring_wchars_realloc(w,n);
+}
+
+/*---------------------------------------------------------------------
+ * atoms
+ */
+PDSTRING_STATIC void pdstring_atoms_clear(t_pdstring_atoms *a)
+{
+  if (a->a_alloc) freebytes(a->a_buf, (a->a_alloc)*sizeof(t_atom));
+  a->a_buf   = NULL;
+  a->a_len   = 0;
+  a->a_alloc = 0;
+}
+PDSTRING_STATIC void pdstring_atoms_realloc(t_pdstring_atoms *a, size_t n)
+{
+  pdstring_atoms_clear(a);
+  a->a_buf   = n ? (t_atom*)getbytes(n*sizeof(t_atom)) : NULL;
+  a->a_alloc = n;
+}
+PDSTRING_STATIC void pdstring_atoms_init(t_pdstring_atoms *a, size_t n)
+{
+  pdstring_atoms_clear(a);
+  pdstring_atoms_realloc(a,n);
+}
+
+/*---------------------------------------------------------------------
+ * floatarray
+ */
+PDSTRING_STATIC void pdstring_floatarray_clearvec(t_pdstring_floatarray *fa)
+{
+  fa->fa_garray = NULL;
+  fa->fa_vlen = 0;
+  fa->fa_vec = NULL;
+}
+PDSTRING_STATIC void pdstring_floatarray_clear(t_pdstring_floatarray *fa)
+{
+  fa->fa_name = &s_;
+  fa->fa_offset = 0;
+  pdstring_floatarray_clearvec(fa);
+}
+PDSTRING_STATIC void pdstring_floatarray_realloc(t_pdstring_floatarray *fa, size_t n)
+{
+  if (fa->fa_name == &s_) return;
+  pdstring_floatarray_getvec(NULL,fa);
+  if (fa->fa_offset < 0) fa->fa_offset += fa->fa_vlen;
+  if (fa->fa_vlen < fa->fa_offset + (int)n) {
+    garray_resize(fa->fa_garray, fa->fa_offset+(int)n);
+    fa->fa_vec = NULL;
+    pdstring_floatarray_getvec(NULL,fa);
+  }
+}
+PDSTRING_STATIC void pdstring_floatarray_init(t_pdstring_floatarray *fa, size_t n)
+{
+  pdstring_floatarray_clearvec(fa);
+  pdstring_floatarray_realloc(fa,n);
+}
+PDSTRING_STATIC void pdstring_floatarray_getvec(t_object *x, t_pdstring_floatarray *fa)
+{
+  //-- get array
+  if (!(fa->fa_garray = (t_garray *)pd_findbyclass(fa->fa_name, garray_class))) {
+    pd_error(x, "pdstring_floatarray_getvec(): no such array '%s'", fa->fa_name->s_name);
+    pdstring_floatarray_clearvec(fa);
+    return;
+  }
+  //-- get float vector & size
+  if (!garray_getfloatarray(fa->fa_garray, &fa->fa_vlen, &fa->fa_vec)) {
+    pd_error(x, "pdstring_floatarray_getvec(): garray_getfloatarray() failed for array '%s'", fa->fa_name->s_name);
+    return;
+  }
+}
+
+
+/*=====================================================================
+ * Utilities
+ *=====================================================================*/
+
+/*--------------------------------------------------------------------
+ * pdstring_any2bytes()
+ *  + x is used for error reporting
+ *  + uses x_binbuf for conversion
+ *  + selector sel is added to binbuf too, if it is none of  {NULL, &s_float, &s_list, &s_}
+ *  + x_binbuf may be NULL, in which case a temporary t_binbuf is created and used
+ *    - in this case, output bytes are copied into *dst, reallocating if required
+ *  + if x_binbuf is given and non-NULL, dst may be NULL.
+ *    - if dst is non-NULL, its values will be clobbered by those returned by
+ *      binbuf_gettext()
+ */
+PDSTRING_STATIC void pdstring_any2bytes(void *x, t_pdstring_bytes *dst, t_symbol *sel, t_pdstring_atoms *src, t_binbuf *x_binbuf)
+{
+  int bb_is_tmp=0;
+
+  //-- create temporary binbuf?
+  if (!x_binbuf) {
+    x_binbuf = binbuf_new();
+    bb_is_tmp = 1;
+  }
+
+  //-- prepare binbuf
+  binbuf_clear(x_binbuf);
+
+  //-- binbuf_add(): selector
+  if (sel && sel != &s_float && sel != &s_list && sel != &s_) {
+    t_atom a;
+    SETSYMBOL((&a), sel);
+    binbuf_add(x_binbuf, 1, &a);
+  }
+
+  //-- binbuf_add(): src atoms
+  binbuf_add(x_binbuf, src->a_len, src->a_buf);
+
+  //-- output: get text string
+  if (bb_is_tmp) {
+    //-- temporary binbuf: copy text
+    char *text;
+    int   len;
+    binbuf_gettext(x_binbuf, &text, &len);
+
+    //-- reallocate?
+    if ( dst->b_alloc < (size_t)len )
+      pdstring_bytes_realloc(dst, len + PDSTRING_BYTES_GET);
+
+    //-- copy
+    memcpy(dst->b_buf, text, len*sizeof(char));
+    dst->b_len = len;
+
+    //-- cleanup
+    binbuf_free(x_binbuf);
+    if (text) freebytes(text,len);
+  }
+  else if (dst) {
+    //-- permanent binbuf: clobber dst
+    pdstring_bytes_clear(dst);
+    binbuf_gettext(x_binbuf, ((char**)((void*)(&dst->b_buf))), &dst->b_len);
+    dst->b_alloc = dst->b_len;
+  }
+}
+
+
+/*--------------------------------------------------------------------
+ * pdstring_bytes2any()
+ *  + uses x_binbuf for conversion
+ *  + x_binbuf may be NULL, in which case a temporary t_binbuf is created and used
+ *    - in this case, output atoms are copied into *dst, reallocating if required
+ *  + if x_binbuf is given and non-NULL, dst may be NULL.
+ *    - if dst is non-NULL, its values will be clobbered by those returned by
+ *      binbuf_getnatom() and binbuf_getvec()
+ */
+PDSTRING_STATIC void pdstring_bytes2any(void *x, t_pdstring_atoms *dst, t_pdstring_bytes *src, t_binbuf *x_binbuf)
+{
+  int bb_is_tmp=0;
+
+  //-- create temporary binbuf?
+  if (!x_binbuf) {
+    x_binbuf = binbuf_new();
+    bb_is_tmp = 1;
+  }
+
+  //-- populate binbuf
+  binbuf_clear(x_binbuf);
+  binbuf_text(x_binbuf, (char*)src->b_buf, src->b_len);
+  //PDSDEBUG(post("bytes2any[dst=%p,src=%p,bb=%p]: binbuf_print: ", dst,src,x_binbuf));
+  //PDSDEBUG(binbuf_print(x_binbuf));
+
+  //-- populate atom list
+  if (bb_is_tmp) {
+    //-- temporary binbuf: copy atoms
+    t_atom *argv = binbuf_getvec(x_binbuf);
+    int     argc = binbuf_getnatom(x_binbuf);
+
+    //-- reallocate?
+    if ( dst->a_alloc < (size_t)argc )
+      pdstring_atoms_realloc(dst, argc + PDSTRING_ATOMS_GET);
+
+    //-- copy
+    memcpy(dst->a_buf, argv, argc*sizeof(t_atom));
+    dst->a_len = argc;
+
+    //-- cleanup
+    binbuf_free(x_binbuf);
+  }
+  else if (dst) {
+    //-- permanent binbuf: clobber dst
+    dst->a_buf = binbuf_getvec(x_binbuf);
+    dst->a_len = binbuf_getnatom(x_binbuf);
+    dst->a_alloc = 0;  //-- don't try to free this
+  }
+}
+
+
+/*--------------------------------------------------------------------
+ * pdstring_atoms2bytes()
+ *  + always appends a final NUL byte to *dst_buf, even if src_argv doesn't contain one
+ *  + returns number of bytes actually written to *dst_buf, __including__ implicit trailing NUL
+ */
+PDSTRING_STATIC int pdstring_atoms2bytes(void *x, t_pdstring_bytes *dst, t_pdstring_atoms *src, t_float x_eos)
+{
+  t_atom *argv = src->a_buf;
+  int     argc = src->a_len;
+  unsigned char *s;
+  int     new_len=0;
+
+  /*-- re-allocate? --*/
+  if (dst->b_alloc <= (size_t)(argc+1))
+    pdstring_bytes_realloc(dst, argc + 1 + PDSTRING_BYTES_GET);
+
+  /*-- get byte string --*/
+  for (s=dst->b_buf, new_len=0; argc > 0; argc--, argv++, s++, new_len++)
+    {
+      *s = atom_getfloat(argv);
+      if ((x_eos<0 && !*s) || (*s==x_eos)) { break; } /*-- hack: truncate at first EOS char --*/
+    }
+  *s = '\0'; /*-- always append terminating NUL */
+  dst->b_len = new_len;
+
+  return new_len+1;
+}
+
+/*--------------------------------------------------------------------
+ * pdstring_atoms2wchars()
+ *  + always appends a final NUL wchar_t to dst->w_buf, even if src->a_buf doesn't contain one
+ *  + returns number of bytes actually written to dst->w_buf, __including__ implicit trailing NUL
+ *  + but dst->w_len does NOT include implicit trailing NUL
+ */
+PDSTRING_STATIC int pdstring_atoms2wchars(void *x, t_pdstring_wchars *dst, t_pdstring_atoms *src, t_float x_eos)
+{
+  t_atom *argv = src->a_buf;
+  int     argc = src->a_len;
+  int     new_len=0;
+  wchar_t *s;
+
+  /*-- re-allocate? --*/
+  if (dst->w_alloc <= (size_t)(argc+1))
+    pdstring_wchars_realloc(dst, argc + 1 + PDSTRING_WCHARS_GET);
+
+  /*-- get wchar_t string --*/
+  for (s=dst->w_buf, new_len=0; argc > 0; argc--, argv++, s++, new_len++)
+    {
+      *s = atom_getfloat(argv);
+      if ((x_eos<0 && !*s) || (*s==x_eos)) { break; } /*-- hack: truncate at first EOS char --*/
+    }
+  *s = L'\0'; /*-- always append terminating NUL */
+  dst->w_len = new_len;
+
+  return new_len+1;
+}
+
+
+/*--------------------------------------------------------------------
+ * pdstring_bytes2wchars()
+ */
+PDSTRING_STATIC int pdstring_bytes2wchars(void *x, t_pdstring_wchars *dst, t_pdstring_bytes *src)
+{
+  size_t bi, wi;
+
+  //-- re-allocate?
+  if ( dst->w_alloc < (size_t)src->b_len )
+    pdstring_wchars_realloc(dst, src->b_len + PDSTRING_WCHARS_GET);
+
+  //-- convert
+  //PDSDEBUG(post("\nbytes2wchars[dst=%p,src=%p]: init", dst,src);)
+  mbtowc(NULL,NULL,0); //-- re-initialize conversion state for mbtowc()
+  for (bi=0,wi=0; bi<(size_t)src->b_len; wi++) {
+    int nbytes = mbtowc(dst->w_buf+wi, (char*)(src->b_buf+bi), src->b_len-bi);
+    if (nbytes <= 0) {
+      if (nbytes < 0) {
+	pd_error(x,"pdstring_bytes2wchars(): malformed byte string \"%s\" at char '%c' - copying literal byte", src->b_buf, src->b_buf[bi]);
+      }
+      dst->w_buf[wi] = src->b_buf[bi];
+      nbytes = 1;
+    }
+    bi += nbytes;
+    //PDSDEBUG(post("bytes2wchars[dst=%p,src=%p]: loop[bi=%d,wi=%d,src=%s]: nbytes=%d,wc=%u", dst,src, bi,wi,src, nbytes,dst->w_buf[wi]));
+  }
+  dst->w_len = wi;
+  return wi;
+}
+
+/*--------------------------------------------------------------------
+ * pdstring_wchars2bytes()
+ */
+PDSTRING_STATIC int pdstring_wchars2bytes(void *x, t_pdstring_bytes *dst, t_pdstring_wchars *src)
+{
+  size_t bi, wi;
+
+  //-- re-allocate?
+  if ( dst->b_alloc < src->w_len * MB_CUR_MAX )
+    pdstring_bytes_realloc(dst, src->w_len * MB_CUR_MAX + PDSTRING_WCHARS_GET);
+
+  //-- convert
+  for (bi=0,wi=0; wi < (size_t)src->w_len; wi++) {
+    int nbytes = wctomb((char*)dst->b_buf+bi, src->w_buf[wi]);
+    if (nbytes <= 0) {
+      if (nbytes < 0) {
+	pd_error(x,"pdstring_wchars2bytes(): malformed wide character (%u) - bashing to byte", src->w_buf[wi]);
+      }
+      dst->b_buf[bi] = src->w_buf[wi];
+      nbytes = 1;
+    }
+    bi += nbytes;
+  }
+  dst->b_len = bi;
+  return bi;
+}
+
+
+/*--------------------------------------------------------------------
+ * pdstring_bytes2atoms()
+ *  + implicitly appends x_eos if >= 0 and != PDSTRING_EOS_NONE
+ */
+PDSTRING_STATIC void pdstring_bytes2atoms(void *x, t_pdstring_atoms *dst, t_pdstring_bytes *src, t_float x_eos)
+{
+  int i;
+
+  //-- re-allocate?
+  if ( dst->a_alloc <= (size_t)src->b_len )
+    pdstring_atoms_realloc(dst, src->b_len + 1 + PDSTRING_ATOMS_GET);
+
+  //-- convert
+  for (i=0; i < src->b_len; i++) {
+    SETFLOAT((dst->a_buf+i), src->b_buf[i]);
+  }
+  dst->a_len = src->b_len;
+
+  //-- append eos atom?
+  if (x_eos >= 0 && x_eos != PDSTRING_EOS_NONE) {
+    SETFLOAT(dst->a_buf+dst->a_len, x_eos);
+    dst->a_len++;
+  }
+}
+
+/*--------------------------------------------------------------------
+ * pdstring_wchars2atoms()
+ */
+PDSTRING_STATIC void pdstring_wchars2atoms(void *x, t_pdstring_atoms *dst, t_pdstring_wchars *src)
+{
+  int i;
+
+  //-- re-allocate?
+  if ( dst->a_alloc < (size_t)src->w_len )
+    pdstring_atoms_realloc(dst, src->w_len + PDSTRING_ATOMS_GET);
+
+  //-- convert
+  for (i=0; i < src->w_len; i++) {
+    SETFLOAT((dst->a_buf+i), src->w_buf[i]);
+  }
+  dst->a_len = src->w_len;
+}
+
+
+#endif /* PDSTRING_UTILS_C */

Modified: trunk/externals/moocow/pdstring/src/pdstringUtils.h
===================================================================
--- trunk/externals/moocow/pdstring/src/pdstringUtils.h	2009-01-27 09:19:55 UTC (rev 10660)
+++ trunk/externals/moocow/pdstring/src/pdstringUtils.h	2009-01-27 21:39:35 UTC (rev 10661)
@@ -33,18 +33,6 @@
 #include "mooPdUtils.h"
 
 /*=====================================================================
- * Debugging
- *=====================================================================*/
-#define PDSTRING_UTILS_DEBUG 1
-//#undef  PDSTRING_UTILS_DEBUG
-
-#ifdef PDSTRING_UTILS_DEBUG
-# define PDSDEBUG(x) x
-#else
-# define PDSDEBUG(x)
-#endif
-
-/*=====================================================================
  * Constants
  *=====================================================================*/
 
@@ -70,6 +58,9 @@
 #define PDSTRING_WCHARS_GET PDSTRING_DEFAULT_GET
 #define PDSTRING_ATOMS_GET PDSTRING_DEFAULT_GET
 
+//#define PDSTRING_STATIC static
+#define PDSTRING_STATIC
+
 /*=====================================================================
  * Structures & Types
  *=====================================================================*/
@@ -101,6 +92,18 @@
   size_t         a_alloc;  //-- allocated size of a_buf
 } t_pdstring_atoms;
 
+/* t_pdstring_floatarray
+ *  + read/store strings to t_array (of t_float)
+ */
+typedef struct _pdstring_floatarray {
+  t_symbol      *fa_name;   //-- name bound to array
+  int            fa_offset; //-- offset at which to begin operation
+  t_garray      *fa_garray; //-- underlying t_garray*, populated by pdstring_floatarray_getarray()
+  int            fa_vlen;   //-- length of fa_vec (number of points), populated by pdstring_floatarray_getvec()
+  t_float       *fa_vec;    //-- underlying t_float*, populated by pdstring_floatarray_getvec()
+} t_pdstring_floatarray;
+
+
 /*=====================================================================
  * Initialization
  *=====================================================================*/
@@ -108,72 +111,35 @@
 /*---------------------------------------------------------------------
  * bytes
  */
-static void pdstring_bytes_clear(t_pdstring_bytes *b)
-{
-  if (b->b_alloc) freebytes(b->b_buf, (b->b_alloc)*sizeof(unsigned char));
-  b->b_buf   = NULL;
-  b->b_len   = 0;
-  b->b_alloc = 0;
-}
-static void pdstring_bytes_realloc(t_pdstring_bytes *b, size_t n)
-{
-  pdstring_bytes_clear(b);
-  b->b_buf   = n ? (unsigned char*)getbytes(n*sizeof(unsigned char)) : NULL;
-  b->b_alloc = n;
-}
-static void pdstring_bytes_init(t_pdstring_bytes *b, size_t n)
-{
-  pdstring_bytes_clear(b);
-  pdstring_bytes_realloc(b,n);
-}
+PDSTRING_STATIC void pdstring_bytes_clear(t_pdstring_bytes *b);
+PDSTRING_STATIC void pdstring_bytes_realloc(t_pdstring_bytes *b, size_t n);
+PDSTRING_STATIC void pdstring_bytes_init(t_pdstring_bytes *b, size_t n);
 
 /*---------------------------------------------------------------------
  * wchars
  */
-static void pdstring_wchars_clear(t_pdstring_wchars *w)
-{
-  if (w->w_alloc) freebytes(w->w_buf, (w->w_alloc)*sizeof(wchar_t));
-  w->w_buf   = NULL;
-  w->w_len   = 0;
-  w->w_alloc = 0;
-}
-static void pdstring_wchars_realloc(t_pdstring_wchars *w, size_t n)
-{
-  pdstring_wchars_clear(w);
-  w->w_buf   = n ? (wchar_t*)getbytes(n*sizeof(wchar_t)) : NULL;
-  w->w_alloc = n;
-}
-static void pdstring_wchars_init(t_pdstring_wchars *w, size_t n)
-{
-  pdstring_wchars_clear(w);
-  pdstring_wchars_realloc(w,n);
-}
+PDSTRING_STATIC void pdstring_wchars_clear(t_pdstring_wchars *w);
+PDSTRING_STATIC void pdstring_wchars_realloc(t_pdstring_wchars *w, size_t n);
+PDSTRING_STATIC void pdstring_wchars_init(t_pdstring_wchars *w, size_t n);
 
 /*---------------------------------------------------------------------
  * atoms
  */
-static void pdstring_atoms_clear(t_pdstring_atoms *a)
-{
-  if (a->a_alloc) freebytes(a->a_buf, (a->a_alloc)*sizeof(t_atom));
-  a->a_buf   = NULL;
-  a->a_len   = 0;
-  a->a_alloc = 0;
-}
-static void pdstring_atoms_realloc(t_pdstring_atoms *a, size_t n)
-{
-  pdstring_atoms_clear(a);
-  a->a_buf   = n ? (t_atom*)getbytes(n*sizeof(t_atom)) : NULL;
-  a->a_alloc = n;
-}
-static void pdstring_atoms_init(t_pdstring_atoms *a, size_t n)
-{
-  pdstring_atoms_clear(a);
-  pdstring_atoms_realloc(a,n);
-}
+PDSTRING_STATIC void pdstring_atoms_clear(t_pdstring_atoms *a);
+PDSTRING_STATIC void pdstring_atoms_realloc(t_pdstring_atoms *a, size_t n);
+PDSTRING_STATIC void pdstring_atoms_init(t_pdstring_atoms *a, size_t n);
 
+/*---------------------------------------------------------------------
+ * floatarray
+ */
+PDSTRING_STATIC void pdstring_floatarray_clear(t_pdstring_floatarray *a);             //-- clears all data (no free)
+PDSTRING_STATIC void pdstring_floatarray_realloc(t_pdstring_floatarray *a, size_t n); //-- calls garray_resize()
+PDSTRING_STATIC void pdstring_floatarray_init(t_pdstring_floatarray *a, size_t n);    //-- if a->fa_name is set
+PDSTRING_STATIC void pdstring_floatarray_getvec(t_object *x, t_pdstring_floatarray *a); //-- gets underlying pointers
 
+
 /*=====================================================================
- * Utilities
+ * Conversions
  *=====================================================================*/
 
 /*--------------------------------------------------------------------
@@ -184,269 +150,55 @@
  *  + x_binbuf may be NULL, in which case a temporary t_binbuf is created and used
  *    - in this case, output bytes are copied into *dst, reallocating if required
  *  + if x_binbuf is given and non-NULL, dst may be NULL.
- *    - if dst is non-NULL, its values will be clobbered by those returned by
- *      binbuf_gettext()
+ *    - if dst is non-NULL, its values will be clobbered by those returned by binbuf_gettext()
  */
-static void pdstring_any2bytes(void *x, t_pdstring_bytes *dst, t_symbol *sel, t_pdstring_atoms *src, t_binbuf *x_binbuf)
-{
-  int bb_is_tmp=0;
+PDSTRING_STATIC void pdstring_any2bytes(void *x, t_pdstring_bytes *dst, t_symbol *sel, t_pdstring_atoms *src, t_binbuf *x_binbuf);
 
-  //-- create temporary binbuf?
-  if (!x_binbuf) {
-    x_binbuf = binbuf_new();
-    bb_is_tmp = 1;
-  }
 
-  //-- prepare binbuf
-  binbuf_clear(x_binbuf);
-
-  //-- binbuf_add(): selector
-  if (sel && sel != &s_float && sel != &s_list && sel != &s_) {
-    t_atom a;
-    SETSYMBOL((&a), sel);
-    binbuf_add(x_binbuf, 1, &a);
-  }
-
-  //-- binbuf_add(): src atoms
-  binbuf_add(x_binbuf, src->a_len, src->a_buf);
-
-  //-- output: get text string
-  if (bb_is_tmp) {
-    //-- temporary binbuf: copy text
-    char *text;
-    int   len;
-    binbuf_gettext(x_binbuf, &text, &len);
-
-    //-- reallocate?
-    if ( dst->b_alloc < len )
-      pdstring_bytes_realloc(dst, len + PDSTRING_BYTES_GET);
-
-    //-- copy
-    memcpy(dst->b_buf, text, len*sizeof(char));
-    dst->b_len = len;
-
-    //-- cleanup
-    binbuf_free(x_binbuf);
-    if (text) freebytes(text,len);
-  }
-  else if (dst) {
-    //-- permanent binbuf: clobber dst
-    pdstring_bytes_clear(dst);
-    binbuf_gettext(x_binbuf, ((char**)((void*)(&dst->b_buf))), &dst->b_len);
-    dst->b_alloc = dst->b_len;
-  }
-}
-
-
 /*--------------------------------------------------------------------
  * pdstring_bytes2any()
  *  + uses x_binbuf for conversion
  *  + x_binbuf may be NULL, in which case a temporary t_binbuf is created and used
  *    - in this case, output atoms are copied into *dst, reallocating if required
  *  + if x_binbuf is given and non-NULL, dst may be NULL.
- *    - if dst is non-NULL, its values will be clobbered by those returned by
- *      binbuf_getnatom() and binbuf_getvec()
+ *    - if dst is non-NULL, its values will be clobbered by those returned by binbuf_getnatom() & binbuf_getvec()
  */
-static void pdstring_bytes2any(void *x, t_pdstring_atoms *dst, t_pdstring_bytes *src, t_binbuf *x_binbuf)
-{
-  int bb_is_tmp=0;
+PDSTRING_STATIC void pdstring_bytes2any(void *x, t_pdstring_atoms *dst, t_pdstring_bytes *src, t_binbuf *x_binbuf);
 
-  //-- create temporary binbuf?
-  if (!x_binbuf) {
-    x_binbuf = binbuf_new();
-    bb_is_tmp = 1;
-  }
-
-  //-- populate binbuf
-  binbuf_clear(x_binbuf);
-  binbuf_text(x_binbuf, (char*)src->b_buf, src->b_len);
-  //PDSDEBUG(post("bytes2any[dst=%p,src=%p,bb=%p]: binbuf_print: ", dst,src,x_binbuf));
-  //PDSDEBUG(binbuf_print(x_binbuf));
-
-  //-- populate atom list
-  if (bb_is_tmp) {
-    //-- temporary binbuf: copy atoms
-    t_atom *argv = binbuf_getvec(x_binbuf);
-    int     argc = binbuf_getnatom(x_binbuf);
-
-    //-- reallocate?
-    if ( dst->a_alloc < argc )
-      pdstring_atoms_realloc(dst, argc + PDSTRING_ATOMS_GET);
-
-    //-- copy
-    memcpy(dst->a_buf, argv, argc*sizeof(t_atom));
-    dst->a_len = argc;
-
-    //-- cleanup
-    binbuf_free(x_binbuf);
-  }
-  else if (dst) {
-    //-- permanent binbuf: clobber dst
-    dst->a_buf = binbuf_getvec(x_binbuf);
-    dst->a_len = binbuf_getnatom(x_binbuf);
-    dst->a_alloc = 0;  //-- don't try to free this
-  }
-}
-
-
 /*--------------------------------------------------------------------
  * pdstring_atoms2bytes()
  *  + always appends a final NUL byte to *dst_buf, even if src_argv doesn't contain one
  *  + returns number of bytes actually written to *dst_buf, __including__ implicit trailing NUL
  */
-static int pdstring_atoms2bytes(void *x, t_pdstring_bytes *dst, t_pdstring_atoms *src, t_float x_eos)
-{
-  t_atom *argv = src->a_buf;
-  int     argc = src->a_len;
-  unsigned char *s;
-  int     new_len=0;
+PDSTRING_STATIC int pdstring_atoms2bytes(void *x, t_pdstring_bytes *dst, t_pdstring_atoms *src, t_float x_eos);
 
-  /*-- re-allocate? --*/
-  if (dst->b_alloc <= (argc+1))
-    pdstring_bytes_realloc(dst, argc + 1 + PDSTRING_BYTES_GET);
-
-  /*-- get byte string --*/
-  for (s=dst->b_buf, new_len=0; argc > 0; argc--, argv++, s++, new_len++)
-    {
-      *s = atom_getfloat(argv);
-      if ((x_eos<0 && !*s) || (*s==x_eos)) { break; } /*-- hack: truncate at first EOS char --*/
-    }
-  *s = '\0'; /*-- always append terminating NUL */
-  dst->b_len = new_len;
-
-  return new_len+1;
-}
-
 /*--------------------------------------------------------------------
  * pdstring_atoms2wchars()
  *  + always appends a final NUL wchar_t to dst->w_buf, even if src->a_buf doesn't contain one
  *  + returns number of bytes actually written to dst->w_buf, __including__ implicit trailing NUL
  *  + but dst->w_len does NOT include implicit trailing NUL
  */
-static int pdstring_atoms2wchars(void *x, t_pdstring_wchars *dst, t_pdstring_atoms *src, t_float x_eos)
-{
-  t_atom *argv = src->a_buf;
-  int     argc = src->a_len;
-  int     new_len=0;
-  wchar_t *s;
+PDSTRING_STATIC int pdstring_atoms2wchars(void *x, t_pdstring_wchars *dst, t_pdstring_atoms *src, t_float x_eos);
 
-  /*-- re-allocate? --*/
-  if (dst->w_alloc <= (argc+1))
-    pdstring_wchars_realloc(dst, argc + 1 + PDSTRING_WCHARS_GET);
-
-  /*-- get wchar_t string --*/
-  for (s=dst->w_buf, new_len=0; argc > 0; argc--, argv++, s++, new_len++)
-    {
-      *s = atom_getfloat(argv);
-      if ((x_eos<0 && !*s) || (*s==x_eos)) { break; } /*-- hack: truncate at first EOS char --*/
-    }
-  *s = L'\0'; /*-- always append terminating NUL */
-  dst->w_len = new_len;
-
-  return new_len+1;
-}
-
-
 /*--------------------------------------------------------------------
  * pdstring_bytes2wchars()
  */
-static int pdstring_bytes2wchars(void *x, t_pdstring_wchars *dst, t_pdstring_bytes *src)
-{
-  size_t bi, wi;
+PDSTRING_STATIC int pdstring_bytes2wchars(void *x, t_pdstring_wchars *dst, t_pdstring_bytes *src);
 
-  //-- re-allocate?
-  if ( dst->w_alloc < src->b_len )
-    pdstring_wchars_realloc(dst, src->b_len + PDSTRING_WCHARS_GET);
-
-  //-- convert
-  //PDSDEBUG(post("\nbytes2wchars[dst=%p,src=%p]: init", dst,src);)
-  mbtowc(NULL,NULL,0); //-- re-initialize conversion state for mbtowc()
-  for (bi=0,wi=0; bi<src->b_len; wi++) {
-    int nbytes = mbtowc(dst->w_buf+wi, (char*)(src->b_buf+bi), src->b_len-bi);
-    if (nbytes <= 0) {
-      if (nbytes < 0) {
-	pd_error(x,"pdstring_bytes2wchars(): malformed byte string \"%s\" at char '%c' - copying literal byte", src->b_buf, src->b_buf[bi]);
-      }
-      dst->w_buf[wi] = src->b_buf[bi];
-      nbytes = 1;
-    }
-    bi += nbytes;
-    //PDSDEBUG(post("bytes2wchars[dst=%p,src=%p]: loop[bi=%d,wi=%d,src=%s]: nbytes=%d,wc=%u", dst,src, bi,wi,src, nbytes,dst->w_buf[wi]));
-  }
-  dst->w_len = wi;
-  return wi;
-}
-
 /*--------------------------------------------------------------------
  * pdstring_wchars2bytes()
  */
-static int pdstring_wchars2bytes(void *x, t_pdstring_bytes *dst, t_pdstring_wchars *src)
-{
-  size_t bi, wi;
+PDSTRING_STATIC int pdstring_wchars2bytes(void *x, t_pdstring_bytes *dst, t_pdstring_wchars *src);
 
-  //-- re-allocate?
-  if ( dst->b_alloc < src->w_len * MB_CUR_MAX )
-    pdstring_bytes_realloc(dst, src->w_len * MB_CUR_MAX + PDSTRING_WCHARS_GET);
-
-  //-- convert
-  for (bi=0,wi=0; wi < src->w_len; wi++) {
-    int nbytes = wctomb((char*)dst->b_buf+bi, src->w_buf[wi]);
-    if (nbytes <= 0) {
-      if (nbytes < 0) {
-	pd_error(x,"pdstring_wchars2bytes(): malformed wide character (%u) - bashing to byte", src->w_buf[wi]);
-      }
-      dst->b_buf[bi] = src->w_buf[wi];
-      nbytes = 1;
-    }
-    bi += nbytes;
-  }
-  dst->b_len = bi;
-  return bi;
-}
-
-
 /*--------------------------------------------------------------------
  * pdstring_bytes2atoms()
  *  + implicitly appends x_eos if >= 0 and != PDSTRING_EOS_NONE
  */
-static void pdstring_bytes2atoms(void *x, t_pdstring_atoms *dst, t_pdstring_bytes *src, t_float x_eos)
-{
-  int i;
+PDSTRING_STATIC void pdstring_bytes2atoms(void *x, t_pdstring_atoms *dst, t_pdstring_bytes *src, t_float x_eos);
 
-  //-- re-allocate?
-  if ( dst->a_alloc <= src->b_len )
-    pdstring_atoms_realloc(dst, src->b_len + 1 + PDSTRING_ATOMS_GET);
-
-  //-- convert
-  for (i=0; i < src->b_len; i++) {
-    SETFLOAT((dst->a_buf+i), src->b_buf[i]);
-  }
-  dst->a_len = src->b_len;
-
-  //-- append eos atom?
-  if (x_eos >= 0 && x_eos != PDSTRING_EOS_NONE) {
-    SETFLOAT(dst->a_buf+dst->a_len, x_eos);
-    dst->a_len++;
-  }
-}
-
 /*--------------------------------------------------------------------
  * pdstring_wchars2atoms()
  */
-static void pdstring_wchars2atoms(void *x, t_pdstring_atoms *dst, t_pdstring_wchars *src)
-{
-  int i;
+PDSTRING_STATIC void pdstring_wchars2atoms(void *x, t_pdstring_atoms *dst, t_pdstring_wchars *src);
 
-  //-- re-allocate?
-  if ( dst->a_alloc < src->w_len )
-    pdstring_atoms_realloc(dst, src->w_len + PDSTRING_ATOMS_GET);
-
-  //-- convert
-  for (i=0; i < src->w_len; i++) {
-    SETFLOAT((dst->a_buf+i), src->w_buf[i]);
-  }
-  dst->a_len = src->w_len;
-}
-
-
 #endif /* PDSTRING_UTILS_H */

Added: trunk/externals/moocow/pdstring/src/printbytes-help.pd
===================================================================
--- trunk/externals/moocow/pdstring/src/printbytes-help.pd	                        (rev 0)
+++ trunk/externals/moocow/pdstring/src/printbytes-help.pd	2009-01-27 21:39:35 UTC (rev 10661)
@@ -0,0 +1,23 @@
+#N canvas 66 62 450 300 10;
+#X text 43 5 printbytes - print byte strings to pd console;
+#X obj 44 172 printbytes mybytes;
+#X text 141 266 Bryan Jurish <moocow at ling.uni-potsdam.de>;
+#X text 17 231 SEE ALSO:;
+#X obj 86 230 pdstring;
+#X obj 150 230 locale;
+#X text 153 45 "ABC";
+#X text 183 173 First argument is prefixed to output;
+#X msg 44 44 list 65 66 67;
+#X msg 54 64 foo 49 50 51;
+#X text 153 65 "123" \, selector "foo" is printed extra;
+#X msg 67 87 228 246 252;
+#X msg 71 111 195 164 195 182 195 188;
+#X text 247 111 ... or in UTF-8;
+#X msg 73 137 207 128 206 180;
+#X text 189 137 "&pi &delta" in UTF-8;
+#X text 157 89 "&auml &ouml &uuml" in ISO-8859-1;
+#X connect 8 0 1 0;
+#X connect 9 0 1 0;
+#X connect 11 0 1 0;
+#X connect 12 0 1 0;
+#X connect 14 0 1 0;

Added: trunk/externals/moocow/pdstring/src/printbytes-test.pd
===================================================================
--- trunk/externals/moocow/pdstring/src/printbytes-test.pd	                        (rev 0)
+++ trunk/externals/moocow/pdstring/src/printbytes-test.pd	2009-01-27 21:39:35 UTC (rev 10661)
@@ -0,0 +1,45 @@
+#N canvas 30 10 564 356 10;
+#X obj 36 280 printbytes;
+#X msg 33 21 A B C;
+#X obj 36 106 any2bytes;
+#X obj 78 134 print any2bytes;
+#X obj 76 160 bytes2any;
+#X obj 124 184 print bytes2any;
+#X obj 260 80 wchars2bytes;
+#X msg 311 287 C;
+#N canvas 0 0 338 182 locale_LC_CTYPE 0;
+#X obj 48 124 locale;
+#X obj 48 36 inlet;
+#X obj 48 64 symbol;
+#X msg 48 92 set LC_CTYPE \$1;
+#X text 57 143 + requires the "locale" external;
+#X connect 1 0 2 0;
+#X connect 2 0 3 0;
+#X connect 3 0 0 0;
+#X restore 343 318 pd locale_LC_CTYPE;
+#X msg 343 287 en_DK.ISO-8859-1;
+#X msg 465 287 en_DK.UTF-8;
+#X msg 259 27 228 246 252;
+#X msg 287 50 960 948;
+#X text 343 27 "&auml &ouml &uuml";
+#X text 341 51 "&pi &delta";
+#X obj 300 108 print wchars2bytes;
+#X obj 258 160 printbytes wbytes;
+#X obj 36 228 list prepend myString;
+#X obj 36 250 list trim;
+#X msg 211 209 65 0 66 0 67 0;
+#X connect 1 0 2 0;
+#X connect 2 0 3 0;
+#X connect 2 0 4 0;
+#X connect 2 0 17 0;
+#X connect 4 0 5 0;
+#X connect 6 0 15 0;
+#X connect 6 0 16 0;
+#X connect 7 0 8 0;
+#X connect 9 0 8 0;
+#X connect 10 0 8 0;
+#X connect 11 0 6 0;
+#X connect 12 0 6 0;
+#X connect 17 0 18 0;
+#X connect 18 0 0 0;
+#X connect 19 0 17 0;

Added: trunk/externals/moocow/pdstring/src/printbytes.c
===================================================================
--- trunk/externals/moocow/pdstring/src/printbytes.c	                        (rev 0)
+++ trunk/externals/moocow/pdstring/src/printbytes.c	2009-01-27 21:39:35 UTC (rev 10661)
@@ -0,0 +1,142 @@
+/* -*- Mode: C -*- */
+/*=============================================================================*\
+ * File: printbytes.c
+ * Author: Bryan Jurish <moocow at ling.uni-potsdam.de>
+ * Description: print byte-strings using post()
+ *
+ * Copyright (c) 2009 Bryan Jurish.
+ *
+ * For information on usage and redistribution, and for a DISCLAIMER OF ALL
+ * WARRANTIES, see the file "COPYING", in this distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ *=============================================================================*/
+
+#include <string.h>
+#include <m_pd.h>
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include "mooPdUtils.h"
+#include "pdstringUtils.h"
+
+
+/*=====================================================================
+ * Constants & Globals
+ *=====================================================================*/
+static char *printbytes_banner = "printbytes: pdstring version " PACKAGE_VERSION " by Bryan Jurish";
+
+/*=====================================================================
+ * Structures and Types: any2string
+ *=====================================================================*/
+
+static t_class *printbytes_class;
+
+typedef struct _printbytes
+{
+  t_object           x_obj;
+  t_symbol          *x_prefix;
+  //t_pdstring_bytes   x_bytes;
+} t_printbytes;
+
+
+/*=====================================================================
+ * Methods
+ *=====================================================================*/
+
+/*--------------------------------------------------------------------
+ * anything
+ */
+static void printbytes_anything(t_printbytes *x, MOO_UNUSED t_symbol *sel, int argc, t_atom *argv)
+{
+  startpost("%s/%s: ", x->x_prefix->s_name, sel->s_name);
+  for (; argc > 0; argc--, argv++) {
+    char c = atom_getfloat(argv);
+    startpost("%c", c);
+  }
+  endpost();
+}
+
+#if 0
+static void printbytes_anything_v1(t_printbytes *x, MOO_UNUSED t_symbol *sel, int argc, t_atom *argv)
+{
+  t_pdstring_atoms arg_atoms = { argv, argc, 0 };
+  pdstring_atoms2bytes(x, &x->x_bytes, &arg_atoms, PDSTRING_EOS_NONE);
+  post("%s/%s: %s", x->x_prefix->s_name, sel->s_name, x->x_bytes.b_buf);
+}
+#endif
+
+
+/*--------------------------------------------------------------------
+ * new
+ */
+static void *printbytes_new(t_symbol *prefix)
+{
+    t_printbytes *x = (t_printbytes *)pd_new(printbytes_class);
+
+    if (prefix == &s_) prefix = gensym("printbytes");
+    x->x_prefix = prefix;
+
+    //pdstring_bytes_init(&x->x_bytes, PDSTRING_DEFAULT_BUFLEN);
+    return (void *)x;
+}
+
+/*--------------------------------------------------------------------
+ * free
+ */
+static void printbytes_free(t_printbytes *x)
+{
+  //pdstring_bytes_clear(&x->x_bytes);
+  return;
+}
+
+/*--------------------------------------------------------------------
+ * setup: guts
+ */
+void printbytes_setup_guts(void)
+{
+  //-- check/set "initialized" flag
+  //if (PRINTBYTES_INITIALIZED) return;
+  //PRINTBYTES_INITIALIZED = 1;
+
+  //-- class
+  printbytes_class = class_new(gensym("printbytes"),
+			       (t_newmethod)printbytes_new,
+			       (t_method)printbytes_free,
+			       sizeof(t_printbytes),
+			       CLASS_DEFAULT,
+			       A_DEFSYM,                     //-- print-prefix
+			       0);
+
+  //-- alias
+  //class_addcreator((t_newmethod)printbytes_new, gensym("printstring"), A_GIMME, 0);
+  
+  //-- methods
+  class_addanything(printbytes_class, (t_method)printbytes_anything);
+
+  //-- help symbol
+  //class_sethelpsymbol(printbytes_class, gensym("printbytes-help.pd")); //-- breaks pd-extended help lookup
+}
+
+/*--------------------------------------------------------------------
+ * setup
+ */
+void printbytes_setup(void)
+{
+  post(printbytes_banner);
+  printbytes_setup_guts();
+}

Added: trunk/externals/moocow/pdstring/src/printwchars-help.pd
===================================================================
--- trunk/externals/moocow/pdstring/src/printwchars-help.pd	                        (rev 0)
+++ trunk/externals/moocow/pdstring/src/printwchars-help.pd	2009-01-27 21:39:35 UTC (rev 10661)
@@ -0,0 +1,21 @@
+#N canvas 82 52 450 300 10;
+#X text 141 266 Bryan Jurish <moocow at ling.uni-potsdam.de>;
+#X text 17 231 SEE ALSO:;
+#X obj 86 230 pdstring;
+#X obj 150 230 locale;
+#X text 153 45 "ABC";
+#X text 193 173 First argument is prefixed to output;
+#X msg 44 44 list 65 66 67;
+#X msg 54 64 foo 49 50 51;
+#X text 153 65 "123" \, selector "foo" is printed extra;
+#X msg 67 87 228 246 252;
+#X text 159 115 "&pi &delta" in UTF-8;
+#X text 35 7 printwchars - print wide character strings to pd console
+;
+#X text 157 89 "&auml &ouml &uuml";
+#X msg 71 115 960 948;
+#X obj 44 172 printwchars mywchars;
+#X connect 6 0 14 0;
+#X connect 7 0 14 0;
+#X connect 9 0 14 0;
+#X connect 13 0 14 0;

Added: trunk/externals/moocow/pdstring/src/printwchars-test.pd
===================================================================
--- trunk/externals/moocow/pdstring/src/printwchars-test.pd	                        (rev 0)
+++ trunk/externals/moocow/pdstring/src/printwchars-test.pd	2009-01-27 21:39:35 UTC (rev 10661)
@@ -0,0 +1,45 @@
+#N canvas 30 10 564 356 10;
+#X msg 33 21 A B C;
+#X msg 311 287 C;
+#N canvas 0 0 338 182 locale_LC_CTYPE 0;
+#X obj 48 124 locale;
+#X obj 48 36 inlet;
+#X obj 48 64 symbol;
+#X msg 48 92 set LC_CTYPE \$1;
+#X text 57 143 + requires the "locale" external;
+#X connect 1 0 2 0;
+#X connect 2 0 3 0;
+#X connect 3 0 0 0;
+#X restore 343 318 pd locale_LC_CTYPE;
+#X msg 343 287 en_DK.ISO-8859-1;
+#X msg 465 287 en_DK.UTF-8;
+#X msg 259 27 228 246 252;
+#X msg 287 50 960 948;
+#X text 343 27 "&auml &ouml &uuml";
+#X text 341 51 "&pi &delta";
+#X obj 36 228 list prepend myString;
+#X obj 36 250 list trim;
+#X msg 211 209 65 0 66 0 67 0;
+#X obj 36 106 any2wchars;
+#X obj 78 134 print any2wchars;
+#X obj 76 158 wchars2any;
+#X obj 124 184 print wchars2any;
+#X obj 36 280 printwchars;
+#X obj 258 160 printwchars wcs;
+#X obj 260 80 t l l;
+#X obj 300 108 print wchars;
+#X connect 0 0 12 0;
+#X connect 1 0 2 0;
+#X connect 3 0 2 0;
+#X connect 4 0 2 0;
+#X connect 5 0 18 0;
+#X connect 6 0 18 0;
+#X connect 9 0 10 0;
+#X connect 10 0 16 0;
+#X connect 11 0 9 0;
+#X connect 12 0 9 0;
+#X connect 12 0 13 0;
+#X connect 12 0 14 0;
+#X connect 14 0 15 0;
+#X connect 18 0 17 0;
+#X connect 18 1 19 0;

Added: trunk/externals/moocow/pdstring/src/printwchars.c
===================================================================
--- trunk/externals/moocow/pdstring/src/printwchars.c	                        (rev 0)
+++ trunk/externals/moocow/pdstring/src/printwchars.c	2009-01-27 21:39:35 UTC (rev 10661)
@@ -0,0 +1,140 @@
+/* -*- Mode: C -*- */
+/*=============================================================================*\
+ * File: printwchars.c
+ * Author: Bryan Jurish <moocow at ling.uni-potsdam.de>
+ * Description: print byte-strings using post()
+ *
+ * Copyright (c) 2009 Bryan Jurish.
+ *
+ * For information on usage and redistribution, and for a DISCLAIMER OF ALL
+ * WARRANTIES, see the file "COPYING", in this distribution.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ *=============================================================================*/
+
+#include <string.h>
+#include <wchar.h>
+#include <m_pd.h>
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include "mooPdUtils.h"
+#include "pdstringUtils.h"
+
+/*=====================================================================
+ * Constants & Globals
+ *=====================================================================*/
+static char *printwchars_banner = "printwchars: pdstring version " PACKAGE_VERSION " by Bryan Jurish";
+
+/*=====================================================================
+ * Structures and Types: any2string
+ *=====================================================================*/
+
+static t_class *printwchars_class;
+
+typedef struct _printwchars
+{
+  t_object           x_obj;
+  t_symbol          *x_prefix;
+} t_printwchars;
+
+
+/*=====================================================================
+ * Methods
+ *=====================================================================*/
+
+/*--------------------------------------------------------------------
+ * anything
+ */
+static void printwchars_anything(t_printwchars *x, MOO_UNUSED t_symbol *sel, int argc, t_atom *argv)
+{
+  startpost("%s/%s: ", x->x_prefix->s_name, sel->s_name);
+  for (; argc > 0; argc--, argv++) {
+    wchar_t c = atom_getfloat(argv);
+    startpost("%C", c);
+  }
+  endpost();
+}
+
+#if 0
+static void printwchars_anything_v1(t_printwchars *x, MOO_UNUSED t_symbol *sel, int argc, t_atom *argv)
+{
+  t_pdstring_atoms arg_atoms = { argv, argc, 0 };
+  pdstring_atoms2wchars(x, &x->x_wchars, &arg_atoms, PDSTRING_EOS_NONE);
+  post("%S/%S: %S", x->x_prefix->s_name, sel->s_name, x->x_wchars.w_buf);
+}
+#endif
+
+/*--------------------------------------------------------------------
+ * new
+ */
+static void *printwchars_new(t_symbol *prefix)
+{
+    t_printwchars *x = (t_printwchars *)pd_new(printwchars_class);
+
+    if (prefix == &s_) prefix = gensym("printwchars");
+    x->x_prefix = prefix;
+
+    //pdstring_wchars_init(&x->x_wchars, PDSTRING_DEFAULT_BUFLEN);
+    return (void *)x;
+}
+
+/*--------------------------------------------------------------------
+ * free
+ */
+static void printwchars_free(t_printwchars *x)
+{
+  //pdstring_wchars_clear(&x->x_wchars);
+  return;
+}
+
+/*--------------------------------------------------------------------
+ * setup: guts
+ */
+void printwchars_setup_guts(void)
+{
+  //-- check/set "initialized" flag
+  //if (PRINTWCHARS_INITIALIZED) return;
+  //PRINTWCHARS_INITIALIZED = 1;
+
+  //-- class
+  printwchars_class = class_new(gensym("printwchars"),
+			       (t_newmethod)printwchars_new,
+			       (t_method)printwchars_free,
+			       sizeof(t_printwchars),
+			       CLASS_DEFAULT,
+			       A_DEFSYM,                   //-- print-prefix
+			       0);
+
+  //-- alias
+  //class_addcreator((t_newmethod)printwchars_new, gensym("printstring"), A_GIMME, 0);
+  
+  //-- methods
+  class_addanything(printwchars_class, (t_method)printwchars_anything);
+
+  //-- help symbol
+  //class_sethelpsymbol(printwchars_class, gensym("printwchars-help.pd")); //-- breaks pd-extended help lookup
+}
+
+/*--------------------------------------------------------------------
+ * setup
+ */
+void printwchars_setup(void)
+{
+  post(printwchars_banner);
+  printwchars_setup_guts();
+}

Added: trunk/externals/moocow/pdstring/src/stringalias-test.pd
===================================================================
--- trunk/externals/moocow/pdstring/src/stringalias-test.pd	                        (rev 0)
+++ trunk/externals/moocow/pdstring/src/stringalias-test.pd	2009-01-27 21:39:35 UTC (rev 10661)
@@ -0,0 +1,18 @@
+#N canvas 34 2 450 300 10;
+#X floatatom 56 81 8 0 0 0 - - -;
+#X symbolatom 46 59 10 0 0 0 - - -;
+#X floatatom 54 178 4 0 0 0 - - -;
+#X msg 37 38 A B C;
+#X msg 55 199 list 49 50 51;
+#X obj 58 139 print any2bytes-out;
+#X obj 37 254 print bytes2any-out;
+#X obj 37 108 any2string;
+#X obj 37 230 string2any;
+#X connect 0 0 7 0;
+#X connect 1 0 7 0;
+#X connect 2 0 8 0;
+#X connect 3 0 7 0;
+#X connect 4 0 8 0;
+#X connect 7 0 5 0;
+#X connect 7 0 8 0;
+#X connect 8 0 6 0;

Modified: trunk/externals/moocow/pdstring/src/wchars2any-help.pd
===================================================================
--- trunk/externals/moocow/pdstring/src/wchars2any-help.pd	2009-01-27 09:19:55 UTC (rev 10660)
+++ trunk/externals/moocow/pdstring/src/wchars2any-help.pd	2009-01-27 21:39:35 UTC (rev 10661)
@@ -1,13 +1,13 @@
-#N canvas 101 18 612 604 10;
+#N canvas 103 20 612 604 10;
 #X text 13 52 INLETS:;
 #X text 309 54 OUTLETS:;
 #X text 325 68 1 - pd messages;
 #X text 325 82 2 - bang on done;
 #X msg 24 113 97 32 98 32 99;
 #X msg 39 135 97 0 98 0 99;
-#X msg 92 206 0;
-#X msg 60 206 -1;
-#X msg 124 206 32;
+#X msg 163 212 0;
+#X msg 131 212 -1;
+#X msg 195 212 32;
 #X text 163 350 First argument: initial buffer size (length of object-local
 text buffer). This should get re-allocated when necessary. Specify
 0 (zero) to use the default value.;
@@ -30,8 +30,10 @@
 #X text 59 7 wchars2any : convert lists of wchar_t values to pd messages
 ;
 #X text 27 68 1 - wchar_t-valued float lists;
-#X text 166 202 The second inlet is as for [bytes2any];
+#X text 237 208 The second inlet is as for [bytes2any];
 #X obj 169 570 locale;
+#X msg 71 186 960 948;
+#X text 171 183 ... real wide characters: "&pi &delta";
 #X connect 4 0 23 0;
 #X connect 5 0 23 0;
 #X connect 6 0 23 1;
@@ -40,3 +42,4 @@
 #X connect 22 0 23 0;
 #X connect 23 0 21 0;
 #X connect 23 1 20 0;
+#X connect 28 0 23 0;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Pd-cvs mailing list