]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
interactive: Add producer to struct i9e_client_info.
authorAndre Noll <maan@systemlinux.org>
Sun, 8 Apr 2012 22:43:07 +0000 (00:43 +0200)
committerAndre Noll <maan@systemlinux.org>
Sun, 18 Nov 2012 19:28:28 +0000 (20:28 +0100)
This enables users of the i9e API to open the i9e subsystem with
a producer already attached to the stdout buffer tree node of the
i9e subsystem.

interactive.c
interactive.h

index cd5fa8a81a4878aaf5c65342432a76888ff517f9..6831643878761be2da1c4ee8f79b7ce6ccf2f21f 100644 (file)
@@ -421,7 +421,11 @@ int i9e_open(struct i9e_client_info *ici, struct sched *s)
        if (ici->history_file)
                read_history(ici->history_file);
        update_winsize();
-       rl_callback_handler_install(i9ep->ici->prompt, i9e_line_handler);
+       if (ici->producer) {
+               rl_callback_handler_install("", i9e_line_handler);
+               i9e_attach_to_stdout(ici->producer);
+       } else
+               rl_callback_handler_install(i9ep->ici->prompt, i9e_line_handler);
        return 1;
 }
 
index 93ee56c7fb7d833a7c3dac514d2b04f24f70ca5c..0af2ef40c27e38950654044ceb0770951ff328ef 100644 (file)
@@ -71,6 +71,11 @@ struct i9e_client_info {
         * completer if the cursor is not on the first word.
         */
        struct i9e_completer *completers;
+       /**
+        * If non-NULL, this node is attached immediately to the stdout btr
+        * node of the i9e subsystem.
+        */
+       struct btr_node *producer;
 };
 
 int i9e_open(struct i9e_client_info *ici, struct sched *s);