io.c revision 1.82 1 1.82 rillig /* $NetBSD: io.c,v 1.82 2021/10/08 17:04:13 rillig Exp $ */
2 1.3 tls
3 1.19 kamil /*-
4 1.19 kamil * SPDX-License-Identifier: BSD-4-Clause
5 1.19 kamil *
6 1.19 kamil * Copyright (c) 1985 Sun Microsystems, Inc.
7 1.4 mrg * Copyright (c) 1980, 1993
8 1.4 mrg * The Regents of the University of California. All rights reserved.
9 1.1 cgd * All rights reserved.
10 1.1 cgd *
11 1.1 cgd * Redistribution and use in source and binary forms, with or without
12 1.1 cgd * modification, are permitted provided that the following conditions
13 1.1 cgd * are met:
14 1.1 cgd * 1. Redistributions of source code must retain the above copyright
15 1.1 cgd * notice, this list of conditions and the following disclaimer.
16 1.1 cgd * 2. Redistributions in binary form must reproduce the above copyright
17 1.1 cgd * notice, this list of conditions and the following disclaimer in the
18 1.1 cgd * documentation and/or other materials provided with the distribution.
19 1.1 cgd * 3. All advertising materials mentioning features or use of this software
20 1.1 cgd * must display the following acknowledgement:
21 1.1 cgd * This product includes software developed by the University of
22 1.1 cgd * California, Berkeley and its contributors.
23 1.1 cgd * 4. Neither the name of the University nor the names of its contributors
24 1.1 cgd * may be used to endorse or promote products derived from this software
25 1.1 cgd * without specific prior written permission.
26 1.1 cgd *
27 1.1 cgd * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
28 1.1 cgd * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
29 1.1 cgd * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
30 1.1 cgd * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
31 1.1 cgd * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
32 1.1 cgd * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
33 1.1 cgd * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
34 1.1 cgd * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
35 1.1 cgd * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
36 1.1 cgd * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
37 1.1 cgd * SUCH DAMAGE.
38 1.1 cgd */
39 1.1 cgd
40 1.19 kamil #if 0
41 1.19 kamil static char sccsid[] = "@(#)io.c 8.1 (Berkeley) 6/6/93";
42 1.19 kamil #endif
43 1.19 kamil
44 1.5 lukem #include <sys/cdefs.h>
45 1.19 kamil #if defined(__NetBSD__)
46 1.82 rillig __RCSID("$NetBSD: io.c,v 1.82 2021/10/08 17:04:13 rillig Exp $");
47 1.19 kamil #elif defined(__FreeBSD__)
48 1.19 kamil __FBSDID("$FreeBSD: head/usr.bin/indent/io.c 334927 2018-06-10 16:44:18Z pstef $");
49 1.19 kamil #endif
50 1.1 cgd
51 1.5 lukem #include <ctype.h>
52 1.1 cgd #include <stdio.h>
53 1.1 cgd #include <string.h>
54 1.20 christos #include <stdarg.h>
55 1.22 rillig
56 1.19 kamil #include "indent.h"
57 1.1 cgd
58 1.66 rillig static bool comment_open;
59 1.67 rillig static int paren_indent;
60 1.68 rillig static int suppress_blanklines;
61 1.1 cgd
62 1.28 rillig static void
63 1.28 rillig output_char(char ch)
64 1.28 rillig {
65 1.28 rillig fputc(ch, output);
66 1.36 rillig debug_vis_range("output_char '", &ch, &ch + 1, "'\n");
67 1.28 rillig }
68 1.28 rillig
69 1.28 rillig static void
70 1.28 rillig output_range(const char *s, const char *e)
71 1.28 rillig {
72 1.28 rillig fwrite(s, 1, (size_t)(e - s), output);
73 1.36 rillig debug_vis_range("output_range \"", s, e, "\"\n");
74 1.28 rillig }
75 1.28 rillig
76 1.29 rillig static inline void
77 1.28 rillig output_string(const char *s)
78 1.28 rillig {
79 1.28 rillig output_range(s, s + strlen(s));
80 1.28 rillig }
81 1.28 rillig
82 1.34 rillig static int
83 1.34 rillig output_indent(int old_ind, int new_ind)
84 1.34 rillig {
85 1.34 rillig int ind = old_ind;
86 1.34 rillig
87 1.34 rillig if (opt.use_tabs) {
88 1.34 rillig int tabsize = opt.tabsize;
89 1.34 rillig int n = new_ind / tabsize - ind / tabsize;
90 1.34 rillig if (n > 0)
91 1.34 rillig ind -= ind % tabsize;
92 1.34 rillig for (int i = 0; i < n; i++) {
93 1.36 rillig fputc('\t', output);
94 1.34 rillig ind += tabsize;
95 1.34 rillig }
96 1.34 rillig }
97 1.34 rillig
98 1.34 rillig for (; ind < new_ind; ind++)
99 1.67 rillig fputc(' ', output);
100 1.34 rillig
101 1.36 rillig debug_println("output_indent %d", ind);
102 1.34 rillig return ind;
103 1.34 rillig }
104 1.34 rillig
105 1.26 rillig /*
106 1.26 rillig * dump_line is the routine that actually effects the printing of the new
107 1.26 rillig * source. It prints the label section, followed by the code section with
108 1.26 rillig * the appropriate nesting level, followed by any comments.
109 1.26 rillig */
110 1.5 lukem void
111 1.11 wiz dump_line(void)
112 1.26 rillig {
113 1.82 rillig int cur_ind;
114 1.62 rillig static bool not_first_line;
115 1.19 kamil
116 1.60 rillig if (ps.procname[0] != '\0') {
117 1.19 kamil ps.ind_level = 0;
118 1.60 rillig ps.procname[0] = '\0';
119 1.19 kamil }
120 1.30 rillig
121 1.55 rillig if (code.s == code.e && lab.s == lab.e && com.s == com.e) {
122 1.19 kamil if (suppress_blanklines > 0)
123 1.19 kamil suppress_blanklines--;
124 1.63 rillig else
125 1.72 rillig next_blank_lines++;
126 1.77 rillig
127 1.30 rillig } else if (!inhibit_formatting) {
128 1.19 kamil suppress_blanklines = 0;
129 1.19 kamil if (prefix_blankline_requested && not_first_line) {
130 1.19 kamil if (opt.swallow_optional_blanklines) {
131 1.72 rillig if (next_blank_lines == 1)
132 1.72 rillig next_blank_lines = 0;
133 1.30 rillig } else {
134 1.72 rillig if (next_blank_lines == 0)
135 1.72 rillig next_blank_lines = 1;
136 1.19 kamil }
137 1.19 kamil }
138 1.77 rillig
139 1.72 rillig while (--next_blank_lines >= 0)
140 1.28 rillig output_char('\n');
141 1.72 rillig next_blank_lines = 0;
142 1.77 rillig
143 1.19 kamil if (ps.ind_level == 0)
144 1.67 rillig ps.ind_stmt = false; /* this is a class A kludge. don't do
145 1.67 rillig * additional statement indentation if
146 1.67 rillig * we are at bracket level 0 */
147 1.19 kamil
148 1.55 rillig if (lab.e != lab.s || code.e != code.s)
149 1.58 rillig ps.stats.code_lines++;
150 1.19 kamil
151 1.54 rillig if (lab.e != lab.s) { /* print lab, if any */
152 1.19 kamil if (comment_open) {
153 1.60 rillig comment_open = false;
154 1.28 rillig output_string(".*/\n");
155 1.19 kamil }
156 1.77 rillig
157 1.69 rillig while (lab.e > lab.s && is_hspace(lab.e[-1]))
158 1.54 rillig lab.e--;
159 1.54 rillig *lab.e = '\0';
160 1.77 rillig
161 1.82 rillig cur_ind = output_indent(0, compute_label_indent());
162 1.77 rillig
163 1.54 rillig if (lab.s[0] == '#' && (strncmp(lab.s, "#else", 5) == 0
164 1.67 rillig || strncmp(lab.s, "#endif", 6) == 0)) {
165 1.54 rillig char *s = lab.s;
166 1.67 rillig if (lab.e[-1] == '\n')
167 1.67 rillig lab.e--;
168 1.25 rillig do {
169 1.28 rillig output_char(*s++);
170 1.54 rillig } while (s < lab.e && 'a' <= *s && *s <= 'z');
171 1.77 rillig
172 1.69 rillig while (s < lab.e && is_hspace(*s))
173 1.19 kamil s++;
174 1.77 rillig
175 1.54 rillig if (s < lab.e) {
176 1.28 rillig if (s[0] == '/' && s[1] == '*') {
177 1.28 rillig output_char('\t');
178 1.54 rillig output_range(s, lab.e);
179 1.28 rillig } else {
180 1.67 rillig output_string("\t/* ");
181 1.54 rillig output_range(s, lab.e);
182 1.28 rillig output_string(" */");
183 1.28 rillig }
184 1.28 rillig }
185 1.28 rillig } else
186 1.67 rillig output_range(lab.s, lab.e);
187 1.82 rillig cur_ind = indentation_after(cur_ind, lab.s);
188 1.30 rillig } else
189 1.82 rillig cur_ind = 0; /* there is no label section */
190 1.19 kamil
191 1.75 rillig ps.is_case_label = false;
192 1.19 kamil
193 1.55 rillig if (code.s != code.e) { /* print code section, if any */
194 1.19 kamil if (comment_open) {
195 1.60 rillig comment_open = false;
196 1.28 rillig output_string(".*/\n");
197 1.19 kamil }
198 1.77 rillig
199 1.44 rillig int target_col = 1 + compute_code_indent();
200 1.81 rillig for (int i = 0; i < ps.p_l_follow; i++) {
201 1.81 rillig if (ps.paren_indents[i] >= 0) {
202 1.81 rillig int ind = ps.paren_indents[i];
203 1.81 rillig /*
204 1.81 rillig * XXX: this mix of 'indent' and 'column' smells like
205 1.81 rillig * an off-by-one error.
206 1.81 rillig */
207 1.81 rillig ps.paren_indents[i] = (short)-(ind + target_col);
208 1.81 rillig debug_println(
209 1.81 rillig "setting pi[%d] from %d to %d for column %d",
210 1.81 rillig i, ind, ps.paren_indents[i], target_col);
211 1.36 rillig }
212 1.19 kamil }
213 1.77 rillig
214 1.82 rillig cur_ind = output_indent(cur_ind, target_col - 1);
215 1.55 rillig output_range(code.s, code.e);
216 1.82 rillig cur_ind = indentation_after(cur_ind, code.s);
217 1.19 kamil }
218 1.77 rillig
219 1.67 rillig if (com.s != com.e) { /* print comment, if any */
220 1.45 rillig int target_col = ps.com_col;
221 1.52 rillig char *com_st = com.s;
222 1.19 kamil
223 1.45 rillig target_col += ps.comment_delta;
224 1.19 kamil while (*com_st == '\t') /* consider original indentation in
225 1.67 rillig * case this is a box comment */
226 1.45 rillig com_st++, target_col += opt.tabsize;
227 1.81 rillig while (target_col <= 0) {
228 1.19 kamil if (*com_st == ' ')
229 1.45 rillig target_col++, com_st++;
230 1.19 kamil else if (*com_st == '\t') {
231 1.45 rillig target_col = opt.tabsize * (1 + (target_col - 1) / opt.tabsize) + 1;
232 1.19 kamil com_st++;
233 1.30 rillig } else
234 1.45 rillig target_col = 1;
235 1.81 rillig }
236 1.82 rillig if (cur_ind + 1 > target_col) { /* if comment can't fit on this line,
237 1.67 rillig * put it on next line */
238 1.28 rillig output_char('\n');
239 1.82 rillig cur_ind = 0;
240 1.58 rillig ps.stats.lines++;
241 1.19 kamil }
242 1.52 rillig while (com.e > com_st && isspace((unsigned char)com.e[-1]))
243 1.52 rillig com.e--;
244 1.82 rillig (void)output_indent(cur_ind, target_col - 1);
245 1.52 rillig output_range(com_st, com.e);
246 1.19 kamil ps.comment_delta = ps.n_comment_delta;
247 1.58 rillig ps.stats.comment_lines++;
248 1.19 kamil }
249 1.77 rillig
250 1.19 kamil if (ps.use_ff)
251 1.70 rillig output_char('\f');
252 1.19 kamil else
253 1.28 rillig output_char('\n');
254 1.58 rillig ps.stats.lines++;
255 1.77 rillig
256 1.19 kamil if (ps.just_saw_decl == 1 && opt.blanklines_after_declarations) {
257 1.60 rillig prefix_blankline_requested = true;
258 1.19 kamil ps.just_saw_decl = 0;
259 1.30 rillig } else
260 1.19 kamil prefix_blankline_requested = postfix_blankline_requested;
261 1.60 rillig postfix_blankline_requested = false;
262 1.19 kamil }
263 1.24 rillig
264 1.24 rillig /* keep blank lines after '//' comments */
265 1.52 rillig if (com.e - com.s > 1 && com.s[1] == '/'
266 1.56 rillig && token.s < token.e && isspace((unsigned char)token.s[0]))
267 1.56 rillig output_range(token.s, token.e);
268 1.24 rillig
269 1.76 rillig ps.decl_on_line = ps.in_decl; /* for proper comment indentation */
270 1.76 rillig ps.ind_stmt = ps.in_stmt && !ps.in_decl;
271 1.19 kamil ps.use_ff = false;
272 1.60 rillig ps.dumped_decl_indent = false;
273 1.77 rillig
274 1.54 rillig *(lab.e = lab.s) = '\0'; /* reset buffers */
275 1.55 rillig *(code.e = code.s) = '\0';
276 1.52 rillig *(com.e = com.s = com.buf + 1) = '\0';
277 1.77 rillig
278 1.64 rillig ps.ind_level = ps.ind_level_follow;
279 1.19 kamil ps.paren_level = ps.p_l_follow;
280 1.77 rillig
281 1.36 rillig if (ps.paren_level > 0) {
282 1.67 rillig /* TODO: explain what negative indentation means */
283 1.31 rillig paren_indent = -ps.paren_indents[ps.paren_level - 1];
284 1.36 rillig debug_println("paren_indent is now %d", paren_indent);
285 1.36 rillig }
286 1.77 rillig
287 1.60 rillig not_first_line = true;
288 1.1 cgd }
289 1.1 cgd
290 1.5 lukem int
291 1.39 rillig compute_code_indent(void)
292 1.1 cgd {
293 1.43 rillig int target_ind = opt.indent_size * ps.ind_level;
294 1.19 kamil
295 1.39 rillig if (ps.paren_level != 0) {
296 1.78 rillig if (!opt.lineup_to_parens) {
297 1.49 rillig if (2 * opt.continuation_indent == opt.indent_size)
298 1.49 rillig target_ind += opt.continuation_indent;
299 1.49 rillig else
300 1.49 rillig target_ind += opt.continuation_indent * ps.paren_level;
301 1.77 rillig
302 1.78 rillig } else if (opt.lineup_to_parens_always) {
303 1.39 rillig /*
304 1.39 rillig * XXX: where does this '- 1' come from? It looks strange but is
305 1.39 rillig * nevertheless needed for proper indentation, as demonstrated in
306 1.39 rillig * the test opt-lpl.0.
307 1.39 rillig */
308 1.39 rillig target_ind = paren_indent - 1;
309 1.77 rillig
310 1.78 rillig } else {
311 1.19 kamil int w;
312 1.31 rillig int t = paren_indent;
313 1.1 cgd
314 1.55 rillig if ((w = 1 + indentation_after(t - 1, code.s) - opt.max_line_length) > 0
315 1.55 rillig && 1 + indentation_after(target_ind, code.s) <= opt.max_line_length) {
316 1.19 kamil t -= w + 1;
317 1.39 rillig if (t > target_ind + 1)
318 1.39 rillig target_ind = t - 1;
319 1.30 rillig } else
320 1.39 rillig target_ind = t - 1;
321 1.19 kamil }
322 1.77 rillig
323 1.30 rillig } else if (ps.ind_stmt)
324 1.39 rillig target_ind += opt.continuation_indent;
325 1.77 rillig
326 1.39 rillig return target_ind;
327 1.1 cgd }
328 1.1 cgd
329 1.5 lukem int
330 1.38 rillig compute_label_indent(void)
331 1.1 cgd {
332 1.75 rillig if (ps.is_case_label)
333 1.74 rillig return (int)(case_ind * (float)opt.indent_size);
334 1.54 rillig if (lab.s[0] == '#')
335 1.67 rillig return 0;
336 1.43 rillig return opt.indent_size * (ps.ind_level - label_offset);
337 1.1 cgd }
338 1.1 cgd
339 1.53 rillig static void
340 1.53 rillig skip_hspace(const char **pp)
341 1.53 rillig {
342 1.69 rillig while (is_hspace(**pp))
343 1.53 rillig (*pp)++;
344 1.53 rillig }
345 1.53 rillig
346 1.73 rillig static bool
347 1.73 rillig skip_string(const char **pp, const char *s)
348 1.73 rillig {
349 1.73 rillig size_t len = strlen(s);
350 1.73 rillig if (strncmp(*pp, s, len) == 0) {
351 1.73 rillig *pp += len;
352 1.73 rillig return true;
353 1.73 rillig }
354 1.73 rillig return false;
355 1.73 rillig }
356 1.73 rillig
357 1.53 rillig static void
358 1.53 rillig parse_indent_comment(void)
359 1.53 rillig {
360 1.73 rillig bool on_off;
361 1.53 rillig
362 1.79 rillig const char *p = inp.buf;
363 1.53 rillig
364 1.53 rillig skip_hspace(&p);
365 1.73 rillig if (!skip_string(&p, "/*"))
366 1.53 rillig return;
367 1.53 rillig skip_hspace(&p);
368 1.73 rillig if (!skip_string(&p, "INDENT"))
369 1.53 rillig return;
370 1.53 rillig skip_hspace(&p);
371 1.77 rillig
372 1.73 rillig if (*p == '*' || skip_string(&p, "ON"))
373 1.73 rillig on_off = true;
374 1.73 rillig else if (skip_string(&p, "OFF"))
375 1.73 rillig on_off = false;
376 1.73 rillig else
377 1.53 rillig return;
378 1.53 rillig
379 1.53 rillig skip_hspace(&p);
380 1.73 rillig if (!skip_string(&p, "*/\n"))
381 1.53 rillig return;
382 1.53 rillig
383 1.55 rillig if (com.s != com.e || lab.s != lab.e || code.s != code.e)
384 1.53 rillig dump_line();
385 1.53 rillig
386 1.73 rillig inhibit_formatting = !on_off;
387 1.73 rillig if (on_off) {
388 1.72 rillig next_blank_lines = 0;
389 1.60 rillig postfix_blankline_requested = false;
390 1.60 rillig prefix_blankline_requested = false;
391 1.53 rillig suppress_blanklines = 1;
392 1.53 rillig }
393 1.53 rillig }
394 1.1 cgd
395 1.1 cgd /*
396 1.1 cgd * Copyright (C) 1976 by the Board of Trustees of the University of Illinois
397 1.5 lukem *
398 1.1 cgd * All rights reserved
399 1.5 lukem *
400 1.33 rillig * FUNCTION: Reads one block of input into the input buffer
401 1.1 cgd */
402 1.5 lukem void
403 1.11 wiz fill_buffer(void)
404 1.67 rillig {
405 1.67 rillig /* this routine reads stuff from the input */
406 1.19 kamil char *p;
407 1.71 rillig int ch;
408 1.19 kamil FILE *f = input;
409 1.19 kamil
410 1.80 rillig if (saved_inp_s != NULL) { /* there is a partly filled input buffer left */
411 1.80 rillig inp.s = saved_inp_s; /* do not read anything, just switch buffers */
412 1.80 rillig inp.e = saved_inp_e;
413 1.80 rillig saved_inp_s = saved_inp_e = NULL;
414 1.80 rillig debug_println("switched inp.s back to saved_inp_s");
415 1.79 rillig if (inp.s < inp.e)
416 1.19 kamil return; /* only return if there is really something in
417 1.1 cgd * this buffer */
418 1.19 kamil }
419 1.77 rillig
420 1.79 rillig for (p = inp.buf;;) {
421 1.79 rillig if (p >= inp.l) {
422 1.79 rillig size_t size = (size_t)(inp.l - inp.buf) * 2 + 10;
423 1.79 rillig size_t offset = (size_t)(p - inp.buf);
424 1.79 rillig inp.buf = xrealloc(inp.buf, size);
425 1.79 rillig p = inp.buf + offset;
426 1.79 rillig inp.l = inp.buf + size - 2;
427 1.19 kamil }
428 1.77 rillig
429 1.71 rillig if ((ch = getc(f)) == EOF) {
430 1.37 rillig *p++ = ' ';
431 1.37 rillig *p++ = '\n';
432 1.37 rillig had_eof = true;
433 1.37 rillig break;
434 1.1 cgd }
435 1.77 rillig
436 1.71 rillig if (ch != '\0')
437 1.71 rillig *p++ = (char)ch;
438 1.71 rillig if (ch == '\n')
439 1.37 rillig break;
440 1.19 kamil }
441 1.77 rillig
442 1.79 rillig inp.s = inp.buf;
443 1.79 rillig inp.e = p;
444 1.77 rillig
445 1.79 rillig if (p - inp.buf > 2 && p[-2] == '/' && p[-3] == '*') {
446 1.79 rillig if (inp.buf[3] == 'I' && strncmp(inp.buf, "/**INDENT**", 11) == 0)
447 1.19 kamil fill_buffer(); /* flush indent error message */
448 1.53 rillig else
449 1.53 rillig parse_indent_comment();
450 1.19 kamil }
451 1.77 rillig
452 1.19 kamil if (inhibit_formatting) {
453 1.79 rillig p = inp.buf;
454 1.25 rillig do {
455 1.28 rillig output_char(*p);
456 1.25 rillig } while (*p++ != '\n');
457 1.19 kamil }
458 1.1 cgd }
459 1.19 kamil
460 1.1 cgd int
461 1.40 rillig indentation_after_range(int ind, const char *start, const char *end)
462 1.1 cgd {
463 1.40 rillig for (const char *p = start; *p != '\0' && p != end; ++p) {
464 1.40 rillig if (*p == '\n' || *p == '\f')
465 1.40 rillig ind = 0;
466 1.40 rillig else if (*p == '\t')
467 1.40 rillig ind = opt.tabsize * (ind / opt.tabsize + 1);
468 1.40 rillig else if (*p == '\b')
469 1.40 rillig --ind;
470 1.40 rillig else
471 1.40 rillig ++ind;
472 1.40 rillig }
473 1.40 rillig return ind;
474 1.40 rillig }
475 1.1 cgd
476 1.40 rillig int
477 1.40 rillig indentation_after(int ind, const char *s)
478 1.40 rillig {
479 1.40 rillig return indentation_after_range(ind, s, NULL);
480 1.40 rillig }
481 1.19 kamil
482 1.5 lukem void
483 1.20 christos diag(int level, const char *msg, ...)
484 1.1 cgd {
485 1.20 christos va_list ap;
486 1.20 christos const char *s, *e;
487 1.20 christos
488 1.60 rillig if (level != 0)
489 1.65 rillig found_err = true;
490 1.1 cgd
491 1.19 kamil if (output == stdout) {
492 1.20 christos s = "/**INDENT** ";
493 1.20 christos e = " */";
494 1.20 christos } else {
495 1.20 christos s = e = "";
496 1.19 kamil }
497 1.1 cgd
498 1.20 christos va_start(ap, msg);
499 1.20 christos fprintf(stderr, "%s%s@%d: ", s, level == 0 ? "Warning" : "Error", line_no);
500 1.20 christos vfprintf(stderr, msg, ap);
501 1.20 christos fprintf(stderr, "%s\n", e);
502 1.20 christos va_end(ap);
503 1.1 cgd }
504