]> sigrok.org Git - libsigrok.git/blobdiff - src/output/csv.c
asix-sigma: Use the more portable g_usleep().
[libsigrok.git] / src / output / csv.c
index 6ac7a77f5e50727f7c9326fbe5d08a9be89301f6..77b62285b2ff31c2d4b884ec43c4435c504c0ea8 100644 (file)
@@ -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,