1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-01 04:10:18 +02:00
Commit graph

7322 commits

Author SHA1 Message Date
Jim Blandy
04904fdf0b * libguile.h: Don't #include "libguile/libpath.h", contrary to Oct
30 change.  That file is only meant for communication between the
configuration process and load.c.  If code linked against libguile
wants to get at the paths mentioned in libpath.h, it can call
functions declared in load.h.
1996-12-22 00:02:42 +00:00
Jim Blandy
6f9dc845e7 *** empty log message *** 1996-12-21 20:40:17 +00:00
Jim Blandy
7d2969581e * libguile.h: Added #include "libguile/net_db.h". 1996-12-21 20:40:01 +00:00
Mikael Djurfeldt
1d361fe02b * libguile.h: Removed #include "libguile/fdsocket.h" 1996-12-21 13:55:29 +00:00
Mikael Djurfeldt
cae7644108 * net_db.c: Added #include <sys/socket.h>. 1996-12-21 13:52:08 +00:00
Mark Galassi
0b7a04e01b little temp changes to work with the new catch/throw stuff 1996-12-21 05:04:04 +00:00
Jim Blandy
dfff89a16a *** empty log message *** 1996-12-21 04:49:10 +00:00
Jim Blandy
816a6f06c8 * throw.c (scm_internal_catch): Make body funcs and handler funcs
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.
1996-12-21 04:48:21 +00:00
Gary Houston
370312ae6e * filesys.c (scm_input_waiting_p): use select in preference to
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>.
1996-12-21 04:13:54 +00:00
Mikael Djurfeldt
ae603deccd *** empty log message *** 1996-12-19 13:08:26 +00:00
Mikael Djurfeldt
4816f61591 * tags.h (scm_tags): Removed comma at end of last enumerator. 1996-12-19 13:08:17 +00:00
Jim Blandy
70d4fe698a *** empty log message *** 1996-12-19 07:55:48 +00:00
Jim Blandy
c0ab1b8d03 Don't use GCC extensions to allocate space for debugging frames.
(Here he goes again!  Why do we put up with this?!)
* debug.h (scm_debug_frame): Make the 'vect' member a pointer to
an scm_debug_info structure, not an in-line array of them.  Add
'info' member, to say how many vect elements we've used, for eval
frames.
* eval.c (SCM_CEVAL): Use alloca to allocate space for vect.  Use
a new variable debug_info_end to mark the end of vect, instead of
the address of the 'info' pointer itself.
[DEVAL] (ENTER_APPLY, SCM_CEVAL, SCM_APPLY): Remove casts of
&debug to scm_debug_frame *; debug is a real scm_debug_frame now.
(SCM_APPLY): Explicitly allocate space for debug.vect.
* debug.c (scm_m_start_stack): Same, for vframe.vect.
* stacks.c: Adjusted for new debug frame structure.
(RELOC_INFO, RELOC_FRAME): New macros.
(stack_depth, read_frames): Use them, and new scm_debug_frame
element 'info', instead of magically knowing that eval frames have
an info pointer sitting after vect.
(scm_make_stack, scm_stack_id, scm_last_stack_frame): Use
RELOC_FRAME.
(scm_init_stacks): Formatting tweaks.
1996-12-19 07:55:42 +00:00
Jim Blandy
4d46a0279b *** empty log message *** 1996-12-18 21:42:26 +00:00
Jim Blandy
4dc2435aef In some cases, the code is fine, but GCC isn't smart enough to
figure that out; this usually happens when one variable is only
initialized and used when a particular condition holds true, and
we know that condition will never change within a given invocation
of the function.  In this case, we simply initialize the variables
to placate the compiler, hopefully to a value which will cause a
crash if it is ever actually used.
* print.c (scm_iprin1): Initialize mw_pos.
* read.c (scm_lreadrecparen): Initialize tl2, ans2.
* throw.c (scm_ithrow): Initialize dynpair.
* unif.c (scm_uniform_vector_ref): Initialize cra.
* struct.c (init_struct): Initialize prot.
* mbstrings.c (scm_print_mb_symbol): Initialize mw_pos and inc.
1996-12-18 21:42:09 +00:00
Jim Blandy
35de7ebe4a Give GCC more control flow information, so it can be sure that
variables aren't used uninitialized.
* error.h (scm_error, scm_syserror, scm_syserror_msg,
scm_sysmissing, scm_num_overflow, scm_out_of_range,
scm_wrong_num_args, scm_wrong_type_arg, scm_memory_error,
scm_misc_error): Tell GCC that these functions never return.
* struct.c (scm_struct_ref, scm_struct_set_x): If we can't figure
out the field type, call abort if SCM_ASSERT returns, to placate
the optimizer.
* stacks.c (scm_make_stack, scm_last_stack_frame): abort if
scm_wta ever returns.  We can't handle this case anyway, and this
gives the optimizer more information.
* unif.c (scm_uniform_vector_ref, scm_array_set_x): Abort if
scm_wta ever returns.

In some cases, the code is fine, but GCC isn't smart enough to
figure that out; this usually happens when one variable is only
initialized and used when a particular condition holds true, and
we know that condition will never change within a given invocation
of the function.  In this case, we simply initialize the variables
to placate the compiler, hopefully to a value which will cause a
crash if it is ever actually used.
* print.c (scm_iprin1): Initialize mw_pos.
* read.c (scm_lreadrecparen): Initialize tl2, ans2.
* throw.c (scm_ithrow): Initialize dynpair.
* unif.c (scm_uniform_vector_ref): Initialize cra.
* struct.c (init_struct): Initialize prot.
* mbstrings.c (scm_print_mb_symbol): Initialize mw_pos and inc.
1996-12-18 21:41:44 +00:00
Jim Blandy
407775cb81 * strports.c (scm_eval_0str): Don't return uninitialized garbage
if EXPR contains no expressions.
1996-12-18 21:40:21 +00:00
Jim Blandy
3323ad081e Give GCC more control flow information, so it can be sure that
variables aren't used uninitialized.
* error.h (scm_error, scm_syserror, scm_syserror_msg,
scm_sysmissing, scm_num_overflow, scm_out_of_range,
scm_wrong_num_args, scm_wrong_type_arg, scm_memory_error,
scm_misc_error): Tell GCC that these functions never return.
* struct.c (scm_struct_ref, scm_struct_set_x): If we can't figure
out the field type, call abort if SCM_ASSERT returns, to placate
the optimizer.
* stacks.c (scm_make_stack, scm_last_stack_frame): abort if
scm_wta ever returns.  We can't handle this case anyway, and this
gives the optimizer more information.
* unif.c (scm_uniform_vector_ref, scm_array_set_x): Abort if
scm_wta ever returns.
1996-12-18 21:39:44 +00:00
Jim Blandy
1b306e1623 *** empty log message *** 1996-12-18 16:50:19 +00:00
Jim Blandy
2c8f214468 * eval.c, debug.h: Revert changes of Dec 16 and Nov 21. They
cause an infinite loop (???).  So much for the algebraic
equivalency of variable-sized arrays and alloca...
1996-12-18 16:45:03 +00:00
Marius Vollmer
e4bcd6d945 *** empty log message *** 1996-12-18 09:43:23 +00:00
Marius Vollmer
6064dcc69e * gc.c (SCM_MTRIGGER_HYSTERESIS): New memory management parameter.
(scm_must_malloc, scm_must_realloc): Added a hysteresis to the
rules for raising scm_mtrigger. Previously, unfortunate but not
unlikely circumstances could result in almost constant invokation
of the gc. Now, this situations should be less likely, but they
are not prevented completely.
1996-12-18 09:42:39 +00:00
Marius Vollmer
016e2ce1d0 * backtrace.c (scm_display_error): Bugfix: scm_procedure_p returns
a SCM boolean, not a C boolean.
1996-12-18 09:40:46 +00:00
Jim Blandy
5e06e4dbb5 *** empty log message *** 1996-12-17 21:24:20 +00:00
Jim Blandy
9ab5a13fc7 * numbers.c (scm_fuck): Procedure removed; looks like old test code.
* numbers.h: Prototype removed.
1996-12-17 21:24:03 +00:00
Jim Blandy
458917df95 *** empty log message *** 1996-12-17 21:21:19 +00:00
Jim Blandy
073621cd66 * numbers.c (scm_fuck): Procedure removed; looks like old test code. 1996-12-17 21:21:01 +00:00
Jim Blandy
0032595465 *** empty log message *** 1996-12-16 23:22:49 +00:00
Jim Blandy
4387795a11 * debug.h (scm_debug_frame): Change `vect' member from an in-line
array to a pointer, to match my Nov 21 change in eval.c.
1996-12-16 23:22:31 +00:00
Jim Blandy
4aff3ae213 *** empty log message *** 1996-12-16 22:18:23 +00:00
Jim Blandy
01e2a66d26 * ramap.c (scm_ra_sum, scm_ra_difference, scm_ra_product,
scm_ra_divide): Properly terminate statements passed as arguments
to IVDEP macros.  (Thanks to Bernard Urban.)
1996-12-16 22:17:57 +00:00
Jim Blandy
2210c32f67 * eval.c (SCM_CEVAL): Use alloca, not GCC's extensions for arrays
with non-constant sizes.  (Thanks to Bernard Urban.)
1996-12-16 22:17:29 +00:00
Mikael Djurfeldt
efcb39f2c8 *** empty log message *** 1996-12-14 14:50:24 +00:00
Mikael Djurfeldt
74f17710af Regenerated by automake-1.1l. 1996-12-14 14:46:02 +00:00
Mikael Djurfeldt
a8aa30d896 * * strports.c, strports.h: Make scm_eval_0str return the value of
the last expression evaluated (previously, it returned void).

*	* strports.c, strports.h: New function: scm_read_0str.  Does what
	it sounds like.
1996-12-13 19:41:18 +00:00
Mikael Djurfeldt
dbe2648143 *** empty log message *** 1996-12-13 19:41:07 +00:00
Mikael Djurfeldt
a65b9c802e * strings.c (scm_string scm_make_string scm_string_ref
scm_string_set_x scm_string_equal_p scm_string_append):
Bugfix according to scm patch from Aubrey Jaffer:
Corrected long-standing
(not (eqv? (integer->char 128)
	   (string-ref (make-string 1 (integer->char 128)) 0)))
bug found by John Kozak <jk@noontide.demon.co.uk>.
1996-12-13 19:40:57 +00:00
Mikael Djurfeldt
dd2c906423 * libguile.h: Added #include "libguile/backtrace.h", #include
"libguile/stacks.h".
1996-12-13 19:40:45 +00:00
Mark Galassi
f9d81b6bcb updated the Makefile.in files with the right automake 1.1l 1996-12-13 02:50:04 +00:00
Mark Galassi
0fedd45c50 some more work on handlers for gh 1996-12-12 02:59:15 +00:00
Gary Houston
9373b38711 * simpos.c (scm_getenv): return #f if string can't be found in the
environment instead of throwing an exception, for compatibility
with numerous other systems.
1996-12-11 19:06:31 +00:00
Tom Tromey
adb75a4155 guile-snarf script once again used for creating .x files 1996-12-10 06:25:08 +00:00
Jim Blandy
52b60d44fb *** empty log message *** 1996-12-10 01:42:08 +00:00
Jim Blandy
f3acc5c15f * backtrace.c (scm_display_error_message): Made non-static, and
renamed from display_error_message.
* backtrace.h (scm_display_error_message): Added extern decl.
* throw.c (uncaught_throw): Use it to display the error message.
1996-12-10 01:41:37 +00:00
Jim Blandy
e82afdb843 Don't print extra newline. 1996-12-09 23:53:47 +00:00
Gary Houston
8588fa1267 * ioext.c (scm_sys_ftell): use scm_long2num instead of SCM_MAKINUM
to convert the returned value.
(scm_sys_fseek): use scm_num2long instead of SCM_INUM to convert
the offset argument.
1996-12-09 20:52:37 +00:00
Tom Tromey
5ce61f2470 Fixed erroneous use of #ifdef 1996-12-09 20:21:47 +00:00
Jim Blandy
f8d0b1924e Rebuilt from Makefile.am. 1996-12-09 02:22:44 +00:00
Jim Blandy
a73b898540 * Makefile.am (libpath.h): Re-incorporate Mikael's changes of Wed
Oct 30.
1996-12-09 02:20:11 +00:00
Jim Blandy
5b9ad5c2db *** empty log message *** 1996-12-09 02:16:35 +00:00