LibAwsCompression

Documentation for LibAwsCompression.

LibAwsCompression.aws_compression_library_clean_upMethod
aws_compression_library_clean_up()

Clean up internal datastructures used by aws-c-compression. Must not be called until application is done using functionality in aws-c-compression.

Prototype

void aws_compression_library_clean_up(void);
source
LibAwsCompression.aws_compression_library_initMethod
aws_compression_library_init(alloc)

Initializes internal datastructures used by aws-c-compression. Must be called before using any functionality in aws-c-compression.

Prototype

void aws_compression_library_init(struct aws_allocator *alloc);
source
LibAwsCompression.aws_huffman_decodeMethod
aws_huffman_decode(decoder, to_decode, output)

Decodes a byte buffer into the provided symbol array.

Arguments

  • decoder:[in] The decoder object to use
  • to_decode:[in] The encoded byte buffer to read from
  • output:[in] The buffer to write decoded symbols to. If decoder is set to allow growth, capacity will be increased when necessary.

Returns

AWS_OP_SUCCESS if encoding is successful, AWS_OP_ERR otherwise

Prototype

int aws_huffman_decode( struct aws_huffman_decoder *decoder, struct aws_byte_cursor *to_decode, struct aws_byte_buf *output);
source
LibAwsCompression.aws_huffman_decoder_allow_growthMethod
aws_huffman_decoder_allow_growth(decoder, allow_growth)

Set whether or not to increase capacity when the output buffer fills up while decoding. This is false by default.

Prototype

void aws_huffman_decoder_allow_growth(struct aws_huffman_decoder *decoder, bool allow_growth);
source
LibAwsCompression.aws_huffman_decoder_initMethod
aws_huffman_decoder_init(decoder, coder)

Initialize a decoder object with a symbol coder.

Prototype

void aws_huffman_decoder_init(struct aws_huffman_decoder *decoder, struct aws_huffman_symbol_coder *coder);
source
LibAwsCompression.aws_huffman_encodeMethod
aws_huffman_encode(encoder, to_encode, output)

Encode a symbol buffer into the output buffer.

Arguments

  • encoder:[in] The encoder object to use
  • to_encode:[in] The symbol buffer to encode
  • output:[in] The buffer to write encoded bytes to

Returns

AWS_OP_SUCCESS if encoding is successful, AWS_OP_ERR otherwise

Prototype

int aws_huffman_encode( struct aws_huffman_encoder *encoder, struct aws_byte_cursor *to_encode, struct aws_byte_buf *output);
source
LibAwsCompression.aws_huffman_encoder_initMethod
aws_huffman_encoder_init(encoder, coder)

Initialize a encoder object with a symbol coder.

Prototype

void aws_huffman_encoder_init(struct aws_huffman_encoder *encoder, struct aws_huffman_symbol_coder *coder);
source
LibAwsCompression.aws_huffman_get_encoded_lengthMethod
aws_huffman_get_encoded_length(encoder, to_encode)

Get the byte length of to_encode post-encoding.

Arguments

  • encoder:[in] The encoder object to use
  • to_encode:[in] The symbol buffer to encode

Returns

The length of the encoded string.

Prototype

size_t aws_huffman_get_encoded_length(struct aws_huffman_encoder *encoder, struct aws_byte_cursor to_encode);
source