ecoli_string(3)
π ecoli_string(3) β Libecoli π
okay bestie, welcome to ecoli_string, the Libecoli page that's literally all about string manipulation β¨ β it's giving "helpers for strings manipulation" and nothing else. no cap, that's the whole vibe. π
πΈ NAME πΈ
ecoli_string β string manipulation, bestie.
- Helpers for strings manipulation. that's it, that's the job π
β¨ SYNOPSIS β¨
π¦ Functions π¦
size_t ec_strcmp_count (const char *s1, const char *s2)
int ec_str_startswith (const char *s, const char *beginning)
bool ec_str_is_space (const char *s)
int ec_str_parse_llint (const char *str, unsigned int base, int64_t min,
int64_t max, int64_t *val)
int ec_str_parse_ullint (const char *str, unsigned int base, uint64_t
min, uint64_t max, uint64_t *val)
char * ec_str_quote (const char *str, char quote, bool force)
char * ec_str_wrap (const char *str, size_t max_cols, size_t start_off)
π Detailed Description π
Helpers for strings manipulation. fr fr, that's the entire detailed description. iconic minimalism π
π Function Documentation π
π size_t ec_strcmp_count (const char * s1, const char * s2)
Counts how many identical characters show up at the very beginning of two strings. literally comparing them character by character until they stop matching, and it tells you the count π«Ά
π int ec_str_startswith (const char * s, const char * beginning)
Returns 1 if the string starts with the given prefix. that's the vibe check: does s begin with beginning? yes or no, no drama β
π bool ec_str_is_space (const char * s)
Returns true if the string contains only whitespace characters. so like, all spaces and vibes, nothing else πΈ
π int ec_str_parse_llint (const char * str, unsigned int base, int64_t min, int64_t max, int64_t * val)
Parses a string for a signed integer. yes bestie, we're doing number parsing π₯
Parameters
strβ the string to parse.baseβ the base (0means guess).minβ the minimum allowed value.maxβ the maximum allowed value.valβ the pointer to the value to be set on success.
Returns
On success, returns 0. Otherwise, returns -1 and sets errno. π (so always check errno, iykyk)
π int ec_str_parse_ullint (const char * str, unsigned int base, uint64_t min, uint64_t max, uint64_t * val)
Parses a string for an unsigned integer. same energy as the signed one, just no negativity allowed π¦
Parameters
strβ the string to parse.baseβ the base (0means guess).minβ the minimum allowed value.maxβ the maximum allowed value.valβ the pointer to the value to be set on success.
Returns
On success, returns 0. Otherwise, returns -1 and sets errno. π same rules, bestie.
π char* ec_str_quote (const char * str, char quote, bool force)
Quotes a string, escaping any nested quotes. very demure, very careful π
Parameters
strβ the string to quote.quoteβ the quote character to use: usually'or'but can be anything. If0, select between'or'automatically.forceβ iftrue, always add quotes; else add them only if the string contains spaces or quotes.
Returns
An allocated string that must be freed by the caller using free(). π«Ά don't forget, or that's a leak and we don't do leaks β¨
π char* ec_str_wrap (const char * str, size_t max_cols, size_t start_off)
Wraps text to a maximum number of columns. the formatting glow-up π
Parameters
strβ the input text.max_colsβ the maximum number of columns.start_offβ the number of already consumed columns on the first line, filled with padding in other lines.
Returns
An allocated string containing the wrapped text. It must be freed by the user using free(). π yes, free() it. please.
π§ Author π§
Generated automatically by Doxygen for Libecoli from the source code. not a human, just Doxygen doing its main character thing π€π
lowkey reminder: anything that hands you back an allocated string (ec_str_quote,ec_str_wrap) is yours tofree(). no cap, that's not optional. π
and that's the page, bestie β Version 0.11.3, dated Thu Apr 9 2026, brought to you by Libecoli. slay, go parse some strings π β¨π¦
π¦ where this page comes from
- epel 9: libecoli-devel 0.11.3-1.el9 Β· BSD-3-Clause AND LicenseRef-Fedora-Public-Domain
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms