From 6f14f578d2e24f58594e682061755dab41ed1f9e Mon Sep 17 00:00:00 2001 From: Marius Vollmer Date: Thu, 12 Aug 2004 17:43:41 +0000 Subject: * strings.h, strings.c (scm_i_get_substring_spec): New. * socket.c, rw.c, deprecated.h, validate.h (SCM_VALIDATE_STRING_COPY): Deprecated. Replaced all uses with SCM_VALIDATE_STRING plus SCM_I_STRING_CHARS or scm_to_locale_string, etc. (SCM_VALIDATE_SUBSTRING_SPEC_COPY): Deprecated. Replaced as above, plus scm_i_get_substring_spec. --- libguile/strings.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'libguile/strings.c') diff --git a/libguile/strings.c b/libguile/strings.c index 1308753aa..0e15f7222 100644 --- a/libguile/strings.c +++ b/libguile/strings.c @@ -452,6 +452,22 @@ scm_i_free_string_pointers (char **pointers) free (pointers); } +void +scm_i_get_substring_spec (size_t len, + SCM start, size_t *cstart, + SCM end, size_t *cend) +{ + if (SCM_UNBNDP (start)) + *cstart = 0; + else + *cstart = scm_to_unsigned_integer (start, 0, len); + + if (SCM_UNBNDP (end)) + *cend = len; + else + *cend = scm_to_unsigned_integer (end, *cstart, len); +} + void scm_init_strings () { -- cgit v1.2.3