From fa91a07f8f6ced306f2a42ccfd4c30d478ee11a6 Mon Sep 17 00:00:00 2001 From: Bryan Jurish Date: Thu, 12 Feb 2009 22:14:51 +0000 Subject: + pdstring: added abstractions any2string.pd, string2any.pd for single-object-external builds + locale: added uselocale.pd (not installed by default) svn path=/trunk/externals/moocow/pdstring/; revision=10762 --- Makefile.in | 1 + configure | 59 ++++++++++++++++++++++++++++++++++++++++++++----------- configure.ac | 4 +++- src/Makefile.am | 19 ++++++++++-------- src/Makefile.in | 24 ++++++++++++---------- src/any2bytes.c | 8 ++++++++ src/any2string.pd | 13 ++++++++++++ src/bytes2any.c | 8 ++++++++ src/string2any.pd | 15 ++++++++++++++ 9 files changed, 121 insertions(+), 30 deletions(-) create mode 100644 src/any2string.pd create mode 100644 src/string2any.pd diff --git a/Makefile.in b/Makefile.in index 3385acc..467b14b 100644 --- a/Makefile.in +++ b/Makefile.in @@ -391,6 +391,7 @@ distclean-tags: distdir: $(DISTFILES) $(am__remove_distdir) mkdir $(distdir) + $(mkdir_p) $(distdir)/src @srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's|.|.|g'`; \ list='$(DISTFILES)'; for file in $$list; do \ diff --git a/configure b/configure index beb94e5..144a696 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.61 for pdstring 0.09. +# Generated by GNU Autoconf 2.61 for pdstring 0.10. # # Report bugs to . # @@ -574,8 +574,8 @@ SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='pdstring' PACKAGE_TARNAME='pdstring' -PACKAGE_VERSION='0.09' -PACKAGE_STRING='pdstring 0.09' +PACKAGE_VERSION='0.10' +PACKAGE_STRING='pdstring 0.10' PACKAGE_BUGREPORT='moocow@ling.uni-potsdam.de' ac_default_prefix=/usr/local @@ -1186,7 +1186,7 @@ if test "$ac_init_help" = "long"; then # 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.09 to adapt to many kinds of systems. +\`configure' configures pdstring 0.10 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1252,7 +1252,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of pdstring 0.09:";; + short | recursive ) echo "Configuration of pdstring 0.10:";; esac cat <<\_ACEOF @@ -1348,7 +1348,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -pdstring configure 0.09 +pdstring configure 0.10 generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, @@ -1362,7 +1362,7 @@ cat >config.log <<_ACEOF 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.09, which was +It was created by pdstring $as_me 0.10, which was generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ @@ -2037,7 +2037,7 @@ fi # Define the identity of the package. PACKAGE=pdstring - VERSION=0.09 + VERSION=0.10 cat >>confdefs.h <<_ACEOF @@ -3837,6 +3837,10 @@ EXT=$PDEXT CFLAGS="$UCFLAGS" CPPFLAGS="$UCPPFLAGS" +ac_config_links="$ac_config_links src/any2string-help.pd:src/any2bytes-help.pd" + +ac_config_links="$ac_config_links src/string2any-help.pd:src/bytes2any-help.pd" + ac_config_files="$ac_config_files config/Makefile src/Makefile Makefile" cat >confcache <<\_ACEOF @@ -4263,7 +4267,7 @@ exec 6>&1 # 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.09, which was +This file was extended by pdstring $as_me 0.10, which was generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -4281,6 +4285,7 @@ cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" +config_links="$ac_config_links" config_commands="$ac_config_commands" _ACEOF @@ -4308,6 +4313,9 @@ $config_files Configuration headers: $config_headers +Configuration links: +$config_links + Configuration commands: $config_commands @@ -4316,7 +4324,7 @@ Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -pdstring config.status 0.09 +pdstring config.status 0.10 configured by $0, generated by GNU Autoconf 2.61, with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" @@ -4431,6 +4439,8 @@ do case $ac_config_target in "src/config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; + "src/any2string-help.pd") CONFIG_LINKS="$CONFIG_LINKS src/any2string-help.pd:src/any2bytes-help.pd" ;; + "src/string2any-help.pd") CONFIG_LINKS="$CONFIG_LINKS src/string2any-help.pd:src/bytes2any-help.pd" ;; "config/Makefile") CONFIG_FILES="$CONFIG_FILES config/Makefile" ;; "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; @@ -4449,6 +4459,7 @@ done if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_LINKS+set}" = set || CONFIG_LINKS=$config_links test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi @@ -4649,7 +4660,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF fi # test -n "$CONFIG_FILES" -for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS +for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS :L $CONFIG_LINKS :C $CONFIG_COMMANDS do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; @@ -5020,7 +5031,33 @@ echo X$ac_file | } s/.*/./; q'`/stamp-h$_am_stamp_count ;; + :L) + # + # CONFIG_LINK + # + + { echo "$as_me:$LINENO: linking $srcdir/$ac_source to $ac_file" >&5 +echo "$as_me: linking $srcdir/$ac_source to $ac_file" >&6;} + if test ! -r "$srcdir/$ac_source"; then + { { echo "$as_me:$LINENO: error: $srcdir/$ac_source: file not found" >&5 +echo "$as_me: error: $srcdir/$ac_source: file not found" >&2;} + { (exit 1); exit 1; }; } + fi + rm -f "$ac_file" + + # Try a relative symlink, then a hard link, then a copy. + case $srcdir in + [\\/$]* | ?:[\\/]* ) ac_rel_source=$srcdir/$ac_source ;; + *) ac_rel_source=$ac_top_build_prefix$srcdir/$ac_source ;; + esac + ln -s "$ac_rel_source" "$ac_file" 2>/dev/null || + ln "$srcdir/$ac_source" "$ac_file" 2>/dev/null || + cp -p "$srcdir/$ac_source" "$ac_file" || + { { echo "$as_me:$LINENO: error: cannot link or copy $srcdir/$ac_source to $ac_file" >&5 +echo "$as_me: error: cannot link or copy $srcdir/$ac_source to $ac_file" >&2;} + { (exit 1); exit 1; }; } + ;; :C) { echo "$as_me:$LINENO: executing $ac_file commands" >&5 echo "$as_me: executing $ac_file commands" >&6;} ;; diff --git a/configure.ac b/configure.ac index 2793398..1e0f21d 100644 --- a/configure.ac +++ b/configure.ac @@ -4,7 +4,7 @@ AC_PREREQ(2.5) dnl Some handy macros define([THE_PACKAGE_NAME], [pdstring]) -define([THE_PACKAGE_VERSION], [0.09]) +define([THE_PACKAGE_VERSION], [0.10]) define([THE_PACKAGE_AUTHOR], [moocow@ling.uni-potsdam.de]) AC_INIT(THE_PACKAGE_NAME, THE_PACKAGE_VERSION, THE_PACKAGE_AUTHOR) @@ -261,4 +261,6 @@ dnl CFLAGS="$UCFLAGS" CPPFLAGS="$UCPPFLAGS" +AC_CONFIG_LINKS([src/any2string-help.pd:src/any2bytes-help.pd]) +AC_CONFIG_LINKS([src/string2any-help.pd:src/bytes2any-help.pd]) AC_OUTPUT(config/Makefile src/Makefile Makefile) diff --git a/src/Makefile.am b/src/Makefile.am index 9b70299..275a330 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -51,19 +51,22 @@ EXTRA_PROGRAMS = \ ## --- patches pdexterns_DATA = \ any2wchars.pd \ - wchars2any.pd + wchars2any.pd \ + any2string.pd \ + string2any.pd ## --- documentation pddoc_DATA = \ pdstring-help.pd \ + any2string-help.pd \ + string2any-help.pd \ any2bytes-help.pd \ bytes2any-help.pd \ bytes2wchars-help.pd \ wchars2bytes-help.pd \ any2wchars-help.pd \ - wchars2any-help.pd - - printbytes-help.pd + wchars2any-help.pd \ + printbytes-help.pd \ printwchars-help.pd @@ -93,16 +96,16 @@ 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) +# $(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) +# $(LN_S) any2bytes.$(PDEXT) $(pdexternsdir)/any2string.$(PDEXT) +# $(LN_S) bytes2any.$(PDEXT) $(pdexternsdir)/string2any.$(PDEXT) endif uninstall-local: diff --git a/src/Makefile.in b/src/Makefile.in index 48056b8..25fb64b 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -64,6 +64,7 @@ EXTRA_PROGRAMS = pdstring$(EXEEXT) any2bytes$(EXEEXT) \ subdir = src SUBDIRS = DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ + $(srcdir)/any2bytes-help.pd $(srcdir)/bytes2any-help.pd \ $(srcdir)/config.h.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac @@ -71,7 +72,7 @@ am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = config.h -CONFIG_CLEAN_FILES = +CONFIG_CLEAN_FILES = any2string-help.pd string2any-help.pd @WANT_OBJECT_EXTERNALS_TRUE@am__EXEEXT_1 = any2bytes$(EXEEXT) \ @WANT_OBJECT_EXTERNALS_TRUE@ bytes2any$(EXEEXT) \ @WANT_OBJECT_EXTERNALS_TRUE@ bytes2wchars$(EXEEXT) \ @@ -244,16 +245,22 @@ target_alias = @target_alias@ SUFFIXES = .@PDEXT@ pdexterns_DATA = \ any2wchars.pd \ - wchars2any.pd + wchars2any.pd \ + any2string.pd \ + string2any.pd pddoc_DATA = \ pdstring-help.pd \ + any2string-help.pd \ + string2any-help.pd \ any2bytes-help.pd \ bytes2any-help.pd \ bytes2wchars-help.pd \ wchars2bytes-help.pd \ any2wchars-help.pd \ - wchars2any-help.pd + wchars2any-help.pd \ + printbytes-help.pd \ + printwchars-help.pd #----------------------------------------------------------------------- @@ -751,9 +758,6 @@ uninstall-info: uninstall-info-recursive uninstall-pdexternsDATA uninstall-pdexternsPROGRAMS - printbytes-help.pd - printwchars-help.pd - #----------------------------------------------------------------------- # aliases via install hook #----------------------------------------------------------------------- @@ -761,14 +765,14 @@ uninstall-info: uninstall-info-recursive @WANT_OBJECT_EXTERNALS_TRUE@all-local: @WANT_OBJECT_EXTERNALS_TRUE@ rm -f any2string.$(PDEXT) @WANT_OBJECT_EXTERNALS_TRUE@ rm -f string2any.$(PDEXT) -@WANT_OBJECT_EXTERNALS_TRUE@ $(LN_S) any2bytes.$(PDEXT) any2string.$(PDEXT) -@WANT_OBJECT_EXTERNALS_TRUE@ $(LN_S) bytes2any.$(PDEXT) string2any.$(PDEXT) +# $(LN_S) any2bytes.$(PDEXT) any2string.$(PDEXT) +# $(LN_S) bytes2any.$(PDEXT) string2any.$(PDEXT) install-data-hook: rm -f $(pdexternsdir)/any2string.$(PDEXT) rm -f $(pdexternsdir)/string2any.$(PDEXT) -@WANT_OBJECT_EXTERNALS_TRUE@ $(LN_S) any2bytes.$(PDEXT) $(pdexternsdir)/any2string.$(PDEXT) -@WANT_OBJECT_EXTERNALS_TRUE@ $(LN_S) bytes2any.$(PDEXT) $(pdexternsdir)/string2any.$(PDEXT) +# $(LN_S) any2bytes.$(PDEXT) $(pdexternsdir)/any2string.$(PDEXT) +# $(LN_S) bytes2any.$(PDEXT) $(pdexternsdir)/string2any.$(PDEXT) uninstall-local: rm -f $(pdexternsdir)/any2string.$(PDEXT) diff --git a/src/any2bytes.c b/src/any2bytes.c index 4760c5f..df2376a 100644 --- a/src/any2bytes.c +++ b/src/any2bytes.c @@ -165,7 +165,9 @@ void any2bytes_setup_guts(void) 0); //-- alias +#ifndef PDSTRING_OBJECT_EXTERNALS class_addcreator((t_newmethod)any2bytes_new, gensym("any2string"), A_GIMME, 0); +#endif //-- methods class_addanything(any2bytes_class, (t_method)any2bytes_anything); @@ -187,6 +189,11 @@ void any2bytes_setup(void) any2bytes_setup_guts(); } +#if 0 +/*-- + this (with symlink install) causes pd-extended 0.41.4 20090209 to puke. + bug report by hcs, Thu, 12 Feb 2009 +*/ /*-------------------------------------------------------------------- * setup (any2string alias) */ @@ -195,3 +202,4 @@ void any2string_setup(void) { post("any2string_setup(): Prefer [any2bytes] over [any2string]."); any2bytes_setup(); } +#endif diff --git a/src/any2string.pd b/src/any2string.pd new file mode 100644 index 0000000..d227144 --- /dev/null +++ b/src/any2string.pd @@ -0,0 +1,13 @@ +#N canvas 0 0 450 300 10; +#X obj 41 47 inlet; +#X obj 141 47 inlet; +#X obj 41 117 outlet; +#X obj 41 83 any2bytes \$1 \$2; +#X text 38 12 any2string.pd : wrapper for any2bytes; +#X text 30 169 WARNING: this abstraction will never be used if [pdstring] +was built as a multi-object library \, rather than single-object externals. +; +#X text 142 263 Bryan Jurish ; +#X connect 0 0 3 0; +#X connect 1 0 3 1; +#X connect 3 0 2 0; diff --git a/src/bytes2any.c b/src/bytes2any.c index a7dc5b2..2d7ccb4 100644 --- a/src/bytes2any.c +++ b/src/bytes2any.c @@ -210,7 +210,9 @@ void bytes2any_setup_guts(void) 0); //-- alias +#ifndef PDSTRING_OBJECT_EXTERNALS class_addcreator((t_newmethod)bytes2any_new, gensym("string2any"), A_GIMME, 0); +#endif //-- methods class_addanything(bytes2any_class, (t_method)bytes2any_anything); @@ -231,6 +233,11 @@ void bytes2any_setup(void) bytes2any_setup_guts(); } +#if 0 +/*-- + this (with symlink install) causes pd-extended 0.41.4 20090209 to puke. + bug report by hcs, Thu, 12 Feb 2009 +*/ /*-------------------------------------------------------------------- * setup (string2any alias) */ @@ -239,3 +246,4 @@ void string2any_setup(void) { post("string2any_setup(): Prefer [bytes2any] over [string2any]."); bytes2any_setup(); } +#endif diff --git a/src/string2any.pd b/src/string2any.pd new file mode 100644 index 0000000..ccdf97b --- /dev/null +++ b/src/string2any.pd @@ -0,0 +1,15 @@ +#N canvas 332 122 450 300 10; +#X obj 41 47 inlet; +#X obj 141 47 inlet; +#X obj 41 117 outlet; +#X text 38 12 string2any.pd : wrapper for bytes2any; +#X obj 41 83 bytes2any \$1 \$2; +#X obj 141 117 outlet; +#X text 30 169 WARNING: this abstraction will never be used if [pdstring] +was built as a multi-object library \, rather than single-object externals. +; +#X text 142 263 Bryan Jurish ; +#X connect 0 0 4 0; +#X connect 1 0 4 1; +#X connect 4 0 2 0; +#X connect 4 1 5 0; -- cgit v1.2.1