RULEXDB_RETRIEVE_ITEM(3)
π RULEXDB_RETRIEVE_ITEM π
okay bestie so this is a page from the Library Functions Manual, section 3 (that's the "functions you call from C" section, iykyk), and it's all about rulexdb_retrieve_item β the lil function that goes and fetches your stuff out of the rulex database. let's get into it π«Ά
πΈ NAME πΈ
rulexdb_retrieve_item β retrieve an item from the rulex database
β¨ SYNOPSIS β¨
#include <rulexdb.h>
int rulexdb_retrieve_item(RULEXDB *rulexdb, const char *key, char *value, int item_type);
π¦ DESCRIPTION π¦
so rulexdb_retrieve_item() grabs an item out of one of the dictionary datasets inside the database that rulexdb points at. one job, does it well, periodt.
the key argument points to a text string holding the word you wanna fetch. that's your search term, your little query, your main character.
the value argument points to the memory area where the corresponding pronunciation string will get placed. yes babe, you provide that buffer, so make sure there's room π
the item_type argument says which dataset you're targeting. it can take one of these values:
RULEXDB_LEXBASEβ the item should be fetched from the Implicit dictionary, and therefore it represents a lexical base.RULEXDB_EXCEPTIONβ the item representing an exception should be fetched from the Explicit dictionary.RULEXDB_DEFAULTβ the target dictionary gets guessed from thekeyyou specified: if it represents any lexical base, the Implicit dictionary is chosen; otherwise the Explicit dictionary is used. so it's like, doing the vibes check for you π§
π RETURN VALUE π
rulexdb_retrieve_item() returns:
RULEXDB_SUCCESS, which is zero, when the specified item was successfully retrieved (slay),- the positive value
RULEXDB_SPECIALwhen the specified key does not exist in the dictionary (not a flop, justβ¦ not there π), - or a negative error code otherwise.
π ERRORS π
RULEXDB_FAILUREβ the referenced database has not been opened, internal data structures are corrupted, or some other general failure has occurred. like, something is deeply wrong.RULEXDB_EINVKEYβ invalid key specified.RULEXDB_EPARMβ therulexdbargument or theitem_typeargument has an invalid value.
bestie if you're getting negative returns, check those last two first. EPARM especially is like, "girl, what did you even pass me" π
π SEE ALSO π
your girl is not alone in this library, here's the whole friend group:
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_search(3)rulexdb_seq(3)rulexdb_subscribe_item(3)rulexdb_subscribe_rule(3)
π AUTHOR π
Igor B. Poretsky <poretsky@mlbox.ru>. iconic behavior, we love to see it π
and that's the whole page!! this little slice of the Library Functions Manual is dated June 22, 2023, and yeah it's RULEXDB_RETRIEVE_ITEM(3) through and through β go forth and retrieve your items, bestie π
β¨
π¦ 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