mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-06-24 12:20:20 +02:00
Remove scm_putc_unlocked.
* libguile/ports.h (scm_putc_unlocked): Remove. * libguile/ports.c (scm_putc): Replace implementation with scm_putc_unlocked's implementation. (scm_port_print): Use scm_putc. * libguile/arbiters.c: * libguile/arrays.c: * libguile/bitvectors.c: * libguile/bytevectors.c: * libguile/continuations.c: * libguile/dynl.c: * libguile/eval.c: * libguile/filesys.c: * libguile/fluids.c: * libguile/foreign.c: * libguile/fports.c: * libguile/frames.c: * libguile/hashtab.c: * libguile/hooks.c: * libguile/macros.c: * libguile/mallocs.c: * libguile/print.c: * libguile/programs.c: * libguile/promises.c: * libguile/r6rs-ports.c: * libguile/smob.c: * libguile/srcprop.c: * libguile/struct.c: * libguile/variable.c: * libguile/weak-set.c: * libguile/weak-table.c: Use scm_putc instead of scm_putc_unlocked.
This commit is contained in:
parent
796676028b
commit
206b3f6e03
28 changed files with 70 additions and 81 deletions
|
@ -93,7 +93,7 @@ arbiter_print (SCM exp, SCM port, scm_print_state *pstate)
|
||||||
if (SCM_ARB_LOCKED (exp))
|
if (SCM_ARB_LOCKED (exp))
|
||||||
scm_puts_unlocked ("locked ", port);
|
scm_puts_unlocked ("locked ", port);
|
||||||
scm_iprin1 (SCM_PACK (SCM_SMOB_DATA (exp)), port, pstate);
|
scm_iprin1 (SCM_PACK (SCM_SMOB_DATA (exp)), port, pstate);
|
||||||
scm_putc_unlocked ('>', port);
|
scm_putc ('>', port);
|
||||||
return !0;
|
return !0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -735,15 +735,15 @@ scm_i_print_array_dimension (scm_t_array_handle *h, int dim, int pos,
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ssize_t i;
|
ssize_t i;
|
||||||
scm_putc_unlocked ('(', port);
|
scm_putc ('(', port);
|
||||||
for (i = h->dims[dim].lbnd; i <= h->dims[dim].ubnd;
|
for (i = h->dims[dim].lbnd; i <= h->dims[dim].ubnd;
|
||||||
i++, pos += h->dims[dim].inc)
|
i++, pos += h->dims[dim].inc)
|
||||||
{
|
{
|
||||||
scm_i_print_array_dimension (h, dim+1, pos, port, pstate);
|
scm_i_print_array_dimension (h, dim+1, pos, port, pstate);
|
||||||
if (i < h->dims[dim].ubnd)
|
if (i < h->dims[dim].ubnd)
|
||||||
scm_putc_unlocked (' ', port);
|
scm_putc (' ', port);
|
||||||
}
|
}
|
||||||
scm_putc_unlocked (')', port);
|
scm_putc (')', port);
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -760,7 +760,7 @@ scm_i_print_array (SCM array, SCM port, scm_print_state *pstate)
|
||||||
|
|
||||||
scm_array_get_handle (array, &h);
|
scm_array_get_handle (array, &h);
|
||||||
|
|
||||||
scm_putc_unlocked ('#', port);
|
scm_putc ('#', port);
|
||||||
if (SCM_I_ARRAYP (array))
|
if (SCM_I_ARRAYP (array))
|
||||||
scm_intprint (h.ndims, 10, port);
|
scm_intprint (h.ndims, 10, port);
|
||||||
if (h.element_type != SCM_ARRAY_ELEMENT_TYPE_SCM)
|
if (h.element_type != SCM_ARRAY_ELEMENT_TYPE_SCM)
|
||||||
|
@ -781,12 +781,12 @@ scm_i_print_array (SCM array, SCM port, scm_print_state *pstate)
|
||||||
{
|
{
|
||||||
if (print_lbnds)
|
if (print_lbnds)
|
||||||
{
|
{
|
||||||
scm_putc_unlocked ('@', port);
|
scm_putc ('@', port);
|
||||||
scm_intprint (h.dims[i].lbnd, 10, port);
|
scm_intprint (h.dims[i].lbnd, 10, port);
|
||||||
}
|
}
|
||||||
if (print_lens)
|
if (print_lens)
|
||||||
{
|
{
|
||||||
scm_putc_unlocked (':', port);
|
scm_putc (':', port);
|
||||||
scm_intprint (h.dims[i].ubnd - h.dims[i].lbnd + 1,
|
scm_intprint (h.dims[i].ubnd - h.dims[i].lbnd + 1,
|
||||||
10, port);
|
10, port);
|
||||||
}
|
}
|
||||||
|
@ -814,9 +814,9 @@ scm_i_print_array (SCM array, SCM port, scm_print_state *pstate)
|
||||||
not really the same as Scheme values since they are boxed and
|
not really the same as Scheme values since they are boxed and
|
||||||
can be modified with array-set!, say.
|
can be modified with array-set!, say.
|
||||||
*/
|
*/
|
||||||
scm_putc_unlocked ('(', port);
|
scm_putc ('(', port);
|
||||||
scm_i_print_array_dimension (&h, 0, 0, port, pstate);
|
scm_i_print_array_dimension (&h, 0, 0, port, pstate);
|
||||||
scm_putc_unlocked (')', port);
|
scm_putc (')', port);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -62,7 +62,7 @@ scm_i_print_bitvector (SCM vec, SCM port, scm_print_state *pstate)
|
||||||
{
|
{
|
||||||
scm_t_uint32 mask = 1;
|
scm_t_uint32 mask = 1;
|
||||||
for (j = 0; j < 32 && j < bit_len; j++, mask <<= 1)
|
for (j = 0; j < 32 && j < bit_len; j++, mask <<= 1)
|
||||||
scm_putc_unlocked ((bits[i] & mask)? '1' : '0', port);
|
scm_putc ((bits[i] & mask)? '1' : '0', port);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
|
|
|
@ -417,17 +417,17 @@ scm_i_print_bytevector (SCM bv, SCM port, scm_print_state *pstate SCM_UNUSED)
|
||||||
|
|
||||||
scm_array_get_handle (bv, &h);
|
scm_array_get_handle (bv, &h);
|
||||||
|
|
||||||
scm_putc_unlocked ('#', port);
|
scm_putc ('#', port);
|
||||||
scm_write (scm_array_handle_element_type (&h), port);
|
scm_write (scm_array_handle_element_type (&h), port);
|
||||||
scm_putc_unlocked ('(', port);
|
scm_putc ('(', port);
|
||||||
for (i = h.dims[0].lbnd, ubnd = h.dims[0].ubnd, inc = h.dims[0].inc;
|
for (i = h.dims[0].lbnd, ubnd = h.dims[0].ubnd, inc = h.dims[0].inc;
|
||||||
i <= ubnd; i += inc)
|
i <= ubnd; i += inc)
|
||||||
{
|
{
|
||||||
if (i > 0)
|
if (i > 0)
|
||||||
scm_putc_unlocked (' ', port);
|
scm_putc (' ', port);
|
||||||
scm_write (scm_array_handle_ref (&h, i), port);
|
scm_write (scm_array_handle_ref (&h, i), port);
|
||||||
}
|
}
|
||||||
scm_putc_unlocked (')', port);
|
scm_putc (')', port);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -96,7 +96,7 @@ continuation_print (SCM obj, SCM port, scm_print_state *state SCM_UNUSED)
|
||||||
scm_intprint (continuation->num_stack_items, 10, port);
|
scm_intprint (continuation->num_stack_items, 10, port);
|
||||||
scm_puts_unlocked (" @ ", port);
|
scm_puts_unlocked (" @ ", port);
|
||||||
scm_uintprint (SCM_SMOB_DATA_1 (obj), 16, port);
|
scm_uintprint (SCM_SMOB_DATA_1 (obj), 16, port);
|
||||||
scm_putc_unlocked ('>', port);
|
scm_putc ('>', port);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -233,7 +233,7 @@ dynl_obj_print (SCM exp, SCM port, scm_print_state *pstate)
|
||||||
scm_iprin1 (DYNL_FILENAME (exp), port, pstate);
|
scm_iprin1 (DYNL_FILENAME (exp), port, pstate);
|
||||||
if (DYNL_HANDLE (exp) == NULL)
|
if (DYNL_HANDLE (exp) == NULL)
|
||||||
scm_puts_unlocked (" (unlinked)", port);
|
scm_puts_unlocked (" (unlinked)", port);
|
||||||
scm_putc_unlocked ('>', port);
|
scm_putc ('>', port);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -922,14 +922,14 @@ boot_closure_print (SCM closure, SCM port, scm_print_state *pstate)
|
||||||
SCM args;
|
SCM args;
|
||||||
scm_puts_unlocked ("#<boot-closure ", port);
|
scm_puts_unlocked ("#<boot-closure ", port);
|
||||||
scm_uintprint (SCM_UNPACK (closure), 16, port);
|
scm_uintprint (SCM_UNPACK (closure), 16, port);
|
||||||
scm_putc_unlocked (' ', port);
|
scm_putc (' ', port);
|
||||||
args = scm_make_list (scm_from_int (BOOT_CLOSURE_NUM_REQUIRED_ARGS (closure)),
|
args = scm_make_list (scm_from_int (BOOT_CLOSURE_NUM_REQUIRED_ARGS (closure)),
|
||||||
scm_from_latin1_symbol ("_"));
|
scm_from_latin1_symbol ("_"));
|
||||||
if (!BOOT_CLOSURE_IS_FIXED (closure) && BOOT_CLOSURE_HAS_REST_ARGS (closure))
|
if (!BOOT_CLOSURE_IS_FIXED (closure) && BOOT_CLOSURE_HAS_REST_ARGS (closure))
|
||||||
args = scm_cons_star (scm_from_latin1_symbol ("_"), args);
|
args = scm_cons_star (scm_from_latin1_symbol ("_"), args);
|
||||||
/* FIXME: optionals and rests */
|
/* FIXME: optionals and rests */
|
||||||
scm_display (args, port);
|
scm_display (args, port);
|
||||||
scm_putc_unlocked ('>', port);
|
scm_putc ('>', port);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1825,7 +1825,7 @@ scm_dir_print (SCM exp, SCM port, scm_print_state *pstate SCM_UNUSED)
|
||||||
scm_puts_unlocked ("closed: ", port);
|
scm_puts_unlocked ("closed: ", port);
|
||||||
scm_puts_unlocked ("directory stream ", port);
|
scm_puts_unlocked ("directory stream ", port);
|
||||||
scm_uintprint (SCM_SMOB_DATA_1 (exp), 16, port);
|
scm_uintprint (SCM_SMOB_DATA_1 (exp), 16, port);
|
||||||
scm_putc_unlocked ('>', port);
|
scm_putc ('>', port);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -81,7 +81,7 @@ scm_i_fluid_print (SCM exp, SCM port, scm_print_state *pstate SCM_UNUSED)
|
||||||
{
|
{
|
||||||
scm_puts_unlocked ("#<fluid ", port);
|
scm_puts_unlocked ("#<fluid ", port);
|
||||||
scm_intprint ((int) FLUID_NUM (exp), 10, port);
|
scm_intprint ((int) FLUID_NUM (exp), 10, port);
|
||||||
scm_putc_unlocked ('>', port);
|
scm_putc ('>', port);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -89,7 +89,7 @@ scm_i_dynamic_state_print (SCM exp, SCM port, scm_print_state *pstate SCM_UNUSED
|
||||||
{
|
{
|
||||||
scm_puts_unlocked ("#<dynamic-state ", port);
|
scm_puts_unlocked ("#<dynamic-state ", port);
|
||||||
scm_intprint (SCM_UNPACK (exp), 16, port);
|
scm_intprint (SCM_UNPACK (exp), 16, port);
|
||||||
scm_putc_unlocked ('>', port);
|
scm_putc ('>', port);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -315,7 +315,7 @@ scm_i_pointer_print (SCM pointer, SCM port, scm_print_state *pstate)
|
||||||
{
|
{
|
||||||
scm_puts_unlocked ("#<pointer 0x", port);
|
scm_puts_unlocked ("#<pointer 0x", port);
|
||||||
scm_uintprint (scm_to_uintptr_t (scm_pointer_address (pointer)), 16, port);
|
scm_uintprint (scm_to_uintptr_t (scm_pointer_address (pointer)), 16, port);
|
||||||
scm_putc_unlocked ('>', port);
|
scm_putc ('>', port);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -556,7 +556,7 @@ fport_print (SCM exp, SCM port, scm_print_state *pstate SCM_UNUSED)
|
||||||
scm_display (name, port);
|
scm_display (name, port);
|
||||||
else
|
else
|
||||||
scm_puts_unlocked (SCM_PTOBNAME (SCM_PTOBNUM (exp)), port);
|
scm_puts_unlocked (SCM_PTOBNAME (SCM_PTOBNUM (exp)), port);
|
||||||
scm_putc_unlocked (' ', port);
|
scm_putc (' ', port);
|
||||||
fdes = (SCM_FSTREAM (exp))->fdes;
|
fdes = (SCM_FSTREAM (exp))->fdes;
|
||||||
|
|
||||||
#if (defined HAVE_TTYNAME) && (defined HAVE_POSIX)
|
#if (defined HAVE_TTYNAME) && (defined HAVE_POSIX)
|
||||||
|
@ -569,10 +569,10 @@ fport_print (SCM exp, SCM port, scm_print_state *pstate SCM_UNUSED)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
scm_puts_unlocked (SCM_PTOBNAME (SCM_PTOBNUM (exp)), port);
|
scm_puts_unlocked (SCM_PTOBNAME (SCM_PTOBNUM (exp)), port);
|
||||||
scm_putc_unlocked (' ', port);
|
scm_putc (' ', port);
|
||||||
scm_uintprint ((scm_t_bits) SCM_PTAB_ENTRY (exp), 16, port);
|
scm_uintprint ((scm_t_bits) SCM_PTAB_ENTRY (exp), 16, port);
|
||||||
}
|
}
|
||||||
scm_putc_unlocked ('>', port);
|
scm_putc ('>', port);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,7 @@ scm_i_frame_print (SCM frame, SCM port, scm_print_state *pstate)
|
||||||
|
|
||||||
if (scm_is_true (name))
|
if (scm_is_true (name))
|
||||||
{
|
{
|
||||||
scm_putc_unlocked (' ', port);
|
scm_putc (' ', port);
|
||||||
scm_write (name, port);
|
scm_write (name, port);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -172,7 +172,7 @@ scm_i_hashtable_print (SCM exp, SCM port, scm_print_state *pstate)
|
||||||
scm_uintprint (SCM_UNPACK (exp), 16, port);
|
scm_uintprint (SCM_UNPACK (exp), 16, port);
|
||||||
scm_putc (' ', port);
|
scm_putc (' ', port);
|
||||||
scm_uintprint (SCM_HASHTABLE_N_ITEMS (exp), 10, port);
|
scm_uintprint (SCM_HASHTABLE_N_ITEMS (exp), 10, port);
|
||||||
scm_putc_unlocked ('/', port);
|
scm_putc ('/', port);
|
||||||
scm_uintprint (SCM_SIMPLE_VECTOR_LENGTH (SCM_HASHTABLE_VECTOR (exp)),
|
scm_uintprint (SCM_SIMPLE_VECTOR_LENGTH (SCM_HASHTABLE_VECTOR (exp)),
|
||||||
10, port);
|
10, port);
|
||||||
scm_puts_unlocked (">", port);
|
scm_puts_unlocked (">", port);
|
||||||
|
|
|
@ -136,20 +136,20 @@ hook_print (SCM hook, SCM port, scm_print_state *pstate)
|
||||||
SCM ls, name;
|
SCM ls, name;
|
||||||
scm_puts_unlocked ("#<hook ", port);
|
scm_puts_unlocked ("#<hook ", port);
|
||||||
scm_intprint (SCM_HOOK_ARITY (hook), 10, port);
|
scm_intprint (SCM_HOOK_ARITY (hook), 10, port);
|
||||||
scm_putc_unlocked (' ', port);
|
scm_putc (' ', port);
|
||||||
scm_uintprint (SCM_UNPACK (hook), 16, port);
|
scm_uintprint (SCM_UNPACK (hook), 16, port);
|
||||||
ls = SCM_HOOK_PROCEDURES (hook);
|
ls = SCM_HOOK_PROCEDURES (hook);
|
||||||
while (scm_is_pair (ls))
|
while (scm_is_pair (ls))
|
||||||
{
|
{
|
||||||
scm_putc_unlocked (' ', port);
|
scm_putc (' ', port);
|
||||||
name = scm_procedure_name (SCM_CAR (ls));
|
name = scm_procedure_name (SCM_CAR (ls));
|
||||||
if (scm_is_true (name))
|
if (scm_is_true (name))
|
||||||
scm_iprin1 (name, port, pstate);
|
scm_iprin1 (name, port, pstate);
|
||||||
else
|
else
|
||||||
scm_putc_unlocked ('?', port);
|
scm_putc ('?', port);
|
||||||
ls = SCM_CDR (ls);
|
ls = SCM_CDR (ls);
|
||||||
}
|
}
|
||||||
scm_putc_unlocked ('>', port);
|
scm_putc ('>', port);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -53,7 +53,7 @@ macro_print (SCM macro, SCM port, scm_print_state *pstate)
|
||||||
else
|
else
|
||||||
scm_puts_unlocked ("#<syntax-transformer ", port);
|
scm_puts_unlocked ("#<syntax-transformer ", port);
|
||||||
scm_iprin1 (scm_macro_name (macro), port, pstate);
|
scm_iprin1 (scm_macro_name (macro), port, pstate);
|
||||||
scm_putc_unlocked ('>', port);
|
scm_putc ('>', port);
|
||||||
|
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,9 +44,9 @@ scm_t_bits scm_tc16_malloc;
|
||||||
static int
|
static int
|
||||||
malloc_print (SCM exp, SCM port, scm_print_state *pstate SCM_UNUSED)
|
malloc_print (SCM exp, SCM port, scm_print_state *pstate SCM_UNUSED)
|
||||||
{
|
{
|
||||||
scm_puts_unlocked("#<malloc ", port);
|
scm_puts_unlocked ("#<malloc ", port);
|
||||||
scm_uintprint (SCM_SMOB_DATA (exp), 16, port);
|
scm_uintprint (SCM_SMOB_DATA (exp), 16, port);
|
||||||
scm_putc_unlocked('>', port);
|
scm_putc ('>', port);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2479,11 +2479,8 @@ SCM_DEFINE (scm_port_write_buffer, "port-write-buffer", 1, 0, 0,
|
||||||
void
|
void
|
||||||
scm_putc (char c, SCM port)
|
scm_putc (char c, SCM port)
|
||||||
{
|
{
|
||||||
scm_i_pthread_mutex_t *lock;
|
SCM_ASSERT_TYPE (SCM_OPOUTPORTP (port), port, 0, NULL, "output port");
|
||||||
scm_c_lock_port (port, &lock);
|
scm_lfwrite_unlocked (&c, 1, port);
|
||||||
scm_putc_unlocked (c, port);
|
|
||||||
if (lock)
|
|
||||||
scm_i_pthread_mutex_unlock (lock);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -3023,9 +3020,9 @@ scm_port_print (SCM exp, SCM port, scm_print_state *pstate SCM_UNUSED)
|
||||||
scm_puts_unlocked ("#<", port);
|
scm_puts_unlocked ("#<", port);
|
||||||
scm_print_port_mode (exp, port);
|
scm_print_port_mode (exp, port);
|
||||||
scm_puts_unlocked (type, port);
|
scm_puts_unlocked (type, port);
|
||||||
scm_putc_unlocked (' ', port);
|
scm_putc (' ', port);
|
||||||
scm_uintprint (SCM_CELL_WORD_1 (exp), 16, port);
|
scm_uintprint (SCM_CELL_WORD_1 (exp), 16, port);
|
||||||
scm_putc_unlocked ('>', port);
|
scm_putc ('>', port);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -324,7 +324,6 @@ SCM_INTERNAL SCM scm_port_write_buffer (SCM port);
|
||||||
|
|
||||||
/* Output. */
|
/* Output. */
|
||||||
SCM_API void scm_putc (char c, SCM port);
|
SCM_API void scm_putc (char c, SCM port);
|
||||||
SCM_INLINE void scm_putc_unlocked (char c, SCM port);
|
|
||||||
SCM_API void scm_puts (const char *str_data, SCM port);
|
SCM_API void scm_puts (const char *str_data, SCM port);
|
||||||
SCM_INLINE void scm_puts_unlocked (const char *str_data, SCM port);
|
SCM_INLINE void scm_puts_unlocked (const char *str_data, SCM port);
|
||||||
SCM_API void scm_c_write (SCM port, const void *buffer, size_t size);
|
SCM_API void scm_c_write (SCM port, const void *buffer, size_t size);
|
||||||
|
@ -396,13 +395,6 @@ scm_c_try_lock_port (SCM port, scm_i_pthread_mutex_t **lock)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
SCM_INLINE_IMPLEMENTATION void
|
|
||||||
scm_putc_unlocked (char c, SCM port)
|
|
||||||
{
|
|
||||||
SCM_ASSERT_TYPE (SCM_OPOUTPORTP (port), port, 0, NULL, "output port");
|
|
||||||
scm_lfwrite_unlocked (&c, 1, port);
|
|
||||||
}
|
|
||||||
|
|
||||||
SCM_INLINE_IMPLEMENTATION void
|
SCM_INLINE_IMPLEMENTATION void
|
||||||
scm_puts_unlocked (const char *s, SCM port)
|
scm_puts_unlocked (const char *s, SCM port)
|
||||||
{
|
{
|
||||||
|
|
|
@ -166,7 +166,7 @@ do \
|
||||||
{ \
|
{ \
|
||||||
if (pstate->top - pstate->list_offset >= pstate->level) \
|
if (pstate->top - pstate->list_offset >= pstate->level) \
|
||||||
{ \
|
{ \
|
||||||
scm_putc_unlocked ('#', port); \
|
scm_putc ('#', port); \
|
||||||
return; \
|
return; \
|
||||||
} \
|
} \
|
||||||
} \
|
} \
|
||||||
|
@ -310,9 +310,9 @@ print_circref (SCM port, scm_print_state *pstate, SCM ref)
|
||||||
for (i = pstate->top - 1; 1; --i)
|
for (i = pstate->top - 1; 1; --i)
|
||||||
if (scm_is_eq (PSTATE_STACK_REF(pstate, i), ref))
|
if (scm_is_eq (PSTATE_STACK_REF(pstate, i), ref))
|
||||||
break;
|
break;
|
||||||
scm_putc_unlocked ('#', port);
|
scm_putc ('#', port);
|
||||||
scm_intprint (i - self, 10, port);
|
scm_intprint (i - self, 10, port);
|
||||||
scm_putc_unlocked ('#', port);
|
scm_putc ('#', port);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Print the name of a symbol. */
|
/* Print the name of a symbol. */
|
||||||
|
@ -473,7 +473,7 @@ print_extended_symbol (SCM sym, SCM port)
|
||||||
{
|
{
|
||||||
scm_lfwrite_unlocked ("\\x", 2, port);
|
scm_lfwrite_unlocked ("\\x", 2, port);
|
||||||
scm_intprint (c, 16, port);
|
scm_intprint (c, 16, port);
|
||||||
scm_putc_unlocked (';', port);
|
scm_putc (';', port);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -489,7 +489,7 @@ print_r7rs_extended_symbol (SCM sym, SCM port)
|
||||||
len = scm_i_symbol_length (sym);
|
len = scm_i_symbol_length (sym);
|
||||||
strategy = PORT_CONVERSION_HANDLER (port);
|
strategy = PORT_CONVERSION_HANDLER (port);
|
||||||
|
|
||||||
scm_putc_unlocked ('|', port);
|
scm_putc ('|', port);
|
||||||
|
|
||||||
for (pos = 0; pos < len; pos++)
|
for (pos = 0; pos < len; pos++)
|
||||||
{
|
{
|
||||||
|
@ -522,13 +522,13 @@ print_r7rs_extended_symbol (SCM sym, SCM port)
|
||||||
{
|
{
|
||||||
scm_lfwrite_unlocked ("\\x", 2, port);
|
scm_lfwrite_unlocked ("\\x", 2, port);
|
||||||
scm_intprint (c, 16, port);
|
scm_intprint (c, 16, port);
|
||||||
scm_putc_unlocked (';', port);
|
scm_putc (';', port);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
scm_putc_unlocked ('|', port);
|
scm_putc ('|', port);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* FIXME: allow R6RS hex escapes instead of #{...}# or |...|. */
|
/* FIXME: allow R6RS hex escapes instead of #{...}# or |...|. */
|
||||||
|
@ -602,7 +602,7 @@ print_vector_or_weak_vector (SCM v, size_t len, SCM (*ref) (SCM, size_t),
|
||||||
for (i = 0; i < last; ++i)
|
for (i = 0; i < last; ++i)
|
||||||
{
|
{
|
||||||
scm_iprin1 (ref (v, i), port, pstate);
|
scm_iprin1 (ref (v, i), port, pstate);
|
||||||
scm_putc_unlocked (' ', port);
|
scm_putc (' ', port);
|
||||||
}
|
}
|
||||||
if (i == last)
|
if (i == last)
|
||||||
{
|
{
|
||||||
|
@ -611,7 +611,7 @@ print_vector_or_weak_vector (SCM v, size_t len, SCM (*ref) (SCM, size_t),
|
||||||
}
|
}
|
||||||
if (cutp)
|
if (cutp)
|
||||||
scm_puts_unlocked (" ...", port);
|
scm_puts_unlocked (" ...", port);
|
||||||
scm_putc_unlocked (')', port);
|
scm_putc (')', port);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -744,9 +744,9 @@ iprin1 (SCM exp, SCM port, scm_print_state *pstate)
|
||||||
{
|
{
|
||||||
scm_puts_unlocked ("#<uninterned-symbol ", port);
|
scm_puts_unlocked ("#<uninterned-symbol ", port);
|
||||||
print_symbol (exp, port);
|
print_symbol (exp, port);
|
||||||
scm_putc_unlocked (' ', port);
|
scm_putc (' ', port);
|
||||||
scm_uintprint (SCM_UNPACK (exp), 16, port);
|
scm_uintprint (SCM_UNPACK (exp), 16, port);
|
||||||
scm_putc_unlocked ('>', port);
|
scm_putc ('>', port);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case scm_tc7_variable:
|
case scm_tc7_variable:
|
||||||
|
@ -1404,7 +1404,7 @@ scm_ipruk (char *hdr, SCM ptr, SCM port)
|
||||||
}
|
}
|
||||||
scm_puts_unlocked (" 0x", port);
|
scm_puts_unlocked (" 0x", port);
|
||||||
scm_uintprint (SCM_UNPACK (ptr), 16, port);
|
scm_uintprint (SCM_UNPACK (ptr), 16, port);
|
||||||
scm_putc_unlocked ('>', port);
|
scm_putc ('>', port);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1445,7 +1445,7 @@ scm_iprlist (char *hdr, SCM exp, int tlr, SCM port, scm_print_state *pstate)
|
||||||
if (scm_is_eq (PSTATE_STACK_REF(pstate, i), exp))
|
if (scm_is_eq (PSTATE_STACK_REF(pstate, i), exp))
|
||||||
goto circref;
|
goto circref;
|
||||||
PUSH_REF (pstate, exp);
|
PUSH_REF (pstate, exp);
|
||||||
scm_putc_unlocked (' ', port);
|
scm_putc (' ', port);
|
||||||
/* CHECK_INTS; */
|
/* CHECK_INTS; */
|
||||||
scm_iprin1 (SCM_CAR (exp), port, pstate);
|
scm_iprin1 (SCM_CAR (exp), port, pstate);
|
||||||
}
|
}
|
||||||
|
@ -1456,7 +1456,7 @@ scm_iprlist (char *hdr, SCM exp, int tlr, SCM port, scm_print_state *pstate)
|
||||||
}
|
}
|
||||||
|
|
||||||
end:
|
end:
|
||||||
scm_putc_unlocked (tlr, port);
|
scm_putc (tlr, port);
|
||||||
pstate->top = floor + 2;
|
pstate->top = floor + 2;
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -1485,7 +1485,7 @@ fancy_printing:
|
||||||
}
|
}
|
||||||
PUSH_REF(pstate, exp);
|
PUSH_REF(pstate, exp);
|
||||||
++pstate->list_offset;
|
++pstate->list_offset;
|
||||||
scm_putc_unlocked (' ', port);
|
scm_putc (' ', port);
|
||||||
/* CHECK_INTS; */
|
/* CHECK_INTS; */
|
||||||
scm_iprin1 (SCM_CAR (exp), port, pstate);
|
scm_iprin1 (SCM_CAR (exp), port, pstate);
|
||||||
}
|
}
|
||||||
|
@ -1665,7 +1665,7 @@ SCM_DEFINE (scm_newline, "newline", 0, 1, 0,
|
||||||
|
|
||||||
SCM_VALIDATE_OPORT_VALUE (1, port);
|
SCM_VALIDATE_OPORT_VALUE (1, port);
|
||||||
|
|
||||||
scm_putc_unlocked ('\n', SCM_COERCE_OUTPORT (port));
|
scm_putc ('\n', SCM_COERCE_OUTPORT (port));
|
||||||
return SCM_UNSPECIFIED;
|
return SCM_UNSPECIFIED;
|
||||||
}
|
}
|
||||||
#undef FUNC_NAME
|
#undef FUNC_NAME
|
||||||
|
|
|
@ -105,22 +105,22 @@ scm_i_program_print (SCM program, SCM port, scm_print_state *pstate)
|
||||||
/* twingliness */
|
/* twingliness */
|
||||||
scm_puts_unlocked ("#<continuation ", port);
|
scm_puts_unlocked ("#<continuation ", port);
|
||||||
scm_uintprint (SCM_UNPACK (program), 16, port);
|
scm_uintprint (SCM_UNPACK (program), 16, port);
|
||||||
scm_putc_unlocked ('>', port);
|
scm_putc ('>', port);
|
||||||
}
|
}
|
||||||
else if (SCM_PROGRAM_IS_PARTIAL_CONTINUATION (program))
|
else if (SCM_PROGRAM_IS_PARTIAL_CONTINUATION (program))
|
||||||
{
|
{
|
||||||
/* twingliness */
|
/* twingliness */
|
||||||
scm_puts_unlocked ("#<partial-continuation ", port);
|
scm_puts_unlocked ("#<partial-continuation ", port);
|
||||||
scm_uintprint (SCM_UNPACK (program), 16, port);
|
scm_uintprint (SCM_UNPACK (program), 16, port);
|
||||||
scm_putc_unlocked ('>', port);
|
scm_putc ('>', port);
|
||||||
}
|
}
|
||||||
else if (scm_is_false (write_program) || print_error)
|
else if (scm_is_false (write_program) || print_error)
|
||||||
{
|
{
|
||||||
scm_puts_unlocked ("#<program ", port);
|
scm_puts_unlocked ("#<program ", port);
|
||||||
scm_uintprint (SCM_UNPACK (program), 16, port);
|
scm_uintprint (SCM_UNPACK (program), 16, port);
|
||||||
scm_putc_unlocked (' ', port);
|
scm_putc (' ', port);
|
||||||
scm_uintprint ((scm_t_uintptr) SCM_PROGRAM_CODE (program), 16, port);
|
scm_uintprint ((scm_t_uintptr) SCM_PROGRAM_CODE (program), 16, port);
|
||||||
scm_putc_unlocked ('>', port);
|
scm_putc ('>', port);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -92,7 +92,7 @@ promise_print (SCM exp, SCM port, scm_print_state *pstate)
|
||||||
SCM_SET_WRITINGP (pstate, 1);
|
SCM_SET_WRITINGP (pstate, 1);
|
||||||
scm_iprin1 (SCM_PROMISE_DATA (exp), port, pstate);
|
scm_iprin1 (SCM_PROMISE_DATA (exp), port, pstate);
|
||||||
SCM_SET_WRITINGP (pstate, writingp);
|
SCM_SET_WRITINGP (pstate, writingp);
|
||||||
scm_putc_unlocked ('>', port);
|
scm_putc ('>', port);
|
||||||
return !0;
|
return !0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -558,7 +558,7 @@ SCM_DEFINE (scm_put_u8, "put-u8", 2, 0, 0,
|
||||||
SCM_VALIDATE_BINARY_OUTPUT_PORT (1, port);
|
SCM_VALIDATE_BINARY_OUTPUT_PORT (1, port);
|
||||||
c_octet = scm_to_uint8 (octet);
|
c_octet = scm_to_uint8 (octet);
|
||||||
|
|
||||||
scm_putc_unlocked ((char) c_octet, port);
|
scm_putc ((char) c_octet, port);
|
||||||
|
|
||||||
return SCM_UNSPECIFIED;
|
return SCM_UNSPECIFIED;
|
||||||
}
|
}
|
||||||
|
|
|
@ -107,12 +107,12 @@ scm_smob_print (SCM exp, SCM port, scm_print_state *pstate SCM_UNUSED)
|
||||||
long n = SCM_SMOBNUM (exp);
|
long n = SCM_SMOBNUM (exp);
|
||||||
scm_puts_unlocked ("#<", port);
|
scm_puts_unlocked ("#<", port);
|
||||||
scm_puts_unlocked (SCM_SMOBNAME (n) ? SCM_SMOBNAME (n) : "smob", port);
|
scm_puts_unlocked (SCM_SMOBNAME (n) ? SCM_SMOBNAME (n) : "smob", port);
|
||||||
scm_putc_unlocked (' ', port);
|
scm_putc (' ', port);
|
||||||
if (scm_smobs[n].size)
|
if (scm_smobs[n].size)
|
||||||
scm_uintprint (SCM_CELL_WORD_1 (exp), 16, port);
|
scm_uintprint (SCM_CELL_WORD_1 (exp), 16, port);
|
||||||
else
|
else
|
||||||
scm_uintprint (SCM_UNPACK (exp), 16, port);
|
scm_uintprint (SCM_UNPACK (exp), 16, port);
|
||||||
scm_putc_unlocked ('>', port);
|
scm_putc ('>', port);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -108,7 +108,7 @@ srcprops_print (SCM obj, SCM port, scm_print_state *pstate)
|
||||||
SCM_SET_WRITINGP (pstate, 1);
|
SCM_SET_WRITINGP (pstate, 1);
|
||||||
scm_iprin1 (scm_srcprops_to_alist (obj), port, pstate);
|
scm_iprin1 (scm_srcprops_to_alist (obj), port, pstate);
|
||||||
SCM_SET_WRITINGP (pstate, writingp);
|
SCM_SET_WRITINGP (pstate, writingp);
|
||||||
scm_putc_unlocked ('>', port);
|
scm_putc ('>', port);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -940,7 +940,7 @@ scm_print_struct (SCM exp, SCM port, scm_print_state *pstate)
|
||||||
if (scm_is_true (name))
|
if (scm_is_true (name))
|
||||||
{
|
{
|
||||||
scm_display (name, port);
|
scm_display (name, port);
|
||||||
scm_putc_unlocked (' ', port);
|
scm_putc (' ', port);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -949,9 +949,9 @@ scm_print_struct (SCM exp, SCM port, scm_print_state *pstate)
|
||||||
else
|
else
|
||||||
scm_puts_unlocked ("struct:", port);
|
scm_puts_unlocked ("struct:", port);
|
||||||
scm_uintprint (SCM_UNPACK (vtable), 16, port);
|
scm_uintprint (SCM_UNPACK (vtable), 16, port);
|
||||||
scm_putc_unlocked (' ', port);
|
scm_putc (' ', port);
|
||||||
scm_write (SCM_VTABLE_LAYOUT (vtable), port);
|
scm_write (SCM_VTABLE_LAYOUT (vtable), port);
|
||||||
scm_putc_unlocked (' ', port);
|
scm_putc (' ', port);
|
||||||
}
|
}
|
||||||
scm_uintprint (SCM_UNPACK (exp), 16, port);
|
scm_uintprint (SCM_UNPACK (exp), 16, port);
|
||||||
/* hackety hack */
|
/* hackety hack */
|
||||||
|
@ -971,7 +971,7 @@ scm_print_struct (SCM exp, SCM port, scm_print_state *pstate)
|
||||||
scm_write (SCM_STRUCT_SETTER (exp), port);
|
scm_write (SCM_STRUCT_SETTER (exp), port);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
scm_putc_unlocked ('>', port);
|
scm_putc ('>', port);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@ scm_i_variable_print (SCM exp, SCM port, scm_print_state *pstate)
|
||||||
scm_uintprint (SCM_UNPACK (exp), 16, port);
|
scm_uintprint (SCM_UNPACK (exp), 16, port);
|
||||||
scm_puts_unlocked (" value: ", port);
|
scm_puts_unlocked (" value: ", port);
|
||||||
scm_iprin1 (SCM_VARIABLE_REF (exp), port, pstate);
|
scm_iprin1 (SCM_VARIABLE_REF (exp), port, pstate);
|
||||||
scm_putc_unlocked('>', port);
|
scm_putc ('>', port);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -678,7 +678,7 @@ scm_i_weak_set_print (SCM exp, SCM port, scm_print_state *pstate)
|
||||||
scm_puts_unlocked ("#<", port);
|
scm_puts_unlocked ("#<", port);
|
||||||
scm_puts_unlocked ("weak-set ", port);
|
scm_puts_unlocked ("weak-set ", port);
|
||||||
scm_uintprint (SCM_WEAK_SET (exp)->n_items, 10, port);
|
scm_uintprint (SCM_WEAK_SET (exp)->n_items, 10, port);
|
||||||
scm_putc_unlocked ('/', port);
|
scm_putc ('/', port);
|
||||||
scm_uintprint (SCM_WEAK_SET (exp)->size, 10, port);
|
scm_uintprint (SCM_WEAK_SET (exp)->size, 10, port);
|
||||||
scm_puts_unlocked (">", port);
|
scm_puts_unlocked (">", port);
|
||||||
}
|
}
|
||||||
|
|
|
@ -793,7 +793,7 @@ scm_i_weak_table_print (SCM exp, SCM port, scm_print_state *pstate)
|
||||||
scm_puts_unlocked ("#<", port);
|
scm_puts_unlocked ("#<", port);
|
||||||
scm_puts_unlocked ("weak-table ", port);
|
scm_puts_unlocked ("weak-table ", port);
|
||||||
scm_uintprint (SCM_WEAK_TABLE (exp)->n_items, 10, port);
|
scm_uintprint (SCM_WEAK_TABLE (exp)->n_items, 10, port);
|
||||||
scm_putc_unlocked ('/', port);
|
scm_putc ('/', port);
|
||||||
scm_uintprint (SCM_WEAK_TABLE (exp)->size, 10, port);
|
scm_uintprint (SCM_WEAK_TABLE (exp)->size, 10, port);
|
||||||
scm_puts_unlocked (">", port);
|
scm_puts_unlocked (">", port);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue