Allow threads to run while processing.
[lms] / python-lightmediascanner / include / lightmediascanner / c_lightmediascanner.pxd
1 cdef extern from "Python.h":
2     # ceval.h
3     cdef enum:
4         Py_BEGIN_ALLOW_THREADS
5         Py_END_ALLOW_THREADS
6
7 cdef extern from "lightmediascanner_plugin.h":
8     ctypedef struct lms_plugin_t:
9         char *name
10
11
12 cdef extern from "lightmediascanner.h":
13     ctypedef struct lms_t
14
15     lms_t *lms_new(char *db_path)
16     int lms_free(lms_t *lms)
17     int lms_process(lms_t *lms, char *top_path)
18     int lms_check(lms_t *lms, char *top_path)
19     void lms_stop_processing(lms_t *lms)
20     int lms_is_processing(lms_t *lms)
21     int lms_get_slave_timeout(lms_t *lms)
22     void lms_set_slave_timeout(lms_t *lms, int ms)
23     unsigned int lms_get_commit_interval(lms_t *lms)
24     void lms_set_commit_interval(lms_t *lms, unsigned int transactions)
25
26     lms_plugin_t *lms_parser_add(lms_t *lms, char *so_path)
27     lms_plugin_t *lms_parser_find_and_add(lms_t *lms, char *name)
28     int lms_parser_del(lms_t *lms, lms_plugin_t *handle)
29
30     int lms_charset_add(lms_t *lms, char *charset)
31     int lms_charset_del(lms_t *lms, char *charset)
32
33
34 cdef class LightMediaScanner:
35     cdef lms_t *obj
36     cdef readonly object parsers
37     cdef readonly object db_path
38
39
40 cdef class Parser:
41     cdef lms_plugin_t *obj
42     cdef readonly LightMediaScanner scanner
43
44     cdef int _set_obj(self, lms_plugin_t *obj) except 0
45     cdef int _unset_obj(self) except 0
46