summaryrefslogtreecommitdiff
path: root/libguile/vectors.h
diff options
context:
space:
mode:
Diffstat (limited to 'libguile/vectors.h')
-rw-r--r--libguile/vectors.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/libguile/vectors.h b/libguile/vectors.h
index df4902c33..4692a6574 100644
--- a/libguile/vectors.h
+++ b/libguile/vectors.h
@@ -56,6 +56,16 @@
#define SCM_VELTS(x) ((SCM *)SCM_CDR(x))
#define SCM_SETVELTS SCM_SETCDR
+
+
+/*
+ bit vectors
+ */
+#define SCM_BITVEC_REF(a, i) ((SCM_ASWORD(SCM_VELTS(a)[(i)/SCM_LONG_BIT]) & (1L<<((i)%SCM_LONG_BIT))) ? 1 : 0)
+#define SCM_BITVEC_SET(a, i) SCM_ASWORD(SCM_VELTS(a)[(i)/SCM_LONG_BIT]) |= (1L<<((i)%SCM_LONG_BIT))
+#define SCM_BITVEC_CLR(a, i) SCM_ASWORD(SCM_VELTS(a)[(i)/SCM_LONG_BIT]) &= ~(1L<<((i)%SCM_LONG_BIT))
+
+
extern SCM scm_vector_set_length_x (SCM vect, SCM len);