summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVito Caputo <vcaputo@pengaru.com>2023-01-19 22:43:05 -0800
committerVito Caputo <vcaputo@pengaru.com>2023-01-21 13:33:30 -0800
commitf034dbc3eb32fda727357834d3a03a42df12edef (patch)
tree7839209108c901f7d174a82b43e9bd8abd715389
parent12e2ea7549ba86893104e1b8117a2ceb50d0ebf2 (diff)
til_stream: add til_stream_pipe_set_driving_tap()
-rw-r--r--src/til_stream.c12
-rw-r--r--src/til_stream.h1
2 files changed, 13 insertions, 0 deletions
diff --git a/src/til_stream.c b/src/til_stream.c
index 4109d8f..e59cbc9 100644
--- a/src/til_stream.c
+++ b/src/til_stream.c
@@ -403,3 +403,15 @@ void til_stream_pipe_set_owner(til_stream_pipe_t *pipe, const void *owner, const
pipe->owner = owner;
pipe->owner_foo = owner_foo;
}
+
+
+/* NULLing out the driving_tap isn't supported, since the tap name is part of the pipe's identity,
+ * just set tap.inactive to indicate another tap should take over driving.
+ */
+void til_stream_pipe_set_driving_tap(til_stream_pipe_t *pipe, const til_tap_t *driving_tap)
+{
+ assert(pipe);
+ assert(driving_tap);
+
+ pipe->driving_tap = driving_tap;
+}
diff --git a/src/til_stream.h b/src/til_stream.h
index 49e1e58..1e9c516 100644
--- a/src/til_stream.h
+++ b/src/til_stream.h
@@ -49,5 +49,6 @@ void til_stream_fprint(til_stream_t *stream, FILE *out);
int til_stream_for_each_pipe(til_stream_t *stream, til_stream_iter_func_t pipe_cb, void *cb_arg);
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);
#endif
© All Rights Reserved