STRUCT TS_CONFIG(9)
π struct ts_config(9) β search configuration, bestie β¨
okay so welcome to the Kernel API Manual page for struct ts_config π this is literally the search config struct and she is the main character of textsearch setup, no cap. sit down, grab a strawberry drink π, and let's get into it.
πΈ NAME πΈ
struct ts_config β search configuration. that's it, that's the vibe check π
β¨ SYNOPSIS β¨
struct ts_config {
struct ts_ops *ops;
int flags;
unsigned int (*get_next_block)(unsigned int consumed,
const u8 **dst, struct ts_config *conf, struct ts_state *state);
void (*finish)(struct ts_config *conf, struct ts_state *state);
};
like, look at her. two function pointers, two plain fields. iconic honestly π
π¦ Members π¦
ops π
operations of chosen algorithm. that's the algorithm's whole ops table, the personality she picked.
flags β
flags. yes bestie that is genuinely the entire description. flags. π it's giving "the vibes are the documentation".
get_next_block π₯
fetch next block of data. here's the tea on the parameters:
consumedβ number of bytes consumed by the callerdstβ destination bufferconfβ search configurationstateβ search state
and listen, she gets called repeatedly until 0 is returned β that's the loop condition, don't sleep on it. she must assign the head of the next block of data to &*dst and return the length of the block, or 0 if you've hit the end. also consumed == 0 indicates a new search, so like, pay attention to that. may store/read persistent values in state->cb. ok that's the whole contract, periodt π
finish π§
finalize/clean a series of get_next_block calls. her params:
confβ search configurationstateβ search state
called after the last use of get_next_block (so like, the afterparty clean-up crew π«Ά), may be used to cleanup any leftovers.
π SEE ALSO π
kernel file ./include/linux/textsearch.h, plus these besties:
struct ts_state(9)struct ts_ops(9)textsearch_next(9)textsearch_find(9)textsearch_get_pattern(9)textsearch_get_pattern_len(9)
bestie reminder π«Ά all of this lives at ./include/linux π¦ and the bookkeeping timestamp on this one is October 2026 β so yeah, she's dated, she's filed, she's slaying in the source tree forever. mwah πβ¨π
π¦ 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