]> git.decadent.org.uk Git - ion3.git/blob - ioncore/exec.h
39e0c683f84df9b7626a00512cf44d0f6a76d32e
[ion3.git] / ioncore / exec.h
1 /*
2  * ion/ioncore/exec.h
3  *
4  * Copyright (c) Tuomo Valkonen 1999-2008. 
5  *
6  * See the included file LICENSE for details.
7  */
8
9 #ifndef ION_IONCORE_EXEC_H
10 #define ION_IONCORE_EXEC_H
11
12 #include <libextl/extl.h>
13 #include <libmainloop/hooks.h>
14 #include "common.h"
15 #include "rootwin.h"
16
17 enum{
18     IONCORE_SM_RESIGN,
19     IONCORE_SM_SHUTDOWN,
20     IONCORE_SM_RESTART,
21     IONCORE_SM_RESTART_OTHER,
22     IONCORE_SM_SNAPSHOT
23 };
24
25
26 INTRSTRUCT(WExecP);
27
28 DECLSTRUCT(WExecP){
29     WRegion *target;
30     const char *cmd;
31     const char *wd;
32 };
33
34
35 extern bool ioncore_exec(const char *cmd);
36 extern int ioncore_do_exec_on(WRegion *reg, const char *cmd, const char *wd,
37                               ExtlFn errh);
38 extern bool ioncore_popen_bgread(const char *cmd, ExtlFn h, ExtlFn errh,
39                                  const char *wd);
40 extern void ioncore_setup_environ(const WExecP *p);
41 extern void ioncore_setup_display(int xscr);
42
43 extern bool ioncore_set_smhook(void (*fn)(int what));
44
45 extern void ioncore_restart_other(const char *cmd);
46 extern void ioncore_restart();
47 extern void ioncore_shutdown();
48 extern void ioncore_resign();
49 extern void ioncore_snapshot();
50
51 extern void ioncore_do_exit();
52 extern void ioncore_do_restart();
53 extern bool ioncore_do_snapshot();
54
55 extern void ioncore_emergency_snapshot();
56
57 /* const WExecP* parameter */
58 extern WHook *ioncore_exec_environ_hook;
59
60 #endif /* ION_IONCORE_EXEC_H */