logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

rulexdb_subscribe_rule - store a new rule into the rulex database

Author

       Igor B. Poretsky <poretsky@mlbox.ru>.

                                                February 19, 2012                      RULEXDB_SUBSCRIBE_RULE(3)

Description

       The rulexdb_subscribe_rule() function adds a new rule to the specified ruleset in the database referenced
       by rulexdb argument.

       The argument src points to the text representation of the rule to be added.

       The argument rule_type specifies the rule type. It may accept one of the following values:

       RULEXDB_LEXCLASS
              The rule is the word classifier and should be added to the Classifiers dataset.

       RULEXDB_PREFIX
              The rule should be added to the Prefixdetectors ruleset.

       RULEXDB_RULE
              The rule should be treated as a general rule and added to the General rules dataset.

       RULEXDB_CORRECTOR
              The rule is a correction rule and should be added to the Correctors dataset.

       The  argument  position  defines  position  of  the  newly  added rule in the ruleset. If 0, this rule is
       appended at the end of ruleset, otherwise the new rule will be inserted at the specified position.

Errors

RULEXDB_FAILURE
              Referenced  database  has  not  been  opened, internal data structures are corrupted or some other
              general failure has occurred.

       RULEXDB_EINVKEY
              The argument position has a non-zero value, but it is out  of  the  ruleset  range  that  must  be
              continuous.

       RULEXDB_EPARM
              The argument rulexdb or rule_type has an invalid value.

       RULEXDB_EACCESS
              The database is not opened for updating.

Name

       rulexdb_subscribe_rule - store a new rule into the rulex database

Return Value

       The rulexdb_subscribe_rule() function returns RULEXDB_SUCCESS which is  zero  when  success  or  non-zero
       error code otherwise.

See Also

rulexdb_classify(3),     rulexdb_close(3),     rulexdb_dataset_name(3),    rulexdb_discard_dictionary(3),
       rulexdb_discard_ruleset(3),    rulexdb_fetch_rule(3),    rulexdb_lexbase(3),     rulexdb_load_ruleset(3),
       rulexdb_open(3),     rulexdb_remove_item(3),     rulexdb_remove_rule(3),     rulexdb_remove_this_item(3),
       rulexdb_retrieve_item(3), rulexdb_search(3), rulexdb_seq(3), rulexdb_subscribe_item(3)

Synopsis

#include<rulexdb.h>intrulexdb_subscribe_rule(RULEXDB*rulexdb,constchar*src,intrule_type,unsignedintposition);

See Also