} ParserRuby;
/**
+ *
* Native memory deletion function
- * @param self The current Parser instance
+ *
* @return nil
+ *
*/
static VALUE parser_free(VALUE self) {
ParserRuby *parser;
#if 0
// Obsolete
/**
+ *
* Add parser plugin, given its shared object path.
- * @param self The current Parser instance
+ *
* @param name path to shared object (usable by dlopen(3)).
+ *
* @return A new Parser
+ *
*/
static VALUE scanner_add_parser(VALUE self, VALUE name) {
lms_t *lms;
#endif
/**
+ *
* Parser#new
+ *
* constructor
- * @param obj The LightMediaScanner::Parser class
+ *
* @param parent The Scanner to which the parser belongs
+ *
* @param name path to shared object (usable by dlopen(3)).
+ *
* @return A new Parser
+ *
*/
static VALUE parser_new(VALUE obj, VALUE parent, VALUE name) {
lms_t *lms;
return Data_Wrap_Struct(lightmediascanner_parser, 0, parser_free, parser);
}// scanner_new
+/**
+ * LightMediaScanner::Parser is a class to represent
+ * a LightMediaScanner plugin.
+ */
void Init_lightmediascanner_parser() {
lightmediascanner_parser = rb_define_class_under(lightmediascanner_module, "Parser", rb_cObject);
rb_define_singleton_method(lightmediascanner_parser, "new", parser_new, 2);
* @author Levi Bard <taktaktaktaktaktaktaktaktaktak@gmail.com>
*/
+#include "ruby-lightmediascanner.h"
#include "lightmediascanner_scanner.h"
/**
* Scanner#new
+ *
* constructor
- * @param obj The LightMediaScanner::Scanner class
+ *
* @param db_path The path to the sqlite3 db to be used
+ *
* @return A new Scanner instance
*/
static VALUE scanner_new(VALUE obj, VALUE db_path) {
}// scanner_new
/**
+ *
* Scanner::process
+ *
* This will add or update media found in the given directory or its children.
- * @param self The current Scanner instance
+ *
* @param top_path The top directory to scan.
+ *
* @return 0 on success
+ *
*/
static VALUE scanner_process(VALUE self, VALUE top_path) {
lms_t *lms;
}// scanner_process
/**
+ *
* Scanner::check
+ *
* Check consistency of the given directory.
- * @param self The current Scanner instance
+ *
* @param top_path The top directory to scan.
+ *
* @return 0 on success
+ *
*/
static VALUE scanner_check(VALUE self, VALUE top_path) {
lms_t *lms;
}// scanner_check
/**
+ *
* Scanner::db_path
+ *
* Accessor for LMS DB path.
- * @param self The current Scanner instance
+ *
* @return The database path given at creation time
+ *
*/
static VALUE scanner_db_path(VALUE self) {
lms_t *lms;
}// scanner_db_path
/**
+ *
* Scanner::processing?
+ *
* Checks if Light Media Scanner is being used in a processing operation like lms_process() or lms_check().
- * @param self The current Scanner instance
+ *
* @return Boolean representing the instance's processing state
+ *
*/
static VALUE scanner_processing(VALUE self) {
lms_t *lms;
}// scanner_processing
/**
+ *
* Scanner::timeout
+ *
* 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.
- * @param self The current Scanner instance
+ *
* @return The timeout in milliseconds, or -1 on error
+ *
*/
static VALUE scanner_get_slave_timeout(VALUE self) {
lms_t *lms;
}// scanner_get_slave_timeout
/**
+ *
* Scanner::timeout=
+ *
* 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.
- * @param self The current Scanner instance
+ *
* @param timeout_ms The timeout in milliseconds
+ *
* @return The new timeout, in milliseconds
+ *
*/
static VALUE scanner_set_slave_timeout(VALUE self, VALUE timeout_ms) {
lms_t *lms;
}// scanner_set_slave_timeout
/**
+ *
* Scanner::commit_interval
+ *
* Get the number of files served between database transactions.
- * @param self The current Scanner instance
+ *
* @return The number of files served between database transactions
+ *
*/
static VALUE scanner_get_commit_interval(VALUE self) {
lms_t *lms;
}// scanner_get_commit_interval
/**
+ *
* Scanner::commit_interval=
+ *
* Set the number of files to be served between database transactions.
- * @param self The current Scanner instance
+ *
* @param transactions The number of files between commits
+ *
* @return The new number of files to be served between database transactions
+ *
*/
static VALUE scanner_set_commit_interval(VALUE self, VALUE transactions) {
lms_t *lms;
}// scanner_set_commit_interval
/**
+ *
* Scanner::add_charset
+ *
* Register a new charset encoding to be used.
+ *
* Throws a RuntimeError if LMS is unable to add the charset.
- * @param self The current Scanner instance
+ *
* @param charset charset name as understood by iconv_open(3).
+ *
* @return charset
+ *
*/
static VALUE scanner_add_charset(VALUE self, VALUE charset) {
lms_t *lms;
}// scanner_add_charset
/**
+ *
* Scanner::remove_charset
+ *
* Forget about a registered charset encoding.
+ *
* Throws a RuntimeError if LMS is unable to remove the charset.
- * @param self The current Scanner instance
+ *
* @param charset charset name as understood by iconv_open(3).
+ *
* @return charset
+ *
*/
static VALUE scanner_remove_charset(VALUE self, VALUE charset) {
lms_t *lms;
return charset;
}// scanner_remove_charset
+/**
+ * LightMediaScanner::Scanner is a class to represent a
+ * LightMediaScanner instance.
+ */
void Init_lightmediascanner_scanner() {
lightmediascanner_scanner = rb_define_class_under(lightmediascanner_module, "Scanner", rb_cObject);
rb_define_singleton_method(lightmediascanner_scanner, "new", scanner_new, 1);