emile: implement emile_cipher_module_get in a useful way.

This commit is contained in:
Cedric BAIL 2015-03-17 08:50:40 +01:00
parent f4c5b3fd70
commit df20c9ff8e
2 changed files with 29 additions and 1 deletions

View File

@ -9,6 +9,20 @@
* @{
*/
/**
* @typedef Emile_Cipher_Backend
*
* Flags describing the implemented backend.
*
* @since 1.14.0
*/
typedef enum _Emile_Cipher_Backend
{
EMILE_NONE,
EMILE_OPENSSL,
EMILE_GNUTLS
} Emile_Cipher_Backend;
/**
* @typedef Emile_Cipher_Algorithm
*
@ -39,7 +53,7 @@ EAPI Eina_Bool emile_cipher_init(void);
* @return the name of the current cipher backend.
* @since 1.14.0
*/
EAPI const char *emile_cipher_module_get(void);
EAPI Emile_Cipher_Backend emile_cipher_module_get(void);
/**
* Cipher a buffer with a defined algorithm and key.

View File

@ -35,6 +35,20 @@ emile_cipher_init(void)
return EINA_TRUE;
}
EAPI Emile_Cipher_Backend
emile_cipher_module_get(void)
{
#ifdef HAVE_GNUTLS
return EMILE_GNUTLS;
#else
#ifdef HAVE_OPENSSL
return EMILE_OPENSSL;
#else
return EMILE_NONE;
#endif
#endif
}
EAPI int
emile_init(void)
{