1
0
mirror of https://github.com/facebook/zstd.git synced 2025-07-28 00:01:53 +03:00

inform manual users that it's automatically generated

suggested by @Eugeny1
This commit is contained in:
Yann Collet
2024-10-31 15:06:48 -07:00
parent adbb536d00
commit 2e02cd330d
3 changed files with 37 additions and 15 deletions

View File

@ -211,6 +211,7 @@ int main(int argc, char *argv[]) {
ostream << "<html>\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=ISO-8859-1\">\n<title>" << version << "</title>\n</head>\n<body>" << endl; ostream << "<html>\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=ISO-8859-1\">\n<title>" << version << "</title>\n</head>\n<body>" << endl;
ostream << "<h1>" << version << "</h1>\n"; ostream << "<h1>" << version << "</h1>\n";
ostream << "Note: the content of this file has been automatically generated by parsing \"zstd.h\" \n";
ostream << "<hr>\n<a name=\"Contents\"></a><h2>Contents</h2>\n<ol>\n"; ostream << "<hr>\n<a name=\"Contents\"></a><h2>Contents</h2>\n<ol>\n";
for (size_t i=0; i<chapters.size(); i++) for (size_t i=0; i<chapters.size(); i++)

View File

@ -1,10 +1,11 @@
<html> <html>
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>zstd 1.5.6 Manual</title> <title>zstd 1.5.7 Manual</title>
</head> </head>
<body> <body>
<h1>zstd 1.5.6 Manual</h1> <h1>zstd 1.5.7 Manual</h1>
Note: the content of this file has been automatically generated by parsing "zstd.h"
<hr> <hr>
<a name="Contents"></a><h2>Contents</h2> <a name="Contents"></a><h2>Contents</h2>
<ol> <ol>
@ -145,17 +146,35 @@ unsigned long long ZSTD_getDecompressedSize(const void* src, size_t srcSize);
</p></pre><BR> </p></pre><BR>
<h3>Compression helper functions</h3><pre></pre><b><pre></pre></b><BR> <h3>Compression helper functions</h3><pre></pre><b><pre></pre></b><BR>
<pre><b>size_t ZSTD_compressBound(size_t srcSize); </b>/*!< maximum compressed size in worst case single-pass scenario */<b> <pre><b>#define ZSTD_MAX_INPUT_SIZE ((sizeof(size_t)==8) ? 0xFF00FF00FF00FF00ULL : 0xFF00FF00U)
</b></pre><BR> #define ZSTD_COMPRESSBOUND(srcSize) (((size_t)(srcSize) >= ZSTD_MAX_INPUT_SIZE) ? 0 : (srcSize) + ((srcSize)>>8) + (((srcSize) < (128<<10)) ? (((128<<10) - (srcSize)) >> 11) </b>/* margin, from 64 to 0 */ : 0)) /* this formula ensures that bound(A) + bound(B) <= bound(A+B) as long as A and B >= 128 KB */<b>
size_t ZSTD_compressBound(size_t srcSize); </b>/*!< maximum compressed size in worst case single-pass scenario */<b>
</b><p> maximum compressed size in worst case single-pass scenario.
When invoking `ZSTD_compress()`, or any other one-pass compression function,
it's recommended to provide @dstCapacity >= ZSTD_compressBound(srcSize)
as it eliminates one potential failure scenario,
aka not enough room in dst buffer to write the compressed frame.
Note : ZSTD_compressBound() itself can fail, if @srcSize > ZSTD_MAX_INPUT_SIZE .
In which case, ZSTD_compressBound() will return an error code
which can be tested using ZSTD_isError().
ZSTD_COMPRESSBOUND() :
same as ZSTD_compressBound(), but as a macro.
It can be used to produce constants, which can be useful for static allocation,
for example to size a static array on stack.
Will produce constant value 0 if srcSize is too large.
</p></pre><BR>
<h3>Error helper functions</h3><pre></pre><b><pre>#include "zstd_errors.h" </b>/* list of errors */<b> <h3>Error helper functions</h3><pre></pre><b><pre>#include "zstd_errors.h" </b>/* list of errors */<b>
</b>/* ZSTD_isError() :<b> </b>/* ZSTD_isError() :<b>
* Most ZSTD_* functions returning a size_t value can be tested for error, * Most ZSTD_* functions returning a size_t value can be tested for error,
* using ZSTD_isError(). * using ZSTD_isError().
* @return 1 if error, 0 otherwise * @return 1 if error, 0 otherwise
*/ */
unsigned ZSTD_isError(size_t code); </b>/*!< tells if a `size_t` function result is an error code */<b> unsigned ZSTD_isError(size_t result); </b>/*!< tells if a `size_t` function result is an error code */<b>
ZSTD_ErrorCode ZSTD_getErrorCode(size_t functionResult); </b>/* convert a result into an error code, which can be compared to error enum list */<b> ZSTD_ErrorCode ZSTD_getErrorCode(size_t functionResult); </b>/* convert a result into an error code, which can be compared to error enum list */<b>
const char* ZSTD_getErrorName(size_t code); </b>/*!< provides readable string from an error code */<b> const char* ZSTD_getErrorName(size_t result); </b>/*!< provides readable string from a function result */<b>
int ZSTD_minCLevel(void); </b>/*!< minimum negative compression level allowed, requires v1.4.0+ */<b> int ZSTD_minCLevel(void); </b>/*!< minimum negative compression level allowed, requires v1.4.0+ */<b>
int ZSTD_maxCLevel(void); </b>/*!< maximum compression level available */<b> int ZSTD_maxCLevel(void); </b>/*!< maximum compression level available */<b>
int ZSTD_defaultCLevel(void); </b>/*!< default compression level, specified by ZSTD_CLEVEL_DEFAULT, requires v1.5.0+ */<b> int ZSTD_defaultCLevel(void); </b>/*!< default compression level, specified by ZSTD_CLEVEL_DEFAULT, requires v1.5.0+ */<b>
@ -163,17 +182,17 @@ int ZSTD_defaultCLevel(void); </b>/*!< default compression leve
<a name="Chapter4"></a><h2>Explicit context</h2><pre></pre> <a name="Chapter4"></a><h2>Explicit context</h2><pre></pre>
<h3>Compression context</h3><pre> When compressing many times, <h3>Compression context</h3><pre> When compressing many times,
it is recommended to allocate a context just once, it is recommended to allocate a compression context just once,
and reuse it for each successive compression operation. and reuse it for each successive compression operation.
This will make workload friendlier for system's memory. This will make the workload easier for system's memory.
Note : re-using context is just a speed / resource optimization. Note : re-using context is just a speed / resource optimization.
It doesn't change the compression ratio, which remains identical. It doesn't change the compression ratio, which remains identical.
Note 2 : In multi-threaded environments, Note 2: For parallel execution in multi-threaded environments,
use one different context per thread for parallel execution. use one different context per thread .
</pre><b><pre>typedef struct ZSTD_CCtx_s ZSTD_CCtx; </pre><b><pre>typedef struct ZSTD_CCtx_s ZSTD_CCtx;
ZSTD_CCtx* ZSTD_createCCtx(void); ZSTD_CCtx* ZSTD_createCCtx(void);
size_t ZSTD_freeCCtx(ZSTD_CCtx* cctx); </b>/* accept NULL pointer */<b> size_t ZSTD_freeCCtx(ZSTD_CCtx* cctx); </b>/* compatible with NULL pointer */<b>
</pre></b><BR> </pre></b><BR>
<pre><b>size_t ZSTD_compressCCtx(ZSTD_CCtx* cctx, <pre><b>size_t ZSTD_compressCCtx(ZSTD_CCtx* cctx,
void* dst, size_t dstCapacity, void* dst, size_t dstCapacity,
@ -184,7 +203,7 @@ size_t ZSTD_freeCCtx(ZSTD_CCtx* cctx); </b>/* accept NULL pointer */<b>
this function compresses at the requested compression level, this function compresses at the requested compression level,
__ignoring any other advanced parameter__ . __ignoring any other advanced parameter__ .
If any advanced parameter was set using the advanced API, If any advanced parameter was set using the advanced API,
they will all be reset. Only `compressionLevel` remains. they will all be reset. Only @compressionLevel remains.
</p></pre><BR> </p></pre><BR>
@ -384,7 +403,8 @@ size_t ZSTD_freeDCtx(ZSTD_DCtx* dctx); </b>/* accept NULL pointer */<b>
* ZSTD_c_stableOutBuffer * ZSTD_c_stableOutBuffer
* ZSTD_c_blockDelimiters * ZSTD_c_blockDelimiters
* ZSTD_c_validateSequences * ZSTD_c_validateSequences
* ZSTD_c_useBlockSplitter * ZSTD_c_blockSplitterLevel
* ZSTD_c_splitAfterSequences
* ZSTD_c_useRowMatchFinder * ZSTD_c_useRowMatchFinder
* ZSTD_c_prefetchCDictTables * ZSTD_c_prefetchCDictTables
* ZSTD_c_enableSeqProducerFallback * ZSTD_c_enableSeqProducerFallback
@ -411,7 +431,8 @@ size_t ZSTD_freeDCtx(ZSTD_DCtx* dctx); </b>/* accept NULL pointer */<b>
ZSTD_c_experimentalParam16=1013, ZSTD_c_experimentalParam16=1013,
ZSTD_c_experimentalParam17=1014, ZSTD_c_experimentalParam17=1014,
ZSTD_c_experimentalParam18=1015, ZSTD_c_experimentalParam18=1015,
ZSTD_c_experimentalParam19=1016 ZSTD_c_experimentalParam19=1016,
ZSTD_c_experimentalParam20=1017
} ZSTD_cParameter; } ZSTD_cParameter;
</b></pre><BR> </b></pre><BR>
<pre><b>typedef struct { <pre><b>typedef struct {

View File

@ -218,7 +218,7 @@ ZSTDLIB_API size_t ZSTD_findFrameCompressedSize(const void* src, size_t srcSize)
/*====== Compression helper functions ======*/ /*====== Compression helper functions ======*/
/* ZSTD_compressBound() : /*! ZSTD_compressBound() :
* maximum compressed size in worst case single-pass scenario. * maximum compressed size in worst case single-pass scenario.
* When invoking `ZSTD_compress()`, or any other one-pass compression function, * When invoking `ZSTD_compress()`, or any other one-pass compression function,
* it's recommended to provide @dstCapacity >= ZSTD_compressBound(srcSize) * it's recommended to provide @dstCapacity >= ZSTD_compressBound(srcSize)