Skip to content

Commit

Permalink
chores: remove remaining traces of lzo compression.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gottox committed May 28, 2023
1 parent 7ac0a9d commit 5d4f359
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 92 deletions.
8 changes: 2 additions & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,13 @@ jobs:
fetch-depth: 0
- name: configure
run: |
apk add zlib-dev lz4-dev xz-dev lzo-dev zstd-dev
apk add zlib-dev lz4-dev xz-dev zstd-dev
CC=gcc meson setup /tmp/build \
-Dwerror=true \
-Dcurl=enabled \
-Dzlib=enabled \
-Dlz4=enabled \
-Dlzma=enabled \
-Dlzo=enabled \
-Dzstd=enabled \
-Dthreads=enabled \
-Dtest=extended \
Expand Down Expand Up @@ -77,7 +76,6 @@ jobs:
-Dzlib=${{ matrix.feature }} \
-Dlz4=${{ matrix.feature }} \
-Dlzma=${{ matrix.feature }} \
-Dlzo=${{ matrix.feature }} \
-Dzstd=${{ matrix.feature }} \
-Dtest=false \
-Ddoc=false
Expand All @@ -97,13 +95,12 @@ jobs:
architecture: x86-64
version: 7.2
run: |
sudo pkg_add bzip2 curl git lzo2 meson lz4
sudo pkg_add bzip2 curl git meson lz4
CC=clang meson setup /tmp/build \
-Dcurl=enabled \
-Dzlib=enabled \
-Dlz4=enabled \
-Dlzma=enabled \
-Dlzo=enabled \
-Dzstd=enabled \
-Dtest=true \
-Ddoc=false
Expand All @@ -127,7 +124,6 @@ jobs:
-Dzlib=disabled \
-Dlz4=disabled\
-Dlzma=disabled \
-Dlzo=disabled \
-Dzstd=disabled \
-Dtest=false \
-Ddoc=true
Expand Down
3 changes: 0 additions & 3 deletions fuzzer/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,4 @@ test(
'-max_total_time=@0@'.format(get_option('fuzzer_timeout')),
],
timeout: 10 + get_option('fuzzer_timeout'),
env: {
'SQSH_LZO_HELPER_PATH': lzo_helper_path
},
)
17 changes: 7 additions & 10 deletions include/sqsh_extract_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@ struct SqshMapReader;
*/
typedef uint8_t sqsh__extractor_context_t[256];

/**
* @brief The implementation of the lzo extractor. This is NULL by default.
* If you want to use this, you need to link against
* [libsqsh-lzo](https://github.com/Gottox/libsqsh-lzo).
*/
extern const struct SqshExtractorImpl *sqsh__impl_lzo;

/**
* @internal
* @brief The SqshExtractorImpl struct is used to implement a extractor
Expand Down Expand Up @@ -283,16 +290,6 @@ extern const struct SqshExtractorImpl *const sqsh__impl_lzma;
*/
extern const struct SqshExtractorImpl *const sqsh__impl_xz;

////////////////////////////////////////
// extract/lzo.c

/**
* @brief The implementation of the lzo extractor. This is NULL by default.
* If you want to use this, you need to link against
* [libsqsh-lzo](https://github.com/Gottox/libsqsh-lzo).
*/
extern struct SqshExtractorImpl *const sqsh__impl_lzo;

////////////////////////////////////////
// extract/zlib.c

Expand Down
2 changes: 1 addition & 1 deletion lib/extract/extractor.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
#include "../../include/sqsh_error.h"
#include "../../include/sqsh_primitive_private.h"

struct SqshExtractorImpl *const sqsh__impl_lzo = NULL;
const struct SqshExtractorImpl *sqsh__impl_lzo = NULL;

const struct SqshExtractorImpl *
extractor_by_id(int id) {
Expand Down
1 change: 0 additions & 1 deletion meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ project(
meson_version: '>=0.57',
license: [
'BSD-2-Clause',
'GPL-2.0-only',
],
)

Expand Down
45 changes: 0 additions & 45 deletions test/extract/extract.c
Original file line number Diff line number Diff line change
Expand Up @@ -152,20 +152,6 @@ decompress_lz4_split(void) {
decompress_test_split(sqsh__impl_lz4, input, sizeof(input));
}

static void
decompress_lzo(void) {
uint8_t input[] = {0x15, 0x61, 0x62, 0x63, 0x64, 0x11, 0x00, 0x00};

decompress_test(sqsh__impl_lzo, input, sizeof(input));
}

static void
decompress_lzo_split(void) {
uint8_t input[] = {0x15, 0x61, 0x62, 0x63, 0x64, 0x11, 0x00, 0x00};

decompress_test_split(sqsh__impl_lzo, input, sizeof(input));
}

static void
decompress_zlib(void) {
uint8_t input[] = {
Expand Down Expand Up @@ -200,46 +186,15 @@ decompress_zstd_split(void) {
decompress_test_split(sqsh__impl_zstd, input, sizeof(input));
}

static void *
multithreaded_lzo_worker(void *arg) {
(void)arg;
uint8_t input[] = {0x15, 0x61, 0x62, 0x63, 0x64, 0x11, 0x00, 0x00};

for (int i = 0; i < 10000; i++) {
decompress_test(sqsh__impl_lzo, input, sizeof(input));
}
return 0;
}

static void
multithreaded_lzo(void) {
(void)multithreaded_lzo_worker;
int rv;
pthread_t threads[16] = {0};

for (unsigned long i = 0; i < LENGTH(threads); i++) {
rv = pthread_create(&threads[i], NULL, multithreaded_lzo_worker, NULL);
assert(rv == 0);
}

for (unsigned long i = 0; i < LENGTH(threads); i++) {
rv = pthread_join(threads[i], NULL);
assert(rv == 0);
}
}

DEFINE
TEST(decompress_lzma);
TEST_OFF(decompress_lzma_split);
TEST(decompress_xz);
TEST(decompress_xz_split);
TEST(decompress_lz4);
TEST_OFF(decompress_lz4_split);
TEST(decompress_lzo);
TEST(decompress_lzo_split);
TEST(decompress_zlib);
TEST(decompress_zlib_split);
TEST(decompress_zstd);
TEST(decompress_zstd_split);
TEST(multithreaded_lzo);
DEFINE_END
26 changes: 0 additions & 26 deletions utils/lzo2.c

This file was deleted.

0 comments on commit 5d4f359

Please sign in to comment.