From ad93bfb0b96d6b58379ff73275701e72e08c63a4 Mon Sep 17 00:00:00 2001 From: Soeren Apel Date: Mon, 2 May 2016 18:10:55 +0200 Subject: [PATCH] Input/csv: Add reset() function --- src/input/csv.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/input/csv.c b/src/input/csv.c index 984a58c7..a8c68944 100644 --- a/src/input/csv.c +++ b/src/input/csv.c @@ -768,6 +768,17 @@ static void cleanup(struct sr_input *in) g_free(inc->sample_buffer); } +static int reset(struct sr_input *in) +{ + struct context *inc = in->priv; + + cleanup(in); + inc->started = FALSE; + g_string_truncate(in->buf, 0); + + return SR_OK; +} + static struct sr_option options[] = { { "single-column", "Single column", "Enable/specify single column", NULL, NULL }, { "numchannels", "Max channels", "Number of channels", NULL, NULL }, @@ -808,4 +819,5 @@ SR_PRIV struct sr_input_module input_csv = { .receive = receive, .end = end, .cleanup = cleanup, + .reset = reset, };