1 # Copyright (C) 2007 by INdT
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.
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.
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.
17 # @author Gustavo Sverzut Barbieri <gustavo.barbieri@openbossa.org>
19 cdef extern from "Python.h":
22 Py_BEGIN_ALLOW_THREADS
25 cdef extern from "lightmediascanner_plugin.h":
26 ctypedef struct lms_plugin_t:
30 cdef extern from "lightmediascanner.h":
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)
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)
48 int lms_charset_add(lms_t *lms, char *charset)
49 int lms_charset_del(lms_t *lms, char *charset)
52 cdef class LightMediaScanner:
54 cdef readonly object parsers
55 cdef readonly object db_path
59 cdef lms_plugin_t *obj
60 cdef readonly LightMediaScanner scanner
62 cdef int _set_obj(self, lms_plugin_t *obj) except 0
63 cdef int _unset_obj(self) except 0