ZXC 1.0.3
High-performance asymmetric lossless compression library
Loading...
Searching...
No Matches
zxc_error.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-3-Clause */
2/*
3 * ZXC - High-performance lossless compression
4 *
5 * Copyright (c) Bertrand Lebonnois and contributors.
6 */
7
16
17#ifndef ZXC_ERROR_H
18#define ZXC_ERROR_H
19
20#include "zxc_export.h"
21
22#ifdef __cplusplus
23extern "C" {
24#endif
25
30
37typedef enum {
38 ZXC_OK = 0,
39
40 /* Memory errors */
42
43 /* Buffer/capacity errors */
46
47 /* Format/header errors */
54
55 /* Data integrity errors */
59
60 /* I/O errors */
63
64 /* Block errors */
67
68 /* Dictionary errors */
72
73 /* Parameter errors */
79
81
89ZXC_EXPORT const char* zxc_error_name(const int code);
90 /* end of error */
92
93#ifdef __cplusplus
94}
95#endif
96
97#endif /* ZXC_ERROR_H */
const char * zxc_error_name(const int code)
Returns a readable name for the given error code.
zxc_error_t
Error codes returned by ZXC library functions.
Definition zxc_error.h:37
@ ZXC_ERROR_BAD_MAGIC
Invalid magic word in file header.
Definition zxc_error.h:48
@ ZXC_ERROR_BAD_VERSION
Unsupported file format version.
Definition zxc_error.h:49
@ ZXC_ERROR_BAD_BLOCK_TYPE
Unknown or unexpected block type.
Definition zxc_error.h:65
@ ZXC_ERROR_OVERFLOW
Buffer overflow detected during processing.
Definition zxc_error.h:58
@ ZXC_ERROR_BAD_OFFSET
Invalid match offset during decompression.
Definition zxc_error.h:57
@ ZXC_ERROR_CORRUPT_DATA
Corrupted compressed data.
Definition zxc_error.h:56
@ ZXC_ERROR_NULL_INPUT
Required input pointer is NULL.
Definition zxc_error.h:62
@ ZXC_ERROR_IO
Read/write/seek failure on file.
Definition zxc_error.h:61
@ ZXC_ERROR_DICT_MISMATCH
Provided dictionary ID does not match the file header.
Definition zxc_error.h:70
@ ZXC_ERROR_MEMORY
Memory allocation failure.
Definition zxc_error.h:41
@ ZXC_ERROR_BAD_HEADER
Corrupted or invalid header (checksum mismatch).
Definition zxc_error.h:50
@ ZXC_ERROR_DST_TOO_SMALL
Destination buffer too small.
Definition zxc_error.h:44
@ ZXC_ERROR_SRC_TOO_SMALL
Source buffer too small or truncated input.
Definition zxc_error.h:45
@ ZXC_ERROR_DICT_REQUIRED
File requires a dictionary but none was provided.
Definition zxc_error.h:69
@ ZXC_ERROR_DICT_UNSUPPORTED
Dictionary not supported by this context's workspace, or library built without dictionary support.
Definition zxc_error.h:75
@ ZXC_ERROR_BAD_CHECKSUM
A block's decoded bytes fail its checksum, or the archive digest mismatches.
Definition zxc_error.h:51
@ ZXC_ERROR_BAD_PARAM
Unknown parameter, or value out of its bounds (zxc_cctx_set_param(), zxc_dctx_set_param()).
Definition zxc_error.h:77
@ ZXC_ERROR_BAD_LEVEL
Compression level not supported by this context's workspace.
Definition zxc_error.h:74
@ ZXC_OK
Success (no error).
Definition zxc_error.h:38
@ ZXC_ERROR_BAD_BLOCK_SIZE
Invalid block size.
Definition zxc_error.h:66
@ ZXC_ERROR_DICT_TOO_LARGE
Dictionary exceeds maximum allowed size.
Definition zxc_error.h:71
Platform-specific symbol visibility macros.