]> git.cameronkatri.com Git - mandoc.git/blob - mdoc_argv.c
Fixed undocumented `-diag' where NULL list item bodies aren't followed by a vspace.
[mandoc.git] / mdoc_argv.c
1 /* $Id: mdoc_argv.c,v 1.21 2009/07/20 14:12:27 kristaps Exp $ */
2 /*
3 * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
4 *
5 * Permission to use, copy, modify, and distribute this software for any
6 * purpose with or without fee is hereby granted, provided that the above
7 * copyright notice and this permission notice appear in all copies.
8 *
9 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16 */
17 #include <sys/types.h>
18
19 #include <assert.h>
20 #include <ctype.h>
21 #include <stdlib.h>
22 #include <stdio.h>
23 #include <string.h>
24
25 #include "libmdoc.h"
26
27 /*
28 * Routines to parse arguments of macros. Arguments follow the syntax
29 * of `-arg [val [valN...]]'. Arguments come in all types: quoted
30 * arguments, multiple arguments per value, no-value arguments, etc.
31 *
32 * There's no limit to the number or arguments that may be allocated.
33 */
34
35 /* FIXME .Bf Li raises "macro-like parameter". */
36
37 #define ARGS_DELIM (1 << 1)
38 #define ARGS_TABSEP (1 << 2)
39
40 #define ARGV_NONE (1 << 0)
41 #define ARGV_SINGLE (1 << 1)
42 #define ARGV_MULTI (1 << 2)
43 #define ARGV_OPT_SINGLE (1 << 3)
44
45 #define MULTI_STEP 5
46
47 static int argv_a2arg(int, const char *);
48 static int args(struct mdoc *, int, int *,
49 char *, int, char **);
50 static int argv(struct mdoc *, int,
51 struct mdoc_argv *, int *, char *);
52 static int argv_single(struct mdoc *, int,
53 struct mdoc_argv *, int *, char *);
54 static int argv_opt_single(struct mdoc *, int,
55 struct mdoc_argv *, int *, char *);
56 static int argv_multi(struct mdoc *, int,
57 struct mdoc_argv *, int *, char *);
58
59 /* Per-argument flags. */
60
61 static int mdoc_argvflags[MDOC_ARG_MAX] = {
62 ARGV_NONE, /* MDOC_Split */
63 ARGV_NONE, /* MDOC_Nosplit */
64 ARGV_NONE, /* MDOC_Ragged */
65 ARGV_NONE, /* MDOC_Unfilled */
66 ARGV_NONE, /* MDOC_Literal */
67 ARGV_NONE, /* MDOC_File */
68 ARGV_SINGLE, /* MDOC_Offset */
69 ARGV_NONE, /* MDOC_Bullet */
70 ARGV_NONE, /* MDOC_Dash */
71 ARGV_NONE, /* MDOC_Hyphen */
72 ARGV_NONE, /* MDOC_Item */
73 ARGV_NONE, /* MDOC_Enum */
74 ARGV_NONE, /* MDOC_Tag */
75 ARGV_NONE, /* MDOC_Diag */
76 ARGV_NONE, /* MDOC_Hang */
77 ARGV_NONE, /* MDOC_Ohang */
78 ARGV_NONE, /* MDOC_Inset */
79 ARGV_MULTI, /* MDOC_Column */
80 ARGV_SINGLE, /* MDOC_Width */
81 ARGV_NONE, /* MDOC_Compact */
82 ARGV_OPT_SINGLE, /* MDOC_Std */
83 ARGV_NONE, /* MDOC_Filled */
84 ARGV_NONE, /* MDOC_Words */
85 ARGV_NONE, /* MDOC_Emphasis */
86 ARGV_NONE, /* MDOC_Symbolic */
87 ARGV_NONE /* MDOC_Symbolic */
88 };
89
90 static int mdoc_argflags[MDOC_MAX] = {
91 0, /* Ap */
92 0, /* Dd */
93 0, /* Dt */
94 0, /* Os */
95 0, /* Sh */
96 0, /* Ss */
97 ARGS_DELIM, /* Pp */
98 ARGS_DELIM, /* D1 */
99 ARGS_DELIM, /* Dl */
100 0, /* Bd */
101 0, /* Ed */
102 0, /* Bl */
103 0, /* El */
104 0, /* It */
105 ARGS_DELIM, /* Ad */
106 ARGS_DELIM, /* An */
107 ARGS_DELIM, /* Ar */
108 0, /* Cd */
109 ARGS_DELIM, /* Cm */
110 ARGS_DELIM, /* Dv */
111 ARGS_DELIM, /* Er */
112 ARGS_DELIM, /* Ev */
113 0, /* Ex */
114 ARGS_DELIM, /* Fa */
115 0, /* Fd */
116 ARGS_DELIM, /* Fl */
117 ARGS_DELIM, /* Fn */
118 ARGS_DELIM, /* Ft */
119 ARGS_DELIM, /* Ic */
120 0, /* In */
121 ARGS_DELIM, /* Li */
122 0, /* Nd */
123 ARGS_DELIM, /* Nm */
124 ARGS_DELIM, /* Op */
125 0, /* Ot */
126 ARGS_DELIM, /* Pa */
127 0, /* Rv */
128 ARGS_DELIM, /* St */
129 ARGS_DELIM, /* Va */
130 ARGS_DELIM, /* Vt */
131 ARGS_DELIM, /* Xr */
132 0, /* %A */
133 0, /* %B */
134 0, /* %D */
135 0, /* %I */
136 0, /* %J */
137 0, /* %N */
138 0, /* %O */
139 0, /* %P */
140 0, /* %R */
141 0, /* %T */
142 0, /* %V */
143 ARGS_DELIM, /* Ac */
144 0, /* Ao */
145 ARGS_DELIM, /* Aq */
146 ARGS_DELIM, /* At */
147 ARGS_DELIM, /* Bc */
148 0, /* Bf */
149 0, /* Bo */
150 ARGS_DELIM, /* Bq */
151 ARGS_DELIM, /* Bsx */
152 ARGS_DELIM, /* Bx */
153 0, /* Db */
154 ARGS_DELIM, /* Dc */
155 0, /* Do */
156 ARGS_DELIM, /* Dq */
157 ARGS_DELIM, /* Ec */
158 0, /* Ef */
159 ARGS_DELIM, /* Em */
160 0, /* Eo */
161 ARGS_DELIM, /* Fx */
162 ARGS_DELIM, /* Ms */
163 ARGS_DELIM, /* No */
164 ARGS_DELIM, /* Ns */
165 ARGS_DELIM, /* Nx */
166 ARGS_DELIM, /* Ox */
167 ARGS_DELIM, /* Pc */
168 ARGS_DELIM, /* Pf */
169 0, /* Po */
170 ARGS_DELIM, /* Pq */
171 ARGS_DELIM, /* Qc */
172 ARGS_DELIM, /* Ql */
173 0, /* Qo */
174 ARGS_DELIM, /* Qq */
175 0, /* Re */
176 0, /* Rs */
177 ARGS_DELIM, /* Sc */
178 0, /* So */
179 ARGS_DELIM, /* Sq */
180 0, /* Sm */
181 ARGS_DELIM, /* Sx */
182 ARGS_DELIM, /* Sy */
183 ARGS_DELIM, /* Tn */
184 ARGS_DELIM, /* Ux */
185 ARGS_DELIM, /* Xc */
186 0, /* Xo */
187 0, /* Fo */
188 0, /* Fc */
189 0, /* Oo */
190 ARGS_DELIM, /* Oc */
191 0, /* Bk */
192 0, /* Ek */
193 0, /* Bt */
194 0, /* Hf */
195 0, /* Fr */
196 0, /* Ud */
197 0, /* Lb */
198 ARGS_DELIM, /* Lp */
199 ARGS_DELIM, /* Lk */
200 ARGS_DELIM, /* Mt */
201 ARGS_DELIM, /* Brq */
202 0, /* Bro */
203 ARGS_DELIM, /* Brc */
204 0, /* %C */
205 0, /* Es */
206 0, /* En */
207 0, /* Dx */
208 0, /* %Q */
209 0, /* br */
210 0, /* sp */
211 };
212
213
214 /*
215 * Parse an argument from line text. This comes in the form of -key
216 * [value0...], which may either have a single mandatory value, at least
217 * one mandatory value, an optional single value, or no value.
218 */
219 int
220 mdoc_argv(struct mdoc *m, int line, int tok,
221 struct mdoc_arg **v, int *pos, char *buf)
222 {
223 char *p, sv;
224 struct mdoc_argv tmp;
225 struct mdoc_arg *arg;
226
227 if (0 == buf[*pos])
228 return(ARGV_EOLN);
229
230 assert(' ' != buf[*pos]);
231
232 /* Parse through to the first unescaped space. */
233
234 p = &buf[++(*pos)];
235
236 assert(*pos > 0);
237
238 /* LINTED */
239 while (buf[*pos]) {
240 if (' ' == buf[*pos])
241 if ('\\' != buf[*pos - 1])
242 break;
243 (*pos)++;
244 }
245
246 /* XXX - save zeroed byte, if not an argument. */
247
248 sv = 0;
249 if (buf[*pos]) {
250 sv = buf[*pos];
251 buf[(*pos)++] = 0;
252 }
253
254 (void)memset(&tmp, 0, sizeof(struct mdoc_argv));
255 tmp.line = line;
256 tmp.pos = *pos;
257
258 /* See if our token accepts the argument. */
259
260 if (MDOC_ARG_MAX == (tmp.arg = argv_a2arg(tok, p))) {
261 /* XXX - restore saved zeroed byte. */
262 if (sv)
263 buf[*pos - 1] = sv;
264 return(ARGV_WORD);
265 }
266
267 while (buf[*pos] && ' ' == buf[*pos])
268 (*pos)++;
269
270 if ( ! argv(m, line, &tmp, pos, buf))
271 return(ARGV_ERROR);
272
273 if (NULL == (arg = *v)) {
274 *v = calloc(1, sizeof(struct mdoc_arg));
275 if (NULL == *v) {
276 (void)mdoc_nerr(m, m->last, EMALLOC);
277 return(ARGV_ERROR);
278 }
279 arg = *v;
280 }
281
282 arg->argc++;
283 arg->argv = realloc(arg->argv, arg->argc *
284 sizeof(struct mdoc_argv));
285
286 if (NULL == arg->argv) {
287 (void)mdoc_nerr(m, m->last, EMALLOC);
288 return(ARGV_ERROR);
289 }
290
291 (void)memcpy(&arg->argv[(int)arg->argc - 1],
292 &tmp, sizeof(struct mdoc_argv));
293
294 return(ARGV_ARG);
295 }
296
297
298 void
299 mdoc_argv_free(struct mdoc_arg *p)
300 {
301 int i, j;
302
303 if (NULL == p)
304 return;
305
306 if (p->refcnt) {
307 --(p->refcnt);
308 if (p->refcnt)
309 return;
310 }
311 assert(p->argc);
312
313 /* LINTED */
314 for (i = 0; i < (int)p->argc; i++) {
315 if (0 == p->argv[i].sz)
316 continue;
317 /* LINTED */
318 for (j = 0; j < (int)p->argv[i].sz; j++)
319 free(p->argv[i].value[j]);
320
321 free(p->argv[i].value);
322 }
323
324 free(p->argv);
325 free(p);
326 }
327
328
329 int
330 mdoc_zargs(struct mdoc *m, int line, int *pos, char *buf, char **v)
331 {
332
333 return(args(m, line, pos, buf, 0, v));
334 }
335
336
337 int
338 mdoc_args(struct mdoc *m, int line,
339 int *pos, char *buf, int tok, char **v)
340 {
341 int fl, c, i;
342 struct mdoc_node *n;
343
344 fl = (0 == tok) ? 0 : mdoc_argflags[tok];
345
346 if (MDOC_It != tok)
347 return(args(m, line, pos, buf, fl, v));
348
349 /*
350 * The `It' macro is a special case, as it acquires parameters from its
351 * parent `Bl' context, specifically, we're concerned with -column.
352 */
353
354 for (n = m->last; n; n = n->parent)
355 if (MDOC_BLOCK == n->type && MDOC_Bl == n->tok)
356 break;
357
358 assert(n);
359 c = (int)(n->args ? n->args->argc : 0);
360 assert(c > 0);
361
362 /* LINTED */
363 for (i = 0; i < c; i++) {
364 if (MDOC_Column != n->args->argv[i].arg)
365 continue;
366 fl |= ARGS_TABSEP;
367 fl &= ~ARGS_DELIM;
368 break;
369 }
370
371 return(args(m, line, pos, buf, fl, v));
372 }
373
374
375 static int
376 args(struct mdoc *m, int line, int *pos,
377 char *buf, int fl, char **v)
378 {
379 int i;
380 char *p, *pp;
381
382 assert(*pos);
383 assert(' ' != buf[*pos]);
384
385 if (0 == buf[*pos])
386 return(ARGS_EOLN);
387
388 /*
389 * If the first character is a delimiter and we're to look for
390 * delimited strings, then pass down the buffer seeing if it
391 * follows the pattern of [[::delim::][ ]+]+.
392 */
393
394 if ((fl & ARGS_DELIM) && mdoc_iscdelim(buf[*pos])) {
395 for (i = *pos; buf[i]; ) {
396 if ( ! mdoc_iscdelim(buf[i]))
397 break;
398 i++;
399 if (0 == buf[i] || ' ' != buf[i])
400 break;
401 i++;
402 while (buf[i] && ' ' == buf[i])
403 i++;
404 }
405
406 /* FIXME: warn about trailing whitespace. */
407
408 if (0 == buf[i]) {
409 *v = &buf[*pos];
410 return(ARGS_PUNCT);
411 }
412 }
413
414 *v = &buf[*pos];
415
416 /*
417 * First handle TABSEP items, restricted to `Bl -column'. This
418 * ignores conventional token parsing and instead uses tabs or
419 * `Ta' macros to separate phrases. Phrases are parsed again
420 * for arguments at a later phase.
421 */
422
423 if (ARGS_TABSEP & fl) {
424 /* Scan ahead to tab (can't be escaped). */
425 p = strchr(*v, '\t');
426
427 /* Scan ahead to unescaped `Ta'. */
428 for (pp = *v; ; pp++) {
429 if (NULL == (pp = strstr(pp, "Ta")))
430 break;
431 if (pp > *v && ' ' != *(pp - 1))
432 continue;
433 if (' ' == *(pp + 2) || 0 == *(pp + 2))
434 break;
435 }
436
437 /*
438 * Adjust new-buffer position to be beyond delimiter
439 * mark (e.g., Ta -> end + 2).
440 */
441 if (p && pp) {
442 *pos += pp < p ? 2 : 1;
443 p = pp < p ? pp : p;
444 } else if (p && ! pp) {
445 *pos += 1;
446 } else if (pp && ! p) {
447 p = pp;
448 *pos += 2;
449 } else
450 p = strchr(*v, 0);
451
452 /* Whitespace check for eoln case... */
453 if (0 == *p && ' ' == *(p - 1))
454 if ( ! mdoc_pwarn(m, line, *pos, ETAILWS))
455 return(ARGS_ERROR);
456
457 *pos += (int)(p - *v);
458
459 /* Strip delimiter's preceding whitespace. */
460 pp = p - 1;
461 while (pp > *v && ' ' == *pp) {
462 if (pp > *v && '\\' == *(pp - 1))
463 break;
464 pp--;
465 }
466 *(pp + 1) = 0;
467
468 /* Strip delimiter's proceeding whitespace. */
469 for (pp = &buf[*pos]; ' ' == *pp; pp++, (*pos)++)
470 /* Skip ahead. */ ;
471
472 return(ARGS_PHRASE);
473 }
474
475 /*
476 * Process a quoted literal. A quote begins with a double-quote
477 * and ends with a double-quote NOT preceded by a double-quote.
478 * Whitespace is NOT involved in literal termination.
479 */
480
481 if ('\"' == buf[*pos]) {
482 *v = &buf[++(*pos)];
483
484 for ( ; buf[*pos]; (*pos)++) {
485 if ('\"' != buf[*pos])
486 continue;
487 if ('\"' != buf[*pos + 1])
488 break;
489 (*pos)++;
490 }
491
492 if (0 == buf[*pos]) {
493 if ( ! mdoc_pwarn(m, line, *pos, EQUOTTERM))
494 return(ARGS_ERROR);
495 return(ARGS_QWORD);
496 }
497
498 buf[(*pos)++] = 0;
499
500 if (0 == buf[*pos])
501 return(ARGS_QWORD);
502
503 while (' ' == buf[*pos])
504 (*pos)++;
505
506 if (0 == buf[*pos])
507 if ( ! mdoc_pwarn(m, line, *pos, ETAILWS))
508 return(ARGS_ERROR);
509
510 return(ARGS_QWORD);
511 }
512
513 /*
514 * A non-quoted term progresses until either the end of line or
515 * a non-escaped whitespace.
516 */
517
518 for ( ; buf[*pos]; (*pos)++)
519 if (' ' == buf[*pos] && '\\' != buf[*pos - 1])
520 break;
521
522 if (0 == buf[*pos])
523 return(ARGS_WORD);
524
525 buf[(*pos)++] = 0;
526
527 while (' ' == buf[*pos])
528 (*pos)++;
529
530 if (0 == buf[*pos])
531 if ( ! mdoc_pwarn(m, line, *pos, ETAILWS))
532 return(ARGS_ERROR);
533
534 return(ARGS_WORD);
535 }
536
537
538 static int
539 argv_a2arg(int tok, const char *argv)
540 {
541
542 /*
543 * Parse an argument identifier from its text. XXX - this
544 * should really be table-driven to clarify the code.
545 *
546 * If you add an argument to the list, make sure that you
547 * register it here with its one or more macros!
548 */
549
550 switch (tok) {
551 case (MDOC_An):
552 if (0 == strcmp(argv, "split"))
553 return(MDOC_Split);
554 else if (0 == strcmp(argv, "nosplit"))
555 return(MDOC_Nosplit);
556 break;
557
558 case (MDOC_Bd):
559 if (0 == strcmp(argv, "ragged"))
560 return(MDOC_Ragged);
561 else if (0 == strcmp(argv, "unfilled"))
562 return(MDOC_Unfilled);
563 else if (0 == strcmp(argv, "filled"))
564 return(MDOC_Filled);
565 else if (0 == strcmp(argv, "literal"))
566 return(MDOC_Literal);
567 else if (0 == strcmp(argv, "file"))
568 return(MDOC_File);
569 else if (0 == strcmp(argv, "offset"))
570 return(MDOC_Offset);
571 else if (0 == strcmp(argv, "compact"))
572 return(MDOC_Compact);
573 break;
574
575 case (MDOC_Bf):
576 if (0 == strcmp(argv, "emphasis"))
577 return(MDOC_Emphasis);
578 else if (0 == strcmp(argv, "literal"))
579 return(MDOC_Literal);
580 else if (0 == strcmp(argv, "symbolic"))
581 return(MDOC_Symbolic);
582 break;
583
584 case (MDOC_Bk):
585 if (0 == strcmp(argv, "words"))
586 return(MDOC_Words);
587 break;
588
589 case (MDOC_Bl):
590 if (0 == strcmp(argv, "bullet"))
591 return(MDOC_Bullet);
592 else if (0 == strcmp(argv, "dash"))
593 return(MDOC_Dash);
594 else if (0 == strcmp(argv, "hyphen"))
595 return(MDOC_Hyphen);
596 else if (0 == strcmp(argv, "item"))
597 return(MDOC_Item);
598 else if (0 == strcmp(argv, "enum"))
599 return(MDOC_Enum);
600 else if (0 == strcmp(argv, "tag"))
601 return(MDOC_Tag);
602 else if (0 == strcmp(argv, "diag"))
603 return(MDOC_Diag);
604 else if (0 == strcmp(argv, "hang"))
605 return(MDOC_Hang);
606 else if (0 == strcmp(argv, "ohang"))
607 return(MDOC_Ohang);
608 else if (0 == strcmp(argv, "inset"))
609 return(MDOC_Inset);
610 else if (0 == strcmp(argv, "column"))
611 return(MDOC_Column);
612 else if (0 == strcmp(argv, "width"))
613 return(MDOC_Width);
614 else if (0 == strcmp(argv, "offset"))
615 return(MDOC_Offset);
616 else if (0 == strcmp(argv, "compact"))
617 return(MDOC_Compact);
618 else if (0 == strcmp(argv, "nested"))
619 return(MDOC_Nested);
620 break;
621
622 case (MDOC_Rv):
623 /* FALLTHROUGH */
624 case (MDOC_Ex):
625 if (0 == strcmp(argv, "std"))
626 return(MDOC_Std);
627 break;
628 default:
629 break;
630 }
631
632 return(MDOC_ARG_MAX);
633 }
634
635
636 static int
637 argv_multi(struct mdoc *m, int line,
638 struct mdoc_argv *v, int *pos, char *buf)
639 {
640 int c;
641 char *p;
642
643 for (v->sz = 0; ; v->sz++) {
644 if ('-' == buf[*pos])
645 break;
646 c = args(m, line, pos, buf, 0, &p);
647 if (ARGS_ERROR == c)
648 return(0);
649 else if (ARGS_EOLN == c)
650 break;
651
652 if (0 == v->sz % MULTI_STEP) {
653 v->value = realloc(v->value,
654 (v->sz + MULTI_STEP) * sizeof(char *));
655 if (NULL == v->value) {
656 (void)mdoc_nerr(m, m->last, EMALLOC);
657 return(ARGV_ERROR);
658 }
659 }
660 if (NULL == (v->value[(int)v->sz] = strdup(p)))
661 return(mdoc_nerr(m, m->last, EMALLOC));
662 }
663
664 return(1);
665 }
666
667
668 static int
669 argv_opt_single(struct mdoc *m, int line,
670 struct mdoc_argv *v, int *pos, char *buf)
671 {
672 int c;
673 char *p;
674
675 if ('-' == buf[*pos])
676 return(1);
677
678 c = args(m, line, pos, buf, 0, &p);
679 if (ARGS_ERROR == c)
680 return(0);
681 if (ARGS_EOLN == c)
682 return(1);
683
684 v->sz = 1;
685 if (NULL == (v->value = calloc(1, sizeof(char *))))
686 return(mdoc_nerr(m, m->last, EMALLOC));
687 if (NULL == (v->value[0] = strdup(p)))
688 return(mdoc_nerr(m, m->last, EMALLOC));
689
690 return(1);
691 }
692
693
694 /*
695 * Parse a single, mandatory value from the stream.
696 */
697 static int
698 argv_single(struct mdoc *m, int line,
699 struct mdoc_argv *v, int *pos, char *buf)
700 {
701 int c, ppos;
702 char *p;
703
704 ppos = *pos;
705
706 c = args(m, line, pos, buf, 0, &p);
707 if (ARGS_ERROR == c)
708 return(0);
709 if (ARGS_EOLN == c)
710 return(mdoc_perr(m, line, ppos, EARGVAL));
711
712 v->sz = 1;
713 if (NULL == (v->value = calloc(1, sizeof(char *))))
714 return(mdoc_nerr(m, m->last, EMALLOC));
715 if (NULL == (v->value[0] = strdup(p)))
716 return(mdoc_nerr(m, m->last, EMALLOC));
717
718 return(1);
719 }
720
721
722 /*
723 * Determine rules for parsing arguments. Arguments can either accept
724 * no parameters, an optional single parameter, one parameter, or
725 * multiple parameters.
726 */
727 static int
728 argv(struct mdoc *mdoc, int line,
729 struct mdoc_argv *v, int *pos, char *buf)
730 {
731
732 v->sz = 0;
733 v->value = NULL;
734
735 switch (mdoc_argvflags[v->arg]) {
736 case (ARGV_SINGLE):
737 return(argv_single(mdoc, line, v, pos, buf));
738 case (ARGV_MULTI):
739 return(argv_multi(mdoc, line, v, pos, buf));
740 case (ARGV_OPT_SINGLE):
741 return(argv_opt_single(mdoc, line, v, pos, buf));
742 default:
743 /* ARGV_NONE */
744 break;
745 }
746
747 return(1);
748 }