]> icculus.org git repositories - icculus/xz.git/blob - src/liblzma/lzma/lzma_encoder.h
Miscellaneous LZ and LZMA encoder cleanups
[icculus/xz.git] / src / liblzma / lzma / lzma_encoder.h
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 /// \file       lzma_encoder.h
4 /// \brief      LZMA encoder API
5 //
6 //  Copyright (C) 1999-2006 Igor Pavlov
7 //  Copyright (C) 2007 Lasse Collin
8 //
9 //  This library is free software; you can redistribute it and/or
10 //  modify it under the terms of the GNU Lesser General Public
11 //  License as published by the Free Software Foundation; either
12 //  version 2.1 of the License, or (at your option) any later version.
13 //
14 //  This library is distributed in the hope that it will be useful,
15 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
16 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
17 //  Lesser General Public License for more details.
18 //
19 ///////////////////////////////////////////////////////////////////////////////
20
21 #ifndef LZMA_LZMA_ENCODER_H
22 #define LZMA_LZMA_ENCODER_H
23
24 #include "common.h"
25
26
27 extern lzma_ret lzma_lzma_encoder_init(lzma_next_coder *next,
28                 lzma_allocator *allocator, const lzma_filter_info *filters);
29
30
31 extern uint64_t lzma_lzma_encoder_memusage(const void *options);
32
33 extern lzma_ret lzma_lzma_props_encode(const void *options, uint8_t *out);
34
35
36 /// Encodes lc/lp/pb into one byte. Returns false on success and true on error.
37 extern bool lzma_lzma_lclppb_encode(
38                 const lzma_options_lzma *options, uint8_t *byte);
39
40
41 #ifdef HAVE_SMALL
42
43 /// Initializes the lzma_fastpos[] array.
44 extern void lzma_fastpos_init(void);
45
46 #endif
47
48
49 #ifdef LZMA_LZ_ENCODER_H
50
51 /// Initializes raw LZMA encoder; this is used by LZMA2.
52 extern lzma_ret lzma_lzma_encoder_create(
53                 lzma_coder **coder_ptr, lzma_allocator *allocator,
54                 const lzma_options_lzma *options, lzma_lz_options *lz_options);
55
56
57 /// Resets an already initialized LZMA encoder; this is used by LZMA2.
58 extern void lzma_lzma_encoder_reset(
59                 lzma_coder *coder, const lzma_options_lzma *options);
60
61
62 extern lzma_ret lzma_lzma_encode(lzma_coder *restrict coder,
63                 lzma_mf *restrict mf, uint8_t *restrict out,
64                 size_t *restrict out_pos, size_t out_size,
65                 uint32_t read_limit);
66
67 #endif
68
69 #endif