Go to the source code of this file.
Data Structures | |
struct | lms_parser_info |
Defines | |
#define | _LIGHTMEDIASCANNER_H_ 1 |
#define | API |
#define | GNUC_NULL_TERMINATED |
#define | GNUC_PURE |
#define | GNUC_MALLOC |
#define | GNUC_CONST |
#define | GNUC_UNUSED |
#define | GNUC_WARN_UNUSED_RESULT |
#define | GNUC_NON_NULL(...) |
Typedefs | |
typedef struct lms | lms_t |
typedef struct lms_plugin | lms_plugin_t |
typedef void(* | lms_free_callback_t )(void *data) |
typedef void(* | lms_progress_callback_t )(lms_t *lms, const char *path, int path_len, lms_progress_status_t status, void *data) |
Enumerations | |
enum | lms_progress_status_t { LMS_PROGRESS_STATUS_UP_TO_DATE, LMS_PROGRESS_STATUS_PROCESSED, LMS_PROGRESS_STATUS_DELETED, LMS_PROGRESS_STATUS_KILLED, LMS_PROGRESS_STATUS_ERROR_PARSE, LMS_PROGRESS_STATUS_ERROR_COMM, LMS_PROGRESS_STATUS_SKIPPED } |
Functions | |
API lms_t * | lms_new (const char *db_path) GNUC_MALLOC GNUC_WARN_UNUSED_RESULT |
API int | lms_free (lms_t *lms) GNUC_NON_NULL(1) |
API int | lms_process (lms_t *lms, const char *top_path) GNUC_NON_NULL(1 |
API int API int | lms_process_single_process (lms_t *lms, const char *top_path) GNUC_NON_NULL(1 |
API int API int API int | lms_check (lms_t *lms, const char *top_path) GNUC_NON_NULL(1 |
API int API int API int API int | lms_check_single_process (lms_t *lms, const char *top_path) GNUC_NON_NULL(1 |
API int API int API int API int API void | lms_stop_processing (lms_t *lms) GNUC_NON_NULL(1) |
API const char * | lms_get_db_path (const lms_t *lms) GNUC_NON_NULL(1) |
API int | lms_is_processing (const lms_t *lms) GNUC_PURE GNUC_NON_NULL(1) |
API int | lms_get_slave_timeout (const lms_t *lms) GNUC_NON_NULL(1) |
API void | lms_set_slave_timeout (lms_t *lms, int ms) GNUC_NON_NULL(1) |
API unsigned int | lms_get_commit_interval (const lms_t *lms) GNUC_NON_NULL(1) |
API void | lms_set_commit_interval (lms_t *lms, unsigned int transactions) GNUC_NON_NULL(1) |
API void | lms_set_progress_callback (lms_t *lms, lms_progress_callback_t cb, const void *data, lms_free_callback_t free_data) GNUC_NON_NULL(1) |
API void | lms_parsers_list (int(*cb)(void *data, const char *path), const void *data) |
API struct lms_parser_info * | lms_parser_info (const char *so_path) |
API struct lms_parser_info * | lms_parser_info_find (const char *name) |
API void | lms_parser_info_free (struct lms_parser_info *info) |
API void | lms_parsers_list_by_category (const char *category, int(*cb)(void *data, const char *path, const struct lms_parser_info *info), const void *data) |
API lms_plugin_t * | lms_parser_add (lms_t *lms, const char *so_path) GNUC_NON_NULL(1 |
API lms_plugin_t *API lms_plugin_t * | lms_parser_find_and_add (lms_t *lms, const char *name) GNUC_NON_NULL(1 |
API lms_plugin_t *API lms_plugin_t *API int | lms_parser_del (lms_t *lms, lms_plugin_t *handle) GNUC_NON_NULL(1 |
API lms_plugin_t *API lms_plugin_t *API int API int | lms_charset_add (lms_t *lms, const char *charset) GNUC_NON_NULL(1 |
API lms_plugin_t *API lms_plugin_t *API int API int API int | lms_charset_del (lms_t *lms, const char *charset) GNUC_NON_NULL(1 |
#define _LIGHTMEDIASCANNER_H_ 1 |
Definition at line 111 of file lightmediascanner.h.
#define API |
Definition at line 145 of file lightmediascanner.h.
#define GNUC_CONST |
Definition at line 149 of file lightmediascanner.h.
#define GNUC_MALLOC |
Definition at line 148 of file lightmediascanner.h.
#define GNUC_NON_NULL | ( | ... | ) |
Definition at line 152 of file lightmediascanner.h.
#define GNUC_NULL_TERMINATED |
Definition at line 146 of file lightmediascanner.h.
#define GNUC_PURE |
Definition at line 147 of file lightmediascanner.h.
#define GNUC_UNUSED |
Definition at line 150 of file lightmediascanner.h.
#define GNUC_WARN_UNUSED_RESULT |
Definition at line 151 of file lightmediascanner.h.
typedef void(* lms_free_callback_t)(void *data) |
Definition at line 177 of file lightmediascanner.h.
typedef struct lms_plugin lms_plugin_t |
Definition at line 165 of file lightmediascanner.h.
typedef void(* lms_progress_callback_t)(lms_t *lms, const char *path, int path_len, lms_progress_status_t status, void *data) |
Definition at line 178 of file lightmediascanner.h.
Definition at line 164 of file lightmediascanner.h.
Definition at line 167 of file lightmediascanner.h.
API lms_plugin_t* API lms_plugin_t* API int API int lms_charset_add | ( | lms_t * | lms, | |
const char * | charset | |||
) |
API lms_plugin_t* API lms_plugin_t* API int API int API int lms_charset_del | ( | lms_t * | lms, | |
const char * | charset | |||
) |
API int API int API int lms_check | ( | lms_t * | lms, | |
const char * | top_path | |||
) |
API int API int API int API int lms_check_single_process | ( | lms_t * | lms, | |
const char * | top_path | |||
) |
API lms_plugin_t* lms_parser_add | ( | lms_t * | lms, | |
const char * | so_path | |||
) |
API lms_plugin_t* API lms_plugin_t* API int lms_parser_del | ( | lms_t * | lms, | |
lms_plugin_t * | handle | |||
) |
API lms_plugin_t* API lms_plugin_t* lms_parser_find_and_add | ( | lms_t * | lms, | |
const char * | name | |||
) |
API struct lms_parser_info* lms_parser_info | ( | const char * | so_path | ) | [read] |
Get parser information.
Information can be used to let user choose parsers on Graphical User Interfaces.
so_path | full path to module. |
Definition at line 699 of file lightmediascanner.c.
References lms_parser_info::authors, lms_plugin_info::authors, lms_parser_info::categories, lms_plugin_info::categories, lms_parser_info::description, lms_plugin_info::description, lms_parser_info::name, lms_plugin_info::name, lms_parser_info::path, lms_parser_info::uri, lms_plugin_info::uri, lms_parser_info::version, and lms_plugin_info::version.
Referenced by lms_parser_info_find().
API struct lms_parser_info* lms_parser_info_find | ( | const char * | name | ) | [read] |
Find parser by name and get its information.
Information can be used to let user choose parsers on Graphical User Interfaces.
name | name of .so to find the whole so_path and retrieve information. |
Definition at line 824 of file lightmediascanner.c.
References lms_parser_info().
API void lms_parser_info_free | ( | struct lms_parser_info * | info | ) |
Free previously returned information.
Definition at line 843 of file lightmediascanner.c.
API void lms_parsers_list | ( | int(*)(void *data, const char *path) | cb, | |
const void * | data | |||
) |
List all known parsers on the system.
No information is retrieved, you might like to call lms_parser_info() on the callback path.
cb | function to call for each path found. If it returns 0, it stops iteraction. | |
data | extra data to pass to cb on every call. |
Definition at line 540 of file lightmediascanner.c.
Referenced by lms_parsers_list_by_category().
API void lms_parsers_list_by_category | ( | const char * | category, | |
int(*)(void *data, const char *path, const struct lms_parser_info *info) | cb, | |||
const void * | data | |||
) |
List all known parsers of a given category.
Since we need information to figure out parser category, these are passed as argument to callback, but you should NOT modify or reference it after callback function returns since it will be released after that.
category | which category to match. | |
cb | function to call for each path found. If it returns 0, it stops iteraction. | |
data | extra data to pass to cb on every call. |
Definition at line 629 of file lightmediascanner.c.
References lms_parsers_list().
API int lms_process | ( | lms_t * | lms, | |
const char * | top_path | |||
) |
API int API int lms_process_single_process | ( | lms_t * | lms, | |
const char * | top_path | |||
) |
API void lms_set_progress_callback | ( | lms_t * | lms, | |
lms_progress_callback_t | cb, | |||
const void * | data, | |||
lms_free_callback_t | free_data | |||
) |
Set callback to be used to report progress (check and process).
lms | previously allocated Light Media Scanner instance. | |
cb | function to call when files are processed or NULL to unset. | |
data | data to give to cb when it's called, may be NULL. | |
free_data | function to call to free data when lms is freed or new progress data is set. |
Definition at line 195 of file lightmediascanner.c.
References lms::cb, lms::data, lms::free_data, and lms::progress.
API int API int API int API int API void lms_stop_processing | ( | lms_t * | lms | ) |
Definition at line 1082 of file lightmediascanner_process.c.
References lms::is_processing, and lms::stop_processing.