From 8b0c8e1e4336ce0c40c467fc86dec40fb2c94128 Mon Sep 17 00:00:00 2001 From: Vito Caputo Date: Mon, 12 Jun 2023 16:58:18 -0700 Subject: til_stream: introduce on-stream registered contexts In order for modules like rkt to be able to do integrated transitions, there must be a way for discovering existing module contexts by path and using them for rendering in new compositions. This is a first stab at something along those lines. The whole multiple contexts at the same path pattern has been partially handled in this implementation, but I think it will just be going away and checkers::fill_module refactored to not do that. --- src/til_stream.h | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/til_stream.h') diff --git a/src/til_stream.h b/src/til_stream.h index 1fb709f..cb3c98e 100644 --- a/src/til_stream.h +++ b/src/til_stream.h @@ -24,6 +24,7 @@ #include "til_setup.h" typedef struct til_stream_t til_stream_t; +typedef struct til_stream_module_context_t til_stream_module_context_t; typedef struct til_stream_pipe_t til_stream_pipe_t; typedef struct til_tap_t til_tap_t; @@ -63,4 +64,14 @@ int til_stream_for_each_pipe(til_stream_t *stream, til_stream_pipe_iter_func_t p void til_stream_pipe_set_owner(til_stream_pipe_t *pipe, const void *owner, const void *owner_foo); void til_stream_pipe_set_driving_tap(til_stream_pipe_t *pipe, const til_tap_t *driving_tap); + +typedef int (til_stream_module_context_iter_func_t)(void *context, til_stream_module_context_t *module_context, size_t n_module_contexts, const til_module_context_t **contexts); + +int til_stream_for_each_module_context(til_stream_t *stream, til_stream_module_context_iter_func_t module_context_cb, void *cb_arg); + +int til_stream_register_module_contexts(til_stream_t *stream, size_t n_contexts, til_module_context_t **contexts); +int til_stream_find_module_contexts(til_stream_t *stream, const char *path, size_t n_contexts, til_module_context_t **res_contexts); +void til_stream_gc_module_contexts(til_stream_t *stream); +void til_stream_fprint_module_contexts(til_stream_t *stream, FILE *out); + #endif -- cgit v1.2.1