/* -*-C-*-
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/uxio.c,v 1.4 1990/08/10 02:13:44 cph Exp $
+$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/uxio.c,v 1.5 1990/08/16 19:22:41 cph Exp $
Copyright (c) 1990 Massachusetts Institute of Technology
size_t OS_channel_table_size;
struct channel * channel_table;
+static void
+DEFUN_VOID (UX_channel_close_all)
+{
+ Tchannel channel;
+ for (channel = 0; (channel < OS_channel_table_size); channel += 1)
+ if (CHANNEL_OPEN_P (channel))
+ OS_channel_close (channel);
+}
+
void
DEFUN_VOID (UX_initialize_channels)
{
for (channel = 0; (channel < OS_channel_table_size); channel += 1)
MARK_CHANNEL_CLOSED (channel);
}
+ add_reload_cleanup (UX_channel_close_all);
}
void
OS_channel_table_size = 0;
}
-void
-DEFUN_VOID (OS_channel_close_all)
-{
- Tchannel channel;
- for (channel = 0; (channel < OS_channel_table_size); channel += 1)
- if (CHANNEL_OPEN_P (channel))
- OS_channel_close (channel);
-}
-
Tchannel
DEFUN_VOID (channel_allocate)
{
{
if (! (CHANNEL_INTERNAL (channel)))
{
- STD_VOID_SYSTEM_CALL ("close", (UX_close (CHANNEL_DESCRIPTOR (channel))));
+ STD_VOID_SYSTEM_CALL
+ ("close", (UX_close (CHANNEL_DESCRIPTOR (channel))));
MARK_CHANNEL_CLOSED (channel);
}
}
UX_close (CHANNEL_DESCRIPTOR (channel));
MARK_CHANNEL_CLOSED (channel);
}
-
+\f
enum channel_type
DEFUN (OS_channel_type, (channel), Tchannel channel)
{
return (CHANNEL_TYPE (channel));
}
-\f
+
long
DEFUN (OS_channel_read, (channel, buffer, nbytes),
Tchannel channel AND