summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--Makefile2
-rw-r--r--bar.c258
-rw-r--r--draw.c134
-rw-r--r--dwm.h14
-rw-r--r--main.c84
-rw-r--r--screen.c36
6 files changed, 269 insertions, 259 deletions
diff --git a/Makefile b/Makefile
index 385b56e..8e48185 100644
--- a/Makefile
+++ b/Makefile
@@ -3,7 +3,7 @@
3 3
4include config.mk 4include config.mk
5 5
6SRC += client.c draw.c event.c main.c screen.c util.c 6SRC += bar.c client.c event.c main.c screen.c util.c
7OBJ = ${SRC:.c=.o} 7OBJ = ${SRC:.c=.o}
8 8
9all: options dwm 9all: options dwm
diff --git a/bar.c b/bar.c
new file mode 100644
index 0000000..9e3c386
--- /dev/null
+++ b/bar.c
@@ -0,0 +1,258 @@
1/* See LICENSE file for copyright and license details. */
2#include "dwm.h"
3#include <string.h>
4#include <stdio.h>
5
6/* static */
7
8static void
9drawsquare(Bool filled, Bool empty, unsigned long col[ColLast]) {
10 int x;
11 XGCValues gcv;
12 XRectangle r = { dc.x, dc.y, dc.w, dc.h };
13
14 gcv.foreground = col[ColFG];
15 XChangeGC(dpy, dc.gc, GCForeground, &gcv);
16 x = (dc.font.ascent + dc.font.descent + 2) / 4;
17 r.x = dc.x + 1;
18 r.y = dc.y + 1;
19 if(filled) {
20 r.width = r.height = x + 1;
21 XFillRectangles(dpy, dc.drawable, dc.gc, &r, 1);
22 }
23 else if(empty) {
24 r.width = r.height = x;
25 XDrawRectangles(dpy, dc.drawable, dc.gc, &r, 1);
26 }
27}
28
29static unsigned long
30initcolor(const char *colstr) {
31 Colormap cmap = DefaultColormap(dpy, screen);
32 XColor color;
33
34 if(!XAllocNamedColor(dpy, cmap, colstr, &color, &color))
35 eprint("error, cannot allocate color '%s'\n", colstr);
36 return color.pixel;
37}
38
39static void
40initfont(const char *fontstr) {
41 char *def, **missing;
42 int i, n;
43
44 missing = NULL;
45 if(dc.font.set)
46 XFreeFontSet(dpy, dc.font.set);
47 dc.font.set = XCreateFontSet(dpy, fontstr, &missing, &n, &def);
48 if(missing) {
49 while(n--)
50 fprintf(stderr, "dwm: missing fontset: %s\n", missing[n]);
51 XFreeStringList(missing);
52 }
53 if(dc.font.set) {
54 XFontSetExtents *font_extents;
55 XFontStruct **xfonts;
56 char **font_names;
57 dc.font.ascent = dc.font.descent = 0;
58 font_extents = XExtentsOfFontSet(dc.font.set);
59 n = XFontsOfFontSet(dc.font.set, &xfonts, &font_names);
60 for(i = 0, dc.font.ascent = 0, dc.font.descent = 0; i < n; i++) {
61 if(dc.font.ascent < (*xfonts)->ascent)
62 dc.font.ascent = (*xfonts)->ascent;
63 if(dc.font.descent < (*xfonts)->descent)
64 dc.font.descent = (*xfonts)->descent;
65 xfonts++;
66 }
67 }
68 else {
69 if(dc.font.xfont)
70 XFreeFont(dpy, dc.font.xfont);
71 dc.font.xfont = NULL;
72 if(!(dc.font.xfont = XLoadQueryFont(dpy, fontstr)))
73 eprint("error, cannot load font: '%s'\n", fontstr);
74 dc.font.ascent = dc.font.xfont->ascent;
75 dc.font.descent = dc.font.xfont->descent;
76 }
77 dc.font.height = dc.font.ascent + dc.font.descent;
78}
79
80static Bool
81isoccupied(unsigned int t) {
82 Client *c;
83
84 for(c = clients; c; c = c->next)
85 if(c->tags[t])
86 return True;
87 return False;
88}
89
90static unsigned int
91textnw(const char *text, unsigned int len) {
92 XRectangle r;
93
94 if(dc.font.set) {
95 XmbTextExtents(dc.font.set, text, len, NULL, &r);
96 return r.width;
97 }
98 return XTextWidth(dc.font.xfont, text, len);
99}
100
101static void
102drawtext(const char *text, unsigned long col[ColLast]) {
103 int x, y, w, h;
104 static char buf[256];
105 unsigned int len, olen;
106 XRectangle r = { dc.x, dc.y, dc.w, dc.h };
107
108 XSetForeground(dpy, dc.gc, col[ColBG]);
109 XFillRectangles(dpy, dc.drawable, dc.gc, &r, 1);
110 if(!text)
111 return;
112 w = 0;
113 olen = len = strlen(text);
114 if(len >= sizeof buf)
115 len = sizeof buf - 1;
116 memcpy(buf, text, len);
117 buf[len] = 0;
118 h = dc.font.ascent + dc.font.descent;
119 y = dc.y + (dc.h / 2) - (h / 2) + dc.font.ascent;
120 x = dc.x + (h / 2);
121 /* shorten text if necessary */
122 while(len && (w = textnw(buf, len)) > dc.w - h)
123 buf[--len] = 0;
124 if(len < olen) {
125 if(len > 1)
126 buf[len - 1] = '.';
127 if(len > 2)
128 buf[len - 2] = '.';
129 if(len > 3)
130 buf[len - 3] = '.';
131 }
132 if(w > dc.w)
133 return; /* too long */
134 XSetForeground(dpy, dc.gc, col[ColFG]);
135 if(dc.font.set)
136 XmbDrawString(dpy, dc.drawable, dc.font.set, dc.gc, x, y, buf, len);
137 else
138 XDrawString(dpy, dc.drawable, dc.gc, x, y, buf, len);
139}
140
141/* extern */
142
143unsigned int bh;
144unsigned int bpos = BARPOS;
145DC dc = {0};
146Window barwin;
147
148void
149drawbar(void) {
150 int i, x;
151
152 dc.x = dc.y = 0;
153 for(i = 0; i < ntags; i++) {
154 dc.w = textw(tags[i]);
155 if(seltags[i]) {
156 drawtext(tags[i], dc.sel);
157 drawsquare(sel && sel->tags[i], isoccupied(i), dc.sel);
158 }
159 else {
160 drawtext(tags[i], dc.norm);
161 drawsquare(sel && sel->tags[i], isoccupied(i), dc.norm);
162 }
163 dc.x += dc.w;
164 }
165 dc.w = blw;
166 drawtext(getsymbol(), dc.norm);
167 x = dc.x + dc.w;
168 dc.w = textw(stext);
169 dc.x = sw - dc.w;
170 if(dc.x < x) {
171 dc.x = x;
172 dc.w = sw - x;
173 }
174 drawtext(stext, dc.norm);
175 if((dc.w = dc.x - x) > bh) {
176 dc.x = x;
177 if(sel) {
178 drawtext(sel->name, dc.sel);
179 drawsquare(sel->ismax, sel->isfloating, dc.sel);
180 }
181 else
182 drawtext(NULL, dc.norm);
183 }
184 XCopyArea(dpy, dc.drawable, barwin, dc.gc, 0, 0, sw, bh, 0, 0);
185 XSync(dpy, False);
186}
187
188void
189initbar(void) {
190 XSetWindowAttributes wa;
191
192 dc.norm[ColBorder] = initcolor(NORMBORDERCOLOR);
193 dc.norm[ColBG] = initcolor(NORMBGCOLOR);
194 dc.norm[ColFG] = initcolor(NORMFGCOLOR);
195 dc.sel[ColBorder] = initcolor(SELBORDERCOLOR);
196 dc.sel[ColBG] = initcolor(SELBGCOLOR);
197 dc.sel[ColFG] = initcolor(SELFGCOLOR);
198 initfont(FONT);
199 dc.h = bh = dc.font.height + 2;
200 wa.override_redirect = 1;
201 wa.background_pixmap = ParentRelative;
202 wa.event_mask = ButtonPressMask | ExposureMask;
203 barwin = XCreateWindow(dpy, root, sx, sy, sw, bh, 0,
204 DefaultDepth(dpy, screen), CopyFromParent, DefaultVisual(dpy, screen),
205 CWOverrideRedirect | CWBackPixmap | CWEventMask, &wa);
206 XDefineCursor(dpy, barwin, cursor[CurNormal]);
207 updatebarpos();
208 XMapRaised(dpy, barwin);
209 strcpy(stext, "dwm-"VERSION);
210 dc.drawable = XCreatePixmap(dpy, root, sw, bh, DefaultDepth(dpy, screen));
211 dc.gc = XCreateGC(dpy, root, 0, 0);
212 XSetLineAttributes(dpy, dc.gc, 1, LineSolid, CapButt, JoinMiter);
213 if(!dc.font.set)
214 XSetFont(dpy, dc.gc, dc.font.xfont->fid);
215}
216
217unsigned int
218textw(const char *text) {
219 return textnw(text, strlen(text)) + dc.font.height;
220}
221
222void
223togglebar(const char *arg) {
224 if(bpos == BarOff)
225 bpos = (BARPOS == BarOff) ? BarTop : BARPOS;
226 else
227 bpos = BarOff;
228 updatebarpos();
229 arrange();
230}
231
232void
233updatebarpos(void) {
234 XEvent ev;
235
236 wax = sx;
237 way = sy;
238 wah = sh;
239 waw = sw;
240 switch(bpos) {
241 default:
242 wah -= bh;
243 way += bh;
244 XMoveWindow(dpy, barwin, sx, sy);
245 break;
246 case BarBot:
247 wah -= bh;
248 XMoveWindow(dpy, barwin, sx, sy + wah);
249 break;
250 case BarOff:
251 XMoveWindow(dpy, barwin, sx, sy - bh);
252 break;
253 }
254 XSync(dpy, False);
255 while(XCheckMaskEvent(dpy, EnterWindowMask, &ev));
256}
257
258
diff --git a/draw.c b/draw.c
deleted file mode 100644
index eaad7fc..0000000
--- a/draw.c
+++ /dev/null
@@ -1,134 +0,0 @@
1/* See LICENSE file for copyright and license details. */
2#include "dwm.h"
3#include <string.h>
4
5/* static */
6
7static void
8drawsquare(Bool filled, Bool empty, unsigned long col[ColLast]) {
9 int x;
10 XGCValues gcv;
11 XRectangle r = { dc.x, dc.y, dc.w, dc.h };
12
13 gcv.foreground = col[ColFG];
14 XChangeGC(dpy, dc.gc, GCForeground, &gcv);
15 x = (dc.font.ascent + dc.font.descent + 2) / 4;
16 r.x = dc.x + 1;
17 r.y = dc.y + 1;
18 if(filled) {
19 r.width = r.height = x + 1;
20 XFillRectangles(dpy, dc.drawable, dc.gc, &r, 1);
21 }
22 else if(empty) {
23 r.width = r.height = x;
24 XDrawRectangles(dpy, dc.drawable, dc.gc, &r, 1);
25 }
26}
27
28static Bool
29isoccupied(unsigned int t) {
30 Client *c;
31
32 for(c = clients; c; c = c->next)
33 if(c->tags[t])
34 return True;
35 return False;
36}
37
38static unsigned int
39textnw(const char *text, unsigned int len) {
40 XRectangle r;
41
42 if(dc.font.set) {
43 XmbTextExtents(dc.font.set, text, len, NULL, &r);
44 return r.width;
45 }
46 return XTextWidth(dc.font.xfont, text, len);
47}
48
49/* extern */
50
51void
52drawbar(void) {
53 int i, x;
54
55 dc.x = dc.y = 0;
56 for(i = 0; i < ntags; i++) {
57 dc.w = textw(tags[i]);
58 if(seltags[i]) {
59 drawtext(tags[i], dc.sel);
60 drawsquare(sel && sel->tags[i], isoccupied(i), dc.sel);
61 }
62 else {
63 drawtext(tags[i], dc.norm);
64 drawsquare(sel && sel->tags[i], isoccupied(i), dc.norm);
65 }
66 dc.x += dc.w;
67 }
68 dc.w = blw;
69 drawtext(getsymbol(), dc.norm);
70 x = dc.x + dc.w;
71 dc.w = textw(stext);
72 dc.x = sw - dc.w;
73 if(dc.x < x) {
74 dc.x = x;
75 dc.w = sw - x;
76 }
77 drawtext(stext, dc.norm);
78 if((dc.w = dc.x - x) > bh) {
79 dc.x = x;
80 if(sel) {
81 drawtext(sel->name, dc.sel);
82 drawsquare(sel->ismax, sel->isfloating, dc.sel);
83 }
84 else
85 drawtext(NULL, dc.norm);
86 }
87 XCopyArea(dpy, dc.drawable, barwin, dc.gc, 0, 0, sw, bh, 0, 0);
88 XSync(dpy, False);
89}
90
91void
92drawtext(const char *text, unsigned long col[ColLast]) {
93 int x, y, w, h;
94 static char buf[256];
95 unsigned int len, olen;
96 XRectangle r = { dc.x, dc.y, dc.w, dc.h };
97
98 XSetForeground(dpy, dc.gc, col[ColBG]);
99 XFillRectangles(dpy, dc.drawable, dc.gc, &r, 1);
100 if(!text)
101 return;
102 w = 0;
103 olen = len = strlen(text);
104 if(len >= sizeof buf)
105 len = sizeof buf - 1;
106 memcpy(buf, text, len);
107 buf[len] = 0;
108 h = dc.font.ascent + dc.font.descent;
109 y = dc.y + (dc.h / 2) - (h / 2) + dc.font.ascent;
110 x = dc.x + (h / 2);
111 /* shorten text if necessary */
112 while(len && (w = textnw(buf, len)) > dc.w - h)
113 buf[--len] = 0;
114 if(len < olen) {
115 if(len > 1)
116 buf[len - 1] = '.';
117 if(len > 2)
118 buf[len - 2] = '.';
119 if(len > 3)
120 buf[len - 3] = '.';
121 }
122 if(w > dc.w)
123 return; /* too long */
124 XSetForeground(dpy, dc.gc, col[ColFG]);
125 if(dc.font.set)
126 XmbDrawString(dpy, dc.drawable, dc.font.set, dc.gc, x, y, buf, len);
127 else
128 XDrawString(dpy, dc.drawable, dc.gc, x, y, buf, len);
129}
130
131unsigned int
132textw(const char *text) {
133 return textnw(text, strlen(text)) + dc.font.height;
134}
diff --git a/dwm.h b/dwm.h
index cc8fd1a..6ab6bc3 100644
--- a/dwm.h
+++ b/dwm.h
@@ -88,6 +88,13 @@ extern DC dc; /* global draw context */
88extern Display *dpy; 88extern Display *dpy;
89extern Window root, barwin; 89extern Window root, barwin;
90 90
91/* bar.c */
92void drawbar(void); /* draw the bar */
93void initbar(void); /* initializes the bar */
94unsigned int textw(const char *text); /* return the width of text in px*/
95void togglebar(const char *arg); /* shows/hides the bar */
96void updatebarpos(void); /* updates the bar position */
97
91/* client.c */ 98/* client.c */
92void attach(Client *c); /* attaches c to global client list */ 99void attach(Client *c); /* attaches c to global client list */
93void ban(Client *c); /* bans c */ 100void ban(Client *c); /* bans c */
@@ -103,11 +110,6 @@ void unmanage(Client *c); /* unmanage c */
103void updatesizehints(Client *c); /* update the size hint variables of c */ 110void updatesizehints(Client *c); /* update the size hint variables of c */
104void updatetitle(Client *c); /* update the name of c */ 111void updatetitle(Client *c); /* update the name of c */
105 112
106/* draw.c */
107void drawbar(void); /* draw the bar */
108void drawtext(const char *text, unsigned long col[ColLast]); /* draw text */
109unsigned int textw(const char *text); /* return the width of text in px*/
110
111/* event.c */ 113/* event.c */
112void grabkeys(void); /* grab all keys defined in config.h */ 114void grabkeys(void); /* grab all keys defined in config.h */
113 115
@@ -132,12 +134,10 @@ Client *nexttiled(Client *c); /* returns tiled successor of c */
132void restack(void); /* restores z layers of all clients */ 134void restack(void); /* restores z layers of all clients */
133void setlayout(const char *arg); /* sets layout, NULL means next layout */ 135void setlayout(const char *arg); /* sets layout, NULL means next layout */
134void tag(const char *arg); /* tags sel with arg's index */ 136void tag(const char *arg); /* tags sel with arg's index */
135void togglebar(const char *arg); /* shows/hides the bar */
136void togglefloating(const char *arg); /* toggles sel between floating/tiled state */ 137void togglefloating(const char *arg); /* toggles sel between floating/tiled state */
137void togglemax(const char *arg); /* toggles maximization of floating client */ 138void togglemax(const char *arg); /* toggles maximization of floating client */
138void toggletag(const char *arg); /* toggles sel tags with arg's index */ 139void toggletag(const char *arg); /* toggles sel tags with arg's index */
139void toggleview(const char *arg); /* toggles the tag with arg's index (in)visible */ 140void toggleview(const char *arg); /* toggles the tag with arg's index (in)visible */
140void updatebarpos(void); /* updates the bar position */
141void view(const char *arg); /* views the tag with arg's index */ 141void view(const char *arg); /* views the tag with arg's index */
142 142
143/* util.c */ 143/* util.c */
diff --git a/main.c b/main.c
index 26bec25..de38cbc 100644
--- a/main.c
+++ b/main.c
@@ -17,8 +17,7 @@
17 17
18char stext[256]; 18char stext[256];
19int screen, sx, sy, sw, sh, wax, way, waw, wah; 19int screen, sx, sy, sw, sh, wax, way, waw, wah;
20unsigned int bh, ntags; 20unsigned int ntags;
21unsigned int bpos = BARPOS;
22unsigned int numlockmask = 0; 21unsigned int numlockmask = 0;
23Atom wmatom[WMLast], netatom[NetLast]; 22Atom wmatom[WMLast], netatom[NetLast];
24Bool *seltags; 23Bool *seltags;
@@ -28,8 +27,7 @@ Client *sel = NULL;
28Client *stack = NULL; 27Client *stack = NULL;
29Cursor cursor[CurLast]; 28Cursor cursor[CurLast];
30Display *dpy; 29Display *dpy;
31DC dc = {0}; 30Window root;
32Window root, barwin;
33 31
34/* static */ 32/* static */
35 33
@@ -60,57 +58,6 @@ cleanup(void) {
60 free(seltags); 58 free(seltags);
61} 59}
62 60
63static unsigned long
64initcolor(const char *colstr) {
65 Colormap cmap = DefaultColormap(dpy, screen);
66 XColor color;
67
68 if(!XAllocNamedColor(dpy, cmap, colstr, &color, &color))
69 eprint("error, cannot allocate color '%s'\n", colstr);
70 return color.pixel;
71}
72
73static void
74initfont(const char *fontstr) {
75 char *def, **missing;
76 int i, n;
77
78 missing = NULL;
79 if(dc.font.set)
80 XFreeFontSet(dpy, dc.font.set);
81 dc.font.set = XCreateFontSet(dpy, fontstr, &missing, &n, &def);
82 if(missing) {
83 while(n--)
84 fprintf(stderr, "dwm: missing fontset: %s\n", missing[n]);
85 XFreeStringList(missing);
86 }
87 if(dc.font.set) {
88 XFontSetExtents *font_extents;
89 XFontStruct **xfonts;
90 char **font_names;
91 dc.font.ascent = dc.font.descent = 0;
92 font_extents = XExtentsOfFontSet(dc.font.set);
93 n = XFontsOfFontSet(dc.font.set, &xfonts, &font_names);
94 for(i = 0, dc.font.ascent = 0, dc.font.descent = 0; i < n; i++) {
95 if(dc.font.ascent < (*xfonts)->ascent)
96 dc.font.ascent = (*xfonts)->ascent;
97 if(dc.font.descent < (*xfonts)->descent)
98 dc.font.descent = (*xfonts)->descent;
99 xfonts++;
100 }
101 }
102 else {
103 if(dc.font.xfont)
104 XFreeFont(dpy, dc.font.xfont);
105 dc.font.xfont = NULL;
106 if(!(dc.font.xfont = XLoadQueryFont(dpy, fontstr)))
107 eprint("error, cannot load font: '%s'\n", fontstr);
108 dc.font.ascent = dc.font.xfont->ascent;
109 dc.font.descent = dc.font.xfont->descent;
110 }
111 dc.font.height = dc.font.ascent + dc.font.descent;
112}
113
114static long 61static long
115getstate(Window w) { 62getstate(Window w) {
116 int format, status; 63 int format, status;
@@ -197,37 +144,12 @@ setup(void) {
197 for(ntags = 0; tags[ntags]; ntags++); 144 for(ntags = 0; tags[ntags]; ntags++);
198 seltags = emallocz(sizeof(Bool) * ntags); 145 seltags = emallocz(sizeof(Bool) * ntags);
199 seltags[0] = True; 146 seltags[0] = True;
200 /* style */
201 dc.norm[ColBorder] = initcolor(NORMBORDERCOLOR);
202 dc.norm[ColBG] = initcolor(NORMBGCOLOR);
203 dc.norm[ColFG] = initcolor(NORMFGCOLOR);
204 dc.sel[ColBorder] = initcolor(SELBORDERCOLOR);
205 dc.sel[ColBG] = initcolor(SELBGCOLOR);
206 dc.sel[ColFG] = initcolor(SELFGCOLOR);
207 initfont(FONT);
208 /* geometry */ 147 /* geometry */
209 sx = sy = 0; 148 sx = sy = 0;
210 sw = DisplayWidth(dpy, screen); 149 sw = DisplayWidth(dpy, screen);
211 sh = DisplayHeight(dpy, screen); 150 sh = DisplayHeight(dpy, screen);
212 initlayouts(); 151 initlayouts();
213 /* bar */ 152 initbar();
214 dc.h = bh = dc.font.height + 2;
215 wa.override_redirect = 1;
216 wa.background_pixmap = ParentRelative;
217 wa.event_mask = ButtonPressMask | ExposureMask;
218 barwin = XCreateWindow(dpy, root, sx, sy, sw, bh, 0,
219 DefaultDepth(dpy, screen), CopyFromParent, DefaultVisual(dpy, screen),
220 CWOverrideRedirect | CWBackPixmap | CWEventMask, &wa);
221 XDefineCursor(dpy, barwin, cursor[CurNormal]);
222 updatebarpos();
223 XMapRaised(dpy, barwin);
224 strcpy(stext, "dwm-"VERSION);
225 /* pixmap for everything */
226 dc.drawable = XCreatePixmap(dpy, root, sw, bh, DefaultDepth(dpy, screen));
227 dc.gc = XCreateGC(dpy, root, 0, 0);
228 XSetLineAttributes(dpy, dc.gc, 1, LineSolid, CapButt, JoinMiter);
229 if(!dc.font.set)
230 XSetFont(dpy, dc.gc, dc.font.xfont->fid);
231 /* multihead support */ 153 /* multihead support */
232 selscreen = XQueryPointer(dpy, root, &w, &w, &i, &i, &i, &i, &mask); 154 selscreen = XQueryPointer(dpy, root, &w, &w, &i, &i, &i, &i, &mask);
233} 155}
diff --git a/screen.c b/screen.c
index f793c5d..142ed56 100644
--- a/screen.c
+++ b/screen.c
@@ -273,16 +273,6 @@ tag(const char *arg) {
273} 273}
274 274
275void 275void
276togglebar(const char *arg) {
277 if(bpos == BarOff)
278 bpos = (BARPOS == BarOff) ? BarTop : BARPOS;
279 else
280 bpos = BarOff;
281 updatebarpos();
282 arrange();
283}
284
285void
286togglefloating(const char *arg) { 276togglefloating(const char *arg) {
287 if(!sel) 277 if(!sel)
288 return; 278 return;
@@ -338,32 +328,6 @@ toggleview(const char *arg) {
338} 328}
339 329
340void 330void
341updatebarpos(void) {
342 XEvent ev;
343
344 wax = sx;
345 way = sy;
346 wah = sh;
347 waw = sw;
348 switch(bpos) {
349 default:
350 wah -= bh;
351 way += bh;
352 XMoveWindow(dpy, barwin, sx, sy);
353 break;
354 case BarBot:
355 wah -= bh;
356 XMoveWindow(dpy, barwin, sx, sy + wah);
357 break;
358 case BarOff:
359 XMoveWindow(dpy, barwin, sx, sy - bh);
360 break;
361 }
362 XSync(dpy, False);
363 while(XCheckMaskEvent(dpy, EnterWindowMask, &ev));
364}
365
366void
367view(const char *arg) { 331view(const char *arg) {
368 unsigned int i; 332 unsigned int i;
369 333