Check-in [f3c0a33c84]
Overview
Comment:Updated to string-ify Tcl script using "sed"
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: f3c0a33c84fdf79521c8ff529663d242a5bf2ba0
User & Date: rkeene on 2014-09-10 07:29:12
Other Links: manifest | tags
Context
2014-09-10
07:33
Removed extraneous reference to stringify check-in: ce18c8a9b9 user: rkeene tags: trunk
07:29
Updated to string-ify Tcl script using "sed" check-in: f3c0a33c84 user: rkeene tags: trunk
07:24
Finished renames check-in: 6958ab0b94 user: rkeene tags: trunk
Changes

Modified Makefile from [66bca1d85f] to [7cb5c594ef].

22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
appfsd: appfsd.o
	$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o appfsd appfsd.o $(LIBS)

appfsd.o: appfsd.c appfsd.tcl.h
	$(CC) $(CPPFLAGS) $(CFLAGS) -o appfsd.o -c appfsd.c

appfsd.tcl.h: appfsd.tcl stringify.tcl
	./stringify.tcl appfsd.tcl > appfsd.tcl.h.new
	mv appfsd.tcl.h.new appfsd.tcl.h

install: appfsd
	cp appfsd $(bindir)

clean:
	rm -f appfsd appfsd.o







|







22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
appfsd: appfsd.o
	$(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o appfsd appfsd.o $(LIBS)

appfsd.o: appfsd.c appfsd.tcl.h
	$(CC) $(CPPFLAGS) $(CFLAGS) -o appfsd.o -c appfsd.c

appfsd.tcl.h: appfsd.tcl stringify.tcl
	sed 's@[\\"]@\\&@g;s@^@   "@;s@$$@\\n"@' appfsd.tcl > appfsd.tcl.h.new
	mv appfsd.tcl.h.new appfsd.tcl.h

install: appfsd
	cp appfsd $(bindir)

clean:
	rm -f appfsd appfsd.o

Deleted stringify.tcl version [07e25e6903].

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/bin/env tclsh

proc stringifyfile {filename {key 0}} {
	catch {
		set fd [open $filename r]
	}

	if {![info exists fd]} {
		return ""
	}

	set data [read -nonewline $fd]
	close $fd

	foreach line [split $data \n] {
		set line [string map [list "\\" "\\\\" "\"" "\\\""] $line]
		append ret "	\"$line\\n\"\n"
	}

	return $ret
}

foreach file $argv {
	puts -nonewline [stringifyfile $file]
}

exit 0
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<