~ubuntu-branches/ubuntu/lucid/graphviz/lucid-security

« back to all changes in this revision

Viewing changes to dotty/dotty.bsh

  • Committer: Bazaar Package Importer
  • Author(s): Stephen M Moraco
  • Date: 2002-02-05 18:52:12 UTC
  • Revision ID: james.westby@ubuntu.com-20020205185212-8i04c70te00rc40y
Tags: upstream-1.7.16
ImportĀ upstreamĀ versionĀ 1.7.16

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
 
 
3
FILES=""
 
4
MLEVEL="0"
 
5
LMODE="async"
 
6
 
 
7
usage='echo "usage: dotty [-V] [-lm (sync|async)] [-el (0|1)] <filename>"'
 
8
 
 
9
if [ "x$DOTTYOPTIONS" != "x" ]; then
 
10
    set -- $DOTTYOPTIONS $*
 
11
fi
 
12
 
 
13
while [ "x$1" != 'x' ]; do
 
14
    case $1 in
 
15
    -V)
 
16
        echo "dotty version 96c (09-24-96)"
 
17
        shift
 
18
        ;;
 
19
    -f)
 
20
        shift
 
21
        loadfile=$1
 
22
        shift
 
23
        ;;
 
24
    -lm)
 
25
        shift
 
26
        LMODE=$1
 
27
        if [ "x$LMODE" != 'xsync' -a "x$LMODE" != 'xasync' ]; then
 
28
            $usage
 
29
            exit 1
 
30
        fi
 
31
        shift
 
32
        ;;
 
33
    -el)
 
34
        shift
 
35
        MLEVEL=$1
 
36
        if [ "x$MLEVEL" != 'x0' -a "x$MLEVEL" != 'x1' ]; then
 
37
            $usage
 
38
            exit 1
 
39
        fi
 
40
        shift
 
41
        ;;
 
42
    -)
 
43
        FILES=`echo $FILES \"$1\"`
 
44
        shift
 
45
        ;;
 
46
    -*)
 
47
        $usage
 
48
        exit 1
 
49
        ;;
 
50
    *)
 
51
        FILES=`echo $FILES \"$1\"`
 
52
        shift
 
53
        ;;
 
54
    esac
 
55
done
 
56
 
 
57
if [ "x$DOTTYPATH" != 'x' ]; then
 
58
    LEFTYPATH="$DOTTYPATH:$LEFTYPATH"
 
59
fi
 
60
 
 
61
CMDS=""
 
62
 
 
63
CMDS="dotty.protogt.layoutmode = '$LMODE';"
 
64
 
 
65
CMDS=`echo $CMDS dotty.mlevel = $MLEVEL";"`
 
66
 
 
67
if [ "x$loadfile" != 'x' ]; then
 
68
    CMDS=`echo $CMDS load \("'"$loadfile"'"\)";"`
 
69
fi
 
70
 
 
71
if [ "x$FILES" = 'x' ]; then
 
72
    FILES=null
 
73
fi
 
74
FUNC="dotty.createviewandgraph"
 
75
for i in $FILES; do
 
76
    CMDS=`echo $CMDS $FUNC \($i, "'"file"'", null, null\)";"`
 
77
done
 
78
 
 
79
leftypath=`which lefty`
 
80
if [ ! -f "$leftypath" ]; then
 
81
    echo "dotty: cannot locate the lefty program"
 
82
    echo "       make sure that your path includes"
 
83
    echo "       the directory containing dotty and lefty"
 
84
    exit 1
 
85
fi
 
86
 
 
87
exec $leftypath -e "
 
88
load ('dotty.lefty');
 
89
checkpath = function () {
 
90
    if (tablesize (dotty) > 0)
 
91
        remove ('checkpath');
 
92
    else {
 
93
        echo ('dotty: cannot locate the dotty scripts');
 
94
        echo ('       make sure that the environment variable LEFTYPATH');
 
95
        echo ('       is set to the directory containing dotty.lefty');
 
96
        exit ();
 
97
    }
 
98
};
 
99
checkpath ();
 
100
dotty.init ();
 
101
monitorfile = dotty.monitorfile;
 
102
$CMDS
 
103
txtview ('off');
 
104
"