From: Andre Noll Date: Sun, 8 Apr 2012 22:43:07 +0000 (+0200) Subject: interactive: Add producer to struct i9e_client_info. X-Git-Tag: v0.4.12~7^2~7 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=6cb789ba07d3830f1d7fbff9daa059eb1c99c166 interactive: Add producer to struct i9e_client_info. 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. --- diff --git a/interactive.c b/interactive.c index cd5fa8a8..68316438 100644 --- a/interactive.c +++ b/interactive.c @@ -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; } diff --git a/interactive.h b/interactive.h index 93ee56c7..0af2ef40 100644 --- a/interactive.h +++ b/interactive.h @@ -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);