compress: Rename modified tinfgzip wrapper to gzip

This commit is contained in:
mintsuki 2023-03-16 22:49:24 +01:00
parent 9663318102
commit 3bf159d81c
4 changed files with 14 additions and 14 deletions

View File

@ -1,5 +1,5 @@
/*
* tinfgzip - tiny gzip decompressor
* originally from tinfgzip - tiny gzip decompressor
*
* Copyright (c) 2003-2019 Joergen Ibsen
* Copyright (c) 2023 mintsuki and contributors to the Limine project
@ -33,9 +33,9 @@ typedef enum {
FEXTRA = 4,
FNAME = 8,
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 *start;
int res;

8
common/compress/gzip.h Normal file
View 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

View File

@ -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

View File

@ -8,7 +8,7 @@
#include <mm/pmm.h>
#include <lib/print.h>
#include <pxe/tftp.h>
#include <compress/tinfgzip.h>
#include <compress/gzip.h>
#include <menu.h>
#include <lib/readline.h>
#include <crypt/blake2b.h>
@ -273,8 +273,8 @@ struct file_handle *uri_open(char *uri) {
if (compressed && ret != NULL) {
struct file_handle *compressed_fd = ext_mem_alloc(sizeof(struct file_handle));
void *src = freadall(ret, MEMMAP_BOOTLOADER_RECLAIMABLE);
if ((compressed_fd->fd = tinf_gzip_uncompress(src, ret->size, &compressed_fd->size)) == NULL) {
panic(true, "tinf error");
if ((compressed_fd->fd = gzip_uncompress(src, ret->size, &compressed_fd->size)) == NULL) {
panic(true, "GZip error");
}
compressed_fd->vol = ret->vol;
compressed_fd->path = ext_mem_alloc(ret->path_len);