- /* $Id: mdoctree.c,v 1.5 2009/03/06 14:13:47 kristaps Exp $ */
+ /* $Id: mdoctree.c,v 1.6 2009/03/08 14:01:46 kristaps Exp $ */
/*
* Copyright (c) 2008 Kristaps Dzonsons <kristaps@kth.se>
*
int i, j;
size_t argc, sz;
char **params;
- struct mdoc_arg *argv;
+ struct mdoc_argv *argv;
argv = NULL;
argc = sz = 0;
switch (n->type) {
case (MDOC_TEXT):
- p = n->data.text.string;
+ p = n->string;
break;
case (MDOC_BODY):
p = mdoc_macronames[n->tok];
break;
case (MDOC_ELEM):
p = mdoc_macronames[n->tok];
- argv = n->data.elem.argv;
- argc = n->data.elem.argc;
+ if (n->args) {
+ argv = n->args->argv;
+ argc = n->args->argc;
+ }
break;
case (MDOC_BLOCK):
p = mdoc_macronames[n->tok];
- argv = n->data.block.argv;
- argc = n->data.block.argc;
+ if (n->args) {
+ argv = n->args->argv;
+ argc = n->args->argc;
+ }
break;
case (MDOC_ROOT):
p = "root";
-/* $Id: term.c,v 1.45 2009/03/08 13:57:07 kristaps Exp $ */
+/* $Id: term.c,v 1.46 2009/03/08 14:01:46 kristaps Exp $ */
/*
* Copyright (c) 2009 Kristaps Dzonsons <kristaps@kth.se>
*
assert(MDOC_BLOCK == n->type);
- len = n->args ? n->args->argc : 0;
+ len = (int)(n->args ? n->args->argc : 0);
for (i = 0; i < len; i++)
switch (n->args->argv[i].arg) {