EC_STRVEC_NDUP(3)
π EC_STRVEC_NDUP β the libecoli programmer's manual, but make it cute π
okay bestie, sit down, hydrate, and let me tell you about ec_strvec_ndup from the libecoli programmer's manual β¨
β¨ NAME β¨
ec_strvec_ndup β she duplicates a part of a string vector π
like not the whole thing, just a slice, and honestly? iconic behavior.
π SYNOPSIS π
#include <ecoli/strvec.h>
struct ec_strvec * ec_strvec_ndup(
const struct ec_strvec *strvec, /* The pointer to the string vector. */
size_t off, /* The index of the first string to duplicate. */
size_t len /* The number of strings to duplicate. */
);
so you're handing her three things, no cap:
strvecβ the pointer to the string vector π«Ά the one you're copying from, don't lose heroffβ the index of the first string to duplicate πΈ where the copy starts, like a lil starting linelenβ the number of strings to duplicate π¦ how many of them you're taking with you
and she gives you back a struct ec_strvec * β a whole fresh baby strvec, born from that slice π
π DESCRIPTION π
Attributes are duplicated if any. that's the whole vibe, fr fr β if your strvec is carrying attributes, they get duplicated too. she's not leaving anything behind, she's a main character like that π
β RETURN VALUE β
you get back the duplicated strvec object π a whole new one, all yours
or β and this is the part where we get a little dramatic π β she returns NULL on error, and errno is set. so like, check that. always check that. don't be out here assuming bestie, okay?
π SEE ALSO π
the whole friend group, go say hi π«Ά:
ec_strvec_set_attrs(3)ec_strvec_del_last(3)ec_strvec_val(3)ec_strvec_cmp(3)ec_strvec_sort(3)ec_strvec_from_array(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)
π COPYRIGHT π
Copyright (C) 2010-2026 Olivier Matz, Robin Jarry. respect the elders, they built the whole libecoli house we're living in π β¨
and that's the page bestie!! π¦ this was libecoli, dated 2026-06-11, and the page itself is EC_STRVEC_NDUP(3) β go forth, duplicate your slices, and remember: check errno, love yourself, periodt π
ππΈ
π¦ 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