diff options
author | Jack Lloyd <[email protected]> | 2017-01-05 18:40:49 -0500 |
---|---|---|
committer | Jack Lloyd <[email protected]> | 2017-01-05 18:40:49 -0500 |
commit | 46a757f3b762b4931f56d091246fb7024886977a (patch) | |
tree | 3523a638d1a590932844b626443f52f47fd58cd8 /src/lib | |
parent | c1d47622ae157ef353e4fe9b7849246516678b9d (diff) | |
parent | bb935199499b96f4a544bedc3f5367039e947e81 (diff) |
Merge GH #803 Add botan_ffi_supports_version func
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/ffi/ffi.cpp | 11 | ||||
-rw-r--r-- | src/lib/ffi/ffi.h | 6 |
2 files changed, 17 insertions, 0 deletions
diff --git a/src/lib/ffi/ffi.cpp b/src/lib/ffi/ffi.cpp index 4727c0763..5c4cba4e7 100644 --- a/src/lib/ffi/ffi.cpp +++ b/src/lib/ffi/ffi.cpp @@ -208,6 +208,17 @@ uint32_t botan_ffi_api_version() return BOTAN_HAS_FFI; } +int botan_ffi_supports_api(uint32_t api_version) + { + /* + * In the future if multiple versions are supported, this + * function would accept any of them. + */ + if(api_version == BOTAN_HAS_FFI) + return 0; + return -1; + } + const char* botan_version_string() { return Botan::version_cstr(); diff --git a/src/lib/ffi/ffi.h b/src/lib/ffi/ffi.h index ed1b55a56..3378e0dcd 100644 --- a/src/lib/ffi/ffi.h +++ b/src/lib/ffi/ffi.h @@ -66,6 +66,12 @@ how to provide the cleanest API for such users would be most welcome. */ BOTAN_DLL uint32_t botan_ffi_api_version(); +/* +* Return 0 (ok) if the version given is one this library supports. +* botan_ffi_supports_api(botan_ffi_api_version()) will always return 0. +*/ +BOTAN_DLL int botan_ffi_supports_api(uint32_t api_version); + BOTAN_DLL const char* botan_version_string(); BOTAN_DLL uint32_t botan_version_major(); BOTAN_DLL uint32_t botan_version_minor(); |