new stuff
8a8b7956
5 file(s) · +25 −32
| 14 | 14 | { |
|
| 15 | 15 | XTextProperty name; |
|
| 16 | 16 | int n; |
|
| 17 | - | char **list = 0; |
|
| 17 | + | char **list = NULL; |
|
| 18 | 18 | ||
| 19 | 19 | name.nitems = 0; |
|
| 20 | 20 | c->name[0] = 0; |
| 116 | 116 | char **missing, *def; |
|
| 117 | 117 | int n; |
|
| 118 | 118 | ||
| 119 | - | missing = 0; |
|
| 119 | + | missing = NULL; |
|
| 120 | 120 | def = "?"; |
|
| 121 | 121 | setlocale(LC_ALL, ""); |
|
| 122 | 122 | if(font->set) |
|
| 128 | 128 | XFreeStringList(missing); |
|
| 129 | 129 | if(font->set) { |
|
| 130 | 130 | XFreeFontSet(dpy, font->set); |
|
| 131 | - | font->set = 0; |
|
| 131 | + | font->set = NULL; |
|
| 132 | 132 | } |
|
| 133 | 133 | } |
|
| 134 | 134 | if(font->set) { |
|
| 151 | 151 | else { |
|
| 152 | 152 | if(font->xfont) |
|
| 153 | 153 | XFreeFont(dpy, font->xfont); |
|
| 154 | - | font->xfont = 0; |
|
| 154 | + | font->xfont = NULL; |
|
| 155 | 155 | font->xfont = XLoadQueryFont(dpy, fontstr); |
|
| 156 | 156 | if (!font->xfont) |
|
| 157 | 157 | font->xfont = XLoadQueryFont(dpy, "fixed"); |
|
| 34 | 34 | static XRectangle rect; |
|
| 35 | 35 | static Bool done = False; |
|
| 36 | 36 | ||
| 37 | - | static Item *allitem = 0; /* first of all items */ |
|
| 38 | - | static Item *item = 0; /* first of pattern matching items */ |
|
| 39 | - | static Item *sel = 0; |
|
| 40 | - | static Item *nextoff = 0; |
|
| 41 | - | static Item *prevoff = 0; |
|
| 42 | - | static Item *curroff = 0; |
|
| 37 | + | static Item *allitem = NULL; /* first of all items */ |
|
| 38 | + | static Item *item = NULL; /* first of pattern matching items */ |
|
| 39 | + | static Item *sel = NULL; |
|
| 40 | + | static Item *nextoff = NULL; |
|
| 41 | + | static Item *prevoff = NULL; |
|
| 42 | + | static Item *curroff = NULL; |
|
| 43 | 43 | ||
| 44 | 44 | static int screen; |
|
| 45 | - | static char *title = 0; |
|
| 45 | + | static char *title = NULL; |
|
| 46 | 46 | static char text[4096]; |
|
| 47 | 47 | static int ret = 0; |
|
| 48 | 48 | static int nitem = 0; |
|
| 107 | 107 | else |
|
| 108 | 108 | cmdw = twidth; |
|
| 109 | 109 | ||
| 110 | - | item = j = 0; |
|
| 110 | + | item = j = NULL; |
|
| 111 | 111 | nitem = 0; |
|
| 112 | 112 | ||
| 113 | 113 | for(i = allitem; i; i=i->next) |
|
| 117 | 117 | else |
|
| 118 | 118 | j->right = i; |
|
| 119 | 119 | i->left = j; |
|
| 120 | - | i->right = 0; |
|
| 120 | + | i->right = NULL; |
|
| 121 | 121 | j = i; |
|
| 122 | 122 | nitem++; |
|
| 123 | 123 | } |
|
| 129 | 129 | else |
|
| 130 | 130 | j->right = i; |
|
| 131 | 131 | i->left = j; |
|
| 132 | - | i->right = 0; |
|
| 132 | + | i->right = NULL; |
|
| 133 | 133 | j = i; |
|
| 134 | 134 | nitem++; |
|
| 135 | 135 | } |
|
| 319 | 319 | static char * |
|
| 320 | 320 | read_allitems() |
|
| 321 | 321 | { |
|
| 322 | - | static char *maxname = 0; |
|
| 322 | + | static char *maxname = NULL; |
|
| 323 | 323 | char *p, buf[1024]; |
|
| 324 | 324 | unsigned int len = 0, max = 0; |
|
| 325 | 325 | Item *i, *new; |
|
| 336 | 336 | } |
|
| 337 | 337 | ||
| 338 | 338 | new = emalloc(sizeof(Item)); |
|
| 339 | - | new->next = new->left = new->right = 0; |
|
| 339 | + | new->next = new->left = new->right = NULL; |
|
| 340 | 340 | new->text = p; |
|
| 341 | 341 | if(!i) |
|
| 342 | 342 | allitem = new; |
|
| 20 | 20 | Cursor cursor[CurLast]; |
|
| 21 | 21 | XRectangle rect, barrect; |
|
| 22 | 22 | Bool running = True; |
|
| 23 | + | Client *client = NULL; |
|
| 23 | 24 | ||
| 24 | - | char *bartext; |
|
| 25 | + | char *bartext, tag[256]; |
|
| 25 | 26 | int screen, sel_screen; |
|
| 26 | 27 | unsigned int lock_mask, numlock_mask; |
|
| 27 | 28 | ||
| 74 | 75 | status = XGetWindowProperty(dpy, w, a, 0L, l, False, t, &real, &format, |
|
| 75 | 76 | &res, &extra, prop); |
|
| 76 | 77 | ||
| 77 | - | if(status != Success || *prop == 0) { |
|
| 78 | + | if(status != Success || *prop == NULL) { |
|
| 78 | 79 | return 0; |
|
| 79 | 80 | } |
|
| 80 | - | if(res == 0) { |
|
| 81 | + | if(res == 0) |
|
| 81 | 82 | free((void *) *prop); |
|
| 82 | - | } |
|
| 83 | 83 | return res; |
|
| 84 | 84 | } |
|
| 85 | 85 | ||
| 264 | 264 | barrect.width, barrect.height, 0, DefaultDepth(dpy, screen), |
|
| 265 | 265 | CopyFromParent, DefaultVisual(dpy, screen), |
|
| 266 | 266 | CWOverrideRedirect | CWBackPixmap | CWEventMask, &wa); |
|
| 267 | - | bartext = 0; |
|
| 267 | + | bartext = NULL; |
|
| 268 | 268 | XDefineCursor(dpy, barwin, cursor[CurNormal]); |
|
| 269 | 269 | XMapRaised(dpy, barwin); |
|
| 270 | 270 | draw_bar(); |
|
| 20 | 20 | enum { RFloat, RGrid, RLast }; |
|
| 21 | 21 | ||
| 22 | 22 | typedef struct Client Client; |
|
| 23 | - | typedef struct Tag Tag; |
|
| 24 | 23 | ||
| 25 | 24 | struct Client { |
|
| 26 | - | Tag *tag; |
|
| 27 | 25 | char name[256]; |
|
| 26 | + | char tag[256]; |
|
| 28 | 27 | int proto; |
|
| 29 | 28 | unsigned int border; |
|
| 30 | 29 | Bool fixedsize; |
|
| 37 | 36 | Client *snext; |
|
| 38 | 37 | }; |
|
| 39 | 38 | ||
| 40 | - | struct Tag { |
|
| 41 | - | char name[256]; |
|
| 42 | - | Client *stack; |
|
| 43 | - | XRectangle r; |
|
| 44 | - | Tag *next; |
|
| 45 | - | Tag *cnext; |
|
| 46 | - | }; |
|
| 47 | - | ||
| 48 | 39 | extern Display *dpy; |
|
| 49 | 40 | extern Window root, barwin; |
|
| 50 | 41 | extern Atom wm_atom[WMLast], net_atom[NetLast]; |
|
| 51 | 42 | extern Cursor cursor[CurLast]; |
|
| 52 | 43 | extern XRectangle rect, barrect; |
|
| 53 | 44 | extern Bool running; |
|
| 45 | + | extern Bool grid; |
|
| 54 | 46 | extern void (*handler[LASTEvent]) (XEvent *); |
|
| 55 | 47 | ||
| 56 | 48 | extern int screen, sel_screen; |
|
| 57 | 49 | extern unsigned int lock_mask, numlock_mask; |
|
| 58 | - | extern char *bartext; |
|
| 50 | + | extern char *bartext, tag[256]; |
|
| 59 | 51 | ||
| 60 | 52 | extern Brush brush; |
|
| 53 | + | extern Client *client; |
|
| 61 | 54 | ||
| 62 | 55 | /* bar.c */ |
|
| 63 | 56 | extern void draw_bar(); |
|