| // Copyright (c) 2016 Google Inc. All rights reserved. |
| |
| /////////////////////////////////////////////////////////////////////////////// |
| //! \file xzdec.h |
| //! \brief decode a xz compressed input stream. |
| /////////////////////////////////////////////////////////////////////////////// |
| |
| #ifndef _XZDEC_H_ |
| #define _XZDEC_H_ |
| |
| #if defined (__cplusplus) |
| extern "C" { |
| #endif //__cplusplus |
| |
| #define XZ_MAGIC "\3757zXZ" |
| #define XZ_MAGIC_SIZE sizeof(XZ_MAGIC) |
| |
| /** @brief decode a compressed xz stream, only |
| * started with xz_magic supported. |
| * |
| * |
| * @param in_buf the input stream buffer, contains the full |
| * input data, started with xz_magic. |
| * @param input_size the whole input stream size, including the magic, |
| * in bytes. |
| * @param out_buf the decoded result. |
| * @param output_size the decode output buffer size when used as input, |
| * and final decoded stream length in bytes as output. |
| * @return 0 if success, negative if failed. |
| */ |
| int xz_decompress(const unsigned char *in_buf, const unsigned int input_size, |
| unsigned char *out_buf, unsigned int *output_size); |
| |
| #if defined (__cplusplus) |
| } |
| #endif //__cplusplus |
| |
| #endif //_XZDEC_H_ |