diff --git a/docs/Makefile.am b/docs/Makefile.am index 8e4b1a66..373a9611 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -1,8 +1,10 @@ -# $Id: Makefile.am,v 1.1 2007/02/02 22:27:06 bagder Exp $ +# $Id: Makefile.am,v 1.2 2007/02/23 10:20:56 bagder Exp $ EXTRA_DIST = template.3 -man_MANS = libssh2_channel_forward_accept.3 libssh2_session_init.3 \ -libssh2_channel_forward_listen_ex.3 libssh2_session_startup.3 \ -libssh2_channel_read_ex.3 libssh2_sftp_init.3 libssh2_channel_readnb_ex.3 \ -libssh2_sftp_open_ex.3 libssh2_channel_set_blocking.3 libssh2_session_free.3 +man_MANS = libssh2_channel_forward_accept.3 libssh2_session_init.3 \ + libssh2_channel_forward_listen_ex.3 libssh2_session_startup.3 \ + libssh2_channel_read_ex.3 libssh2_sftp_init.3 \ + libssh2_channel_readnb_ex.3 libssh2_sftp_open_ex.3 \ + libssh2_channel_set_blocking.3 libssh2_session_free.3 libssh2_poll.3 \ + libssh2_poll_channel_read.3 libssh2_sftp_read.3 libssh2_sftp_readnb.3 diff --git a/docs/libssh2_channel_read_ex.3 b/docs/libssh2_channel_read_ex.3 index d33bf481..2c12bbd4 100644 --- a/docs/libssh2_channel_read_ex.3 +++ b/docs/libssh2_channel_read_ex.3 @@ -1,4 +1,4 @@ -.\" $Id: libssh2_channel_read_ex.3,v 1.4 2007/02/02 16:11:55 bagder Exp $ +.\" $Id: libssh2_channel_read_ex.3,v 1.5 2007/02/23 10:20:56 bagder Exp $ .\" .TH libssh2_channel_read_ex 3 "14 Dec 2006" "libssh2 0.15" "libssh2 manual" .SH NAME @@ -33,4 +33,4 @@ macros. .SH RETURN VALUE Actual number of bytes read or negative on failure. .SH "SEE ALSO" - +.BR libssh2_poll_channel_read(3) diff --git a/docs/libssh2_channel_readnb_ex.3 b/docs/libssh2_channel_readnb_ex.3 index f06ea284..ec2b8395 100644 --- a/docs/libssh2_channel_readnb_ex.3 +++ b/docs/libssh2_channel_readnb_ex.3 @@ -1,4 +1,4 @@ -.\" $Id: libssh2_channel_readnb_ex.3,v 1.1 2007/02/02 16:09:12 bagder Exp $ +.\" $Id: libssh2_channel_readnb_ex.3,v 1.2 2007/02/23 10:20:56 bagder Exp $ .\" .TH libssh2_channel_read_ex 3 "14 Dec 2006" "libssh2 0.15" "libssh2 manual" .SH NAME @@ -35,3 +35,5 @@ Actual number of bytes read or negative on failure. It returns LIBSSH2CHANNEL_EAGAIN when it would otherwise block. While LIBSSH2CHANNEL_EAGAIN is a negative number, it isn't really a failure per se. .SH "SEE ALSO" +.BR libssh2_poll_channel_read(3) + diff --git a/docs/libssh2_channel_write_ex.3 b/docs/libssh2_channel_write_ex.3 new file mode 100644 index 00000000..f2b0cdc9 --- /dev/null +++ b/docs/libssh2_channel_write_ex.3 @@ -0,0 +1,37 @@ +.\" $Id: libssh2_channel_write_ex.3,v 1.1 2007/02/23 10:20:56 bagder Exp $ +.\" +.TH libssh2_channel_write_ex 3 "6 Feb 2007" "libssh2 0.15" "libssh2 manual" +.SH NAME +libssh2_channel_write_ex - write data to a channel stream blocking +.SH SYNOPSIS +#include + +int libssh2_channel_write_ex(LIBSSH2_CHANNEL *channel, int stream_id, + char *buf, size_t buflen); + +int libssh2_channel_write(LIBSSH2_CHANNEL *channel, char *buf, + size_t buflen); + +int libssh2_channel_write_stderr(LIBSSH2_CHANNEL *channel, char *buf, + size_t buflen); +.SH DESCRIPTION +Write data to a channel stream. All channel streams have one standard I/O +substream (stream_id == 0), and may have up to 2^32 extended data streams as +identified by the selected \fIstream_id\fP. The SSH2 protocol currently +defines a stream ID of 1 to be the stderr substream. + +\fIchannel\fP - active channel stream to write to. + +\fIstream_id\fP - substream ID number (e.g. 0 or SSH_EXTENDED_DATA_STDERR) + +\fIbuf\fP - pointer to buffer to write + +\fIbuflen\fP - size of the data to write + +\fIlibssh2_channel_write(3)\fP and \fIlibssh2_channel_write_stderr(3)\fP are +macros. +.SH RETURN VALUE +Actual number of bytes written or negative on failure. +.SH "SEE ALSO" +.BR libssh2_channel_open_session(3) +.BR libssh2_channel_read(3) diff --git a/docs/libssh2_poll.3 b/docs/libssh2_poll.3 new file mode 100644 index 00000000..3f6e3de8 --- /dev/null +++ b/docs/libssh2_poll.3 @@ -0,0 +1,19 @@ +.\" $Id: libssh2_poll.3,v 1.1 2007/02/23 10:20:56 bagder Exp $ +.\" +.TH libssh2_poll 3 "14 Dec 2006" "libssh2 0.15" "libssh2 manual" +.SH NAME +libssh2_poll - poll for activity on a socket, channel or listener +.SH SYNOPSIS +#include + +int libssh2_poll(LIBSSH2_POLLFD *fds, unsigned int nfds, long timeout); +.SH DESCRIPTION +Poll for activity on a socket, channel, listener, or any combination of these +three types. The calling semantics for this function generally match +\fIpoll(2)\fP however the structure of fds is somewhat more complex in order +to accomodate the disparate datatypes, POLLFD constants have been namespaced +to avoid platform discrepencies, and revents has additional values defined. +.SH "RETURN VALUE" +Number of fds with interresting events. +.SH "SEE ALSO" +.BR libssh2_poll_channel_read(3) diff --git a/docs/libssh2_poll_channel_read.3 b/docs/libssh2_poll_channel_read.3 new file mode 100644 index 00000000..c7098343 --- /dev/null +++ b/docs/libssh2_poll_channel_read.3 @@ -0,0 +1,18 @@ +.\" $Id: libssh2_poll_channel_read.3,v 1.1 2007/02/23 10:20:56 bagder Exp $ +.\" +.TH libssh2_poll_channel_read 3 "14 Dec 2006" "libssh2 0.15" "libssh2 manual" +.SH NAME +libssh2_poll_channel_read - check if data is available +.SH SYNOPSIS +#include + +int libssh2_poll_channel_read(LIBSSH2_CHANNEL *channel, int extended); +.SH DESCRIPTION +\fIlibssh2_poll_channel_read(3)\fP checks to see if data is available in the +\fIchannel\fP's read buffer. No attempt is made with this method to see if +packets are available to be processed. For full polling support, use +\fIlibssh2_poll(3)\fP. +.SH RETURN VALUE +Returns 1 when data is available and 0 otherwise. +.SH "SEE ALSO" +.BR libssh2_poll(3) diff --git a/docs/libssh2_sftp_read.3 b/docs/libssh2_sftp_read.3 new file mode 100644 index 00000000..782c14a9 --- /dev/null +++ b/docs/libssh2_sftp_read.3 @@ -0,0 +1,26 @@ +.\" $Id: libssh2_sftp_read.3,v 1.1 2007/02/23 10:20:56 bagder Exp $ +.\" +.TH libssh2_sftp_read 3 "6 Feb 2007" "libssh2 0.15" "libssh2 manual" +.SH NAME +libssh2_sftp_read - read data from an SFTP handle +.SH SYNOPSIS +#include + +ssize_t libssh2_sftp_read(LIBSSH2_SFTP_HANDLE *handle, + char *buffer, size_t buffer_maxlen); +.SH DESCRIPTION +Reads a block of data from an LIBSSH2_SFTP_HANDLE. This method is modeled +after the POSIX \Iread(3)\fP function and uses the same calling +semantics. \fIlibssh2_sftp_read(3)\fP will attempt to read as much as possible +however it may not fill all of buffer if the file pointer reaches the end or +if further reads would cause the socket to block. + +\fIhandle\fP is the SFTP File Handle as returned by \fIlibssh2_sftp_open(3)\fP. + +\fIbuffer\fP is a pointer to a pre-allocated buffer of at least +\fIbuffer_maxlen\fP bytes to read data into. +.SH RETURN VALUE +Number of bytes actually populated into buffer, or -1 on failure. +.SH "SEE ALSO" +.BR libssh2_sftp_open(3) +.BR libssh2_sftp_readnb(3) diff --git a/docs/libssh2_sftp_readnb.3 b/docs/libssh2_sftp_readnb.3 new file mode 100644 index 00000000..1b475959 --- /dev/null +++ b/docs/libssh2_sftp_readnb.3 @@ -0,0 +1,28 @@ +.\" $Id: libssh2_sftp_readnb.3,v 1.1 2007/02/23 10:20:56 bagder Exp $ +.\" +.TH libssh2_sftp_read 3 "6 Feb 2007" "libssh2 0.15" "libssh2 manual" +.SH NAME +libssh2_sftp_readnb - read data from an SFTP handle non-blocking +.SH SYNOPSIS +#include + +ssize_t libssh2_sftp_readnb(LIBSSH2_SFTP_HANDLE *handle, + char *buffer, size_t buffer_maxlen); +.SH DESCRIPTION +Reads a block of data from an LIBSSH2_SFTP_HANDLE non-blocking. This method is +modeled after the POSIX \Iread(3)\fP function and uses the same calling +semantics. \fIlibssh2_sftp_read(3)\fP will attempt to read as much as possible +however it may not fill all of buffer if the file pointer reaches the end or +if further reads would cause the socket to block. + +\fIhandle\fP is the SFTP File Handle as returned by \fIlibssh2_sftp_open(3)\fP. + +\fIbuffer\fP is a pointer to a pre-allocated buffer of at least +\fIbuffer_maxlen\fP bytes to read data into. +.SH RETURN VALUE +Number of bytes actually populated into buffer, or negative on failure. It +returns LIBSSH2CHANNEL_EAGAIN when it would otherwise block. While +LIBSSH2CHANNEL_EAGAIN is a negative number, it isn't really a failure per se. +.SH "SEE ALSO" +.BR libssh2_sftp_read(3) +.BR libssh2_sftp_open(3)