/* Return value is the character in the string which caused the parse to end (typically a null terminator, if @str is completely parseable).  */
char* get_options(const char *str, int nints, int *ints)
/* Return value is the character in the string which caused the parse to end (typically a null terminator, if @str is completely parseable).  */
char* get_options(const char *str, int nints, int *ints)
{
	int res, i = 1;
	while (i < nints) {
		res = get_option ((char **)&str, ints + i);
		if (res == 0)
			break;
		if (res == 3) {
			int range_nums;
			range_nums = get_range((char **)&str, ints + i);
			if (range_nums < 0)
				break;
			i += (range_nums - 1);
		}
		i++;
		if (res == 1)
			break;
	}
	ints[0] = i - 1;
	return (char *)str;
}