* Deprecated SCM_RWSTRINGP and SCM_VALIDATE_RWSTRING.
authorDirk Herrmann <dirk@dirk-herrmanns-seiten.de>
Tue, 21 Nov 2000 17:32:38 +0000 (17:32 +0000)
committerDirk Herrmann <dirk@dirk-herrmanns-seiten.de>
Tue, 21 Nov 2000 17:32:38 +0000 (17:32 +0000)
* Prepared SCM_STRING_U?CHARS to replace SCM_ROU?CHARS.

ChangeLog
NEWS
RELEASE
acconfig.h
libguile/ChangeLog
libguile/ports.c
libguile/strings.c
libguile/strings.h

index d901254..e5cd22a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2000-11-21  Dirk Herrmann  <D.Herrmann@tu-bs.de>
+
+       * acconfig.h:  Removed bogus #ifndef.  Thanks to Lars J. Aas.
+
 2000-10-25  Mikael Djurfeldt  <mdj@linnaeus.mit.edu>
 
        * GUILE-VERSION (LIBGUILE_MAJOR_VERSION): Incremented major
diff --git a/NEWS b/NEWS
index 3ba7434..0e7a497 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -263,7 +263,7 @@ SCM_VALIDATE_STRINGORSUBSTR, SCM_FREEP, SCM_NFREEP, SCM_CHARS, SCM_UCHARS,
 SCM_VALIDATE_ROSTRING, SCM_VALIDATE_ROSTRING_COPY,
 SCM_VALIDATE_NULLORROSTRING_COPY, SCM_ROLENGTH, SCM_LENGTH, SCM_HUGE_LENGTH,
 SCM_SUBSTRP, SCM_SUBSTR_STR, SCM_SUBSTR_OFFSET, SCM_COERCE_SUBSTR,
-SCM_ROSTRINGP
+SCM_ROSTRINGP, SCM_RWSTRINGP, SCM_VALIDATE_RWSTRING
 
 Use SCM_ASSERT_RANGE or SCM_VALIDATE_XXX_RANGE instead of SCM_OUTOFRANGE.
 Use scm_memory_error instead of SCM_NALLOC.
@@ -275,6 +275,8 @@ Use a type specific accessor instead of SCM(_|_RO|_HUGE_)LENGTH.
 Use SCM_VALIDATE_(SYMBOL|STRING) instead of SCM_VALIDATE_ROSTRING.
 Use SCM_STRING_COERCE_0TERMINATION_X instead of SCM_COERCE_SUBSTR.
 Use SCM_STRINGP or SCM_SYMBOLP instead of SCM_ROSTRINGP.
+Use SCM_STRINGP instead of SCM_RWSTRINGP.
+Use SCM_VALIDATE_STRING instead of SCM_VALIDATE_RWSTRING.
 
 ** Removed function:  scm_struct_init
 
diff --git a/RELEASE b/RELEASE
index 37c17ff..8ba4961 100644 (file)
--- a/RELEASE
+++ b/RELEASE
@@ -49,7 +49,7 @@ In release 1.6:
   SCM_FREEP, SCM_NFREEP, SCM_CHARS, SCM_UCHARS, SCM_VALIDATE_ROSTRING,
   SCM_VALIDATE_ROSTRING_COPY, SCM_VALIDATE_NULLORROSTRING_COPY, SCM_ROLENGTH,
   SCM_LENGTH, SCM_HUGE_LENGTH, SCM_SUBSTRP, SCM_SUBSTR_STR, SCM_SUBSTR_OFFSET,
-  SCM_COERCE_SUBSTR, SCM_ROSTRINGP
+  SCM_COERCE_SUBSTR, SCM_ROSTRINGP, SCM_RWSTRINGP, SCM_VALIDATE_RWSTRING
 - remove scm_vector_set_length_x
 - remove function scm_call_catching_errors
   (replaced by catch functions from throw.[ch])
index b7b42bc..dd51a22 100644 (file)
@@ -44,9 +44,6 @@
  * If you do not wish that, delete this exception notice.  */
 \f
 
-#ifndef PORTSH
-#define PORTSH
-
 /* Define these two if you want support for debugging of Scheme
    programs.  */
 #undef DEBUG_EXTENSIONS
index c6b0921..75f282a 100644 (file)
@@ -1,3 +1,17 @@
+2000-11-21  Dirk Herrmann  <D.Herrmann@tu-bs.de>
+
+       * ports.c:  Include eval.h.
+
+       * strings.c (scm_string_set_x), strings.h (SCM_RWSTRINGP),
+       validate.h (SCM_VALIDATE_RWSTRING):  Deprecate SCM_RWSTRINGP and
+       SCM_VALIDATE_RWSTRING.
+
+       * strings.h (SCM_STRING_UCHARS, SCM_STRING_CHARS):  Handle strings
+       and substrings uniformly.  However, substring handling is
+       deprecated.
+
+       (SCM_RWSTRINGP):  Deprecated.
+
 2000-11-18  Gary Houston  <ghouston@arglist.com>
 
        * Makefile.am (.c.x): don't prefix ".:" to $PATH when running
index 03284f8..292daa9 100644 (file)
@@ -47,6 +47,7 @@
 
 #include <stdio.h>
 #include "libguile/_scm.h"
+#include "libguile/eval.h"
 #include "libguile/objects.h"
 #include "libguile/smob.h"
 #include "libguile/chars.h"
index 0427efc..bfd7caa 100644 (file)
@@ -261,13 +261,18 @@ SCM_DEFINE (scm_string_ref, "string-ref", 2, 0, 0,
 }
 #undef FUNC_NAME
 
+
 SCM_DEFINE (scm_string_set_x, "string-set!", 3, 0, 0,
             (SCM str, SCM k, SCM chr),
            "Stores CHR in element K of STRING and returns an unspecified value.\n"
             "K must be a valid index of STR.")
 #define FUNC_NAME s_scm_string_set_x
 {
-  SCM_VALIDATE_RWSTRING (1,str);
+#if (SCM_DEBUG_DEPRECATED == 0)
+  SCM_VALIDATE_RWSTRING (1, str);
+#else
+  SCM_VALIDATE_STRING (1, str);
+#endif
   SCM_VALIDATE_INUM_RANGE (2,k,0,SCM_STRING_LENGTH(str));
   SCM_VALIDATE_CHAR (3,chr);
   SCM_STRING_UCHARS (str)[SCM_INUM (k)] = SCM_CHAR (chr);
index 8e3ca5e..8503f3e 100644 (file)
 \f
 
 #define SCM_STRINGP(x) (SCM_NIMP (x) && (SCM_TYP7S (x) == scm_tc7_string))
+#if (SCM_DEBUG_DEPRECATED == 1)
 #define SCM_STRING_UCHARS(x) ((unsigned char *) (SCM_CELL_WORD_1 (x)))
 #define SCM_STRING_CHARS(x) ((char *) (SCM_CELL_WORD_1 (x)))
+#endif
 #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))
-
 #define SCM_STRING_COERCE_0TERMINATION_X(x) \
   { if (SCM_NIMP (x) && (SCM_TYP7 (x) == scm_tc7_substring)) \
       x = scm_makfromstr (SCM_ROCHARS (x), SCM_STRING_LENGTH (x), 0); }
@@ -89,7 +88,16 @@ extern void scm_init_strings (void);
 
 #define SCM_SLOPPY_STRINGP(x) (SCM_STRINGP(x))
 #define SCM_NSTRINGP(x) (!SCM_STRINGP(x))
+#define SCM_RWSTRINGP(x) (SCM_NIMP (x) && (SCM_TYP7 (x) == scm_tc7_string))
 #define SCM_NRWSTRINGP(x) (! SCM_RWSTRINGP (x))
+#define SCM_STRING_UCHARS(x) \
+  ((SCM_TYP7 (x) == scm_tc7_substring) \
+     ? (unsigned char *) SCM_CELL_WORD_1 (SCM_CDDR (x)) + SCM_INUM (SCM_CADR (x)) \
+     : (unsigned char *) SCM_CELL_WORD_1 (x))
+#define SCM_STRING_CHARS(x) \
+  ((SCM_TYP7 (x) == scm_tc7_substring) \
+     ? (char *) SCM_CELL_WORD_1 (SCM_CDDR (x)) + SCM_INUM (SCM_CADR (x)) \
+     : (char *) SCM_CELL_WORD_1 (x))
 extern SCM scm_make_shared_substring (SCM str, SCM frm, SCM to);
 
 #endif  /* SCM_DEBUG_DEPRECATED == 0 */