Added.
authorPekka Riikonen <priikone@silcnet.org>
Wed, 28 Dec 2005 13:44:04 +0000 (13:44 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Wed, 28 Dec 2005 13:44:04 +0000 (13:44 +0000)
scripts/bool2silcbool [new file with mode: 0755]
scripts/fsmgraph

diff --git a/scripts/bool2silcbool b/scripts/bool2silcbool
new file mode 100755 (executable)
index 0000000..1321b6a
--- /dev/null
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+files=`find . -type f -name \*\.[ch]`
+
+for i in $files
+do
+  cp $i $i.tmp
+  sed -e '/bool /s//SilcBool /' -e '/(bool)/s//(SilcBool)/' -e '/(bool *)/s//(SilcBool *)/' $i.tmp >$i
+  rm $i.tmp
+done
index 82772a9e489134280c90bc405c717c880aacac10..38377bee366106a6db21273e71343468805554b1 100755 (executable)
@@ -45,7 +45,7 @@ do
   tr=`cat $@ | grep -v "^SILC_FSM_STATE($i);" | awk '/^SILC_FSM_STATE\('$i'\)/,/^}/ { if (/\/\*\* /) print; if (/silc_fsm_next/) print; }' | sed 's/^[         ]*//; s/\\/\\*\\* /L:/; s/\\*\\///; s/silc_fsm_next/T:silc_fsm_next/' | sed '/L:/s/ /\\\\/g; /T:/s/ /\\\\/g; s/T:/T: /; s/L:/L: /'`
 
   # Get thread starts
-  threads=`cat $@ | grep -v "^SILC_FSM_STATE($i);" | awk '/^SILC_FSM_STATE\('$i'\)/,/^}/ { if (/silc_fsm_start/) print; }' | cut -d, -f2 | cut -d\) -f1`
+  threads=`cat $@ | grep -v "^SILC_FSM_STATE($i);" | awk '/^SILC_FSM_STATE\('$i'\)/,/^}/ { if (/\/\*\*\* /) print; if (/silc_fsm_start/) print; }' | sed 's/^[ ]*//; s/\\/\\*\\*\\* /L:/; s/\\*\\///; s/silc_fsm_start/T:silc_fsm_start/' | sed '/L:/s/ /\\\\/g; /T:/s/ /\\\\/g; s/T:/T: /; s/L:/L: /'`
 
   # Get async calls
   asyncs=`cat $@ | grep -v "^SILC_FSM_STATE($i);" | awk '/^SILC_FSM_STATE\('$i'\)/,/^}/ { if (/SILC_FSM_CALL\(/) print; }' | sed 's/SILC_FSM_CALL(//' | cut -d= -f2 | cut -d\( -f1`
@@ -79,16 +79,42 @@ do
     trname=`echo $trname | sed 's/\\\\/ /g'`
     trname=`echo $trname | cut -d, -f2 | cut -d\) -f1`
 
-    echo "$i -> $trname [label=\"$label\"];"
+    echo "$i -> $trname [label=\" $label \"];"
 
     trname=""
     label=""
   done
 
   # Draw thread transitions
-  for h in $threads
+  for t in $threads
   do
-    echo "$i -> $h [style=dotted];"
+    if test "$t" = "L:"; then
+      label="$t"
+      continue
+    fi
+    if test "$t" = "T:"; then
+      trname="$t"
+      continue
+    fi
+    if test "$label" = "L:"; then
+      label="$t"
+      continue
+    fi
+    if test "$trname" = "T:"; then
+      trname="$t"
+    fi
+
+    # Unescape
+    if test "$label"; then
+      label=`echo $label | sed 's/\\\\/ /g'`
+    fi
+    trname=`echo $trname | sed 's/\\\\/ /g'`
+    trname=`echo $trname | cut -d, -f2 | cut -d\) -f1`
+
+    echo "$i -> $trname [label=\" $label \"] [style=dotted];"
+
+    trname=""
+    label=""
   done
 
   # Draw async calls