Shorten constant a bit. More documentation.

This commit is contained in:
Simon Josefsson 2010-03-19 09:17:42 +01:00
parent d00283927f
commit 55ede3b41b
2 changed files with 10 additions and 5 deletions

View File

@ -370,14 +370,18 @@ typedef struct _LIBSSH2_POLLFD {
#define LIBSSH2_ERROR_AGENT_PROTOCOL -42
/* Global API */
#define LIBSSH2_INIT_NO_CRYPTO_INIT 0x0001
#define LIBSSH2_INIT_NO_CRYPTO 0x0001
/*
* libssh2_init()
*
* Initialize the libssh2 functions. flags can be:
* Initialize the libssh2 functions. This typically initialize the
* crypto library. It uses a global state, and is not thread safe --
* you must make sure this function is not called concurrently.
*
* Flags can be:
* 0: Normal initialize
* LIBSSH2_INIT_NO_CRYPTO_INIT: Do not initialize the crypto library (ie.
* LIBSSH2_INIT_NO_CRYPTO: Do not initialize the crypto library (ie.
* OPENSSL_add_cipher_algoritms() for OpenSSL
*
* Returns 0 if succeeded, or a negative value for error.

View File

@ -1,4 +1,5 @@
/* Copyright (c) 2010 Lars Nordin <Lars.Nordin@SDlabs.se>
* Copyright (C) 2010 Simon Josefsson <simon@josefsson.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms,
@ -42,7 +43,7 @@ static int _libssh2_init_flags = 0;
LIBSSH2_API int libssh2_init(int flags)
{
if (libssh2_initialized == 0 && !(flags & LIBSSH2_INIT_NO_CRYPTO_INIT)) {
if (libssh2_initialized == 0 && !(flags & LIBSSH2_INIT_NO_CRYPTO)) {
libssh2_crypto_init();
}
@ -59,7 +60,7 @@ LIBSSH2_API void libssh2_exit()
libssh2_initialized--;
if (!(libssh2_init_flags & LIBSSH2_INIT_NO_CRYPTO_INIT)) {
if (!(libssh2_init_flags & LIBSSH2_INIT_NO_CRYPTO)) {
libssh2_crypto_exit();
}