5 ms·
Here's a C vector implemented in a macro we use pretty extensively which is along similar lines: https://gitlab.com/nbdkit/nbdkit/-/blob/master/common/utils/ve
by rwmj 5y ago
Here's a C vector implemented in a macro we use pretty extensively which is along similar lines:
https://gitlab.com/nbdkit/nbdkit/-/blob/master/common/utils/vector.h#L52 https://gitlab.com/nbdkit/nbdkit/-/blob/master/common/utils/...
On top of this we implement a string type:
https://gitlab.com/nbdkit/nbdkit/-/blob/master/common/utils/nbdkit-string.h#L40-L41 https://gitlab.com/nbdkit/nbdkit/-/blob/master/common/utils/...
Example usage of the vector to store NULL-terminated argv-type arrays of char*:
https://gitlab.com/nbdkit/nbdkit/-/blob/master/common/utils/environ.c#L45 https://gitlab.com/nbdkit/nbdkit/-/blob/master/common/utils/...