paraslash 0.7.3
[paraslash.git] / interactive.h
index 93ee56c7fb7d833a7c3dac514d2b04f24f70ca5c..6ef7f8e259b0045a5c808c01560b5a81166b01fd 100644 (file)
@@ -1,8 +1,4 @@
-/*
- * Copyright (C) 2011-2012 Andre Noll <maan@systemlinux.org>
- *
- * Licensed under the GPL v2. For licencing details see COPYING.
- */
+/* Copyright (C) 2011 Andre Noll <maan@tuebingen.mpg.de>, see file COPYING. */
 
 /** \file interactive.h Public API for interactive sessions. */
 
@@ -33,7 +29,7 @@ struct i9e_completion_result {
  *
  * \param name Determines the name of the function to be defined.
  */
-#define I9E_DUMMY_COMPLETER(name) void name ## _completer( \
+#define I9E_DUMMY_COMPLETER(name) static void name ## _completer( \
                __a_unused struct i9e_completion_info *ciname, \
                struct i9e_completion_result *result) {result->matches = NULL;}
 
@@ -59,6 +55,10 @@ struct i9e_client_info {
        int loglevel;
        /** Complete input lines are passed to this callback function. */
        int (*line_handler)(char *line);
+       /** In single key mode, this callback is executed instead. */
+       int (*key_handler)(int key);
+       /** The array of valid key sequences for libreadline. */
+       char **bound_keyseqs;
        /** File descriptors to use for input/output/log. */
        int fds[3];
        /** Text of the current prompt. */
@@ -71,15 +71,20 @@ 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);
 void i9e_attach_to_stdout(struct btr_node *producer);
+void i9e_print_status_bar(char *buf, unsigned len);
 void i9e_close(void);
 void i9e_signal_dispatch(int sig_num);
 __printf_2_3 void i9e_log(int ll, const char* fmt,...);
-int i9e_select(int n, fd_set *readfds, fd_set *writefds,
-               struct timeval *timeout_tv);
+int i9e_poll(struct pollfd *fds, nfds_t nfds, int timeout);
 int i9e_extract_completions(const char *word, char **string_list,
                char ***result);
 char **i9e_complete_commands(const char *word, struct i9e_completer *completers);
@@ -87,3 +92,5 @@ void i9e_complete_option(char **opts, struct i9e_completion_info *ci,
                struct i9e_completion_result *cr);
 int i9e_print_completions(struct i9e_completer *completers);
 int i9e_get_error(void);
+void i9e_ll_completer(struct i9e_completion_info *ci,
+               struct i9e_completion_result *cr);