1 ///////////////////////////////////////////////////////////////////////////////
3 /// \file easy_single.c
4 /// \brief Easy Single-Block Stream encoder initialization
6 // Copyright (C) 2008 Lasse Collin
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.
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.
18 ///////////////////////////////////////////////////////////////////////////////
20 #include "easy_common.h"
23 extern LZMA_API lzma_ret
24 lzma_easy_encoder_single(lzma_stream *strm, lzma_easy_level level)
26 lzma_options_stream opt_stream = {
27 .check = LZMA_CHECK_CRC32,
29 .uncompressed_size = LZMA_VLI_VALUE_UNKNOWN,
33 if (lzma_easy_set_filters(opt_stream.filters, level))
34 return LZMA_HEADER_ERROR;
36 return lzma_stream_encoder_single(strm, &opt_stream);