summaryrefslogtreecommitdiff
path: root/src/til_stream.h
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2023-01-10 23:26:06 -0800
committerVito Caputo <vcaputo@pengaru.com>2023-01-11 22:31:26 -0800
commitfe4d2000013329ed9882fb900a19a6fe03876c52 (patch)
treefe9a2e5ebbdb24c87feed7d0f10d3b6237315a66 /src/til_stream.h
parentd0a302aff0b3da86aa32b3cfea177ec41cc6488d (diff)
til_stream: first stab at implementing til_stream_t
Until now there's just been a forward declared type for til_fb_fragment_t.stream's type, and it's been completely unused. The purpose of the stream is to provide a continous inter-frame object where information can be stored pertaining to the stream of frames. Right now, that information is limited to emergent "pipes" formed by using taps against a given stream. Taps at new paths in the stream become added as pipes for those paths, with the responsible tap hooked in as the driving tap. Taps at existing paths become diverted to the driving taps, enabling potential for external drivers for tapped variables. This commit only adds the implementation, nothing is actually using it yet.
Diffstat (limited to 'src/til_stream.h')
-rw-r--r--src/til_stream.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/til_stream.h b/src/til_stream.h
new file mode 100644
index 0000000..91eaa55
--- /dev/null
+++ b/src/til_stream.h
@@ -0,0 +1,27 @@
+#ifndef _TIL_STREAM_H
+#define _TIL_STREAM_H
+
+#include <stddef.h>
+#include <stdint.h>
+
+#include "til_module_context.h"
+
+typedef struct til_stream_t til_stream_t;
+typedef struct til_tap_t til_tap_t;
+
+til_stream_t * til_stream_new(void);
+til_stream_t * til_stream_free(til_stream_t *stream);
+
+/* bare interface for non-module-context owned taps */
+int til_stream_tap(til_stream_t *stream, const void *tap_owner, const char *parent_path, uint32_t parent_hash, const til_tap_t *tap);
+
+/* convenience helper for use within modules */
+static inline int til_stream_tap_context(til_stream_t *stream, const til_module_context_t *module_context, const til_tap_t *tap)
+{
+ return til_stream_tap(stream, module_context, module_context->path, module_context->path_hash, tap);
+}
+
+void til_stream_untap_owner(til_stream_t *stream, const void *owner);
+void til_stream_fprint(til_stream_t *stream, FILE *out);
+
+#endif
© All Rights Reserved