25 #include "sigrok-internal.h"
34 uint64_t length_in, uint8_t **data_out,
38 unsigned int outsize, offset, p;
49 if (!(outbuf = g_try_malloc0(outsize + 1))) {
50 sr_err(
"hex out: %s: outbuf malloc failed", __func__);
57 strncpy((
char *)outbuf, ctx->
header, outsize);
63 for (offset = 0; offset <= length_in - ctx->
unitsize;
65 memcpy(&sample, data_in + offset, ctx->
unitsize);
68 if (sample & ((uint64_t) 1 << p))
91 *length_out = strlen((
const char *)outbuf);
98 .description =
"Hexadecimal",