From a46fc692413dfe66c48c85c24df685069fb97d5a Mon Sep 17 00:00:00 2001 From: Natalia Portillo Date: Wed, 13 Oct 2021 03:50:10 +0100 Subject: [PATCH] Add version checking function. --- CMakeLists.txt | 2 +- library.c | 23 +++++++++++++++++++++++ library.h | 4 ++++ 3 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 library.c diff --git a/CMakeLists.txt b/CMakeLists.txt index eb361a5..bf53249 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -54,6 +54,6 @@ if("${CMAKE_BUILD_TYPE}" MATCHES "Release") endif() endif() -add_library("Aaru.Checksums.Native" SHARED adler32.h adler32.c crc16.h crc16.c crc16_ccitt.h crc16_ccitt.c crc32.c crc32.h crc64.c crc64.h fletcher16.h fletcher16.c fletcher32.h fletcher32.c library.h spamsum.c spamsum.h crc32_clmul.c crc64_clmul.c simd.c simd.h adler32_ssse3.c adler32_avx2.c adler32_neon.c crc32_arm_simd.c crc32_vmull.c crc32_simd.h arm_vmull.c arm_vmull.h crc64_vmull.c) +add_library("Aaru.Checksums.Native" SHARED adler32.h adler32.c crc16.h crc16.c crc16_ccitt.h crc16_ccitt.c crc32.c crc32.h crc64.c crc64.h fletcher16.h fletcher16.c fletcher32.h fletcher32.c library.h spamsum.c spamsum.h crc32_clmul.c crc64_clmul.c simd.c simd.h adler32_ssse3.c adler32_avx2.c adler32_neon.c crc32_arm_simd.c crc32_vmull.c crc32_simd.h arm_vmull.c arm_vmull.h crc64_vmull.c library.c) add_subdirectory(tests) diff --git a/library.c b/library.c new file mode 100644 index 0000000..09f8006 --- /dev/null +++ b/library.c @@ -0,0 +1,23 @@ +/* + * This file is part of the Aaru Data Preservation Suite. + * Copyright (c) 2019-2021 Natalia Portillo. + * + * This library is free software; you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as + * published by the Free Software Foundation; either version 2.1 of the + * License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, see . + */ + +#include + +#include "library.h" + +AARU_EXPORT uint64_t AARU_CALL get_acn_version() { return AARU_CHECKUMS_NATIVE_VERSION; } \ No newline at end of file diff --git a/library.h b/library.h index d77a770..f7e52e8 100644 --- a/library.h +++ b/library.h @@ -56,4 +56,8 @@ #include "simd.h" +#define AARU_CHECKUMS_NATIVE_VERSION 0x06000086 + +AARU_EXPORT uint64_t AARU_CALL get_acn_version(); + #endif // AARU_CHECKSUMS_NATIVE_LIBRARY_H