add a die() function to util

This commit is contained in:
Julien Danjou 2007-09-16 22:51:28 +02:00
parent c74c9c80a4
commit 2222164c27
2 changed files with 12 additions and 0 deletions

11
util.c
View File

@ -30,6 +30,17 @@
#include "util.h"
void
die(const char *fmt, ...)
{
va_list ap;
va_start(ap, fmt);
vfprintf(stderr, fmt, ap);
va_end(ap);
abort();
}
void
eprint(const char *fmt, ...)
{

1
util.h
View File

@ -118,6 +118,7 @@ static inline char *a_strdup(const char *s)
return len ? p_dup(s, len + 1) : NULL;
}
void die(const char *, ...) __attribute__ ((noreturn)) __attribute__ ((format(printf, 1, 2)));
void eprint(const char *, ...) __attribute__ ((noreturn)) __attribute__ ((format(printf, 1, 2)));
void uicb_spawn(Display *, int, DC *, awesome_config *, const char *);
Bool xgettextprop(Display *, Window, Atom, char *, unsigned int);