sereal 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/rsrl +1 -1
- data/ext/sereal/decode.c +9 -27
- data/ext/sereal/encode.c +10 -33
- data/ext/sereal/proto.h +0 -1
- data/ext/sereal/sereal.c +2 -6
- data/ext/sereal/sereal.h +0 -2
- metadata +2 -10
- data/ext/sereal/lz4.c +0 -822
- data/ext/sereal/lz4.h +0 -205
- data/ext/sereal/lz4/lz4.c +0 -822
- data/ext/sereal/lz4/lz4.h +0 -205
- data/ext/sereal/lz4/lz4hc.c +0 -817
- data/ext/sereal/lz4/lz4hc.h +0 -111
- data/ext/sereal/lz4hc.c +0 -817
- data/ext/sereal/lz4hc.h +0 -111
data/ext/sereal/lz4hc.h
DELETED
@@ -1,111 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
LZ4 HC - High Compression Mode of LZ4
|
3
|
-
Header File
|
4
|
-
Copyright (C) 2011-2013, Yann Collet.
|
5
|
-
BSD 2-Clause License (http://www.opensource.org/licenses/bsd-license.php)
|
6
|
-
|
7
|
-
Redistribution and use in source and binary forms, with or without
|
8
|
-
modification, are permitted provided that the following conditions are
|
9
|
-
met:
|
10
|
-
|
11
|
-
* Redistributions of source code must retain the above copyright
|
12
|
-
notice, this list of conditions and the following disclaimer.
|
13
|
-
* Redistributions in binary form must reproduce the above
|
14
|
-
copyright notice, this list of conditions and the following disclaimer
|
15
|
-
in the documentation and/or other materials provided with the
|
16
|
-
distribution.
|
17
|
-
|
18
|
-
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
19
|
-
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
20
|
-
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
21
|
-
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
22
|
-
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
23
|
-
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
24
|
-
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
25
|
-
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
26
|
-
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
27
|
-
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
28
|
-
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
29
|
-
|
30
|
-
You can contact the author at :
|
31
|
-
- LZ4 homepage : http://fastcompression.blogspot.com/p/lz4.html
|
32
|
-
- LZ4 source repository : http://code.google.com/p/lz4/
|
33
|
-
*/
|
34
|
-
#pragma once
|
35
|
-
|
36
|
-
|
37
|
-
#if defined (__cplusplus)
|
38
|
-
extern "C" {
|
39
|
-
#endif
|
40
|
-
|
41
|
-
|
42
|
-
int LZ4_compressHC (const char* source, char* dest, int inputSize);
|
43
|
-
/*
|
44
|
-
LZ4_compressHC :
|
45
|
-
return : the number of bytes in compressed buffer dest
|
46
|
-
or 0 if compression fails.
|
47
|
-
note : destination buffer must be already allocated.
|
48
|
-
To avoid any problem, size it to handle worst cases situations (input data not compressible)
|
49
|
-
Worst case size evaluation is provided by function LZ4_compressBound() (see "lz4.h")
|
50
|
-
*/
|
51
|
-
|
52
|
-
int LZ4_compressHC_limitedOutput (const char* source, char* dest, int inputSize, int maxOutputSize);
|
53
|
-
/*
|
54
|
-
LZ4_compress_limitedOutput() :
|
55
|
-
Compress 'inputSize' bytes from 'source' into an output buffer 'dest' of maximum size 'maxOutputSize'.
|
56
|
-
If it cannot achieve it, compression will stop, and result of the function will be zero.
|
57
|
-
This function never writes outside of provided output buffer.
|
58
|
-
|
59
|
-
inputSize : Max supported value is 1 GB
|
60
|
-
maxOutputSize : is maximum allowed size into the destination buffer (which must be already allocated)
|
61
|
-
return : the number of output bytes written in buffer 'dest'
|
62
|
-
or 0 if compression fails.
|
63
|
-
*/
|
64
|
-
|
65
|
-
|
66
|
-
/* Note :
|
67
|
-
Decompression functions are provided within LZ4 source code (see "lz4.h") (BSD license)
|
68
|
-
*/
|
69
|
-
|
70
|
-
|
71
|
-
/* Advanced Functions */
|
72
|
-
|
73
|
-
void* LZ4_createHC (const char* inputBuffer);
|
74
|
-
int LZ4_compressHC_continue (void* LZ4HC_Data, const char* source, char* dest, int inputSize);
|
75
|
-
int LZ4_compressHC_limitedOutput_continue (void* LZ4HC_Data, const char* source, char* dest, int inputSize, int maxOutputSize);
|
76
|
-
char* LZ4_slideInputBufferHC (void* LZ4HC_Data);
|
77
|
-
int LZ4_freeHC (void* LZ4HC_Data);
|
78
|
-
|
79
|
-
/*
|
80
|
-
These functions allow the compression of dependent blocks, where each block benefits from prior 64 KB within preceding blocks.
|
81
|
-
In order to achieve this, it is necessary to start creating the LZ4HC Data Structure, thanks to the function :
|
82
|
-
|
83
|
-
void* LZ4_createHC (const char* inputBuffer);
|
84
|
-
The result of the function is the (void*) pointer on the LZ4HC Data Structure.
|
85
|
-
This pointer will be needed in all other functions.
|
86
|
-
If the pointer returned is NULL, then the allocation has failed, and compression must be aborted.
|
87
|
-
The only parameter 'const char* inputBuffer' must, obviously, point at the beginning of input buffer.
|
88
|
-
The input buffer must be already allocated, and size at least 192KB.
|
89
|
-
'inputBuffer' will also be the 'const char* source' of the first block.
|
90
|
-
|
91
|
-
All blocks are expected to lay next to each other within the input buffer, starting from 'inputBuffer'.
|
92
|
-
To compress each block, use either LZ4_compressHC_continue() or LZ4_compressHC_limitedOutput_continue().
|
93
|
-
Their behavior are identical to LZ4_compressHC() or LZ4_compressHC_limitedOutput(),
|
94
|
-
but require the LZ4HC Data Structure as their first argument, and check that each block starts right after the previous one.
|
95
|
-
If next block does not begin immediately after the previous one, the compression will fail (return 0).
|
96
|
-
|
97
|
-
When it's no longer possible to lay the next block after the previous one (not enough space left into input buffer), a call to :
|
98
|
-
char* LZ4_slideInputBufferHC(void* LZ4HC_Data);
|
99
|
-
must be performed. It will typically copy the latest 64KB of input at the beginning of input buffer.
|
100
|
-
Note that, for this function to work properly, minimum size of an input buffer must be 192KB.
|
101
|
-
==> The memory position where the next input data block must start is provided as the result of the function.
|
102
|
-
|
103
|
-
Compression can then resume, using LZ4_compressHC_continue() or LZ4_compressHC_limitedOutput_continue(), as usual.
|
104
|
-
|
105
|
-
When compression is completed, a call to LZ4_freeHC() will release the memory used by the LZ4HC Data Structure.
|
106
|
-
*/
|
107
|
-
|
108
|
-
|
109
|
-
#if defined (__cplusplus)
|
110
|
-
}
|
111
|
-
#endif
|