X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Foutput%2Fcsv.c;h=77b62285b2ff31c2d4b884ec43c4435c504c0ea8;hb=d9c3331d12d3060d33b1d2ee592c26c1d927dce8;hp=6ac7a77f5e50727f7c9326fbe5d08a9be89301f6;hpb=a755b0e122105d934c4e7b97435420eda6df6e8e;p=libsigrok.git diff --git a/src/output/csv.c b/src/output/csv.c index 6ac7a77f..77b62285 100644 --- a/src/output/csv.c +++ b/src/output/csv.c @@ -60,7 +60,7 @@ static int init(struct sr_output *o, GHashTable *options) return SR_ERR_ARG; ctx = g_malloc0(sizeof(struct context)); - o->internal = ctx; + o->priv = ctx; ctx->separator = ','; /* Get the number of channels, and the unitsize. */ @@ -98,7 +98,7 @@ static GString *gen_header(const struct sr_output *o) int num_channels, i; char *samplerate_s; - ctx = o->internal; + ctx = o->priv; header = g_string_sized_new(512); /* Some metadata */ @@ -154,7 +154,7 @@ static int receive(const struct sr_output *o, const struct sr_datafeed_packet *p *out = NULL; if (!o || !o->sdi) return SR_ERR_ARG; - if (!(ctx = o->internal)) + if (!(ctx = o->priv)) return SR_ERR_ARG; switch (packet->type) { @@ -203,11 +203,11 @@ static int cleanup(struct sr_output *o) if (!o || !o->sdi) return SR_ERR_ARG; - if (o->internal) { - ctx = o->internal; + if (o->priv) { + ctx = o->priv; g_free(ctx->channel_index); - g_free(o->internal); - o->internal = NULL; + g_free(o->priv); + o->priv = NULL; } return SR_OK; @@ -217,6 +217,7 @@ SR_PRIV struct sr_output_module output_csv = { .id = "csv", .name = "CSV", .desc = "Comma-separated values", + .exts = (const char*[]){"csv", NULL}, .options = NULL, .init = init, .receive = receive,