]> git.cameronkatri.com Git - mandoc.git/blob - mdoc_argv.c
Cleaned up version info.
[mandoc.git] / mdoc_argv.c
1 /* $Id: mdoc_argv.c,v 1.33 2010/01/01 17:14:29 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 #ifdef HAVE_CONFIG_H
18 #include "config.h"
19 #endif
20
21 #include <sys/types.h>
22
23 #include <assert.h>
24 #include <ctype.h>
25 #include <stdlib.h>
26 #include <stdio.h>
27 #include <string.h>
28
29 #include "libmdoc.h"
30 #include "libmandoc.h"
31
32 /*
33 * Routines to parse arguments of macros. Arguments follow the syntax
34 * of `-arg [val [valN...]]'. Arguments come in all types: quoted
35 * arguments, multiple arguments per value, no-value arguments, etc.
36 *
37 * There's no limit to the number or arguments that may be allocated.
38 */
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_SINGLE, /* MDOC_File */
68 ARGV_OPT_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_NONE, /* 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 0, /* %U */
212 };
213
214
215 /*
216 * Parse an argument from line text. This comes in the form of -key
217 * [value0...], which may either have a single mandatory value, at least
218 * one mandatory value, an optional single value, or no value.
219 */
220 int
221 mdoc_argv(struct mdoc *m, int line, int tok,
222 struct mdoc_arg **v, int *pos, char *buf)
223 {
224 char *p, sv;
225 struct mdoc_argv tmp;
226 struct mdoc_arg *arg;
227
228 if (0 == buf[*pos])
229 return(ARGV_EOLN);
230
231 assert(' ' != buf[*pos]);
232
233 /* Parse through to the first unescaped space. */
234
235 p = &buf[++(*pos)];
236
237 assert(*pos > 0);
238
239 /* LINTED */
240 while (buf[*pos]) {
241 if (' ' == buf[*pos])
242 if ('\\' != buf[*pos - 1])
243 break;
244 (*pos)++;
245 }
246
247 /* XXX - save zeroed byte, if not an argument. */
248
249 sv = 0;
250 if (buf[*pos]) {
251 sv = buf[*pos];
252 buf[(*pos)++] = 0;
253 }
254
255 (void)memset(&tmp, 0, sizeof(struct mdoc_argv));
256 tmp.line = line;
257 tmp.pos = *pos;
258
259 /* See if our token accepts the argument. */
260
261 if (MDOC_ARG_MAX == (tmp.arg = argv_a2arg(tok, p))) {
262 /* XXX - restore saved zeroed byte. */
263 if (sv)
264 buf[*pos - 1] = sv;
265 return(ARGV_WORD);
266 }
267
268 while (buf[*pos] && ' ' == buf[*pos])
269 (*pos)++;
270
271 if ( ! argv(m, line, &tmp, pos, buf))
272 return(ARGV_ERROR);
273
274 if (NULL == (arg = *v))
275 arg = *v = mandoc_calloc(1, sizeof(struct mdoc_arg));
276
277 arg->argc++;
278 arg->argv = mandoc_realloc
279 (arg->argv, arg->argc * sizeof(struct mdoc_argv));
280
281 (void)memcpy(&arg->argv[(int)arg->argc - 1],
282 &tmp, sizeof(struct mdoc_argv));
283
284 return(ARGV_ARG);
285 }
286
287
288 void
289 mdoc_argv_free(struct mdoc_arg *p)
290 {
291 int i, j;
292
293 if (NULL == p)
294 return;
295
296 if (p->refcnt) {
297 --(p->refcnt);
298 if (p->refcnt)
299 return;
300 }
301 assert(p->argc);
302
303 /* LINTED */
304 for (i = 0; i < (int)p->argc; i++) {
305 if (0 == p->argv[i].sz)
306 continue;
307 if (NULL == p->argv[i].value)
308 continue;
309
310 /* LINTED */
311 for (j = 0; j < (int)p->argv[i].sz; j++)
312 if (p->argv[i].value[j])
313 free(p->argv[i].value[j]);
314
315 free(p->argv[i].value);
316 }
317
318 free(p->argv);
319 free(p);
320 }
321
322
323 int
324 mdoc_zargs(struct mdoc *m, int line, int *pos,
325 char *buf, int flags, char **v)
326 {
327
328 return(args(m, line, pos, buf, flags, v));
329 }
330
331
332 int
333 mdoc_args(struct mdoc *m, int line,
334 int *pos, char *buf, int tok, char **v)
335 {
336 int fl, c, i;
337 struct mdoc_node *n;
338
339 fl = (0 == tok) ? 0 : mdoc_argflags[tok];
340
341 if (MDOC_It != tok)
342 return(args(m, line, pos, buf, fl, v));
343
344 /*
345 * The `It' macro is a special case, as it acquires parameters from its
346 * parent `Bl' context, specifically, we're concerned with -column.
347 */
348
349 for (n = m->last; n; n = n->parent)
350 if (MDOC_BLOCK == n->type && MDOC_Bl == n->tok)
351 break;
352
353 assert(n);
354 c = (int)(n->args ? n->args->argc : 0);
355 assert(c > 0);
356
357 /* LINTED */
358 for (i = 0; i < c; i++) {
359 if (MDOC_Column != n->args->argv[i].arg)
360 continue;
361 fl |= ARGS_TABSEP;
362 fl &= ~ARGS_DELIM;
363 break;
364 }
365
366 return(args(m, line, pos, buf, fl, v));
367 }
368
369
370 static int
371 args(struct mdoc *m, int line, int *pos,
372 char *buf, int fl, char **v)
373 {
374 int i;
375 char *p, *pp;
376
377 /*
378 * Parse out the terms (like `val' in `.Xx -arg val' or simply
379 * `.Xx val'), which can have all sorts of properties:
380 *
381 * ARGS_DELIM: use special handling if encountering trailing
382 * delimiters in the form of [[::delim::][ ]+]+.
383 *
384 * ARGS_NOWARN: don't post warnings. This is only used when
385 * re-parsing delimiters, as the warnings have already been
386 * posted.
387 *
388 * ARGS_TABSEP: use special handling for tab/`Ta' separated
389 * phrases like in `Bl -column'.
390 */
391
392 assert(*pos);
393 assert(' ' != buf[*pos]);
394
395 if (0 == buf[*pos])
396 return(ARGS_EOLN);
397
398 /*
399 * If the first character is a delimiter and we're to look for
400 * delimited strings, then pass down the buffer seeing if it
401 * follows the pattern of [[::delim::][ ]+]+.
402 */
403
404 if ((fl & ARGS_DELIM) && mdoc_iscdelim(buf[*pos])) {
405 for (i = *pos; buf[i]; ) {
406 if ( ! mdoc_iscdelim(buf[i]))
407 break;
408 i++;
409 if (0 == buf[i] || ' ' != buf[i])
410 break;
411 i++;
412 while (buf[i] && ' ' == buf[i])
413 i++;
414 }
415
416 if (0 == buf[i]) {
417 *v = &buf[*pos];
418 if (' ' != buf[i - 1])
419 return(ARGS_PUNCT);
420 if (ARGS_NOWARN & fl)
421 return(ARGS_PUNCT);
422 if ( ! mdoc_pwarn(m, line, *pos, ETAILWS))
423 return(ARGS_ERROR);
424 return(ARGS_PUNCT);
425 }
426 }
427
428 *v = &buf[*pos];
429
430 /*
431 * First handle TABSEP items, restricted to `Bl -column'. This
432 * ignores conventional token parsing and instead uses tabs or
433 * `Ta' macros to separate phrases. Phrases are parsed again
434 * for arguments at a later phase.
435 */
436
437 if (ARGS_TABSEP & fl) {
438 /* Scan ahead to tab (can't be escaped). */
439 p = strchr(*v, '\t');
440
441 /* Scan ahead to unescaped `Ta'. */
442 for (pp = *v; ; pp++) {
443 if (NULL == (pp = strstr(pp, "Ta")))
444 break;
445 if (pp > *v && ' ' != *(pp - 1))
446 continue;
447 if (' ' == *(pp + 2) || 0 == *(pp + 2))
448 break;
449 }
450
451 /*
452 * Adjust new-buffer position to be beyond delimiter
453 * mark (e.g., Ta -> end + 2).
454 */
455 if (p && pp) {
456 *pos += pp < p ? 2 : 1;
457 p = pp < p ? pp : p;
458 } else if (p && ! pp) {
459 *pos += 1;
460 } else if (pp && ! p) {
461 p = pp;
462 *pos += 2;
463 } else
464 p = strchr(*v, 0);
465
466 /* Whitespace check for eoln case... */
467 if (0 == *p && ' ' == *(p - 1) && ! (ARGS_NOWARN & fl))
468 if ( ! mdoc_pwarn(m, line, *pos, ETAILWS))
469 return(ARGS_ERROR);
470
471 *pos += (int)(p - *v);
472
473 /* Strip delimiter's preceding whitespace. */
474 pp = p - 1;
475 while (pp > *v && ' ' == *pp) {
476 if (pp > *v && '\\' == *(pp - 1))
477 break;
478 pp--;
479 }
480 *(pp + 1) = 0;
481
482 /* Strip delimiter's proceeding whitespace. */
483 for (pp = &buf[*pos]; ' ' == *pp; pp++, (*pos)++)
484 /* Skip ahead. */ ;
485
486 return(ARGS_PHRASE);
487 }
488
489 /*
490 * Process a quoted literal. A quote begins with a double-quote
491 * and ends with a double-quote NOT preceded by a double-quote.
492 * Whitespace is NOT involved in literal termination.
493 */
494
495 if ('\"' == buf[*pos]) {
496 *v = &buf[++(*pos)];
497
498 for ( ; buf[*pos]; (*pos)++) {
499 if ('\"' != buf[*pos])
500 continue;
501 if ('\"' != buf[*pos + 1])
502 break;
503 (*pos)++;
504 }
505
506 if (0 == buf[*pos]) {
507 if (ARGS_NOWARN & fl)
508 return(ARGS_QWORD);
509 if ( ! mdoc_pwarn(m, line, *pos, EQUOTTERM))
510 return(ARGS_ERROR);
511 return(ARGS_QWORD);
512 }
513
514 buf[(*pos)++] = 0;
515
516 if (0 == buf[*pos])
517 return(ARGS_QWORD);
518
519 while (' ' == buf[*pos])
520 (*pos)++;
521
522 if (0 == buf[*pos] && ! (ARGS_NOWARN & fl))
523 if ( ! mdoc_pwarn(m, line, *pos, ETAILWS))
524 return(ARGS_ERROR);
525
526 return(ARGS_QWORD);
527 }
528
529 /*
530 * A non-quoted term progresses until either the end of line or
531 * a non-escaped whitespace.
532 */
533
534 for ( ; buf[*pos]; (*pos)++)
535 if (' ' == buf[*pos] && '\\' != buf[*pos - 1])
536 break;
537
538 if (0 == buf[*pos])
539 return(ARGS_WORD);
540
541 buf[(*pos)++] = 0;
542
543 while (' ' == buf[*pos])
544 (*pos)++;
545
546 if (0 == buf[*pos] && ! (ARGS_NOWARN & fl))
547 if ( ! mdoc_pwarn(m, line, *pos, ETAILWS))
548 return(ARGS_ERROR);
549
550 return(ARGS_WORD);
551 }
552
553
554 static int
555 argv_a2arg(int tok, const char *p)
556 {
557
558 /*
559 * Parse an argument identifier from its text. XXX - this
560 * should really be table-driven to clarify the code.
561 *
562 * If you add an argument to the list, make sure that you
563 * register it here with its one or more macros!
564 */
565
566 switch (tok) {
567 case (MDOC_An):
568 if (0 == strcmp(p, "split"))
569 return(MDOC_Split);
570 else if (0 == strcmp(p, "nosplit"))
571 return(MDOC_Nosplit);
572 break;
573
574 case (MDOC_Bd):
575 if (0 == strcmp(p, "ragged"))
576 return(MDOC_Ragged);
577 else if (0 == strcmp(p, "unfilled"))
578 return(MDOC_Unfilled);
579 else if (0 == strcmp(p, "filled"))
580 return(MDOC_Filled);
581 else if (0 == strcmp(p, "literal"))
582 return(MDOC_Literal);
583 else if (0 == strcmp(p, "file"))
584 return(MDOC_File);
585 else if (0 == strcmp(p, "offset"))
586 return(MDOC_Offset);
587 else if (0 == strcmp(p, "compact"))
588 return(MDOC_Compact);
589 else if (0 == strcmp(p, "centered"))
590 return(MDOC_Centred);
591 break;
592
593 case (MDOC_Bf):
594 if (0 == strcmp(p, "emphasis"))
595 return(MDOC_Emphasis);
596 else if (0 == strcmp(p, "literal"))
597 return(MDOC_Literal);
598 else if (0 == strcmp(p, "symbolic"))
599 return(MDOC_Symbolic);
600 break;
601
602 case (MDOC_Bk):
603 if (0 == strcmp(p, "words"))
604 return(MDOC_Words);
605 break;
606
607 case (MDOC_Bl):
608 if (0 == strcmp(p, "bullet"))
609 return(MDOC_Bullet);
610 else if (0 == strcmp(p, "dash"))
611 return(MDOC_Dash);
612 else if (0 == strcmp(p, "hyphen"))
613 return(MDOC_Hyphen);
614 else if (0 == strcmp(p, "item"))
615 return(MDOC_Item);
616 else if (0 == strcmp(p, "enum"))
617 return(MDOC_Enum);
618 else if (0 == strcmp(p, "tag"))
619 return(MDOC_Tag);
620 else if (0 == strcmp(p, "diag"))
621 return(MDOC_Diag);
622 else if (0 == strcmp(p, "hang"))
623 return(MDOC_Hang);
624 else if (0 == strcmp(p, "ohang"))
625 return(MDOC_Ohang);
626 else if (0 == strcmp(p, "inset"))
627 return(MDOC_Inset);
628 else if (0 == strcmp(p, "column"))
629 return(MDOC_Column);
630 else if (0 == strcmp(p, "width"))
631 return(MDOC_Width);
632 else if (0 == strcmp(p, "offset"))
633 return(MDOC_Offset);
634 else if (0 == strcmp(p, "compact"))
635 return(MDOC_Compact);
636 else if (0 == strcmp(p, "nested"))
637 return(MDOC_Nested);
638 break;
639
640 case (MDOC_Rv):
641 /* FALLTHROUGH */
642 case (MDOC_Ex):
643 if (0 == strcmp(p, "std"))
644 return(MDOC_Std);
645 break;
646 default:
647 break;
648 }
649
650 return(MDOC_ARG_MAX);
651 }
652
653
654 static int
655 argv_multi(struct mdoc *m, int line,
656 struct mdoc_argv *v, int *pos, char *buf)
657 {
658 int c;
659 char *p;
660
661 for (v->sz = 0; ; v->sz++) {
662 if ('-' == buf[*pos])
663 break;
664 c = args(m, line, pos, buf, 0, &p);
665 if (ARGS_ERROR == c)
666 return(0);
667 else if (ARGS_EOLN == c)
668 break;
669
670 if (0 == v->sz % MULTI_STEP)
671 v->value = mandoc_realloc(v->value,
672 (v->sz + MULTI_STEP) * sizeof(char *));
673
674 v->value[(int)v->sz] = mandoc_strdup(p);
675 }
676
677 return(1);
678 }
679
680
681 static int
682 argv_opt_single(struct mdoc *m, int line,
683 struct mdoc_argv *v, int *pos, char *buf)
684 {
685 int c;
686 char *p;
687
688 if ('-' == buf[*pos])
689 return(1);
690
691 c = args(m, line, pos, buf, 0, &p);
692 if (ARGS_ERROR == c)
693 return(0);
694 if (ARGS_EOLN == c)
695 return(1);
696
697 v->sz = 1;
698 v->value = mandoc_malloc(sizeof(char *));
699 v->value[0] = mandoc_strdup(p);
700
701 return(1);
702 }
703
704
705 /*
706 * Parse a single, mandatory value from the stream.
707 */
708 static int
709 argv_single(struct mdoc *m, int line,
710 struct mdoc_argv *v, int *pos, char *buf)
711 {
712 int c, ppos;
713 char *p;
714
715 ppos = *pos;
716
717 c = args(m, line, pos, buf, 0, &p);
718 if (ARGS_ERROR == c)
719 return(0);
720 if (ARGS_EOLN == c)
721 return(mdoc_perr(m, line, ppos, EARGVAL));
722
723 v->sz = 1;
724 v->value = mandoc_malloc(sizeof(char *));
725 v->value[0] = mandoc_strdup(p);
726
727 return(1);
728 }
729
730
731 /*
732 * Determine rules for parsing arguments. Arguments can either accept
733 * no parameters, an optional single parameter, one parameter, or
734 * multiple parameters.
735 */
736 static int
737 argv(struct mdoc *mdoc, int line,
738 struct mdoc_argv *v, int *pos, char *buf)
739 {
740
741 v->sz = 0;
742 v->value = NULL;
743
744 switch (mdoc_argvflags[v->arg]) {
745 case (ARGV_SINGLE):
746 return(argv_single(mdoc, line, v, pos, buf));
747 case (ARGV_MULTI):
748 return(argv_multi(mdoc, line, v, pos, buf));
749 case (ARGV_OPT_SINGLE):
750 return(argv_opt_single(mdoc, line, v, pos, buf));
751 default:
752 /* ARGV_NONE */
753 break;
754 }
755
756 return(1);
757 }