aboutsummaryrefslogtreecommitdiff
path: root/libssh/init.c
diff options
context:
space:
mode:
authorAris Adamantiadis <aris@0xbadc0de.be>2009-06-15 15:31:23 +0000
committerAris Adamantiadis <aris@0xbadc0de.be>2009-06-15 15:31:23 +0000
commit7dbc66e4a389b5d7cd075f73559415aaa0e555df (patch)
tree1aa963a15d00af7ac9fd64cb42d823be1366bed0 /libssh/init.c
parent387348968842dce1fd5da139fc858866c10830e2 (diff)
downloadlibssh-7dbc66e4a389b5d7cd075f73559415aaa0e555df.tar.gz
libssh-7dbc66e4a389b5d7cd075f73559415aaa0e555df.tar.xz
libssh-7dbc66e4a389b5d7cd075f73559415aaa0e555df.zip
ssh_init()
fixes in client.c and server.c for this git-svn-id: svn+ssh://svn.berlios.de/svnroot/repos/libssh/trunk@778 7dcaeef0-15fb-0310-b436-a5af3365683c
Diffstat (limited to 'libssh/init.c')
-rw-r--r--libssh/init.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/libssh/init.c b/libssh/init.c
index b6c99443..8d2ae032 100644
--- a/libssh/init.c
+++ b/libssh/init.c
@@ -32,11 +32,28 @@
*/
/**
+ * @brief initialize global cryptographic data structures.
+ *
+ * This function should only be called once, at the begining of the program, in the main thread. It may be omitted if your program is not multithreaded.
+ *
+ * @returns 0
+ */
+int ssh_init(void) {
+ if(ssh_crypto_init())
+ return -1;
+ if(ssh_socket_init())
+ return -1;
+ return 0;
+}
+
+
+/**
* @brief Finalize and cleanup all libssh and cryptographic data structures.
*
* This function should only be called once, at the end of the program!
*
- * @returns 0
+ * @returns -1 in case of error
+ @returns 0 otherwise
*/
int ssh_finalize(void) {
ssh_crypto_finalize();