RULEXDB_SUBSCRIBE_RULE(3)
β¨ RULEXDB_SUBSCRIBE_RULE β¨
okay so bestie, welcome to RULEXDB_SUBSCRIBE_RULE(3) β a page from the Library Functions Manual and honestly? it's giving "new rule just dropped" π
stay with me, it's short and slay.
πΈ NAME πΈ
rulexdb_subscribe_rule β store a new rule into the rulex database π
π¦ SYNOPSIS π¦
#include <rulexdb.h>
int rulexdb_subscribe_rule(RULEXDB *rulexdb, const char *src, int rule_type, unsigned int position);
π DESCRIPTION π
so rulexdb_subscribe_rule() literally just adds a brand new rule to the specified ruleset in the database that the rulexdb argument points at. that's the whole vibe. new rule, in the ruleset, periodt β¨
the argument src points to the text representation of the rule you wanna add β like, the actual rule as text, okay? π
the argument rule_type specifies the rule type. it may accept one of these iconic values:
RULEXDB_LEXCLASSβ this rule is the word classifier and should be added to the Classifiers dataset. it's the main character of word classification, no cap.RULEXDB_PREFIXβ the rule should be added to the Prefix detectors ruleset. prefix girly pop πRULEXDB_RULEβ the rule should be treated as a general rule and added to the General rules dataset. just a regular queen living her regular life πΈRULEXDB_CORRECTORβ this rule is a correction rule and should be added to the Correctors dataset. fixing things, as she should π
the argument position defines the position of the newly added rule in the ruleset. so:
- if it's
0, this rule is appended at the end of the ruleset (chill, she goes last) - otherwise, the new rule will be inserted at the specified position (cut the line bestie, she's going in the middle π)
π₯ RETURN VALUE π₯
rulexdb_subscribe_rule() returns RULEXDB_SUCCESS, which is zero, when it's a success π β or a non-zero error code otherwise. so like, 0 = we ate, anything else = we did not eat π
π ERRORS π
here's where it can go wrong, and ngl you need to know all of these:
RULEXDB_FAILUREβ the referenced database has not been opened, internal data structures are corrupted, or some other general failure has occurred. it's giving "everything is broken and we don't know why" πRULEXDB_EINVKEYβ the argumentpositionhas a non-zero value, but it is out of the ruleset range that must be continuous. so the range has to be continuous, and your position was not. not slay.RULEXDB_EPARMβ the argumentrulexdborrule_typehas an invalid value. bad param, bad vibe π«RULEXDB_EACCESSβ the database is not opened for updating. she's read-only rn, sorry bestie, you can't write to her π
π SEE ALSO π
go read these next, they're all connected, iykyk π«Ά
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)
π AUTHOR π
written by Igor B. Poretsky <poretsky@mlbox.ru> β icon behavior, thank you for your service π«‘π
and that's the page bestie!! π this was RULEXDB_SUBSCRIBE_RULE(3) from the Library Functions Manual, dated February 19, 2012 β go forth and subscribe those rules, you absolute legend π
β¨π
π¦ where this page comes from
- debian trixie: librulexdb-dev 3.8.6-1 Β· LGPL-2.1-or-later
- ubuntu questing: librulexdb-dev 3.8.6-1
- ubuntu resolute: librulexdb-dev 3.8.6-1build1 Β· LGPL-2.1-or-later
- ubuntu stonking: librulexdb-dev 3.8.6-1build1 Β· LGPL-2.1-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms