mirror of
https://github.com/pbatard/rufus.git
synced 2025-05-24 19:54:25 -04:00
[cmp] add decompression support
* Adds .Z, .gz, .lzma, .xz and .bz2 decompression support for DD images using the Bled library (https://github.com/pbatard/bled). * Closes #269
This commit is contained in:
parent
3f0e71f3ba
commit
7599715ae6
56 changed files with 10020 additions and 89 deletions
41
src/bled/bled.h
Normal file
41
src/bled/bled.h
Normal file
|
@ -0,0 +1,41 @@
|
|||
/*
|
||||
* Bled (Busybox Library for Easy Decompression)
|
||||
*
|
||||
* Copyright © 2014 Pete Batard <pete@akeo.ie>
|
||||
*
|
||||
* Licensed under GPLv2 or later, see file LICENSE in this source tree.
|
||||
*/
|
||||
|
||||
#include <windows.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifndef ARRAYSIZE
|
||||
#define ARRAYSIZE(A) (sizeof(A)/sizeof((A)[0]))
|
||||
#endif
|
||||
|
||||
typedef void (*printf_t) (const char* format, ...);
|
||||
typedef void (*progress_t) (const uint64_t processed_bytes);
|
||||
|
||||
typedef enum {
|
||||
BLED_COMPRESSION_NONE = 0,
|
||||
BLED_COMPRESSION_ZIP, // .zip
|
||||
BLED_COMPRESSION_LZW, // .Z
|
||||
BLED_COMPRESSION_GZIP, // .gz
|
||||
BLED_COMPRESSION_LZMA, // .lzma
|
||||
BLED_COMPRESSION_BZIP2, // .bz2
|
||||
BLED_COMPRESSION_XZ, // .xz
|
||||
// BLED_COMPRESSION_7ZIP // .7z
|
||||
BLED_COMPRESSION_MAX
|
||||
} bled_compression_type;
|
||||
|
||||
/* Uncompress file 'src', compressed using 'type', to file 'dst' */
|
||||
int64_t bled_uncompress(const char* src, const char* dst, int type);
|
||||
|
||||
int64_t bled_uncompress_with_handles(HANDLE hSrc, HANDLE hDst, int type);
|
||||
|
||||
/* Initialize the library */
|
||||
int bled_init(printf_t print_function, progress_t progress_function);
|
||||
|
||||
void bled_exit(void);
|
Loading…
Add table
Add a link
Reference in a new issue