liblzma: Make lzma_stream_encoder_init() static (second try).

It's an internal function and it's not needed by
anything outside stream_encoder.c.
This commit is contained in:
Lasse Collin 2011-04-11 09:27:57 +03:00
parent a34730cf6a
commit fb64a49243
4 changed files with 6 additions and 32 deletions

View File

@ -38,7 +38,6 @@ liblzma_la_SOURCES += \
common/index_encoder.h \ common/index_encoder.h \
common/stream_buffer_encoder.c \ common/stream_buffer_encoder.c \
common/stream_encoder.c \ common/stream_encoder.c \
common/stream_encoder.h \
common/stream_flags_encoder.c \ common/stream_flags_encoder.c \
common/vli_encoder.c common/vli_encoder.c
endif endif

View File

@ -11,7 +11,6 @@
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
#include "easy_preset.h" #include "easy_preset.h"
#include "stream_encoder.h"
extern LZMA_API(lzma_ret) extern LZMA_API(lzma_ret)

View File

@ -10,7 +10,6 @@
// //
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
#include "stream_encoder.h"
#include "block_encoder.h" #include "block_encoder.h"
#include "index_encoder.h" #include "index_encoder.h"
@ -26,7 +25,7 @@ struct lzma_coder_s {
} sequence; } sequence;
/// True if Block encoder has been initialized by /// True if Block encoder has been initialized by
/// lzma_stream_encoder_init() or stream_encoder_update() /// stream_encoder_init() or stream_encoder_update()
/// and thus doesn't need to be initialized in stream_encode(). /// and thus doesn't need to be initialized in stream_encode().
bool block_encoder_is_initialized; bool block_encoder_is_initialized;
@ -126,7 +125,7 @@ stream_encode(lzma_coder *coder, lzma_allocator *allocator,
} }
// Initialize the Block encoder unless it was already // Initialize the Block encoder unless it was already
// initialized by lzma_stream_encoder_init() or // initialized by stream_encoder_init() or
// stream_encoder_update(). // stream_encoder_update().
if (!coder->block_encoder_is_initialized) if (!coder->block_encoder_is_initialized)
return_if_error(block_encoder_init(coder, allocator)); return_if_error(block_encoder_init(coder, allocator));
@ -262,11 +261,11 @@ stream_encoder_update(lzma_coder *coder, lzma_allocator *allocator,
} }
extern lzma_ret static lzma_ret
lzma_stream_encoder_init(lzma_next_coder *next, lzma_allocator *allocator, stream_encoder_init(lzma_next_coder *next, lzma_allocator *allocator,
const lzma_filter *filters, lzma_check check) const lzma_filter *filters, lzma_check check)
{ {
lzma_next_coder_init(&lzma_stream_encoder_init, next, allocator); lzma_next_coder_init(&stream_encoder_init, next, allocator);
if (filters == NULL) if (filters == NULL)
return LZMA_PROG_ERROR; return LZMA_PROG_ERROR;
@ -320,7 +319,7 @@ extern LZMA_API(lzma_ret)
lzma_stream_encoder(lzma_stream *strm, lzma_stream_encoder(lzma_stream *strm,
const lzma_filter *filters, lzma_check check) const lzma_filter *filters, lzma_check check)
{ {
lzma_next_strm_init(lzma_stream_encoder_init, strm, filters, check); lzma_next_strm_init(stream_encoder_init, strm, filters, check);
strm->internal->supported_actions[LZMA_RUN] = true; strm->internal->supported_actions[LZMA_RUN] = true;
strm->internal->supported_actions[LZMA_SYNC_FLUSH] = true; strm->internal->supported_actions[LZMA_SYNC_FLUSH] = true;

View File

@ -1,23 +0,0 @@
///////////////////////////////////////////////////////////////////////////////
//
/// \file stream_encoder.h
/// \brief Encodes .xz Streams
//
// Author: Lasse Collin
//
// This file has been put into the public domain.
// You can do whatever you want with this file.
//
///////////////////////////////////////////////////////////////////////////////
#ifndef LZMA_STREAM_ENCODER_H
#define LZMA_STREAM_ENCODER_H
#include "common.h"
extern lzma_ret lzma_stream_encoder_init(
lzma_next_coder *next, lzma_allocator *allocator,
const lzma_filter *filters, lzma_check check);
#endif