+ comment[0] = '\0';
+ if (o->device->plugin) {
+ /* TODO: Handle num_probes == 0, too many probes, etc. */
+ /* TODO: Error handling. */
+ samplerate = *((uint64_t *) o->device->plugin->get_device_info(
+ o->device->plugin_index, DI_CUR_SAMPLERATE));
+ if (!((samplerate_s = sigrok_samplerate_string(samplerate)))) {
+ free(ctx->header);
+ free(ctx);
+ return SIGROK_ERR;
+ }
+ /* TODO: Handle sprintf() errors. */
+ snprintf(comment, 127, vcd_header_comment,
+ ctx->num_enabled_probes, num_probes, samplerate_s);
+ free(samplerate_s);
+ }