aboutsummaryrefslogtreecommitdiff
path: root/libssh
diff options
context:
space:
mode:
authorAndreas Schneider <mail@cynapses.org>2009-09-22 12:27:28 +0200
committerAndreas Schneider <mail@cynapses.org>2009-09-22 12:28:07 +0200
commit7de3122b423487c3f2127f0b0a44ed7c6735fbff (patch)
tree8b38f2a833e09789f4795c3aed6aba6a0a88af5a /libssh
parent88f4e9ea24257bfdce511272a65a8d0f7eab8b35 (diff)
downloadlibssh-7de3122b423487c3f2127f0b0a44ed7c6735fbff.tar.gz
libssh-7de3122b423487c3f2127f0b0a44ed7c6735fbff.tar.xz
libssh-7de3122b423487c3f2127f0b0a44ed7c6735fbff.zip
Added a userdata generic pointer to the log callback function.
Diffstat (limited to 'libssh')
-rw-r--r--libssh/log.c3
-rw-r--r--libssh/options.c9
2 files changed, 7 insertions, 5 deletions
diff --git a/libssh/log.c b/libssh/log.c
index b2f5f415..4a3b275b 100644
--- a/libssh/log.c
+++ b/libssh/log.c
@@ -56,7 +56,8 @@ void ssh_log(SSH_SESSION *session, int verbosity, const char *format, ...) {
va_end(va);
if (session->options->log_function) {
- session->options->log_function(buffer, session, verbosity);
+ session->options->log_function(session, verbosity, buffer,
+ session->options->log_userdata);
} else if (verbosity == SSH_LOG_FUNCTIONS) {
if (session->log_indent > 255) {
min = 255;
diff --git a/libssh/options.c b/libssh/options.c
index 755ef505..0fa3e895 100644
--- a/libssh/options.c
+++ b/libssh/options.c
@@ -762,13 +762,14 @@ int ssh_options_allow_ssh2(SSH_OPTIONS *opt, int allow) {
*
* @warning The message string may contain format string characters.
*/
-int ssh_options_set_log_function(SSH_OPTIONS *opt,
- void (*callback)(const char *message, SSH_SESSION *session, int priority)) {
- if (opt == NULL || callback == NULL) {
+int ssh_options_set_log_function(SSH_OPTIONS *opt, ssh_log_callback cb,
+ void *userdata) {
+ if (opt == NULL || cb == NULL) {
return -1;
}
- opt->log_function = callback;
+ opt->log_function = cb;
+ opt->log_userdata = userdata;
return 0;
}