mirror of
https://github.com/netwide-assembler/nasm
synced 2026-08-26 16:23:04 -04:00
Move the handling of compressed data out of macro-handling-specific code. - This cleans up the code by separating out unrelated code. - This makes it much easier to e.g. change from zlib to some other compression format (which could even be host-specific), and abstracts the representation of a compressed data unit. - Allows future reuse for other purposes. Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
30 lines
781 B
C
30 lines
781 B
C
/* SPDX-License-Identifier: BSD-2-Clause */
|
|
/* Copyright 1996-2025 The NASM Authors - All Rights Reserved */
|
|
|
|
/*
|
|
* zdata.h - compressed data functions
|
|
*/
|
|
|
|
#ifndef NASM_ZDATA_H
|
|
#define NASM_ZDATA_H 1
|
|
|
|
struct zdata {
|
|
unsigned int dsize, zsize;
|
|
const void *zdata;
|
|
};
|
|
|
|
/*
|
|
* Always uncompress zdata; if the data is uncompressed, return a copy of
|
|
* it in a new buffer.
|
|
*/
|
|
void *uncompress_zdata(const struct zdata *);
|
|
|
|
/*
|
|
* Uncompress zdata only if it actually compressed; otherwise return
|
|
* a pointer to the stored uncompressed data. *buf is set to the buffer
|
|
* address if it was nasm_malloc'd, otherwise NULL (this pointer can be
|
|
* safely passed to nasm_free() or nasm_delete().)
|
|
*/
|
|
const void *get_zdata(const struct zdata *, void **buf);
|
|
|
|
#endif /* NASM_ZDATA_H */
|