added set -e to scripts
[reconos.git] / lib / utils.h
blobeb953bc51033e449296dca0122d3658bd748630a
1 /*
2 * ____ _____
3 * ________ _________ ____ / __ \/ ___/
4 * / ___/ _ \/ ___/ __ \/ __ \/ / / /\__ \
5 * / / / __/ /__/ /_/ / / / / /_/ /___/ /
6 * /_/ \___/\___/\____/_/ /_/\____//____/
8 * ======================================================================
10 * title: ReconOS library - Utils
12 * project: ReconOS
13 * author: Andreas Agne, University of Paderborn
14 * Markus Happe, University of Paderborn
15 * Daniel Borkmann, ETH Zürich
16 * Sebastian Meisner, University of Paderborn
17 * Christoph Rüthing, University of Paderborn
18 * description: Some simple helper funtions
20 * ======================================================================
23 #ifndef RECONOS_UTILS_H
24 #define RECONOS_UTILS_H
26 #include <stdarg.h>
27 #include <stdio.h>
28 #include <stdlib.h>
31 static inline void die() {
32 exit(EXIT_FAILURE);
35 static inline void panic(char *msg, ...) {
36 va_list vl;
38 va_start(vl, msg);
39 vfprintf(stderr, msg, vl);
40 va_end(vl);
42 fflush(stderr);
43 die();
46 static inline void whine(char *msg, ...) {
47 va_list vl;
49 va_start(vl, msg);
50 vfprintf(stderr, msg, vl);
51 va_end(vl);
53 fflush(stderr);
56 #endif /* RECONOS_UTILS_H */