summaryrefslogtreecommitdiffstats
path: root/src/subshell/subshell.h
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 17:44:12 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 17:44:12 +0000
commit8ccb487c21368a7fdc8c7c72315325bf0aa06147 (patch)
treeb2056fae01d325924508a41731edfbd4c3cddd23 /src/subshell/subshell.h
parentInitial commit. (diff)
downloadmc-8ccb487c21368a7fdc8c7c72315325bf0aa06147.tar.xz
mc-8ccb487c21368a7fdc8c7c72315325bf0aa06147.zip
Adding upstream version 3:4.8.29.upstream/3%4.8.29upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/subshell/subshell.h')
-rw-r--r--src/subshell/subshell.h55
1 files changed, 55 insertions, 0 deletions
diff --git a/src/subshell/subshell.h b/src/subshell/subshell.h
new file mode 100644
index 0000000..bde19c4
--- /dev/null
+++ b/src/subshell/subshell.h
@@ -0,0 +1,55 @@
+/** \file subshell.h
+ * \brief Header: concurrent shell support
+ */
+
+#ifndef MC__SUBSHELL_H
+#define MC__SUBSHELL_H
+
+/*** typedefs(not structures) and defined constants **********************************************/
+
+/*** enums ***************************************************************************************/
+
+/* State of the subshell; see subshell.c for an explanation */
+
+enum subshell_state_enum
+{
+ INACTIVE,
+ ACTIVE,
+ RUNNING_COMMAND
+};
+
+/* For the 'how' argument to various functions */
+enum
+{
+ QUIETLY,
+ VISIBLY
+};
+
+/*** structures declarations (and typedefs of structures)*****************************************/
+
+/*** global variables defined in .c file *********************************************************/
+
+extern enum subshell_state_enum subshell_state;
+
+/* Holds the latest prompt captured from the subshell */
+extern GString *subshell_prompt;
+
+extern gboolean update_subshell_prompt;
+
+extern gboolean should_read_new_subshell_prompt;
+
+/*** declarations of public functions ************************************************************/
+
+void init_subshell (void);
+int invoke_subshell (const char *command, int how, vfs_path_t ** new_dir);
+gboolean flush_subshell (int max_wait_length, int how);
+gboolean read_subshell_prompt (void);
+void do_update_prompt (void);
+gboolean exit_subshell (void);
+void do_subshell_chdir (const vfs_path_t * vpath, gboolean update_prompt);
+void subshell_get_console_attributes (void);
+void sigchld_handler (int sig);
+
+/*** inline functions ****************************************************************************/
+
+#endif /* MC__SUBSHELL_H */