X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Finput%2Fvcd.c;h=39a92d32509cf510b59c624bcde2e4f55689584f;hb=15a5bfe4815f9991a9bb532c05d6244a1818a0e4;hp=253e76f67d25a78a5b381a08e2cd841ca8bdc723;hpb=3be42bc22f8b36599a448273c12a76d3e0f7a940;p=libsigrok.git 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, };