-/* return a newly allocated array of char pointers to each of the strings
- in args, with a terminating NULL pointer. */
-/* Note: a similar function is defined in dynl.c, but we don't necessarily
- want to export it. */
-static char **
-allocate_string_pointers (SCM args)
-{
- char **result;
- int n_args = scm_ilength (args);
- int i;
-
- SCM_ASSERT (n_args >= 0, args, SCM_ARGn, "allocate_string_pointers");
- result = (char **) scm_malloc ((n_args + 1) * sizeof (char *));
- result[n_args] = NULL;
- for (i = 0; i < n_args; i++)
- {
- SCM car = SCM_CAR (args);
-
- if (!SCM_STRINGP (car))
- {
- free (result);
- scm_wrong_type_arg ("allocate_string_pointers", SCM_ARGn, car);
- }
- result[i] = SCM_STRING_CHARS (SCM_CAR (args));
- args = SCM_CDR (args);
- }
- return result;
-}