0f4fe4ba9f784d2609aff23f5908007543586836
[lms] / python-lightmediascanner / include / lightmediascanner / c_lightmediascanner.pxd
1 # Copyright (C) 2007 by INdT
2 #
3 # This program is free software; you can redistribute it and/or
4 # modify it under the terms of the GNU Lesser General Public License
5 # as published by the Free Software Foundation; either version 2
6 # of the License, or (at your option) any later version.
7 #
8 # This program is distributed in the hope that it will be useful,
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 # GNU General Public License for more details.
12 #
13 # You should have received a copy of the GNU Lesser General Public License
14 # along with this program; if not, write to the Free Software
15 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
16 #
17 # @author Gustavo Sverzut Barbieri <gustavo.barbieri@openbossa.org>
18
19 cdef extern from "Python.h":
20     # ceval.h
21     cdef enum:
22         Py_BEGIN_ALLOW_THREADS
23         Py_END_ALLOW_THREADS
24
25 cdef extern from "lightmediascanner_plugin.h":
26     ctypedef struct lms_plugin_t:
27         char *name
28
29
30 cdef extern from "lightmediascanner.h":
31     ctypedef struct lms_t
32
33     lms_t *lms_new(char *db_path)
34     int lms_free(lms_t *lms)
35     int lms_process(lms_t *lms, char *top_path)
36     int lms_check(lms_t *lms, char *top_path)
37     void lms_stop_processing(lms_t *lms)
38     int lms_is_processing(lms_t *lms)
39     int lms_get_slave_timeout(lms_t *lms)
40     void lms_set_slave_timeout(lms_t *lms, int ms)
41     unsigned int lms_get_commit_interval(lms_t *lms)
42     void lms_set_commit_interval(lms_t *lms, unsigned int transactions)
43
44     lms_plugin_t *lms_parser_add(lms_t *lms, char *so_path)
45     lms_plugin_t *lms_parser_find_and_add(lms_t *lms, char *name)
46     int lms_parser_del(lms_t *lms, lms_plugin_t *handle)
47
48     int lms_charset_add(lms_t *lms, char *charset)
49     int lms_charset_del(lms_t *lms, char *charset)
50
51
52 cdef class LightMediaScanner:
53     cdef lms_t *obj
54     cdef readonly object parsers
55     cdef readonly object db_path
56
57
58 cdef class Parser:
59     cdef lms_plugin_t *obj
60     cdef readonly LightMediaScanner scanner
61
62     cdef int _set_obj(self, lms_plugin_t *obj) except 0
63     cdef int _unset_obj(self) except 0
64