X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Foutput%2Fols.c;h=8d68bdaf91e728639bd560c6c0474fb6fe51a280;hb=ce7d3578e3b1438ca472abea8b3844c3debd249f;hp=78a41bb0b4645032eb342ef1796246d165b6da6b;hpb=155b680da482cea2381becb73c51cfb838bff31e;p=libsigrok.git diff --git a/src/output/ols.c b/src/output/ols.c index 78a41bb0..8d68bdaf 100644 --- a/src/output/ols.c +++ b/src/output/ols.c @@ -38,15 +38,17 @@ struct context { uint64_t num_samples; }; -static int init(struct sr_output *o) +static int init(struct sr_output *o, GHashTable *options) { struct context *ctx; + (void)options; + if (!(ctx = g_try_malloc(sizeof(struct context)))) { sr_err("%s: ctx malloc failed", __func__); return SR_ERR_MALLOC; } - o->internal = ctx; + o->priv = ctx; ctx->samplerate = 0; ctx->num_samples = 0; @@ -88,7 +90,7 @@ static GString *gen_header(const struct sr_dev_inst *sdi, struct context *ctx) return s; } -static int receive(struct sr_output *o, const struct sr_datafeed_packet *packet, +static int receive(const struct sr_output *o, const struct sr_datafeed_packet *packet, GString **out) { struct context *ctx; @@ -102,7 +104,7 @@ static int receive(struct sr_output *o, const struct sr_datafeed_packet *packet, *out = NULL; if (!o || !o->sdi) return SR_ERR_ARG; - ctx = o->internal; + ctx = o->priv; switch (packet->type) { case SR_DF_META: @@ -141,16 +143,18 @@ static int cleanup(struct sr_output *o) if (!o || !o->sdi) return SR_ERR_ARG; - ctx = o->internal; + ctx = o->priv; g_free(ctx); - o->internal = NULL; + o->priv = NULL; return SR_OK; } -SR_PRIV struct sr_output_format output_ols = { +SR_PRIV struct sr_output_module output_ols = { .id = "ols", - .description = "OpenBench Logic Sniffer", + .name = "OLS", + .desc = "OpenBench Logic Sniffer", + .options = NULL, .init = init, .receive = receive, .cleanup = cleanup