mirror of
https://github.com/johndoe6345789/typthon.git
synced 2026-04-25 06:05:05 +00:00
Massive automated renaming of all Py_/PyObject/etc. prefixes to Ty_/TyObject/etc. This includes: - All public API types (TyObject, TyTypeObject, etc.) - All public API functions (Ty_Initialize, Ty_BuildValue, etc.) - All internal API (_Ty_ prefixes) - Reference counting macros (Ty_INCREF, Ty_DECREF, etc.) - Type flags (Ty_TPFLAGS_*) - Debug flags (Ty_DEBUG, Ty_TRACE_REFS, etc.) - All object type APIs (TyList_, TyDict_, TyUnicode_, etc.) This changes over 60,000 occurrences across 1000+ files. Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
62 lines
1.4 KiB
C
62 lines
1.4 KiB
C
/* Low level interface to the Zstandard algorthm & the zstd library. */
|
|
|
|
/* Declarations shared between different parts of the _zstd module*/
|
|
|
|
#ifndef ZSTD_MODULE_H
|
|
#define ZSTD_MODULE_H
|
|
|
|
#include "zstddict.h"
|
|
|
|
/* Type specs */
|
|
extern TyType_Spec zstd_dict_type_spec;
|
|
extern TyType_Spec zstd_compressor_type_spec;
|
|
extern TyType_Spec zstd_decompressor_type_spec;
|
|
|
|
typedef struct {
|
|
/* Module heap types. */
|
|
TyTypeObject *ZstdDict_type;
|
|
TyTypeObject *ZstdCompressor_type;
|
|
TyTypeObject *ZstdDecompressor_type;
|
|
TyObject *ZstdError;
|
|
|
|
/* enum types set by set_parameter_types. */
|
|
TyTypeObject *CParameter_type;
|
|
TyTypeObject *DParameter_type;
|
|
} _zstd_state;
|
|
|
|
typedef enum {
|
|
ERR_DECOMPRESS,
|
|
ERR_COMPRESS,
|
|
ERR_SET_PLEDGED_INPUT_SIZE,
|
|
|
|
ERR_LOAD_D_DICT,
|
|
ERR_LOAD_C_DICT,
|
|
|
|
ERR_GET_C_BOUNDS,
|
|
ERR_GET_D_BOUNDS,
|
|
ERR_SET_C_LEVEL,
|
|
|
|
ERR_TRAIN_DICT,
|
|
ERR_FINALIZE_DICT,
|
|
} error_type;
|
|
|
|
typedef enum {
|
|
DICT_TYPE_DIGESTED = 0,
|
|
DICT_TYPE_UNDIGESTED = 1,
|
|
DICT_TYPE_PREFIX = 2
|
|
} dictionary_type;
|
|
|
|
extern ZstdDict *
|
|
_Ty_parse_zstd_dict(const _zstd_state *state,
|
|
TyObject *dict, int *type);
|
|
|
|
/* Format error message and set ZstdError. */
|
|
extern void
|
|
set_zstd_error(const _zstd_state *state,
|
|
error_type type, size_t zstd_ret);
|
|
|
|
extern void
|
|
set_parameter_error(int is_compress, int key_v, int value_v);
|
|
|
|
#endif // !ZSTD_MODULE_H
|