]> granicus.if.org Git - graphviz/commitdiff
add lefty, dotty, lneato to graphviz2 tree
authorellson <devnull@localhost>
Thu, 6 Jan 2005 15:01:44 +0000 (15:01 +0000)
committerellson <devnull@localhost>
Thu, 6 Jan 2005 15:01:44 +0000 (15:01 +0000)
cmd/lneato/lneato.ksh [new file with mode: 0755]
cmd/lneato/lneato.sh [new file with mode: 0755]

diff --git a/cmd/lneato/lneato.ksh b/cmd/lneato/lneato.ksh
new file mode 100755 (executable)
index 0000000..f64875b
--- /dev/null
@@ -0,0 +1,83 @@
+#!/bin/ksh
+
+FILES=""
+MLEVEL="0"
+LMODE="async"
+
+function usage {
+    print "usage: lneato [-V] [-lm (sync|async)] [-el (0|1)] <filename>"
+}
+
+function processoptions {
+    while [[ $# > 0 ]] do
+        case $1 in
+        -V)
+            print "lneato version 96b (06-24-96)"
+            shift
+            ;;
+        -lm)
+            shift
+            LMODE=$1
+            if [[ $LMODE != 'sync' && $LMODE != 'async' ]] then
+                usage
+                exit 1
+            fi
+            shift
+            ;;
+        -el)
+            shift
+            MLEVEL=$1
+            if [[ $MLEVEL != '0' && $MLEVEL != '1' ]] then
+                usage
+                exit 1
+            fi
+            shift
+            ;;
+        -)
+            FILES="$(print $FILES "'"$1"'")"
+            shift
+            ;;
+        -*)
+            usage
+            exit 1
+            ;;
+        *)
+            FILES="$(print $FILES "'"$1"'")"
+            shift
+            ;;
+        esac
+    done
+}
+
+if [[ $DOTTYOPTIONS != '' ]] then
+    processoptions $DOTTYOPTIONS
+fi
+processoptions "$@"
+
+if [[ $DOTTYPATH != '' ]] then
+    LEFTYPATH="$DOTTYPATH:$LEFTYPATH"
+fi
+
+CMDS=""
+
+CMDS="dotty.protogt.layoutmode = '$LMODE';"
+
+CMDS="$(print $CMDS dotty.mlevel = $MLEVEL";")"
+
+if [[ $FILES == '' ]] then
+    FILES=null
+fi
+FUNC="dotty.createviewandgraph"
+for i in $FILES; do
+    CMDS="$(print $CMDS $FUNC \($i, "'"file"'", null, null\)";")"
+done
+
+lefty -e "
+load ('dotty.lefty');
+dotty.protogt.lserver = 'neato';
+dotty.protogt.graph.type = 'graph';
+dotty.init ();
+monitorfile = dotty.monitorfile;
+$CMDS
+txtview ('off');
+"
diff --git a/cmd/lneato/lneato.sh b/cmd/lneato/lneato.sh
new file mode 100755 (executable)
index 0000000..7ffd3fa
--- /dev/null
@@ -0,0 +1,100 @@
+#!/bin/sh
+FILES=""
+MLEVEL="0"
+LMODE="async"
+
+usage="echo usage: lneato [-V] [-lm (sync|async)] [-el (0|1)] <filename>"
+
+if test "x$DOTTYOPTIONS" != "x"
+then
+    options=$DOTTYOPTIONS
+else
+    options="$@"
+fi
+
+set -- $options
+
+for i in "$@"
+do
+       if test "x$i" = "x$1"
+       then
+               case $i in
+               -V)
+                       shift
+                       echo "lneato version 95 (04-18-95)"
+                       ;;
+               -lm)
+                       shift
+                       LMODE="$1"
+                       shift
+                       if test "x$LMODE" != "xsync" -a "x$LMODE" != "xasync"
+                       then
+                               $usage
+                               exit 1
+                       fi
+                       ;;
+               -el)
+                       shift
+                       MLEVEL="$1"
+                       shift
+                       if test "x$MLEVEL" != "x0" -a "x$MLEVEL" != "x1"
+                       then
+                               $usage
+                               exit 1
+                       fi
+                       ;;
+               -?*)
+                       $usage
+                       exit 1
+                       ;;
+               *)
+                       FILES="$FILES '"$1"'"
+                       shift
+                       ;;
+               esac
+       fi
+done
+
+if test "x$MLEVEL" != "x0"
+then
+       echo "FILES  = $FILES"
+       echo "MLEVEL = $MLEVEL"
+       echo "LMODE  = $LMODE"
+fi
+
+if test "x$DOTTYPATH" != "x"
+then
+    LEFTYPATH="$DOTTYPATH:$LEFTYPATH"
+fi
+
+CMDS="dotty.layoutmode = '$LMODE';"
+CMDS="$CMDS dotty.mlevel = $MLEVEL; dot.mlevel =  $MLEVEL;"
+
+if test "x$FILES" = "x"
+then
+    FILES=null
+fi
+for i in $FILES
+do
+       CMDS="$CMDS dotty.createviewandgraph($i,'file',null,null);"
+done
+
+lefty -e "
+load ('dotty.lefty');
+
+checkpath = function () {
+       if (tablesize(dotty) > 0);      # because tablesize(undef) returns "" not 0
+       else {
+               echo('You must set LEFTYPATH to the lefty lib directory path name.');
+               exit();
+       }
+};
+checkpath ();
+
+dotty.protogt.lserver = 'neato';
+dotty.protogt.graph.type = 'graph';
+dotty.init ();
+monitorfile = dotty.monitorfile;
+$CMDS
+txtview ('off');
+"