summaryrefslogtreecommitdiff
path: root/ipl/gprocs/pattread.icn
diff options
context:
space:
mode:
Diffstat (limited to 'ipl/gprocs/pattread.icn')
-rw-r--r--ipl/gprocs/pattread.icn42
1 files changed, 42 insertions, 0 deletions
diff --git a/ipl/gprocs/pattread.icn b/ipl/gprocs/pattread.icn
new file mode 100644
index 0000000..d9613d5
--- /dev/null
+++ b/ipl/gprocs/pattread.icn
@@ -0,0 +1,42 @@
+############################################################################
+#
+# File: pattread.icn
+#
+# Subject: Procedure to read pattern
+#
+# Author: Ralph E. Griswold
+#
+# Date: December 10, 2001
+#
+############################################################################
+#
+# This file is in the public domain.
+#
+############################################################################
+#
+# Reads BLP or row file and produces pattern in row form.
+#
+############################################################################
+#
+# Links: patutils
+#
+############################################################################
+
+link patutils
+
+procedure pattread(file)
+ local line, rows
+
+ line := read(file) | fail
+
+ line ? {
+ if upto("#", line) then rows := pat2rows(line)
+ else {
+ rows := [line]
+ while put(rows, read(file)) # read in row pattern
+ }
+ }
+
+ return rows
+
+end