*
*/
#include <xcb/xcb.h>
+#include <err.h>
#include "data.h"
#ifndef _UTIL_H
#define _UTIL_H
+#define die(...) errx(EXIT_FAILURE, __VA_ARGS__);
#define exit_if_null(pointer, ...) { if (pointer == NULL) die(__VA_ARGS__); }
#define STARTS_WITH(string, needle) (strncasecmp(string, needle, strlen(needle)) == 0)
#define CIRCLEQ_NEXT_OR_NULL(head, elm, field) (CIRCLEQ_NEXT(elm, field) != CIRCLEQ_END(head) ? \
*/
void slog(char *fmt, ...);
-/**
- * Prints the message (see printf()) to stderr, then exits the program.
- *
- */
-void die(char *fmt, ...) __attribute__((__noreturn__));
-
/**
* Safe-wrapper around malloc which exits if malloc returns NULL (meaning that
* there is no more memory available)
Client *get_last_focused_client(xcb_connection_t *conn, Container *container,
Client *exclude);
-/**
- * Unmaps all clients (and stack windows) of the given workspace.
- *
- * This needs to be called separately when temporarily rendering a workspace
- * which is not the active workspace to force reconfiguration of all clients,
- * like in src/xinerama.c when re-assigning a workspace to another screen.
- *
- */
-void unmap_workspace(xcb_connection_t *conn, Workspace *u_ws);
-
-/**
- * Unmaps all clients (and stack windows) of the given workspace.
- *
- * This needs to be called separately when temporarily rendering
- * a workspace which is not the active workspace to force
- * reconfiguration of all clients, like in src/xinerama.c when
- * re-assigning a workspace to another screen.
- *
- */
-void unmap_workspace(xcb_connection_t *conn, Workspace *u_ws);
-
/**
* Sets the given client as focused by updating the data structures correctly,
* updating the X input focus and finally re-decorating both windows (to
Client *get_matching_client(xcb_connection_t *conn,
const char *window_classtitle, Client *specific);
+#if defined(__OpenBSD__)
+/* OpenBSD does not provide memmem(), so we provide FreeBSD’s implementation */
+void *memmem(const void *l, size_t l_len, const void *s, size_t s_len);
+#endif
+
#endif