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 the key you gave: if it represents any lexical base, then the Implicit dictionary will be chosen, otherwise the Explicit dictionary is used instead. and if the key word 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 β€” invalid key specified.
  • RULEXDB_EINVREC β€” invalid pronunciation string specified.
  • RULEXDB_EPARM β€” the argument rulexdb or item_type has 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