File: tcl2c

package info (click to toggle)
floater 1.2b1-6
  • links: PTS
  • area: non-free
  • in suites: woody
  • size: 1,612 kB
  • ctags: 1,822
  • sloc: ansic: 16,755; tcl: 4,034; sh: 1,291; makefile: 129
file content (27 lines) | stat: -rwxr-xr-x 587 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/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