User-API


Functions

lms_tlms_new (const char *db_path)
int lms_free (lms_t *lms)
lms_plugin_tlms_parser_add (lms_t *lms, const char *so_path)
lms_plugin_tlms_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)

Detailed Description

Functions for library users.

Function Documentation

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.

Parameters:
lms previously allocated Light Media Scanner instance.
charset charset name as understood by iconv_open(3).
Returns:
On success 0 is returned.

Definition at line 496 of file lightmediascanner.c.

References lms::cs_conv, and lms_charset_conv_add().

Here is the call graph for this function:

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.

Parameters:
lms previously allocated Light Media Scanner instance.
charset charset name as understood by iconv_open(3).
Returns:
On success 0 is returned.

Definition at line 519 of file lightmediascanner.c.

References lms::cs_conv, and lms_charset_conv_del().

Here is the call graph for this function:

int lms_free ( lms_t lms  ) 

Free existing Light Media Scanner instance.

Parameters:
lms previously allocated Light Media Scanner instance.
Returns:
On success 0 is returned.

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().

Here is the call graph for this function:

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.

Parameters:
lms previously allocated Light Media Scanner instance.
Returns:
(unsigned int)-1 on error, value otherwise.

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.

Parameters:
lms previously allocated Light Media Scanner instance.
Returns:
path to database.

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.

Parameters:
lms previously allocated Light Media Scanner instance.
Returns:
-1 on error or time in milliseconds otherwise.

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().

Parameters:
lms previously allocated Light Media Scanner instance.
Returns:
1 if it is processing, 0 if it's not, -1 on error.

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.

Parameters:
db_path path to database file.
Returns:
allocated data on success or NULL on failure.

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.

Here is the call graph for this function:

lms_plugin_t* lms_parser_add ( lms_t lms,
const char *  so_path 
)

Add parser plugin given it's shared object path.

Parameters:
lms previously allocated Light Media Scanner instance.
so_path path to shared object (usable by dlopen(3)).
Returns:
On success the LMS handle to plugin is returned, NULL on error.

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.

Parameters:
lms previously allocated Light Media Scanner instance.
Returns:
On success 0 is returned.

Definition at line 334 of file lightmediascanner.c.

References lms::is_processing, lms_parser_del_int(), lms::n_parsers, lms::parsers, and parser::plugin.

Here is the call graph for this function:

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).

Parameters:
lms previously allocated Light Media Scanner instance.
name plugin name.
Returns:
On success the LMS handle to plugin is returned, NULL on error.

Definition at line 279 of file lightmediascanner.c.

References lms_parser_add(), and parser::so_path.

Here is the call graph for this function:

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.

Parameters:
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.

Parameters:
lms previously allocated Light Media Scanner instance.
ms time in milliseconds.

Definition at line 427 of file lightmediascanner.c.

References lms::slave_timeout.


Generated on Wed Apr 22 23:56:01 2009 for Light Media Scanner by  doxygen 1.5.8