Skip to content

Commit

Permalink
Update imagecodecs/libdeflate.pxd
Browse files Browse the repository at this point in the history
  • Loading branch information
cgohlke committed Sep 17, 2023
1 parent 06d7bde commit 34e8f33
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion imagecodecs/libdeflate.pxd
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# imagecodecs/libdeflate.pxd
# cython: language_level = 3

# Cython declarations for the `libdeflate 1.18` library.
# Cython declarations for the `libdeflate 1.19` library.
# https://github.com/ebiggers/libdeflate

from libc.stdint cimport uint32_t
Expand All @@ -18,6 +18,9 @@ cdef extern from 'libdeflate.h':
struct libdeflate_decompressor:
pass

struct libdeflate_options:
pass

enum libdeflate_result:
LIBDEFLATE_SUCCESS
LIBDEFLATE_BAD_DATA
Expand All @@ -30,6 +33,11 @@ cdef extern from 'libdeflate.h':
int compression_level
) nogil

libdeflate_compressor* libdeflate_alloc_compressor_ex(
int compression_level,
const libdeflate_options *options
) nogil

size_t libdeflate_deflate_compress(
libdeflate_compressor* compressor,
const void* in_,
Expand Down Expand Up @@ -77,6 +85,10 @@ cdef extern from 'libdeflate.h':

libdeflate_decompressor* libdeflate_alloc_decompressor() nogil

libdeflate_decompressor* libdeflate_alloc_decompressor_ex(
const libdeflate_options *options
) nogil

libdeflate_result libdeflate_deflate_decompress(
libdeflate_decompressor* decompressor,
const void* in_,
Expand Down Expand Up @@ -158,3 +170,8 @@ cdef extern from 'libdeflate.h':
void* (*malloc_func)(size_t),
void (*free_func)(void*)
) nogil

struct libdeflate_options:
size_t sizeof_options
void *(*malloc_func)(size_t) nogil
void (*free_func)(void *) nogil

0 comments on commit 34e8f33

Please sign in to comment.