Tests: Fix memory leaks in test_block_header.
[xz/debian.git] / src / liblzma / lzma / lzma_encoder.h
blob84d8c9163f2d98a1bf05b5b4ab22cbc4f7c78019
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 /// \file lzma_encoder.h
4 /// \brief LZMA encoder API
5 ///
6 // Authors: Igor Pavlov
7 // Lasse Collin
8 //
9 // This file has been put into the public domain.
10 // You can do whatever you want with this file.
12 ///////////////////////////////////////////////////////////////////////////////
14 #ifndef LZMA_LZMA_ENCODER_H
15 #define LZMA_LZMA_ENCODER_H
17 #include "common.h"
20 typedef struct lzma_lzma1_encoder_s lzma_lzma1_encoder;
23 extern lzma_ret lzma_lzma_encoder_init(lzma_next_coder *next,
24 const lzma_allocator *allocator,
25 const lzma_filter_info *filters);
28 extern uint64_t lzma_lzma_encoder_memusage(const void *options);
30 extern lzma_ret lzma_lzma_props_encode(const void *options, uint8_t *out);
33 /// Encodes lc/lp/pb into one byte. Returns false on success and true on error.
34 extern bool lzma_lzma_lclppb_encode(
35 const lzma_options_lzma *options, uint8_t *byte);
38 #ifdef LZMA_LZ_ENCODER_H
40 /// Initializes raw LZMA encoder; this is used by LZMA2.
41 extern lzma_ret lzma_lzma_encoder_create(
42 void **coder_ptr, const lzma_allocator *allocator,
43 lzma_vli id, const lzma_options_lzma *options,
44 lzma_lz_options *lz_options);
47 /// Resets an already initialized LZMA encoder; this is used by LZMA2.
48 extern lzma_ret lzma_lzma_encoder_reset(
49 lzma_lzma1_encoder *coder, const lzma_options_lzma *options);
52 extern lzma_ret lzma_lzma_encode(lzma_lzma1_encoder *restrict coder,
53 lzma_mf *restrict mf, uint8_t *restrict out,
54 size_t *restrict out_pos, size_t out_size,
55 uint32_t read_limit);
57 #endif
59 #endif