Subversion Repositories planix.SVN

Rev

Rev 2 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 - 1
#!/bin/rc
2
# Print a listing of an object, often a dictionary or an array. Something
3
# like ==, but the output is often easier to read and closer to PostScript
4
# that can be sent back through the interpreter.
5
#
6
 
7
POSTLIB=/sys/lib/postscript/prologues
8
PROLOGUE=$POSTLIB/grabit.ps
9
 
10
COPYFILE=
11
RECURSIVE=true
12
OMITNAMES='/Grabit /GrabitDict'
13
 
14
NONCONFORMING='%!PS'
15
ENDPROLOG='%%EndProlog'
16
BEGINSETUP='%%BeginSetup'
17
ENDSETUP='%%EndSetup'
18
TRAILER='%%Trailer'
19
 
20
SETUP=GrabitSetup
21
 
22
while (! ~ $#* 0 && ~ $1 -*) {
23
	switch ($1) {
24
	case -d;  RECURSIVE=false
25
 
26
	case -o;  shift; OMITNAMES=$OMITNAMES' '$1
27
	case -o*; OMITNAMES=$OMITNAMES' '`{echo $1 | sed s/-o//}
28
 
29
	case -C;  shift; COPYFILE=$COPYFILE' '$1
30
	case -C*; COPYFILE=$COPYFILE' '`{echo $1 | sed s/-C//}
31
 
32
	case -L;  shift; PROLOGUE=$1
33
	case -L*; PROLOGUE=`{echo $1 | sed s/-L//}
34
 
35
	case --;
36
 
37
	case -*;  echo $0: illegal option $1 >[1=2]; exit 1
38
    }
39
    shift
40
done
41
 
42
echo $NONCONFORMING
43
cat $PROLOGUE
44
echo $ENDPROLOG
45
echo $BEGINSETUP
46
if (~ $COPYFILE '') COPYFILE=/dev/null
47
cat $COPYFILE
48
echo 'GrabitDict begin'
49
echo '/recursive '$RECURSIVE' def'
50
 
51
echo mark
52
for (i in $OMITNAMES) {
53
	switch ($i) {
54
	case /*; echo $i
55
	case ?*; echo /$i
56
	}
57
}
58
echo GrabitSetup
59
 
60
echo end
61
echo $ENDSETUP
62
 
63
for (i) echo $i Grabit
64