diff options
author | Bernhard R. Link <brlink@debian.org> | 2009-10-04 14:03:25 +0200 |
---|---|---|
committer | Andreas Schneider <mail@cynapses.org> | 2009-10-05 00:02:43 +0200 |
commit | 7c759b961521ecae451b113eaa7531f9c77b0079 (patch) | |
tree | a8e4e3d780d6f4ce6c3e045bb1edb16fa7ea78ef /libssh | |
parent | d54e9550da59465d9a795c885e18199122b57ba5 (diff) | |
download | libssh-7c759b961521ecae451b113eaa7531f9c77b0079.tar.gz libssh-7c759b961521ecae451b113eaa7531f9c77b0079.tar.xz libssh-7c759b961521ecae451b113eaa7531f9c77b0079.zip |
add ssh_set_error_oom and ssh_set_error_invalid
Signed-off-by: Andreas Schneider <mail@cynapses.org>
Diffstat (limited to 'libssh')
-rw-r--r-- | libssh/error.c | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/libssh/error.c b/libssh/error.c index 392e741..f44bf49 100644 --- a/libssh/error.c +++ b/libssh/error.c @@ -41,7 +41,7 @@ * * @brief Registers an error with a description. * - * @param error The class of error. + * @param error The place to store the error. * * @param code The class of error. * @@ -59,6 +59,35 @@ void ssh_set_error(void *error, int code, const char *descr, ...) { } /** + * @internal + * + * @brief Registers an out of memory error + * + * @param error The place to store the error. + * + */ +void ssh_set_error_oom(void *error) { + struct error_struct *err = error; + + strcpy(err->error_buffer, "Out of memory"); + err->error_code = SSH_FATAL; +} + +/** + * @internal + * + * @brief Registers an out of memory error + * + * @param error The place to store the error. + * + * @param function The function the error happened in. + * + */ +void ssh_set_error_invalid(void *error, const char *function) { + ssh_set_error(error, SSH_FATAL, "Invalid argument in %s", function); +} + +/** * @brief Retrieve the error text message from the last error. * * @param error The SSH session pointer. |