2 * Copyright (C) 2007 by INdT
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public License
6 * as published by the Free Software Foundation; either version 2
7 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 * @author Gustavo Sverzut Barbieri <gustavo.barbieri@openbossa.org>
21 #ifndef _LIGHTMEDIASCANNER_H_
22 #define _LIGHTMEDIASCANNER_H_ 1
30 # define API __attribute__ ((visibility("default")))
31 # define GNUC_NULL_TERMINATED __attribute__((__sentinel__))
34 # define GNUC_NULL_TERMINATED
36 # if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
37 # define GNUC_PURE __attribute__((__pure__))
38 # define GNUC_MALLOC __attribute__((__malloc__))
39 # define GNUC_CONST __attribute__((__const__))
40 # define GNUC_UNUSED __attribute__((__unused__))
44 # define GNUC_NORETURN
48 # if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
49 # define GNUC_WARN_UNUSED_RESULT __attribute__((warn_unused_result))
50 # define GNUC_NON_NULL(...) __attribute__((nonnull(__VA_ARGS__)))
52 # define GNUC_WARN_UNUSED_RESULT
53 # define GNUC_NON_NULL(...)
57 # define GNUC_NULL_TERMINATED
62 # define GNUC_WARN_UNUSED_RESULT
63 # define GNUC_NON_NULL(...)
69 typedef struct lms lms_t;
70 typedef struct lms_plugin lms_plugin_t;
72 API lms_t *lms_new(const char *db_path) GNUC_MALLOC GNUC_WARN_UNUSED_RESULT;
73 API int lms_free(lms_t *lms) GNUC_NON_NULL(1);
74 API int lms_process(lms_t *lms, const char *top_path) GNUC_NON_NULL(1, 2);
75 API const char *lms_get_db_path(const lms_t *lms) GNUC_NON_NULL(1);
76 API int lms_is_processing(const lms_t *lms) GNUC_PURE GNUC_NON_NULL(1);
77 API int lms_get_slave_timeout(const lms_t *lms) GNUC_NON_NULL(1);
78 API void lms_set_slave_timeout(lms_t *lms, int ms) GNUC_NON_NULL(1);
79 API unsigned int lms_get_commit_interval(const lms_t *lms) GNUC_NON_NULL(1);
80 API void lms_set_commit_interval(lms_t *lms, unsigned int transactions) GNUC_NON_NULL(1);
82 API lms_plugin_t *lms_parser_add(lms_t *lms, const char *so_path) GNUC_NON_NULL(1, 2);
83 API lms_plugin_t *lms_parser_find_and_add(lms_t *lms, const char *name) GNUC_NON_NULL(1, 2);
84 API int lms_parser_del(lms_t *lms, lms_plugin_t *handle) GNUC_NON_NULL(1, 2);
86 API int lms_charset_add(lms_t *lms, const char *charset) GNUC_NON_NULL(1, 2);
87 API int lms_charset_del(lms_t *lms, const char *charset) GNUC_NON_NULL(1, 2);
92 #endif /* _LIGHTMEDIASCANNER_H_ */