#include <dlfcn.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <dirent.h>
#include <errno.h>
#include "lightmediascanner.h"
#include "lightmediascanner_private.h"
#include "lightmediascanner_plugin.h"
Go to the source code of this file.
Defines | |
#define | DEFAULT_SLAVE_TIMEOUT 1000 |
#define | DEFAULT_COMMIT_INTERVAL 100 |
Functions | |
lms_t * | lms_new (const char *db_path) |
int | lms_free (lms_t *lms) |
void | lms_set_progress_callback (lms_t *lms, lms_progress_callback_t cb, const void *data, lms_free_callback_t free_data) |
lms_plugin_t * | lms_parser_add (lms_t *lms, const char *so_path) |
lms_plugin_t * | lms_parser_find_and_add (lms_t *lms, const char *name) |
int | lms_parser_del_int (lms_t *lms, int i) |
int | lms_parser_del (lms_t *lms, lms_plugin_t *handle) |
int | lms_is_processing (const lms_t *lms) |
const char * | lms_get_db_path (const lms_t *lms) |
int | lms_get_slave_timeout (const lms_t *lms) |
void | lms_set_slave_timeout (lms_t *lms, int ms) |
unsigned int | lms_get_commit_interval (const lms_t *lms) |
void | lms_set_commit_interval (lms_t *lms, unsigned int transactions) |
int | lms_charset_add (lms_t *lms, const char *charset) |
int | lms_charset_del (lms_t *lms, const char *charset) |
void | lms_parsers_list (int(*cb)(void *data, const char *path), const void *data) |
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) |
struct lms_parser_info * | lms_parser_info (const char *so_path) |
struct lms_parser_info * | lms_parser_info_find (const char *name) |
void | lms_parser_info_free (struct lms_parser_info *info) |
#define DEFAULT_COMMIT_INTERVAL 100 |
#define DEFAULT_SLAVE_TIMEOUT 1000 |
Copyright (C) 2007 by INdT
This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Definition at line 36 of file lightmediascanner.c.
Referenced by lms_new().
int lms_parser_del_int | ( | lms_t * | lms, | |
int | i | |||
) |
Definition at line 294 of file lightmediascanner.c.
References lms::n_parsers, and lms::parsers.
Referenced by lms_parser_del(), lms_parsers_setup(), and lms_parsers_start().
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().
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().
void lms_parser_info_free | ( | struct lms_parser_info * | info | ) |
Free previously returned information.
Definition at line 843 of file lightmediascanner.c.
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().
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().
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.