X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=output%2Foutput_ols.c;h=8116472d45d4a5d12aade5fc22b61a3e061d7544;hb=d494a4aa9dcbd90126d86757d16fa3e0f0a419f3;hp=bc006dc2ae6133c0d6728723f4541224bbb96b22;hpb=305bde4d42ac801312743cc05671de214f6501fd;p=libsigrok.git diff --git a/output/output_ols.c b/output/output_ols.c index bc006dc2..8116472d 100644 --- a/output/output_ols.c +++ b/output/output_ols.c @@ -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, };