GDAL
cpl_compressor.h
Go to the documentation of this file.
1/**********************************************************************
2 * Project: CPL - Common Portability Library
3 * Purpose: Registry of compression/decompression functions
4 * Author: Even Rouault <even.rouault at spatialys.com>
5 *
6 **********************************************************************
7 * Copyright (c) 2021, Even Rouault <even.rouault at spatialys.com>
8 *
9 * SPDX-License-Identifier: MIT
10 ****************************************************************************/
11
12#ifndef CPL_COMPRESSOR_H_INCLUDED
13#define CPL_COMPRESSOR_H_INCLUDED
14
15#include "cpl_port.h"
16
17#include <stdbool.h>
18
26
57typedef bool (*CPLCompressionFunc)(const void *input_data, size_t input_size,
58 void **output_data, size_t *output_size,
59 CSLConstList options,
60 void *compressor_user_data);
61
63typedef enum
64{
70
72typedef struct
73{
77 const char *pszId;
91 void *user_data;
93
94bool CPL_DLL CPLRegisterCompressor(const CPLCompressor *compressor);
95
96bool CPL_DLL CPLRegisterDecompressor(const CPLCompressor *decompressor);
97
98char CPL_DLL **CPLGetCompressors(void);
99
100char CPL_DLL **CPLGetDecompressors(void);
101
102const CPLCompressor CPL_DLL *CPLGetCompressor(const char *pszId);
103
104const CPLCompressor CPL_DLL *CPLGetDecompressor(const char *pszId);
105
107void CPL_DLL CPLDestroyCompressorRegistry(void);
111
112#endif // CPL_COMPRESSOR_H_INCLUDED
const CPLCompressor * CPLGetDecompressor(const char *pszId)
Return a decompressor.
Definition: cpl_compressor.cpp:1978
bool CPLRegisterDecompressor(const CPLCompressor *decompressor)
Register a new decompressor.
Definition: cpl_compressor.cpp:1882
char ** CPLGetCompressors(void)
Return the list of registered compressors.
Definition: cpl_compressor.cpp:1910
char ** CPLGetDecompressors(void)
Return the list of registered decompressors.
Definition: cpl_compressor.cpp:1931
bool(* CPLCompressionFunc)(const void *input_data, size_t input_size, void **output_data, size_t *output_size, CSLConstList options, void *compressor_user_data)
Callback of a compressor/decompressor.
Definition: cpl_compressor.h:57
CPLCompressorType
Type of compressor.
Definition: cpl_compressor.h:64
@ CCT_FILTER
Filter.
Definition: cpl_compressor.h:68
@ CCT_COMPRESSOR
Compressor.
Definition: cpl_compressor.h:66
bool CPLRegisterCompressor(const CPLCompressor *compressor)
Register a new compressor.
Definition: cpl_compressor.cpp:1850
const CPLCompressor * CPLGetCompressor(const char *pszId)
Return a compressor.
Definition: cpl_compressor.cpp:1954
Core portability definitions for CPL.
#define CPL_C_END
Macro to end a block of C symbols.
Definition: cpl_port.h:283
#define CPL_C_START
Macro to start a block of C symbols.
Definition: cpl_port.h:279
char ** CSLConstList
Type of a constant null-terminated list of nul terminated strings.
Definition: cpl_port.h:1179
Compressor/decompressor description.
Definition: cpl_compressor.h:73
void * user_data
User data to provide to the callback.
Definition: cpl_compressor.h:91
CPLCompressorType eType
Compressor type.
Definition: cpl_compressor.h:79
int nStructVersion
Structure version.
Definition: cpl_compressor.h:75
CPLCompressionFunc pfnFunc
Compressor/decompressor callback.
Definition: cpl_compressor.h:89
const char * pszId
Id of the compressor/decompressor.
Definition: cpl_compressor.h:77
CSLConstList papszMetadata
Metadata, as a NULL terminated list of strings.
Definition: cpl_compressor.h:87