* configure.in: add --disable-arrays option, probably temporary.
* the following changes allow guile to be built with the array
"module" omitted. some of this stuff is just tc7 type support,
which wouldn't be needed if uniform array types were converted
to smobs.
* tag.c (scm_utag_bvect ... scm_utag_cvect): don't define unless
HAVE_ARRAYS.
(scm_tag): don't check array types unless HAVE_ARRAYS.
* sort.c (scm_restricted_vector_sort_x, scm_sorted_p):
remove the unused array types.
* (scm_stable_sort, scm_sort): don't support vectors if not
HAVE_ARRAYS. a bit excessive.
* random.c (vector_scale, vector_sum_squares,
scm_random_solid_sphere_x, scm_random_hollow_sphere_x,
scm_random_normal_vector_x): don't define unless HAVE_ARRAYS.
* gh_data.c (makvect, gh_chars2byvect, gh_shorts2svect,
gh_longs2ivect, gh_ulongs2uvect, gh_floats2fvect, gh_doubles2dvect,
gh_uniform_vector_length, gh_uniform_vector_ref):
don't define unless HAVE_ARRAYS.
(gh_scm2chars, gh_scm2shorts, gh_scm2longs, gh_scm2floats,
gh_scm2doubles):
don't check vector types if not HAVE_ARRAYS.
* eq.c (scm_equal_p), eval.c (SCM_CEVAL), print.c (scm_iprin1),
gc.c (scm_gc_mark, scm_gc_sweep), objects.c (scm_class_of):
don't support the array types unless HAVE_ARRAYS is defined.
* tags.h: make nine tc7 types conditional on HAVE_ARRAYS.
* read.c (scm_lreadr): don't check for #* unless HAVE_ARRAYS is
defined (this should use read-hash-extend).
* ramap.c, unif.c: don't check whether ARRAYS is defined.
* vectors.c (scm_vector_set_length_x): moved here from unif.c. call
scm_uniform_element_size if HAVE_ARRAYS.
vectors.h: prototype too.
* unif.c (scm_uniform_element_size): new procedure.
* init.c (scm_boot_guile_1): don't call scm_init_ramap or
scm_init_unif unless HAVE_ARRAYS is defined.
* __scm.h: don't define ARRAYS.
* Makefile.am (EXTRA_libguile_la_SOURCES): unif.c and ramap.c
moved here from libguile_la_SOURCES.
* Makefile.am (ice9_sources): add arrays.scm.
* boot-9.scm: load arrays.scm if 'array is provided.
* arrays.scm: new file with stuff from boot-9.scm.
associated with subrs.
(SCM_SUBRNUM, SCM_SUBR_ENTRY, SCM_SUBR_GENERIC, SCM_SUBR_PROPS,
SCM_SUBR_DOC): New macros.
(scm_subr_table): New variable.
(scm_mark_subr_table): New function.
* init.c (scm_boot_guile_1): Call scm_init_subr_table.
* gc.c (scm_gc_mark): Don't mark subr names here.
(scm_igc): Call scm_mark_subr_table.
* snarf.h (SCM_GPROC, SCM_GPROC1): New macros.
* procs.c, procs.h (scm_subr_p): New function (used internally).
* gsubr.c, gsubr.h (scm_make_gsubr_with_generic): New function.
* objects.c, objects.h (scm_primitive_generic): New class.
* objects.h (SCM_CMETHOD_CODE, SCM_CMETHOD_ENV): New macros.
* print.c (scm_iprin1): Print primitive-generics.
* __scm.h (SCM_WTA_DISPATCH_1, SCM_GASSERT1,
SCM_WTA_DISPATCH_2, SCM_GASSERT2): New macros.
* eval.c (SCM_CEVAL, SCM_APPLY): Replace scm_wta -->
SCM_WTA_DISPATCH_1 for scm_cxr's (unary floating point
primitives). NOTE: This means that it is now *required* to use
SCM_GPROC1 when creating float scm_cxr's (float scm_cxr's is an
obscured representation that will be removed in the future anyway,
so backward compatibility is no problem here).
* numbers.c: Converted most numeric primitives (all but bit
comparison operations and bit operations) to dispatch on generic
if args don't match.
* eval.c, eval.h (scm_eval_body): New function.
* objects.c (scm_call_generic_0, scm_call_generic_1,
scm_call_generic_2, scm_call_generic_3, scm_apply_generic): New
functions.
* eval.c (SCM_CEVAL): Apply the cmethod directly after having
called scm_memoize_method instead of doing a second lookup.
* objects.h (scm_memoize_method): Now returns the memoized cmethod.
* procs.c (scm_make_subr_opt): Use scm_sysintern0 instead of
scm_sysintern so that the binding connected with the subr name
isn't cleared when we give set = 0.
newline. A bit faster, and definitely hairier.
(scm_read_line): Count newlines here instead.
* strings.c (scm_take_str): New function.
(scm_take0str): Reimplement in terms of scm_take_str. * strings.h
(scm_take_str): New declaration. * ioext.c (scm_read_line): Use
scm_take_str, to avoid copying the string.
Add some simple-minded support for line buffered ports.
* ports.h (SCM_BUFLINE): New flag for ports.
* init.c (scm_init_standard_ports): Request line-buffering on
the standard output port.
* * ports.c (scm_mode_bits): Recognize 'l' as a request for line
buffering.
(scm_putc, scm_puts, scm_lfwrite): If the port is line-buffered,
and there's a newline to be written, flush the port.
* ports.c: (scm_lseek): clear buffers even if just reading current
position.
* fports.c (local_fclose): call local_fflush unconditionally.
(various): don't use the scm_must... memory procs.
* ports.h (scm_port): make read_pos a pointer to const.
strports.c: take care of rw_active and rw_randow.
fports.c: scm_fport_drain_input: removed. do it all in ports.c.
strports.c (scm_mkstrport): check that pos is reasonable.
ioext.c (scm_ftell, scm_fseek): use lseek.
(SCM_CLEAR_BUFFERS): macro deleted.
ioext.c (redirect_port: use ptob fflush, read_flush.
ports.h (scm_ptobfuns): add ftruncate.
ports.c (scm_newptob): set ftruncate.
adjust ptob tables.
* ports.c (scm_ftruncate): new procedure.
fports.c (local_ftrunate), strports.c (str_ftruncate): new procs.
strports.c (st_seek, st_grow_port): new procs.
fports.h (scm_port): change size types from int to off_t.
ports.c (scm_init_ports): initialise the seek symbols here
instead of in ioext.c.
strports.c (scm_call_with_output_string): start with an empty
string, so seek and ftruncate can be used.
* ports.h (scm_ptobfuns): add a read_flush procedure which is the
equivalent to fflush for the read buffer.
* ports.c (scm_newptob): set read_flush.
ports.c (void_port_ptob): set read_flush.
fports.c (local_read_flush): new proc. add to ptob.
strport.c (st_read_flush): likewise.
vport.c (sf_read_flush): likewise.
fports.h (struct scm_fport): remove random member. there's nothing
left but fdes. leaving it as a struct to allow for future changes.
fports.c: replace usage of scm_fport::random with scm_port::rw_random.
ports.c: (scm_putc, scm_puts, scm_lfwrite): call the read_flush
ptob proc if the read buffer is filled.
* ports.h (scm_port): add a rw_random member and replace
reading and writing members with rw_active member.
SCM_PORT_READ/SCM_PORT_WRITE: new values.
* ports.h (struct scm_port_table): add writing and reading members
to replace write_needs_seek: it isn't good enough for non-fports.
ports.c, ioext.c, fports.c: corresponding changes.
(struct scm_port_table): give it a typedef and rename to scm_port.
ports.c, fports.c, strports.c, vports.c, ioext.c, ports.h:
corresponding changes.
* ports.c (scm_newptob): bugfix: set seek member.
* * (scm_lseek): new procedure, using code from ioext.c:scm_fseek
and generalised to all port types.
* scmsigs.c (scm_init_scmsigs): set the SA_RESTART flag for all
signals (it was only being done for handlers installed from Scheme).
Otherwise (for example) SIGSTOP followed by SIGCONT on an interpreter
waiting for input caused an EINTR error from read.
* ports.h (struct scm_port_table): make all the char members
unsigned, so they convert to int without becoming negative if large.
* fports.c (scm_fdes_wait_for_input): forgot to check compilation
with threads enabled. rename this procedure to
fport_wait_for_input and take a port instead of a fdes.
use scm_fport_input_waiting_p instead of scm_fdes_waiting_p.
* readline.c (scm_readline): Applied a patch from Greg Harvey to
get readline support working again: use fdopen to get FILE objects.
* gc.c (scm_init_storage): install an atexit proc to flush the
ports.
(cleanup): the new proc. it sets a global variable which can be
checked by the ptob flush procs to avoid trying to throw
exceptions during exit. not very pleasant but it seems more reliable.
* fports.c (local_fflush): check terminating variable and if set
don't throw exception.
* CHECKME: that the atexit proc is installed if unexec used.
* throw.c (scm_handle_by_message): don't flush all ports here.
it still causes bus errors.
* fports.h (SCM_FPORT_CLEAR_BUFFERS): rename to SCM_CLEAR_BUFFERS
and move to ioext.c.
* fports.c (scm_fdes_waiting_p): merged into fport_input_waiting_p.
* ports.c (scm_char_ready_p): check the port buffer and call the
ptob entry if needed.
* ports.h (scm_ptobfuns): input_waiting_p added. change all the
ptob initialisers. use it in char-ready
* ioext.c (scm_do_read_line): moved from ports.c. make it static.
* vports.c (sfflush): modified to write a char (since softports
currently use shortbuf.)
* fports.c (scm_standard_stream_to_port): moved to init.c and
made static.
* init.c (scm_init_standard_ports): make stdout and stderr
unbuffered if connected to a terminal. with stdio they
were line-buffered by default.
* ports.h (scm_ptobfuns): change fflush return to void.
change flush proc definitions.
* strports.c (scm_call_with_output_string): get size from
buffer instead of port stream.
(scm_strprint_obj): likewise.
(st_flush): new proc.
* ports.h (struct scm_port_table): added write_end member,
as an optimisation. set it where write_buf_size is set.
* ports.h (struct scm_port_table): change stream from void *
back to SCM. SCM presumably must be large enough to hold a
pointer (and probably vice versa but who knows.)
(SCM_SSTREAM): deleted. change users back to SCM_STREAM.
(scm_puts): rewritten
* fports.c (local_ffwrite, local_fputs): removed.
* strports.c (stputc, stputs, stwrite): dyked out (FIXME)
* vports.c (sfputc, sfputs, sfwrite) likewise.
* ports.c (write_void_port, puts_void_port): removed.
(putc_void_port, getc_void_port, fgets_void_port): likewise.
* ports.c (scm_lfwrite): rewritten using fport.c version.
* fports.c (local_fputc): deleted.
* ports.c (scm_add_to_port_table): initialise write_needs_seek.
* ports.h (scm_ptobfuns): add seek function pointer.
* fports.c: set it to local_seek, new procedure.
* fports.h (SCM_MAYBE_DRAIN_INPUT): moved to ports.c.
use ptob for seek. take ptob instead of fport arg.
* ports.h (struct scm_port_table): new member write_needs_seek,
replaces reading member in fport struct.
* vports.c (sfgetc): store the getted char into the buffer.
rename to sf_fill_buffer and install it for fill-buffer in ptob.
the Scheme interface is still a procedure that gets a char.
(scm_make_soft_port): set up the port buffer (shortbuf).
* fports.c (local_fgetc, local_fgets): deleted.
* strports.c (stgetc): likewise.
* ports.c: scm_generic_fgets: likewise.
* ports.h (scm_ptobfuns): add fill_buffer.
* ports.c (scm_newptob): assign it.
* strports.c (scm_mkstrport): set up the buffer.
put just the string into the stream, not cons (pos stream).
(stfill_buffer): new proc.
* ports.h: fport buffer moved into port table: to be
used for all port types.
* throw.c (scm_handle_by_message): flush ports at exit.
* socket.c (scm_sock_fd_to_port): use scm_fdes_to_port.
(scm_getsockopt, scm_setsockopt, scm_shutdown, scm_connect,
scm_bind, scm_listen, scm_accept, scm_getsockname,
scm_getpeername, scm_recv, scm_send, scm_recvfrom,
scm_sendto,
use SCM_FPORT_FDES. use SCM_OPFPORTP not SCM_FPORTP.
* posix.c (scm_getgroups): use SCM_ALLOW/DEFER_INTS.
(scm_ttyname): use SCM_FPORT_FDES.
(scm_tcgetpgrp, scm_tcsetpgrp): likewise.
* ioext.c (scm_isatty_p): use SCM_FPORT_FDES.
(scm_fdes_to_ports): modified.
(scm_fdopen): use scm_fdes_to_port.
* ports.c (scm_init_ports): don't try to flush ports using
atexit(). it's too late, errors will cause SEGV.
* fports.c (scm_fport_buffer_add): new procedure.
* fports.h (SCM_FDES_RANDOM_P): new macro. use it in
scm_fdes_to_port and scm_redirect_port.
* ioext.c (scm_redirect_port): use setvbuf to set buffers in the
new port. reset fp->random.
* fports.c (scm_fdes_to_port), ports.c (scm_void_port),
filesys.c (scm_opendir):
restore defer interrupts while the port is constructed.
* (scm_setvbuf): if mode is _IOFBF and size is not supplied,
derive buffer size from fdes or use a default.
(scm_fdes_to_port): use setvbuf instead of creating the buffers
directly.
vports.c (various places): use SCM_SSTREAM.
strports.c: likewise.
* gdbint.c: likewise.
* ports.h (SCM_SSTREAM): new macro.
* fports.c (scm_input_waiting_p): use scm_return_first, since port
may be removed from the stack by the tail call to scm_fdes_waiting_p.
* fports.h (SCM_CLEAR_BUFFERS): new macro.
* ports.c (scm_force_output): call scm_fflush.
* print.c (scm_newline): don't check errno for EPIPE (it wouldn't
* reach this point.) don't flush port (if scm_cur_outp).
* fports.h (SCM_FPORT_FDES): new macro.
* vports.c (sfflush): don't need to set errno.
* ports.c: install scm_flush_all_ports to be run on exit.
ports.c fports.c ioext.c posix.c socket.c net_db.c filesys.c:
removed all uses of SCM_DEFER/ALLOW ints for now. they were mainly
just protecting errno. some may need to be put back.
* scmsigs.c (take_signal): save and restore errno while this
proc runs.
*fports.c (print_pipe_port, local_pclose, scm_pipob): deleted.
* open-pipe, close-pipe are emulated in (ice-9 popen)
ports.c (scm_ports_prehistory): don't init scm_pipob.
ports.h (scm_tc16_pipe): deleted.
posix.c (scm_open_pipe, scm_close_pipe): deleted.
* ioext.c (scm_primitive_move_to_fdes): use fport.
* fport.c (scm_fport_fill_buffer): flush write buffer if needed.
change arg type from scm_fport to SCM port.
fport.h (SCM_SETFDES): removed.
(SCM_MAYBE_DRAIN_INPUT): new macro.
* ioext.c (scm_dup_to_fdes): use SCM_FSTREAM.
(scm_ftell): always use lseek and account for the buffer.
(scm_fileno): use fport buffer.
(scm_fseek): clear fport buffers. always use lseek.
* posix.c (scm_pipe): use fport buffer.
* unif.c: include fports.h instead of genio.h.
* fports.c (scm_fdes_wait_for_input, scm_fport_fill_buffer): new
procedures.
(local_fgetc): use them.
(local_ffwrite): use buffer.
(local_fgets): use buffer.
(scm_setbuf0): deleted.
(scm_setvbuf): set the buffer.
(scm_setfileno): deleted.
(scm_evict_ports): set fdes directly.
* (scm_freopen): deleted. doesn't seem useful in Guile.
(scm_stdio_to_port): deleted.
fports.h (struct scm_fport): add shortbuf member to avoid separate
code for unbuffered ports.
(SCM_FPORTP, SCM_OPFPORTP, SCM_OPINFPORTP, SCM_OPOUTFPORTP): moved
from ports.h.
* genio.c, genio.h: move contents into ports.c, ports.h. The
division wasn't useful.
* fports.c, fports.h (scm_fport_drain_input): new procedure.
* ports.c (scm_drain_input): call scm_fport_drain_input.
* scm_fdes_waiting_p: new procedure.
* fports.c (scm_fdes_to_port): allocate read and/or write buffers.
(scm_input_waiting_p): check the buffer.
(local_fgetc, local_fflush, local_fputc): likewise.
* fports.h (scm_fport): read/write_buf,_pos,_buf_end,,_buf_size:
new members.
* init.c (scm_init_standard_ports): pass fdes instead of FILE *.
* * ports.c (scm_drain_input): new procedure.
ports.h: prototype.
* fports.c (FPORT_READ_SAFE, FPORT_WRITE_SAFE, FPORT_ALL_OKAY,
pre_read, pre_write): removed.
(local_fputc, local_fputs, local_ffwrite): use write, not stdio.
(scm_standard_stream_to_port): change first arg from FILE * to
int fdes.
(local_fflush): flush fdes, not FILE *.
* fports.h (SCM_NOFTELL): removed.
* genio.c, ports.c: don't include filesys.h.
* genio.c (scm_getc): don't use scm_internal_select if FPORT.
do it in fports.c:local_fgetc.
* genio.c: don't use SCM_SYSCALL when calling ptob procedures.
do it where it's needed in the port smobs.
* filesys.c (scm_input_waiting_p): moved to fports.c, stdio
buffer support removed. take SCM arg, not FILE *.
* filesys.h: prototype moved too.
* fports.c (scm_fdes_to_port): new procedure.
(local_fgetc): use read not fgetc.
(local_fclose): use close, not fclose.
(local_fgets): use read, not fgets
* fports.h: prototype for scm_fdes_to_port.
* fports.h (scm_fport): new struct.
* fports.c (scm_open_file): use open, not fopen.
#include fcntl.h
* ports.h (struct scm_port_table): change stream from SCM to void *.
* ports.c (scm_add_to_port_table): check for memory allocation error.
(scm_prinport): remove MSDOS hair.
(scm_void_port): set stream to 0 instead of SCM_BOOL_F.
(scm_close_port): don't throw errors: do it in fports.c.
fports.c; don't just throw them together anywhere.
* fports.c (scm_stdio_to_port): Make NAME a SCM value, which is
what the rest of Guile wants. Don't set the revealed count;
that's only appropriate for stdin, stdout, stderr.
(scm_standard_stream_to_port): This function does set the revealed
count.
* init.c (scm_init_standard_ports): Use scm_standard_stream_to_port,
not scm_stdio_to_port.
* filesys.c (scm_open): Call scm_stdio_to_port; don't write it out.
* fports.c (scm_open_file): Same.
* posix.c (scm_pipe): Same.
* socket.c (scm_sock_fd_to_port): Same.
* ioext.c (scm_fdopen): Same.
(scm_freopen): Moved from here to...
* fports.c (scm_freopen): ... here. This is really something that
munges the internals of an fport, so it should go here.
* fports.h (scm_stdio_to_port): Adjust prototype.
(scm_standard_stream_to_port, scm_freopen): New protoypes.
* ioext.h (scm_freopen): Prototype removed.
* init.c (scm_boot_guile_1): Use scm_internal_lazy_catch, so the
stack is still there when we catch the error.
* throw.c (handler_message): If we are handling an error with a
message, then put together the proper arguments and call
scm_display_error, instead of scm_display_error_message. That
displays source location, if it can find it.
reports anymore. We've had them since April. The current reason
is a completely unintelligible failure of totoro.red-bean.com to
do the test for rl_getc_function in libreadline correctly. This
kludge overrides the test if we're on totoro so that the snapshot
generation process can work.
* readline.c: Define a strdup replacement if not existent on system.
(scm_init_backtrace): Initialize `the-last-stack' to a fluid.
(scm_backtrace): `the-last-stack' is now a fluid.
* init.c (scm_boot_guile_1): Moved call to scm_init_backtrace
after scm_init_fluids.
* coop.c (coop_qinit): Initialize fields used by
scm_internal_select.
(coop_qget, coop_qget, coop_tmp_queue): Made global.
(coop_next_runnable_thread): If GUILE_ISELECT enabled, use
replacement in iselect.c.
(coop_mutex_lock, coop_condition_variable_wait, coop_abort,
coop_join): If GUILE_ISELECT enabled, use
coop_wait_for_runnable_thread instead of
coop_next_runnable_thread.
(usleep, sleep): New replacements for system functions if
GUILE_ISELECT is enabled.
* coop-threads.h: Declare coop_wait_for_runnable_thread.
* coop-defs.h (coop_t): Added fields used by scm_internal_select.
* filesys.c: Added #include "iselect.h". Moved FD-macros to
iselect.h. Implement Scheme level `select' using
scm_internal_select. (See NEWS.)
* genio.c (scm_getc): Block with scm_internal_select. (See NEWS.)
* init.c: Call scm_init_iselect.
* readline.c, readline.h: New files.
* init.c: #include "readline.h".
(scm_boot_guile_1): Call scm_init_readline, if we have it.
* Makefile.am (libguile_la_SOURCES): Include readline.c.
* Makefile.in: Regenerated.
* scmconfig.h.in: Regenerated, after change to ../configure.
Added #include "objects.h"
* eval.c (scm_makprom): Added SCM_DEFER_INTS and SCM_ALLOW_INTS.
Add #include "feature.h".
* ports.h (SCM_EOF_OBJECT_P): New macro predicate.
This test is needed at many places in the code and should be
abstracted. (Motivated by the need of this test in libguiletk.)
* ports.c (scm_eof_object_p), vports.c (sfgetc), strports.c
(scm_eval_string), load.c (scm_primitive_load,
scm_read_and_eval_x), gh_eval.c (gh_eval_str):
Use SCM_EOF_OBJECT_P.
* eval.c (scm_init_eval): Add feature `delay'.
* _scm.h: if HAVE_RESTARTS is defined then don't use a SYSCALL
loop.
* posix.c (scm_uname): interpret only negative values as an error.
Solaris normally returns a positive value.
* script.c (scm_compile_shell_switches): if we are not going into
an interactive repl, set scm_mask_ints to zero so that asyncs can
run.
* simpos.c (scm_system): don't ignore/unignore signals around
the "system" call.
* posix.c (scm_open_pipe): don't ignore/unignore signals around
the "popen" call.
* init.c (scm_boot_guile_1): don't call scm_init_signals, it's
done in boot-9.scm instead.
* scmsigs.c, async.c: Major rewriting of signal handling code.
(scm_sigaction): new procedure.
(scm_sleep): don't wrap sleep in SCM_SYSCALL, it would mess up the
timing.
(scm_raise): return unspecified, throw error on failure.
* boot-9.scm: signal-handler, alarm-thunk: removed.
don't define ticks-interrupt etc.
top-repl: install signal handlers for SIGINT, SIGFPE, SIGSEGV, SIGBUS
during call to scm-style-repl.
* acconfig.h: mention HAVE_RESTARTS.
* configure.in: check for sigaction and restartable system calls.
* regex-posix.c, regex-posix.h: New files. (Some code
is taken liberally from rx/rgx.c in the old Guile dist.)
* init.c: Include regex-posix.h.
(scm_boot_guile_1): Call scm_init_regex_posix.
* Makefile.am (EXTRA_libguile_la_SOURCES, modinclude_HEADERS):
Add regex-posix.[ch] sources.
* Makefile.in: Regenerated.
* scmconfig.h.in: Add HAVE_REGCOMP macro. (automake is supposed
to do this automatically? It didn't for me, bleh.)
gdb_interface.h, gdbint.c, gdbint.h, gh_data.c, gh_init.c,
gh_io.c, gh_list.c, gh_predicates.c, gh_test_c.c, gh_test_repl.c,
init.c, net_db.c, options.c, options.h, ports.c, print.c, read.c,
script.h, snarf.h, srcprop.c, srcprop.h, stacks.c, stacks.h,
throw.c: Update copyright years; these files have been worked on
significantly in 1997, but only had copyright years for 1996.
Also, change name of copyright holder on some from Mikael
Djurfeldt to Free Software Foundation; he has signed papers
assigning the changes to the FSF.
so guile.c can be very small (and eventuallly auto-generated. (I
mean, generated mechanically, not self-generated. Hmm.))
* guile.c, script.c, script.h: New source files.
* init.c (scm_boot_guile_1): Call scm_init_script.
* libguile.h: #include "script.h".
* Makefile.am (bin_PROGRAMS, guile_SOURCES, guile_LDADD): New
targets, for new executable.
(libguile_la_SOURCES): Mention script.c.
(modinclude_HEADERS): Add script.h.
* configure.in: Always check for -lm, -lsocket, -lnsl, whether or
not dynamic linking is enabled. This is because we're generating
executables now. Move CY_AC_WITH_THREADS call after those, so the
values of cy_cv_threads_libs captures the libs chosen above.
* Makefile.in, configure, aclocal.m4: Regenerated.
old scm_sysintern but doesn't take a second value argument.
(scm_sysintern): Now uses scm_sysintern0.
(scm_sysintern_no_module_lookup): Renamed to
scm_sysintern0_no_module_lookup and doesn't take a second value
argument any longer.
* symbols.h (scm_sysintern0: Added declaration.
* options.c (scm_init_opts): Use scm_sysintern0 instead of
scm_sysintern when interning option keys. Otherwise we risk
destroying the values of already interned variables.
* symbols.c (scm_sym2vcell): Bugfix: Treat definedp as
scheme-level boolean (use SCM_NFALSEP).
* backtrace.c (scm_init_backtrace): Make Scheme-level variable
`the-last-stack'.
(scm_backtrace): New function. (C version of old function from
boot-9.scm) Motivation: Make it possible to display backtraces
without depending on boot-9.scm. (I'm uncertain if this
motivation is good enough...)
* root.h (scm_root_state): Add member the_last_stack_var.
(scm_the_stack_var): Defined to scm_root->the_last_stack_var.
* root.c (mark_root): Mark scm_the_last_stack_var.
* init.c (scm_start_stack): Initialize scm_the_last_stack_var to
SCM_BOOL_F.
use separate data pointers, to allow them to be designed
independently and reused.
(scm_body_thunk, scm_handle_by_proc, scm_handle_by_message):
Renamed from catch_body, catch_handler, and uncaught_throw; made
generically useful.
(struct scm_catch_body_data): Renamed from catch_body_data; moved
to throw.h.
(scm_catch): Use the above.
(scm_throw): Don't bother printing a message for an uncaught
throw; we establish a default handler in init.
* throw.h (scm_internal_catch): Prototype updated.
(scm_body_thunk, scm_handle_by_proc, scm_handle_by_message): New
decls.
(struct scm_body_thunk_data): New structure, used as data
argument to scm_body_thunk.
* init.c (struct main_func_closure): New structure, packaging up
the data to pass to the user's main function.
(scm_boot_guile): Create one. Pass it to scm_boot_guile_1.
(scm_boot_guile_1): Pass it through to invoke_main_func. Use
scm_internal_catch to establish a catch-all handler, using
scm_handle_by_message. This replaces the special-case code in
scm_throw.
(invoke_main_func): Body function for scm_internal_catch; invoke
the user's main function, using the main_func_closure pointer to
decide what to pass it.
* root.c (struct cwdr_body_data): Remove handler_proc member.
(cwdr): Use scm_handle_by_proc instead of cwdr_handler.
(cwdr_handler): Removed.
FIONREAD, since the latter doesn't detect EOF.
Throw error if neither select nor FIONREAD available.
* socket.c (scm_connect): take a port, not a fd object.
(scm_fill_sockaddr): throw an error if fam is not recognised.
(scm_bind): use scm_fill_sockaddr.
(scm_listen): take a port, not a fd object.
(scm_accept): take and return a port. return CDR in the car if
address can't be got
(scm_sock_fd_to_port): new procedure.
(scm_socket): use scm_sock_fd_to_port.
(scm_addr_vector): throw error if unrecognised address type.
take an extra argument with the calling procedure name.
(scm_getsockname): take a port. return #f if address can't be got.
(scm_getpeername): take a port. return #f if address can't be got.
(scm_recvfrom): take a port. return #f for address component if can't
be got.
(scm_sendto, scm_socketpair, scm_getsockopt scm_shutdown,
scm_setsockopt, scm_recv, scm_send): take a port not a fd object.
* socket.h (SCM_P): update bind prototype.
* socket.c (scm_init_socket): intern PF_UNSPEC, PF_UNIX, PF_INET.
include "feature.h".
(scm_socket): return a port, not a file descriptor object.
include "fports.h" and <unistd.h>
(scm_bind): take a port, not a file descriptor object.
take an extra argument for address args.
* net_db.c (scm_init_net_db): intern INADDR_ANY, INADDR_BROADCAST,
INADDR_NONE, INADDR_LOOPBACK.
* init.c: include net_db.h and not fdsocket.h.
(scm_boot_guile_1): call scm_init_net_db and not scm_init_fdsocket.
* Makefile.am: corresponding changes.
* socket.h: renamed from fdsocket.h, fix names.
* net_db.h: renamed from socket.h, fix names.
* socket.c: renamed from fdsocket.c.
remove _sys from procedure names.
(scm_init_socket): rename from scm_init_fdsocket. include socket.x.
add "socket" to features list.
* net_db.c: renamed from socket.c.
remove _sys from procedure names.
(scm_init_net_db): rename from scm_init_socket. include net_db.x.
add "net-db" to features list.
include "net_db.h". don't include <sys/socket.h> or
<sys/un.h>.
initialize dynamic linking support.
* init.c (scm_boot_guile_1): Moved `live' variable to the toplevel
(as we Schemers say). It needs to be global, so that I can tweak
it for the proper operation of unexec.
(scm_boot_guile_1_live): New variable, see above.
(scm_boot_guile): Call scm_set_program_arguments here, later than
the old initialization.
* init.c: (scm_boot_guile, scm_boot_guile_1): New, simplified
initialization procedure.
- Delete in, out, err arguments; there are other perfectly good
ways to override these when desired.
- Delete result argument; this function shouldn't ever return.
- Rename init_func argument to main_func, for less confusion.
- Delete boot_cmd argument; main_func is more general.
-Add 'closure' argument, to help people pass data to main_func
without resorting to global variables.
- Abort if reentered; don't bother returning an error code.
- Call scm_init_standard_ports to set up the default/current
standard ports; no need to pass them to scm_start_stack.
- Remove code to evaluate the boot_cmd, and start the repl; let
the user do something like that in main_func if they want.
- Remove code to package up a return value; main_func can do any
of that as needed.
- Call exit (0), instead of returning.
(scm_start_stack): Don't initialize the I/O ports here; that's
weird. Delete in, out, err arguments. Move guts to
scm_init_standard_ports, scm_stdio_to_port.
(scm_init_standard_ports): New function, to set up current and
default standard ports.
(scm_start_stack, scm_restart_stack): Make these static.
* init.h (scm_boot_guile): Adjust declaration.
(scm_start_stack, scm_restart_stack): Remove externally
visible declarations for these.
(enum scm_boot_status): Removed; now scm_boot_guile never returns.