/*-****************************************
* Customization
******************************************/
-typedef ZSTD_errorCode ERR_enum;
+typedef ZSTD_ErrorCode ERR_enum;
#define PREFIX(name) ZSTD_error_##name
ZSTD_error_maxSymbolValue_tooSmall,
ZSTD_error_dictionary_corrupted,
ZSTD_error_maxCode
-} ZSTD_errorCode;
+} ZSTD_ErrorCode;
/* note : functions provide error codes in reverse negative order,
so compare with (size_t)(0-enum) */
* Explicit memory management
***************************************/
/** Compression context */
-typedef struct ZSTD_CCtx_s ZSTD_CCtx; /* incomplete type */
+typedef struct ZSTD_CCtx_s ZSTD_CCtx; /*< incomplete type */
ZSTDLIB_API ZSTD_CCtx* ZSTD_createCCtx(void);
-ZSTDLIB_API size_t ZSTD_freeCCtx(ZSTD_CCtx* cctx);
+ZSTDLIB_API size_t ZSTD_freeCCtx(ZSTD_CCtx* cctx); /*!< @return : errorCode */
/** ZSTD_compressCCtx() :
Same as ZSTD_compress(), but requires an already allocated ZSTD_CCtx (see ZSTD_createCCtx()) */
/** Decompression context */
typedef struct ZSTD_DCtx_s ZSTD_DCtx;
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); /*!< @return : errorCode */
/** ZSTD_decompressDCtx() :
* Same as ZSTD_decompress(), but requires an already allocated ZSTD_DCtx (see ZSTD_createDCtx()) */
{
free(cctx->workSpace);
free(cctx);
- return 0;
+ return 0; /* reserved as a potential error code in the future */
}
}
-
/*-*************************************
* Hashes
***************************************/
/*! ZSTD_getError() :
* convert a `size_t` function result into a proper ZSTD_errorCode enum */
-ZSTD_errorCode ZSTD_getError(size_t code) { return ERR_getError(code); }
+ZSTD_ErrorCode ZSTD_getError(size_t code) { return ERR_getError(code); }
/*! ZSTD_getErrorName() :
* provides error code string (useful for debugging) */
size_t ZSTD_freeDCtx(ZSTD_DCtx* dctx)
{
free(dctx);
- return 0;
+ return 0; /* reserved as a potential error code in the future */
}
void ZSTD_copyDCtx(ZSTD_DCtx* dstDCtx, const ZSTD_DCtx* srcDCtx)
/*! ZSTD_getErrorCode() :
convert a `size_t` function result into a `ZSTD_error_code` enum type,
which can be used to compare directly with enum list within "error_public.h" */
-ZSTD_errorCode ZSTD_getError(size_t code);
+ZSTD_ErrorCode ZSTD_getError(size_t code);
#if defined (__cplusplus)