414 def estimate_decompression_context_size(): |
414 def estimate_decompression_context_size(): |
415 return lib.ZSTD_estimateDCtxSize() |
415 return lib.ZSTD_estimateDCtxSize() |
416 |
416 |
417 |
417 |
418 def _set_compression_parameter(params, param, value): |
418 def _set_compression_parameter(params, param, value): |
419 zresult = lib.ZSTD_CCtxParam_setParameter(params, param, value) |
419 zresult = lib.ZSTD_CCtxParams_setParameter(params, param, value) |
420 if lib.ZSTD_isError(zresult): |
420 if lib.ZSTD_isError(zresult): |
421 raise ZstdError('unable to set compression context parameter: %s' % |
421 raise ZstdError('unable to set compression context parameter: %s' % |
422 _zstd_error(zresult)) |
422 _zstd_error(zresult)) |
423 |
423 |
424 |
424 |
425 def _get_compression_parameter(params, param): |
425 def _get_compression_parameter(params, param): |
426 result = ffi.new('int *') |
426 result = ffi.new('int *') |
427 |
427 |
428 zresult = lib.ZSTD_CCtxParam_getParameter(params, param, result) |
428 zresult = lib.ZSTD_CCtxParams_getParameter(params, param, result) |
429 if lib.ZSTD_isError(zresult): |
429 if lib.ZSTD_isError(zresult): |
430 raise ZstdError('unable to get compression context parameter: %s' % |
430 raise ZstdError('unable to get compression context parameter: %s' % |
431 _zstd_error(zresult)) |
431 _zstd_error(zresult)) |
432 |
432 |
433 return result[0] |
433 return result[0] |