27 #include "sigrok-internal.h"
32 static int max_probename_len = 0;
38 if (max_probename_len == 0) {
42 if (len > max_probename_len)
43 max_probename_len = len;
48 sprintf((
char *)outbuf + strlen((
const char *)outbuf),
49 "%*s:%s\n", max_probename_len,
61 sprintf((
char *)outbuf + strlen((
const char *)outbuf),
77 if (!(ctx = g_try_malloc0(
sizeof(
struct context)))) {
78 sr_err(
"text out: %s: ctx malloc failed", __func__);
85 for (l = o->
dev->
probes; l; l = l->next) {
106 if (!(ctx->
header = g_try_malloc0(512))) {
108 sr_err(
"text out: %s: ctx->header malloc failed", __func__);
113 num_probes = g_slist_length(o->
dev->
probes);
123 511 - strlen(ctx->
header),
124 "Acquisition with %d/%d probes at %s\n",
126 g_free(samplerate_s);
133 sr_err(
"text out: %s: ctx->linebuf malloc failed", __func__);
136 if (!(ctx->
linevalues = g_try_malloc0(num_probes))) {
139 sr_err(
"text out: %s: ctx->linevalues malloc failed", __func__);
147 uint64_t *length_out)
154 switch (event_type) {
163 if (!(outbuf = g_try_malloc0(outsize))) {
164 sr_err(
"text out: %s: outbuf malloc failed", __func__);
169 *length_out = strlen((
const char *)outbuf);