summaryrefslogtreecommitdiffstats
path: root/lib/lz4frame.h
diff options
context:
space:
mode:
authorYann Collet <cyan@fb.com>2022-07-13 23:29:58 (GMT)
committerYann Collet <cyan@fb.com>2022-07-13 23:36:18 (GMT)
commite535d6424a2952dad6db73e2882abaef76a5e5e8 (patch)
treecf03d23dcc474643215beac24165a6fc0c2e3a4f /lib/lz4frame.h
parenta3c4f0d0a31580da09a955b6783203d6c383a9e4 (diff)
downloadlz4-e535d6424a2952dad6db73e2882abaef76a5e5e8.zip
lz4-e535d6424a2952dad6db73e2882abaef76a5e5e8.tar.gz
lz4-e535d6424a2952dad6db73e2882abaef76a5e5e8.tar.bz2
implemented LZ4F_createCDict_advanced()
Diffstat (limited to 'lib/lz4frame.h')
-rw-r--r--lib/lz4frame.h50
1 files changed, 26 insertions, 24 deletions
diff --git a/lib/lz4frame.h b/lib/lz4frame.h
index 0d2ebf9..74df963 100644
--- a/lib/lz4frame.h
+++ b/lib/lz4frame.h
@@ -551,30 +551,6 @@ typedef enum { LZ4F_LIST_ERRORS(LZ4F_GENERATE_ENUM)
LZ4FLIB_STATIC_API LZ4F_errorCodes LZ4F_getErrorCode(size_t functionResult);
-/*! Custom memory allocation :
- * These prototypes make it possible to pass custom allocation/free functions.
- * LZ4F_customMem is provided at state creation time, using LZ4F_createCompressionContext_advanced() listed below.
- * All allocation/free operations will be completed using these custom variants instead of regular <stdlib.h> ones.
- */
-typedef void* (*LZ4F_AllocFunction) (void* opaqueState, size_t size);
-typedef void* (*LZ4F_CallocFunction) (void* opaqueState, size_t size);
-typedef void (*LZ4F_FreeFunction) (void* opaqueState, void* address);
-typedef struct {
- LZ4F_AllocFunction customAlloc;
- LZ4F_CallocFunction customCalloc; /* optional; when not defined, uses customAlloc + memset */
- LZ4F_FreeFunction customFree;
- void* opaqueState;
-} LZ4F_CustomMem;
-static
-#ifdef __GNUC__
-__attribute__((__unused__))
-#endif
-LZ4F_CustomMem const LZ4F_defaultCMem = { NULL, NULL, NULL, NULL }; /**< this constant defers to stdlib's functions */
-
-LZ4FLIB_STATIC_API LZ4F_cctx* LZ4F_createCompressionContext_advanced(LZ4F_CustomMem customMem, unsigned version);
-LZ4FLIB_STATIC_API LZ4F_dctx* LZ4F_createDecompressionContext_advanced(LZ4F_CustomMem customMem, unsigned version);
-
-
/*! LZ4F_getBlockSize() :
* Return, in scalar format (size_t),
* the maximum block size associated with blockSizeID.
@@ -674,6 +650,32 @@ LZ4FLIB_STATIC_API size_t LZ4F_decompress_usingDict(
const void* dict, size_t dictSize,
const LZ4F_decompressOptions_t* decompressOptionsPtr);
+
+/*! Custom memory allocation :
+ * These prototypes make it possible to pass custom allocation/free functions.
+ * LZ4F_customMem is provided at state creation time, using LZ4F_create*_advanced() listed below.
+ * All allocation/free operations will be completed using these custom variants instead of regular <stdlib.h> ones.
+ */
+typedef void* (*LZ4F_AllocFunction) (void* opaqueState, size_t size);
+typedef void* (*LZ4F_CallocFunction) (void* opaqueState, size_t size);
+typedef void (*LZ4F_FreeFunction) (void* opaqueState, void* address);
+typedef struct {
+ LZ4F_AllocFunction customAlloc;
+ LZ4F_CallocFunction customCalloc; /* optional; when not defined, uses customAlloc + memset */
+ LZ4F_FreeFunction customFree;
+ void* opaqueState;
+} LZ4F_CustomMem;
+static
+#ifdef __GNUC__
+__attribute__((__unused__))
+#endif
+LZ4F_CustomMem const LZ4F_defaultCMem = { NULL, NULL, NULL, NULL }; /**< this constant defers to stdlib's functions */
+
+LZ4FLIB_STATIC_API LZ4F_cctx* LZ4F_createCompressionContext_advanced(LZ4F_CustomMem customMem, unsigned version);
+LZ4FLIB_STATIC_API LZ4F_dctx* LZ4F_createDecompressionContext_advanced(LZ4F_CustomMem customMem, unsigned version);
+LZ4FLIB_STATIC_API LZ4F_CDict* LZ4F_createCDict_advanced(LZ4F_CustomMem customMem, const void* dictBuffer, size_t dictSize);
+
+
#if defined (__cplusplus)
}
#endif