diff options
Diffstat (limited to 'otherlibs/unix/cstringv.c')
-rw-r--r-- | otherlibs/unix/cstringv.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/otherlibs/unix/cstringv.c b/otherlibs/unix/cstringv.c new file mode 100644 index 000000000..8c2fa1e56 --- /dev/null +++ b/otherlibs/unix/cstringv.c @@ -0,0 +1,18 @@ +#include <mlvalues.h> +#include <memory.h> +#include "unix.h" + +char ** cstringvect(arg) + value arg; +{ + char ** res; + mlsize_t size, i; + + size = Wosize_val(arg); + res = (char **) stat_alloc((size + 1) * sizeof(char *)); + for (i = 0; i < size; i++) res[i] = String_val(Field(arg, i)); + res[size] = NULL; + return res; +} + + |