rangefunc-strings.c 516 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
/*
 * rangefunc-strings.c: String Functions on ranges.
 *
 * Authors:
 *   Andreas J. Guelzow  <aguelzow@taliesin.ca>
 */

#include <gnumeric-config.h>
#include "gnumeric.h"
#include "rangefunc-strings.h"

#include <string.h>

static void
cb_concatenate (char const *text, GString *str)
{
Morten Welinder's avatar
Morten Welinder committed
17
	g_string_append (str, text);
18 19
}

Morten Welinder's avatar
Morten Welinder committed
20 21
int
range_concatenate (GSList *data, char **res)
22
{
23
	GString *str = g_string_new (NULL);
24

25
	g_slist_foreach (data, (GFunc) cb_concatenate, str);
26 27 28 29 30

	*res = g_string_free (str, FALSE);
	return 0;
}