Midnight Commander for Win32
[reactos.git] / rosapps / mc / src / background.h
1 #ifndef __BACKGROUND_H
2 #define __BACKGROUND_H
3
4 /* Background code requires socketpair to be available */
5 /* Do not add the background code if it is not supported */
6 #ifdef USE_NETCODE
7 # define WITH_BACKGROUND
8 #endif
9
10 /* Used for parent/child communication. These are numbers that
11 * could not possible be a routine address.
12 */
13 enum {
14 MSG_CHILD_EXITING
15 };
16
17 /* First argument passed to real functions */
18 enum OperationMode {
19 Foreground,
20 Background
21 };
22
23 enum ReturnType {
24 Return_String,
25 Return_Integer
26 };
27
28 enum TaskState {
29 Task_Running,
30 Task_Stopped
31 };
32
33 typedef struct TaskList {
34 int fd;
35 pid_t pid;
36 int state;
37 char *info;
38 struct TaskList *next;
39 } TaskList;
40
41 extern struct TaskList *task_list;
42
43 extern int background_wait;
44
45 int do_background (char *info);
46 int background_attention (int fd, void *xpid);
47 void tell_parent (int msg);
48 int parent_call (void *routine, int argc, ...);
49 int call_1s (int (*routine)(enum OperationMode, char *), char *str);
50
51 void unregister_task_running (pid_t, int fd);
52 void register_task_running (pid_t, int, char *);
53
54 /* stubs */
55 void message_1s (int flags, char *title, char *str1);
56 void message_2s (int flags, char *title, char *str1, char *str2);
57 void message_3s (int flags, char *title, char *str1, char *str2, const char *str3);
58 void message_1s1d (int flags, char *title, char *str, int d);
59
60 #endif