Namespace exported symbols.

This commit is contained in:
2021-10-30 21:58:10 +01:00
parent 49f0ea6c33
commit 37e8a8b4c7
9 changed files with 102 additions and 104 deletions

2
adc.c
View File

@@ -37,7 +37,7 @@ FORCE_INLINE int GetOffset(uint8_t chunk[])
}
}
AARU_EXPORT int32_t AARU_CALL adc_decode_buffer(uint8_t* dst_buffer,
AARU_EXPORT int32_t AARU_CALL AARU_adc_decode_buffer(uint8_t* dst_buffer,
int32_t dst_size,
const uint8_t* src_buffer,
int32_t src_size)

View File

@@ -24,7 +24,7 @@
#include "library.h"
#include "apple_rle.h"
AARU_EXPORT int32_t AARU_CALL apple_rle_decode_buffer(uint8_t* dst_buffer,
AARU_EXPORT int32_t AARU_CALL AARU_apple_rle_decode_buffer(uint8_t* dst_buffer,
int32_t dst_size,
const uint8_t* src_buffer,
int32_t src_size)

4
flac.c
View File

@@ -21,7 +21,7 @@ static FLAC__StreamDecoderWriteStatus write_callback(const FLAC__StreamDecoder*
static void
error_callback(const FLAC__StreamDecoder* decoder, FLAC__StreamDecoderErrorStatus status, void* client_data);
AARU_EXPORT size_t AARU_CALL flac_decode_redbook_buffer(uint8_t* dst_buffer,
AARU_EXPORT size_t AARU_CALL AARU_flac_decode_redbook_buffer(uint8_t* dst_buffer,
size_t dst_size,
const uint8_t* src_buffer,
size_t src_size)
@@ -135,7 +135,7 @@ static FLAC__StreamEncoderWriteStatus encoder_write_callback(const FLAC__StreamE
uint32_t current_frame,
void* client_data);
AARU_EXPORT size_t AARU_CALL flac_encode_redbook_buffer(uint8_t* dst_buffer,
AARU_EXPORT size_t AARU_CALL AARU_flac_encode_redbook_buffer(uint8_t* dst_buffer,
size_t dst_size,
const uint8_t* src_buffer,
size_t src_size,

View File

@@ -54,22 +54,22 @@
#define FORCE_INLINE static inline __attribute__((always_inline))
#endif
AARU_EXPORT int32_t AARU_CALL adc_decode_buffer(uint8_t* dst_buffer,
AARU_EXPORT int32_t AARU_CALL AARU_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,
AARU_EXPORT int32_t AARU_CALL AARU_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,
AARU_EXPORT size_t AARU_CALL AARU_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,
AARU_EXPORT size_t AARU_CALL AARU_flac_encode_redbook_buffer(uint8_t* dst_buffer,
size_t dst_size,
const uint8_t* src_buffer,
size_t src_size,
@@ -85,12 +85,12 @@ AARU_EXPORT size_t AARU_CALL flac_encode_redbook_buffer(uint8_t* dst_buffe
const char* application_id,
uint32_t application_id_len);
AARU_EXPORT int32_t AARU_CALL lzip_decode_buffer(uint8_t* dst_buffer,
AARU_EXPORT int32_t AARU_CALL AARU_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,
AARU_EXPORT int32_t AARU_CALL AARU_lzip_encode_buffer(uint8_t* dst_buffer,
int32_t dst_size,
const uint8_t* src_buffer,
int32_t src_size,

4
lzip.c
View File

@@ -23,7 +23,7 @@
#include "library.h"
#include "3rdparty/lzlib-1.12/lzlib.h"
AARU_EXPORT int32_t AARU_CALL lzip_decode_buffer(uint8_t* dst_buffer,
AARU_EXPORT int32_t AARU_CALL AARU_lzip_decode_buffer(uint8_t* dst_buffer,
int32_t dst_size,
const uint8_t* src_buffer,
int32_t src_size)
@@ -83,7 +83,7 @@ AARU_EXPORT int32_t AARU_CALL lzip_decode_buffer(uint8_t* dst_buffer,
return out_pos;
}
AARU_EXPORT int32_t AARU_CALL lzip_encode_buffer(uint8_t* dst_buffer,
AARU_EXPORT int32_t AARU_CALL AARU_lzip_encode_buffer(uint8_t* dst_buffer,
int32_t dst_size,
const uint8_t* src_buffer,
int32_t src_size,

View File

@@ -20,8 +20,8 @@
#include <cstdint>
#include <cstring>
#include "../library.h"
#include "../adc.h"
#include "../library.h"
#include "crc32.h"
#include "gtest/gtest.h"
@@ -67,7 +67,7 @@ TEST_F(adcFixture, adc)
{
auto* outBuf = (uint8_t*)malloc(327680);
auto decoded = adc_decode_buffer(outBuf, 327680, buffer, 34367);
auto decoded = AARU_adc_decode_buffer(outBuf, 327680, buffer, 34367);
EXPECT_EQ(decoded, 262144);

View File

@@ -20,8 +20,8 @@
#include <cstdint>
#include <cstring>
#include "../library.h"
#include "../apple_rle.h"
#include "../library.h"
#include "crc32.h"
#include "gtest/gtest.h"
@@ -53,9 +53,7 @@ class apple_rleFixture : public ::testing::Test
fclose(file);
}
void TearDown() {
free((void*)buffer);
}
void TearDown() { free((void*)buffer); }
~apple_rleFixture()
{
@@ -67,9 +65,9 @@ class apple_rleFixture : public ::testing::Test
TEST_F(apple_rleFixture, apple_rle)
{
auto *outBuf = (uint8_t*)malloc(32768);
auto* outBuf = (uint8_t*)malloc(32768);
auto decoded = apple_rle_decode_buffer(outBuf, 32768, buffer, 1102);
auto decoded = AARU_apple_rle_decode_buffer(outBuf, 32768, buffer, 1102);
EXPECT_EQ(decoded, 20960);

View File

@@ -20,8 +20,8 @@
#include <cstddef>
#include <cstdint>
#include "../library.h"
#include "../flac.h"
#include "../library.h"
#include "crc32.h"
#include "gtest/gtest.h"
@@ -67,7 +67,7 @@ TEST_F(flacFixture, flac)
{
auto* outBuf = (uint8_t*)malloc(9633792);
auto decoded = flac_decode_redbook_buffer(outBuf, 9633792, buffer, 6534197);
auto decoded = AARU_flac_decode_redbook_buffer(outBuf, 9633792, buffer, 6534197);
EXPECT_EQ(decoded, 9633792);
@@ -109,7 +109,7 @@ TEST_F(flacFixture, flacCompress)
original_crc = crc32_data(original, original_len);
// Compress
newSize = flac_encode_redbook_buffer(cmp_buffer,
newSize = AARU_flac_encode_redbook_buffer(cmp_buffer,
cmp_len,
original,
original_len,
@@ -127,7 +127,7 @@ TEST_F(flacFixture, flacCompress)
cmp_len = newSize;
// Decompress
newSize = flac_decode_redbook_buffer(decmp_buffer, decmp_len, cmp_buffer, cmp_len);
newSize = AARU_flac_decode_redbook_buffer(decmp_buffer, decmp_len, cmp_buffer, cmp_len);
decmp_len = newSize;
EXPECT_EQ(decmp_len, original_len);

View File

@@ -17,10 +17,10 @@
*/
#include <climits>
#include <cstddef>
#include <cstdint>
#include "../library.h"
#include "../lzip.h"
#include "crc32.h"
#include "gtest/gtest.h"
@@ -66,7 +66,7 @@ TEST_F(lzipFixture, lzip)
{
auto* outBuf = (uint8_t*)malloc(1048576);
auto decoded = lzip_decode_buffer(outBuf, 1048576, buffer, 1062874);
auto decoded = AARU_lzip_decode_buffer(outBuf, 1048576, buffer, 1062874);
EXPECT_EQ(decoded, 1048576);
@@ -108,11 +108,11 @@ TEST_F(lzipFixture, lzipCompress)
original_crc = crc32_data(original, original_len);
// Compress
newSize = lzip_encode_buffer(cmp_buffer, cmp_len, original, original_len, 1048576, 273);
newSize = AARU_lzip_encode_buffer(cmp_buffer, cmp_len, original, original_len, 1048576, 273);
cmp_len = newSize;
// Decompress
newSize = lzip_decode_buffer(decmp_buffer, decmp_len, cmp_buffer, cmp_len);
newSize = AARU_lzip_decode_buffer(decmp_buffer, decmp_len, cmp_buffer, cmp_len);
decmp_len = newSize;
EXPECT_EQ(decmp_len, original_len);