aboutsummaryrefslogtreecommitdiff
path: root/libssh/connect.c
diff options
context:
space:
mode:
authorAris Adamantiadis <aris@0xbadc0de.be>2006-11-07 01:45:13 +0000
committerAris Adamantiadis <aris@0xbadc0de.be>2006-11-07 01:45:13 +0000
commitd101fb4329f4313f1b930e9876166df3304e672a (patch)
tree25189df8f32687ace3681e7fdc20f778758649c4 /libssh/connect.c
parent24aeed5d1f40291c0c33a34403b212434e8f4e85 (diff)
downloadlibssh-d101fb4329f4313f1b930e9876166df3304e672a.tar.gz
libssh-d101fb4329f4313f1b930e9876166df3304e672a.tar.xz
libssh-d101fb4329f4313f1b930e9876166df3304e672a.zip
more doxygen documentation
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@79 7dcaeef0-15fb-0310-b436-a5af3365683c
Diffstat (limited to 'libssh/connect.c')
-rw-r--r--libssh/connect.c29
1 files changed, 26 insertions, 3 deletions
diff --git a/libssh/connect.c b/libssh/connect.c
index fefda87..d7962e1 100644
--- a/libssh/connect.c
+++ b/libssh/connect.c
@@ -158,8 +158,16 @@ int ssh_connect_host(SSH_SESSION *session, const char *host, const char
return s;
}
-/* returns 1 if bytes are available to read on the stream, 0 instead */
-/* -1 on select() error. */
+/** \addtogroup ssh_session
+ * * @{ */
+
+/** \internal
+ * \brief polls the stream for activity
+ * \param session ssh session
+ * \param write value pointed to set to 1 if it is possible to write
+ * \param except value pointed to set to 1 if there is an exception
+ * \return 1 if it is possible to read, 0 otherwise, -1 on error
+ */
int ssh_fd_poll(SSH_SESSION *session, int *write, int *except){
struct timeval sometime;
fd_set rdes; // read set
@@ -199,7 +207,20 @@ int ssh_fd_poll(SSH_SESSION *session, int *write, int *except){
return session->data_to_read;
}
-/* this function is a complete wrapper for the select syscall. it does more than wrapping ... */
+
+/** This functions acts more or less like the select(2) syscall.\n
+ * There is no support for writing or exceptions.\n
+ * \brief wrapper for the select syscall
+ * \param channels arrays of channels pointers finished by an NULL. It is never rewritten/
+ * \param outchannels arrays of same size that "channels", it hasn't to be initialized
+ * \param maxfd maximum +1 file descriptor from readfds
+ * \param readfds an fd_set of file descriptors to be select'ed for reading
+ * \param timeout a timeout for the select
+ * \see select(2)
+ * \return -1 if an error occured. E_INTR if it was interrupted. In that case, just restart it.
+ * \warning libssh is not threadsafe. That means that if a signal is caught during the processing
+ * of this function, you cannot call ssh functions on sessions that are busy with ssh_select()
+ */
int ssh_select(CHANNEL **channels,CHANNEL **outchannels, int maxfd, fd_set *readfds, struct timeval *timeout){
struct timeval zerotime;
fd_set localset,localset2;
@@ -283,3 +304,5 @@ int ssh_select(CHANNEL **channels,CHANNEL **outchannels, int maxfd, fd_set *read
memcpy(readfds,&localset2,sizeof(fd_set));
return 0;
}
+
+/** @} */