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_PLUGIN_H_
22 #define _LIGHTMEDIASCANNER_PLUGIN_H_ 1
24 #include <lightmediascanner.h>
25 #include <lightmediascanner_charset_conv.h>
27 #include <sys/types.h>
33 struct lms_file_info {
34 const char *path; /**< file path */
35 int path_len; /**< path length */
36 int base; /**< index of basename inside path */
37 int64_t id; /**< database id */
38 time_t mtime; /**< in-disk modification time */
39 time_t dtime; /**< deletion time */
40 size_t size; /**< file size in bytes */
45 lms_charset_conv_t *cs_conv;
48 typedef void *(*lms_plugin_match_fn_t)(lms_plugin_t *p, const char *path, int len, int base);
49 typedef int (*lms_plugin_parse_fn_t)(lms_plugin_t *p, struct lms_context *ctxt, const struct lms_file_info *finfo, void *match);
50 typedef int (*lms_plugin_close_fn_t)(lms_plugin_t *p);
51 typedef int (*lms_plugin_setup_fn_t)(lms_plugin_t *p, struct lms_context *ctxt);
52 typedef int (*lms_plugin_start_fn_t)(lms_plugin_t *p, struct lms_context *ctxt);
53 typedef int (*lms_plugin_finish_fn_t)(lms_plugin_t *p, struct lms_context *ctxt);
57 lms_plugin_match_fn_t match;
58 lms_plugin_parse_fn_t parse;
59 lms_plugin_close_fn_t close;
60 lms_plugin_setup_fn_t setup;
61 lms_plugin_start_fn_t start;
62 lms_plugin_finish_fn_t finish;
68 #endif /* _LIGHTMEDIASCANNER_PLUGIN_H_ */