RULEXDB_LOAD_RULESET(3)

πŸ’– RULEXDB_LOAD_RULESET πŸ’–

okay bestie, welcome to the rulexdb_load_ruleset(3) page β€” yes it's a section 3 library function, from the Library Functions Manual, and yes it's about to eat. let's go ✨


πŸŽ€ NAME πŸŽ€

rulexdb_load_ruleset β€” bestie, this is the one that loads up a specified ruleset from a rulex database. that's it. that's the whole job. πŸ‘‘


🌸 SYNOPSIS 🌸

#include <rulexdb.h>

int rulexdb_load_ruleset(RULEXDB *rulexdb, int rule_type);

like, you include the header, you call the function, you get an int back. simple as. πŸ¦‹


✨ DESCRIPTION ✨

so here's the tea πŸ“ β€” rulexdb_load_ruleset() preloads all the data for whichever ruleset you point at with the rule_type argument. and that argument is a choose-your-own-adventure, it accepts one of these iconic values:

  • RULEXDB_LEXCLASS β€” loads the Classifiers ruleset.
  • RULEXDB_PREFIX β€” loads the Prefix detectors ruleset.
  • RULEXDB_RULE β€” loads the General ruleset.
  • RULEXDB_CORRECTOR β€” loads the Correctors ruleset.

and the rulexdb argument? that one references the database you're dealing with. like, the actual db. the main character. πŸ’…

⚠️ lowkey important: a loaded ruleset cannot be modified. once it's loaded, that's the vibe, it's locked in, periodt. πŸ”’

πŸ”₯ RETURN VALUE πŸ”₯

rulexdb_load_ruleset() returns the number of loaded records when it's slaying πŸ’– β€” or a negative error code when it's not. so if the number comes back spicy-negative, check the next section, no cap.


πŸ’€ ERRORS πŸ’€

here's the vibe check on what can go wrong, bestie:

  • RULEXDB_FAILURE β€” the referenced database has not been opened, or the internal data structures are corrupted, or honestly some other general failure has occurred. it's giving chaos. 😭
  • RULEXDB_EPARM β€” invalid arguments are specified. check ur inputs babes πŸ™ˆ
  • RULEXDB_EACCESS β€” the database cannot be initialized for loading. ngl that one hurts.

🌈 SEE ALSO 🌈

go read these too, iykyk 🫢 β€” they're all part of the same little rulexdb fam:


πŸ‘‘ AUTHOR πŸ‘‘

this absolute icon wrote it: Igor B. Poretsky <poretsky@mlbox.ru>. stan. πŸ’œ


and that's the whole page bestie!! this lil gem dropped on June 21, 2023, and it's living in the Library Functions Manual as RULEXDB_LOAD_RULESET(3) β€” go forth and load those rulesets, mwah πŸ’…βœ¨πŸ’–

πŸ“¦ where this page comes from