clap

CLAP Audio Plugin API
Log | Files | Refs | README | LICENSE

commit ef785b6dd73f44521ae8e1a0e4044bf4e3124f89
parent bb3077fcd15a63ef07dd5b339279edfecf1f62b7
Author: Alexandre BIQUE <bique.alexandre@gmail.com>
Date:   Wed, 21 Apr 2021 21:58:55 +0200

Add a stream mechanism

Diffstat:
Ainclude/clap/ext/stream.h | 25+++++++++++++++++++++++++
1 file changed, 25 insertions(+), 0 deletions(-)

diff --git a/include/clap/ext/stream.h b/include/clap/ext/stream.h @@ -0,0 +1,24 @@ +#pragma once + +#include <stdint.h> + +#ifdef __cplusplus +extern "C" { +#endif + +struct clap_istream { + /* returns the number of bytes read. + * 0 for end of file. + * -1 on error. */ + int64_t (*read)(struct clap_istream *stream, void *buffer, uint64_t size); +}; + +struct clap_ostream { + /* returns the number of bytes written. + * -1 on error. */ + int64_t (*write)(struct clap_istream *stream, const void *buffer, uint64_t size); +}; + +#ifdef __cplusplus +} +#endif +\ No newline at end of file