* Some more work to get rid of SCM_LENGTH
[bpt/guile.git] / libguile / symbols.h
index 352f114..3331bd6 100644 (file)
 
 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)
 #define SCM_SETLENGTH(x, v, t) (SCM_SET_CELL_WORD_0 ((x), ((v) << 8) + (t)))
 
-#define SCM_CHARS(x)           ((char *) (SCM_CELL_WORD_1 (x)))
-#define SCM_UCHARS(x)          ((unsigned char *) (SCM_CELL_WORD_1 (x)))
 #define SCM_SETCHARS(x, v)     (SCM_SET_CELL_WORD_1 ((x), (scm_bits_t) (v)))
 
 #define SCM_PROP_SLOTS(X)           (SCM_CELL_WORD_3 (X))
@@ -96,7 +95,7 @@ extern int scm_symhash_dim;
 
 #define SCM_COERCE_SUBSTR(x) { if (SCM_SUBSTRP (x)) \
                                 x = scm_makfromstr (SCM_ROCHARS (x), \
-                                                    SCM_ROLENGTH (x), 0); }
+                                                    SCM_STRING_LENGTH (x), 0); }
 
 \f
 
@@ -137,6 +136,8 @@ extern void scm_init_symbols (void);
 
 #if (SCM_DEBUG_DEPRECATED == 0)
 
+#define SCM_CHARS(x) ((char *) (SCM_CELL_WORD_1 (x)))
+#define SCM_UCHARS(x) ((unsigned char *) (SCM_CELL_WORD_1 (x)))
 #define SCM_SLOPPY_SUBSTRP(x) (SCM_SUBSTRP (x))
 #define scm_strhash(str, len, n) (scm_string_hash ((str), (len)) % (n))