# HG changeset patch # User Anselm R. Garbe # Date 1152610076 -7200 # Node ID 49e2fc9fb94f58871fae976f055740303a5205b2 # Parent e0cefb3981c85fadbd03f6fb3d173a69f0ddaf79 new stuff diff -r e0cefb3981c8 -r 49e2fc9fb94f client.c --- a/client.c Tue Jul 11 11:10:05 2006 +0200 +++ b/client.c Tue Jul 11 11:27:56 2006 +0200 @@ -14,7 +14,7 @@ { XTextProperty name; int n; - char **list = 0; + char **list = NULL; name.nitems = 0; c->name[0] = 0; diff -r e0cefb3981c8 -r 49e2fc9fb94f draw.c --- a/draw.c Tue Jul 11 11:10:05 2006 +0200 +++ b/draw.c Tue Jul 11 11:27:56 2006 +0200 @@ -116,7 +116,7 @@ char **missing, *def; int n; - missing = 0; + missing = NULL; def = "?"; setlocale(LC_ALL, ""); if(font->set) @@ -128,7 +128,7 @@ XFreeStringList(missing); if(font->set) { XFreeFontSet(dpy, font->set); - font->set = 0; + font->set = NULL; } } if(font->set) { @@ -151,7 +151,7 @@ else { if(font->xfont) XFreeFont(dpy, font->xfont); - font->xfont = 0; + font->xfont = NULL; font->xfont = XLoadQueryFont(dpy, fontstr); if (!font->xfont) font->xfont = XLoadQueryFont(dpy, "fixed"); diff -r e0cefb3981c8 -r 49e2fc9fb94f menu.c --- a/menu.c Tue Jul 11 11:10:05 2006 +0200 +++ b/menu.c Tue Jul 11 11:27:56 2006 +0200 @@ -34,15 +34,15 @@ static XRectangle rect; static Bool done = False; -static Item *allitem = 0; /* first of all items */ -static Item *item = 0; /* first of pattern matching items */ -static Item *sel = 0; -static Item *nextoff = 0; -static Item *prevoff = 0; -static Item *curroff = 0; +static Item *allitem = NULL; /* first of all items */ +static Item *item = NULL; /* first of pattern matching items */ +static Item *sel = NULL; +static Item *nextoff = NULL; +static Item *prevoff = NULL; +static Item *curroff = NULL; static int screen; -static char *title = 0; +static char *title = NULL; static char text[4096]; static int ret = 0; static int nitem = 0; @@ -107,7 +107,7 @@ else cmdw = twidth; - item = j = 0; + item = j = NULL; nitem = 0; for(i = allitem; i; i=i->next) @@ -117,7 +117,7 @@ else j->right = i; i->left = j; - i->right = 0; + i->right = NULL; j = i; nitem++; } @@ -129,7 +129,7 @@ else j->right = i; i->left = j; - i->right = 0; + i->right = NULL; j = i; nitem++; } @@ -319,7 +319,7 @@ static char * read_allitems() { - static char *maxname = 0; + static char *maxname = NULL; char *p, buf[1024]; unsigned int len = 0, max = 0; Item *i, *new; @@ -336,7 +336,7 @@ } new = emalloc(sizeof(Item)); - new->next = new->left = new->right = 0; + new->next = new->left = new->right = NULL; new->text = p; if(!i) allitem = new; diff -r e0cefb3981c8 -r 49e2fc9fb94f wm.c --- a/wm.c Tue Jul 11 11:10:05 2006 +0200 +++ b/wm.c Tue Jul 11 11:27:56 2006 +0200 @@ -20,8 +20,9 @@ Cursor cursor[CurLast]; XRectangle rect, barrect; Bool running = True; +Client *client = NULL; -char *bartext; +char *bartext, tag[256]; int screen, sel_screen; unsigned int lock_mask, numlock_mask; @@ -74,12 +75,11 @@ status = XGetWindowProperty(dpy, w, a, 0L, l, False, t, &real, &format, &res, &extra, prop); - if(status != Success || *prop == 0) { + if(status != Success || *prop == NULL) { return 0; } - if(res == 0) { + if(res == 0) free((void *) *prop); - } return res; } @@ -264,7 +264,7 @@ barrect.width, barrect.height, 0, DefaultDepth(dpy, screen), CopyFromParent, DefaultVisual(dpy, screen), CWOverrideRedirect | CWBackPixmap | CWEventMask, &wa); - bartext = 0; + bartext = NULL; XDefineCursor(dpy, barwin, cursor[CurNormal]); XMapRaised(dpy, barwin); draw_bar(); diff -r e0cefb3981c8 -r 49e2fc9fb94f wm.h --- a/wm.h Tue Jul 11 11:10:05 2006 +0200 +++ b/wm.h Tue Jul 11 11:27:56 2006 +0200 @@ -20,11 +20,10 @@ enum { RFloat, RGrid, RLast }; typedef struct Client Client; -typedef struct Tag Tag; struct Client { - Tag *tag; char name[256]; + char tag[256]; int proto; unsigned int border; Bool fixedsize; @@ -37,27 +36,21 @@ Client *snext; }; -struct Tag { - char name[256]; - Client *stack; - XRectangle r; - Tag *next; - Tag *cnext; -}; - extern Display *dpy; extern Window root, barwin; extern Atom wm_atom[WMLast], net_atom[NetLast]; extern Cursor cursor[CurLast]; extern XRectangle rect, barrect; extern Bool running; +extern Bool grid; extern void (*handler[LASTEvent]) (XEvent *); extern int screen, sel_screen; extern unsigned int lock_mask, numlock_mask; -extern char *bartext; +extern char *bartext, tag[256]; extern Brush brush; +extern Client *client; /* bar.c */ extern void draw_bar();