(SCM_CHARS, SCM_UCHARS, SCM_LENGTH, scm_i_object_chars,
authorMarius Vollmer <mvo@zagadka.de>
Mon, 10 Jan 2005 17:42:23 +0000 (17:42 +0000)
committerMarius Vollmer <mvo@zagadka.de>
Mon, 10 Jan 2005 17:42:23 +0000 (17:42 +0000)
scm_i_object_length): Brought back from the dead.

libguile/deprecated.c
libguile/deprecated.h

index e747785..91cb86c 100644 (file)
@@ -651,6 +651,33 @@ scm_strprint_obj (SCM obj)
   return scm_object_to_string (obj, SCM_UNDEFINED);
 }
 
+char *
+scm_i_object_chars (SCM obj)
+{
+  scm_c_issue_deprecation_warning 
+    ("SCM_CHARS is deprecated.  See the manual for alternatives.");
+  if (SCM_STRINGP (obj))
+    return SCM_STRING_CHARS (obj);
+  if (SCM_SYMBOLP (obj))
+    return SCM_SYMBOL_CHARS (obj);
+  abort ();
+}
+
+long
+scm_i_object_length (SCM obj)
+{
+  scm_c_issue_deprecation_warning 
+    ("SCM_LENGTH is deprecated.  "
+     "Use scm_c_string_length instead, for example, or see the manual.");
+  if (SCM_STRINGP (obj))
+    return SCM_STRING_LENGTH (obj);
+  if (SCM_SYMBOLP (obj))
+    return SCM_SYMBOL_LENGTH (obj);
+  if (SCM_VECTORP (obj))
+    return SCM_VECTOR_LENGTH (obj);
+  abort ();
+}
+
 SCM 
 scm_sym2ovcell_soft (SCM sym, SCM obarray)
 {
index a8c7de3..4032baf 100644 (file)
@@ -226,6 +226,15 @@ SCM_API SCM scm_strprint_obj (SCM obj);
 SCM_API SCM scm_read_0str (char *expr);
 SCM_API SCM scm_eval_0str (const char *expr);
 
+SCM_API char *scm_i_object_chars (SCM);
+
+#define SCM_CHARS(x)   scm_i_object_chars(x)
+#define SCM_UCHARS(x)  ((unsigned char *)SCM_CHARS(x))
+
+SCM_API long scm_i_object_length (SCM);
+
+#define SCM_LENGTH(x) scm_i_object_length(x)
+
 #define scm_strhash(str, len, n) (scm_string_hash ((str), (len)) % (n))
 
 SCM_API SCM scm_sym2ovcell_soft (SCM sym, SCM obarray);