util.h 399 B raw
1
#ifndef SWM_UTIL_H
2
#define SWM_UTIL_H
3
4
#include <stddef.h>
5
6
/* Print an error and terminate the process. */
7
[[noreturn]] void die(const char *fmt, ...);
8
/* Expand $NAME references without shell evaluation, returning bytes written or zero. */
9
size_t env_expand(char *output, size_t capacity, const char *input);
10
/* Put a file descriptor into nonblocking mode. */
11
int fd_set_nonblock(int fd);
12
13
#endif