(void)options;
- if (!(ctx = g_try_malloc(sizeof(struct context)))) {
- sr_err("%s: ctx malloc failed", __func__);
- return SR_ERR_MALLOC;
- }
- o->internal = ctx;
-
+ ctx = g_malloc0(sizeof(struct context));
+ o->priv = ctx;
ctx->samplerate = 0;
ctx->num_samples = 0;
*out = NULL;
if (!o || !o->sdi)
return SR_ERR_ARG;
- ctx = o->internal;
+ ctx = o->priv;
switch (packet->type) {
case SR_DF_META:
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;
}
.id = "ols",
.name = "OLS",
.desc = "OpenBench Logic Sniffer",
+ .exts = (const char*[]){"ols", NULL},
.options = NULL,
.init = init,
.receive = receive,