]> sigrok.org Git - libsigrok.git/blobdiff - src/input/input.c
input/wav: use our own endian macros.
[libsigrok.git] / src / input / input.c
index 4aee8d22e1955c16816aa51d0f43f571ac378bb6..3961e429593850e15fe80302d4df15009f469b68 100644 (file)
@@ -66,12 +66,11 @@ extern SR_PRIV struct sr_input_module input_wav;
 /* @endcond */
 
 static const struct sr_input_module *input_module_list[] = {
+       &input_binary,
+       &input_chronovu_la8,
+       &input_csv,
        &input_vcd,
-//     &input_chronovu_la8,
        &input_wav,
-       &input_csv,
-       /* This one has to be last, because it will take any input. */
-//     &input_binary,
        NULL,
 };
 
@@ -312,6 +311,12 @@ static gboolean check_required_metadata(const uint8_t *metadata, uint8_t *avail)
  * If an input module is found, an instance is created and returned.
  * Otherwise, NULL is returned.
  *
+ * If an instance is created, it has the given buffer used for scanning
+ * already submitted to it, to be processed before more data is sent.
+ * This allows a frontend to submit an initial chunk of a non-seekable
+ * stream, such as stdin, without having to keep it around and submit
+ * it again later.
+ *
  */
 SR_API const struct sr_input *sr_input_scan_buffer(GString *buf)
 {
@@ -460,7 +465,6 @@ SR_API const struct sr_input *sr_input_scan_file(const char *filename)
 
                /* Found a matching module. */
                in = sr_input_new(imod, NULL);
-               g_string_insert_len(in->buf, 0, buf->str, buf->len);
                break;
        }
        g_string_free(header_buf, TRUE);