src/list.c
char_u *
list2string(typval_T *tv, int copyID, int restore_copyID)
{
    garray_T	ga;

    if (tv->vval.v_list == NULL)
	return NULL;
    ga_init2(&ga, (int)sizeof(char), 80);
    ga_append(&ga, '[');
    range_list_materialize(tv->vval.v_list);
    if (list_join(&ga, tv->vval.v_list, (char_u *)", ",
				       FALSE, restore_copyID, copyID) == FAIL)
    {
	vim_free(ga.ga_data);
	return NULL;
    }
    ga_append(&ga, ']');
    ga_append(&ga, NUL);
    return (char_u *)ga.ga_data;
}
/*
 * Return an allocated string with the string representation of a list.
 * May return NULL.
 */
Return an allocated string with the string representation of a list.
May return NULL.
Return an allocated string with the string representation of a list . May return NULL .
char_u *
list2string(typval_T *tv, int copyID, int restore_copyID)
{
    garray_T	ga;
    if (tv->vval.v_list == NULL)
	return NULL;
    ga_init2(&ga, (int)sizeof(char), 80);
    ga_append(&ga, '[');
    range_list_materialize(tv->vval.v_list);
    if (list_join(&ga, tv->vval.v_list, (char_u *)", ",
				       FALSE, restore_copyID, copyID) == FAIL)
    {
	vim_free(ga.ga_data);
	return NULL;
    }
    ga_append(&ga, ']');
    ga_append(&ga, NUL);
    return (char_u *)ga.ga_data;
}
char_u * list2string ( typval_T * tv , int copyID , int restore_copyID ) { garray_T ga ; if ( tv -> vval . v_list == NULL ) return NULL ; ga_init2 ( & ga , ( int ) sizeof ( char ) , 80 ) ; ga_append ( & ga , ' ' ) ; range_list_materialize ( tv -> vval . v_list ) ; if ( list_join ( & ga , tv -> vval . v_list , ( char_u * ) " " , FALSE , restore_copyID , copyID ) == FAIL ) { vim_free ( ga . ga_data ) ; return NULL ; } ga_append ( & ga , ' ' ) ; ga_append ( & ga , NUL ) ; return ( char_u * ) ga . ga_data ; }
Return an allocated string with the string representation of a list.
Return an allocated string with the string representation of a list .