]> sigrok.org Git - libsigrok.git/blobdiff - output/output_ols.c
input/output formats: Explicit struct member names.
[libsigrok.git] / output / output_ols.c
index bc006dc2ae6133c0d6728723f4541224bbb96b22..8116472d45d4a5d12aade5fc22b61a3e061d7544 100644 (file)
@@ -37,14 +37,13 @@ struct context {
        unsigned int unitsize;
 };
 
-
 static int init(struct sr_output *o)
 {
        struct context *ctx;
        struct sr_probe *probe;
        GSList *l;
        uint64_t samplerate;
-       int num_enabled_probes, i;
+       int num_enabled_probes;
 
        if (!(ctx = g_malloc(sizeof(struct context))))
                return SR_ERR_MALLOC;
@@ -71,8 +70,6 @@ static int init(struct sr_output *o)
        g_string_append_printf(ctx->header, ";EnabledChannels: -1\n");
        g_string_append_printf(ctx->header, ";Compressed: true\n");
        g_string_append_printf(ctx->header, ";CursorEnabled: false\n");
-       for (i = 0; i < 10; i++)
-               g_string_append_printf(ctx->header, ";Cursor%d: 0\n", i);
 
        return SR_OK;
 }
@@ -97,7 +94,7 @@ static int event(struct sr_output *o, int event_type, char **data_out,
        return SR_OK;
 }
 
-static int data(struct sr_output *o, char *data_in, uint64_t length_in,
+static int data(struct sr_output *o, const char *data_in, uint64_t length_in,
                char **data_out, uint64_t *length_out)
 {
        GString *out;
@@ -127,10 +124,10 @@ static int data(struct sr_output *o, char *data_in, uint64_t length_in,
 }
 
 struct sr_output_format output_ols = {
-       "ols",
-       "OpenBench Logic Sniffer",
-       SR_DF_LOGIC,
-       init,
-       data,
-       event,
+       .extension = "ols",
+       .description = "OpenBench Logic Sniffer",
+       .df_type = SR_DF_LOGIC,
+       .init = init,
+       .data = data,
+       .event = event,
 };