* 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>.
This commit is contained in:
Gary Houston 1996-12-21 04:13:54 +00:00
commit 370312ae6e
10 changed files with 1352 additions and 362 deletions

View file

@ -60,7 +60,6 @@
#include "eq.h"
#include "error.h"
#include "eval.h"
#include "fdsocket.h"
#include "feature.h"
#include "filesys.h"
#include "fports.h"
@ -75,6 +74,7 @@
#include "load.h"
#include "mallocs.h"
#include "mbstrings.h"
#include "net_db.h"
#include "numbers.h"
#include "objprop.h"
#include "options.h"
@ -362,7 +362,6 @@ scm_boot_guile_1 (base, argc, argv, main_func, closure)
scm_init_dynwind ();
scm_init_eq ();
scm_init_error ();
scm_init_fdsocket ();
scm_init_fports ();
scm_init_filesys ();
scm_init_gc ();
@ -373,6 +372,7 @@ scm_boot_guile_1 (base, argc, argv, main_func, closure)
scm_init_kw ();
scm_init_list ();
scm_init_mallocs ();
scm_init_net_db ();
scm_init_numbers ();
scm_init_objprop ();
#if DEBUG_EXTENSIONS