More experimentation with the dependency logging features of cpp and xsltproc.
authorMatt McCutchen <hashproduct@gmail.com>
Sun, 3 Jun 2007 13:43:13 +0000 (09:43 -0400)
committerMatt McCutchen <hashproduct@gmail.com>
Sun, 3 Jun 2007 13:43:13 +0000 (09:43 -0400)
experiments/dep-logging/bar.h [new file with mode: 0644]
experiments/dep-logging/bar.xml [new file with mode: 0644]
experiments/dep-logging/barfile [new file with mode: 0644]
experiments/dep-logging/dummy.xml [new file with mode: 0644]
experiments/dep-logging/foo.c [new file with mode: 0644]
experiments/dep-logging/foo.xsl [new file with mode: 0644]
experiments/dep-logging/foofile [new file with mode: 0644]
experiments/dep-logging/sip [moved from experiments/sip with 94% similarity]

diff --git a/experiments/dep-logging/bar.h b/experiments/dep-logging/bar.h
new file mode 100644 (file)
index 0000000..f09c105
--- /dev/null
@@ -0,0 +1,3 @@
+int difference(int a, int b) {
+       return a - b;
+}
diff --git a/experiments/dep-logging/bar.xml b/experiments/dep-logging/bar.xml
new file mode 100644 (file)
index 0000000..958b51d
--- /dev/null
@@ -0,0 +1,4 @@
+<?xml version="1.0"?>
+<bar>
+Hello world!
+</bar>
\ No newline at end of file
diff --git a/experiments/dep-logging/barfile b/experiments/dep-logging/barfile
new file mode 100644 (file)
index 0000000..e90c4a5
--- /dev/null
@@ -0,0 +1 @@
+middle text
diff --git a/experiments/dep-logging/dummy.xml b/experiments/dep-logging/dummy.xml
new file mode 100644 (file)
index 0000000..3894d57
--- /dev/null
@@ -0,0 +1 @@
+<dummy/>
\ No newline at end of file
diff --git a/experiments/dep-logging/foo.c b/experiments/dep-logging/foo.c
new file mode 100644 (file)
index 0000000..1c8b34f
--- /dev/null
@@ -0,0 +1,6 @@
+int sum(int a, int b) {
+       return a + b;
+}
+
+#include "bar.h"
+#include "another.h"
diff --git a/experiments/dep-logging/foo.xsl b/experiments/dep-logging/foo.xsl
new file mode 100644 (file)
index 0000000..67c95c6
--- /dev/null
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0"
+       xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+       xmlns:exslt="http://exslt.org/common"
+>
+       <xsl:template match="/">
+               <information>
+                       <xsl:copy-of select="document('bar.xml')"/>
+                       <xsl:copy-of select="document('bzing.xml')"/>
+               </information>
+       </xsl:template>
+       
+</xsl:stylesheet>
diff --git a/experiments/dep-logging/foofile b/experiments/dep-logging/foofile
new file mode 100644 (file)
index 0000000..cefb6e5
--- /dev/null
@@ -0,0 +1,3 @@
+beginning text
+include barfile
+ending text
similarity index 94%
rename from experiments/sip
rename to experiments/dep-logging/sip
index 12e0579..43735ec 100755 (executable)
@@ -8,6 +8,7 @@ exec >"$2"
 
 function do_read {
        echo "$1" >&3
+       [ -r "$1" ] || exit 1
        while IFS='' read line; do
                if [[ "$line" == "include "* ]]; then
                        do_read "${line#include }"