]> git.sur5r.net Git - i3/i3/blob - i3bar/include/child.h
i3bar: Introduce i3bar_child struct
[i3/i3] / i3bar / include / child.h
1 /*
2  * vim:ts=4:sw=4:expandtab
3  *
4  * i3bar - an xcb-based status- and ws-bar for i3
5  * © 2010-2012 Axel Wagner and contributors (see also: LICENSE)
6  *
7  * child.c: Getting Input for the statusline
8  *
9  */
10 #ifndef CHILD_H_
11 #define CHILD_H_
12
13 #define STDIN_CHUNK_SIZE 1024
14
15 typedef struct {
16     pid_t pid;
17
18     /**
19      * The version number is an uint32_t to avoid machines with different sizes of
20      * 'int' to allow different values here. It’s highly unlikely we ever exceed
21      * even an int8_t, but still…
22      */
23     uint32_t version;
24 } i3bar_child;
25
26 /*
27  * Start a child-process with the specified command and reroute stdin.
28  * We actually start a $SHELL to execute the command so we don't have to care
29  * about arguments and such
30  *
31  */
32 void start_child(char *command);
33
34 /*
35  * kill()s the child-process (if any). Called when exit()ing.
36  *
37  */
38 void kill_child_at_exit(void);
39
40 /*
41  * kill()s the child-process (if any) and closes and
42  * free()s the stdin- and sigchild-watchers
43  *
44  */
45 void kill_child(void);
46
47 /*
48  * Sends a SIGSTOP to the child-process (if existent)
49  *
50  */
51 void stop_child(void);
52
53 /*
54  * Sends a SIGCONT to the child-process (if existent)
55  *
56  */
57 void cont_child(void);
58
59 #endif