Add functions missing from manual, and fix parameter alignment
This commit is contained in:
parent
a296c6646a
commit
dec2b96536
@ -168,7 +168,11 @@ int main(int argc, char *argv[]) {
|
|||||||
sout << "<pre><b>";
|
sout << "<pre><b>";
|
||||||
for (l=0; l<lines.size(); l++) {
|
for (l=0; l<lines.size(); l++) {
|
||||||
// fprintf(stderr, "line[%d]=%s\n", l, lines[l].c_str());
|
// fprintf(stderr, "line[%d]=%s\n", l, lines[l].c_str());
|
||||||
print_line(sout, lines[l]);
|
string fline = lines[l];
|
||||||
|
if (fline.substr(0, 12) == "ZSTDLIB_API " ||
|
||||||
|
fline.substr(0, 12) == string(12, ' '))
|
||||||
|
fline = fline.substr(12);
|
||||||
|
print_line(sout, fline);
|
||||||
}
|
}
|
||||||
sout << "</b><p>";
|
sout << "</b><p>";
|
||||||
for (l=0; l<comments.size(); l++) {
|
for (l=0; l<comments.size(); l++) {
|
||||||
|
@ -118,7 +118,11 @@ size_t ZSTD_freeCCtx(ZSTD_CCtx* cctx);
|
|||||||
</b><p> Same as ZSTD_compress(), requires an allocated ZSTD_CCtx (see ZSTD_createCCtx()).
|
</b><p> Same as ZSTD_compress(), requires an allocated ZSTD_CCtx (see ZSTD_createCCtx()).
|
||||||
</p></pre><BR>
|
</p></pre><BR>
|
||||||
|
|
||||||
<h3>Decompression context</h3><pre></pre><b><pre>typedef struct ZSTD_DCtx_s ZSTD_DCtx;
|
<h3>Decompression context</h3><pre> When decompressing many times,
|
||||||
|
it is recommended to allocate a context just once, and re-use it for each successive compression operation.
|
||||||
|
This will make workload friendlier for system's memory.
|
||||||
|
Use one context per thread for parallel execution in multi-threaded environments.
|
||||||
|
</pre><b><pre>typedef struct ZSTD_DCtx_s ZSTD_DCtx;
|
||||||
ZSTD_DCtx* ZSTD_createDCtx(void);
|
ZSTD_DCtx* ZSTD_createDCtx(void);
|
||||||
size_t ZSTD_freeDCtx(ZSTD_DCtx* dctx);
|
size_t ZSTD_freeDCtx(ZSTD_DCtx* dctx);
|
||||||
</pre></b><BR>
|
</pre></b><BR>
|
||||||
@ -239,6 +243,14 @@ size_t ZSTD_freeDCtx(ZSTD_DCtx* dctx);
|
|||||||
|
|
||||||
<BR></pre>
|
<BR></pre>
|
||||||
|
|
||||||
|
<h3>ZSTD_CStream management functions</h3><pre></pre><b><pre>ZSTD_CStream* ZSTD_createCStream(void);
|
||||||
|
size_t ZSTD_freeCStream(ZSTD_CStream* zcs);
|
||||||
|
</pre></b><BR>
|
||||||
|
<h3>Streaming compression functions</h3><pre></pre><b><pre>size_t ZSTD_initCStream(ZSTD_CStream* zcs, int compressionLevel);
|
||||||
|
size_t ZSTD_compressStream(ZSTD_CStream* zcs, ZSTD_outBuffer* output, ZSTD_inBuffer* input);
|
||||||
|
size_t ZSTD_flushStream(ZSTD_CStream* zcs, ZSTD_outBuffer* output);
|
||||||
|
size_t ZSTD_endStream(ZSTD_CStream* zcs, ZSTD_outBuffer* output);
|
||||||
|
</pre></b><BR>
|
||||||
<pre><b>size_t ZSTD_CStreamInSize(void); </b>/**< recommended size for input buffer */<b>
|
<pre><b>size_t ZSTD_CStreamInSize(void); </b>/**< recommended size for input buffer */<b>
|
||||||
</b></pre><BR>
|
</b></pre><BR>
|
||||||
<pre><b>size_t ZSTD_CStreamOutSize(void); </b>/**< recommended size for output buffer. Guarantee to successfully flush at least one complete compressed block in all circumstances. */<b>
|
<pre><b>size_t ZSTD_CStreamOutSize(void); </b>/**< recommended size for output buffer. Guarantee to successfully flush at least one complete compressed block in all circumstances. */<b>
|
||||||
@ -264,6 +276,12 @@ size_t ZSTD_freeDCtx(ZSTD_DCtx* dctx);
|
|||||||
|
|
||||||
<BR></pre>
|
<BR></pre>
|
||||||
|
|
||||||
|
<h3>ZSTD_DStream management functions</h3><pre></pre><b><pre>ZSTD_DStream* ZSTD_createDStream(void);
|
||||||
|
size_t ZSTD_freeDStream(ZSTD_DStream* zds);
|
||||||
|
</pre></b><BR>
|
||||||
|
<h3>Streaming decompression functions</h3><pre></pre><b><pre>size_t ZSTD_initDStream(ZSTD_DStream* zds);
|
||||||
|
size_t ZSTD_decompressStream(ZSTD_DStream* zds, ZSTD_outBuffer* output, ZSTD_inBuffer* input);
|
||||||
|
</pre></b><BR>
|
||||||
<pre><b>size_t ZSTD_DStreamInSize(void); </b>/*!< recommended size for input buffer */<b>
|
<pre><b>size_t ZSTD_DStreamInSize(void); </b>/*!< recommended size for input buffer */<b>
|
||||||
</b></pre><BR>
|
</b></pre><BR>
|
||||||
<pre><b>size_t ZSTD_DStreamOutSize(void); </b>/*!< recommended size for output buffer. Guarantee to successfully flush at least one complete block in all circumstances. */<b>
|
<pre><b>size_t ZSTD_DStreamOutSize(void); </b>/*!< recommended size for output buffer. Guarantee to successfully flush at least one complete block in all circumstances. */<b>
|
||||||
@ -443,6 +461,11 @@ typedef struct { ZSTD_allocFunction customAlloc; ZSTD_freeFunction customFree; v
|
|||||||
It is important that dictBuffer outlives DDict, it must remain read accessible throughout the lifetime of DDict
|
It is important that dictBuffer outlives DDict, it must remain read accessible throughout the lifetime of DDict
|
||||||
</p></pre><BR>
|
</p></pre><BR>
|
||||||
|
|
||||||
|
<pre><b>ZSTD_DDict* ZSTD_createDDict_advanced(const void* dict, size_t dictSize,
|
||||||
|
unsigned byReference, ZSTD_customMem customMem);
|
||||||
|
</b><p> Create a ZSTD_DDict using external alloc and free, optionally by reference
|
||||||
|
</p></pre><BR>
|
||||||
|
|
||||||
<pre><b>size_t ZSTD_sizeof_DDict(const ZSTD_DDict* ddict);
|
<pre><b>size_t ZSTD_sizeof_DDict(const ZSTD_DDict* ddict);
|
||||||
</b><p> Gives the amount of memory used by a given ZSTD_DDict
|
</b><p> Gives the amount of memory used by a given ZSTD_DDict
|
||||||
</p></pre><BR>
|
</p></pre><BR>
|
||||||
|
12
lib/zstd.h
12
lib/zstd.h
@ -139,7 +139,11 @@ ZSTDLIB_API size_t ZSTD_freeCCtx(ZSTD_CCtx* cctx);
|
|||||||
Same as ZSTD_compress(), requires an allocated ZSTD_CCtx (see ZSTD_createCCtx()). */
|
Same as ZSTD_compress(), requires an allocated ZSTD_CCtx (see ZSTD_createCCtx()). */
|
||||||
ZSTDLIB_API size_t ZSTD_compressCCtx(ZSTD_CCtx* ctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize, int compressionLevel);
|
ZSTDLIB_API size_t ZSTD_compressCCtx(ZSTD_CCtx* ctx, void* dst, size_t dstCapacity, const void* src, size_t srcSize, int compressionLevel);
|
||||||
|
|
||||||
/*= Decompression context */
|
/*= Decompression context
|
||||||
|
* When decompressing many times,
|
||||||
|
* it is recommended to allocate a context just once, and re-use it for each successive compression operation.
|
||||||
|
* This will make workload friendlier for system's memory.
|
||||||
|
* Use one context per thread for parallel execution in multi-threaded environments. */
|
||||||
typedef struct ZSTD_DCtx_s ZSTD_DCtx;
|
typedef struct ZSTD_DCtx_s ZSTD_DCtx;
|
||||||
ZSTDLIB_API ZSTD_DCtx* ZSTD_createDCtx(void);
|
ZSTDLIB_API ZSTD_DCtx* ZSTD_createDCtx(void);
|
||||||
ZSTDLIB_API size_t ZSTD_freeDCtx(ZSTD_DCtx* dctx);
|
ZSTDLIB_API size_t ZSTD_freeDCtx(ZSTD_DCtx* dctx);
|
||||||
@ -277,9 +281,11 @@ typedef struct ZSTD_outBuffer_s {
|
|||||||
* *******************************************************************/
|
* *******************************************************************/
|
||||||
|
|
||||||
typedef struct ZSTD_CStream_s ZSTD_CStream;
|
typedef struct ZSTD_CStream_s ZSTD_CStream;
|
||||||
|
/*===== ZSTD_CStream management functions =====*/
|
||||||
ZSTDLIB_API ZSTD_CStream* ZSTD_createCStream(void);
|
ZSTDLIB_API ZSTD_CStream* ZSTD_createCStream(void);
|
||||||
ZSTDLIB_API size_t ZSTD_freeCStream(ZSTD_CStream* zcs);
|
ZSTDLIB_API size_t ZSTD_freeCStream(ZSTD_CStream* zcs);
|
||||||
|
|
||||||
|
/*===== Streaming compression functions =====*/
|
||||||
ZSTDLIB_API size_t ZSTD_initCStream(ZSTD_CStream* zcs, int compressionLevel);
|
ZSTDLIB_API size_t ZSTD_initCStream(ZSTD_CStream* zcs, int compressionLevel);
|
||||||
ZSTDLIB_API size_t ZSTD_compressStream(ZSTD_CStream* zcs, ZSTD_outBuffer* output, ZSTD_inBuffer* input);
|
ZSTDLIB_API size_t ZSTD_compressStream(ZSTD_CStream* zcs, ZSTD_outBuffer* output, ZSTD_inBuffer* input);
|
||||||
ZSTDLIB_API size_t ZSTD_flushStream(ZSTD_CStream* zcs, ZSTD_outBuffer* output);
|
ZSTDLIB_API size_t ZSTD_flushStream(ZSTD_CStream* zcs, ZSTD_outBuffer* output);
|
||||||
@ -313,9 +319,11 @@ ZSTDLIB_API size_t ZSTD_CStreamOutSize(void); /**< recommended size for output
|
|||||||
* *******************************************************************************/
|
* *******************************************************************************/
|
||||||
|
|
||||||
typedef struct ZSTD_DStream_s ZSTD_DStream;
|
typedef struct ZSTD_DStream_s ZSTD_DStream;
|
||||||
|
/*===== ZSTD_DStream management functions =====*/
|
||||||
ZSTDLIB_API ZSTD_DStream* ZSTD_createDStream(void);
|
ZSTDLIB_API ZSTD_DStream* ZSTD_createDStream(void);
|
||||||
ZSTDLIB_API size_t ZSTD_freeDStream(ZSTD_DStream* zds);
|
ZSTDLIB_API size_t ZSTD_freeDStream(ZSTD_DStream* zds);
|
||||||
|
|
||||||
|
/*===== Streaming decompression functions =====*/
|
||||||
ZSTDLIB_API size_t ZSTD_initDStream(ZSTD_DStream* zds);
|
ZSTDLIB_API size_t ZSTD_initDStream(ZSTD_DStream* zds);
|
||||||
ZSTDLIB_API size_t ZSTD_decompressStream(ZSTD_DStream* zds, ZSTD_outBuffer* output, ZSTD_inBuffer* input);
|
ZSTDLIB_API size_t ZSTD_decompressStream(ZSTD_DStream* zds, ZSTD_outBuffer* output, ZSTD_inBuffer* input);
|
||||||
|
|
||||||
@ -540,6 +548,8 @@ ZSTDLIB_API size_t ZSTD_sizeof_DCtx(const ZSTD_DCtx* dctx);
|
|||||||
* It is important that dictBuffer outlives DDict, it must remain read accessible throughout the lifetime of DDict */
|
* It is important that dictBuffer outlives DDict, it must remain read accessible throughout the lifetime of DDict */
|
||||||
ZSTDLIB_API ZSTD_DDict* ZSTD_createDDict_byReference(const void* dictBuffer, size_t dictSize);
|
ZSTDLIB_API ZSTD_DDict* ZSTD_createDDict_byReference(const void* dictBuffer, size_t dictSize);
|
||||||
|
|
||||||
|
/*! ZSTD_createDDict_advanced() :
|
||||||
|
* Create a ZSTD_DDict using external alloc and free, optionally by reference */
|
||||||
ZSTDLIB_API ZSTD_DDict* ZSTD_createDDict_advanced(const void* dict, size_t dictSize,
|
ZSTDLIB_API ZSTD_DDict* ZSTD_createDDict_advanced(const void* dict, size_t dictSize,
|
||||||
unsigned byReference, ZSTD_customMem customMem);
|
unsigned byReference, ZSTD_customMem customMem);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user