diff options
author | Marius Vollmer <mvo@zagadka.de> | 2004-08-19 17:19:44 +0000 |
---|---|---|
committer | Marius Vollmer <mvo@zagadka.de> | 2004-08-19 17:19:44 +0000 |
commit | cc95e00ac63820cbc03ca858ff6b8e1015c9d168 (patch) | |
tree | 31ed97062f17f16438e0674bd963454f22fa6754 /libguile/rdelim.c | |
parent | f76c6bb2342534158769cc55ce40edd17492f9c4 (diff) | |
download | guile-cc95e00ac63820cbc03ca858ff6b8e1015c9d168.tar.gz |
* strings.h, strings.c: (scm_i_string_chars, scm_i_string_length,
scm_i_string_writable_chars, scm_i_string_stop_writing): New, to
replace SCM_I_STRING_CHARS and SCM_I_STRING_LENGTH. Updated all
uses.
(scm_i_make_string, scm_c_make_string): New, to replace
scm_allocate_string. Updated all uses.
(SCM_STRINGP, SCM_STRING_CHARS, SCM_STRING_UCHARS,
SCM_STRING_LENGTH): Deprecated.
(scm_allocate_string, scm_take_str, scm_take0str, scm_mem2string,
scm_str2string, scm_makfrom0str, scm_makfrom0str_opt):
Discouraged. Replaced all uses with scm_from_locale_string or
similar, as appropriate.
(scm_c_string_length, scm_c_string_ref, scm_c_string_set_x,
scm_c_substring, scm_c_substring_shared, scm_c_substring_copy,
scm_substring_shared, scm_substring_copy): New.
* symbols.c, symbols.h (SCM_SYMBOLP, SCM_SYMBOL_FUNC,
SCM_SET_SYMBOL_FUNC, SCM_SYMBOL_PROPS, SCM_SET_SYMBOL_PROPS,
SCM_SYMBOL_HASH, SCM_SYMBOL_INTERNED_P, scm_mem2symbol,
scm_str2symbol, scm_mem2uninterned_symbol): Discouraged.
(SCM_SYMBOL_LENGTH, SCM_SYMBOL_CHARS, scm_c_symbol2str):
Deprecated.
(SCM_MAKE_SYMBOL_TAG, SCM_SET_SYMBOL_LENGTH, SCM_SET_SYMBOL_CHARS,
SCM_PROP_SLOTS, SCM_SET_PROP_SLOTS): Removed.
(scm_is_symbol, scm_from_locale_symbol, scm_from_locale_symboln):
New, to replace scm_str2symbol and scm_mem2symbol, respectively.
Updated all uses.
(scm_gensym): Generate only the number suffix in the buffer, just
string-append the prefix.
Diffstat (limited to 'libguile/rdelim.c')
-rw-r--r-- | libguile/rdelim.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/libguile/rdelim.c b/libguile/rdelim.c index 3967a1d72..98e88779e 100644 --- a/libguile/rdelim.c +++ b/libguile/rdelim.c @@ -56,20 +56,18 @@ SCM_DEFINE (scm_read_delimited_x, "%read-delimited!", 3, 3, 0, #define FUNC_NAME s_scm_read_delimited_x { size_t j; - char *buf; size_t cstart; size_t cend; int c; - char *cdelims; + const char *cdelims; size_t num_delims; SCM_VALIDATE_STRING (1, delims); - cdelims = SCM_I_STRING_CHARS (delims); - num_delims = SCM_I_STRING_LENGTH (delims); + cdelims = scm_i_string_chars (delims); + num_delims = scm_i_string_length (delims); SCM_VALIDATE_STRING (2, str); - buf = SCM_I_STRING_CHARS (str); - scm_i_get_substring_spec (SCM_I_STRING_LENGTH (str), + scm_i_get_substring_spec (scm_i_string_length (str), start, &cstart, end, &cend); if (SCM_UNBNDP (port)) @@ -97,7 +95,7 @@ SCM_DEFINE (scm_read_delimited_x, "%read-delimited!", 3, 3, 0, return scm_cons (SCM_EOF_VAL, scm_from_size_t (j - cstart)); - buf[j] = c; + scm_c_string_set_x (str, j, SCM_MAKE_CHAR (c)); } return scm_cons (SCM_BOOL_F, scm_from_size_t (j - cstart)); } @@ -227,14 +225,14 @@ SCM_DEFINE (scm_read_line, "%read-line", 0, 1, 0, { term = SCM_MAKE_CHAR ('\n'); s[slen-1] = '\0'; - line = scm_take_str (s, slen-1); + line = scm_take_locale_stringn (s, slen-1); SCM_INCLINE (port); } else { /* Fix: we should check for eof on the port before assuming this. */ term = SCM_EOF_VAL; - line = scm_take_str (s, slen); + line = scm_take_locale_stringn (s, slen); SCM_COL (port) += slen; } } |