Shorten constant a bit. More documentation.
Этот коммит содержится в:
родитель
d00283927f
Коммит
55ede3b41b
@ -370,14 +370,18 @@ typedef struct _LIBSSH2_POLLFD {
|
|||||||
#define LIBSSH2_ERROR_AGENT_PROTOCOL -42
|
#define LIBSSH2_ERROR_AGENT_PROTOCOL -42
|
||||||
|
|
||||||
/* Global API */
|
/* Global API */
|
||||||
#define LIBSSH2_INIT_NO_CRYPTO_INIT 0x0001
|
#define LIBSSH2_INIT_NO_CRYPTO 0x0001
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* libssh2_init()
|
* 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
|
* 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
|
* OPENSSL_add_cipher_algoritms() for OpenSSL
|
||||||
*
|
*
|
||||||
* Returns 0 if succeeded, or a negative value for error.
|
* Returns 0 if succeeded, or a negative value for error.
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
/* Copyright (c) 2010 Lars Nordin <Lars.Nordin@SDlabs.se>
|
/* Copyright (c) 2010 Lars Nordin <Lars.Nordin@SDlabs.se>
|
||||||
|
* Copyright (C) 2010 Simon Josefsson <simon@josefsson.org>
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms,
|
* 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)
|
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();
|
libssh2_crypto_init();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -59,7 +60,7 @@ LIBSSH2_API void libssh2_exit()
|
|||||||
|
|
||||||
libssh2_initialized--;
|
libssh2_initialized--;
|
||||||
|
|
||||||
if (!(libssh2_init_flags & LIBSSH2_INIT_NO_CRYPTO_INIT)) {
|
if (!(libssh2_init_flags & LIBSSH2_INIT_NO_CRYPTO)) {
|
||||||
libssh2_crypto_exit();
|
libssh2_crypto_exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user