From 4dee9a3e68853b71490ca0c208808a238119d511 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Sat, 10 Oct 2009 19:59:14 +0200 Subject: Document the function to set the callbacks and provide an example. --- include/libssh/callbacks.h | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) 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 -- cgit