Commit bf91f509 authored by Erick's avatar Erick

Modification: the extended function read-chars is renamed in read-bytes

parent 2d2c5fec
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
;; USA. ;; USA.
;; Author: Erick Gallesio [eg@unice.fr] ;; Author: Erick Gallesio [eg@unice.fr]
;; Creation date: 26-Nov-2000 18:19 (eg) ;; Creation date: 26-Nov-2000 18:19 (eg)
;; Last file update: 1-Aug-2018 19:09 (eg) ;; Last file update: 2-Aug-2018 23:21 (eg)
;; ;;
;; ====================================================================== ;; ======================================================================
...@@ -549,6 +549,7 @@ be accessed as a normal port with the standard Scheme primitives.]) ...@@ -549,6 +549,7 @@ be accessed as a normal port with the standard Scheme primitives.])
(insertdoc 'output-port?) (insertdoc 'output-port?)
(insertdoc 'port?) (insertdoc 'port?)
(insertdoc 'output-string-port?) (insertdoc 'output-string-port?)
(insertdoc 'output-bytevector-port?)
(insertdoc 'output-file-port?) (insertdoc 'output-file-port?)
(insertdoc 'output-virtual-port?) (insertdoc 'output-virtual-port?)
(insertdoc 'interactive-port?) (insertdoc 'interactive-port?)
...@@ -563,14 +564,17 @@ be accessed as a normal port with the standard Scheme primitives.]) ...@@ -563,14 +564,17 @@ be accessed as a normal port with the standard Scheme primitives.])
(insertdoc 'open-input-file) (insertdoc 'open-input-file)
(index "SRFI-6") (index "SRFI-6")
(insertdoc 'open-input-string) (insertdoc 'open-input-string)
(insertdoc 'open-input-bytevector)
(insertdoc 'open-input-virtual) (insertdoc 'open-input-virtual)
(insertdoc 'open-output-file) (insertdoc 'open-output-file)
(index "SRFI-6") (index "SRFI-6")
(insertdoc 'open-output-string) (insertdoc 'open-output-string)
(insertdoc 'open-output-bytevector)
(insertdoc 'open-output-virtual) (insertdoc 'open-output-virtual)
(insertdoc 'open-file) (insertdoc 'open-file)
(index "SRFI-6") (index "SRFI-6")
(insertdoc 'get-output-string) (insertdoc 'get-output-string)
(insertdoc 'get-output-bytevector)
(insertdoc 'close-output-port) (insertdoc 'close-output-port)
(insertdoc 'close-port) (insertdoc 'close-port)
(insertdoc 'port-rewind) (insertdoc 'port-rewind)
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
* *
* Author: Erick Gallesio [eg@unice.fr] * Author: Erick Gallesio [eg@unice.fr]
* Creation date: 17-Feb-1993 12:27 * Creation date: 17-Feb-1993 12:27
* Last file update: 18-Jul-2018 16:14 (eg) * Last file update: 3-Aug-2018 17:35 (eg)
* *
*/ */
...@@ -312,18 +312,21 @@ DEFINE_PRIMITIVE("read-char", read_char, subr01, (SCM port)) ...@@ -312,18 +312,21 @@ DEFINE_PRIMITIVE("read-char", read_char, subr01, (SCM port))
/* /*
<doc EXT read-chars <doc EXT read-bytes read-chars
* (read-chars size) * (read-bytes size)
* (read-chars size port) * (read-bytes size port)
* *
* Returns a newly allocated string made of |size| characters read from |port|. * Returns a newly allocated string made of |size| characters read from |port|.
* If less than |size| characters are available on the input port, the returned * If less than |size| characters are available on the input port, the returned
* string is smaller than |size| and its size is the number of available * string is smaller than |size| and its size is the number of available
* characters. |Port| may be omitted, in which case it defaults to the * characters. |Port| may be omitted, in which case it defaults to the
* value returned by |current-input-port|. * value returned by |current-input-port|.
doc> * @l
* ,(bold "Note:") This function was previously called |read-chars|. Usage
* of the old name is deprecated.
doc>
*/ */
DEFINE_PRIMITIVE("read-chars", read_chars, subr12, (SCM size, SCM port)) DEFINE_PRIMITIVE("read-bytes", read_chars, subr12, (SCM size, SCM port))
{ {
int count, n = STk_integer_value(size); int count, n = STk_integer_value(size);
SCM z; SCM z;
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
* *
* Author: Erick Gallesio [eg@unice.fr] * Author: Erick Gallesio [eg@unice.fr]
* Creation date: 17-Feb-1993 12:27 * Creation date: 17-Feb-1993 12:27
* Last file update: 3-Aug-2018 16:09 (eg) * Last file update: 3-Aug-2018 17:59 (eg)
* *
*/ */
...@@ -295,11 +295,10 @@ make_bport(enum kind_port kind, SCM str, int init_len, int flags) ...@@ -295,11 +295,10 @@ make_bport(enum kind_port kind, SCM str, int init_len, int flags)
PORT_STR(ss) = str; PORT_STR(ss) = str;
break; break;
} }
// case PREAD_C: /* this is a input string (from a C string) */ case PREAD_C: /* not used for bytevector port */
// PORT_BASE(ss) = (char *) str; STk_error("Problem: PREAD_C used for a bytecode vector.");
// PORT_END(ss) = (char *) str + init_len; exit(1);
// PORT_STR(ss) = str; break;
// break;
case PWRITE: /* This is an output bytevector */ case PWRITE: /* This is an output bytevector */
PORT_BASE(ss) = PORT_END(ss) = STk_must_malloc_atomic(init_len); PORT_BASE(ss) = PORT_END(ss) = STk_must_malloc_atomic(init_len);
PORT_STR(ss) = STk_false; PORT_STR(ss) = STk_false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment