Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython-zstd
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
cython-zstd
Commits
28228281
Commit
28228281
authored
Aug 28, 2018
by
Julien Muchembled
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wip
parent
ae436f7d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
0 deletions
+46
-0
zstd/_bindings.pyx
zstd/_bindings.pyx
+46
-0
No files found.
zstd/_bindings.pyx
View file @
28228281
...
...
@@ -27,6 +27,38 @@ cdef extern from "zstd.h":
ssize_t
ZSTD_decompress
(
void
*
dst
,
ssize_t
dstCapacity
,
const
void
*
src
,
ssize_t
compressedSize
)
nogil
ctypedef
struct
ZSTD_inBuffer
:
const
void
*
src
ssize_t
size
ssize_t
pos
ctypedef
struct
ZSTD_outBuffer
:
void
*
dst
ssize_t
size
ssize_t
pos
ctypedef
struct
ZSTD_CStream
:
pass
ZSTD_CStream
*
ZSTD_createCStream
()
ssize_t
ZSTD_freeCStream
(
ZSTD_CStream
*
zcs
)
ssize_t
ZSTD_initCStream
(
ZSTD_CStream
*
zcs
,
int
compressionLevel
)
ssize_t
ZSTD_compressStream
(
ZSTD_CStream
*
zcs
,
ZSTD_outBuffer
*
output
,
ZSTD_inBuffer
*
input
)
nogil
ssize_t
ZSTD_flushStream
(
ZSTD_CStream
*
zcs
,
ZSTD_outBuffer
*
output
)
ssize_t
ZSTD_endStream
(
ZSTD_CStream
*
zcs
,
ZSTD_outBuffer
*
output
)
ssize_t
ZSTD_CStreamInSize
()
ssize_t
ZSTD_CStreamOutSize
()
ctypedef
struct
ZSTD_DStream
:
pass
ZSTD_DStream
*
ZSTD_createDStream
()
ssize_t
ZSTD_freeDStream
(
ZSTD_DStream
*
zds
)
ssize_t
ZSTD_initDStream
(
ZSTD_DStream
*
zds
)
ssize_t
ZSTD_decompressStream
(
ZSTD_DStream
*
zds
,
ZSTD_outBuffer
*
output
,
ZSTD_inBuffer
*
input
)
nogil
ssize_t
ZSTD_DStreamInSize
()
ssize_t
ZSTD_DStreamOutSize
()
def
version
():
cdef
int
x
=
ZSTD_versionNumber
()
cdef
int
r
=
x
%
100
...
...
@@ -83,3 +115,17 @@ def decompress(bytes string not None):
if
x
<
0
:
raise
error
(
-
x
)
return
dst
cdef
class
Compressor
:
cdef
ZSTD_CStream
*
ctx
;
def
__cinit__
(
self
):
self
.
ctx
=
ZSTD_createCStream
()
def
__dealloc__
(
self
):
ZSTD_freeCStream
(
self
.
ctx
)
def
__init__
(
self
,
int
level
=
0
):
ZSTD_initCStream
(
self
.
ctx
,
level
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment