git » fp-git.git » commit 8db0fc4

Added to get the frame id of a resource.

author ecalot
2004-08-16 07:24:37 UTC
committer ecalot
2004-08-16 07:24:37 UTC
parent 270134ef51410e09361152afeafef3531e3762fd

Added to get the frame id of a resource.

FP/src/conf/resinfo +35 -0

diff --git a/FP/src/conf/resinfo b/FP/src/conf/resinfo
new file mode 100755
index 0000000..2fcdf06
--- /dev/null
+++ b/FP/src/conf/resinfo
@@ -0,0 +1,35 @@
+#!/bin/sh
+
+AWK=`which awk`
+if [ $? != 0 ]; then echo "Error. Awk is needed by the instalation script, please install it.";exit 1; fi
+GREP=`which grep`
+if [ $? != 0 ]; then echo "Error. Grep not found!";exit 1; fi
+
+#resources
+$GREP resources.conf -v -e '\(^$\)\|^#' |$AWK "
+
+{
+	res=0
+	for (i=3;i<=NF;i++) {
+		if (match(\$i,/^[0-9]*-[0-9]*$/)) {
+			split(\$i,a,\"-\")
+			for (g=a[1];g<=a[2];g++) {
+				if (g==\"$1\") {
+					printf \"def=%s; res=%4s; frame=%4d\\n\",\$1,g,res
+				}
+				res++
+			}
+		} else {
+			res++
+			if (\$i==\"$1\") {
+				printf \"def=%s; res=%4s; frame=%4d\\n\",\$1,\$i,res
+			}
+		}
+	}
+}
+"
+
+#footer
+exit 0
+
+