-/* $Id: mdoc_argv.c,v 1.2 2009/03/31 13:50:19 kristaps Exp $ */
+/* $Id: mdoc_argv.c,v 1.8 2009/06/17 14:10:09 kristaps Exp $ */
/*
- * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@openbsd.org>
+ * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
* Permission to use, copy, modify, and distribute this software for any
- * purpose with or without fee is hereby granted, provided that the
- * above copyright notice and this permission notice appear in all
- * copies.
+ * purpose with or without fee is hereby granted, provided that the above
+ * copyright notice and this permission notice appear in all copies.
*
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
- * WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
- * AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
- * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
- * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
- * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- * PERFORMANCE OF THIS SOFTWARE.
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include <sys/types.h>
* There's no limit to the number or arguments that may be allocated.
*/
+/* FIXME .Bf Li raises "macro-like parameter". */
+/* FIXME .Bl -column should deprecate old-groff syntax. */
+
#define ARGS_QUOTED (1 << 0)
#define ARGS_DELIM (1 << 1)
#define ARGS_TABSEP (1 << 2)
};
static int mdoc_argflags[MDOC_MAX] = {
- 0, /* \" */
+ 0, /* Ap */
0, /* Dd */
0, /* Dt */
0, /* Os */
ARGS_DELIM | ARGS_QUOTED, /* Dl */
0, /* Bd */
0, /* Ed */
- 0, /* Bl */
+ ARGS_QUOTED, /* Bl */
0, /* El */
0, /* It */
ARGS_DELIM, /* Ad */
0, /* Fr */
0, /* Ud */
0, /* Lb */
- 0, /* Ap */
ARGS_DELIM, /* Lp */
ARGS_DELIM | ARGS_QUOTED, /* Lk */
ARGS_DELIM | ARGS_QUOTED, /* Mt */
argv_multi(struct mdoc *mdoc, int line,
struct mdoc_argv *v, int *pos, char *buf)
{
- int c, ppos;
+ int c;
char *p;
- ppos = *pos;
-
for (v->sz = 0; ; v->sz++) {
if ('-' == buf[*pos])
break;
return(verr(mdoc, EMALLOC));
}
- if (v->sz)
- return(1);
-
- return(perr(mdoc, line, ppos, EARGVAL));
+ return(1);
}