Skip to content

Commit

Permalink
refactor: remove primitive, replace by cextras
Browse files Browse the repository at this point in the history
  • Loading branch information
Gottox committed Aug 21, 2023
1 parent c5eef74 commit 3cc14d5
Show file tree
Hide file tree
Showing 28 changed files with 94 additions and 1,915 deletions.
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 3cc14d5

Please sign in to comment.