00001 00133 #ifndef _LIGHTMEDIASCANNER_PLUGIN_H_ 00134 #define _LIGHTMEDIASCANNER_PLUGIN_H_ 1 00135 00136 #include <lightmediascanner.h> 00137 #include <lightmediascanner_charset_conv.h> 00138 #include <sqlite3.h> 00139 #include <sys/types.h> 00140 00141 #ifdef __cplusplus 00142 extern "C" { 00143 #endif 00144 00145 struct lms_file_info { 00146 const char *path; 00147 int path_len; 00148 int base; 00149 int64_t id; 00150 time_t mtime; 00151 time_t dtime; 00152 size_t size; 00153 }; 00154 00155 struct lms_context { 00156 sqlite3 *db; 00157 lms_charset_conv_t *cs_conv; 00158 }; 00159 00160 typedef void *(*lms_plugin_match_fn_t)(lms_plugin_t *p, const char *path, int len, int base); 00161 typedef int (*lms_plugin_parse_fn_t)(lms_plugin_t *p, struct lms_context *ctxt, const struct lms_file_info *finfo, void *match); 00162 typedef int (*lms_plugin_close_fn_t)(lms_plugin_t *p); 00163 typedef int (*lms_plugin_setup_fn_t)(lms_plugin_t *p, struct lms_context *ctxt); 00164 typedef int (*lms_plugin_start_fn_t)(lms_plugin_t *p, struct lms_context *ctxt); 00165 typedef int (*lms_plugin_finish_fn_t)(lms_plugin_t *p, struct lms_context *ctxt); 00166 00167 struct lms_plugin { 00168 const char *name; 00169 lms_plugin_match_fn_t match; 00170 lms_plugin_parse_fn_t parse; 00171 lms_plugin_close_fn_t close; 00172 lms_plugin_setup_fn_t setup; 00173 lms_plugin_start_fn_t start; 00174 lms_plugin_finish_fn_t finish; 00175 }; 00176 00177 struct lms_plugin_info { 00178 const char *name; 00179 const char * const *categories; 00180 const char *description; 00181 const char *version; 00182 const char * const *authors; 00183 const char *uri; 00184 }; 00185 00186 00187 #ifdef __cplusplus 00188 } 00189 #endif 00190 #endif /* _LIGHTMEDIASCANNER_PLUGIN_H_ */