3 * By Daniel Borkmann <daniel@netyack.org>
4 * Copyright 2009, 2010 Daniel Borkmann.
19 static inline void error_and_die(int status
, char *msg
, ...)
23 vfprintf(stderr
, msg
, vl
);
29 static inline void die(void)
34 static inline void panic(char *msg
, ...)
38 vfprintf(stderr
, msg
, vl
);
44 static inline void whine(char *msg
, ...)
48 vfprintf(stderr
, msg
, vl
);
52 static inline void info(char *msg
, ...)
56 vfprintf(stdout
, msg
, vl
);
61 static inline void debug(char *msg
, ...)
65 vfprintf(stderr
, msg
, vl
);
71 static inline void debug_blue(char *msg
, ...)
75 fprintf(stderr
, "%s", colorize_start_full(white
, blue
));
77 vfprintf(stderr
, msg
, vl
);
79 fprintf(stderr
, "%s\n", colorize_end());
84 static inline void debug_red(char *msg
, ...)
88 fprintf(stderr
, "%s", colorize_start_full(white
, red
));
90 vfprintf(stderr
, msg
, vl
);
92 fprintf(stderr
, "%s\n", colorize_end());
97 static inline void debug_green(char *msg
, ...)
101 fprintf(stderr
, "%s", colorize_start_full(white
, green
));
103 vfprintf(stderr
, msg
, vl
);
105 fprintf(stderr
, "%s\n", colorize_end());
110 static inline void debug(char *msg
, ...)
115 static inline void debug_blue(char *msg
, ...)
120 static inline void debug_red(char *msg
, ...)
125 static inline void debug_green(char *msg
, ...)
131 static inline void print_blue(char *msg
, ...)
135 fprintf(stdout
, "%s", colorize_start_full(white
, blue
));
137 vfprintf(stdout
, msg
, vl
);
139 fprintf(stdout
, "%s\n", colorize_end());
144 static inline void print_red(char *msg
, ...)
148 fprintf(stdout
, "%s", colorize_start_full(white
, red
));
150 vfprintf(stdout
, msg
, vl
);
152 fprintf(stdout
, "%s\n", colorize_end());
157 static inline void print_green(char *msg
, ...)
161 fprintf(stdout
, "%s", colorize_start_full(white
, green
));
163 vfprintf(stdout
, msg
, vl
);
165 fprintf(stdout
, "%s\n", colorize_end());
170 static inline void puke_and_die_num(int status
, int num
, char *msg
, ...)
174 vfprintf(stderr
, msg
, vl
);
177 fprintf(stderr
, ": %s\n", strerror(num
));
182 static inline void puke_and_die(int status
, char *msg
, ...)
186 vfprintf(stderr
, msg
, vl
);
189 fprintf(stderr
, ": %s\n", strerror(errno
));