struct ec_strvec_elt **vec;
};
-struct ec_strvec *ec_strvec_new(void)
+struct ec_strvec *ec_strvec(void)
{
struct ec_strvec *strvec;
struct ec_strvec *copy = NULL;
size_t i, veclen;
- copy = ec_strvec_new();
+ copy = ec_strvec();
if (copy == NULL)
goto fail;
size_t i;
if (strvec == NULL) {
- fprintf(out, "empty strvec\n");
+ fprintf(out, "none\n");
return;
}
- fprintf(out, "strvec:\n");
- for (i = 0; i < ec_strvec_len(strvec); i++)
- fprintf(out, " %zd: %s (refcnt=%d)\n", i,
- strvec->vec[i]->str, strvec->vec[i]->refcnt);
+ fprintf(out, "strvec (len=%zu) [", strvec->len);
+ for (i = 0; i < ec_strvec_len(strvec); i++) {
+ if (i == 0)
+ fprintf(out, "%s", strvec->vec[i]->str);
+ else
+ fprintf(out, ", %s", strvec->vec[i]->str);
+ }
+ fprintf(out, "]\n");
+
}
/* XXX test case */