Skip to content

Commit

Permalink
Merge pull request #57 from Gottox/refactor/cextras
Browse files Browse the repository at this point in the history
refactor: remove primitive, replace by cextras
  • Loading branch information
Gottox authored Aug 21, 2023
2 parents c5eef74 + 0ccf2e0 commit 792bc39
Show file tree
Hide file tree
Showing 29 changed files with 94 additions and 1,935 deletions.
20 changes: 0 additions & 20 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,25 +38,6 @@ jobs:
run: |
ninja -C /tmp/build test
plain-build:
runs-on: ubuntu-latest
container: gottox/sqsh-build:${{ matrix.arch }}
strategy:
matrix:
cc:
- gcc
- clang
arch:
#- i386
- x86_64
steps:
- uses: actions/checkout@v3
- name: build
run: |
CC=${{ matrix.cc }}
apk add zlib-dev
$CC -o sqsh-ls tools/common.c tools/ls.c $(find lib -name '*.c') -DCONFIG_ZLIB -L/lib -lz
build:
runs-on: ubuntu-latest
container: gottox/sqsh-build:${{ matrix.arch }}
Expand Down Expand Up @@ -127,7 +108,6 @@ jobs:
needs:
- build
- build-openbsd
- plain-build
- test
runs-on: ubuntu-latest
container: gottox/sqsh-build:latest
Expand Down
1 change: 0 additions & 1 deletion include/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ headers = files(
'sqsh_mapper_private.h',
'sqsh_metablock_private.h',
'sqsh_posix.h',
'sqsh_primitive_private.h',
'sqsh_reader_private.h',
'sqsh_table.h',
'sqsh_table_private.h',
Expand Down
16 changes: 8 additions & 8 deletions include/sqsh_extract_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#ifndef SQSH_EXTRACT_PRIVATE_H
#define SQSH_EXTRACT_PRIVATE_H

#include "sqsh_primitive_private.h"
#include <cextras/collection.h>

#include "sqsh_thread_private.h"

Expand Down Expand Up @@ -91,7 +91,7 @@ struct SqshExtractor {
/**
* @privatesection
*/
struct SqshBuffer *buffer;
struct CxBuffer *buffer;
const struct SqshExtractorImpl *impl;
size_t block_size;
};
Expand Down Expand Up @@ -122,7 +122,7 @@ sqsh__extractor_impl_from_id(int id);
* @return 0 on success, a negative value on error.
*/
SQSH_NO_EXPORT SQSH_NO_UNUSED int sqsh__extractor_init(
struct SqshExtractor *extractor, struct SqshBuffer *buffer,
struct SqshExtractor *extractor, struct CxBuffer *buffer,
int algorithm_id, size_t block_size);

/**
Expand Down Expand Up @@ -162,11 +162,11 @@ struct SqshExtractManager {
/**
* @privatesection
*/
struct SqshRcHashMap hash_map;
struct CxRcHashMap hash_map;
unsigned int compression_id;
uint32_t block_size;
struct SqshMapManager *map_manager;
struct SqshLru lru;
struct CxLru lru;
sqsh__mutex_t lock;
};

Expand Down Expand Up @@ -199,7 +199,7 @@ SQSH_NO_EXPORT SQSH_NO_UNUSED int sqsh__extract_manager_init(
*/
SQSH_NO_EXPORT int sqsh__extract_manager_uncompress(
struct SqshExtractManager *manager, const struct SqshMapReader *reader,
const struct SqshBuffer **target);
const struct CxBuffer **target);

/**
* @internal
Expand All @@ -212,7 +212,7 @@ SQSH_NO_EXPORT int sqsh__extract_manager_uncompress(
* @return 0 on success, a negative value on error.
*/
SQSH_NO_EXPORT int sqsh__extract_manager_release(
struct SqshExtractManager *manager, const struct SqshBuffer *buffer);
struct SqshExtractManager *manager, const struct CxBuffer *buffer);

/**
* @internal
Expand All @@ -238,7 +238,7 @@ struct SqshExtractView {
* @privatesection
*/
struct SqshExtractManager *manager;
const struct SqshBuffer *buffer;
const struct CxBuffer *buffer;
size_t offset;
size_t size;
};
Expand Down
6 changes: 3 additions & 3 deletions include/sqsh_mapper_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@

#include "sqsh_mapper.h"

#include "sqsh_primitive_private.h"
#include "sqsh_reader_private.h"
#include "sqsh_thread_private.h"
#include <cextras/collection.h>
#include <sys/wait.h>

#ifdef __cplusplus
Expand Down Expand Up @@ -259,8 +259,8 @@ struct SqshMapManager {
* @privatesection
*/
struct SqshMapper mapper;
struct SqshLru lru;
struct SqshRcMap maps;
struct CxLru lru;
struct CxRcMap maps;
uint64_t archive_offset;
sqsh__mutex_t lock;
};
Expand Down
Loading

0 comments on commit 792bc39

Please sign in to comment.