critbit0_delete(3)

πŸ“¦
version 0.34 Β· 2 versions
  • 0.34 Β· alpine 3.24, debian bookworm, debian trixie, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking (latest)
  • 0.30 Β· fedora 43, fedora 44, ubuntu jammy
, in alpine 3.24, debian bookworm, debian trixie, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– critbit0_delete β€” bestie edition πŸ’–

okay so this is a page from the Library Functions Manual, and the function in question is critbit0_delete. It lives in section 3, and it's the girl whose whole job is removing a string from a critbit tree. Clean, simple, iconic. πŸŽ€


✨ NAME ✨

critbit0_delete β€” delete a string from a critbit tree πŸ—‘οΈπŸ¦‹


🌸 SYNTAX 🌸

no cap, this is literally the whole thing:

#include <libowfat/critbit.h>

critbit0_tree cb = { 0 };

int critbit0_delete(critbit0_tree* cb,const char* str);

see that { 0 }? yeah bestie, initialize your tree. main character energy only. πŸ‘‘


πŸ’… DESCRIPTION πŸ’…

okay so critbit0_delete attempts to delete a string from a critbit0 tree. That's the whole vibe. But here's where it gets spicy, because there are two possible outcomes and you gotta know which one you're getting:

  • If str is in cb, then critbit0_delete removes it and returns 1. slay. gone. periodt. πŸ’€
  • If str is not in cb, then critbit0_delete leaves it alone and returns 0. it's giving "not my problem, not my string." πŸ™ˆ

so like, it's not out here creating chaos β€” if your string isn't there, nothing happens. the tree stays exactly as it was. lowkey respectful of it honestly. 🫢


⭐ RETURN VALUE ⭐

  • 1 β€” it was in cb, and it has now been removed πŸŽ‰
  • 0 β€” it was not in cb, so nothing changed 🧚

that's it, that's the whole return situation, fr fr.


🌈 SEE ALSO 🌈


and that's the page!! shoutout to the Library Functions Manual, section 3, where critbit0_delete(3) lives rent free. go forth and delete responsibly, bestie πŸ’œβœ¨πŸŽ€