EC_STRVEC_SH_LEX_STR(3)

✨ NAME ✨

okay so bestie, welcome to ec_strvec_sh_lex_str from the Libecoli Programmer's Manual πŸ’– β€” she splits a string into multiple tokens following basic shell lexing rules. like, that's her whole thing. periodt πŸŽ€


🌸 SYNOPSIS 🌸

#include <ecoli/strvec.h>

struct ec_strvec * ec_strvec_sh_lex_str(
    const char       *str,             /* The string to split. */
    ec_strvec_flag_t  flags,           /* Options for controlling behavior. */
    /*
     * If not NULL and if the provided string has an unterminated quote. The
     * opening quote will be stored here.
     */
    char             *unclosed_quote
);

so you pass in the str you wanna split, some flags for controlling behavior, and unclosed_quote β€” and listen, that last one is lowkey important: if it's not NULL and the string you handed over has an unterminated quote, the opening quote gets stored there. iykyk πŸ¦‹


🧚 STRUCTURES 🧚

the flag vibes, in all their glory:

enum ec_strvec_flag_t {
      EC_STRVEC_STRICT;
      EC_STRVEC_TRAILSP;
};

πŸ‘‘ RETURN VALUE πŸ‘‘

you get the new strvec object back β€” or NULL on error, and in that case errno is set 😭 no cap, always check her.


πŸ’œ SEE ALSO πŸ’œ

go read these too, bestie, they're the whole friend group:


Copyright (C) 2010-2026 Olivier Matz, Robin Jarry.


and that's the whole page, bestie 🫢 tysm for reading, she's from libecoli, dated 2026-06-11, and honestly? iconic. slay πŸ’…βœ¨

πŸ“¦ where this page comes from