textsearch_prepare(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ textsearch_prepare(9) ✨

okay so bestie, we're in the Kernel API Manual today and this one is textsearch_prepare(9) β€” literally the glow-up that gets your search ready to go. πŸ’…


🌸 NAME 🌸

textsearch_prepare β€” Prepare a search πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

struct ts_config * textsearch_prepare (const char *algo , const void
       *pattern , unsigned int len , gfp_t gfp_mask , int flags );

like, it hands you back a struct ts_config *, and it takes five whole arguments. she's thorough. πŸ’–


πŸ”₯ ARGUMENTS πŸ”₯

  • algo β€” name of search algorithm πŸ‘‘ (yes, as a string, pick your fighter)
  • pattern β€” pattern data πŸ“ the actual bytes you're hunting for
  • len β€” length of pattern, fr fr, she needs to know how much
  • gfp_mask β€” allocation mask 🌈 standard kernel allocation vibes
  • flags β€” search flags ⭐ the little toggles

πŸ’œ DESCRIPTION πŸ’œ

So what does it do? It looks up the search algorithm module (shoutout to modules, iconic) and creates a new textsearch configuration for the specified pattern. that's it, that's the whole vibe check. main character energy: prepare the search, then go find stuff. ✨🫢


🌟 NOTE 🌟

big heads-up bestie: the format of the pattern may not be compatible between the various search algorithms 😭 like the pattern you write for one algo is not guaranteed to make sense to another one. no cap.

It returns a new textsearch configuration according to the specified parameters, or a ERR_PTR πŸ’€ (yes, an error pointer, she does that sometimes).

And if a zero length pattern is passed, this function returns EINVAL. zero bytes? not today. πŸ™ˆ


🌈 SEE ALSO 🌈

Kernel file ./lib/textsearch.c, plus the whole friend group: ts_intro(9), textsearch_register(9), textsearch_unregister(9), textsearch_find_continuous(9), textsearch_destroy(9) πŸ§šβ€β™€οΈπŸ’«


mwah, that's the page πŸ’‹ β€” straight out of ./lib, dated October 2026, and this was textsearch_prepare(9). go slay your searches, bestie πŸŽ€πŸ’–

πŸ“¦ where this page comes from