diff options
author | Michael Gran <spk121@yahoo.com> | 2009-08-23 06:50:45 -0700 |
---|---|---|
committer | Michael Gran <spk121@yahoo.com> | 2009-08-23 09:29:45 -0700 |
commit | 587a33556fdef90025c1b7d4d172af649c8ebba8 (patch) | |
tree | 97792a8e7e1a2b9cb05596df2332294a6c316671 /libguile/strings.h | |
parent | 27646f414e9350c2bf9f35982082bcabfb475c5d (diff) | |
download | guile-587a33556fdef90025c1b7d4d172af649c8ebba8.tar.gz |
Modify socket and time functions for wide strings
* libguile/socket.c (scm_recv): receive the message without holding the
stringbuf writing lock
(scm_send): try to narrow a string before using it
* libguile/stime.c (strftime): convert string to UTF-8 so that it can
be safely passed to strftime
(strptime): convert input string to UTF-8 so that it can be safely
passed through strptime
* libguile/strings.c (narrow_stringbuf): new function
(scm_i_try_narrow_string): new function
* libguile/strings.h: new declaration for scm_i_try_narrow_string
Diffstat (limited to 'libguile/strings.h')
-rw-r--r-- | libguile/strings.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libguile/strings.h b/libguile/strings.h index d0cbb8dd3..20726a3e7 100644 --- a/libguile/strings.h +++ b/libguile/strings.h @@ -124,6 +124,7 @@ SCM_API SCM scm_c_substring_copy (SCM str, size_t start, size_t end); SCM_API int scm_is_string (SCM x); SCM_API SCM scm_from_locale_string (const char *str); SCM_API SCM scm_from_locale_stringn (const char *str, size_t len); +SCM_INTERNAL SCM scm_i_from_utf8_string (const scm_t_uint8 *str); SCM_API SCM scm_take_locale_string (char *str); SCM_API SCM scm_take_locale_stringn (char *str, size_t len); SCM_API char *scm_to_locale_string (SCM str); @@ -132,6 +133,7 @@ SCM_INTERNAL char *scm_to_stringn (SCM str, size_t *lenp, const char *encoding, scm_t_string_failed_conversion_handler handler); +SCM_INTERNAL scm_t_uint8 *scm_i_to_utf8_string (SCM str); SCM_API size_t scm_to_locale_stringbuf (SCM str, char *buf, size_t max_len); SCM_API SCM scm_makfromstrs (int argc, char **argv); @@ -168,6 +170,7 @@ SCM_INTERNAL const char *scm_i_symbol_chars (SCM sym); SCM_INTERNAL const scm_t_wchar *scm_i_symbol_wide_chars (SCM sym); SCM_INTERNAL size_t scm_i_symbol_length (SCM sym); SCM_INTERNAL int scm_i_is_narrow_symbol (SCM str); +SCM_INTERNAL int scm_i_try_narrow_string (SCM str); SCM_INTERNAL SCM scm_i_symbol_substring (SCM sym, size_t start, size_t end); SCM_INTERNAL scm_t_wchar scm_i_symbol_ref (SCM sym, size_t x); |