From 3f3a01d1d91a97bfbc90c744e0232f71a3a46ce8 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Mon, 14 Nov 1994 00:54:36 +0000 Subject: [PATCH] Eliminate old channel select registry mechanism. --- v7/src/microcode/dosio.c | 34 ++---------------------------- v7/src/microcode/dosio.h | 7 ++----- v7/src/microcode/ntio.c | 35 ++----------------------------- v7/src/microcode/ntio.h | 7 ++----- v7/src/microcode/osio.h | 10 ++------- v7/src/microcode/prosio.c | 28 ++----------------------- v7/src/microcode/uxio.c | 44 ++------------------------------------- v7/src/microcode/uxio.h | 7 ++----- 8 files changed, 16 insertions(+), 156 deletions(-) diff --git a/v7/src/microcode/dosio.c b/v7/src/microcode/dosio.c index db62704ec..b10dcadad 100644 --- a/v7/src/microcode/dosio.c +++ b/v7/src/microcode/dosio.c @@ -1,8 +1,8 @@ /* -*-C-*- -$Id: dosio.c,v 1.7 1993/09/01 20:21:25 gjr Exp $ +$Id: dosio.c,v 1.8 1994/11/14 00:53:57 cph Exp $ -Copyright (c) 1992-1993 Massachusetts Institute of Technology +Copyright (c) 1992-94 Massachusetts Institute of Technology This material was developed by the Scheme project at the Massachusetts Institute of Technology, Department of Electrical Engineering and @@ -43,8 +43,6 @@ MIT in each case. */ size_t OS_channel_table_size; struct channel * channel_table; -unsigned int OS_channels_registered; - static void DEFUN_VOID (DOS_channel_close_all) { @@ -73,8 +71,6 @@ DEFUN_VOID (DOS_initialize_channels) MARK_CHANNEL_CLOSED (channel); } add_reload_cleanup (DOS_channel_close_all); - OS_channels_registered = 0; - return; } void @@ -111,8 +107,6 @@ DEFUN (OS_channel_close, (channel), Tchannel channel) { if (! (CHANNEL_INTERNAL (channel))) { - if (CHANNEL_REGISTERED (channel)) - OS_channel_unregister (channel); STD_VOID_SYSTEM_CALL (syscall_close, (DOS_close (CHANNEL_DESCRIPTOR (channel)))); MARK_CHANNEL_CLOSED (channel); @@ -125,8 +119,6 @@ DEFUN (OS_channel_close_noerror, (channel), Tchannel channel) { if (! (CHANNEL_INTERNAL (channel))) { - if (CHANNEL_REGISTERED (channel)) - OS_channel_unregister (channel); DOS_close (CHANNEL_DESCRIPTOR (channel)); MARK_CHANNEL_CLOSED (channel); } @@ -484,28 +476,6 @@ DEFUN_VOID (OS_have_ptys_p) { return (FALSE); } - -int -DEFUN (OS_channel_registered_p, (channel), Tchannel channel) -{ - return (CHANNEL_REGISTERED (channel)); -} - -void -DEFUN (OS_channel_register, (channel), Tchannel channel) -{ - error_unimplemented_primitive (); -} - -void -DEFUN (OS_channel_unregister, (channel), Tchannel channel) -{ - if (CHANNEL_REGISTERED (channel)) - { - OS_channels_registered -= 1; - (CHANNEL_REGISTERED (channel)) = 0; - } -} /* No SELECT in DOS */ CONST int OS_have_select_p = 0; diff --git a/v7/src/microcode/dosio.h b/v7/src/microcode/dosio.h index 30b80828b..fae9059da 100644 --- a/v7/src/microcode/dosio.h +++ b/v7/src/microcode/dosio.h @@ -1,8 +1,8 @@ /* -*-C-*- -$Id: dosio.h,v 1.3 1994/01/29 21:25:33 gjr Exp $ +$Id: dosio.h,v 1.4 1994/11/14 00:54:36 cph Exp $ -Copyright (c) 1992-1994 Massachusetts Institute of Technology +Copyright (c) 1992-94 Massachusetts Institute of Technology This material was developed by the Scheme project at the Massachusetts Institute of Technology, Department of Electrical Engineering and @@ -43,7 +43,6 @@ struct channel enum channel_type type; unsigned int internal : 1; unsigned int nonblocking : 1; - unsigned int registered : 1; unsigned int buffered : 1; unsigned int cooked : 1; }; @@ -58,7 +57,6 @@ struct channel ((channel_table [(channel)]) . nonblocking) #define CHANNEL_BLOCKING_P(channel) \ (!CHANNEL_NONBLOCKING(channel)) -#define CHANNEL_REGISTERED(channel) ((channel_table [(channel)]) . registered) #define CHANNEL_BUFFERED(channel) ((channel_table [(channel)]) . buffered) #define CHANNEL_COOKED(channel) ((channel_table [(channel)]) . cooked) @@ -69,7 +67,6 @@ struct channel (CHANNEL_TYPE (MAKE_CHANNEL_temp)) = (type); \ (CHANNEL_INTERNAL (MAKE_CHANNEL_temp)) = 0; \ (CHANNEL_NONBLOCKING (MAKE_CHANNEL_temp)) = 0; \ - (CHANNEL_REGISTERED (MAKE_CHANNEL_temp)) = 0; \ (CHANNEL_BUFFERED (MAKE_CHANNEL_temp)) = 1; \ (CHANNEL_COOKED (MAKE_CHANNEL_temp)) = 0; \ receiver (MAKE_CHANNEL_temp); \ diff --git a/v7/src/microcode/ntio.c b/v7/src/microcode/ntio.c index f0d3f2728..b6d4ce34f 100644 --- a/v7/src/microcode/ntio.c +++ b/v7/src/microcode/ntio.c @@ -1,8 +1,8 @@ /* -*-C-*- -$Id: ntio.c,v 1.9 1993/09/01 19:36:28 gjr Exp $ +$Id: ntio.c,v 1.10 1994/11/14 00:53:40 cph Exp $ -Copyright (c) 1992-1993 Massachusetts Institute of Technology +Copyright (c) 1992-94 Massachusetts Institute of Technology This material was developed by the Scheme project at the Massachusetts Institute of Technology, Department of Electrical Engineering and @@ -50,8 +50,6 @@ MIT in each case. */ size_t OS_channel_table_size; struct channel * channel_table; -unsigned int OS_channels_registered; - #ifndef GUI HANDLE STDIN_HANDLE, STDOUT_HANDLE, STDERR_HANDLE; #endif @@ -105,8 +103,6 @@ DEFUN (OS_channel_close, (channel), Tchannel channel) { if (! (CHANNEL_INTERNAL (channel))) { - if (CHANNEL_REGISTERED (channel)) - OS_channel_unregister (channel); STD_BOOL_SYSTEM_CALL (syscall_close, (CloseHandle (CHANNEL_HANDLE (channel)))); MARK_CHANNEL_CLOSED (channel); @@ -119,8 +115,6 @@ DEFUN (OS_channel_close_noerror, (channel), Tchannel channel) { if (! (CHANNEL_INTERNAL (channel))) { - if (CHANNEL_REGISTERED (channel)) - OS_channel_unregister (channel); if (! Screen_IsScreenHandle (CHANNEL_HANDLE (channel))) CloseHandle (CHANNEL_HANDLE (channel)); MARK_CHANNEL_CLOSED (channel); @@ -517,29 +511,6 @@ DEFUN_VOID (OS_have_ptys_p) return (FALSE); } -int -DEFUN (OS_channel_registered_p, (channel), Tchannel channel) -{ - return (CHANNEL_REGISTERED (channel)); -} - -void -DEFUN (OS_channel_register, (channel), Tchannel channel) -{ - error_unimplemented_primitive (); -} - -void -DEFUN (OS_channel_unregister, (channel), Tchannel channel) -{ - if (CHANNEL_REGISTERED (channel)) - { - OS_channels_registered -= 1; - (CHANNEL_REGISTERED (channel)) = 0; - } - return; -} - /* Initialization/Termination code. */ int OS_have_select_p = 0; @@ -612,6 +583,4 @@ DEFUN_VOID (NT_initialize_channels) MARK_CHANNEL_CLOSED (channel); } add_reload_cleanup (NT_channel_close_all); - OS_channels_registered = 0; - return; } diff --git a/v7/src/microcode/ntio.h b/v7/src/microcode/ntio.h index 89f5f0a8f..6a66fe34d 100644 --- a/v7/src/microcode/ntio.h +++ b/v7/src/microcode/ntio.h @@ -1,8 +1,8 @@ /* -*-C-*- -$Id: ntio.h,v 1.5 1993/08/21 03:34:27 gjr Exp $ +$Id: ntio.h,v 1.6 1994/11/14 00:54:27 cph Exp $ -Copyright (c) 1992-1993 Massachusetts Institute of Technology +Copyright (c) 1992-94 Massachusetts Institute of Technology This material was developed by the Scheme project at the Massachusetts Institute of Technology, Department of Electrical Engineering and @@ -43,7 +43,6 @@ struct channel enum channel_type type; unsigned int internal : 1; unsigned int nonblocking : 1; - unsigned int registered : 1; unsigned int buffered : 1; unsigned int cooked : 1; }; @@ -58,7 +57,6 @@ struct channel ((channel_table [(channel)]) . nonblocking) #define CHANNEL_BLOCKING_P(channel) \ (!CHANNEL_NONBLOCKING(channel)) -#define CHANNEL_REGISTERED(channel) ((channel_table [(channel)]) . registered) #define CHANNEL_BUFFERED(channel) ((channel_table [(channel)]) . buffered) #define CHANNEL_COOKED(channel) ((channel_table [(channel)]) . cooked) @@ -69,7 +67,6 @@ struct channel (CHANNEL_TYPE (MAKE_CHANNEL_temp)) = (type); \ (CHANNEL_INTERNAL (MAKE_CHANNEL_temp)) = 0; \ (CHANNEL_NONBLOCKING (MAKE_CHANNEL_temp)) = 0; \ - (CHANNEL_REGISTERED (MAKE_CHANNEL_temp)) = 0; \ (CHANNEL_BUFFERED (MAKE_CHANNEL_temp)) = 1; \ (CHANNEL_COOKED (MAKE_CHANNEL_temp)) = 0; \ receiver (MAKE_CHANNEL_temp); \ diff --git a/v7/src/microcode/osio.h b/v7/src/microcode/osio.h index 86ef6fa55..aef510429 100644 --- a/v7/src/microcode/osio.h +++ b/v7/src/microcode/osio.h @@ -1,8 +1,8 @@ /* -*-C-*- -$Id: osio.h,v 1.9 1994/11/13 23:47:37 cph Exp $ +$Id: osio.h,v 1.10 1994/11/14 00:53:17 cph Exp $ -Copyright (c) 1990-93 Massachusetts Institute of Technology +Copyright (c) 1990-94 Massachusetts Institute of Technology This material was developed by the Scheme project at the Massachusetts Institute of Technology, Department of Electrical Engineering and @@ -89,11 +89,5 @@ extern void EXFUN (OS_channel_nonblocking, (Tchannel channel)); extern void EXFUN (OS_channel_blocking, (Tchannel channel)); extern CONST int OS_have_select_p; -extern unsigned int OS_channels_registered; -extern int EXFUN (OS_channels_registered_p, (void)); -extern void EXFUN (OS_channel_register, (Tchannel channel)); -extern void EXFUN (OS_channel_unregister, (Tchannel channel)); -extern long EXFUN - (OS_channel_select_then_read, (Tchannel channel, PTR buffer, size_t nbytes)); #endif /* SCM_OSIO_H */ diff --git a/v7/src/microcode/prosio.c b/v7/src/microcode/prosio.c index 86120c966..aaf850a9d 100644 --- a/v7/src/microcode/prosio.c +++ b/v7/src/microcode/prosio.c @@ -1,8 +1,8 @@ /* -*-C-*- -$Id: prosio.c,v 1.10 1994/11/14 00:05:20 cph Exp $ +$Id: prosio.c,v 1.11 1994/11/14 00:54:04 cph Exp $ -Copyright (c) 1987-93 Massachusetts Institute of Technology +Copyright (c) 1987-94 Massachusetts Institute of Technology This material was developed by the Scheme project at the Massachusetts Institute of Technology, Department of Electrical Engineering and @@ -247,27 +247,3 @@ DEFINE_PRIMITIVE ("HAVE-SELECT?", Prim_have_select_p, 0, 0, 0) PRIMITIVE_HEADER (0); PRIMITIVE_RETURN (BOOLEAN_TO_OBJECT (OS_have_select_p)); } - -DEFINE_PRIMITIVE ("CHANNEL-REGISTERED?", Prim_channel_registered_p, 1, 1, - "Return #F iff CHANNEL is registered for selection.") -{ - PRIMITIVE_HEADER (1); - PRIMITIVE_RETURN - (BOOLEAN_TO_OBJECT (OS_channel_registered_p (arg_channel (1)))); -} - -DEFINE_PRIMITIVE ("CHANNEL-REGISTER", Prim_channel_register, 1, 1, - "Register CHANNEL for selection.") -{ - PRIMITIVE_HEADER (1); - OS_channel_register (arg_channel (1)); - PRIMITIVE_RETURN (UNSPECIFIC); -} - -DEFINE_PRIMITIVE ("CHANNEL-UNREGISTER", Prim_channel_unregister, 1, 1, - "Unregister CHANNEL for selection.") -{ - PRIMITIVE_HEADER (1); - OS_channel_unregister (arg_channel (1)); - PRIMITIVE_RETURN (UNSPECIFIC); -} diff --git a/v7/src/microcode/uxio.c b/v7/src/microcode/uxio.c index a65f1e84c..c1e4deb9d 100644 --- a/v7/src/microcode/uxio.c +++ b/v7/src/microcode/uxio.c @@ -1,8 +1,8 @@ /* -*-C-*- -$Id: uxio.c,v 1.33 1993/11/18 00:35:24 gjr Exp $ +$Id: uxio.c,v 1.34 1994/11/14 00:53:27 cph Exp $ -Copyright (c) 1990-1993 Massachusetts Institute of Technology +Copyright (c) 1990-94 Massachusetts Institute of Technology This material was developed by the Scheme project at the Massachusetts Institute of Technology, Department of Electrical Engineering and @@ -50,7 +50,6 @@ struct channel * channel_table; #define FD_ZERO(p) ((*(p)) = 0) #endif -unsigned int OS_channels_registered; static SELECT_TYPE input_descriptors; #ifdef HAVE_SELECT static struct timeval zero_timeout; @@ -86,7 +85,6 @@ DEFUN_VOID (UX_initialize_channels) } add_reload_cleanup (UX_channel_close_all); FD_ZERO (&input_descriptors); - OS_channels_registered = 0; #ifdef HAVE_SELECT (zero_timeout . tv_sec) = 0; (zero_timeout . tv_usec) = 0; @@ -132,8 +130,6 @@ DEFUN (OS_channel_close, (channel), Tchannel channel) { if (! (CHANNEL_INTERNAL (channel))) { - if (CHANNEL_REGISTERED (channel)) - OS_channel_unregister (channel); STD_VOID_SYSTEM_CALL (syscall_close, (UX_close (CHANNEL_DESCRIPTOR (channel)))); MARK_CHANNEL_CLOSED (channel); @@ -145,8 +141,6 @@ DEFUN (OS_channel_close_noerror, (channel), Tchannel channel) { if (! (CHANNEL_INTERNAL (channel))) { - if (CHANNEL_REGISTERED (channel)) - OS_channel_unregister (channel); UX_close (CHANNEL_DESCRIPTOR (channel)); MARK_CHANNEL_CLOSED (channel); } @@ -498,40 +492,6 @@ DEFUN (UX_select_descriptor, (fd, blockp), #endif } -/* Old Global Registry Mechanism */ - -int -DEFUN (OS_channel_registered_p, (channel), Tchannel channel) -{ - return (CHANNEL_REGISTERED (channel)); -} - -void -DEFUN (OS_channel_register, (channel), Tchannel channel) -{ -#ifdef HAVE_SELECT - if (! (CHANNEL_REGISTERED (channel))) - { - FD_SET ((CHANNEL_DESCRIPTOR (channel)), (&input_descriptors)); - OS_channels_registered += 1; - (CHANNEL_REGISTERED (channel)) = 1; - } -#else - error_unimplemented_primitive (); -#endif -} - -void -DEFUN (OS_channel_unregister, (channel), Tchannel channel) -{ - if (CHANNEL_REGISTERED (channel)) - { - FD_CLR ((CHANNEL_DESCRIPTOR (channel)), (&input_descriptors)); - OS_channels_registered -= 1; - (CHANNEL_REGISTERED (channel)) = 0; - } -} - enum select_input DEFUN (UX_select_input, (fd, blockp), int fd AND int blockp) { diff --git a/v7/src/microcode/uxio.h b/v7/src/microcode/uxio.h index 3356ef174..a6c480252 100644 --- a/v7/src/microcode/uxio.h +++ b/v7/src/microcode/uxio.h @@ -1,8 +1,8 @@ /* -*-C-*- -$Id: uxio.h,v 1.3 1993/06/24 07:10:10 gjr Exp $ +$Id: uxio.h,v 1.4 1994/11/14 00:54:19 cph Exp $ -Copyright (c) 1990-91 Massachusetts Institute of Technology +Copyright (c) 1990-94 Massachusetts Institute of Technology This material was developed by the Scheme project at the Massachusetts Institute of Technology, Department of Electrical Engineering and @@ -43,7 +43,6 @@ struct channel enum channel_type type; unsigned int internal : 1; unsigned int nonblocking : 1; - unsigned int registered : 1; }; #define MARK_CHANNEL_CLOSED(channel) ((CHANNEL_DESCRIPTOR (channel)) = (-1)) @@ -54,7 +53,6 @@ struct channel #define CHANNEL_INTERNAL(channel) ((channel_table [(channel)]) . internal) #define CHANNEL_NONBLOCKING(channel) \ ((channel_table [(channel)]) . nonblocking) -#define CHANNEL_REGISTERED(channel) ((channel_table [(channel)]) . registered) #define MAKE_CHANNEL(descriptor, type, receiver) \ { \ @@ -63,7 +61,6 @@ struct channel (CHANNEL_TYPE (MAKE_CHANNEL_temp)) = (type); \ (CHANNEL_INTERNAL (MAKE_CHANNEL_temp)) = 0; \ (CHANNEL_NONBLOCKING (MAKE_CHANNEL_temp)) = 0; \ - (CHANNEL_REGISTERED (MAKE_CHANNEL_temp)) = 0; \ receiver (MAKE_CHANNEL_temp); \ } -- 2.25.1