summaryrefslogtreecommitdiff
path: root/sys/src/cmd/postscript/grabit/grabit.rc
diff options
context:
space:
mode:
authorTaru Karttunen <taruti@taruti.net>2011-03-30 15:46:40 +0300
committerTaru Karttunen <taruti@taruti.net>2011-03-30 15:46:40 +0300
commite5888a1ffdae813d7575f5fb02275c6bb07e5199 (patch)
treed8d51eac403f07814b9e936eed0c9a79195e2450 /sys/src/cmd/postscript/grabit/grabit.rc
Import sources from 2011-03-30 iso image
Diffstat (limited to 'sys/src/cmd/postscript/grabit/grabit.rc')
-rwxr-xr-xsys/src/cmd/postscript/grabit/grabit.rc64
1 files changed, 64 insertions, 0 deletions
diff --git a/sys/src/cmd/postscript/grabit/grabit.rc b/sys/src/cmd/postscript/grabit/grabit.rc
new file mode 100755
index 000000000..1f06c2176
--- /dev/null
+++ b/sys/src/cmd/postscript/grabit/grabit.rc
@@ -0,0 +1,64 @@
+#!/bin/rc
+# Print a listing of an object, often a dictionary or an array. Something
+# like ==, but the output is often easier to read and closer to PostScript
+# that can be sent back through the interpreter.
+#
+
+POSTLIB=/sys/lib/postscript/prologues
+PROLOGUE=$POSTLIB/grabit.ps
+
+COPYFILE=
+RECURSIVE=true
+OMITNAMES='/Grabit /GrabitDict'
+
+NONCONFORMING='%!PS'
+ENDPROLOG='%%EndProlog'
+BEGINSETUP='%%BeginSetup'
+ENDSETUP='%%EndSetup'
+TRAILER='%%Trailer'
+
+SETUP=GrabitSetup
+
+while (! ~ $#* 0 && ~ $1 -*) {
+ switch ($1) {
+ case -d; RECURSIVE=false
+
+ case -o; shift; OMITNAMES=$OMITNAMES' '$1
+ case -o*; OMITNAMES=$OMITNAMES' '`{echo $1 | sed s/-o//}
+
+ case -C; shift; COPYFILE=$COPYFILE' '$1
+ case -C*; COPYFILE=$COPYFILE' '`{echo $1 | sed s/-C//}
+
+ case -L; shift; PROLOGUE=$1
+ case -L*; PROLOGUE=`{echo $1 | sed s/-L//}
+
+ case --;
+
+ case -*; echo $0: illegal option $1 >[1=2]; exit 1
+ }
+ shift
+done
+
+echo $NONCONFORMING
+cat $PROLOGUE
+echo $ENDPROLOG
+echo $BEGINSETUP
+if (~ $COPYFILE '') COPYFILE=/dev/null
+cat $COPYFILE
+echo 'GrabitDict begin'
+echo '/recursive '$RECURSIVE' def'
+
+echo mark
+for (i in $OMITNAMES) {
+ switch ($i) {
+ case /*; echo $i
+ case ?*; echo /$i
+ }
+}
+echo GrabitSetup
+
+echo end
+echo $ENDSETUP
+
+for (i) echo $i Grabit
+