diff --git a/libguile/ChangeLog b/libguile/ChangeLog index 8386ac49c..a5f910f80 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,3 +1,10 @@ +2000-10-06 Dirk Herrmann + + * continuations.h (SCM_CONTINUATION_LENGTH), strings.h + (SCM_STRING_LENGTH), symbols.h (SCM_SYMBOL_LENGTH), unif.h + (SCM_UVECTOR_LENGTH, SCM_BITVECTOR_LENGTH), vectors.h + (SCM_VECTOR_LENGTH): Added as replacements for SCM_LENGTH. + 2000-10-02 Marius Vollmer * coop-defs.h (coop_key_create): Don't use the C++ keyword diff --git a/libguile/continuations.h b/libguile/continuations.h index 133eb9804..11aa75c5a 100644 --- a/libguile/continuations.h +++ b/libguile/continuations.h @@ -63,6 +63,7 @@ typedef struct #define SCM_CONTREGS(x) ((scm_contregs *) SCM_CELL_WORD_1 (x)) #define SCM_SET_CONTREGS(x, r) (SCM_SET_CELL_WORD_1 ((x), (scm_bits_t) (r))) +#define SCM_CONTINUATION_LENGTH(x) (((unsigned long) SCM_CELL_WORD_0 (x)) >> 8) #define SCM_JMPBUF(x) ((SCM_CONTREGS (x))->jmpbuf) #define SCM_DYNENV(x) ((SCM_CONTREGS (x))->dynenv) diff --git a/libguile/strings.h b/libguile/strings.h index c13ccfda3..6cc64aa5b 100644 --- a/libguile/strings.h +++ b/libguile/strings.h @@ -54,6 +54,7 @@ #define SCM_STRINGP(x) (SCM_NIMP (x) && (SCM_TYP7S (x) == scm_tc7_string)) #define SCM_STRING_UCHARS(x) ((unsigned char *) (SCM_CELL_WORD_1 (x))) #define SCM_STRING_CHARS(x) ((char *) (SCM_CELL_WORD_1 (x))) +#define SCM_STRING_LENGTH(x) (((unsigned long) SCM_CELL_WORD_0 (x)) >> 8) /* Is X a writable string (i.e., not a substring)? */ #define SCM_RWSTRINGP(x) (SCM_NIMP (x) && (SCM_TYP7 (x) == scm_tc7_string)) diff --git a/libguile/symbols.h b/libguile/symbols.h index d974a506b..64b319c25 100644 --- a/libguile/symbols.h +++ b/libguile/symbols.h @@ -52,13 +52,14 @@ extern int scm_symhash_dim; -/* SCM_LENGTH(SYM) is the length of SYM's name in characters, and +/* SCM_SYMBOL_LENGTH(SYM) is the length of SYM's name in characters, and * SCM_SYMBOL_CHARS(SYM) is the address of the first character of SYM's name. */ #define SCM_SYMBOLP(x) (SCM_NIMP (x) && (SCM_TYP7 (x) == scm_tc7_symbol)) #define SCM_SYMBOL_UCHARS(x) ((unsigned char *) (SCM_CELL_WORD_1 (x))) #define SCM_SYMBOL_CHARS(x) ((char *) (SCM_CELL_WORD_1 (x))) +#define SCM_SYMBOL_LENGTH(x) (((unsigned long) SCM_CELL_WORD_0 (x)) >> 8) #define SCM_LENGTH_MAX (0xffffffL) #define SCM_LENGTH(x) (((unsigned long) SCM_CELL_WORD_0 (x)) >> 8) diff --git a/libguile/unif.h b/libguile/unif.h index 32f0317a4..4a9f5ede1 100644 --- a/libguile/unif.h +++ b/libguile/unif.h @@ -87,6 +87,9 @@ extern long scm_tc16_array; #define SCM_ARRAY_DIMS(a) ((scm_array_dim *)((char *) SCM_ARRAY_MEM (a) + sizeof (scm_array))) #define SCM_UVECTOR_BASE(x) ((void *) (SCM_CELL_WORD_1 (x))) +#define SCM_UVECTOR_LENGTH(x) (((unsigned long) SCM_CELL_WORD_0 (x)) >> 8) + +#define SCM_BITVECTOR_LENGTH(x) (((unsigned long) SCM_CELL_WORD_0 (x)) >> 8) /* apparently it's possible to have more than SCM_LENGTH_MAX elements in an array: if the length is SCM_LENGTH_MAX then the SCM_VELTS diff --git a/libguile/vectors.h b/libguile/vectors.h index 3e8708472..f995da3e8 100644 --- a/libguile/vectors.h +++ b/libguile/vectors.h @@ -53,6 +53,8 @@ #define SCM_VECTORP(x) (SCM_NIMP (x) && (SCM_TYP7S (x) == scm_tc7_vector)) #define SCM_VECTOR_BASE(x) ((scm_bits_t *) SCM_CELL_WORD_1 (x)) +#define SCM_VECTOR_LENGTH(x) (((unsigned long) SCM_CELL_WORD_0 (x)) >> 8) + #define SCM_VELTS(x) ((SCM *) SCM_CELL_WORD_1 (x)) #define SCM_VELTS_AS_STACKITEMS(x) ((SCM_STACKITEM *) SCM_CELL_WORD_1 (x)) #define SCM_SETVELTS(x,v) (SCM_SET_CELL_WORD_1 ((x), (v)))