From 60d0643dbfa91ffa7fe55a7e336e2dff4acd4a34 Mon Sep 17 00:00:00 2001 From: Gary Houston Date: Sat, 4 Dec 1999 22:59:10 +0000 Subject: [PATCH] * ports.c (scm_port_closed_p): new procedure, implements "port-closed?" suggested by Bernard Urban. ports.h: added prototype, removed the SCM_P macros. --- AUTHORS | 3 +- NEWS | 3 ++ THANKS | 12 ++++-- TODO | 4 -- libguile/ChangeLog | 6 +++ libguile/ports.c | 8 ++++ libguile/ports.h | 101 +++++++++++++++++++++++---------------------- 7 files changed, 79 insertions(+), 58 deletions(-) diff --git a/AUTHORS b/AUTHORS index 92d4983f0..3b33c194b 100644 --- a/AUTHORS +++ b/AUTHORS @@ -20,7 +20,8 @@ In the subdirectory libguile, wrote: gsubr.h ramap.h unif.h Gary Houston: changes to many files in libguile. -wrote: libguile/socket.c, ice-9/expect.scm +In the subdirectory ice-9, wrote: + expect.scm networking.scm popen.scm posix.scm Jim Blandy: Many changes throughout. In the subdirectory libguile, wrote: diff --git a/NEWS b/NEWS index bd3efc420..d88e165bc 100644 --- a/NEWS +++ b/NEWS @@ -85,6 +85,9 @@ at the top of the script. (The first options enables the debugging evaluator. The second enables backtraces.) +** New procedure: port-closed? PORT +Returns #t if PORT is closed or #f if it is open. + * Changes to the scm_ interface ** Port internals: the rw_random variable in the scm_port structure diff --git a/THANKS b/THANKS index c7778b0a9..a66f3f12c 100644 --- a/THANKS +++ b/THANKS @@ -1,10 +1,16 @@ -Jim Blandy is Guile's maintainer. +Maintainer: -Thanks to: +Contributors since the last release: -Bug reports and fixes from: + Greg Badros + Jim Blandy + Mikael Djurfeldt + Gary Houston + +Bug reports and fixes: Lauri Alanko + Mark Galassi Greg Harvey Roland Orre Bertrand Petit diff --git a/TODO b/TODO index 97ca63e80..b54b495d8 100644 --- a/TODO +++ b/TODO @@ -16,10 +16,6 @@ Desired later on * Good interface to Tk -* Add a convenient facility for running a pipeline of processes -with redirections. Gary Houston -is working on this. - * Make it possible to link Guile and TK without using libtcl.a, by providing Guile-based replacements for the libtcl.a functions that TK requires. diff --git a/libguile/ChangeLog b/libguile/ChangeLog index 1f2bef9bc..d3780d91a 100644 --- a/libguile/ChangeLog +++ b/libguile/ChangeLog @@ -1,3 +1,9 @@ +1999-12-04 Gary Houston + + * ports.c (scm_port_closed_p): new procedure, implements + "port-closed?" suggested by Bernard Urban. + ports.h: added prototype, removed the SCM_P macros. + 1999-11-30 Gary Houston * unif.h: added some comments, removed the SCM_P macros. diff --git a/libguile/ports.c b/libguile/ports.c index 542d56ee6..5f9e6fd61 100644 --- a/libguile/ports.c +++ b/libguile/ports.c @@ -622,6 +622,14 @@ scm_output_port_p (SCM x) return SCM_OUTPORTP (x) ? SCM_BOOL_T : SCM_BOOL_F; } +SCM_PROC(s_port_closed_p, "port-closed?", 1, 0, 0, scm_port_closed_p); +SCM +scm_port_closed_p (SCM port) +{ + SCM_ASSERT (SCM_NIMP (port) && SCM_PORTP (port), port, SCM_ARG1, + s_port_closed_p); + return SCM_OPPORTP (port) ? SCM_BOOL_F : SCM_BOOL_T; +} SCM_PROC(s_eof_object_p, "eof-object?", 1, 0, 0, scm_eof_object_p); diff --git a/libguile/ports.h b/libguile/ports.h index 4d9e63f69..593406879 100644 --- a/libguile/ports.h +++ b/libguile/ports.h @@ -209,7 +209,7 @@ extern int scm_port_table_room; -extern SCM scm_markstream SCM_P ((SCM ptr)); +extern SCM scm_markstream (SCM ptr); extern long scm_make_port_type (char *name, int (*fill_input) (SCM port), void (*write) (SCM port, void *data, @@ -236,64 +236,65 @@ extern void scm_set_port_truncate (long tc, void (*truncate) (SCM port, off_t length)); extern void scm_set_port_input_waiting (long tc, int (*input_waiting) (SCM)); -extern SCM scm_char_ready_p SCM_P ((SCM port)); +extern SCM scm_char_ready_p (SCM port); extern SCM scm_drain_input (SCM port); -extern SCM scm_current_input_port SCM_P ((void)); -extern SCM scm_current_output_port SCM_P ((void)); -extern SCM scm_current_error_port SCM_P ((void)); -extern SCM scm_current_load_port SCM_P ((void)); -extern SCM scm_set_current_input_port SCM_P ((SCM port)); -extern SCM scm_set_current_output_port SCM_P ((SCM port)); -extern SCM scm_set_current_error_port SCM_P ((SCM port)); -extern scm_port * scm_add_to_port_table SCM_P ((SCM port)); -extern void scm_remove_from_port_table SCM_P ((SCM port)); -extern void scm_grow_port_cbuf SCM_P ((SCM port, size_t requested)); -extern SCM scm_pt_size SCM_P ((void)); -extern SCM scm_pt_member SCM_P ((SCM member)); -extern int scm_revealed_count SCM_P ((SCM port)); -extern SCM scm_port_revealed SCM_P ((SCM port)); -extern SCM scm_set_port_revealed_x SCM_P ((SCM port, SCM rcount)); -extern long scm_mode_bits SCM_P ((char *modes)); -extern SCM scm_port_mode SCM_P ((SCM port)); -extern SCM scm_close_port SCM_P ((SCM port)); -extern SCM scm_close_all_ports_except SCM_P ((SCM ports)); -extern SCM scm_input_port_p SCM_P ((SCM x)); -extern SCM scm_output_port_p SCM_P ((SCM x)); -extern SCM scm_eof_object_p SCM_P ((SCM x)); -extern SCM scm_force_output SCM_P ((SCM port)); -extern SCM scm_flush_all_ports SCM_P ((void)); -extern SCM scm_read_char SCM_P ((SCM port)); -extern void scm_putc SCM_P ((char c, SCM port)); -extern void scm_puts SCM_P ((char *str_data, SCM port)); -extern void scm_lfwrite SCM_P ((char *ptr, scm_sizet size, SCM port)); -extern void scm_flush SCM_P ((SCM port)); +extern SCM scm_current_input_port (void); +extern SCM scm_current_output_port (void); +extern SCM scm_current_error_port (void); +extern SCM scm_current_load_port (void); +extern SCM scm_set_current_input_port (SCM port); +extern SCM scm_set_current_output_port (SCM port); +extern SCM scm_set_current_error_port (SCM port); +extern scm_port * scm_add_to_port_table (SCM port); +extern void scm_remove_from_port_table (SCM port); +extern void scm_grow_port_cbuf (SCM port, size_t requested); +extern SCM scm_pt_size (void); +extern SCM scm_pt_member (SCM member); +extern int scm_revealed_count (SCM port); +extern SCM scm_port_revealed (SCM port); +extern SCM scm_set_port_revealed_x (SCM port, SCM rcount); +extern long scm_mode_bits (char *modes); +extern SCM scm_port_mode (SCM port); +extern SCM scm_close_port (SCM port); +extern SCM scm_close_all_ports_except (SCM ports); +extern SCM scm_input_port_p (SCM x); +extern SCM scm_output_port_p (SCM x); +extern SCM scm_port_closed_p (SCM port); +extern SCM scm_eof_object_p (SCM x); +extern SCM scm_force_output (SCM port); +extern SCM scm_flush_all_ports (void); +extern SCM scm_read_char (SCM port); +extern void scm_putc (char c, SCM port); +extern void scm_puts (char *str_data, SCM port); +extern void scm_lfwrite (char *ptr, scm_sizet size, SCM port); +extern void scm_flush (SCM port); extern void scm_end_input (SCM port); extern int scm_fill_input (SCM port); -extern int scm_getc SCM_P ((SCM port)); -extern void scm_ungetc SCM_P ((int c, SCM port)); -extern void scm_ungets SCM_P ((char *s, int n, SCM port)); -extern SCM scm_peek_char SCM_P ((SCM port)); -extern SCM scm_unread_char SCM_P ((SCM cobj, SCM port)); -extern SCM scm_unread_string SCM_P ((SCM str, SCM port)); -extern char *scm_generic_fgets SCM_P ((SCM port, int *len)); +extern int scm_getc (SCM port); +extern void scm_ungetc (int c, SCM port); +extern void scm_ungets (char *s, int n, SCM port); +extern SCM scm_peek_char (SCM port); +extern SCM scm_unread_char (SCM cobj, SCM port); +extern SCM scm_unread_string (SCM str, SCM port); +extern char *scm_generic_fgets (SCM port, int *len); extern SCM scm_seek (SCM object, SCM offset, SCM whence); extern SCM scm_truncate_file (SCM object, SCM length); -extern SCM scm_port_line SCM_P ((SCM port)); -extern SCM scm_set_port_line_x SCM_P ((SCM port, SCM line)); -extern SCM scm_port_column SCM_P ((SCM port)); -extern SCM scm_set_port_column_x SCM_P ((SCM port, SCM line)); -extern SCM scm_port_filename SCM_P ((SCM port)); -extern SCM scm_set_port_filename_x SCM_P ((SCM port, SCM filename)); +extern SCM scm_port_line (SCM port); +extern SCM scm_set_port_line_x (SCM port, SCM line); +extern SCM scm_port_column (SCM port); +extern SCM scm_set_port_column_x (SCM port, SCM line); +extern SCM scm_port_filename (SCM port); +extern SCM scm_set_port_filename_x (SCM port, SCM filename); extern int scm_port_print (SCM exp, SCM port, scm_print_state *); extern void scm_print_port_mode (SCM exp, SCM port); -extern void scm_ports_prehistory SCM_P ((void)); -extern SCM scm_void_port SCM_P ((char * mode_str)); -extern SCM scm_sys_make_void_port SCM_P ((SCM mode)); -extern void scm_init_ports SCM_P ((void)); +extern void scm_ports_prehistory (void); +extern SCM scm_void_port (char * mode_str); +extern SCM scm_sys_make_void_port (SCM mode); +extern void scm_init_ports (void); #ifdef GUILE_DEBUG -extern SCM scm_pt_size SCM_P ((void)); -extern SCM scm_pt_member SCM_P ((SCM member)); +extern SCM scm_pt_size (void); +extern SCM scm_pt_member (SCM member); #endif /* GUILE_DEBUG */ #endif /* PORTSH */ -- 2.20.1