From 40a690416a3951361ec77d33a723dd4497fb7585 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Fri, 26 Dec 2014 14:16:44 -0600 Subject: [PATCH] Adjust naming of (de)compression files --- Makefile.am | 22 +++++++++---------- README | 2 +- include/wimlib/decompress_common.h | 4 ++-- include/wimlib/{lzms.h => lzms_common.h} | 8 +++---- include/wimlib/{lzx.h => lzx_common.h} | 8 +++---- .../wimlib/{xpress.h => xpress_constants.h} | 13 ++++++----- src/{lzms-common.c => lzms_common.c} | 2 +- src/{lzms-compress.c => lzms_compress.c} | 6 ++--- src/{lzms-decompress.c => lzms_decompress.c} | 6 +++-- src/{lzx-common.c => lzx_common.c} | 2 +- src/{lzx-compress.c => lzx_compress.c} | 6 ++--- src/{lzx-decompress.c => lzx_decompress.c} | 10 ++++----- src/{xpress-compress.c => xpress_compress.c} | 4 ++-- ...press-decompress.c => xpress_decompress.c} | 6 ++--- 14 files changed, 52 insertions(+), 47 deletions(-) rename include/wimlib/{lzms.h => lzms_common.h} (97%) rename include/wimlib/{lzx.h => lzx_common.h} (95%) rename include/wimlib/{xpress.h => xpress_constants.h} (53%) rename src/{lzms-common.c => lzms_common.c} (99%) rename src/{lzms-compress.c => lzms_compress.c} (99%) rename src/{lzms-decompress.c => lzms_decompress.c} (99%) rename src/{lzx-common.c => lzx_common.c} (99%) rename src/{lzx-compress.c => lzx_compress.c} (99%) rename src/{lzx-decompress.c => lzx_decompress.c} (98%) rename src/{xpress-compress.c => xpress_compress.c} (99%) rename src/{xpress-decompress.c => xpress_decompress.c} (97%) diff --git a/Makefile.am b/Makefile.am index 39b86f22..0893ef66 100644 --- a/Makefile.am +++ b/Makefile.am @@ -64,12 +64,12 @@ libwim_la_SOURCES = \ src/lz_null.c \ src/lz_repsearch.c \ src/lz_suffix_array_utils.c \ - src/lzms-common.c \ - src/lzms-compress.c \ - src/lzms-decompress.c \ - src/lzx-common.c \ - src/lzx-compress.c \ - src/lzx-decompress.c \ + src/lzms_common.c \ + src/lzms_compress.c \ + src/lzms_decompress.c \ + src/lzx_common.c \ + src/lzx_compress.c \ + src/lzx_decompress.c \ src/metadata_resource.c \ src/mount_image.c \ src/pathlist.c \ @@ -92,8 +92,8 @@ libwim_la_SOURCES = \ src/wim.c \ src/write.c \ src/xml.c \ - src/xpress-compress.c \ - src/xpress-decompress.c \ + src/xpress_compress.c \ + src/xpress_decompress.c \ include/wimlib/apply.h \ include/wimlib/assert.h \ include/wimlib/avl_tree.h \ @@ -129,9 +129,9 @@ libwim_la_SOURCES = \ include/wimlib/lz_mf_ops.h \ include/wimlib/lz_repsearch.h \ include/wimlib/lz_suffix_array_utils.h \ - include/wimlib/lzms.h \ + include/wimlib/lzms_common.h \ include/wimlib/lzms_constants.h \ - include/wimlib/lzx.h \ + include/wimlib/lzx_common.h \ include/wimlib/lzx_constants.h \ include/wimlib/matchfinder_avx2.h \ include/wimlib/matchfinder_common.h \ @@ -157,7 +157,7 @@ libwim_la_SOURCES = \ include/wimlib/wim.h \ include/wimlib/write.h \ include/wimlib/xml.h \ - include/wimlib/xpress.h + include/wimlib/xpress_constants.h if WITH_NTFS_3G libwim_la_SOURCES += src/ntfs-3g_apply.c \ diff --git a/README b/README index a7a82083..7a405600 100644 --- a/README +++ b/README @@ -336,7 +336,7 @@ With regards to the supported compression formats: neither of which is completely applicable to its use in the WIM format, and the first of which contains multiple errors. - There does not seem to be any official documentation for LZMS, so my comments - and code in src/lzms-decompress.c may in fact be the best documentation + and code in src/lzms_decompress.c may in fact be the best documentation available for this particular compression format. The algorithms used by wimlib's compression and decompression codecs are diff --git a/include/wimlib/decompress_common.h b/include/wimlib/decompress_common.h index 296d0b1d..b6927bed 100644 --- a/include/wimlib/decompress_common.h +++ b/include/wimlib/decompress_common.h @@ -214,8 +214,8 @@ bitstream_align(struct input_bitstream *is) * input data is exhausted, the Huffman symbol is decoded as if the missing bits * are all zeroes. * - * XXX: This is mostly duplicated in lzms_huffman_decode_symbol() in - * lzms-decompress.c. */ + * XXX: This is mostly duplicated in lzms_decode_huffman_symbol() in + * lzms_decompress.c. */ static inline u16 read_huffsym(struct input_bitstream *istream, const u16 decode_table[], unsigned table_bits, unsigned max_codeword_len) diff --git a/include/wimlib/lzms.h b/include/wimlib/lzms_common.h similarity index 97% rename from include/wimlib/lzms.h rename to include/wimlib/lzms_common.h index 91a0e1ba..10dc4d02 100644 --- a/include/wimlib/lzms.h +++ b/include/wimlib/lzms_common.h @@ -1,11 +1,11 @@ /* - * lzms.h + * lzms_common.h * * Declarations shared between LZMS compression and decompression. */ -#ifndef _WIMLIB_LZMS_H -#define _WIMLIB_LZMS_H +#ifndef _LZMS_COMMON_H +#define _LZMS_COMMON_H #include "wimlib/compiler.h" #include "wimlib/lzms_constants.h" @@ -107,4 +107,4 @@ lzms_get_probability(const struct lzms_probability_entry *prob_entry) return prob; } -#endif /* _WIMLIB_LZMS_H */ +#endif /* _LZMS_COMMON_H */ diff --git a/include/wimlib/lzx.h b/include/wimlib/lzx_common.h similarity index 95% rename from include/wimlib/lzx.h rename to include/wimlib/lzx_common.h index 5bd6b140..b3ae85a7 100644 --- a/include/wimlib/lzx.h +++ b/include/wimlib/lzx_common.h @@ -1,11 +1,11 @@ /* - * lzx.h + * lzx_common.h * * Declarations shared between LZX compression and decompression. */ -#ifndef _WIMLIB_LZX_H -#define _WIMLIB_LZX_H +#ifndef _LZX_COMMON_H +#define _LZX_COMMON_H #include "wimlib/assert.h" #include "wimlib/bitops.h" @@ -71,4 +71,4 @@ lzx_do_e8_preprocessing(u8 *data, u32 size); extern void lzx_undo_e8_preprocessing(u8 *data, u32 size); -#endif /* _WIMLIB_LZX_H */ +#endif /* _LZX_COMMON_H */ diff --git a/include/wimlib/xpress.h b/include/wimlib/xpress_constants.h similarity index 53% rename from include/wimlib/xpress.h rename to include/wimlib/xpress_constants.h index 2163c550..9a8ba2c2 100644 --- a/include/wimlib/xpress.h +++ b/include/wimlib/xpress_constants.h @@ -1,8 +1,11 @@ -#ifndef _WIMLIB_XPRESS_H -#define _WIMLIB_XPRESS_H +/* + * xpress_constants.h + * + * Constants for the XPRESS compression format. + */ -/* Constants for the XPRESS data compression format. See the comments in - * xpress-decompress.c for more information about this format. */ +#ifndef _XPRESS_CONSTANTS_H +#define _XPRESS_CONSTANTS_H #define XPRESS_NUM_CHARS 256 #define XPRESS_NUM_SYMBOLS 512 @@ -16,4 +19,4 @@ #define XPRESS_MIN_MATCH_LEN 3 #define XPRESS_MAX_MATCH_LEN 65538 -#endif /* _WIMLIB_XPRESS_H */ +#endif /* _XPRESS_CONSTANTS_H */ diff --git a/src/lzms-common.c b/src/lzms_common.c similarity index 99% rename from src/lzms-common.c rename to src/lzms_common.c index eaa237fa..fccc5667 100644 --- a/src/lzms-common.c +++ b/src/lzms_common.c @@ -24,7 +24,7 @@ #endif #include "wimlib/endianness.h" -#include "wimlib/lzms.h" +#include "wimlib/lzms_common.h" #include "wimlib/unaligned.h" /* Table: offset slot => offset slot base value */ diff --git a/src/lzms-compress.c b/src/lzms_compress.c similarity index 99% rename from src/lzms-compress.c rename to src/lzms_compress.c index 5f5e3741..8ba9bcbc 100644 --- a/src/lzms-compress.c +++ b/src/lzms_compress.c @@ -1,7 +1,7 @@ /* - * lzms-compress.c + * lzms_compress.c * - * A compressor that produces output compatible with the LZMS compression format. + * A compressor for the LZMS compression format. */ /* @@ -31,7 +31,7 @@ #include "wimlib/error.h" #include "wimlib/lz_mf.h" #include "wimlib/lz_repsearch.h" -#include "wimlib/lzms.h" +#include "wimlib/lzms_common.h" #include "wimlib/unaligned.h" #include "wimlib/util.h" diff --git a/src/lzms-decompress.c b/src/lzms_decompress.c similarity index 99% rename from src/lzms-decompress.c rename to src/lzms_decompress.c index b56c4ffa..3be7cd13 100644 --- a/src/lzms-decompress.c +++ b/src/lzms_decompress.c @@ -1,5 +1,7 @@ /* - * lzms-decompress.c + * lzms_decompress.c + * + * A decompressor for the LZMS compression format. */ /* @@ -203,7 +205,7 @@ #include "wimlib/decompressor_ops.h" #include "wimlib/decompress_common.h" #include "wimlib/error.h" -#include "wimlib/lzms.h" +#include "wimlib/lzms_common.h" #include "wimlib/util.h" /* The TABLEBITS values can be changed; they only affect decoding speed. */ diff --git a/src/lzx-common.c b/src/lzx_common.c similarity index 99% rename from src/lzx-common.c rename to src/lzx_common.c index b40f43d7..76c73bae 100644 --- a/src/lzx-common.c +++ b/src/lzx_common.c @@ -27,7 +27,7 @@ #include "wimlib/bitops.h" #include "wimlib/endianness.h" -#include "wimlib/lzx.h" +#include "wimlib/lzx_common.h" #include "wimlib/unaligned.h" #include "wimlib/util.h" diff --git a/src/lzx-compress.c b/src/lzx_compress.c similarity index 99% rename from src/lzx-compress.c rename to src/lzx_compress.c index 201a1cfb..6032f1e2 100644 --- a/src/lzx-compress.c +++ b/src/lzx_compress.c @@ -1,7 +1,7 @@ /* - * lzx-compress.c + * lzx_compress.c * - * A compressor that produces output compatible with the LZX compression format. + * A compressor for the LZX compression format, as used in WIM files. */ /* @@ -71,7 +71,7 @@ #include "wimlib/error.h" #include "wimlib/lz_mf.h" #include "wimlib/lz_repsearch.h" -#include "wimlib/lzx.h" +#include "wimlib/lzx_common.h" #include "wimlib/util.h" #include diff --git a/src/lzx-decompress.c b/src/lzx_decompress.c similarity index 98% rename from src/lzx-decompress.c rename to src/lzx_decompress.c index 2c466512..57b32890 100644 --- a/src/lzx-decompress.c +++ b/src/lzx_decompress.c @@ -1,7 +1,7 @@ /* - * lzx-decompress.c + * lzx_decompress.c * - * A very fast decompressor for LZX, as used in WIM files. + * A decompressor for the LZX compression format, as used in WIM files. */ /* @@ -24,7 +24,7 @@ /* * LZX is an LZ77 and Huffman-code based compression format that has many * similarities to DEFLATE (the format used by zlib/gzip). The compression - * ratio is as good or better than DEFLATE. See lzx-compress.c for a format + * ratio is as good or better than DEFLATE. See lzx_compress.c for a format * overview, and see https://en.wikipedia.org/wiki/LZX_(algorithm) for a * historical overview. Here I make some pragmatic notes. * @@ -57,7 +57,7 @@ #include "wimlib/decompressor_ops.h" #include "wimlib/decompress_common.h" #include "wimlib/error.h" -#include "wimlib/lzx.h" +#include "wimlib/lzx_common.h" #include "wimlib/util.h" #include @@ -270,7 +270,7 @@ lzx_read_block_header(struct input_bitstream *istream, block_type = bitstream_pop_bits(istream, 3); /* Read the block size. This mirrors the behavior of - * lzx_write_compressed_block() in lzx-compress.c; see that for more + * lzx_write_compressed_block() in lzx_compress.c; see that for more * details. */ if (bitstream_pop_bits(istream, 1)) { block_size = LZX_DEFAULT_BLOCK_SIZE; diff --git a/src/xpress-compress.c b/src/xpress_compress.c similarity index 99% rename from src/xpress-compress.c rename to src/xpress_compress.c index 73d831ee..04105ae0 100644 --- a/src/xpress-compress.c +++ b/src/xpress_compress.c @@ -1,5 +1,5 @@ /* - * xpress-compress.c + * xpress_compress.c * * A compressor for the XPRESS compression format (Huffman variant). */ @@ -70,7 +70,7 @@ #include "wimlib/hc_matchfinder.h" #include "wimlib/unaligned.h" #include "wimlib/util.h" -#include "wimlib/xpress.h" +#include "wimlib/xpress_constants.h" #if SUPPORT_NEAR_OPTIMAL_PARSING diff --git a/src/xpress-decompress.c b/src/xpress_decompress.c similarity index 97% rename from src/xpress-decompress.c rename to src/xpress_decompress.c index b43e5273..2951be1b 100644 --- a/src/xpress-decompress.c +++ b/src/xpress_decompress.c @@ -1,7 +1,7 @@ /* - * xpress-decompress.c + * xpress_decompress.c * - * A very fast decompressor for XPRESS (Huffman version). + * A decompressor for the XPRESS compression format (Huffman variant). */ /* @@ -70,7 +70,7 @@ #include "wimlib/decompressor_ops.h" #include "wimlib/decompress_common.h" #include "wimlib/error.h" -#include "wimlib/xpress.h" +#include "wimlib/xpress_constants.h" /* This value is chosen for fast decompression. */ #define XPRESS_TABLEBITS 12 -- 2.43.0