Changeset 826f3afa in rtems for cpukit/libmisc/untar/untar.h


Ignore:
Timestamp:
Oct 11, 2016, 10:15:23 PM (4 years ago)
Author:
Chris Johns <chrisj@…>
Branches:
5, master
Children:
f5eff00
Parents:
be57318
git-author:
Chris Johns <chrisj@…> (10/11/16 22:15:23)
git-committer:
Chris Johns <chrisj@…> (10/13/16 02:11:40)
Message:

libmisc/xz: Add xz decompression.

Add support to untar XZ compressed files.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libmisc/untar/untar.h

    rbe57318 r826f3afa  
    2222#include <tar.h>
    2323#include <zlib.h>
     24#include <xz.h>
    2425
    2526#include <rtems/print.h>
     
    118119} Untar_GzChunkContext;
    119120
     121typedef struct {
     122  /**
     123   * @brief Instance of Chunk Context needed for tar decompression.
     124   */
     125  Untar_ChunkContext base;
     126
     127  /**
     128   * @brief Xz context.
     129   */
     130  struct xz_dec* strm;
     131
     132  /**
     133   * @brief Xz buffer.
     134   */
     135  struct xz_buf buf;
     136
     137  /**
     138   * @brief Buffer that contains the inflated data.
     139   */
     140  void *inflateBuffer;
     141
     142  /**
     143   * @brief Size of buffer that contains the inflated data.
     144   */
     145  size_t inflateBufferSize;
     146
     147} Untar_XzChunkContext;
     148
    120149/**
    121150 * @brief Initializes the Untar_ChunkContext files out of a part of a block of
     
    171200int Untar_FromGzChunk_Print(
    172201  Untar_GzChunkContext *ctx,
     202  void *chunk,
     203  size_t chunk_size,
     204  const rtems_printer* printer
     205);
     206
     207/**
     208 * @brief Initializes the Untar_ChunkXzContext.
     209 *
     210 * @param Untar_ChunkXzContext *context [in] Pointer to a context structure.
     211 * @param enum xz_mode mode [in] Dictionary mode.
     212 * @param uint32_t dict_max [in] Maximum size of dictionary.
     213 * @param void *inflateBuffer [in] Pointer to a context structure.
     214 * @param size_t inflateBufferSize [in] Size of inflateBuffer.
     215 */
     216int Untar_XzChunkContext_Init(
     217  Untar_XzChunkContext *ctx,
     218  enum xz_mode mode,
     219  uint32_t dict_max,
     220  void *inflateBuffer,
     221  size_t inflateBufferSize
     222);
     223
     224/*
     225 * @brief Untars a XZ compressed POSIX TAR file.
     226 *
     227 * This is a subroutine used to rip links, directories, and
     228 * files out of a tar.gz/tgz file.
     229 *
     230 * @param Untar_ChunkContext *context [in] Pointer to a context structure.
     231 * @param ssize buflen [in] Size of valid bytes in input buffer.
     232 * @param z_stream *strm [in] Pointer to the current zlib context.
     233 */
     234int Untar_FromXzChunk_Print(
     235  Untar_XzChunkContext *ctx,
    173236  void *chunk,
    174237  size_t chunk_size,
Note: See TracChangeset for help on using the changeset viewer.