RULEXDB_SUBSCRIBE_ITEM(3)
π RULEXDB_SUBSCRIBE_ITEM π
okay so bestie, welcome to the rulexdb_subscribe_item(3) page β it lives in the Library Functions Manual and it's literally the glow-up your rulex dictionary has been waiting for β¨
πΈ NAME πΈ
rulexdb_subscribe_item β drop a brand new dictionary item into the rulex database π«Ά
β¨ SYNOPSIS β¨
#include <rulexdb.h>
int rulexdb_subscribe_item(RULEXDB *rulexdb, const char *key, const char *value, int item_type, int overwrite);
π DESCRIPTION π
so the rulexdb_subscribe_item() function inserts a new item into one of the dictionary datasets inside the database that the rulexdb argument points at. no cap, that's the whole job.
the argument key points to a text string holding the original word π
the argument value points to the matching pronunciation string π
the argument item_type tells you which dataset is the target, and it may accept one of these iconic values:
RULEXDB_LEXBASEβ this item is a lexical base, so it should be inserted into the Implicit dictionary. periodt.RULEXDB_EXCEPTIONβ an explicit item that should be inserted into the Explicit dictionary.RULEXDB_DEFAULTβ the target dictionary gets guessed based on thekeyyou gave: if it represents any lexical base, then the Implicit dictionary will be chosen, otherwise the Explicit dictionary is used instead. and if thekeyword IS recognized as a lexical base, but the record for this key already exists in the Implicit dictionary, then the Explicit dictionary gets tried instead. it's giving backup plan energy π
the argument overwrite β if true (non-zero) the new item will replace an already existing one with the same key, if there is one. otherwise the new item will not be stored. like, it just won't show up. the vibe check said no π
β RETURN VALUE β
rulexdb_subscribe_item() returns RULEXDB_SUCCESS, which is zero, when the item you specified was successfully subscribed π or it returns the positive value RULEXDB_SPECIAL when that key already exists in the dictionary, or a negative error code otherwise.
π ERRORS π
RULEXDB_FAILUREβ the referenced database has not been opened, the internal data structures are corrupted, or some other general failure has occurred. yikes.RULEXDB_EINVKEYβ invalidkeyspecified.RULEXDB_EINVRECβ invalid pronunciation string specified.RULEXDB_EPARMβ the argumentrulexdboritem_typehas an invalid value.RULEXDB_EACCESSβ the database is not opened for updating. no write access, no entry, bestie π«
π¦ 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_rule(3)
π AUTHOR π
Igor B. Poretsky <poretsky@mlbox.ru>. king behavior, fr fr π
and that's the whole page bestie!! February 19, 2012 is when this beauty got its date stamp, the page is RULEXDB_SUBSCRIBE_ITEM(3), and it's all part of the Library Functions Manual β go forth and subscribe those items, you absolute icon ππβ¨
π¦ 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