1 /* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2 // vim: expandtab:ts=8:sw=4:softtabstop=4:
3 ///////////////////////////////////////////////////////////////////////////////
4 //
5 /// \file       lzma_encoder.h
6 /// \brief      LZMA encoder API
7 ///
8 //  Authors:    Igor Pavlov
9 //              Lasse Collin
10 //
11 //  This file has been put into the public domain.
12 //  You can do whatever you want with this file.
13 //
14 ///////////////////////////////////////////////////////////////////////////////
15 
16 #ifndef LZMA_LZMA_ENCODER_H
17 #define LZMA_LZMA_ENCODER_H
18 
19 #include "common.h"
20 
21 
22 extern lzma_ret lzma_lzma_encoder_init(lzma_next_coder *next,
23 		lzma_allocator *allocator, const lzma_filter_info *filters);
24 
25 
26 extern uint64_t lzma_lzma_encoder_memusage(const void *options);
27 
28 extern lzma_ret lzma_lzma_props_encode(const void *options, uint8_t *out);
29 
30 
31 /// Encodes lc/lp/pb into one byte. Returns false on success and true on error.
32 extern bool lzma_lzma_lclppb_encode(
33 		const lzma_options_lzma *options, uint8_t *byte);
34 
35 
36 #ifdef LZMA_LZ_ENCODER_H
37 
38 /// Initializes raw LZMA encoder; this is used by LZMA2.
39 extern lzma_ret lzma_lzma_encoder_create(
40 		lzma_coder **coder_ptr, lzma_allocator *allocator,
41 		const lzma_options_lzma *options, lzma_lz_options *lz_options);
42 
43 
44 /// Resets an already initialized LZMA encoder; this is used by LZMA2.
45 extern lzma_ret lzma_lzma_encoder_reset(
46 		lzma_coder *coder, const lzma_options_lzma *options);
47 
48 
49 extern lzma_ret lzma_lzma_encode(lzma_coder *restrict coder,
50 		lzma_mf *restrict mf, uint8_t *restrict out,
51 		size_t *restrict out_pos, size_t out_size,
52 		uint32_t read_limit);
53 
54 #endif
55 
56 #endif
57