+/**
+ * Open a writer node and register the corresponding task.
+ *
+ * \param wn The writer node to open.
+ * \param parent The parent btr node (the source for the writer node).
+ * \param s The scheduler instance to register the task to.
+ */
+void register_writer_node(struct writer_node *wn, struct btr_node *parent,
+ struct sched *s)
+{
+ const struct writer *w = writer_get(wn->wid);
+
+ wn->btrn = btr_new_node(&(struct btr_node_description)
+ EMBRACE(.name = writer_name(wn->wid), .parent = parent,
+ .handler = w->execute, .context = wn));
+ wn->task = task_register(&(struct task_info) {
+ .name = writer_name(wn->wid),
+ .pre_select = w->pre_select,
+ .post_select = w->post_select,
+ .context = wn,
+ }, s);
+}