=================================================================== RCS file: /cvs/docbook2mdoc/statistics.c,v retrieving revision 1.4 retrieving revision 1.21 diff -u -p -r1.4 -r1.21 --- docbook2mdoc/statistics.c 2019/04/03 09:49:49 1.4 +++ docbook2mdoc/statistics.c 2019/04/13 13:06:35 1.21 @@ -1,4 +1,4 @@ -/* $Id: statistics.c,v 1.4 2019/04/03 09:49:49 schwarze Exp $ */ +/* $Id: statistics.c,v 1.21 2019/04/13 13:06:35 schwarze Exp $ */ /* * Copyright (c) 2019 Ingo Schwarze * @@ -225,13 +225,15 @@ parse_file(int fd, char *fname) continue; } if (in_arg) { - if (in_quotes == 0 && b[pend] == '"') { - in_quotes = 1; + if (in_quotes == 0 && + (b[pend] == '\'' || b[pend] == '"')) { + in_quotes = b[pend] == '"' ? 2 : 1; pend++; continue; } if (advance(b, rlen, &pend, - in_quotes ? "\"" : " >") && rsz > 0) + in_quotes == 2 ? "\"" : + in_quotes == 1 ? "'" : " >") && rsz > 0) break; in_arg = in_quotes = elem_end = 0; if (b[pend] == '>') { @@ -346,7 +348,114 @@ main(int argc, char *argv[]) /* Exclude relations that are already fully implemented. */ if (show_all == 0) { + table_add("ROOT", "refentry"); + table_add("acronym", "TEXT"); + table_add("appendix", NULL); + table_add("article", NULL); + table_add("articleinfo", "pubdate"); + table_add("articleinfo", "title"); + table_add("author", "contrib"); + table_add("author", "email"); + table_add("author", "firstname"); + table_add("author", "othername"); + table_add("author", "surname"); + table_add("blockquote", NULL); + table_add("book", NULL); + table_add("bookinfo", "pubdate"); + table_add("bookinfo", "title"); + table_add("chapter", NULL); + table_add("code", "TEXT"); + table_add("computeroutput", "TEXT"); + table_add("constant", "TEXT"); + table_add("date", "TEXT"); + table_add("emphasis", "TEXT"); + table_add("entry", NULL); + table_add("errorname", "TEXT"); + table_add("filename", "TEXT"); + table_add("funcdef", "function"); + table_add("funcdef", "TEXT"); + table_add("funcprototype", "funcdef"); + table_add("funcprototype", "paramdef"); + table_add("funcsynopsis", "funcprototype"); + table_add("funcsynopsis", "funcsynopsisinfo"); + table_add("funcsynopsisinfo", "TEXT"); + table_add("function", "TEXT"); + table_add("glossary", "glossdiv"); + table_add("glossary", "glossentry"); + table_add("glossdef", "para"); + table_add("glossdiv", "glossentry"); + table_add("glossentry", "glossdef"); + table_add("glossentry", "glossterm"); + table_add("glossentry", "indexterm"); + table_add("glosslist", "glossentry"); + table_add("glossterm", "TEXT"); + table_add("indexterm", "primary"); + table_add("indexterm", "secondary"); + table_add("informaltable", "tgroup"); + table_add("itemizedlist", "listitem"); + table_add("legalnotice", NULL); + table_add("link", NULL); + table_add("listitem", NULL); + table_add("literal", "TEXT"); + table_add("literallayout", NULL); + table_add("markup", "TEXT"); + table_add("member", "TEXT"); + table_add("note", NULL); + table_add("orderedlist", "listitem"); + table_add("othercredit", "contrib"); + table_add("othercredit", "email"); + table_add("othercredit", "firstname"); + table_add("othercredit", "othername"); + table_add("othercredit", "surname"); table_add("para", NULL); + table_add("paramdef", "parameter"); + table_add("paramdef", "TEXT"); + table_add("parameter", "TEXT"); + table_add("primary", NULL); + table_add("programlisting", NULL); + table_add("pubdate", "TEXT"); + table_add("refentry", "refmeta"); + table_add("refentry", "refnamediv"); + table_add("refentry", "refsect1"); + table_add("refentry", "refsynopsisdiv"); + table_add("refmeta", "manvolnum"); + table_add("refmeta", "refentrytitle"); + table_add("refname", "TEXT"); + table_add("refnamediv", "refname"); + table_add("refnamediv", "refpurpose"); + table_add("refpurpose", "TEXT"); + table_add("refsect1", NULL); + table_add("refsect2", NULL); + table_add("refsynopsisdiv", "funcsynopsis"); + table_add("row", "entry"); + table_add("screen", NULL); + table_add("secondary", NULL); + table_add("section", NULL); + table_add("sect1", NULL); + table_add("sect2", NULL); + table_add("sect3", NULL); + table_add("sect4", NULL); + table_add("sgmltag", "TEXT"); + table_add("simpara", NULL); + table_add("simplelist", "member"); + table_add("structfield", "TEXT"); + table_add("structname", "TEXT"); + table_add("symbol", "TEXT"); + table_add("table", "tgroup"); + table_add("table", "title"); + table_add("tbody", "row"); + table_add("term", NULL); + table_add("tgroup", "colspec"); + table_add("tgroup", "tbody"); + table_add("tgroup", "thead"); + table_add("thead", "row"); + table_add("title", "TEXT"); + table_add("type", "TEXT"); + table_add("ulink", NULL); + table_add("userinput", "TEXT"); + table_add("variablelist", "varlistentry"); + table_add("varlistentry", "listitem"); + table_add("varlistentry", "term"); } table_add(NULL, NULL);