ennaf/src/compressor.c
static ZSTD_CStream* create_zstd_cstream(int level, int window_size_log)
{
    ZSTD_CStream *s = ZSTD_createCStream();
    if (s == NULL) { die("ZSTD_createCStream() error\n"); }

    if (window_size_log != 0)
    {
        ZSTD_TRY(ZSTD_CCtx_setParameter(s, ZSTD_c_enableLongDistanceMatching, 1));
        ZSTD_TRY(ZSTD_CCtx_setParameter(s, ZSTD_c_windowLog, window_size_log));
    }

    size_t const initResult = ZSTD_initCStream(s, level);
    if (ZSTD_isError(initResult)) { die("ZSTD_initCStream() error: %s\n", ZSTD_getErrorName(initResult)); }
    return s;
}
/*
 * NAF compressor
 * Copyright (c) 2018-2021 Kirill Kryukov
 * See README.md and LICENSE files of this repository
 */
NAF compressor
Copyright (c) 2018-2021 Kirill Kryukov
See README.md and LICENSE files of this repository
NAF compressor Copyright ( c ) 2018 - 2021 Kirill Kryukov See README . md and LICENSE files of this repository
static ZSTD_CStream* create_zstd_cstream(int level, int window_size_log)
{
    ZSTD_CStream *s = ZSTD_createCStream();
    if (s == NULL) { die("ZSTD_createCStream() error\n"); }
    if (window_size_log != 0)
    {
        ZSTD_TRY(ZSTD_CCtx_setParameter(s, ZSTD_c_enableLongDistanceMatching, 1));
        ZSTD_TRY(ZSTD_CCtx_setParameter(s, ZSTD_c_windowLog, window_size_log));
    }
    size_t const initResult = ZSTD_initCStream(s, level);
    if (ZSTD_isError(initResult)) { die("ZSTD_initCStream() error: %s\n", ZSTD_getErrorName(initResult)); }
    return s;
}
static ZSTD_CStream * create_zstd_cstream ( int level , int window_size_log ) { ZSTD_CStream * s = ZSTD_createCStream ( ) ; if ( s == NULL ) { die ( " \n " ) ; } if ( window_size_log != 0 ) { ZSTD_TRY ( ZSTD_CCtx_setParameter ( s , ZSTD_c_enableLongDistanceMatching , 1 ) ) ; ZSTD_TRY ( ZSTD_CCtx_setParameter ( s , ZSTD_c_windowLog , window_size_log ) ) ; } size_t const initResult = ZSTD_initCStream ( s , level ) ; if ( ZSTD_isError ( initResult ) ) { die ( " \n " , ZSTD_getErrorName ( initResult ) ) ; } return s ; }
NAF compressor
 Copyright (c) 2018-2021 Kirill Kryukov
 See README.md and LICENSE files of this repository
NAF compressor Copyright ( c ) 2018 - 2021 Kirill Kryukov See README . md and LICENSE files of this repository