]> git.decadent.org.uk Git - ion3.git/blob - ioncore/exec.h
b76f01e5a650a01451318fd309032ac2d6525ce0
[ion3.git] / ioncore / exec.h
1 /*
2  * ion/ioncore/exec.h
3  *
4  * Copyright (c) Tuomo Valkonen 1999-2007. 
5  *
6  * Ion is free software; you can redistribute it and/or modify it under
7  * the terms of the GNU Lesser General Public License as published by
8  * the Free Software Foundation; either version 2.1 of the License, or
9  * (at your option) any later version.
10  */
11
12 #ifndef ION_IONCORE_EXEC_H
13 #define ION_IONCORE_EXEC_H
14
15 #include <libextl/extl.h>
16 #include <libmainloop/hooks.h>
17 #include "common.h"
18 #include "rootwin.h"
19
20 enum{
21     IONCORE_SM_RESIGN,
22     IONCORE_SM_SHUTDOWN,
23     IONCORE_SM_RESTART,
24     IONCORE_SM_RESTART_OTHER,
25     IONCORE_SM_SNAPSHOT
26 };
27
28
29 INTRSTRUCT(WExecP);
30
31 DECLSTRUCT(WExecP){
32     WRegion *target;
33     const char *cmd;
34     const char *wd;
35 };
36
37
38 extern bool ioncore_exec(const char *cmd);
39 extern int ioncore_do_exec_on(WRegion *reg, const char *cmd, const char *wd,
40                               ExtlFn errh);
41 extern bool ioncore_popen_bgread(const char *cmd, ExtlFn h, ExtlFn errh);
42 extern void ioncore_setup_environ(const WExecP *p);
43 extern void ioncore_setup_display(int xscr);
44
45 extern bool ioncore_set_smhook(void (*fn)(int what));
46
47 extern void ioncore_restart_other(const char *cmd);
48 extern void ioncore_restart();
49 extern void ioncore_shutdown();
50 extern void ioncore_resign();
51 extern void ioncore_snapshot();
52
53 extern void ioncore_do_exit();
54 extern void ioncore_do_restart();
55 extern bool ioncore_do_snapshot();
56
57 extern void ioncore_emergency_snapshot();
58
59 /* const WExecP* parameter */
60 extern WHook *ioncore_exec_environ_hook;
61
62 #endif /* ION_IONCORE_EXEC_H */