Bell 32V development
authorTom London <tbl@research.uucp>
Fri, 26 Jan 1979 04:10:36 +0000 (23:10 -0500)
committerTom London <tbl@research.uucp>
Fri, 26 Jan 1979 04:10:36 +0000 (23:10 -0500)
Work on file usr/src/cmd/sdb/cdefs.h

Co-Authored-By: John Reiser <jfr@research.uucp>
Synthesized-from: 32v

usr/src/cmd/sdb/cdefs.h [new file with mode: 0644]

diff --git a/usr/src/cmd/sdb/cdefs.h b/usr/src/cmd/sdb/cdefs.h
new file mode 100644 (file)
index 0000000..e8c946d
--- /dev/null
@@ -0,0 +1,32 @@
+/* type modifiers */
+
+# define PTR  020
+# define FTN  040
+# define ARY  060
+
+/* type packing constants */
+
+# define TMASK 060
+# define TMASK1 0300
+# define TMASK2  0360
+# define BTMASK 017
+# define BTSHIFT 4
+# define TSHIFT 2
+
+/*     macros  */
+
+# define BTYPE(x)  (x&BTMASK)   /* basic type of x */
+# define ISUNSIGNED(x) ((x)<=ULONG&&(x)>=UCHAR)
+# define UNSIGNABLE(x) ((x)<=LONG&&(x)>=CHAR)
+# define ENUNSIGN(x) ((x)+(UNSIGNED-INT))
+# define DEUNSIGN(x) ((x)+(INT-UNSIGNED))
+# define ISPTR(x) ((x&TMASK)==PTR)
+# define ISFTN(x)  ((x&TMASK)==FTN)  /* is x a function type */
+# define ISARY(x)   ((x&TMASK)==ARY)   /* is x an array type */
+# define INCREF(x) (((x&~BTMASK)<<TSHIFT)|PTR|(x&BTMASK))
+# define DECREF(x) (((x>>TSHIFT)&~BTMASK)|(x&BTMASK))
+       /* pack and unpack field descriptors (size and offset) */
+# define PKFIELD(s,o) ((o<<6)|s)
+# define UPKFSZ(v)  (v&077)
+# define UPKFOFF(v) (v>>6)
+