a3b7edee1defb5a5fc61abacb0d8a01e887a0b18
[runtime.git] / apps / irssi / src / fe-common / core / fe-exec.h
1 #ifndef __FE_EXEC_H
2 #define __FE_EXEC_H
3
4 #include "fe-windows.h"
5
6 #define EXEC_WI(query) \
7         MODULE_CHECK_CAST_MODULE(query, EXEC_WI_REC, type, \
8                               "WINDOW ITEM TYPE", "EXEC")
9
10 #define IS_EXEC_WI(query) \
11         (EXEC_WI(query) ? TRUE : FALSE)
12
13 typedef struct PROCESS_REC PROCESS_REC;
14
15 #define STRUCT_SERVER_REC void
16 typedef struct {
17 #include "window-item-rec.h"
18         PROCESS_REC *process;
19         unsigned int destroying:1;
20 } EXEC_WI_REC;
21
22 struct PROCESS_REC {
23         int id;
24         char *name;
25         char *args;
26
27         int pid;
28         GIOChannel *in;
29         NET_SENDBUF_REC *out;
30         LINEBUF_REC *databuf;
31         int read_tag;
32
33         int level; /* what level to use when printing the text */
34         char *target; /* send text with /msg <target> ... */
35         WINDOW_REC *target_win; /* print text to this window */
36         EXEC_WI_REC *target_item; /* print text to this exec window item */
37
38         unsigned int shell:1; /* start the program via /bin/sh */
39         unsigned int notice:1; /* send text with /notice, not /msg if target is set */
40         unsigned int silent:1; /* don't print "process exited with level xx" */
41         unsigned int target_channel:1; /* target is a channel */
42         unsigned int target_nick:1; /* target is a nick */
43 };
44
45 extern GSList *processes;
46
47 void fe_exec_init(void);
48 void fe_exec_deinit(void);
49
50 #endif