textsearch_prepare(9)
β¨ 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 forlenβ length of pattern, fr fr, she needs to know how muchgfp_maskβ allocation mask π standard kernel allocation vibesflagsβ 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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms