RULEXDB_FETCH_RULE(3)
β¨ RULEXDB_FETCH_RULE β the manual page, but make it make sense π
okay bestie, gather round, because today we're talking about rulexdb_fetch_rule from the rulexdb library (that's manual section 3, library functions, iykyk). This little icon pulls one specific rule out of the rulex database for you. Not a vibe, not a guess β the actual rule. Let's go. π¦
πΈ SYNOPSIS πΈ
#include <rulexdb.h>
char *rulexdb_fetch_rule(RULEXDB *rulexdb, int rule_type, int position);
that's it. that's the whole flex. β¨
π DESCRIPTION π
So rulexdb_fetch_rule() does the thing: it retrieves a rule from the rulex database referenced by the rulexdb argument, and it identifies that rule by its type and its position in the ruleset. Both. You need both. no shortcuts, bestie. π«Ά
The rule_type argument says which kind of rule you're after. It may accept one of these iconic values:
RULEXDB_LEXCLASSβ this rule is the word classifier, and it belongs to the Classifiers dataset. πRULEXDB_PREFIXβ this rule describes prefix detection and replacement, and it belongs to the Prefix detectors ruleset.RULEXDB_RULEβ the rule you're requesting should be extracted from the General rules dataset. periodt.RULEXDB_CORRECTORβ this rule is a correction rule, and it belongs to the Correctors dataset. π
And then there's the position argument β that one defines where your requested rule sits in the ruleset. like, its seat in the group chat. πͺ
π RETURN VALUE π
On success? The rulexdb_fetch_rule() function returns a pointer to the textual representation of the extracted rule. slay.
β οΈ okay important, listen up: that pointer remains valid only until the next database operation. Do not hoard it. Do not stash it in your purse. The moment you touch the database again, it's gone, bestie. π
Otherwise β if it doesn't work out β NULL is returned. that's the no-note-no-call of return values. π
π₯ SEE ALSO π₯
the whole friend group, honestly:
rulexdb_classify(3)rulexdb_close(3)rulexdb_dataset_name(3)rulexdb_discard_dictionary(3)rulexdb_discard_ruleset(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)rulexdb_subscribe_rule(3)
π AUTHOR π
this masterpiece was written by Igor B. Poretsky <poretsky@mlbox.ru>. absolute main character energy. π
and that's the whole page, bestie β Library Functions Manual, RULEXDB_FETCH_RULE(3), dated February 19, 2012. go forth and fetch responsibly. mwah. πβ¨
π¦ 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