aboutsummaryrefslogtreecommitdiff
path: root/include/libssh/callbacks.h
diff options
context:
space:
mode:
authorAndreas Schneider <mail@cynapses.org>2009-10-10 19:59:14 +0200
committerAndreas Schneider <mail@cynapses.org>2009-10-10 19:59:14 +0200
commit4dee9a3e68853b71490ca0c208808a238119d511 (patch)
tree3658511f733f39a1dbf5f1e953fd60687e0e8128 /include/libssh/callbacks.h
parent399041180ffccd613119f2bd41cf7563e675600d (diff)
downloadlibssh-4dee9a3e68853b71490ca0c208808a238119d511.tar.gz
libssh-4dee9a3e68853b71490ca0c208808a238119d511.tar.xz
libssh-4dee9a3e68853b71490ca0c208808a238119d511.zip
Document the function to set the callbacks and provide an example.
Diffstat (limited to 'include/libssh/callbacks.h')
-rw-r--r--include/libssh/callbacks.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/include/libssh/callbacks.h b/include/libssh/callbacks.h
index 1adaaa35..2156f202 100644
--- a/include/libssh/callbacks.h
+++ b/include/libssh/callbacks.h
@@ -82,6 +82,28 @@ typedef struct ssh_callbacks_struct * ssh_callbacks;
(p)->size=sizeof(*(p)); \
} while(0);
+/**
+ * @brief Set the callback functions.
+ *
+ * This functions sets the callback structure to use your own callback
+ * functions for auth, logging and status.
+ *
+ * @code
+ * struct ssh_callbacks_struct cb;
+ *
+ * cb.userdata = data;
+ * cb.auth_function = my_auth_function;
+ *
+ * ssh_callbacks_init(&cb);
+ * ssh_set_callbacks(session, &cb);
+ * @endcode
+ *
+ * @param session The session to set the callback structure.
+ *
+ * @param cb The callback itself.
+ *
+ * @return 0 on success, < 0 on error.
+ */
LIBSSH_API int ssh_set_callbacks(ssh_session session, ssh_callbacks cb);
#ifdef __cplusplus