]> git.sur5r.net Git - i3/i3/blob - include/util.h
Implement stacking
[i3/i3] / include / util.h
1 /*
2  * vim:ts=8:expandtab
3  *
4  * i3 - an improved dynamic tiling window manager
5  *
6  * (c) 2009 Michael Stapelberg and contributors
7  *
8  * See file LICENSE for license information.
9  *
10  */
11 #include <xcb/xcb.h>
12
13 #include "data.h"
14
15 #ifndef _UTIL_H
16 #define _UTIL_H
17
18 #define exit_if_null(pointer, ...) { if (pointer == NULL) die(__VA_ARGS__); }
19 #define CIRCLEQ_NEXT_OR_NULL(head, elm, field) (CIRCLEQ_NEXT(elm, field) != CIRCLEQ_END(head) ? \
20                                                 CIRCLEQ_NEXT(elm, field) : NULL)
21 #define CIRCLEQ_PREV_OR_NULL(head, elm, field) (CIRCLEQ_PREV(elm, field) != CIRCLEQ_END(head) ? \
22                                                 CIRCLEQ_PREV(elm, field) : NULL)
23
24
25 int min(int a, int b);
26 int max(int a, int b);
27 void die(char *fmt, ...);
28 void *smalloc(size_t size);
29 char *sstrdup(const char *str);
30 void start_application(const char *command);
31 void check_error(xcb_connection_t *connection, xcb_void_cookie_t cookie, char *err_message);
32 void set_focus(xcb_connection_t *conn, Client *client);
33 void switch_layout_mode(xcb_connection_t *conn, Container *container, int mode);
34 void warp_pointer_into(xcb_connection_t *connection, Client *client);
35 void toggle_fullscreen(xcb_connection_t *conn, Client *client);
36
37 #endif