mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-20 11:40:18 +02:00
Remove scm_puts_unlocked.
* libguile/ports.h (scm_puts_unlocked): Remove. * libguile/ports.c (scm_puts): Replace implementation with scm_puts_unlocked's implementation. * libguile/arbiters.c: * libguile/backtrace.c: * libguile/bitvectors.c: * libguile/continuations.c: * libguile/deprecation.c: * libguile/dynl.c: * libguile/eval.c: * libguile/filesys.c: * libguile/fluids.c: * libguile/foreign.c: * libguile/fports.c: * libguile/frames.c: * libguile/guardians.c: * libguile/hashtab.c: * libguile/hooks.c: * libguile/load.c: * libguile/macros.c: * libguile/mallocs.c: * libguile/print.c: * libguile/programs.c: * libguile/promises.c: * libguile/smob.c: * libguile/srcprop.c: * libguile/srfi-14.c: * libguile/stackchk.c: * libguile/struct.c: * libguile/threads.c: * libguile/throw.c: * libguile/values.c: * libguile/variable.c: * libguile/vm.c: * libguile/weak-set.c: * libguile/weak-table.c: Use scm_puts instead of scm_puts_unlocked.
This commit is contained in:
parent
206b3f6e03
commit
105e36543f
35 changed files with 118 additions and 129 deletions
|
@ -89,9 +89,9 @@ static scm_t_bits scm_tc16_arbiter;
|
|||
static int
|
||||
arbiter_print (SCM exp, SCM port, scm_print_state *pstate)
|
||||
{
|
||||
scm_puts_unlocked ("#<arbiter ", port);
|
||||
scm_puts ("#<arbiter ", port);
|
||||
if (SCM_ARB_LOCKED (exp))
|
||||
scm_puts_unlocked ("locked ", port);
|
||||
scm_puts ("locked ", port);
|
||||
scm_iprin1 (SCM_PACK (SCM_SMOB_DATA (exp)), port, pstate);
|
||||
scm_putc ('>', port);
|
||||
return !0;
|
||||
|
|
|
@ -58,9 +58,9 @@ static SCM
|
|||
boot_print_exception (SCM port, SCM frame, SCM key, SCM args)
|
||||
#define FUNC_NAME "boot-print-exception"
|
||||
{
|
||||
scm_puts_unlocked ("Throw to key ", port);
|
||||
scm_puts ("Throw to key ", port);
|
||||
scm_write (key, port);
|
||||
scm_puts_unlocked (" with args ", port);
|
||||
scm_puts (" with args ", port);
|
||||
scm_write (args, port);
|
||||
return SCM_UNSPECIFIED;
|
||||
}
|
||||
|
@ -253,7 +253,7 @@ error_during_backtrace (void *data, SCM tag, SCM throw_args)
|
|||
{
|
||||
SCM port = SCM_PACK_POINTER (data);
|
||||
|
||||
scm_puts_unlocked ("Exception thrown while printing backtrace:\n", port);
|
||||
scm_puts ("Exception thrown while printing backtrace:\n", port);
|
||||
scm_print_exception (port, SCM_BOOL_F, tag, throw_args);
|
||||
|
||||
return SCM_UNSPECIFIED;
|
||||
|
@ -311,7 +311,7 @@ SCM_DEFINE (scm_backtrace_with_highlights, "backtrace", 0, 1, 0,
|
|||
highlights = SCM_EOL;
|
||||
|
||||
scm_newline (port);
|
||||
scm_puts_unlocked ("Backtrace:\n", port);
|
||||
scm_puts ("Backtrace:\n", port);
|
||||
scm_display_backtrace_with_highlights (stack, port, SCM_BOOL_F, SCM_BOOL_F,
|
||||
highlights);
|
||||
scm_newline (port);
|
||||
|
|
|
@ -57,7 +57,7 @@ scm_i_print_bitvector (SCM vec, SCM port, scm_print_state *pstate)
|
|||
scm_t_uint32 *bits = BITVECTOR_BITS (vec);
|
||||
size_t i, j;
|
||||
|
||||
scm_puts_unlocked ("#*", port);
|
||||
scm_puts ("#*", port);
|
||||
for (i = 0; i < word_len; i++, bit_len -= 32)
|
||||
{
|
||||
scm_t_uint32 mask = 1;
|
||||
|
|
|
@ -92,9 +92,9 @@ continuation_print (SCM obj, SCM port, scm_print_state *state SCM_UNUSED)
|
|||
{
|
||||
scm_t_contregs *continuation = SCM_CONTREGS (obj);
|
||||
|
||||
scm_puts_unlocked ("#<continuation ", port);
|
||||
scm_puts ("#<continuation ", port);
|
||||
scm_intprint (continuation->num_stack_items, 10, port);
|
||||
scm_puts_unlocked (" @ ", port);
|
||||
scm_puts (" @ ", port);
|
||||
scm_uintprint (SCM_SMOB_DATA_1 (obj), 16, port);
|
||||
scm_putc ('>', port);
|
||||
return 1;
|
||||
|
@ -404,7 +404,7 @@ print_exception_and_backtrace (SCM port, SCM tag, SCM args)
|
|||
|
||||
if (should_print_backtrace (tag, stack))
|
||||
{
|
||||
scm_puts_unlocked ("Backtrace:\n", port);
|
||||
scm_puts ("Backtrace:\n", port);
|
||||
scm_display_backtrace_with_highlights (stack, port,
|
||||
SCM_BOOL_F, SCM_BOOL_F,
|
||||
SCM_EOL);
|
||||
|
|
|
@ -83,7 +83,7 @@ scm_c_issue_deprecation_warning (const char *msg)
|
|||
fprintf (stderr, "%s\n", msg);
|
||||
else
|
||||
{
|
||||
scm_puts_unlocked (msg, scm_current_warning_port ());
|
||||
scm_puts (msg, scm_current_warning_port ());
|
||||
scm_newline (scm_current_warning_port ());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -229,10 +229,10 @@ scm_t_bits scm_tc16_dynamic_obj;
|
|||
static int
|
||||
dynl_obj_print (SCM exp, SCM port, scm_print_state *pstate)
|
||||
{
|
||||
scm_puts_unlocked ("#<dynamic-object ", port);
|
||||
scm_puts ("#<dynamic-object ", port);
|
||||
scm_iprin1 (DYNL_FILENAME (exp), port, pstate);
|
||||
if (DYNL_HANDLE (exp) == NULL)
|
||||
scm_puts_unlocked (" (unlinked)", port);
|
||||
scm_puts (" (unlinked)", port);
|
||||
scm_putc ('>', port);
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -920,7 +920,7 @@ static int
|
|||
boot_closure_print (SCM closure, SCM port, scm_print_state *pstate)
|
||||
{
|
||||
SCM args;
|
||||
scm_puts_unlocked ("#<boot-closure ", port);
|
||||
scm_puts ("#<boot-closure ", port);
|
||||
scm_uintprint (SCM_UNPACK (closure), 16, port);
|
||||
scm_putc (' ', port);
|
||||
args = scm_make_list (scm_from_int (BOOT_CLOSURE_NUM_REQUIRED_ARGS (closure)),
|
||||
|
|
|
@ -1820,10 +1820,10 @@ SCM_DEFINE (scm_closedir, "closedir", 1, 0, 0,
|
|||
static int
|
||||
scm_dir_print (SCM exp, SCM port, scm_print_state *pstate SCM_UNUSED)
|
||||
{
|
||||
scm_puts_unlocked ("#<", port);
|
||||
scm_puts ("#<", port);
|
||||
if (!SCM_DIR_OPEN_P (exp))
|
||||
scm_puts_unlocked ("closed: ", port);
|
||||
scm_puts_unlocked ("directory stream ", port);
|
||||
scm_puts ("closed: ", port);
|
||||
scm_puts ("directory stream ", port);
|
||||
scm_uintprint (SCM_SMOB_DATA_1 (exp), 16, port);
|
||||
scm_putc ('>', port);
|
||||
return 1;
|
||||
|
|
|
@ -79,7 +79,7 @@ grow_dynamic_state (SCM state)
|
|||
void
|
||||
scm_i_fluid_print (SCM exp, SCM port, scm_print_state *pstate SCM_UNUSED)
|
||||
{
|
||||
scm_puts_unlocked ("#<fluid ", port);
|
||||
scm_puts ("#<fluid ", port);
|
||||
scm_intprint ((int) FLUID_NUM (exp), 10, port);
|
||||
scm_putc ('>', port);
|
||||
}
|
||||
|
@ -87,7 +87,7 @@ scm_i_fluid_print (SCM exp, SCM port, scm_print_state *pstate SCM_UNUSED)
|
|||
void
|
||||
scm_i_dynamic_state_print (SCM exp, SCM port, scm_print_state *pstate SCM_UNUSED)
|
||||
{
|
||||
scm_puts_unlocked ("#<dynamic-state ", port);
|
||||
scm_puts ("#<dynamic-state ", port);
|
||||
scm_intprint (SCM_UNPACK (exp), 16, port);
|
||||
scm_putc ('>', port);
|
||||
}
|
||||
|
|
|
@ -313,7 +313,7 @@ SCM_DEFINE (scm_set_pointer_finalizer_x, "set-pointer-finalizer!", 2, 0, 0,
|
|||
void
|
||||
scm_i_pointer_print (SCM pointer, SCM port, scm_print_state *pstate)
|
||||
{
|
||||
scm_puts_unlocked ("#<pointer 0x", port);
|
||||
scm_puts ("#<pointer 0x", port);
|
||||
scm_uintprint (scm_to_uintptr_t (scm_pointer_address (pointer)), 16, port);
|
||||
scm_putc ('>', port);
|
||||
}
|
||||
|
|
|
@ -546,7 +546,7 @@ SCM_DEFINE (scm_adjust_port_revealed_x, "adjust-port-revealed!", 2, 0, 0,
|
|||
static int
|
||||
fport_print (SCM exp, SCM port, scm_print_state *pstate SCM_UNUSED)
|
||||
{
|
||||
scm_puts_unlocked ("#<", port);
|
||||
scm_puts ("#<", port);
|
||||
scm_print_port_mode (exp, port);
|
||||
if (SCM_OPFPORTP (exp))
|
||||
{
|
||||
|
@ -555,7 +555,7 @@ fport_print (SCM exp, SCM port, scm_print_state *pstate SCM_UNUSED)
|
|||
if (scm_is_string (name) || scm_is_symbol (name))
|
||||
scm_display (name, port);
|
||||
else
|
||||
scm_puts_unlocked (SCM_PTOBNAME (SCM_PTOBNUM (exp)), port);
|
||||
scm_puts (SCM_PTOBNAME (SCM_PTOBNUM (exp)), port);
|
||||
scm_putc (' ', port);
|
||||
fdes = (SCM_FSTREAM (exp))->fdes;
|
||||
|
||||
|
@ -568,7 +568,7 @@ fport_print (SCM exp, SCM port, scm_print_state *pstate SCM_UNUSED)
|
|||
}
|
||||
else
|
||||
{
|
||||
scm_puts_unlocked (SCM_PTOBNAME (SCM_PTOBNUM (exp)), port);
|
||||
scm_puts (SCM_PTOBNAME (SCM_PTOBNUM (exp)), port);
|
||||
scm_putc (' ', port);
|
||||
scm_uintprint ((scm_t_bits) SCM_PTAB_ENTRY (exp), 16, port);
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ scm_c_make_frame (enum scm_vm_frame_kind kind, const struct scm_frame *frame)
|
|||
void
|
||||
scm_i_frame_print (SCM frame, SCM port, scm_print_state *pstate)
|
||||
{
|
||||
scm_puts_unlocked ("#<frame ", port);
|
||||
scm_puts ("#<frame ", port);
|
||||
scm_uintprint (SCM_UNPACK (frame), 16, port);
|
||||
if (scm_module_system_booted_p)
|
||||
{
|
||||
|
@ -54,7 +54,7 @@ scm_i_frame_print (SCM frame, SCM port, scm_print_state *pstate)
|
|||
}
|
||||
}
|
||||
/* Don't write args, they can be ridiculously long. */
|
||||
scm_puts_unlocked (">", port);
|
||||
scm_puts (">", port);
|
||||
}
|
||||
|
||||
static union scm_vm_stack_element*
|
||||
|
|
|
@ -86,16 +86,16 @@ guardian_print (SCM guardian, SCM port, scm_print_state *pstate SCM_UNUSED)
|
|||
{
|
||||
t_guardian *g = GUARDIAN_DATA (guardian);
|
||||
|
||||
scm_puts_unlocked ("#<guardian ", port);
|
||||
scm_puts ("#<guardian ", port);
|
||||
scm_uintprint ((scm_t_bits) g, 16, port);
|
||||
|
||||
scm_puts_unlocked (" (reachable: ", port);
|
||||
scm_puts (" (reachable: ", port);
|
||||
scm_display (scm_from_uint (g->live), port);
|
||||
scm_puts_unlocked (" unreachable: ", port);
|
||||
scm_puts (" unreachable: ", port);
|
||||
scm_display (scm_length (g->zombies), port);
|
||||
scm_puts_unlocked (")", port);
|
||||
scm_puts (")", port);
|
||||
|
||||
scm_puts_unlocked (">", port);
|
||||
scm_puts (">", port);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
|
|
@ -168,14 +168,14 @@ scm_i_rehash (SCM table,
|
|||
void
|
||||
scm_i_hashtable_print (SCM exp, SCM port, scm_print_state *pstate)
|
||||
{
|
||||
scm_puts_unlocked ("#<hash-table ", port);
|
||||
scm_puts ("#<hash-table ", port);
|
||||
scm_uintprint (SCM_UNPACK (exp), 16, port);
|
||||
scm_putc (' ', port);
|
||||
scm_uintprint (SCM_HASHTABLE_N_ITEMS (exp), 10, port);
|
||||
scm_putc ('/', port);
|
||||
scm_uintprint (SCM_SIMPLE_VECTOR_LENGTH (SCM_HASHTABLE_VECTOR (exp)),
|
||||
10, port);
|
||||
scm_puts_unlocked (">", port);
|
||||
scm_puts (">", port);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -134,7 +134,7 @@ static int
|
|||
hook_print (SCM hook, SCM port, scm_print_state *pstate)
|
||||
{
|
||||
SCM ls, name;
|
||||
scm_puts_unlocked ("#<hook ", port);
|
||||
scm_puts ("#<hook ", port);
|
||||
scm_intprint (SCM_HOOK_ARITY (hook), 10, port);
|
||||
scm_putc (' ', port);
|
||||
scm_uintprint (SCM_UNPACK (hook), 16, port);
|
||||
|
|
|
@ -560,11 +560,11 @@ compiled_is_fresh (SCM full_filename, SCM compiled_filename,
|
|||
else
|
||||
{
|
||||
compiled_is_newer = 0;
|
||||
scm_puts_unlocked (";;; note: source file ", scm_current_warning_port ());
|
||||
scm_puts (";;; note: source file ", scm_current_warning_port ());
|
||||
scm_display (full_filename, scm_current_warning_port ());
|
||||
scm_puts_unlocked ("\n;;; newer than compiled ", scm_current_warning_port ());
|
||||
scm_puts ("\n;;; newer than compiled ", scm_current_warning_port ());
|
||||
scm_display (compiled_filename, scm_current_warning_port ());
|
||||
scm_puts_unlocked ("\n", scm_current_warning_port ());
|
||||
scm_puts ("\n", scm_current_warning_port ());
|
||||
}
|
||||
|
||||
return compiled_is_newer;
|
||||
|
@ -704,7 +704,7 @@ search_path (SCM path, SCM filename, SCM extensions, SCM require_exts,
|
|||
|
||||
if (found_stale_file && *found_stale_file)
|
||||
{
|
||||
scm_puts_unlocked (";;; found fresh compiled file at ",
|
||||
scm_puts (";;; found fresh compiled file at ",
|
||||
scm_current_warning_port ());
|
||||
scm_display (found, scm_current_warning_port ());
|
||||
scm_newline (scm_current_warning_port ());
|
||||
|
@ -823,7 +823,7 @@ do_try_auto_compile (void *data)
|
|||
SCM source = SCM_PACK_POINTER (data);
|
||||
SCM comp_mod, compile_file;
|
||||
|
||||
scm_puts_unlocked (";;; compiling ", scm_current_warning_port ());
|
||||
scm_puts (";;; compiling ", scm_current_warning_port ());
|
||||
scm_display (source, scm_current_warning_port ());
|
||||
scm_newline (scm_current_warning_port ());
|
||||
|
||||
|
@ -852,16 +852,16 @@ do_try_auto_compile (void *data)
|
|||
/* Assume `*current-warning-prefix*' has an appropriate value. */
|
||||
res = scm_call_n (scm_variable_ref (compile_file), args, 5);
|
||||
|
||||
scm_puts_unlocked (";;; compiled ", scm_current_warning_port ());
|
||||
scm_puts (";;; compiled ", scm_current_warning_port ());
|
||||
scm_display (res, scm_current_warning_port ());
|
||||
scm_newline (scm_current_warning_port ());
|
||||
return res;
|
||||
}
|
||||
else
|
||||
{
|
||||
scm_puts_unlocked (";;; it seems ", scm_current_warning_port ());
|
||||
scm_puts (";;; it seems ", scm_current_warning_port ());
|
||||
scm_display (source, scm_current_warning_port ());
|
||||
scm_puts_unlocked ("\n;;; is part of the compiler; skipping auto-compilation\n",
|
||||
scm_puts ("\n;;; is part of the compiler; skipping auto-compilation\n",
|
||||
scm_current_warning_port ());
|
||||
return SCM_BOOL_F;
|
||||
}
|
||||
|
@ -876,16 +876,16 @@ auto_compile_catch_handler (void *data, SCM tag, SCM throw_args)
|
|||
oport = scm_open_output_string ();
|
||||
scm_print_exception (oport, SCM_BOOL_F, tag, throw_args);
|
||||
|
||||
scm_puts_unlocked (";;; WARNING: compilation of ", scm_current_warning_port ());
|
||||
scm_puts (";;; WARNING: compilation of ", scm_current_warning_port ());
|
||||
scm_display (source, scm_current_warning_port ());
|
||||
scm_puts_unlocked (" failed:\n", scm_current_warning_port ());
|
||||
scm_puts (" failed:\n", scm_current_warning_port ());
|
||||
|
||||
lines = scm_string_split (scm_get_output_string (oport),
|
||||
SCM_MAKE_CHAR ('\n'));
|
||||
for (; scm_is_pair (lines); lines = scm_cdr (lines))
|
||||
if (scm_c_string_length (scm_car (lines)))
|
||||
{
|
||||
scm_puts_unlocked (";;; ", scm_current_warning_port ());
|
||||
scm_puts (";;; ", scm_current_warning_port ());
|
||||
scm_display (scm_car (lines), scm_current_warning_port ());
|
||||
scm_newline (scm_current_warning_port ());
|
||||
}
|
||||
|
@ -903,7 +903,7 @@ SCM_DEFINE (scm_sys_warn_auto_compilation_enabled, "%warn-auto-compilation-enabl
|
|||
|
||||
if (!message_shown)
|
||||
{
|
||||
scm_puts_unlocked (";;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0\n"
|
||||
scm_puts (";;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0\n"
|
||||
";;; or pass the --no-auto-compile argument to disable.\n",
|
||||
scm_current_warning_port ());
|
||||
message_shown = 1;
|
||||
|
@ -1040,7 +1040,7 @@ SCM_DEFINE (scm_primitive_load_path, "primitive-load-path", 0, 0, 1,
|
|||
{
|
||||
if (found_stale_compiled_file)
|
||||
{
|
||||
scm_puts_unlocked (";;; found fresh local cache at ",
|
||||
scm_puts (";;; found fresh local cache at ",
|
||||
scm_current_warning_port ());
|
||||
scm_display (fallback, scm_current_warning_port ());
|
||||
scm_newline (scm_current_warning_port ());
|
||||
|
|
|
@ -49,9 +49,9 @@ static int
|
|||
macro_print (SCM macro, SCM port, scm_print_state *pstate)
|
||||
{
|
||||
if (scm_is_false (SCM_MACRO_TYPE (macro)))
|
||||
scm_puts_unlocked ("#<primitive-syntax-transformer ", port);
|
||||
scm_puts ("#<primitive-syntax-transformer ", port);
|
||||
else
|
||||
scm_puts_unlocked ("#<syntax-transformer ", port);
|
||||
scm_puts ("#<syntax-transformer ", port);
|
||||
scm_iprin1 (scm_macro_name (macro), port, pstate);
|
||||
scm_putc ('>', port);
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ scm_t_bits scm_tc16_malloc;
|
|||
static int
|
||||
malloc_print (SCM exp, SCM port, scm_print_state *pstate SCM_UNUSED)
|
||||
{
|
||||
scm_puts_unlocked ("#<malloc ", port);
|
||||
scm_puts ("#<malloc ", port);
|
||||
scm_uintprint (SCM_SMOB_DATA (exp), 16, port);
|
||||
scm_putc ('>', port);
|
||||
return 1;
|
||||
|
|
|
@ -2486,11 +2486,8 @@ scm_putc (char c, SCM port)
|
|||
void
|
||||
scm_puts (const char *s, SCM port)
|
||||
{
|
||||
scm_i_pthread_mutex_t *lock;
|
||||
scm_c_lock_port (port, &lock);
|
||||
scm_puts_unlocked (s, port);
|
||||
if (lock)
|
||||
scm_i_pthread_mutex_unlock (lock);
|
||||
SCM_ASSERT_TYPE (SCM_OPOUTPORTP (port), port, 0, NULL, "output port");
|
||||
scm_lfwrite_unlocked (s, strlen (s), port);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -2999,7 +2996,7 @@ SCM_DEFINE (scm_set_port_filename_x, "set-port-filename!", 2, 0, 0,
|
|||
void
|
||||
scm_print_port_mode (SCM exp, SCM port)
|
||||
{
|
||||
scm_puts_unlocked (SCM_CLOSEDP (exp)
|
||||
scm_puts (SCM_CLOSEDP (exp)
|
||||
? "closed: "
|
||||
: (SCM_RDNG & SCM_CELL_WORD_0 (exp)
|
||||
? (SCM_WRTNG & SCM_CELL_WORD_0 (exp)
|
||||
|
@ -3017,9 +3014,9 @@ scm_port_print (SCM exp, SCM port, scm_print_state *pstate SCM_UNUSED)
|
|||
char *type = SCM_PTOBNAME (SCM_PTOBNUM (exp));
|
||||
if (!type)
|
||||
type = "port";
|
||||
scm_puts_unlocked ("#<", port);
|
||||
scm_puts ("#<", port);
|
||||
scm_print_port_mode (exp, port);
|
||||
scm_puts_unlocked (type, port);
|
||||
scm_puts (type, port);
|
||||
scm_putc (' ', port);
|
||||
scm_uintprint (SCM_CELL_WORD_1 (exp), 16, port);
|
||||
scm_putc ('>', port);
|
||||
|
|
|
@ -325,7 +325,6 @@ SCM_INTERNAL SCM scm_port_write_buffer (SCM port);
|
|||
/* Output. */
|
||||
SCM_API void scm_putc (char c, 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_API void scm_c_write (SCM port, const void *buffer, size_t size);
|
||||
SCM_API void scm_c_write_unlocked (SCM port, const void *buffer, size_t size);
|
||||
SCM_API void scm_c_write_bytes (SCM port, SCM src, size_t start, size_t count);
|
||||
|
@ -394,13 +393,6 @@ scm_c_try_lock_port (SCM port, scm_i_pthread_mutex_t **lock)
|
|||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
SCM_INLINE_IMPLEMENTATION void
|
||||
scm_puts_unlocked (const char *s, SCM port)
|
||||
{
|
||||
SCM_ASSERT_TYPE (SCM_OPOUTPORTP (port), port, 0, NULL, "output port");
|
||||
scm_lfwrite_unlocked (s, strlen (s), port);
|
||||
}
|
||||
#endif /* SCM_CAN_INLINE || defined SCM_INLINE_C_IMPLEMENTING_INLINES */
|
||||
|
||||
#endif /* SCM_PORTS_H */
|
||||
|
|
|
@ -566,7 +566,7 @@ static void iprin1 (SCM exp, SCM port, scm_print_state *pstate);
|
|||
scm_intprint (i, 8, port); \
|
||||
else \
|
||||
{ \
|
||||
scm_puts_unlocked ("x", port); \
|
||||
scm_puts ("x", port); \
|
||||
scm_intprint (i, 16, port); \
|
||||
} \
|
||||
} \
|
||||
|
@ -610,7 +610,7 @@ print_vector_or_weak_vector (SCM v, size_t len, SCM (*ref) (SCM, size_t),
|
|||
scm_iprin1 (ref (v, i), port, pstate);
|
||||
}
|
||||
if (cutp)
|
||||
scm_puts_unlocked (" ...", port);
|
||||
scm_puts (" ...", port);
|
||||
scm_putc (')', port);
|
||||
}
|
||||
|
||||
|
@ -648,7 +648,7 @@ iprin1 (SCM exp, SCM port, scm_print_state *pstate)
|
|||
else if (SCM_IFLAGP (exp)
|
||||
&& ((size_t) SCM_IFLAGNUM (exp) < (sizeof iflagnames / sizeof (char *))))
|
||||
{
|
||||
scm_puts_unlocked (iflagnames [SCM_IFLAGNUM (exp)], port);
|
||||
scm_puts (iflagnames [SCM_IFLAGNUM (exp)], port);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -742,7 +742,7 @@ iprin1 (SCM exp, SCM port, scm_print_state *pstate)
|
|||
}
|
||||
else
|
||||
{
|
||||
scm_puts_unlocked ("#<uninterned-symbol ", port);
|
||||
scm_puts ("#<uninterned-symbol ", port);
|
||||
print_symbol (exp, port);
|
||||
scm_putc (' ', port);
|
||||
scm_uintprint (SCM_UNPACK (exp), 16, port);
|
||||
|
@ -777,7 +777,7 @@ iprin1 (SCM exp, SCM port, scm_print_state *pstate)
|
|||
scm_i_frame_print (exp, port, pstate);
|
||||
break;
|
||||
case scm_tc7_keyword:
|
||||
scm_puts_unlocked ("#:", port);
|
||||
scm_puts ("#:", port);
|
||||
scm_iprin1 (scm_keyword_to_symbol (exp), port, pstate);
|
||||
break;
|
||||
case scm_tc7_vm_cont:
|
||||
|
@ -796,14 +796,14 @@ iprin1 (SCM exp, SCM port, scm_print_state *pstate)
|
|||
break;
|
||||
case scm_tc7_wvect:
|
||||
ENTER_NESTED_DATA (pstate, exp, circref);
|
||||
scm_puts_unlocked ("#w(", port);
|
||||
scm_puts ("#w(", port);
|
||||
print_vector_or_weak_vector (exp, scm_c_weak_vector_length (exp),
|
||||
scm_c_weak_vector_ref, port, pstate);
|
||||
EXIT_NESTED_DATA (pstate);
|
||||
break;
|
||||
case scm_tc7_vector:
|
||||
ENTER_NESTED_DATA (pstate, exp, circref);
|
||||
scm_puts_unlocked ("#(", port);
|
||||
scm_puts ("#(", port);
|
||||
print_vector_or_weak_vector (exp, SCM_SIMPLE_VECTOR_LENGTH (exp),
|
||||
scm_c_vector_ref, port, pstate);
|
||||
EXIT_NESTED_DATA (pstate);
|
||||
|
@ -1282,7 +1282,7 @@ write_character_escaped (scm_t_wchar ch, int string_escapes_p, SCM port)
|
|||
|
||||
name = scm_i_charname (SCM_MAKE_CHAR (ch));
|
||||
if (name != NULL)
|
||||
scm_puts_unlocked (name, port);
|
||||
scm_puts (name, port);
|
||||
else
|
||||
PRINT_CHAR_ESCAPE (ch, port);
|
||||
}
|
||||
|
@ -1392,17 +1392,17 @@ scm_uintprint (scm_t_uintmax n, int radix, SCM port)
|
|||
void
|
||||
scm_ipruk (char *hdr, SCM ptr, SCM port)
|
||||
{
|
||||
scm_puts_unlocked ("#<unknown-", port);
|
||||
scm_puts_unlocked (hdr, port);
|
||||
scm_puts ("#<unknown-", port);
|
||||
scm_puts (hdr, port);
|
||||
if (1) /* (scm_in_heap_p (ptr)) */ /* FIXME */
|
||||
{
|
||||
scm_puts_unlocked (" (0x", port);
|
||||
scm_puts (" (0x", port);
|
||||
scm_uintprint (SCM_CELL_WORD_0 (ptr), 16, port);
|
||||
scm_puts_unlocked (" . 0x", port);
|
||||
scm_puts (" . 0x", port);
|
||||
scm_uintprint (SCM_CELL_WORD_1 (ptr), 16, port);
|
||||
scm_puts_unlocked (") @", port);
|
||||
scm_puts (") @", port);
|
||||
}
|
||||
scm_puts_unlocked (" 0x", port);
|
||||
scm_puts (" 0x", port);
|
||||
scm_uintprint (SCM_UNPACK (ptr), 16, port);
|
||||
scm_putc ('>', port);
|
||||
}
|
||||
|
@ -1415,7 +1415,7 @@ scm_iprlist (char *hdr, SCM exp, int tlr, SCM port, scm_print_state *pstate)
|
|||
{
|
||||
register SCM hare, tortoise;
|
||||
long floor = pstate->top - 2;
|
||||
scm_puts_unlocked (hdr, port);
|
||||
scm_puts (hdr, port);
|
||||
/* CHECK_INTS; */
|
||||
if (pstate->fancyp)
|
||||
goto fancy_printing;
|
||||
|
@ -1451,7 +1451,7 @@ scm_iprlist (char *hdr, SCM exp, int tlr, SCM port, scm_print_state *pstate)
|
|||
}
|
||||
if (!SCM_NULL_OR_NIL_P (exp))
|
||||
{
|
||||
scm_puts_unlocked (" . ", port);
|
||||
scm_puts (" . ", port);
|
||||
scm_iprin1 (exp, port, pstate);
|
||||
}
|
||||
|
||||
|
@ -1477,7 +1477,7 @@ fancy_printing:
|
|||
{
|
||||
if (n == 0)
|
||||
{
|
||||
scm_puts_unlocked (" ...", port);
|
||||
scm_puts (" ...", port);
|
||||
goto skip_tail;
|
||||
}
|
||||
else
|
||||
|
@ -1492,7 +1492,7 @@ fancy_printing:
|
|||
}
|
||||
if (!SCM_NULL_OR_NIL_P (exp))
|
||||
{
|
||||
scm_puts_unlocked (" . ", port);
|
||||
scm_puts (" . ", port);
|
||||
scm_iprin1 (exp, port, pstate);
|
||||
}
|
||||
skip_tail:
|
||||
|
@ -1503,7 +1503,7 @@ fancy_circref:
|
|||
pstate->list_offset -= pstate->top - floor - 2;
|
||||
|
||||
circref:
|
||||
scm_puts_unlocked (" . ", port);
|
||||
scm_puts (" . ", port);
|
||||
print_circref (port, pstate, exp);
|
||||
goto end;
|
||||
}
|
||||
|
|
|
@ -103,20 +103,20 @@ scm_i_program_print (SCM program, SCM port, scm_print_state *pstate)
|
|||
if (SCM_PROGRAM_IS_CONTINUATION (program))
|
||||
{
|
||||
/* twingliness */
|
||||
scm_puts_unlocked ("#<continuation ", port);
|
||||
scm_puts ("#<continuation ", port);
|
||||
scm_uintprint (SCM_UNPACK (program), 16, port);
|
||||
scm_putc ('>', port);
|
||||
}
|
||||
else if (SCM_PROGRAM_IS_PARTIAL_CONTINUATION (program))
|
||||
{
|
||||
/* twingliness */
|
||||
scm_puts_unlocked ("#<partial-continuation ", port);
|
||||
scm_puts ("#<partial-continuation ", port);
|
||||
scm_uintprint (SCM_UNPACK (program), 16, port);
|
||||
scm_putc ('>', port);
|
||||
}
|
||||
else if (scm_is_false (write_program) || print_error)
|
||||
{
|
||||
scm_puts_unlocked ("#<program ", port);
|
||||
scm_puts ("#<program ", port);
|
||||
scm_uintprint (SCM_UNPACK (program), 16, port);
|
||||
scm_putc (' ', port);
|
||||
scm_uintprint ((scm_t_uintptr) SCM_PROGRAM_CODE (program), 16, port);
|
||||
|
|
|
@ -88,7 +88,7 @@ static int
|
|||
promise_print (SCM exp, SCM port, scm_print_state *pstate)
|
||||
{
|
||||
int writingp = SCM_WRITINGP (pstate);
|
||||
scm_puts_unlocked ("#<promise ", port);
|
||||
scm_puts ("#<promise ", port);
|
||||
SCM_SET_WRITINGP (pstate, 1);
|
||||
scm_iprin1 (SCM_PROMISE_DATA (exp), port, pstate);
|
||||
SCM_SET_WRITINGP (pstate, writingp);
|
||||
|
|
|
@ -105,8 +105,8 @@ int
|
|||
scm_smob_print (SCM exp, SCM port, scm_print_state *pstate SCM_UNUSED)
|
||||
{
|
||||
long n = SCM_SMOBNUM (exp);
|
||||
scm_puts_unlocked ("#<", port);
|
||||
scm_puts_unlocked (SCM_SMOBNAME (n) ? SCM_SMOBNAME (n) : "smob", port);
|
||||
scm_puts ("#<", port);
|
||||
scm_puts (SCM_SMOBNAME (n) ? SCM_SMOBNAME (n) : "smob", port);
|
||||
scm_putc (' ', port);
|
||||
if (scm_smobs[n].size)
|
||||
scm_uintprint (SCM_CELL_WORD_1 (exp), 16, port);
|
||||
|
|
|
@ -104,7 +104,7 @@ static int
|
|||
srcprops_print (SCM obj, SCM port, scm_print_state *pstate)
|
||||
{
|
||||
int writingp = SCM_WRITINGP (pstate);
|
||||
scm_puts_unlocked ("#<srcprops ", port);
|
||||
scm_puts ("#<srcprops ", port);
|
||||
SCM_SET_WRITINGP (pstate, 1);
|
||||
scm_iprin1 (scm_srcprops_to_alist (obj), port, pstate);
|
||||
SCM_SET_WRITINGP (pstate, writingp);
|
||||
|
|
|
@ -597,27 +597,27 @@ charset_print (SCM charset, SCM port, scm_print_state *pstate SCM_UNUSED)
|
|||
|
||||
p = SCM_CHARSET_DATA (charset);
|
||||
|
||||
scm_puts_unlocked ("#<charset {", port);
|
||||
scm_puts ("#<charset {", port);
|
||||
for (i = 0; i < p->len; i++)
|
||||
{
|
||||
if (first)
|
||||
first = 0;
|
||||
else
|
||||
scm_puts_unlocked (" ", port);
|
||||
scm_puts (" ", port);
|
||||
scm_write (SCM_MAKE_CHAR (p->ranges[i].lo), port);
|
||||
if (p->ranges[i].lo != p->ranges[i].hi)
|
||||
{
|
||||
scm_puts_unlocked ("..", port);
|
||||
scm_puts ("..", port);
|
||||
scm_write (SCM_MAKE_CHAR (p->ranges[i].hi), port);
|
||||
}
|
||||
if (i >= max_ranges_to_print)
|
||||
{
|
||||
/* Too many to print here. Quit early. */
|
||||
scm_puts_unlocked (" ...", port);
|
||||
scm_puts (" ...", port);
|
||||
break;
|
||||
}
|
||||
}
|
||||
scm_puts_unlocked ("}>", port);
|
||||
scm_puts ("}>", port);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -630,16 +630,16 @@ charset_cursor_print (SCM cursor, SCM port,
|
|||
|
||||
cur = (scm_t_char_set_cursor *) SCM_SMOB_DATA (cursor);
|
||||
|
||||
scm_puts_unlocked ("#<charset-cursor ", port);
|
||||
scm_puts ("#<charset-cursor ", port);
|
||||
if (cur->range == (size_t) (-1))
|
||||
scm_puts_unlocked ("(empty)", port);
|
||||
scm_puts ("(empty)", port);
|
||||
else
|
||||
{
|
||||
scm_write (scm_from_size_t (cur->range), port);
|
||||
scm_puts_unlocked (":", port);
|
||||
scm_puts (":", port);
|
||||
scm_write (scm_from_int32 (cur->n), port);
|
||||
}
|
||||
scm_puts_unlocked (">", port);
|
||||
scm_puts (">", port);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
|
@ -58,11 +58,11 @@ scm_stack_report ()
|
|||
scm_uintprint ((scm_stack_size (thread->continuation_base)
|
||||
* sizeof (SCM_STACKITEM)),
|
||||
16, port);
|
||||
scm_puts_unlocked (" of stack: 0x", port);
|
||||
scm_puts (" of stack: 0x", port);
|
||||
scm_uintprint ((scm_t_bits) thread->continuation_base, 16, port);
|
||||
scm_puts_unlocked (" - 0x", port);
|
||||
scm_puts (" - 0x", port);
|
||||
scm_uintprint ((scm_t_bits) &stack, 16, port);
|
||||
scm_puts_unlocked ("\n", port);
|
||||
scm_puts ("\n", port);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -936,7 +936,7 @@ scm_print_struct (SCM exp, SCM port, scm_print_state *pstate)
|
|||
{
|
||||
SCM vtable = SCM_STRUCT_VTABLE (exp);
|
||||
SCM name = scm_struct_vtable_name (vtable);
|
||||
scm_puts_unlocked ("#<", port);
|
||||
scm_puts ("#<", port);
|
||||
if (scm_is_true (name))
|
||||
{
|
||||
scm_display (name, port);
|
||||
|
@ -945,9 +945,9 @@ scm_print_struct (SCM exp, SCM port, scm_print_state *pstate)
|
|||
else
|
||||
{
|
||||
if (SCM_VTABLE_FLAG_IS_SET (vtable, SCM_VTABLE_FLAG_VTABLE))
|
||||
scm_puts_unlocked ("vtable:", port);
|
||||
scm_puts ("vtable:", port);
|
||||
else
|
||||
scm_puts_unlocked ("struct:", port);
|
||||
scm_puts ("struct:", port);
|
||||
scm_uintprint (SCM_UNPACK (vtable), 16, port);
|
||||
scm_putc (' ', port);
|
||||
scm_write (SCM_VTABLE_LAYOUT (vtable), port);
|
||||
|
@ -959,15 +959,15 @@ scm_print_struct (SCM exp, SCM port, scm_print_state *pstate)
|
|||
{
|
||||
if (scm_is_true (SCM_STRUCT_PROCEDURE (exp)))
|
||||
{
|
||||
scm_puts_unlocked (" proc: ", port);
|
||||
scm_puts (" proc: ", port);
|
||||
if (scm_is_true (scm_procedure_p (SCM_STRUCT_PROCEDURE (exp))))
|
||||
scm_write (SCM_STRUCT_PROCEDURE (exp), port);
|
||||
else
|
||||
scm_puts_unlocked ("(not a procedure?)", port);
|
||||
scm_puts ("(not a procedure?)", port);
|
||||
}
|
||||
if (SCM_STRUCT_SETTER_P (exp))
|
||||
{
|
||||
scm_puts_unlocked (" setter: ", port);
|
||||
scm_puts (" setter: ", port);
|
||||
scm_write (SCM_STRUCT_SETTER (exp), port);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -264,11 +264,11 @@ thread_print (SCM exp, SCM port, scm_print_state *pstate SCM_UNUSED)
|
|||
else
|
||||
id = u.um;
|
||||
|
||||
scm_puts_unlocked ("#<thread ", port);
|
||||
scm_puts ("#<thread ", port);
|
||||
scm_uintprint (id, 10, port);
|
||||
scm_puts_unlocked (" (", port);
|
||||
scm_puts (" (", port);
|
||||
scm_uintprint ((scm_t_bits)t, 16, port);
|
||||
scm_puts_unlocked (")>", port);
|
||||
scm_puts (")>", port);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -1197,9 +1197,9 @@ static int
|
|||
fat_mutex_print (SCM mx, SCM port, scm_print_state *pstate SCM_UNUSED)
|
||||
{
|
||||
fat_mutex *m = SCM_MUTEX_DATA (mx);
|
||||
scm_puts_unlocked ("#<mutex ", port);
|
||||
scm_puts ("#<mutex ", port);
|
||||
scm_uintprint ((scm_t_bits)m, 16, port);
|
||||
scm_puts_unlocked (">", port);
|
||||
scm_puts (">", port);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -1658,9 +1658,9 @@ static int
|
|||
fat_cond_print (SCM cv, SCM port, scm_print_state *pstate SCM_UNUSED)
|
||||
{
|
||||
fat_cond *c = SCM_CONDVAR_DATA (cv);
|
||||
scm_puts_unlocked ("#<condition-variable ", port);
|
||||
scm_puts ("#<condition-variable ", port);
|
||||
scm_uintprint ((scm_t_bits)c, 16, port);
|
||||
scm_puts_unlocked (">", port);
|
||||
scm_puts (">", port);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
|
@ -527,7 +527,7 @@ handler_message (void *handler_data, SCM tag, SCM args)
|
|||
|
||||
if (should_print_backtrace (tag, stack))
|
||||
{
|
||||
scm_puts_unlocked ("Backtrace:\n", p);
|
||||
scm_puts ("Backtrace:\n", p);
|
||||
scm_display_backtrace_with_highlights (stack, p,
|
||||
SCM_BOOL_F, SCM_BOOL_F,
|
||||
SCM_EOL);
|
||||
|
|
|
@ -60,9 +60,9 @@ print_values (SCM obj, SCM pwps)
|
|||
SCM port = SCM_PORT_WITH_PS_PORT (pwps);
|
||||
scm_print_state *ps = SCM_PRINT_STATE (SCM_PORT_WITH_PS_PS (pwps));
|
||||
|
||||
scm_puts_unlocked ("#<values ", port);
|
||||
scm_puts ("#<values ", port);
|
||||
scm_iprin1 (values, port, ps);
|
||||
scm_puts_unlocked (">", port);
|
||||
scm_puts (">", port);
|
||||
|
||||
return SCM_UNSPECIFIED;
|
||||
}
|
||||
|
|
|
@ -36,9 +36,9 @@
|
|||
void
|
||||
scm_i_variable_print (SCM exp, SCM port, scm_print_state *pstate)
|
||||
{
|
||||
scm_puts_unlocked ("#<variable ", port);
|
||||
scm_puts ("#<variable ", port);
|
||||
scm_uintprint (SCM_UNPACK (exp), 16, port);
|
||||
scm_puts_unlocked (" value: ", port);
|
||||
scm_puts (" value: ", port);
|
||||
scm_iprin1 (SCM_VARIABLE_REF (exp), port, pstate);
|
||||
scm_putc ('>', port);
|
||||
}
|
||||
|
|
|
@ -106,9 +106,9 @@ vm_restore_sp (struct scm_vm *vp, union scm_vm_stack_element *new_sp)
|
|||
void
|
||||
scm_i_vm_cont_print (SCM x, SCM port, scm_print_state *pstate)
|
||||
{
|
||||
scm_puts_unlocked ("#<vm-continuation ", port);
|
||||
scm_puts ("#<vm-continuation ", port);
|
||||
scm_uintprint (SCM_UNPACK (x), 16, port);
|
||||
scm_puts_unlocked (">", port);
|
||||
scm_puts (">", port);
|
||||
}
|
||||
|
||||
int
|
||||
|
|
|
@ -675,12 +675,12 @@ make_weak_set (unsigned long k)
|
|||
void
|
||||
scm_i_weak_set_print (SCM exp, SCM port, scm_print_state *pstate)
|
||||
{
|
||||
scm_puts_unlocked ("#<", port);
|
||||
scm_puts_unlocked ("weak-set ", port);
|
||||
scm_puts ("#<", port);
|
||||
scm_puts ("weak-set ", port);
|
||||
scm_uintprint (SCM_WEAK_SET (exp)->n_items, 10, port);
|
||||
scm_putc ('/', port);
|
||||
scm_uintprint (SCM_WEAK_SET (exp)->size, 10, port);
|
||||
scm_puts_unlocked (">", port);
|
||||
scm_puts (">", port);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -790,12 +790,12 @@ make_weak_table (unsigned long k, scm_t_weak_table_kind kind)
|
|||
void
|
||||
scm_i_weak_table_print (SCM exp, SCM port, scm_print_state *pstate)
|
||||
{
|
||||
scm_puts_unlocked ("#<", port);
|
||||
scm_puts_unlocked ("weak-table ", port);
|
||||
scm_puts ("#<", port);
|
||||
scm_puts ("weak-table ", port);
|
||||
scm_uintprint (SCM_WEAK_TABLE (exp)->n_items, 10, port);
|
||||
scm_putc ('/', port);
|
||||
scm_uintprint (SCM_WEAK_TABLE (exp)->size, 10, port);
|
||||
scm_puts_unlocked (">", port);
|
||||
scm_puts (">", port);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue