From 0e42caf3591d09d156c2b35462bc91a04e903b39 Mon Sep 17 00:00:00 2001 From: Eugene Kliuchnikov Date: Tue, 31 Aug 2021 14:07:17 +0200 Subject: Migrate to github actions (#920) Not all combinations are migrated to the initial configuration; corresponding TODOs added. Drive-by: additional combinations uncovered minor portability problems -> fixed Drive-by: remove no-longer used "script" files. Co-authored-by: Eugene Kliuchnikov --- docs/brotli.1 | 6 +++++- docs/constants.h.3 | 2 +- docs/decode.h.3 | 35 ++++++++++++++++++++++++++++++++++- docs/encode.h.3 | 46 +++++++++++++++++++++++++++++++++++++++++++++- docs/types.h.3 | 2 +- 5 files changed, 86 insertions(+), 5 deletions(-) (limited to 'docs') diff --git a/docs/brotli.1 b/docs/brotli.1 index 7242a32..a3c9a13 100644 --- a/docs/brotli.1 +++ b/docs/brotli.1 @@ -1,4 +1,4 @@ -.TH "BROTLI" "1" "February 2018" "brotli 1.0.0" "User commands" +.TH "BROTLI" "1" "August 2021" "" "User commands" .SH "NAME" \fBbrotli\fR \- brotli, unbrotli \- compress or decompress files .SH SYNOPSIS @@ -108,6 +108,10 @@ Conflicting or duplicate \fIoptions\fR are not allowed\. windows size improve density; decoder might require up to window size memory to operate .IP \(bu 2 +\fB\-D FILE\fP, \fB\-\-dictionary=FILE\fP: + use FILE as raw (LZ77) dictionary; same dictionary MUST be used both for + compression and decompression +.IP \(bu 2 \fB\-S SUF\fP, \fB\-\-suffix=SUF\fP: output file suffix (default: \fB\|\.br\fP) .IP \(bu 2 diff --git a/docs/constants.h.3 b/docs/constants.h.3 index edf071c..1b29f28 100644 --- a/docs/constants.h.3 +++ b/docs/constants.h.3 @@ -1,4 +1,4 @@ -.TH "constants.h" 3 "Wed May 13 2020" "Brotli" \" -*- nroff -*- +.TH "constants.h" 3 "August 2021" "Brotli" \" -*- nroff -*- .ad l .nh .SH NAME diff --git a/docs/decode.h.3 b/docs/decode.h.3 index 7b8581c..3d4e538 100644 --- a/docs/decode.h.3 +++ b/docs/decode.h.3 @@ -1,4 +1,4 @@ -.TH "decode.h" 3 "Thu Feb 22 2018" "Brotli" \" -*- nroff -*- +.TH "decode.h" 3 "August 2021" "Brotli" \" -*- nroff -*- .ad l .nh .SH NAME @@ -36,6 +36,10 @@ decode.h \- API for Brotli decompression\&. .in +1c .ti -1c +.RI "\fBBROTLI_BOOL\fP \fBBrotliDecoderAttachDictionary\fP (\fBBrotliDecoderState\fP *state, BrotliSharedDictionaryType type, size_t data_size, const uint8_t data[data_size])" +.br +.RI "\fIAdds LZ77 prefix dictionary, adds or replaces built-in static dictionary and transforms\&. \fP" +.ti -1c .RI "\fBBrotliDecoderState\fP * \fBBrotliDecoderCreateInstance\fP (\fBbrotli_alloc_func\fP alloc_func, \fBbrotli_free_func\fP free_func, void *opaque)" .br .RI "\fICreates an instance of \fBBrotliDecoderState\fP and initializes it\&. \fP" @@ -167,6 +171,35 @@ Partially done; should be called again with more input\&. Partially done; should be called again with more output\&. .SH "Function Documentation" .PP +.SS "\fBBROTLI_BOOL\fP BrotliDecoderAttachDictionary (\fBBrotliDecoderState\fP * state, BrotliSharedDictionaryType type, size_t data_size, const uint8_t data[data_size])" + +.PP +Adds LZ77 prefix dictionary, adds or replaces built-in static dictionary and transforms\&. Attached dictionary ownership is not transferred\&. Data provided to this method should be kept accessible until decoding is finished and decoder instance is destroyed\&. +.PP +\fBNote:\fP +.RS 4 +Dictionaries can NOT be attached after actual decoding is started\&. +.RE +.PP +\fBParameters:\fP +.RS 4 +\fIstate\fP decoder instance +.br +\fItype\fP dictionary data format +.br +\fIdata_size\fP length of memory region pointed by \fCdata\fP +.br +\fIdata\fP dictionary data in format corresponding to \fCtype\fP +.RE +.PP +\fBReturns:\fP +.RS 4 +\fBBROTLI_FALSE\fP if dictionary is corrupted, or dictionary count limit is reached +.PP +\fBBROTLI_TRUE\fP if dictionary is accepted / attached +.RE +.PP + .SS "\fBBrotliDecoderState\fP* BrotliDecoderCreateInstance (\fBbrotli_alloc_func\fP alloc_func, \fBbrotli_free_func\fP free_func, void * opaque)" .PP diff --git a/docs/encode.h.3 b/docs/encode.h.3 index 0cab816..e31b6b4 100644 --- a/docs/encode.h.3 +++ b/docs/encode.h.3 @@ -1,4 +1,4 @@ -.TH "encode.h" 3 "Thu Feb 22 2018" "Brotli" \" -*- nroff -*- +.TH "encode.h" 3 "August 2021" "Brotli" \" -*- nroff -*- .ad l .nh .SH NAME @@ -76,6 +76,10 @@ encode.h \- API for Brotli compression\&. .in +1c .ti -1c +.RI "\fBBROTLI_BOOL\fP \fBBrotliEncoderAttachPreparedDictionary\fP (\fBBrotliEncoderState\fP *state, const BrotliEncoderPreparedDictionary *dictionary)" +.br +.RI "\fIAttaches a prepared dictionary of any type to the encoder\&. \fP" +.ti -1c .RI "\fBBROTLI_BOOL\fP \fBBrotliEncoderCompress\fP (int quality, int lgwin, \fBBrotliEncoderMode\fP mode, size_t input_size, const uint8_t input_buffer[input_size], size_t *encoded_size, uint8_t encoded_buffer[*encoded_size])" .br .RI "\fIPerforms one-shot memory-to-memory compression\&. \fP" @@ -104,6 +108,10 @@ encode.h \- API for Brotli compression\&. .br .RI "\fICalculates the output size bound for the given \fCinput_size\fP\&. \fP" .ti -1c +.RI "BrotliEncoderPreparedDictionary * \fBBrotliEncoderPrepareDictionary\fP (BrotliSharedDictionaryType type, size_t data_size, const uint8_t data[data_size], int quality, \fBbrotli_alloc_func\fP alloc_func, \fBbrotli_free_func\fP free_func, void *opaque)" +.br +.RI "\fIPrepares a shared dictionary from the given file format for the encoder\&. \fP" +.ti -1c .RI "\fBBROTLI_BOOL\fP \fBBrotliEncoderSetParameter\fP (\fBBrotliEncoderState\fP *state, \fBBrotliEncoderParameter\fP param, uint32_t value)" .br .RI "\fISets the specified parameter to the given encoder instance\&. \fP" @@ -318,6 +326,19 @@ If offset is not 0, then stream header is omitted\&. In any case output start is Range is not artificially limited, but all the values greater or equal to maximal window size have the same effect\&. Values greater than 2**30 are not allowed\&. .SH "Function Documentation" .PP +.SS "\fBBROTLI_BOOL\fP BrotliEncoderAttachPreparedDictionary (\fBBrotliEncoderState\fP * state, const BrotliEncoderPreparedDictionary * dictionary)" + +.PP +Attaches a prepared dictionary of any type to the encoder\&. Can be used multiple times to attach multiple dictionaries\&. The dictionary type was determined by BrotliEncoderPrepareDictionary\&. Multiple raw prefix dictionaries and/or max 1 serialized dictionary with custom words can be attached\&. +.PP +\fBReturns:\fP +.RS 4 +\fBBROTLI_FALSE\fP in case of error +.PP +\fBBROTLI_TRUE\fP otherwise +.RE +.PP + .SS "\fBBROTLI_BOOL\fP BrotliEncoderCompress (int quality, int lgwin, \fBBrotliEncoderMode\fP mode, size_t input_size, const uint8_t input_buffer[input_size], size_t * encoded_size, uint8_t encoded_buffer[*encoded_size])" .PP @@ -509,6 +530,29 @@ Result is only valid if quality is at least \fC2\fP and, in case \fBBrotliEncode .RE .PP +.SS "BrotliEncoderPreparedDictionary* BrotliEncoderPrepareDictionary (BrotliSharedDictionaryType type, size_t data_size, const uint8_t data[data_size], int quality, \fBbrotli_alloc_func\fP alloc_func, \fBbrotli_free_func\fP free_func, void * opaque)" + +.PP +Prepares a shared dictionary from the given file format for the encoder\&. \fCalloc_func\fP and \fCfree_func\fP \fBMUST\fP be both zero or both non-zero\&. In the case they are both zero, default memory allocators are used\&. \fCopaque\fP is passed to \fCalloc_func\fP and \fCfree_func\fP when they are called\&. \fCfree_func\fP has to return without doing anything when asked to free a NULL pointer\&. +.PP +\fBParameters:\fP +.RS 4 +\fItype\fP type of dictionary stored in data +.br +\fIdata_size\fP size of \fCdata\fP buffer +.br +\fIdata\fP pointer to the dictionary data +.br +\fIquality\fP the maximum Brotli quality to prepare the dictionary for, use BROTLI_MAX_QUALITY by default +.br +\fIalloc_func\fP custom memory allocation function +.br +\fIfree_func\fP custom memory free function +.br +\fIopaque\fP custom memory manager handle +.RE +.PP + .SS "\fBBROTLI_BOOL\fP BrotliEncoderSetParameter (\fBBrotliEncoderState\fP * state, \fBBrotliEncoderParameter\fP param, uint32_t value)" .PP diff --git a/docs/types.h.3 b/docs/types.h.3 index bef9313..3d8a98c 100644 --- a/docs/types.h.3 +++ b/docs/types.h.3 @@ -1,4 +1,4 @@ -.TH "types.h" 3 "Thu Feb 22 2018" "Brotli" \" -*- nroff -*- +.TH "types.h" 3 "August 2021" "Brotli" \" -*- nroff -*- .ad l .nh .SH NAME -- cgit v1.1