Skip to content

Commit

Permalink
chores: rearrange source
Browse files Browse the repository at this point in the history
  • Loading branch information
Gottox committed Sep 20, 2023
1 parent 95de1c2 commit 03d88b1
Show file tree
Hide file tree
Showing 146 changed files with 1,293 additions and 679 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
branches:
- main
paths:
- utils/*
- common/build_utils/*

jobs:
docker:
Expand All @@ -31,8 +31,8 @@ jobs:
sha-${{ github.sha }}-${{ matrix.tag_suffix }}
${{ github.ref_name }}-${{ matrix.tag_suffix }}
${{ matrix.extra_tags }}
context: utils
containerfiles: utils/Dockerfile
context: common/build_utils
containerfiles: common/build_utils/Dockerfile
- name: Push to Dockerhub
uses: redhat-actions/push-to-registry@v2
with:
Expand Down
File renamed without changes.
6 changes: 6 additions & 0 deletions common/include/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
libsqsh_common_headers = files(
'sqsh_data.h',
'sqsh_data_private.h',
)

libsqsh_common_include = include_directories('.')
141 changes: 141 additions & 0 deletions common/include/sqsh_data.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
/******************************************************************************
* *
* Copyright (c) 2023, Enno Boland <[email protected]> *
* *
* Redistribution and use in source and binary forms, with or without *
* modification, are permitted provided that the following conditions are *
* met: *
* *
* * Redistributions of source code must retain the above copyright notice, *
* this list of conditions and the following disclaimer. *
* * Redistributions in binary form must reproduce the above copyright *
* notice, this list of conditions and the following disclaimer in the *
* documentation and/or other materials provided with the distribution. *
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS *
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, *
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR *
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR *
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, *
* EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, *
* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR *
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF *
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING *
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS *
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
* *
******************************************************************************/

/**
* @author Enno Boland ([email protected])
* @file sqsh_data.h
*/

#ifndef SQSH_DATA_H
#define SQSH_DATA_H

#include "sqsh_common.h"

#ifdef __cplusplus
extern "C" {
#endif

/***************************************
* data/superblock_data.c
*/

/**
* @brief The compression used in the archive.
*/
enum SqshSuperblockCompressionId {
SQSH_COMPRESSION_GZIP = 1,
SQSH_COMPRESSION_LZMA = 2,
SQSH_COMPRESSION_LZO = 3,
SQSH_COMPRESSION_XZ = 4,
SQSH_COMPRESSION_LZ4 = 5,
SQSH_COMPRESSION_ZSTD = 6
};

/**
* @brief The flags used in the superblock.
*/
enum SqshSuperblockFlags {
SQSH_SUPERBLOCK_UNCOMPRESSED_INODES = 0x0001,
SQSH_SUPERBLOCK_UNCOMPRESSED_DATA = 0x0002,
SQSH_SUPERBLOCK_CHECK = 0x0004,
SQSH_SUPERBLOCK_UNCOMPRESSED_FRAGMENTS = 0x0008,
SQSH_SUPERBLOCK_NO_FRAGMENTS = 0x0010,
SQSH_SUPERBLOCK_ALWAYS_FRAGMENTS = 0x0020,
SQSH_SUPERBLOCK_DUPLICATES = 0x0040,
SQSH_SUPERBLOCK_EXPORTABLE = 0x0080,
SQSH_SUPERBLOCK_UNCOMPRESSED_XATTRS = 0x0100,
SQSH_SUPERBLOCK_NO_XATTRS = 0x0200,
SQSH_SUPERBLOCK_COMPRESSOR_OPTIONS = 0x0400,
SQSH_SUPERBLOCK_UNCOMPRESSED_IDS = 0x0800
};

/***************************************
* data/compression_options_data.c
*/

/**
* @brief definitions of gzip strategies
*/
enum SqshGzipStrategies {
SQSH_GZIP_STRATEGY_NONE = 0x0,
SQSH_GZIP_STRATEGY_DEFAULT = 0x0001,
SQSH_GZIP_STRATEGY_FILTERED = 0x0002,
SQSH_GZIP_STRATEGY_HUFFMAN_ONLY = 0x0004,
SQSH_GZIP_STRATEGY_RLE = 0x0008,
SQSH_GZIP_STRATEGY_FIXED = 0x0010
};

/**
* @brief definitions xz filters
*/
enum SqshXzFilters {
SQSH_XZ_FILTER_NONE = 0x0,
SQSH_XZ_FILTER_X86 = 0x0001,
SQSH_XZ_FILTER_POWERPC = 0x0002,
SQSH_XZ_FILTER_IA64 = 0x0004,
SQSH_XZ_FILTER_ARM = 0x0008,
SQSH_XZ_FILTER_ARMTHUMB = 0x0010,
SQSH_XZ_FILTER_SPARC = 0x0020
};

/**
* @brief definitions of lz4 flags
*/
enum SqshLz4Flags {
SQS_LZ4_FLAG_NONE = 0x0,
SQSH_LZ4_HIGH_COMPRESSION = 0x0001
};

/**
* @brief definitions of Lzo algorithms
*/
enum SqshLzoAlgorithm {
SQSH_LZO_ALGORITHM_LZO1X_1 = 0x0000,
SQSH_LZO_ALGORITHM_LZO1X_1_11 = 0x0001,
SQSH_LZO_ALGORITHM_LZO1X_1_12 = 0x0002,
SQSH_LZO_ALGORITHM_LZO1X_1_15 = 0x0003,
SQSH_LZO_ALGORITHM_LZO1X_999 = 0x0004
};

/***************************************
* data/xattr_data.c
*/

/**
* @brief The type of an external attribute.
*/
enum SqshXattrType {
SQSH_XATTR_USER = 0,
SQSH_XATTR_TRUSTED = 1,
SQSH_XATTR_SECURITY = 2
};

#ifdef __cplusplus
}
#endif
#endif /* SQSH_DATA_H */
File renamed without changes.
18 changes: 18 additions & 0 deletions common/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
subdir('include')

subdir('src')

libsqsh_common_dependencies = [
cextras_dep,
]

libsqsh_common_c_args = ['-Wconversion', '-Wsign-conversion']

libsqsh_common = static_library(
'sqsh',
libsqsh_common_sources,
include_directories: [libsqsh_common_include, libsqsh_include],
c_args: libsqsh_common_c_args,
dependencies: libsqsh_common_dependencies,
install: false,
)
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

#define _DEFAULT_SOURCE

#include "../../../include/sqsh_data_private.h"
#include <sqsh_data_private.h>

#include <cextras/endian_compat.h>

Expand Down
2 changes: 1 addition & 1 deletion lib/data/directory_data.c → common/src/directory_data.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

#define _DEFAULT_SOURCE

#include "../../../include/sqsh_data_private.h"
#include <sqsh_data_private.h>

#include <cextras/endian_compat.h>

Expand Down
2 changes: 1 addition & 1 deletion lib/data/fragment_data.c → common/src/fragment_data.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

#define _DEFAULT_SOURCE

#include "../../../include/sqsh_data_private.h"
#include <sqsh_data_private.h>

#include <cextras/endian_compat.h>

Expand Down
2 changes: 1 addition & 1 deletion lib/data/inode_data.c → common/src/inode_data.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

#define _DEFAULT_SOURCE

#include "../../../include/sqsh_data_private.h"
#include <sqsh_data_private.h>

#include <cextras/endian_compat.h>

Expand Down
9 changes: 9 additions & 0 deletions common/src/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
libsqsh_common_sources = files(
'compression_options_data.c',
'directory_data.c',
'fragment_data.c',
'inode_data.c',
'metablock_data.c',
'superblock_data.c',
'xattr_data.c',
)
2 changes: 1 addition & 1 deletion lib/data/metablock_data.c → common/src/metablock_data.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

#define _DEFAULT_SOURCE

#include "../../../include/sqsh_data_private.h"
#include <sqsh_data_private.h>

#include <cextras/endian_compat.h>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

#define _DEFAULT_SOURCE

#include "../../../include/sqsh_data_private.h"
#include <sqsh_data_private.h>

#include <cextras/endian_compat.h>

Expand Down
2 changes: 1 addition & 1 deletion lib/data/xattr_data.c → common/src/xattr_data.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@

#define _DEFAULT_SOURCE

#include "../../../include/sqsh_data_private.h"
#include <cextras/endian_compat.h>
#include <sqsh_data_private.h>
#include <string.h>

uint16_t
Expand Down
2 changes: 1 addition & 1 deletion doc/Doxyfile.in
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ WARN_AS_ERROR = YES


# Input files
INPUT = @DOXYGEN_INPUT@/README.md @DOXYGEN_INPUT@/include @DOXYGEN_INPUT@/doc @DOXYGEN_INPUT@/examples
INPUT = @DOXYGEN_INPUT@/README.md @DOXYGEN_INPUT@/libsqsh/include @DOXYGEN_INPUT@/include @DOXYGEN_INPUT@/doc @DOXYGEN_INPUT@/examples
EXCLUDE = @DOXYGEN_INPUT@/include/sqsh_data_private.h
FILE_PATTERNS = *.c *.h *.md
EXCLUDE_PATTERNS = *_internal.h
Expand Down
12 changes: 0 additions & 12 deletions include/meson.build
Original file line number Diff line number Diff line change
@@ -1,29 +1,17 @@
headers = files(
'sqsh.h',
'sqsh_archive.h',
'sqsh_archive_private.h',
'sqsh_common.h',
'sqsh_data.h',
'sqsh_data_private.h',
'sqsh_directory.h',
'sqsh_directory_private.h',
'sqsh_easy.h',
'sqsh_error.h',
'sqsh_extract_private.h',
'sqsh_file.h',
'sqsh_file_private.h',
'sqsh_mapper.h',
'sqsh_mapper_private.h',
'sqsh_metablock_private.h',
'sqsh_posix.h',
'sqsh_reader_private.h',
'sqsh_table.h',
'sqsh_table_private.h',
'sqsh_thread_private.h',
'sqsh_tree.h',
'sqsh_tree_private.h',
'sqsh_xattr.h',
'sqsh_xattr_private.h',
)

libsqsh_include = include_directories('.')
Expand Down
77 changes: 0 additions & 77 deletions lib/.exrc

This file was deleted.

Loading

0 comments on commit 03d88b1

Please sign in to comment.