+2000-05-24 Dirk Herrmann <D.Herrmann@tu-bs.de>
+
+ * fports.c (fport_write), ports.c (scm_markstream, scm_port_mode,
+ scm_print_port_mode), ports.h (SCM_OPPORTP, SCM_OPINPORTP,
+ SCM_OPOUTPORTP, SCM_INPUT_PORT_P, SCM_OUTPUT_PORT_P, SCM_OPENP),
+ procs.h (SCM_CLOSCAR), unif.h (SCM_ARRAY_NDIM, SCM_ARRAY_CONTP),
+ variable.h (SCM_VARIABLEP): Replace SCM_UNPACK_CAR
+ appropriately.
+
2000-05-23 Dirk Herrmann <D.Herrmann@tu-bs.de>
* gc.c (free_list_length), hash.c (scm_hasher), macros.c
}
/* handle line buffering. */
- if ((SCM_UNPACK_CAR (port) & SCM_BUFLINE) && memchr (data, '\n', size))
+ if ((SCM_CELL_WORD_0 (port) & SCM_BUFLINE) && memchr (data, '\n', size))
fport_flush (port);
}
}
scm_markstream (SCM ptr)
{
int openp;
- openp = SCM_UNPACK_CAR (ptr) & SCM_OPN;
+ openp = SCM_CELL_WORD_0 (ptr) & SCM_OPN;
if (openp)
return SCM_PACK (SCM_STREAM (ptr));
else
port = SCM_COERCE_OUTPORT (port);
SCM_VALIDATE_OPPORT (1,port);
- if (SCM_UNPACK_CAR (port) & SCM_RDNG) {
- if (SCM_UNPACK_CAR (port) & SCM_WRTNG)
+ if (SCM_CELL_WORD_0 (port) & SCM_RDNG) {
+ if (SCM_CELL_WORD_0 (port) & SCM_WRTNG)
strcpy (modes, "r+");
else
strcpy (modes, "r");
}
- else if (SCM_UNPACK_CAR (port) & SCM_WRTNG)
+ else if (SCM_CELL_WORD_0 (port) & SCM_WRTNG)
strcpy (modes, "w");
- if (SCM_UNPACK_CAR (port) & SCM_BUF0)
+ if (SCM_CELL_WORD_0 (port) & SCM_BUF0)
strcat (modes, "0");
return scm_makfromstr (modes, strlen (modes), 0);
}
{
scm_puts (SCM_CLOSEDP (exp)
? "closed: "
- : (SCM_RDNG & SCM_UNPACK_CAR (exp)
- ? (SCM_WRTNG & SCM_UNPACK_CAR (exp)
+ : (SCM_RDNG & SCM_CELL_WORD_0 (exp)
+ ? (SCM_WRTNG & SCM_CELL_WORD_0 (exp)
? "input-output: "
: "input: ")
- : (SCM_WRTNG & SCM_UNPACK_CAR (exp)
+ : (SCM_WRTNG & SCM_CELL_WORD_0 (exp)
? "output: "
: "bogus: ")),
port);
#define SCM_BUFLINE (64L<<16) /* Is it line-buffered? */
#define SCM_PORTP(x) (SCM_NIMP(x) && (SCM_TYP7(x)==scm_tc7_port))
-#define SCM_OPPORTP(x) (SCM_NIMP(x) && (((0x7f | SCM_OPN) & SCM_UNPACK_CAR(x))==(scm_tc7_port | SCM_OPN)))
-#define SCM_OPINPORTP(x) (SCM_NIMP(x) && (((0x7f | SCM_OPN | SCM_RDNG) & SCM_UNPACK_CAR(x))==(scm_tc7_port | SCM_OPN | SCM_RDNG)))
-#define SCM_OPOUTPORTP(x) (SCM_NIMP(x) && (((0x7f | SCM_OPN | SCM_WRTNG) & SCM_UNPACK_CAR(x))==(scm_tc7_port | SCM_OPN | SCM_WRTNG)))
+#define SCM_OPPORTP(x) (SCM_NIMP(x) && (((0x7f | SCM_OPN) & SCM_CELL_WORD_0(x))==(scm_tc7_port | SCM_OPN)))
+#define SCM_OPINPORTP(x) (SCM_NIMP(x) && (((0x7f | SCM_OPN | SCM_RDNG) & SCM_CELL_WORD_0(x))==(scm_tc7_port | SCM_OPN | SCM_RDNG)))
+#define SCM_OPOUTPORTP(x) (SCM_NIMP(x) && (((0x7f | SCM_OPN | SCM_WRTNG) & SCM_CELL_WORD_0(x))==(scm_tc7_port | SCM_OPN | SCM_WRTNG)))
#define SCM_INPUT_PORT_P(x) \
(SCM_NIMP(x) \
- && (((0x7f | SCM_RDNG) & SCM_UNPACK_CAR(x)) == (scm_tc7_port | SCM_RDNG)))
+ && (((0x7f | SCM_RDNG) & SCM_CELL_WORD_0(x)) == (scm_tc7_port | SCM_RDNG)))
#define SCM_OUTPUT_PORT_P(x) \
(SCM_NIMP(x) \
- && (((0x7f | SCM_WRTNG) & SCM_UNPACK_CAR(x))==(scm_tc7_port | SCM_WRTNG)))
-#define SCM_OPENP(x) (SCM_NIMP(x) && (SCM_OPN & SCM_UNPACK_CAR (x)))
+ && (((0x7f | SCM_WRTNG) & SCM_CELL_WORD_0(x))==(scm_tc7_port | SCM_WRTNG)))
+#define SCM_OPENP(x) (SCM_NIMP(x) && (SCM_OPN & SCM_CELL_WORD_0 (x)))
#define SCM_CLOSEDP(x) (!SCM_OPENP(x))
#define SCM_PTAB_ENTRY(x) ((scm_port *) SCM_CELL_WORD_1 (x))
*/
#define SCM_CLOSUREP(x) (SCM_NIMP(x) && (SCM_TYP3 (x) == scm_tc3_closure))
-#define SCM_CLOSCAR(x) SCM_PACK (SCM_UNPACK_CAR (x) - scm_tc3_closure)
+#define SCM_CLOSCAR(x) SCM_PACK (SCM_CELL_WORD_0 (x) - scm_tc3_closure)
#define SCM_CODE(x) SCM_CAR (SCM_CLOSCAR (x))
#define SCM_PROCPROPS(x) SCM_CDR (SCM_CLOSCAR (x))
#define SCM_SETPROCPROPS(x, p) SCM_SETCDR (SCM_CLOSCAR (x), p)
extern long scm_tc16_array;
#define SCM_ARRAYP(a) (SCM_NIMP(a) && (scm_tc16_array == SCM_TYP16(a)))
-#define SCM_ARRAY_NDIM(x) ((scm_sizet)(SCM_UNPACK_CAR(x)>>17))
+#define SCM_ARRAY_NDIM(x) ((scm_sizet) (SCM_CELL_WORD_0 (x) >> 17))
#define SCM_ARRAY_CONTIGUOUS 0x10000
-#define SCM_ARRAY_CONTP(x) (SCM_ARRAY_CONTIGUOUS & (int)(SCM_UNPACK_CAR(x)))
+#define SCM_ARRAY_CONTP(x) (SCM_ARRAY_CONTIGUOUS & (SCM_CELL_WORD_0 (x)))
#define SCM_ARRAY_V(a) (((scm_array *) SCM_CELL_WORD_1 (a))->v)
#define SCM_ARRAY_BASE(a) (((scm_array *) SCM_CELL_WORD_1 (a))->base)
extern int scm_tc16_variable;
#define SCM_VARVCELL(V) SCM_CDR(V)
-#define SCM_VARIABLEP(X) (SCM_NIMP(X) && (scm_tc16_variable == SCM_UNPACK_CAR(X)))
+#define SCM_VARIABLEP(X) (!SCM_IMP (X) && SCM_CELL_TYPE (X) == scm_tc16_variable)
#define SCM_UDVARIABLEP(X) (SCM_VARIABLEP(X) && SCM_UNBNDP (SCM_CDR (SCM_VARVCELL (X))))
#define SCM_DEFVARIABLEP(X) (SCM_VARIABLEP(X) && !SCM_UNBNDP (SCM_CDR (SCM_VARVCELL (X))))