]> sigrok.org Git - libsigrok.git/blobdiff - src/input/input.c
binary helpers: add "invalid" enum item, improve readability
[libsigrok.git] / src / input / input.c
index 4d3eb9856744271879f2f93fc866c7ddbad6c07b..b5de532bc58a1c25a4d3430d223a8b5b8ee7299b 100644 (file)
@@ -29,7 +29,9 @@
 #define LOG_PREFIX "input"
 /** @endcond */
 
+/** @cond PRIVATE */
 #define CHUNK_SIZE     (4 * 1024 * 1024)
+/** @endcond */
 
 /**
  * @file
 extern SR_PRIV struct sr_input_module input_chronovu_la8;
 extern SR_PRIV struct sr_input_module input_csv;
 extern SR_PRIV struct sr_input_module input_binary;
+extern SR_PRIV struct sr_input_module input_stf;
 extern SR_PRIV struct sr_input_module input_trace32_ad;
 extern SR_PRIV struct sr_input_module input_vcd;
 extern SR_PRIV struct sr_input_module input_wav;
 extern SR_PRIV struct sr_input_module input_raw_analog;
 extern SR_PRIV struct sr_input_module input_logicport;
+extern SR_PRIV struct sr_input_module input_saleae;
 extern SR_PRIV struct sr_input_module input_null;
-/* @endcond */
+/** @endcond */
 
 static const struct sr_input_module *input_module_list[] = {
        &input_binary,
        &input_chronovu_la8,
        &input_csv,
+#if defined HAVE_INPUT_STF && HAVE_INPUT_STF
+       &input_stf,
+#endif
        &input_trace32_ad,
        &input_vcd,
        &input_wav,
        &input_raw_analog,
        &input_logicport,
+       &input_saleae,
        &input_null,
        NULL,
 };
@@ -582,8 +590,10 @@ SR_API struct sr_dev_inst *sr_input_dev_inst_get(const struct sr_input *in)
  */
 SR_API int sr_input_send(const struct sr_input *in, GString *buf)
 {
-       sr_spew("Sending %" G_GSIZE_FORMAT " bytes to %s module.",
-               buf->len, in->module->id);
+       size_t len;
+
+       len = buf ? buf->len : 0;
+       sr_spew("Sending %zu bytes to %s module.", len, in->module->id);
        return in->module->receive((struct sr_input *)in, buf);
 }