Check-in [5989d7a323]
Overview
Comment:Replaced stringify with a simpler "sed" script
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 5989d7a3233920d359edd2da602ca91beebfce38
User & Date: rkeene on 2014-10-28 19:43:43
Other Links: manifest | tags
Context
2014-10-28
19:44
tuapi 0.4 check-in: cc158325f1 user: rkeene tags: trunk
19:43
Replaced stringify with a simpler "sed" script check-in: 5989d7a323 user: rkeene tags: trunk
19:39
Updated to allow user to specify some compilation flags as a part of KitCreator build check-in: 8b9755f077 user: rkeene tags: trunk
Changes

Modified build-common.sh from [82f16cfdad] to [bcc9e1cb0b].

12
13
14
15
16
17
18
19
		exit 0
		;;
	version)
		echo "${tuapi_version}"
		;;
esac

./stringify.tcl tuapi.tcl > tuapi.tcl.h







|
12
13
14
15
16
17
18
19
		exit 0
		;;
	version)
		echo "${tuapi_version}"
		;;
esac

sed 's@[\\"]@\\&@g;s@^@   "@;s@$@\\n"@' tuapi.tcl > tuapi.tcl.h

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
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<