diff options
author | Hiltjo Posthuma <hiltjo@codemadness.org> | 2015-05-04 21:54:46 +0200 |
---|---|---|
committer | Anselm R Garbe <garbeam@gmail.com> | 2015-06-27 21:47:10 +0200 |
commit | 4b1fecd44e8376594c418663351fcb30c4e841de (patch) | |
tree | 78db12fd7024bff8afb3c3bd8851c009837f5a34 /util.c | |
parent | 13a529ce63364544bdc851dfd5d3aa2ef8740914 (diff) |
Use libdraw: add Xft and fallback-fonts support to graphics lib
- libdraw, util: add drw.{c,h}, util.{c,h} and update code.
- libdraw: fix drw_rect(): use w and h parameter.
- libdraw: print errstr if last character in string was ":" (sbase).
- libdraw: drw_clr_free() allow valid free(NULL).
- config.def.h: set default font to monospace.
- cleanup() on exit.
- LICENSE: update license string for dmenu -v to 2015.
- LICENSE: add myself to LICENSE
Diffstat (limited to 'util.c')
-rw-r--r-- | util.c | 23 |
1 files changed, 23 insertions, 0 deletions
@@ -0,0 +1,23 @@ +/* See LICENSE file for copyright and license details. */ +#include <stdarg.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#include "util.h" + +void +die(const char *fmt, ...) { + va_list ap; + + va_start(ap, fmt); + vfprintf(stderr, fmt, ap); + va_end(ap); + + if (fmt[0] && fmt[strlen(fmt)-1] == ':') { + fputc(' ', stderr); + perror(NULL); + } + + exit(1); +} |