]> granicus.if.org Git - xz/commitdiff
liblzma: Make lzma_index_decoder_init() visible to other liblzma funcs.
authorLasse Collin <lasse.collin@tukaani.org>
Thu, 30 Mar 2017 17:03:05 +0000 (20:03 +0300)
committerLasse Collin <lasse.collin@tukaani.org>
Thu, 30 Mar 2017 17:03:05 +0000 (20:03 +0300)
This is to allow other functions to use it without going
via the public API (lzma_index_decoder()).

src/liblzma/common/Makefile.inc
src/liblzma/common/index_decoder.c
src/liblzma/common/index_decoder.h [new file with mode: 0644]

index 6ca6adddae711f36abb45fe5f1a3042e1a78575a..67c8e48ca366555bf6aedb1aaf4a72bb5f6f850c 100644 (file)
@@ -70,6 +70,7 @@ liblzma_la_SOURCES += \
        common/filter_decoder.h \
        common/filter_flags_decoder.c \
        common/index_decoder.c \
+       common/index_decoder.h \
        common/index_hash.c \
        common/stream_buffer_decoder.c \
        common/stream_decoder.c \
index cc07a1b8c5335623778e1075d1916c5447ebcde3..e71fc6dfa7e03a56c58119aa5a241d8256e3a373 100644 (file)
@@ -10,7 +10,7 @@
 //
 ///////////////////////////////////////////////////////////////////////////////
 
-#include "index.h"
+#include "index_decoder.h"
 #include "check.h"
 
 
@@ -265,11 +265,11 @@ index_decoder_reset(lzma_index_coder *coder, const lzma_allocator *allocator,
 }
 
 
-static lzma_ret
-index_decoder_init(lzma_next_coder *next, const lzma_allocator *allocator,
+extern lzma_ret
+lzma_index_decoder_init(lzma_next_coder *next, const lzma_allocator *allocator,
                lzma_index **i, uint64_t memlimit)
 {
-       lzma_next_coder_init(&index_decoder_init, next, allocator);
+       lzma_next_coder_init(&lzma_index_decoder_init, next, allocator);
 
        if (i == NULL)
                return LZMA_PROG_ERROR;
@@ -296,7 +296,7 @@ index_decoder_init(lzma_next_coder *next, const lzma_allocator *allocator,
 extern LZMA_API(lzma_ret)
 lzma_index_decoder(lzma_stream *strm, lzma_index **i, uint64_t memlimit)
 {
-       lzma_next_strm_init(index_decoder_init, strm, i, memlimit);
+       lzma_next_strm_init(lzma_index_decoder_init, strm, i, memlimit);
 
        strm->internal->supported_actions[LZMA_RUN] = true;
        strm->internal->supported_actions[LZMA_FINISH] = true;
diff --git a/src/liblzma/common/index_decoder.h b/src/liblzma/common/index_decoder.h
new file mode 100644 (file)
index 0000000..1af433b
--- /dev/null
@@ -0,0 +1,24 @@
+///////////////////////////////////////////////////////////////////////////////
+//
+/// \file       index_decoder.h
+/// \brief      Decodes the Index field
+//
+//  Author:     Lasse Collin
+//
+//  This file has been put into the public domain.
+//  You can do whatever you want with this file.
+//
+///////////////////////////////////////////////////////////////////////////////
+
+#ifndef LZMA_INDEX_DECODER_H
+#define LZMA_INDEX_DECODER_H
+
+#include "index.h"
+
+
+extern lzma_ret lzma_index_decoder_init(lzma_next_coder *next,
+               const lzma_allocator *allocator,
+               lzma_index **i, uint64_t memlimit);
+
+
+#endif