diff options
author | Andy Wingo <wingo@pobox.com> | 2013-01-15 14:41:26 +0100 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2013-01-15 16:32:17 +0100 |
commit | 08467a7e6116de5e21e9622b79657e113ce4b072 (patch) | |
tree | cea07109be9e1f95b73a8ec7f42bb01f5721adee /doc/ref/api-data.texi | |
parent | 99d716b6f681f5d39288efffd0ee534bb9866fa9 (diff) | |
download | guile-08467a7e6116de5e21e9622b79657e113ce4b072.tar.gz |
add scm_from_port_string and friends
* doc/ref/api-data.texi (Conversion to/from C):
* libguile/strings.h:
* libguile/strings.c (scm_from_port_string, scm_from_port_stringn):
(scm_to_port_string, scm_to_port_stringn): New functions.
* guile-readline/readline.c (internal_readline):
* libguile/strports.c (scm_strport_to_string):
* libguile/read.c (scm_read_number, scm_read_mixed_case_symbol):
(scm_read_number_and_radix, scm_read_character): Use the new
functions.
Diffstat (limited to 'doc/ref/api-data.texi')
-rw-r--r-- | doc/ref/api-data.texi | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/doc/ref/api-data.texi b/doc/ref/api-data.texi index 21398f48d..28160c88c 100644 --- a/doc/ref/api-data.texi +++ b/doc/ref/api-data.texi @@ -4428,6 +4428,19 @@ returned is the number of bytes for @code{scm_to_latin1_stringn} and for @code{scm_to_utf32_stringn}. @end deftypefn +It is not often the case, but sometimes when you are dealing with the +implementation details of a port, you need to encode and decode strings +according to the encoding and conversion strategy of the port. There +are some convenience functions for that purpose as well. + +@deftypefn {C Function} SCM scm_from_port_string (const char *str, SCM port) +@deftypefnx {C Function} SCM scm_from_port_stringn (const char *str, size_t len, SCM port) +@deftypefnx {C Function} char* scm_to_port_string (SCM str, SCM port) +@deftypefnx {C Function} char* scm_to_port_stringn (SCM str, size_t *lenp, SCM port) +Like @code{scm_from_stringn} and friends, except they take their +encoding and conversion strategy from a given port object. +@end deftypefn + @node String Internals @subsubsection String Internals |