ioext.c (%read-line): Return a cons of the input line and its terminator.
fports.c, genio.c, genio.h, ports.c, ports.h: Change fgets methods
to return the string length as well as its contents.
* configure.in: AC_CHECK_FUNCS: add "system".
* simpos.c (scm_system): always define: use sysmissing if not
available. Check for HAVE_SYSTEM instead of _Windows (does
Windows lack system or does it have an unusable one?).
Check for error conditions -1 and 127. Use SCM_DEFER_INTS.
Let the argument be optional: if not supplied, call system(NULL).
* ports.c (scm_close_port): relax the type check from OPPORTP to
PORTP; closing a closed port is allowed.
* fports.c (scm_fgets): Use malloc/free rather than scm_must_malloc
and scm_must_free, since ultimately the string returned will be copied
by scm_makfrom0str anyway. Also, read any characters that may have
been pushed onto the port with scm_ungetc.
* ports.c (scm_generic_fgets): Same as for scm_fgets.
* ioext.c (scm_read_line): Free string after Guilifying it.
* ports.h (scm_ptobfuns): fgets method returns a char *, not a char.
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_THREAD_CRITICAL_SECTION_START/END unless USE_THREADS is defined.
* ports.h: prototypes too.
* ports.c (scm_mode_bits, scm_port_mode): moved from fports.c.
* fports.h: prototype too.
* fports.c (scm_evict_ports): moved from ioext.c.
* ports.c (scm_close_port): return a boolean instead of unspecified.
throw an error if an error other than EBADF occurs.
* filesys.h: scm_close prototype.
* filesys.c (scm_close): new procedure, can close file descriptors
and ports (scsh compatible).
* ports.c (scm_flush_all_ports): SCM_PROC incorrectly allowed an
optional argument.
write_void_port, flush_void_port, getc_void_port, close_void_port,
noop0): Use ANSI prototypes instead of K&R declarations, so the
initialization of void_port_ptob gets aggressively type-checked.
Fix arguments of print_void_port and write_void_port. (Bill
Janssen)
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.
* Makefile.am: remove AWK=@AWK@.
Add a rule for generating errnos.list.
(CLEANFILES): put errnos.list here instead of in DISTCLEANFILES.
* configure.in: add AC_SUBST(AWK) and AC_SUBST(ERRNO_EXTRACT).
don't extract errnos, just set a variable (avoids the
need to recompile error.c just because configure is run.)
* unif.h: update prototypes.
* unif.c (scm_uniform_array_read,write): change the offset and
length arguments to start and end, for consistency.
* __scm.h: uncomment SCM_ARG6 and SCM_ARG7, I needed SCM_ARG6.
* ioext.h: update prototypes.
* * ioext.c (scm_read_delimited_x): replaces scm_read_line and
scm_read_line_x, it's a more general procedure using an
interface from scsh. read-line and read-line! are now defined
in boot-9.scm.
* Note that the new read-line trims the terminator
by default, previously it was appended to the returned string. An
optional argument specifies how to process the terminator (scsh
compatible). For the old behaviour: (read-line port 'concat).
scm_read_line, scm_read_line_x: deleted. (read-line port 'split)
returns a pair, but is converted to multiple values if the scsh
module is loaded.
socket.h: update prototypes.
* socket.c (scm_recvfrom): for consistency with other procedures,
take start and end as separate optional arguments.
* (scm_recv, scm_recvfrom): don't allow the second argument
to be a size, only a buffer. Change the scheme names to
recv! and recvfrom!. Don't return the buffer.
* ioext.h, posix.h: move prototypes too.
* ioext.c, posix.c (scm_read_line, scm_read_line_x, scm_write_line:
moved back from posix.c to ioext.c. Also move #includes of "genio.h"
"read.h" and "unif.h".
* ioext.c: include "chars.h"
srcprop.h, tags.h, throw.c, unif.c: Added new selectors
SCM_SETAND_CAR, SCM_SETAND_CDR, SCM_SETOR_CAR and SCM_SETOR_CDR.
Motivation: Safer use. Some other macros are defined in terms of
these operations. If these are defined using the SCM_SETCXR
(<e1>, SCM_CXR (<e1>) <op> <e2>) pattern a complex <e1> will lead
to inefficiency and an <e1> with side-effects could potentially
break. Also, these particular operations are heavily utilized in
the garbage collector. In unoptimized code there will be a
measurable speedup.
* alist.c, arbiters.c, continuations.c, debug.c, debug.h, eval.c,
eval.h, feature.c, filesys.c, fports.c, gc.c, gsubr.c, init.c,
ioext.c, kw.c, list.c, load.c, mallocs.c, numbers.c, numbers.h,
pairs.c, pairs.h, ports.c, ports.h, posix.c, procprop.c, procs.c,
procs.h, ramap.c, read.c, root.c, srcprop.c, srcprop.h,
strports.c, symbols.c, tags.h, throw.c, unif.c, variable.c,
vports.c: Cleaned up use of pairs: Don't make any special
assumptions about the internal structure of selectors and
mutators: SCM_CXR (<e1>) = <e2> --> SCM_SETCXR (<e1>, <e2>),
SCM_CXR (<e1>) &= <e2> --> SCM_SETAND_CXR (<e1>, <e2>) etc.
(Among other things, this change makes it easier to build Guile
with certain compilers which have problems with casted lvalues.)
scm_port_\1; Added mutator scm_set_port_filename_x (used when
loading source from non-file ports, which, e. g., happens when
using the Emacs interface).