mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-14 07:30:32 +02:00
Merge remote-tracking branch 'origin/stable-2.0'
Moved scm_i_struct_hash from struct.c to hash.c and made it static. The port's alist is now a field of 'scm_t_port'. Conflicts: libguile/arrays.c libguile/hash.c libguile/ports.c libguile/print.h libguile/read.c
This commit is contained in:
commit
fa980bcc0f
53 changed files with 1677 additions and 531 deletions
|
@ -1229,6 +1229,29 @@ write_character (scm_t_wchar ch, SCM port, int string_escapes_p)
|
|||
write_character_escaped (ch, string_escapes_p, port);
|
||||
}
|
||||
|
||||
/* Display STR to PORT from START inclusive to END exclusive. */
|
||||
void
|
||||
scm_i_display_substring (SCM str, size_t start, size_t end, SCM port)
|
||||
{
|
||||
int narrow_p;
|
||||
const char *buf;
|
||||
size_t len, printed;
|
||||
|
||||
buf = scm_i_string_data (str);
|
||||
len = end - start;
|
||||
narrow_p = scm_i_is_narrow_string (str);
|
||||
buf += start * (narrow_p ? sizeof (char) : sizeof (scm_t_wchar));
|
||||
|
||||
printed = display_string (buf, narrow_p, end - start, port,
|
||||
PORT_CONVERSION_HANDLER (port));
|
||||
|
||||
if (SCM_UNLIKELY (printed < len))
|
||||
scm_encoding_error (__func__, errno,
|
||||
"cannot convert to output locale",
|
||||
port, scm_c_string_ref (str, printed + start));
|
||||
}
|
||||
|
||||
|
||||
/* Print an integer.
|
||||
*/
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue