diff options
Diffstat (limited to 'libssh/error.c')
-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. |