X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=session.c;h=ad084074889deee4367928d6b20d504fa15343ad;hb=24ba9e1bdfe107e394176eda3116b714463a8437;hp=386fb710f5cb7a73506a15e5ea047a7b4f715cbb;hpb=3a063627c5658a65790ff52a9c0ed9a1f660a0fb;p=libsigrokdecode.git diff --git a/session.c b/session.c index 386fb71..ad08407 100644 --- a/session.c +++ b/session.c @@ -278,6 +278,32 @@ SRD_API int srd_session_send(struct srd_session *sess, return SRD_OK; } +/** + * Communicate the end of the stream of sample data to the session. + * + * @param[in] sess The session. Must not be NULL. + * + * @return SRD_OK upon success. A (negative) error code otherwise. + * + * @since 0.6.0 + */ +SRD_API int srd_session_send_eof(struct srd_session *sess) +{ + GSList *d; + int ret; + + if (!sess) + return SRD_ERR_ARG; + + for (d = sess->di_list; d; d = d->next) { + ret = srd_inst_send_eof(d->data); + if (ret != SRD_OK) + return ret; + } + + return SRD_OK; +} + /** * Terminate currently executing decoders in a session, reset internal state. *