]> icculus.org git repositories - icculus/xz.git/blob - src/liblzma/common/easy_single.c
Don't fill allocated memory with 0xFD when debugging is
[icculus/xz.git] / src / liblzma / common / easy_single.c
1 ///////////////////////////////////////////////////////////////////////////////
2 //
3 /// \file       easy_single.c
4 /// \brief      Easy Single-Block Stream encoder initialization
5 //
6 //  Copyright (C) 2008 Lasse Collin
7 //
8 //  This library is free software; you can redistribute it and/or
9 //  modify it under the terms of the GNU Lesser General Public
10 //  License as published by the Free Software Foundation; either
11 //  version 2.1 of the License, or (at your option) any later version.
12 //
13 //  This library is distributed in the hope that it will be useful,
14 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
15 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16 //  Lesser General Public License for more details.
17 //
18 ///////////////////////////////////////////////////////////////////////////////
19
20 #include "easy_common.h"
21
22
23 extern LZMA_API lzma_ret
24 lzma_easy_encoder_single(lzma_stream *strm, lzma_easy_level level)
25 {
26         lzma_options_stream opt_stream = {
27                 .check = LZMA_CHECK_CRC32,
28                 .has_crc32 = true,
29                 .uncompressed_size = LZMA_VLI_VALUE_UNKNOWN,
30                 .alignment = 0,
31         };
32
33         if (lzma_easy_set_filters(opt_stream.filters, level))
34                 return LZMA_HEADER_ERROR;
35
36         return lzma_stream_encoder_single(strm, &opt_stream);
37 }