*** empty log message ***
[bpt/guile.git] / libguile / pairs.h
index 2b18433..40af8ce 100644 (file)
@@ -2,7 +2,7 @@
 
 #ifndef PAIRSH
 #define PAIRSH
-/*     Copyright (C) 1995,1996 Free Software Foundation, Inc.
+/*     Copyright (C) 1995,1996, 2000 Free Software Foundation, Inc.
  * 
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -104,17 +104,21 @@ typedef SCM  huge *SCMPTR;
 
 #define SCM_CAR(x) (((scm_cell *)(SCM2PTR(x)))->car)
 #define SCM_CDR(x) (((scm_cell *)(SCM2PTR(x)))->cdr)
-#define SCM_GCCDR(x) (~1L & SCM_CDR(x))
-#define SCM_SETCAR(x, v) (SCM_CAR(x) = (SCM)(v))
-#define SCM_SETCDR(x, v) (SCM_CDR(x) = (SCM)(v))
+#define SCM_GCCDR(x) SCM_PACK(~1L & SCM_UNPACK (SCM_CDR(x)))
+#define SCM_SETCAR(x, v) (SCM_CAR(x) = SCM_PACK(v))
+#define SCM_SETCDR(x, v) (SCM_CDR(x) = SCM_PACK(v))
 
 #define SCM_CARLOC(x) (&SCM_CAR (x))
 #define SCM_CDRLOC(x) (&SCM_CDR (x))
 
-#define SCM_SETAND_CAR(x, y) (SCM_CAR (x) &= (y))
-#define SCM_SETAND_CDR(x, y) (SCM_CDR (x) &= (y))
-#define SCM_SETOR_CAR(x, y)  (SCM_CAR (x) |= (y))
-#define SCM_SETOR_CDR(x, y)  (SCM_CDR (x) |= (y))
+#define SCM_SETAND_CAR(x, y)\
+  (SCM_CAR (x) = SCM_PACK (SCM_UNPACK (SCM_CAR (x)) & (y)))
+#define SCM_SETAND_CDR(x, y)\
+  (SCM_CDR (x) = SCM_PACK (SCM_UNPACK (SCM_CDR (x)) & (y)))
+#define SCM_SETOR_CAR(x, y)\
+  (SCM_CAR (x) = SCM_PACK (SCM_UNPACK (SCM_CAR (x)) | (y)))
+#define SCM_SETOR_CDR(x, y)\
+  (SCM_CDR (x) = SCM_PACK (SCM_UNPACK (SCM_CDR (x)) | (y)))
 
 #define SCM_CAAR(OBJ)          SCM_CAR (SCM_CAR (OBJ))
 #define SCM_CDAR(OBJ)          SCM_CDR (SCM_CAR (OBJ))
@@ -172,11 +176,11 @@ typedef SCM  huge *SCMPTR;
 
 \f
 
-extern SCM scm_cons SCM_P ((SCM x, SCM y));
-extern SCM scm_cons2 SCM_P ((SCM w, SCM x, SCM y));
-extern SCM scm_pair_p SCM_P ((SCM x));
-extern SCM scm_set_car_x SCM_P ((SCM pair, SCM value));
-extern SCM scm_set_cdr_x SCM_P ((SCM pair, SCM value));
-extern void scm_init_pairs SCM_P ((void));
+extern SCM scm_cons (SCM x, SCM y);
+extern SCM scm_cons2 (SCM w, SCM x, SCM y);
+extern SCM scm_pair_p (SCM x);
+extern SCM scm_set_car_x (SCM pair, SCM value);
+extern SCM scm_set_cdr_x (SCM pair, SCM value);
+extern void scm_init_pairs (void);
 
 #endif  /* PAIRSH */