summaryrefslogtreecommitdiff
path: root/dviware/umddvi/h/num.h
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /dviware/umddvi/h/num.h
Initial commit
Diffstat (limited to 'dviware/umddvi/h/num.h')
-rw-r--r--dviware/umddvi/h/num.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/dviware/umddvi/h/num.h b/dviware/umddvi/h/num.h
new file mode 100644
index 0000000000..823bb3f5b5
--- /dev/null
+++ b/dviware/umddvi/h/num.h
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 1987 University of Maryland Department of Computer Science.
+ * All rights reserved. Permission to copy for any purpose is hereby granted
+ * so long as this copyright notice remains intact.
+ */
+
+/*
+ * Pointer I/O: numbers.
+ *
+ * We deal in fixed format numbers and pointers here.
+ * For file I/O, see fio.h.
+ */
+
+/*
+ * Get one unsigned byte. Note that this is a proper expression.
+ * The rest have more limited contexts, and are therefore OddLy
+ * CapItaliseD.
+ */
+#define pgetbyte(p) UnSign8(*(p)++)
+
+/*
+ * Get a two-byte unsigned integer, a three-byte unsigned integer,
+ * or a four-byte signed integer.
+ */
+#define pGetWord(p, r) ((r) = UnSign8(*(p)++) << 8, \
+ (r) |= UnSign8(*(p)++))
+#define pGet3Byte(p,r) ((r) = UnSign8(*(p)++) << 16, \
+ (r) |= UnSign8(*(p)++) << 8, \
+ (r) |= UnSign8(*(p)++))
+#define pGetLong(p, r) ((r) = UnSign8(*(p)++) << 24, \
+ (r) |= UnSign8(*(p)++) << 16, \
+ (r) |= UnSign8(*(p)++) << 8, \
+ (r) |= UnSign8(*(p)++))
+
+/*
+ * ADD pputbyte, pPutWord, pPut3Byte, pPutLong HERE IF THEY PROVE
+ * USEFUL. (But then must consider changing PutWord &c in fio.h.)
+ */