continued with draw.c abstraction, also started util.{h,c} implementation, that will be used by draw.c as well

This commit is contained in:
Anselm R Garbe
2012-12-08 10:13:01 +01:00
parent c0ba635c50
commit f21d46ea7d
6 changed files with 80 additions and 29 deletions

14
dwm.c
View File

@ -41,6 +41,7 @@
#endif /* XINERAMA */
#include "draw.h"
#include "util.h"
/* macros */
#define BUTTONMASK (ButtonPressMask|ButtonReleaseMask)
@ -49,8 +50,6 @@
* MAX(0, MIN((y)+(h),(m)->wy+(m)->wh) - MAX((y),(m)->wy)))
#define ISVISIBLE(C) ((C->tags & C->mon->tagset[C->mon->seltags]))
#define LENGTH(X) (sizeof X / sizeof X[0])
#define MAX(A, B) ((A) > (B) ? (A) : (B))
#define MIN(A, B) ((A) < (B) ? (A) : (B))
#define MOUSEMASK (BUTTONMASK|PointerMotionMask)
#define WIDTH(X) ((X)->w + 2 * (X)->bw)
#define HEIGHT(X) ((X)->h + 2 * (X)->bw)
@ -176,7 +175,6 @@ static Monitor *createmon(void);
static void destroynotify(XEvent *e);
static void detach(Client *c);
static void detachstack(Client *c);
static void die(const char *errstr, ...);
static Monitor *dirtomon(int dir);
static void drawbar(Monitor *m);
static void drawbars(void);
@ -695,16 +693,6 @@ detachstack(Client *c) {
}
}
void
die(const char *errstr, ...) {
va_list ap;
va_start(ap, errstr);
vfprintf(stderr, errstr, ap);
va_end(ap);
exit(EXIT_FAILURE);
}
Monitor *
dirtomon(int dir) {
Monitor *m = NULL;