EC_STRVEC_FROM_ARRAY(3)
π EC_STRVEC_FROM_ARRAY π
okay bestie, so this is a page from the Libecoli Programmer's Manual, section 3 β and we're talking about ec_strvec_from_array, which is genuinely the most "build me a whole new string vector out of thin air" function you will ever meet. No cap. β¨
πΈ NAME πΈ
ec_strvec_from_array β literally just: allocate a new string vector. That's the whole job. She's an icon, she does one thing, she slays at it. π
π SYNOPSIS π
#include <ecoli/strvec.h>
struct ec_strvec * ec_strvec_from_array(
const char *const *strarr, /* The array of const strings. */
size_t n /* The number of strings in the array. */
);
So she takes two things, right:
strarrβ the array ofconststrings. Yes,const char *const *, the double-const situation, she's committed, she's not touching your strings, periodt. πnβ how many strings are in that array. You gotta tell her, she's not psychic, bestie. π¦
π¦ DESCRIPTION π¦
The string vector gets initialized with the array of const strings that you passed in as arguments. That's it. You hand her an array, she hands you a fresh little strvec holding those exact strings. it's giving "glow up, but make it data structure." β¨π
π RETURN VALUE π
You get the new strvec object back β yay!! ππ«Ά
BUT. If something goes wrong, you get NULL instead, and errno is set. So like, always check, bestie. Not me ignoring a NULL return and then crying at 3am. ππ
π SEE ALSO π
the whole girl gang, all up in here β go read these too fr fr:
ec_strvec_set_attrs(3)ec_strvec_del_last(3)ec_strvec_val(3)ec_strvec_cmp(3)ec_strvec_sort(3)ec_strvec_get_attrs(3)ec_strvec_dup(3)ec_strvec_set(3)ec_strvec_len(3)ec_strvec_dump(3)ec_strvec_sh_lex_str(3)ec_strvec_add(3)ec_strvec_free(3)ec_strvec(3)ec_strvec_ndup(3)
π COPYRIGHT π
Copyright (C) 2010-2026 Olivier Matz, Robin Jarry. Respect the authors, they ate. π
ok so that's the whole page, no skips, no summaries, every single detail preserved because that's just how we do it around here. π β¨
and finally, the cute lil sign-off: this whole thing lives in libecoli, dated 2026-06-11, and yes it's page EC_STRVEC_FROM_ARRAY(3) of the Libecoli Programmer's Manual. mwah. ππ¦π
π¦ where this page comes from
- fedora 44: libecoli-devel 0.11.7-1.fc44 Β· BSD-3-Clause AND LicenseRef-Fedora-Public-Domain
- fedora 44: libecoli-devel 0.11.7-1.fc44 Β· BSD-3-Clause AND LicenseRef-Fedora-Public-Domain
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms