Input/csv: Add reset() function
This commit is contained in:
parent
ef9d3fefbc
commit
ad93bfb0b9
|
@ -768,6 +768,17 @@ static void cleanup(struct sr_input *in)
|
||||||
g_free(inc->sample_buffer);
|
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[] = {
|
static struct sr_option options[] = {
|
||||||
{ "single-column", "Single column", "Enable/specify single column", NULL, NULL },
|
{ "single-column", "Single column", "Enable/specify single column", NULL, NULL },
|
||||||
{ "numchannels", "Max channels", "Number of channels", NULL, NULL },
|
{ "numchannels", "Max channels", "Number of channels", NULL, NULL },
|
||||||
|
@ -808,4 +819,5 @@ SR_PRIV struct sr_input_module input_csv = {
|
||||||
.receive = receive,
|
.receive = receive,
|
||||||
.end = end,
|
.end = end,
|
||||||
.cleanup = cleanup,
|
.cleanup = cleanup,
|
||||||
|
.reset = reset,
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue