From 0c0227d5230573378956a1f36259e7f204d65507 Mon Sep 17 00:00:00 2001 From: Timothy Sample Date: Thu, 15 Nov 2018 14:11:43 -0500 Subject: [PATCH] Add support for file descriptors 3 to 9 * geesh/shell.scm (*fd-count*) Increase to 10. (current-3-port, current-4-port, current-5-port, current-6-port, current-7-port, current-8-port, current-9-port): New variables. (fd->current-port): Handle file descriptors 3 to 9. --- geesh/shell.scm | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/geesh/shell.scm b/geesh/shell.scm index 3d05cd9..8668632 100644 --- a/geesh/shell.scm +++ b/geesh/shell.scm @@ -23,7 +23,15 @@ ;;; ;;; Code: -(define *fd-count* 3) +(define *fd-count* 10) + +(define current-3-port (make-parameter #f)) +(define current-4-port (make-parameter #f)) +(define current-5-port (make-parameter #f)) +(define current-6-port (make-parameter #f)) +(define current-7-port (make-parameter #f)) +(define current-8-port (make-parameter #f)) +(define current-9-port (make-parameter #f)) (define (fd->current-port fd) "Return the current port (e.g. @code{current-input-port}) @@ -31,7 +39,14 @@ corresponding to the the Shell file descriptor @var{fd}." (match fd (0 current-input-port) (1 current-output-port) - (2 current-error-port))) + (2 current-error-port) + (3 current-3-port) + (4 current-4-port) + (5 current-5-port) + (6 current-6-port) + (7 current-7-port) + (8 current-8-port) + (9 current-9-port))) (define (install-current-ports!) "Install all current ports into their usual file descriptors. For