compress: Rename modified tinfgzip wrapper to gzip
This commit is contained in:
parent
9663318102
commit
3bf159d81c
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* tinfgzip - tiny gzip decompressor
|
* originally from tinfgzip - tiny gzip decompressor
|
||||||
*
|
*
|
||||||
* Copyright (c) 2003-2019 Joergen Ibsen
|
* Copyright (c) 2003-2019 Joergen Ibsen
|
||||||
* Copyright (c) 2023 mintsuki and contributors to the Limine project
|
* Copyright (c) 2023 mintsuki and contributors to the Limine project
|
||||||
@ -33,9 +33,9 @@ typedef enum {
|
|||||||
FEXTRA = 4,
|
FEXTRA = 4,
|
||||||
FNAME = 8,
|
FNAME = 8,
|
||||||
FCOMMENT = 16
|
FCOMMENT = 16
|
||||||
} tinf_gzip_flag;
|
} gzip_flag;
|
||||||
|
|
||||||
void *tinf_gzip_uncompress(const void *source, uint64_t sourceLen, uint64_t *outsize) {
|
void *gzip_uncompress(const void *source, uint64_t sourceLen, uint64_t *outsize) {
|
||||||
const uint8_t *src = (const uint8_t *) source;
|
const uint8_t *src = (const uint8_t *) source;
|
||||||
const uint8_t *start;
|
const uint8_t *start;
|
||||||
int res;
|
int res;
|
8
common/compress/gzip.h
Normal file
8
common/compress/gzip.h
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
#ifndef __COMPRESS__GZIP_H__
|
||||||
|
#define __COMPRESS__GZIP_H__
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
void *gzip_uncompress(const void *source, uint64_t sourceLen, uint64_t *outsize);
|
||||||
|
|
||||||
|
#endif
|
@ -1,8 +0,0 @@
|
|||||||
#ifndef __COMPRESS__TINFGZIP_H__
|
|
||||||
#define __COMPRESS__TINFGZIP_H__
|
|
||||||
|
|
||||||
#include <stdint.h>
|
|
||||||
|
|
||||||
void *tinf_gzip_uncompress(const void *source, uint64_t sourceLen, uint64_t *outsize);
|
|
||||||
|
|
||||||
#endif
|
|
@ -8,7 +8,7 @@
|
|||||||
#include <mm/pmm.h>
|
#include <mm/pmm.h>
|
||||||
#include <lib/print.h>
|
#include <lib/print.h>
|
||||||
#include <pxe/tftp.h>
|
#include <pxe/tftp.h>
|
||||||
#include <compress/tinfgzip.h>
|
#include <compress/gzip.h>
|
||||||
#include <menu.h>
|
#include <menu.h>
|
||||||
#include <lib/readline.h>
|
#include <lib/readline.h>
|
||||||
#include <crypt/blake2b.h>
|
#include <crypt/blake2b.h>
|
||||||
@ -273,8 +273,8 @@ struct file_handle *uri_open(char *uri) {
|
|||||||
if (compressed && ret != NULL) {
|
if (compressed && ret != NULL) {
|
||||||
struct file_handle *compressed_fd = ext_mem_alloc(sizeof(struct file_handle));
|
struct file_handle *compressed_fd = ext_mem_alloc(sizeof(struct file_handle));
|
||||||
void *src = freadall(ret, MEMMAP_BOOTLOADER_RECLAIMABLE);
|
void *src = freadall(ret, MEMMAP_BOOTLOADER_RECLAIMABLE);
|
||||||
if ((compressed_fd->fd = tinf_gzip_uncompress(src, ret->size, &compressed_fd->size)) == NULL) {
|
if ((compressed_fd->fd = gzip_uncompress(src, ret->size, &compressed_fd->size)) == NULL) {
|
||||||
panic(true, "tinf error");
|
panic(true, "GZip error");
|
||||||
}
|
}
|
||||||
compressed_fd->vol = ret->vol;
|
compressed_fd->vol = ret->vol;
|
||||||
compressed_fd->path = ext_mem_alloc(ret->path_len);
|
compressed_fd->path = ext_mem_alloc(ret->path_len);
|
||||||
|
Loading…
Reference in New Issue
Block a user