Skip to content

Commit

Permalink
docs: Bump the license year
Browse files Browse the repository at this point in the history
  • Loading branch information
prantlf committed Apr 17, 2024
1 parent ff99700 commit 30b795f
Show file tree
Hide file tree
Showing 7 changed files with 53 additions and 63 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 Ferdinand Prantl
Copyright (c) 2023-2024 Ferdinand Prantl

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ In lieu of a formal styleguide, take care to maintain the existing coding style.

## License

Copyright (c) 2023 Ferdinand Prantl
Copyright (c) 2023-2024 Ferdinand Prantl

Licensed under the MIT license.

Expand Down
8 changes: 3 additions & 5 deletions zstd/common.v
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
module zstd

pub const (
min_compress_level = C.ZSTD_minCLevel()
max_compress_level = C.ZSTD_maxCLevel()
default_compress_level = C.ZSTD_defaultCLevel()
)
pub const min_compress_level = C.ZSTD_minCLevel()
pub const max_compress_level = C.ZSTD_maxCLevel()
pub const default_compress_level = C.ZSTD_defaultCLevel()

pub fn get_frame_content_size(frame []u8) !int {
res := C.ZSTD_getFrameContentSize(frame.data, frame.len)
Expand Down
20 changes: 9 additions & 11 deletions zstd/compress_context.v
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,15 @@ pub struct CompressContext {
cctx &C.ZSTD_CCtx = unsafe { nil }
}

pub const (
strategy_fast = C.ZSTD_fast
strategy_dfast = C.ZSTD_dfast
strategy_greedy = C.ZSTD_greedy
strategy_lazy = C.ZSTD_lazy
strategy_lazy2 = C.ZSTD_lazy2
strategy_btlazy2 = C.ZSTD_btlazy2
strategy_btopt = C.ZSTD_btopt
strategy_btultra = C.ZSTD_btultra
strategy_btultra2 = C.ZSTD_btultra2
)
pub const strategy_fast = C.ZSTD_fast
pub const strategy_dfast = C.ZSTD_dfast
pub const strategy_greedy = C.ZSTD_greedy
pub const strategy_lazy = C.ZSTD_lazy
pub const strategy_lazy2 = C.ZSTD_lazy2
pub const strategy_btlazy2 = C.ZSTD_btlazy2
pub const strategy_btopt = C.ZSTD_btopt
pub const strategy_btultra = C.ZSTD_btultra
pub const strategy_btultra2 = C.ZSTD_btultra2

pub enum CompressParam {
compression_level = C.ZSTD_c_compressionLevel
Expand Down
6 changes: 2 additions & 4 deletions zstd/compress_stream.v
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
module zstd

pub const (
compress_stream_out_size = int(C.ZSTD_CStreamOutSize())
compress_stream_in_size = int(C.ZSTD_CStreamInSize())
)
pub const compress_stream_out_size = int(C.ZSTD_CStreamOutSize())
pub const compress_stream_in_size = int(C.ZSTD_CStreamInSize())

pub fn new_compress_stream_context() &StreamContext {
return new_stream_context(zstd.compress_stream_out_size, zstd.compress_stream_in_size)
Expand Down
6 changes: 2 additions & 4 deletions zstd/decompress_stream.v
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
module zstd

pub const (
decompress_stream_out_size = int(C.ZSTD_DStreamOutSize())
decompress_stream_in_size = int(C.ZSTD_DStreamInSize())
)
pub const decompress_stream_out_size = int(C.ZSTD_DStreamOutSize())
pub const decompress_stream_in_size = int(C.ZSTD_DStreamInSize())

pub fn new_decompress_stream_context() &StreamContext {
return new_stream_context(zstd.decompress_stream_out_size, zstd.decompress_stream_in_size)
Expand Down
72 changes: 35 additions & 37 deletions zstd/errors.v
Original file line number Diff line number Diff line change
Expand Up @@ -9,43 +9,41 @@ pub fn (err &ContentSizeUnknown) msg() string {
return 'content size unknown'
}

pub const (
err_no_error = 0
err_generic = 1
err_prefix_unknown = 10
err_version_unsupported = 12
err_frame_parameter_unsupported = 14
err_frame_parameter_window_too_large = 16
err_corruption_detected = 20
err_checksum_wrong = 22
err_literals_header_wrong = 24
err_dictionary_corrupted = 30
err_dictionary_wrong = 32
err_dictionary_creation_failed = 34
err_parameter_unsupported = 40
err_parameter_combination_unsupported = 41
err_parameter_out_of_bound = 42
err_table_log_too_large = 44
err_max_symbol_value_too_large = 46
err_max_symbol_value_too_small = 48
err_stability_condition_not_respected = 50
err_stage_wrong = 60
err_init_missing = 62
err_memory_allocation = 64
err_work_space_too_small = 66
err_dst_size_too_small = 70
err_src_size_wrong = 72
err_dst_buffer_null = 74
err_no_forward_progress_dest_full = 80
err_no_forward_progress_input_empty = 82
err_frame_index_too_large = 100
err_seekable_io = 102
err_dst_buffer_wrong = 104
err_src_buffer_wrong = 105
err_sequence_producer_failed = 106
err_external_sequences_invalid = 107
err_max_code = 120
)
pub const err_no_error = 0
pub const err_generic = 1
pub const err_prefix_unknown = 10
pub const err_version_unsupported = 12
pub const err_frame_parameter_unsupported = 14
pub const err_frame_parameter_window_too_large = 16
pub const err_corruption_detected = 20
pub const err_checksum_wrong = 22
pub const err_literals_header_wrong = 24
pub const err_dictionary_corrupted = 30
pub const err_dictionary_wrong = 32
pub const err_dictionary_creation_failed = 34
pub const err_parameter_unsupported = 40
pub const err_parameter_combination_unsupported = 41
pub const err_parameter_out_of_bound = 42
pub const err_table_log_too_large = 44
pub const err_max_symbol_value_too_large = 46
pub const err_max_symbol_value_too_small = 48
pub const err_stability_condition_not_respected = 50
pub const err_stage_wrong = 60
pub const err_init_missing = 62
pub const err_memory_allocation = 64
pub const err_work_space_too_small = 66
pub const err_dst_size_too_small = 70
pub const err_src_size_wrong = 72
pub const err_dst_buffer_null = 74
pub const err_no_forward_progress_dest_full = 80
pub const err_no_forward_progress_input_empty = 82
pub const err_frame_index_too_large = 100
pub const err_seekable_io = 102
pub const err_dst_buffer_wrong = 104
pub const err_src_buffer_wrong = 105
pub const err_sequence_producer_failed = 106
pub const err_external_sequences_invalid = 107
pub const err_max_code = 120

fn check_error(res usize) ! {
if C.ZSTD_isError(res) != 0 {
Expand Down

0 comments on commit 30b795f

Please sign in to comment.