From 6210937137137fe4019e808686dd1fcf99360af6 Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Wed, 28 Dec 2005 13:44:04 +0000 Subject: [PATCH] Added. --- scripts/bool2silcbool | 10 ++++++++++ scripts/fsmgraph | 34 ++++++++++++++++++++++++++++++---- 2 files changed, 40 insertions(+), 4 deletions(-) create mode 100755 scripts/bool2silcbool diff --git a/scripts/bool2silcbool b/scripts/bool2silcbool new file mode 100755 index 00000000..1321b6a1 --- /dev/null +++ b/scripts/bool2silcbool @@ -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 diff --git a/scripts/fsmgraph b/scripts/fsmgraph index 82772a9e..38377bee 100755 --- a/scripts/fsmgraph +++ b/scripts/fsmgraph @@ -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 -- 2.24.0