rulexdb_remove_rule(3)

rulexdb_remove_rule3

Remove specified rule from the rulex database

Usage

#include <rulexdb.h>

int rulexdb_remove_rule(RULEXDB *rulexdb, int rule_type, int position);

Overview

The rulexdb_remove_rule() function removes a rule identified by its type and position in the ruleset from the rulex database referenced by rulexdb argument.

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 belongs to the Classifiers dataset.

RULEXDB_PREFIX

The requested rule should be removed from the Prefix detectors ruleset.

RULEXDB_RULE

The requested rule should be removed from the General rules dataset.

RULEXDB_CORRECTOR

The rule is a correction rule that belongs to the Correctors dataset.

The argument position defines position of the requested rule in the ruleset.

Return value

The rulexdb_remove_rule() function returns RULEXDB_SUCCESS which is zero when specified rule was successfully removed, positive value RULEXDB_SPECIAL when there is no rule with such number in specified ruleset, or negative error code otherwise.

Errors

RULEXDB_FAILURE

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

RULEXDB_EPARM

The argument rulexdb or rule_type has an invalid value.

RULEXDB_EACCESS

The database is not opened for updating.

Author

Igor B. Poretsky <[email protected]>.

From librulexdb-dev 3.8.6-1 in Debian 13 (Trixie). Parsed by carta from the page's man source.