1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
|
diff --git a/xcb.c b/xcb.c
index 2c990a3..ac9fec2 100644
--- a/xcb.c
+++ b/xcb.c
@@ -262,13 +262,8 @@ XCreateFontSetWithGuess (Display * d, const char *pattern, char ***miss, int *n_
static
Boolean
-CvtStringToFontSet (dpy, args, num_args, fromVal, toVal, closure_ret)
- Display *dpy;
- XrmValuePtr args;
- Cardinal *num_args;
- XrmValuePtr fromVal;
- XrmValuePtr toVal;
- XtPointer *closure_ret;
+CvtStringToFontSet (Display *dpy, XrmValuePtr args, Cardinal *num_args,
+ XrmValuePtr fromVal, XrmValuePtr toVal, XtPointer *closure_ret)
{
XFontSet f;
char **missing_charset_list;
@@ -299,10 +294,7 @@ CvtStringToFontSet (dpy, args, num_args, fromVal, toVal, closure_ret)
* Fetch the contents of cut buffer n from the root window.
*/
static char *
-fetch_buffer (a, nb, force_mb)
- Atom a;
- int *nb;
- int force_mb;
+fetch_buffer (Atom a, int *nb, int force_mb)
{
unsigned long after;
char **list;
@@ -338,11 +330,7 @@ fetch_buffer (a, nb, force_mb)
* Store the string p into cut buffer n on the root window.
*/
static void
-store_buffer (p, nb, atom, force_mb)
- char *p;
- int nb;
- Atom atom;
- int force_mb;
+store_buffer (char *p, int nb, Atom atom, int force_mb)
{
XTextProperty pt;
@@ -359,8 +347,7 @@ store_buffer (p, nb, atom, force_mb)
* Add an atom to the program's atom cache.
*/
static Atom
-get_atom (n, ifexists)
- int n, ifexists;
+get_atom (int n, int ifexists)
{
char tmp[32];
@@ -403,10 +390,7 @@ initialize_properties (void)
* Draw a string in the window with top-left corner justification.
*/
static void
-place_text (cb, str, len, y)
- CbWidget cb;
- char *str;
- int len, y;
+place_text (CbWidget cb, char *str, int len, int y)
{
int cols;
GC gc;
@@ -439,10 +423,8 @@ place_text (cb, str, len, y)
*/
static void
-cb_initialize (req, wdg, args, nargs) /*ARGSUSED */
- Widget req, wdg;
- ArgList args;
- Cardinal *nargs;
+cb_initialize (Widget req, Widget wdg,
+ ArgList args, Cardinal *nargs) /*ARGSUSED */
{
CbWidget cb = (CbWidget) wdg;
XFontSetExtents *xfe = XExtentsOfFontSet (cb->fontset);
@@ -455,10 +437,7 @@ cb_initialize (req, wdg, args, nargs) /*ARGSUSED */
}
static void
-cb_realize (wdg, mask, attrs)
- Widget wdg;
- XtValueMask *mask;
- XSetWindowAttributes *attrs;
+cb_realize (Widget wdg, XtValueMask *mask, XSetWindowAttributes *attrs)
{
CbWidget cb = (CbWidget) wdg;
XtGCMask v_mask = 0L;
@@ -487,10 +466,7 @@ cb_realize (wdg, mask, attrs)
* Keep it simple.
*/
static void
-cb_redisplay (wdg, event, region) /*ARGSUSED */
- Widget wdg;
- XEvent *event;
- Region region;
+cb_redisplay (Widget wdg, XEvent *event, Region region) /*ARGSUSED */
{
CbWidget cb = (CbWidget) wdg;
char *p, *pp, *base;
@@ -513,8 +489,7 @@ cb_redisplay (wdg, event, region) /*ARGSUSED */
}
static void
-cb_destroy (wdg)
- Widget wdg;
+cb_destroy (Widget wdg)
{
CbWidget cb = (CbWidget) wdg;
@@ -540,11 +515,8 @@ cb_destroy (wdg)
* This breaks all the rules for object oriented widgets. Disgusting, no?
*/
static void
-cb_cut (wdg, event, parms, nparms) /*ARGSUSED */
- Widget wdg;
- XEvent *event;
- String *parms;
- Cardinal *nparms;
+cb_cut (Widget wdg, XEvent *event,
+ String *parms, Cardinal *nparms) /*ARGSUSED */
{
CbWidget cb = (CbWidget) wdg;
Window win = cb->core.window;
@@ -572,11 +544,8 @@ cb_cut (wdg, event, parms, nparms) /*ARGSUSED */
}
static void
-cb_paste (wdg, event, parms, nparms) /*ARGSUSED */
- Widget wdg;
- XEvent *event;
- String *parms;
- Cardinal *nparms;
+cb_paste (Widget wdg, XEvent *event,
+ String *parms, Cardinal *nparms) /*ARGSUSED */
{
CbWidget cb = (CbWidget) wdg;
Window w;
@@ -596,11 +565,8 @@ cb_paste (wdg, event, parms, nparms) /*ARGSUSED */
}
static void
-cb_clear (wdg, event, parms, nparms) /*ARGSUSED */
- Widget wdg;
- XEvent *event;
- String *parms;
- Cardinal *nparms;
+cb_clear (Widget wdg, XEvent *event,
+ String *parms, Cardinal *nparms) /*ARGSUSED */
{
CbWidget cb = (CbWidget) wdg;
Window win = cb->core.window;
@@ -614,11 +580,8 @@ cb_clear (wdg, event, parms, nparms) /*ARGSUSED */
}
static void
-cb_rotate (wdg, event, parms, nparms) /*ARGSUSED */
- Widget wdg;
- XEvent *event;
- String *parms;
- Cardinal *nparms;
+cb_rotate (Widget wdg, XEvent *event,
+ String *parms, Cardinal *nparms) /*ARGSUSED */
{
int n = 0;
@@ -630,11 +593,8 @@ cb_rotate (wdg, event, parms, nparms) /*ARGSUSED */
}
static void
-cb_quit (wdg, event, parms, nparms) /*ARGSUSED */
- Widget wdg;
- XEvent *event;
- String *parms;
- Cardinal *nparms;
+cb_quit (Widget wdg, XEvent *event,
+ String *parms, Cardinal *nparms) /*ARGSUSED */
{
exit (0);
}
@@ -643,11 +603,8 @@ cb_quit (wdg, event, parms, nparms) /*ARGSUSED */
* Clear and redraw the widget's window.
*/
static void
-cb_refresh (wdg, event, parms, nparms) /*ARGSUSED */
- Widget wdg;
- XEvent *event;
- String *parms;
- Cardinal *nparms;
+cb_refresh (Widget wdg, XEvent *event,
+ String *parms, Cardinal *nparms) /*ARGSUSED */
{
XClearArea (dpy, wdg->core.window, 0, 0, 0, 0, False);
cb_redisplay (wdg, (XEvent *) 0, (Region) 0);
@@ -661,11 +618,8 @@ cb_refresh (wdg, event, parms, nparms) /*ARGSUSED */
* of the cut buffer to the target window+atom.
*/
static void
-cb_selreq (wdg, event, parms, nparms) /*ARGSUSED */
- Widget wdg;
- XEvent *event;
- String *parms;
- Cardinal *nparms;
+cb_selreq (Widget wdg, XEvent *event,
+ String *parms, Cardinal *nparms) /*ARGSUSED */
{
int nbytes;
char *ptr;
@@ -739,11 +693,8 @@ cb_selreq (wdg, event, parms, nparms) /*ARGSUSED */
* be redrawn without highlighting.
*/
static void
-cb_selclear (wdg, event, parms, nparms) /*ARGSUSED */
- Widget wdg;
- XEvent *event;
- String *parms;
- Cardinal *nparms;
+cb_selclear (Widget wdg, XEvent *event,
+ String *parms, Cardinal *nparms) /*ARGSUSED */
{
CbWidget cb = (CbWidget) wdg;
@@ -858,18 +809,14 @@ usage ()
* or in the xdm-errors file when forcibly destroying the client program.
*/
static int
-xioerror (d) /*ARGSUSED */
- Display *d;
+xioerror (Display *d) /*ARGSUSED */
{
exit (1); /*NOTREACHED */
}
static void
-wmdel (wdg, ptr, ep, cont) /*ARGSUSED */
- Widget wdg;
- XtPointer ptr;
- XEvent *ep;
- Boolean *cont;
+wmdel (Widget wdg, XtPointer ptr,
+ XEvent *ep, Boolean *cont) /*ARGSUSED */
{
if (ep->type == ClientMessage && ep->xclient.data.l[0] == delwin)
exit (0);
@@ -879,10 +826,7 @@ wmdel (wdg, ptr, ep, cont) /*ARGSUSED */
* Print the contents of a cut buffer on stdout.
*/
static void
-doprint (n, ptr, nb)
- int n;
- char *ptr;
- int nb;
+doprint (int n, char *ptr, int nb)
{
Atom a;
@@ -905,10 +849,7 @@ doprint (n, ptr, nb)
* Load a new value into one of the cut buffers.
*/
static void
-doset (n, ptr, nb)
- int n;
- char *ptr;
- int nb;
+doset (int n, char *ptr, int nb)
{
char *str = malloc (nb + 1);
@@ -920,9 +861,7 @@ doset (n, ptr, nb)
}
static void
-timeout (arg, id)
- char *arg;
- XtIntervalId *id;
+timeout (void *arg, XtIntervalId *id)
{
exit (2);
}
@@ -931,10 +870,7 @@ timeout (arg, id)
* Copy the PRIMARY selection into a cut buffer.
*/
static void
-dogetseln (n, ptr, nb)
- int n;
- char *ptr;
- int nb;
+dogetseln (int n, char *ptr, int nb)
{
char *data;
int nbytes;
@@ -981,11 +917,7 @@ dogetseln (n, ptr, nb)
* list ordering is significant.
*/
static void
-dolist (list, fn, data, nbytes)
- char *list;
- void (*fn) ();
- char *data;
- int nbytes;
+dolist (char *list, void (*fn)(int, char*, int), char *data, int nbytes)
{
int m, n, x;
@@ -1027,9 +959,7 @@ dolist (list, fn, data, nbytes)
* without the need to create any X windows first.
*/
static void
-dotask (cmd, arg)
- int cmd;
- char *arg;
+dotask (int cmd, char *arg)
{
char *ptr;
int i, n, nb;
@@ -1122,9 +1052,7 @@ static XrmOptionDescRec opt[] =
* perform all the windows initializations.
*/
static void
-init (argc, argv)
- int argc;
- char **argv;
+init (int argc, char **argv)
{
int i, n;
char **p;
@@ -1350,9 +1278,8 @@ xevents ()
}
}
-main (argc, argv)
- int argc;
- char **argv;
+int
+main (int argc, char **argv)
{
init (argc, argv);
xevents ();
|