]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
Interactive: Introduce i9e_get_error().
authorAndre Noll <maan@systemlinux.org>
Wed, 27 Jun 2012 20:32:16 +0000 (22:32 +0200)
committerAndre Noll <maan@systemlinux.org>
Sun, 18 Nov 2012 19:28:28 +0000 (20:28 +0100)
Currently there is no easy way for a paraslash task to find out
whether the i9e task is still up and running. This commit adds the
new public function i9e_get_error() which simply returns the error
state of the i9e task.

interactive.c
interactive.h

index 7768d36b08ec716718b58396e90549722336f7be..cd5fa8a81a4878aaf5c65342432a76888ff517f9 100644 (file)
@@ -38,6 +38,20 @@ struct i9e_private {
 };
 static struct i9e_private i9e_private, *i9ep = &i9e_private;
 
+/**
+ * Return the error state of the i9e task.
+ *
+ * This is mainly useful for other tasks to tell whether the i9e task is still
+ * running.
+ *
+ * \return A negative return value of zero means the i9e task terminated. Only
+ * in this case it is safe to call ie9_close().
+ */
+int i9e_get_error(void)
+{
+       return i9ep->task.error;
+}
+
 static bool is_prefix(const char *partial, const char *full, size_t len)
 {
        if (len == 0)
index a19f8a4736700c99f60c84f6448ba5e9092885ac..93ee56c7fb7d833a7c3dac514d2b04f24f70ca5c 100644 (file)
@@ -86,3 +86,4 @@ char **i9e_complete_commands(const char *word, struct i9e_completer *completers)
 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);