diff options
author | Andreas Schneider <mail@cynapses.org> | 2009-05-05 07:25:07 +0000 |
---|---|---|
committer | Andreas Schneider <mail@cynapses.org> | 2009-05-05 07:25:07 +0000 |
commit | 4838742a8e4f6893922b5ddf8bb296205b09f55d (patch) | |
tree | 29644849d0517e45811d5844c93c105d0b47e2b1 | |
parent | 8c45767d34af2635507f50f1985e9cce9aed3a06 (diff) | |
download | libssh-4838742a8e4f6893922b5ddf8bb296205b09f55d.tar.gz libssh-4838742a8e4f6893922b5ddf8bb296205b09f55d.tar.xz libssh-4838742a8e4f6893922b5ddf8bb296205b09f55d.zip |
Improve and document ssh_set_error().
git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@719 7dcaeef0-15fb-0310-b436-a5af3365683c
-rw-r--r-- | libssh/error.c | 33 |
1 files changed, 23 insertions, 10 deletions
diff --git a/libssh/error.c b/libssh/error.c index 8503ff85..0999ffb3 100644 --- a/libssh/error.c +++ b/libssh/error.c @@ -27,22 +27,35 @@ #include <stdarg.h> #include "libssh/priv.h" -/** \defgroup ssh_error SSH Errors - * \brief error handling +/** + * @defgroup ssh_error SSH Errors + * + * @brief Functions for error handling. */ -/** \addtogroup ssh_error +/** + * @addtogroup ssh_error * @{ */ -/* ssh_set_error registers an error with a description. the error code is the class of error, and description is obvious.*/ +/** + * @brief Registers an error with a description. + * + * @param error The class of error. + * + * @param code The class of error. + * + * @param descr The description, which can be a format string. + * + * @param ... The arguments for the format string. + */ void ssh_set_error(void *error, int code, const char *descr, ...) { - struct error_struct *err= error; - va_list va; - va_start(va,descr); - vsnprintf(err->error_buffer,ERROR_BUFFERLEN,descr,va); - va_end(va); - err->error_code=code; + struct error_struct *err = error; + va_list va; + va_start(va, descr); + vsnprintf(err->error_buffer, ERROR_BUFFERLEN, descr, va); + va_end(va); + err->error_code = code; } /** \brief retrieve an error text message |