static int LZ4_compress_destSize_extState()

in src/lz4.c [894:909]


static int LZ4_compress_destSize_extState (void* state, const char* src, char* dst, int* srcSizePtr, int targetDstSize)
{
    LZ4_resetStream((LZ4_stream_t*)state);

    if (targetDstSize >= LZ4_compressBound(*srcSizePtr))   /* compression success is guaranteed */
    {
        return LZ4_compress_fast_extState(state, src, dst, *srcSizePtr, targetDstSize, 1);
    }
    else
    {
        if (*srcSizePtr < LZ4_64Klimit)
            return LZ4_compress_destSize_generic(state, src, dst, srcSizePtr, targetDstSize, byU16);
        else
            return LZ4_compress_destSize_generic(state, src, dst, srcSizePtr, targetDstSize, LZ4_64bits() ? byU32 : byPtr);
    }
}