From e477fc5cd7b95cbde4e1ec25f58eb2754ce0f404 Mon Sep 17 00:00:00 2001 From: "Artyom V. Poptsov" Date: Sat, 5 Dec 2015 20:07:41 +0300 Subject: channel.scm (make-channel): Accept optional flags * modules/ssh/channel.scm (make-channel): Accept optional flags that allow to create an input, output or input/output channel. The procedure creates a bidirectional tunnel by default. * libguile-ssh/channel-type.c (guile_ssh_make_channel): Likewise. Rename the Scheme procedure to '%make-channel'. All callers updated. (_scm_from_channel_data): Accept flags. Assert flags value. (print_channel): Print the direction of a channel. (init_channel_type): Define 'RDNG' and 'WRTNG' symbols. * libguile-ssh/channel-type.h: Update. * libguile-ssh/message-func.c (guile_ssh_message_channel_request_open_reply_accept): Update. * doc/api-channels.texi: Update description of 'make-channel'. --- doc/api-channels.texi | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'doc') diff --git a/doc/api-channels.texi b/doc/api-channels.texi index 6123027..03c5b7b 100644 --- a/doc/api-channels.texi +++ b/doc/api-channels.texi @@ -33,9 +33,13 @@ Return @code{#t} if @var{x} is a Guile-SSH channel, @code{#f} otherwise. @end deffn -@deffn {Scheme Procedure} make-channel session -Allocate a new Guile-SSH channel for the @var{session} -(@pxref{Sessions}). +@deffn {Scheme Procedure} make-channel session [flags] +Allocate a new Guile-SSH channel for the @var{session} (@pxref{Sessions}). + +@var{flags} are determine what kind of a channel should be created. Possible +flags are: @code{O_RDONLY}, @code{O_WRONLY}, @code{O_RDWR}. They play similar +role to @code{open} procedure flags, and allow to create an ihput channel, +output channel or input/output channel respectively. @end deffn @deffn {Scheme Procedure} channel-open-session channel -- cgit v1.2.3