RULEXDB_LEXBASE(3)

πŸ’– RULEXDB_LEXBASE(3) πŸ’–

okay bestie, pull up a chair because we're about to talk about rulexdb_lexbase from the rulexdb library functions manual and honestly? she's kind of iconic. πŸŽ€


✨ NAME ✨

rulexdb_lexbase β€” the girl whose whole job is trying to find the lexical base for a word you hand her. no cap, that's the gig. πŸ¦‹


🌸 SYNOPSIS 🌸

#include <rulexdb.h>

int rulexdb_lexbase(RULEXDB *rulexdb, const char *s, char *t, int n);

like… look at her. four arguments. serving c function energy. πŸ’…


πŸ’œ DESCRIPTION πŸ’œ

so here's the tea, fr fr. The rulexdb_lexbase() function goes scanning through the Classifiers ruleset, and it starts from n β€” and heads up, n must be positive, that's non-negotiable, it's giving boundaries β€” while it tries to match the word that s points at. 🫢

when the match actually succeeds (slay), the lexical base gets constructed in the memory area that t points at, and listen β€” that area must have enough space for it, like you have to actually prepare room, she is not going to build it in a closet. Then the function returns the number of the matched rule, or 0 if no match was found. 🧚

and the rulexdb argument? that's a reference to the rulex database we're searching in. she needs to know where to look. πŸ‘‘


⭐ RETURN VALUE ⭐

  • returns the number of the matched rule β€” and that number is always positive, okay, always 🌈
  • returns 0 when no match was found
  • returns a negative error code if something went wrong 😭

πŸ’€ ERRORS πŸ’€

  • RULEXDB_FAILURE β€” the referenced database has not been opened, or the internal data structures are corrupted, or some other general failure has occurred. it's giving disaster. πŸ™ˆ
  • RULEXDB_EMALLOC β€” internal memory allocation error. the mallocs said no. πŸ’”
  • RULEXDB_EPARM β€” invalid parameters are specified. bestie. check your args. 😀

πŸ”₯ SEE ALSO πŸ”₯

the whole friend group, honestly. go say hi. πŸ’–


πŸ‘‘ AUTHOR πŸ‘‘

Igor B. Poretsky <poretsky@mlbox.ru>. the main character who wrote her. periodt. ✨


and that's the whole page, bestie β€” Library Functions Manual, RULEXDB_LEXBASE(3), dated February 20, 2012, mwah πŸ’…πŸ’–

πŸ“¦ where this page comes from