Skip to content

Commit

Permalink
Update python-zstd.c
Browse files Browse the repository at this point in the history
Add new information functions
  • Loading branch information
sergey-dryabzhinsky authored Jan 19, 2025
1 parent 7ebfe95 commit b43f84c
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/python-zstd.c
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,25 @@ static PyObject *py_zstd_library_external(PyObject* self, PyObject *args)
}


/**
* Returns 0 or 1 if ZSTD library build with threads
*/
static PyObject *py_zstd_with_threads(PyObject* self, PyObject *args)
{
return Py_BuildValue("i", ZSTD_MULTITHREAD);
}


/**
* Returns 0 or 1 if ZSTD library build with threads
*/
static PyObject *py_zstd_with_asm(PyObject* self, PyObject *args)
{
return Py_BuildValue("i", ! ZSTD_DISABLEASM);
}



/**
* Returns ZSTD determined threads count, int
*/
Expand Down Expand Up @@ -284,6 +303,8 @@ static PyMethodDef ZstdMethods[] = {
{"ZSTD_threads_count", py_zstd_threads_count, METH_NOARGS, ZSTD_THREADS_COUNT_DOCSTRING},
{"ZSTD_max_threads_count", py_zstd_max_threads_count, METH_NOARGS, ZSTD_MAX_THREADS_COUNT_DOCSTRING},
{"ZSTD_external", py_zstd_library_external, METH_NOARGS, ZSTD_EXTERNAL_DOCSTRING},
{"ZSTD_with_threads", py_zstd_with_threads, METH_NOARGS, ZSTD_WITH_THREADS_DOCSTRING},
{"ZSTD_with_asm", py_zstd_with_asm, METH_NOARGS, ZSTD_WITH_ASM_DOCSTRING},
{NULL, NULL, 0, NULL}
};

Expand Down

0 comments on commit b43f84c

Please sign in to comment.