diff --git a/CMakeLists.txt b/CMakeLists.txt index f4a1914..a39d4fd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -88,7 +88,7 @@ endif() add_subdirectory(3rdparty) -add_library("Aaru.Compression.Native" SHARED library.c apple_rle.c apple_rle.h adc.c adc.h lzip.c lzip.h flac.c flac.h) +add_library("Aaru.Compression.Native" SHARED library.c apple_rle.c apple_rle.h adc.c adc.h lzip.c flac.c flac.h) MACRO(TARGET_LINK_LIBRARIES_WHOLE_ARCHIVE target) if("${CMAKE_C_COMPILER_ID}" MATCHES "MSVC") diff --git a/adc.h b/adc.h index ef1e632..2e10efd 100644 --- a/adc.h +++ b/adc.h @@ -9,9 +9,4 @@ #define ADC_TWO_BYTE 2 #define ADC_THREE_BYTE 3 -AARU_EXPORT int32_t AARU_CALL adc_decode_buffer(uint8_t* dst_buffer, - int32_t dst_size, - const uint8_t* src_buffer, - int32_t src_size); - #endif // AARU_COMPRESSION_NATIVE__ADC_H_ diff --git a/apple_rle.c b/apple_rle.c index 5a08dbf..5fc55f4 100644 --- a/apple_rle.c +++ b/apple_rle.c @@ -18,6 +18,7 @@ */ #include +#include #include #include "library.h" diff --git a/apple_rle.h b/apple_rle.h index f862dad..6b1733a 100644 --- a/apple_rle.h +++ b/apple_rle.h @@ -21,9 +21,4 @@ #define DART_CHUNK 20960 -AARU_EXPORT int32_t AARU_CALL apple_rle_decode_buffer(uint8_t* dst_buffer, - int32_t dst_size, - const uint8_t* src_buffer, - int32_t src_size); - #endif // AARU_CHECKSUMS_NATIVE__APPLE_RLE_H_ diff --git a/flac.h b/flac.h index 29cb4f0..a8d25c4 100644 --- a/flac.h +++ b/flac.h @@ -16,25 +16,4 @@ typedef struct uint8_t error; } aaru_flac_ctx; -AARU_EXPORT size_t AARU_CALL flac_decode_redbook_buffer(uint8_t* dst_buffer, - size_t dst_size, - const uint8_t* src_buffer, - size_t src_size); - -AARU_EXPORT size_t AARU_CALL flac_encode_redbook_buffer(uint8_t* dst_buffer, - size_t dst_size, - const uint8_t* src_buffer, - size_t src_size, - uint32_t blocksize, - int32_t do_mid_side_stereo, - int32_t loose_mid_side_stereo, - const char* apodization, - uint32_t qlp_coeff_precision, - int32_t do_qlp_coeff_prec_search, - int32_t do_exhaustive_model_search, - uint32_t min_residual_partition_order, - uint32_t max_residual_partition_order, - const char* application_id, - uint32_t application_id_len); - #endif // AARU_COMPRESSION_NATIVE__FLAC_H_ diff --git a/library.c b/library.c index ab0a059..556f0a0 100644 --- a/library.c +++ b/library.c @@ -16,6 +16,8 @@ * License along with this library; if not, see . */ +#include +#include #include #include "library.h" diff --git a/library.h b/library.h index f747260..a962a79 100644 --- a/library.h +++ b/library.h @@ -54,4 +54,47 @@ #define FORCE_INLINE static inline __attribute__((always_inline)) #endif +AARU_EXPORT int32_t AARU_CALL adc_decode_buffer(uint8_t* dst_buffer, + int32_t dst_size, + const uint8_t* src_buffer, + int32_t src_size); + +AARU_EXPORT int32_t AARU_CALL apple_rle_decode_buffer(uint8_t* dst_buffer, + int32_t dst_size, + const uint8_t* src_buffer, + int32_t src_size); + +AARU_EXPORT size_t AARU_CALL flac_decode_redbook_buffer(uint8_t* dst_buffer, + size_t dst_size, + const uint8_t* src_buffer, + size_t src_size); + +AARU_EXPORT size_t AARU_CALL flac_encode_redbook_buffer(uint8_t* dst_buffer, + size_t dst_size, + const uint8_t* src_buffer, + size_t src_size, + uint32_t blocksize, + int32_t do_mid_side_stereo, + int32_t loose_mid_side_stereo, + const char* apodization, + uint32_t qlp_coeff_precision, + int32_t do_qlp_coeff_prec_search, + int32_t do_exhaustive_model_search, + uint32_t min_residual_partition_order, + uint32_t max_residual_partition_order, + const char* application_id, + uint32_t application_id_len); + +AARU_EXPORT int32_t AARU_CALL lzip_decode_buffer(uint8_t* dst_buffer, + int32_t dst_size, + const uint8_t* src_buffer, + int32_t src_size); + +AARU_EXPORT int32_t AARU_CALL lzip_encode_buffer(uint8_t* dst_buffer, + int32_t dst_size, + const uint8_t* src_buffer, + int32_t src_size, + int32_t dictionary_size, + int32_t match_len_limit); + #endif // AARU_COMPRESSION_NATIVE_LIBRARY_H diff --git a/lzip.c b/lzip.c index aeb39ee..b8b0d92 100644 --- a/lzip.c +++ b/lzip.c @@ -17,11 +17,11 @@ * License along with this library; if not, see . */ +#include #include #include "library.h" #include "3rdparty/lzlib-1.12/lzlib.h" -#include "lzip.h" AARU_EXPORT int32_t AARU_CALL lzip_decode_buffer(uint8_t* dst_buffer, int32_t dst_size, diff --git a/lzip.h b/lzip.h deleted file mode 100644 index 76aad1d..0000000 --- a/lzip.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - * 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 . - */ - -#ifndef AARU_CHECKSUMS_NATIVE__LZIP_H_ -#define AARU_CHECKSUMS_NATIVE__LZIP_H_ - -AARU_EXPORT int32_t AARU_CALL lzip_decode_buffer(uint8_t* dst_buffer, - int32_t dst_size, - const uint8_t* src_buffer, - int32_t src_size); - -AARU_EXPORT int32_t AARU_CALL lzip_encode_buffer(uint8_t* dst_buffer, - int32_t dst_size, - const uint8_t* src_buffer, - int32_t src_size, - int32_t dictionary_size, - int32_t match_len_limit); -#endif // AARU_CHECKSUMS_NATIVE__LZIP_H_