Hacker News new | ask | show | jobs
by rwmj 1567 days 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/...

On top of this we implement a string type:

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/...