*
* Native memory deletion function
*
- * @return nil
+ * * return nil
*
*/
-static VALUE parser_free(VALUE self) {
- ParserRuby *parser;
- Data_Get_Struct(self, ParserRuby, parser);
+static VALUE parser_free(ParserRuby *parser) {
+ if(parser) {
+ if(parser->plugin) {
+ lms_parser_del(parser->parent, parser->plugin);
+ }// delete plugin
- if(parser->plugin) {
- lms_parser_del(parser->parent, parser->plugin);
- }// delete plugin
-
- free(parser);
+ free(parser);
+ }
return Qnil;
}// parser_free
*
* Add parser plugin, given its shared object path.
*
- * @param name path to shared object (usable by dlopen(3)).
+ * * p1 (name) path to shared object (usable by dlopen(3)).
*
- * @return A new Parser
+ * * return A new Parser
*
*/
static VALUE scanner_add_parser(VALUE self, VALUE name) {
*
* constructor
*
- * @param parent The Scanner to which the parser belongs
+ * * p1 (parent) The Scanner to which the parser belongs
*
- * @param name path to shared object (usable by dlopen(3)).
+ * * p2 (name) path to shared object (usable by dlopen(3)).
*
- * @return A new Parser
+ * * return A new Parser
*
*/
static VALUE parser_new(VALUE obj, VALUE parent, VALUE name) {
- lms_t *lms;
+ lms_t *lms = NULL;
char *cname = NULL;
ParserRuby *parser = NULL;
lms_plugin_t *plugin = NULL;
parser->parent = lms;
parser->plugin = plugin;
- return Data_Wrap_Struct(lightmediascanner_parser, 0, parser_free, parser);
+ return Data_Wrap_Struct(obj, NULL, parser_free, parser);
}// scanner_new
/**
*
* constructor
*
- * @param db_path The path to the sqlite3 db to be used
+ * * p1 (db_path) The path to the sqlite3 db to be used
*
- * @return A new Scanner instance
+ * * return A new Scanner instance
*/
static VALUE scanner_new(VALUE obj, VALUE db_path) {
Check_Type(db_path, T_STRING);
*
* This will add or update media found in the given directory or its children.
*
- * @param top_path The top directory to scan.
+ * * p1 (top_path) The top directory to scan.
*
- * @return 0 on success
+ * * return 0 on success
*
*/
static VALUE scanner_process(VALUE self, VALUE top_path) {
*
* Check consistency of the given directory.
*
- * @param top_path The top directory to scan.
+ * * p1 (top_path) The top directory to scan.
*
- * @return 0 on success
+ * * return 0 on success
*
*/
static VALUE scanner_check(VALUE self, VALUE top_path) {
*
* Accessor for LMS DB path.
*
- * @return The database path given at creation time
+ * * return The database path given at creation time
*
*/
static VALUE scanner_db_path(VALUE self) {
*
* Checks if Light Media Scanner is being used in a processing operation like lms_process() or lms_check().
*
- * @return Boolean representing the instance's processing state
+ * * return Boolean representing the instance's processing state
*
*/
static VALUE scanner_processing(VALUE self) {
*
* If a slave takes more than this amount of milliseconds, it will be killed and the scanner will continue with the next file.
*
- * @return The timeout in milliseconds, or -1 on error
+ * * return The timeout in milliseconds, or -1 on error
*
*/
static VALUE scanner_get_slave_timeout(VALUE self) {
*
* If a slave takes more than this amount of milliseconds, it will be killed and the scanner will continue with the next file.
*
- * @param timeout_ms The timeout in milliseconds
+ * * p1 (timeout_ms) The timeout in milliseconds
*
- * @return The new timeout, in milliseconds
+ * * return The new timeout, in milliseconds
*
*/
static VALUE scanner_set_slave_timeout(VALUE self, VALUE timeout_ms) {
*
* Get the number of files served between database transactions.
*
- * @return The number of files served between database transactions
+ * * return The number of files served between database transactions
*
*/
static VALUE scanner_get_commit_interval(VALUE self) {
*
* Set the number of files to be served between database transactions.
*
- * @param transactions The number of files between commits
+ * * p1 (transactions) The number of files between commits
*
- * @return The new number of files to be served between database transactions
+ * * return The new number of files to be served between database transactions
*
*/
static VALUE scanner_set_commit_interval(VALUE self, VALUE transactions) {
*
* Throws a RuntimeError if LMS is unable to add the charset.
*
- * @param charset charset name as understood by iconv_open(3).
+ * * p1 (charset) charset name as understood by iconv_open(3).
*
- * @return charset
+ * * return charset
*
*/
static VALUE scanner_add_charset(VALUE self, VALUE charset) {
*
* Throws a RuntimeError if LMS is unable to remove the charset.
*
- * @param charset charset name as understood by iconv_open(3).
+ * * p1 (charset) charset name as understood by iconv_open(3).
*
- * @return charset
+ * * return charset
*
*/
static VALUE scanner_remove_charset(VALUE self, VALUE charset) {