#!/usr/local/bin/tclsh

exec cp floatcl1.c floatcl.c
set n 0
set quote \"
set comma ", "
set s ""
foreach arg $argv {
    if {[incr n] != 1} {set s $s$comma}
    set s $s$quote$arg$quote
}

set f [open floatcl.c a]
puts $f "$s};\nchar *tcl2cfiles\[\] = \{"
close $f

set n 0
foreach arg $argv {
    puts "Processing $arg"
    if {[incr n] != 1} {exec cat << ",\n" >> floatcl.c}
    exec cat << $quote >> floatcl.c
    exec sed s/\\\\/\\\\\\\\/g $arg | sed s/\"/\\\\\"/g | \
	    sed s/\\\\\\\\$/\\\\/g >> floatcl.c
    exec cat << $quote >> floatcl.c
}

exec cat floatcl2.c >> floatcl.c
