summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDirk Herrmann <dirk@dirk-herrmanns-seiten.de>2000-11-21 17:32:38 +0000
committerDirk Herrmann <dirk@dirk-herrmanns-seiten.de>2000-11-21 17:32:38 +0000
commitf0942910aff219e4a153d6d2f446c100127b0048 (patch)
treedf64a1a11a500bd1dc457832fc85071d31e96956
parentc2c276029351aeaade33050102e3f1a71e464015 (diff)
downloadguile-f0942910aff219e4a153d6d2f446c100127b0048.tar.gz
* Deprecated SCM_RWSTRINGP and SCM_VALIDATE_RWSTRING.
* Prepared SCM_STRING_U?CHARS to replace SCM_ROU?CHARS.
-rw-r--r--ChangeLog4
-rw-r--r--NEWS4
-rw-r--r--RELEASE2
-rw-r--r--acconfig.h3
-rw-r--r--libguile/ChangeLog14
-rw-r--r--libguile/ports.c1
-rw-r--r--libguile/strings.c7
-rw-r--r--libguile/strings.h14
8 files changed, 40 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index d9012543f..e5cd22a1c 100644
--- 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 3ba743414..0e7a4976b 100644
--- 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 37c17ffda..8ba49614f 100644
--- 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])
diff --git a/acconfig.h b/acconfig.h
index b7b42bc3d..dd51a227e 100644
--- a/acconfig.h
+++ b/acconfig.h
@@ -44,9 +44,6 @@
* If you do not wish that, delete this exception notice. */
-#ifndef PORTSH
-#define PORTSH
-
/* Define these two if you want support for debugging of Scheme
programs. */
#undef DEBUG_EXTENSIONS
diff --git a/libguile/ChangeLog b/libguile/ChangeLog
index c6b092147..75f282ae5 100644
--- a/libguile/ChangeLog
+++ b/libguile/ChangeLog
@@ -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
diff --git a/libguile/ports.c b/libguile/ports.c
index 03284f879..292daa984 100644
--- a/libguile/ports.c
+++ b/libguile/ports.c
@@ -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"
diff --git a/libguile/strings.c b/libguile/strings.c
index 0427efcef..bfd7caa9f 100644
--- a/libguile/strings.c
+++ b/libguile/strings.c
@@ -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);
diff --git a/libguile/strings.h b/libguile/strings.h
index 8e3ca5eb3..8503f3e32 100644
--- a/libguile/strings.h
+++ b/libguile/strings.h
@@ -52,13 +52,12 @@
#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 */