summaryrefslogtreecommitdiffstats
path: root/libssh/error.c
diff options
context:
space:
mode:
authorAris Adamantiadis <aris@0xbadc0de.be>2005-07-05 21:10:50 +0000
committerAris Adamantiadis <aris@0xbadc0de.be>2005-07-05 21:10:50 +0000
commit55846a4c7b09af2d105c7f7dfd0a43aab2f6e5a5 (patch)
tree14a9b2f68ddbf29eb80e119e85d0bff4627f1d3f /libssh/error.c
parentd40f16d48ec1ed9670c20ffaad1005c59a689484 (diff)
downloadlibssh-55846a4c7b09af2d105c7f7dfd0a43aab2f6e5a5.tar.gz
libssh-55846a4c7b09af2d105c7f7dfd0a43aab2f6e5a5.tar.xz
libssh-55846a4c7b09af2d105c7f7dfd0a43aab2f6e5a5.zip
Beginning of the SSH_BIND implementation
hack for errors handling so it supports an Object-oriented kind of errors (generic for ssh_bind and ssh_session data types) git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@3 7dcaeef0-15fb-0310-b436-a5af3365683c
Diffstat (limited to 'libssh/error.c')
-rw-r--r--libssh/error.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/libssh/error.c b/libssh/error.c
index f3db794..78a7ea1 100644
--- a/libssh/error.c
+++ b/libssh/error.c
@@ -27,20 +27,23 @@ MA 02111-1307, USA. */
static int verbosity;
/* ssh_set_error registers an error with a description. the error code is the class of error, and description is obvious.*/
-void ssh_set_error(SSH_SESSION *session,int code,char *descr,...){
- va_list va;
- va_start(va,descr);
- vsnprintf(session->error_buffer,ERROR_BUFFERLEN,descr,va);
- va_end(va);
- session->error_code=code;
+void ssh_set_error(void *error,int code,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;
}
-char *ssh_get_error(SSH_SESSION *session){
- return session->error_buffer;
+char *ssh_get_error(void *error){
+ struct error_struct *err=error;
+ return err->error_buffer;
}
-int ssh_get_error_code(SSH_SESSION *session){
- return session->error_code;
+int ssh_get_error_code(void *error){
+ struct error_struct *err=error;
+ return err->error_code;
}
void ssh_say(int priority, char *format,...){