44#if defined(_MSC_VER) && !defined(__cplusplus) // Visual Studio
45# define inline __inline // Visual is not C99, but supports some kind of inline
46#endif
47
48
49//****************************
50// Simple Functions
51//****************************
52
53intLZ4_compress (constchar* source, char* dest, int isize);
54intLZ4_uncompress (constchar* source, char* dest, int osize);
55
56/*
57LZ4_compress() :
58 Compresses 'isize' bytes from 'source' into 'dest'.
59 Destination buffer must be already allocated,
60 and must be sized to handle worst cases situations (input data not compressible)
61 Worst case size evaluation is provided by function LZ4_compressBound()
62
63 isize : is the input size. Max supported value is ~1.9GB
64 return : the number of bytes written in buffer dest
65
66
67LZ4_uncompress() :
68 osize : is the output size, therefore the original size
69 return : the number of bytes read in the source buffer
70 If the source stream is malformed, the function will stop decoding and return a negative result, indicating the byte position of the faulty instruction
71 This function never writes outside of provided buffers, and never modifies input buffer.
72 note : destination buffer must be already allocated.
116 isize : is the input size, therefore the compressed size
117 maxOutputSize : is the size of the destination buffer (which must be already allocated)
118 return : the number of bytes decoded in the destination buffer (necessarily <= maxOutputSize)
119 If the source stream is malformed, the function will stop decoding and return a negative result, indicating the byte position of the faulty instruction
120 This function never writes beyond dest + maxOutputSize, and is therefore protected against malicious data packets
121 note : Destination buffer must be already allocated.
122 This version is slightly slower than LZ4_uncompress()