mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-11-30 13:01:23 +03:00
doc: Improve the doc of ssh_bind_set_callbacks.
This commit is contained in:
@@ -157,6 +157,26 @@ LIBSSH_API int ssh_bind_options_set(ssh_bind sshbind,
|
||||
*/
|
||||
LIBSSH_API int ssh_bind_listen(ssh_bind ssh_bind_o);
|
||||
|
||||
/**
|
||||
* @brief Set the callback for this bind.
|
||||
*
|
||||
* @param[in] sshbind The bind to set the callback on.
|
||||
*
|
||||
* @param[in] callbacks An already set up ssh_bind_callbacks instance.
|
||||
*
|
||||
* @param[in] userdata A pointer to private data to pass to the callbacks.
|
||||
*
|
||||
* @return SSH_OK on success, SSH_ERROR if an error occured.
|
||||
*
|
||||
* @code
|
||||
* struct ssh_callbacks_struct cb = {
|
||||
* .userdata = data,
|
||||
* .auth_function = my_auth_function
|
||||
* };
|
||||
* ssh_callbacks_init(&cb);
|
||||
* ssh_bind_set_callbacks(session, &cb);
|
||||
* @endcode
|
||||
*/
|
||||
LIBSSH_API int ssh_bind_set_callbacks(ssh_bind sshbind, ssh_bind_callbacks callbacks,
|
||||
void *userdata);
|
||||
|
||||
|
||||
19
src/bind.c
19
src/bind.c
@@ -186,25 +186,6 @@ int ssh_bind_listen(ssh_bind sshbind) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief set the bind callbacks for ssh_bind
|
||||
* @code
|
||||
* struct ssh_callbacks_struct cb = {
|
||||
* .userdata = data,
|
||||
* .auth_function = my_auth_function
|
||||
* };
|
||||
* ssh_callbacks_init(&cb);
|
||||
* ssh_set_callbacks(session, &cb);
|
||||
* @endcode
|
||||
* @param sshbind the ssh_bind structure to set
|
||||
* @param callbacks a ssh_bind_callbacks instance already set up. Do
|
||||
* use ssh_callbacks_init() to initialize it.
|
||||
* @param userdata userdata to be used with each callback called
|
||||
* within callbacks.
|
||||
* @returns SSH_OK on success,
|
||||
* SSH_ERROR on error.
|
||||
*/
|
||||
|
||||
int ssh_bind_set_callbacks(ssh_bind sshbind, ssh_bind_callbacks callbacks,
|
||||
void *userdata){
|
||||
if (sshbind == NULL) {
|
||||
|
||||
Reference in New Issue
Block a user