From: Soeren Apel Date: Mon, 2 May 2016 16:16:38 +0000 (+0200) Subject: Input/vcd: Add reset() function X-Git-Tag: libsigrok-0.5.0~431 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=f4b4725bce213c58dd370a6c84ba4b327a89f7a4;p=libsigrok.git Input/vcd: Add reset() function --- diff --git a/src/input/vcd.c b/src/input/vcd.c index 253e76f6..39a92d32 100644 --- a/src/input/vcd.c +++ b/src/input/vcd.c @@ -613,6 +613,17 @@ static void cleanup(struct sr_input *in) inc->current_levels = NULL; } +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[] = { { "numchannels", "Number of channels", "Number of channels", NULL, NULL }, { "skip", "Skip", "Skip until timestamp", NULL, NULL }, @@ -645,4 +656,5 @@ SR_PRIV struct sr_input_module input_vcd = { .receive = receive, .end = end, .cleanup = cleanup, + .reset = reset, };