From a7dc40f29086515c31667490c03211812b84e2ed Mon Sep 17 00:00:00 2001 From: "N.N." Date: Tue, 4 Oct 2005 02:12:44 +0000 Subject: added the remainder of the files (or almost) from GF 0.8.0 svn path=/trunk/; revision=3651 --- externals/gridflow/bin/backtrace | 18 ++++++++++++++++++ externals/gridflow/bin/demangle | 4 ++++ externals/gridflow/bin/jmax2pd | 29 +++++++++++++++++++++++++++++ externals/gridflow/bin/plusminus | 39 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 90 insertions(+) create mode 100755 externals/gridflow/bin/backtrace create mode 100755 externals/gridflow/bin/demangle create mode 100755 externals/gridflow/bin/jmax2pd create mode 100755 externals/gridflow/bin/plusminus (limited to 'externals/gridflow/bin') diff --git a/externals/gridflow/bin/backtrace b/externals/gridflow/bin/backtrace new file mode 100755 index 00000000..ac1358af --- /dev/null +++ b/externals/gridflow/bin/backtrace @@ -0,0 +1,18 @@ +#!/usr/bin/env ruby +if ARGV.length != 1 + puts "usage: core.rb " + exit 1 +end +qfile=ARGV[0].gsub /'/, "\\\\'" +x=`gdb --batch -c '#{qfile}'`.split"\n" +m=/`([^']+)/.match x[0] +f=File.open("/tmp/backtrace_#{$$}.gdb","w") +f.puts"bt" +f.puts"quit" +f.close +cmd="gdb #{m[1]} #{qfile} --command=/tmp/backtrace_#{$$}.gdb" +x=`#{cmd}`.split("\n") +i=nil +x.each_with_index {|line,i| break if /^#0/ =~ line } +x[0..i]=[] +puts x diff --git a/externals/gridflow/bin/demangle b/externals/gridflow/bin/demangle new file mode 100755 index 00000000..923bca25 --- /dev/null +++ b/externals/gridflow/bin/demangle @@ -0,0 +1,4 @@ +#!/usr/bin/env ruby +f = File.popen "gdb", "r+" +f.puts "maintenance demangle #{ARGV[0]}", "quit" +puts f.read.split("\n")[-2].sub(/^\(gdb\) /,"") diff --git a/externals/gridflow/bin/jmax2pd b/externals/gridflow/bin/jmax2pd new file mode 100755 index 00000000..5510656a --- /dev/null +++ b/externals/gridflow/bin/jmax2pd @@ -0,0 +1,29 @@ +#!/usr/bin/env ruby + +require "gridflow" +require "gridflow/extra/jmax_format.rb" +require "gridflow/extra/puredata_format.rb" +include GridFlow +#GridFlow.verbose = true + +iname,oname = ARGV +if not iname + raise "usage: jmax2pd []" +end +if not oname + oname = iname.sub(/\.jmax$/,".pd") +end +keep=["broken","jpatcher","button","slider","messbox"] +GridFlow.instance_eval{@fclasses_set.delete_if {|k,v| + not keep.include? k +}} +#p GridFlow.instance_eval{@fclasses_set.keys.sort} + +jfr = JMaxFileReader.new(File.open(iname),FObject) +FObject.broken_ok = true +FObject.do_loadbangs = false +my_patcher = jfr.parse +pfw = PureDataFileWriter.new(oname) +pfw.write_patcher my_patcher +pfw.close + diff --git a/externals/gridflow/bin/plusminus b/externals/gridflow/bin/plusminus new file mode 100755 index 00000000..685014ce --- /dev/null +++ b/externals/gridflow/bin/plusminus @@ -0,0 +1,39 @@ +#!/usr/bin/env ruby +# NOTE: this works with diff -u only!!! + +puts "-"*64 + +$plustot=0 +$minustot=0 + +def show + printf "%20s %+5d %+5d (net %+5d)\n", $file, $plus, -$minus, $plus-$minus +end + +loop{ + line = gets + break if not line + if /^diff/.match line then + x = line.split(/\s+/) + $plustot+=$plus if $plus + $minustot+=$minus if $minus + show if $file + $file = x[-1] + $on=false + $plus=0 + $minus=0 + elsif /^\@\@/ =~ line then $on=true + elsif $on and /^\+/ =~ line then $plus+=1 + elsif $on and /^\-/ =~ line then $minus+=1 + end +} + +$plustot+=$plus if $plus +$minustot+=$minus if $minus +show if $file + +$file="total" +$plus=$plustot +$minus=$minustot +puts "-"*64 +show -- cgit v1.2.1