RULEXDB_REMOVE_ITEM(3)

πŸ’– RULEXDB_REMOVE_ITEM(3) πŸ’–

okay bestie, we're in the Library Functions Manual and this one's a lil delete-button moment, so let's get into it πŸŽ€


✨ NAME ✨

rulexdb_remove_item β€” remove specified item from the rulex dictionary


🌸 SYNOPSIS 🌸

#include <rulexdb.h>

int rulexdb_remove_item(RULEXDB *rulexdb, const char *key, int item_type);

πŸ’… DESCRIPTION πŸ’…

so the rulexdb_remove_item() function does exactly what it says on the tin β€” it removes a lexical item for the specified key from the dictionary dataset defined by the item_type argument. and item_type can be one of these two icons πŸ‘‘

  • RULEXDB_LEXBASE β€” remove the item from the Implicit dictionary. 🫢
  • RULEXDB_EXCEPTION β€” remove the item from the Explicit dictionary. ✨
lowkey important: the data type has to be specified explicitly. the value RULEXDB_DEFAULT is not allowed here, no exceptions, periodt πŸ’€

and the rulexdb argument references the database we're dealing with, obviously πŸ¦‹


🌈 RETURN VALUE 🌈

so rulexdb_remove_item() returns:

  • RULEXDB_SUCCESS β€” which is zero β€” when the specified item was successfully removed πŸŽ‰ slay
  • a positive value, RULEXDB_SPECIAL β€” when no record exists for the specified key (it's giving "girl there's nothing here") πŸ™ˆ
  • a negative error code β€” when it's any other kind of failure 😭

πŸ’€ ERRORS πŸ’€

  • RULEXDB_FAILURE β€” the referenced database has not been opened, internal data structures are corrupted, or some other general failure has occurred. bestie, this is the vague "something's wrong" of error codes 🫠
  • RULEXDB_EINVKEY β€” invalid key specified. nope, not that one πŸ’…
  • RULEXDB_EPARM β€” the argument rulexdb or item_type has an invalid value. check your inputs bestie πŸ™ˆ
  • RULEXDB_EACCESS β€” the database is not opened for updating. so you literally cannot delete anything from it rn πŸ”₯

πŸ¦‹ SEE ALSO πŸ¦‹


πŸ‘‘ AUTHOR πŸ‘‘

Igor B. Poretsky <poretsky@mlbox.ru>. king behavior, no cap 🫢


and that's the whole page bestie πŸ’œ this lil masterpiece dropped on February 20, 2012, and it's filed under RULEXDB_REMOVE_ITEM(3) in the Library Functions Manual β€” iconic, historic, and fr fr useful. mwah πŸŽ€βœ¨

πŸ“¦ where this page comes from