diff options
author | Andreas Schneider <asn@cryptomilk.org> | 2013-07-14 12:03:54 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2013-07-14 12:37:12 +0200 |
commit | a73557053e7a75f9cbb0840421ac3c386cc05321 (patch) | |
tree | 29f79f8b5f7657dc14a7dd2b30dc1b5d95f9ac6c | |
parent | 2c91efcc68d9a6aff9163e81df7a5024703084d4 (diff) | |
download | libssh-a73557053e7a75f9cbb0840421ac3c386cc05321.tar.gz libssh-a73557053e7a75f9cbb0840421ac3c386cc05321.tar.xz libssh-a73557053e7a75f9cbb0840421ac3c386cc05321.zip |
doc: Document public functions.
-rw-r--r-- | src/log.c | 32 |
1 files changed, 28 insertions, 4 deletions
@@ -168,39 +168,63 @@ void ssh_log_common(struct ssh_common_struct *common, /* PUBLIC */ +/** + * @brief Set the log level of the library. + * + * @param[in] level The level to set. + * + * @return SSH_OK on success, SSH_ERROR on error. + */ int ssh_set_log_level(int level) { if (level < 0) { - return -1; + return SSH_ERROR; } ssh_log_level = level; - return 0; + return SSH_OK; } +/** + * @brief Get the log level of the library. + * + * @return The value of the log level. + */ int ssh_get_log_level(void) { return ssh_log_level; } int ssh_set_log_callback(ssh_logging_callback cb) { if (cb == NULL) { - return -1; + return SSH_ERROR; } ssh_log_cb = cb; - return 0; + return SSH_OK; } ssh_logging_callback ssh_get_log_callback(void) { return ssh_log_cb; } +/** + * @brief Get the userdata of the logging function. + * + * @return The userdata if set or NULL. + */ void *ssh_get_log_userdata(void) { return ssh_log_userdata; } +/** + * @brief Set the userdata for the logging function. + * + * @param[in] data The userdata to set. + * + * @return SSH_OK on success. + */ int ssh_set_log_userdata(void *data) { ssh_log_userdata = data; |