Functions | |
lms_t * | lms_new (const char *db_path) |
int | lms_free (lms_t *lms) |
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 (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) |
int lms_charset_add | ( | lms_t * | lms, | |
const char * | charset | |||
) |
Register a new charset encoding to be used.
All database text strings are in UTF-8, so one needs to register new encodings in order to convert to it.
lms | previously allocated Light Media Scanner instance. | |
charset | charset name as understood by iconv_open(3). |
Definition at line 496 of file lightmediascanner.c.
References lms::cs_conv, and lms_charset_conv_add().
int lms_charset_del | ( | lms_t * | lms, | |
const char * | charset | |||
) |
Forget about registered charset encoding.
All database text strings are in UTF-8, so one needs to register new encodings in order to convert to it.
lms | previously allocated Light Media Scanner instance. | |
charset | charset name as understood by iconv_open(3). |
Definition at line 519 of file lightmediascanner.c.
References lms::cs_conv, and lms_charset_conv_del().
int lms_free | ( | lms_t * | lms | ) |
Free existing Light Media Scanner instance.
lms | previously allocated Light Media Scanner instance. |
Definition at line 159 of file lightmediascanner.c.
References lms::cs_conv, lms::data, lms::db_path, lms::free_data, lms::is_processing, lms_charset_conv_free(), lms::n_parsers, lms::parsers, and lms::progress.
Referenced by lms_create_slave().
unsigned int lms_get_commit_interval | ( | const lms_t * | lms | ) |
Get the number of files served between database transactions.
This is used as an optimization to database access: doing database commits take some time and can slow things down too much, so you can choose to just commit after some number of files are processed, this is the commit_interval.
lms | previously allocated Light Media Scanner instance. |
Definition at line 449 of file lightmediascanner.c.
References lms::commit_interval.
const char* lms_get_db_path | ( | const lms_t * | lms | ) |
Get the database path given at creation time.
lms | previously allocated Light Media Scanner instance. |
Definition at line 385 of file lightmediascanner.c.
References lms::db_path.
int lms_get_slave_timeout | ( | const lms_t * | lms | ) |
Get the maximum amount of milliseconds the slave can take to serve one file.
If a slave takes more than this amount of milliseconds, it will be killed and the scanner will continue with the next file.
lms | previously allocated Light Media Scanner instance. |
Definition at line 407 of file lightmediascanner.c.
References lms::slave_timeout.
int lms_is_processing | ( | const lms_t * | lms | ) |
Checks if Light Media Scanner is being used in a processing operation lile lms_process() or lms_check().
lms | previously allocated Light Media Scanner instance. |
Definition at line 366 of file lightmediascanner.c.
References lms::is_processing.
lms_t* lms_new | ( | const char * | db_path | ) |
Create new Light Media Scanner instance.
db_path | path to database file. |
Definition at line 121 of file lightmediascanner.c.
References lms::commit_interval, lms::cs_conv, lms::db_path, DEFAULT_COMMIT_INTERVAL, DEFAULT_SLAVE_TIMEOUT, lms_charset_conv_free(), lms_charset_conv_new(), and lms::slave_timeout.
lms_plugin_t* lms_parser_add | ( | lms_t * | lms, | |
const char * | so_path | |||
) |
Add parser plugin given it's shared object path.
lms | previously allocated Light Media Scanner instance. | |
so_path | path to shared object (usable by dlopen(3)). |
Definition at line 221 of file lightmediascanner.c.
References lms::is_processing, lms::n_parsers, lms::parsers, and parser::plugin.
Referenced by lms_parser_find_and_add().
int lms_parser_del | ( | lms_t * | lms, | |
lms_plugin_t * | handle | |||
) |
Delete previously added parser, making it unavailable for future operations.
lms | previously allocated Light Media Scanner instance. |
Definition at line 334 of file lightmediascanner.c.
References lms::is_processing, lms_parser_del_int(), lms::n_parsers, lms::parsers, and parser::plugin.
lms_plugin_t* lms_parser_find_and_add | ( | lms_t * | lms, | |
const char * | name | |||
) |
Add parser plugin given it's name.
This will look at default plugin path by the file named name
(plus the required shared object extension).
lms | previously allocated Light Media Scanner instance. | |
name | plugin name. |
Definition at line 279 of file lightmediascanner.c.
References lms_parser_add(), and parser::so_path.
void lms_set_commit_interval | ( | lms_t * | lms, | |
unsigned int | transactions | |||
) |
Set the number of files served between database transactions.
This is used as an optimization to database access: doing database commits take some time and can slow things down too much, so you can choose to just commit after transactions
files are processed.
lms | previously allocated Light Media Scanner instance. | |
transactions | number of files (transactions) to process between commits. |
Definition at line 472 of file lightmediascanner.c.
References lms::commit_interval.
void lms_set_slave_timeout | ( | lms_t * | lms, | |
int | ms | |||
) |
Set the maximum amount of milliseconds the slave can take to serve one file.
If a slave takes more than this amount of milliseconds, it will be killed and the scanner will continue with the next file.
lms | previously allocated Light Media Scanner instance. | |
ms | time in milliseconds. |
Definition at line 427 of file lightmediascanner.c.
References lms::slave_timeout.