summaryrefslogtreecommitdiffstats
path: root/src/background.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/background.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 '')
-rw-r--r--src/background.h54
1 files changed, 54 insertions, 0 deletions
diff --git a/src/background.h b/src/background.h
new file mode 100644
index 0000000..a8b0323
--- /dev/null
+++ b/src/background.h
@@ -0,0 +1,54 @@
+/** \file background.h
+ * \brief Header: Background support
+ */
+
+#ifndef MC__BACKGROUND_H
+#define MC__BACKGROUND_H
+
+#include <sys/types.h> /* pid_t */
+#include "filemanager/fileopctx.h"
+/*** typedefs(not structures) and defined constants **********************************************/
+
+enum TaskState
+{
+ Task_Running,
+ Task_Stopped
+};
+
+typedef struct TaskList
+{
+ int fd;
+ int to_child_fd;
+ pid_t pid;
+ int state;
+ char *info;
+ struct TaskList *next;
+} TaskList;
+
+/*** enums ***************************************************************************************/
+
+/*** structures declarations (and typedefs of structures)*****************************************/
+
+/*** global variables defined in .c file *********************************************************/
+
+extern TaskList *task_list;
+
+/*** declarations of public functions ************************************************************/
+
+int do_background (file_op_context_t * ctx, char *info);
+int parent_call (void *routine, file_op_context_t * ctx, int argc, ...);
+char *parent_call_string (void *routine, int argc, ...);
+
+void unregister_task_running (pid_t pid, int fd);
+void unregister_task_with_pid (pid_t pid);
+
+gboolean background_parent_call (const gchar * event_group_name, const gchar * event_name,
+ gpointer init_data, gpointer data);
+
+gboolean
+background_parent_call_string (const gchar * event_group_name, const gchar * event_name,
+ gpointer init_data, gpointer data);
+
+/*** inline functions ****************************************************************************/
+
+#endif /* MC__BACKGROUND_H */