summaryrefslogtreecommitdiffstats
path: root/libssh/error.c
diff options
context:
space:
mode:
authorAris Adamantiadis <aris@0xbadc0de.be>2009-10-05 10:01:24 +0200
committerAris Adamantiadis <aris@0xbadc0de.be>2009-10-05 10:01:24 +0200
commit40778d4ba94ab5bfbe71bd3a304d6664c9a02560 (patch)
tree5864e2c4bda6c2d1782ef0ba765a40fcd8b8e8c5 /libssh/error.c
parenta3a7f17d0f971edce873970863cfe660b21d8f57 (diff)
parent60d6954b7560df62634b305fec65dffbc98ff0b8 (diff)
downloadlibssh-40778d4ba94ab5bfbe71bd3a304d6664c9a02560.tar.gz
libssh-40778d4ba94ab5bfbe71bd3a304d6664c9a02560.tar.xz
libssh-40778d4ba94ab5bfbe71bd3a304d6664c9a02560.zip
Merge branch 'master' of git://git.libssh.org/projects/libssh/libssh
Diffstat (limited to 'libssh/error.c')
-rw-r--r--libssh/error.c31
1 files changed, 30 insertions, 1 deletions
diff --git a/libssh/error.c b/libssh/error.c
index 392e7414..aa373e38 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 invalid argument 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.