summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2011-10-27 18:00:16 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2011-10-27 18:00:16 (GMT)
commit8491e9fbd06ef8a8f1cc542a524c673d7781d4b6 (patch)
tree7c1bfd20df6135fa1aac607ebe1a46d31d7f4b65 /src
parent3af6ff4c3d2748b45f468695a3db9f26eef4e630 (diff)
downloadDoxygen-8491e9fbd06ef8a8f1cc542a524c673d7781d4b6.zip
Doxygen-8491e9fbd06ef8a8f1cc542a524c673d7781d4b6.tar.gz
Doxygen-8491e9fbd06ef8a8f1cc542a524c673d7781d4b6.tar.bz2
Release-1.7.5.1-20111027
Diffstat (limited to 'src')
-rw-r--r--src/bib2xhtml.h290
-rwxr-xr-xsrc/bib2xhtml.pl290
-rw-r--r--src/cite.cpp343
-rw-r--r--src/cite.h16
-rw-r--r--src/classdef.cpp76
-rw-r--r--src/classdef.h5
-rw-r--r--src/code.l36
-rw-r--r--src/commentscan.l3
-rw-r--r--src/config.xml17
-rw-r--r--src/configoptions.cpp23
-rw-r--r--src/definition.h3
-rw-r--r--src/dirdef.h9
-rw-r--r--src/docparser.cpp21
-rw-r--r--src/doctokenizer.l8
-rw-r--r--src/doxygen.bst760
-rw-r--r--src/doxygen.cpp32
-rw-r--r--src/doxygen.h1
-rw-r--r--src/doxygen_bst.h760
-rw-r--r--src/filedef.cpp8
-rw-r--r--src/filedef.h6
-rw-r--r--src/fortranscanner.l14
-rw-r--r--src/groupdef.h1
-rw-r--r--src/htmldocvisitor.cpp19
-rw-r--r--src/index.cpp130
-rw-r--r--src/latexdocvisitor.cpp5
-rw-r--r--src/latexgen.cpp27
-rw-r--r--src/libdoxygen.pro.in1
-rw-r--r--src/libdoxygen.t4
-rw-r--r--src/memberdef.cpp5
-rw-r--r--src/namespacedef.h1
-rw-r--r--src/pagedef.h1
-rw-r--r--src/portable.cpp8
-rw-r--r--src/pre.h1
-rw-r--r--src/pre.l293
-rw-r--r--src/pycode.l3
-rw-r--r--src/rtfdocvisitor.cpp2
-rw-r--r--src/scanner.l38
-rw-r--r--src/util.cpp167
-rw-r--r--src/util.h2
-rw-r--r--src/xmlgen.cpp37
40 files changed, 2098 insertions, 1368 deletions
diff --git a/src/bib2xhtml.h b/src/bib2xhtml.h
new file mode 100644
index 0000000..65e4ed4
--- /dev/null
+++ b/src/bib2xhtml.h
@@ -0,0 +1,290 @@
+"#\n"
+"# Below is a stripped down version of bib2xhtml used by doxygen.\n"
+"# For the full version see http://www.spinellis.gr/sw/textproc/bib2xhtml/\n"
+"#\n"
+"# Convert from bibtex to XHTML.\n"
+"#\n"
+"# (C) Copyright 1995, 1996 David Hull.\n"
+"# (David Hull / hull@cs.uiuc.edu / http://www.uiuc.edu/ph/www/dlhull)\n"
+"#\n"
+"# (C) Copyright 2002-2010 Diomidis Spinellis\n"
+"# http://www.spinellis.gr\n"
+"#\n"
+"# This program is free software. You can redistribute it and/or modify\n"
+"# it under the terms of the GNU General Public License. See the\n"
+"# files README and COPYING for details.\n"
+"#\n"
+"# This source code contains UTF-8 characters. You might want to use\n"
+"# an appropriate editor, if you want to view/modify the LaTeX to Unicode\n"
+"# substitution commands.\n"
+"#\n"
+"\n"
+"use Getopt::Std;\n"
+"use open IO => ':crlf';\n"
+"$label_styles{'numbered'} = $LABEL_NUMBERED = 2;\n"
+"$list_start[$LABEL_NUMBERED] = 'dl class=\"citelist\"';\n"
+"$list_end[$LABEL_NUMBERED] = \"/dl\";\n"
+"@tmpfiles = ();\n"
+"sub html_ent {\n"
+" s/\\\\i\\b/i/g;\n"
+" s/\\\\\\'(\\001\\d+)\\{([AEIOUaeiou])\\1\\}/&$2acute;/gs;\n"
+" s/\\\\\\'([AEIOUaeiou])/&$1acute;/g;\n"
+" s/\\\\\\`(\\001\\d+)\\{([AEIOUaeiou])\\1\\}/&$2grave;/gs;\n"
+" s/\\\\\\`([AEIOUaeiou])/&$1grave;/g;\n"
+" s/\\\\\\\"(\\001\\d+)\\{([AEIOUaeiouy])\\1\\}/&$2uml;/gs;\n"
+" s/\\\\\\\"([AEIOUaeiouy])/&$1uml;/g;\n"
+" s/\\\\\\~(\\001\\d+)\\{([ANOano])\\1\\}/&$2tilde;/gs;\n"
+" s/\\\\\\~([ANOano])/&$1tilde;/g;\n"
+" s/\\\\\\^(\\001\\d+)\\{([AEIOUaeiou])\\1\\}/&$2circ;/gs;\n"
+" s/\\\\\\^([AEIOUaeiou])/&$1circ;/g;\n"
+" s/\\\\c(\\001\\d+)\\{([Cc])\\1\\}/&$2cedil;/gs;\n"
+" s/\\\\u(\\001\\d+)\\{(.)\\1\\}/$2/gs;\n"
+" s/\\\\v(\\001\\d+)\\{(.)\\1\\}/$2/gs;\n"
+" s/\\\\([lL])\\b/$1/g;\n"
+" s/\\\\\\=(\\001\\d+)\\{(.)\\1\\}/$2/gs;\n"
+" s/\\\\\\=(.)/$1/g;\n"
+" s/\\\\\\.(\\001\\d+)\\{(.)\\1\\}/$2/gs;\n"
+" s/\\\\\\.(.)/$1/g;\n"
+" s/\\\\([Oo])\\b\\s*/&$1slash;/g;\n"
+" s/\\\\AA\\b\\s*/&Aring;/g;\n"
+" s/\\\\aa\\b\\s*/&aring;/g;\n"
+" s/\\\\AE\\b\\s*/&AElig;/g;\n"
+" s/\\\\ae\\b\\s*/&aelig;/g;\n"
+" s/\\\\ss\\b\\s*/&szlig;/g;\n"
+" s/\\\\S\\b\\s*/&sect;/g;\n"
+" s/\\\\P\\b\\s*/&para;/g;\n"
+" s/\\\\pounds\\b\\s*/&pound;/g;\n"
+" s/\\?\\`/&iquest;/g;\n"
+" s/\\!\\`/&iexcl;/g;\n"
+" s/\\-\\-\\-/&mdash;/g;\n"
+" s/([^\\!])\\-\\-([^\\>])/$1&ndash;$2/g;\n"
+" s/\\\\([aA]lpha)\\b/&$1;/g;\n"
+" s/\\\\([bB]eta)\\b/&$1;/g;\n"
+" s/\\\\([gG]amma)\\b/&$1;/g;\n"
+" s/\\\\([dD]elta)\\b/&$1;/g;\n"
+" s/\\\\varepsilon\\b/&epsilon;/g;\n"
+" s/\\\\([eE]psilon)\\b/&$1;/g;\n"
+" s/\\\\([zZ]eta)\\b/&$1;/g;\n"
+" s/\\\\([eE]ta)\\b/&$1;/g;\n"
+" s/\\\\([tT]heta)\\b/&$1;/g;\n"
+" s/\\\\vartheta\\b/&theta;/g;\n"
+" s/\\\\([iI]ota)\\b/&$1;/g;\n"
+" s/\\\\([kK]appa)\\b/&$1;/g;\n"
+" s/\\\\([lL]ambda)\\b/&$1;/g;\n"
+" s/\\\\([mM]u)\\b/&$1;/g;\n"
+" s/\\\\([nN]u)\\b/&$1;/g;\n"
+" s/\\\\([xX]i)\\b/&$1;/g;\n"
+" s/\\\\([oO]micron)\\b/&$1;/g;\n"
+" s/\\\\([pP]i)\\b/&$1;/g;\n"
+" s/\\\\varpi\\b/&pi;/g;\n"
+" s/\\\\([rR]ho)\\b/&$1;/g;\n"
+" s/\\\\varrho\\b/&rho;/g;\n"
+" s/\\\\([sS]igma)\\b/&$1;/g;\n"
+" s/\\\\varsigma\\b/&sigmaf;/g;\n"
+" s/\\\\([tT]au)\\b/&$1;/g;\n"
+" s/\\\\([uU]psilon)\\b/&$1;/g;\n"
+" s/\\\\([pP]hi)\\b/&$1;/g;\n"
+" s/\\\\varphi\\b/&phi;/g;\n"
+" s/\\\\([cC]hi)\\b/&$1;/g;\n"
+" s/\\\\([pP]si)\\b/&$1;/g;\n"
+" s/\\\\([oO]mega)\\b/&$1;/g;\n"
+"}\n"
+"foreach (@ARGV) {\n"
+" if (/\\.bib$/) {\n"
+" $bibfile = $_;\n"
+" $bibfile =~ s/\\.bib$//;\n"
+" push(@bibfiles,$bibfile);\n"
+" } else {\n"
+" $htmlfile = $_;\n"
+" }\n"
+"}\n"
+"exit(1) unless defined($htmlfile);\n"
+"$bibdatacmd=\"\\\\bibdata{\".join(',',@bibfiles).\"}\";\n"
+"$label_style = $LABEL_NUMBERED;\n"
+"$bstfile = \"doxygen\";\n"
+"umask(077);\n"
+"open(HTMLFILE,\">$htmlfile$$\");\n"
+"if (open(OHTMLFILE, \"$htmlfile\")) {\n"
+" $mode = (stat OHTMLFILE)[2] & 0xfff;\n"
+"} else {\n"
+" print \"Error opening $htmlfile\\n\";\n"
+" exit(1);\n"
+"}\n"
+"$beginstring = \"<!-- BEGIN CITATIONS -->\";\n"
+"$endstring = \"<!-- END CITATIONS -->\";\n"
+"@citations = ();\n"
+"loop:\n"
+"while (<OHTMLFILE>) {\n"
+" print HTMLFILE;\n"
+" last loop if m/^$beginstring$/;\n"
+"}\n"
+"loop:\n"
+"while (<OHTMLFILE>) {\n"
+" print HTMLFILE;\n"
+" last loop if m/^$endstring$/;\n"
+" push(@citations, $2) if m/^([^\\\\]*)?(.+\\})(.*)?$/;\n"
+"}\n"
+"push(@citations, $bibdatacmd);\n"
+"$auxfile = \"bib$$\";\n"
+"push(@tmpfiles, \"$auxfile.aux\");\n"
+"open(AUXFILE, \">$auxfile\" . \".aux\");\n"
+"print AUXFILE \"\\\\relax\\n\\\\bibstyle{$bstfile}\\n\";\n"
+"foreach $citation (@citations) {\n"
+" print AUXFILE \"$citation\\n\";\n"
+"}\n"
+"close(AUXFILE);\n"
+"push(@tmpfiles, \"$auxfile.blg\");\n"
+"push(@tmpfiles, \"$auxfile.bbl\");\n"
+"`bibtex $auxfile 2>&1`;\n"
+"if ($?==-1)\n"
+"{\n"
+" print \"bibtex command failed: $!\\n\";\n"
+"}\n"
+"$beginstring = \"<!-- BEGIN BIBLIOGRAPHY -->\";\n"
+"$endstring = \"<!-- END BIBLIOGRAPHY -->\";\n"
+"loop:\n"
+"while (<OHTMLFILE>) {\n"
+" last loop if m/^$beginstring$/;\n"
+" print HTMLFILE;\n"
+"}\n"
+"loop:\n"
+"while (<OHTMLFILE>) {\n"
+" last loop if m/^$endstring$/;\n"
+"}\n"
+"print HTMLFILE \"$beginstring\\n\";\n"
+"$t = $auxfile . \".bbl\";\n"
+"$/ = \"\";\n"
+"open(BBLFILE, \"<$t\") || die \"error opening $t: $!\\n\";\n"
+"$nentry = 0;\n"
+"loop:\n"
+"while (<BBLFILE>) {\n"
+" if (($nentry == 0) && (m/^#/)) {\n"
+" if ((m/#\\s*label-style:\\s*(\\S+)/) && (! defined $label_style)) {\n"
+" $label_style = $label_styles{$1};\n"
+" if (! defined $label_style) {\n"
+" print STDERR \"label style unknown: \\n\";\n"
+" next loop;\n"
+" }\n"
+" }\n"
+" next loop;\n"
+" }\n"
+" $nentry++;\n"
+" ($bcite, $blabel) = m+<dt><a name=\\\"([^\\\"]*)\\\">\\[([^\\]]*)\\]</a></dt><dd>+;\n"
+" $blabel = \"$nentry\";\n"
+" $bibcite{$bcite} = $blabel;\n"
+"}\n"
+"close(BBLFILE);\n"
+"$label_style = $LABEL_DEFAULT if (! defined $label_style);\n"
+"$list_start = $list_start[$label_style];\n"
+"$list_end = $list_end[$label_style];\n"
+"print HTMLFILE \"<$list_start>\\n\\n\";\n"
+"open(BBLFILE, \"<$t\") || die \"error opening $t: $!\\n\";\n"
+"$nentry = 0;\n"
+"loop:\n"
+"while (<BBLFILE>) {\n"
+" next loop if (($nentry == 0) && (m/^#/));\n"
+" $nentry++;\n"
+" s/\\\\\\{/\\002/g;\n"
+" s/\\\\\\}/\\003/g;\n"
+" s/\\\\\\$/\\004/g;\n"
+" {\n"
+" local ($c, $l, $z) = (0, 0, ());\n"
+" s/([\\{\\}])/join(\"\",\"\\001\",($1 eq \"\\{\" ? $z[$l++]=$c++ : $z[--$l]),$1)/ge;\n"
+" }\n"
+" s/\\%\\n//g;\n"
+" s/(\\.(<\\/cite>|<\\/a>|\\')+)\\./$1/g;\n"
+" s:(<dt><a name=\\\"[^\\\"]*\\\">\\[)[^\\]]*(\\]</a></dt><dd>):$1$nentry$2:;\n"
+" while (m/(\\\\(cite(label)?)(\\001\\d+)\\{([^\\001]+)\\4\\})/) {\n"
+" $old = $1;\n"
+" $cmd = $2;\n"
+" $doxref = defined($3);\n"
+" $bcite = $5;\n"
+" if (! defined $bibcite{$bcite}) {\n"
+" $blabel = \" [\" . $bcite . \"]\";\n"
+" } elsif ($doxref) {\n"
+" $blabel = \" <a href=\\\"#$bcite\\\">[\" . $bibcite{$bcite} . \"]<\\/a>\";\n"
+" } else {\n"
+" $blabel = \" [\" . $bibcite{$bcite} . \"]\";\n"
+" }\n"
+" $old =~ s/(\\W)/\\\\$1/g;\n"
+" s/\\s*$old/$blabel/g;\n"
+" }\n"
+" s/In (<a href=\\\"[^\\\"]*\\\">)([^\\[]+) \\[(\\2)/In $1\\[$2/;\n"
+" s/\\\\htmladdnormallink(foot)?(\\001\\d+)\\{([^\\001]+)\\2\\}(\\001\\d+)\\{([^\\001]+)\\4\\}/<a href=\"$5\">$3<\\/a>/gs;\n"
+" s/\\&amp;/\\005/g;\n"
+" s/\\\\?&/&amp;/g;\n"
+" s/\\005/&amp;/g;\n"
+" html_ent();\n"
+" while (m/\\\\char([\\'\\\"]?[0-9a-fA-F]+)/) {\n"
+" $o = $r = $1;\n"
+" if ($r =~ s/^\\'//) {\n"
+" $r = oct($r);\n"
+" } elsif ($r =~ s/^\\\"//) {\n"
+" $r = hex($r);\n"
+" }\n"
+" s/\\\\char$o\\s*/&#$r;/g;\n"
+" }\n"
+" s/{\\\\etalchar\\001(\\d+)\\{(.)}\\001\\1\\}/$2/g;\n"
+" s/\\\\par\\b/<p \\/>/g;\n"
+" s/\\\\url(\\001\\d+)\\{(.*)\\1\\}/<a href=\"$2\">$2<\\/a>/gs;\n"
+" s/\\\\href(\\001\\d+)\\{(.*)\\1\\}(\\001\\d+)\\{([^\\001]*)\\3\\}/<a href=\"$2\">$4<\\/a>/gs;\n"
+" s/\\\\href(\\001\\d+)\\{(.*)\\1\\}/<a href=\"$2\">$2<\\/a>/gs;\n"
+" s/(\\001\\d+)\\{\\\\rm\\s+(.*)\\1\\}/$2/gs;\n"
+" s/\\\\textrm(\\001\\d+)\\{(.*)\\1\\}/$2/gs;\n"
+" s/(\\001\\d+)\\{\\\\em\\s+(.*)\\1\\}/<em>$2<\\/em>/gs;\n"
+" s/(\\001\\d+)\\{\\\\it\\s+(.*)\\1\\}/<i>$2<\\/i>/gs;\n"
+" s/(\\001\\d+)\\{\\\\bf\\s+(.*)\\1\\}/<b>$2<\\/b>/gs;\n"
+" s/(\\001\\d+)\\{\\\\tt\\s+(.*)\\1\\}/<tt>$2<\\/tt>/gs;\n"
+" s/\\\\emph(\\001\\d+)\\{(.*)\\1\\}/<em>$2<\\/em>/gs;\n"
+" s/\\\\textit(\\001\\d+)\\{(.*)\\1\\}/<i>$2<\\/i>/gs;\n"
+" s/\\\\textbf(\\001\\d+)\\{(.*)\\1\\}/<b>$2<\\/b>/gs;\n"
+" s/\\\\texttt(\\001\\d+)\\{(.*)\\1\\}/<tt>$2<\\/tt>/gs;\n"
+" s/\\\\mathrm(\\001\\d+)\\{(.*)\\1\\}/$2/gs;\n"
+" s/\\\\mathnormal(\\001\\d+)\\{(.*)\\1\\}/$2/gs;\n"
+" s/\\\\mathsf(\\001\\d+)\\{(.*)\\1\\}/$2/gs;\n"
+" s/\\\\mathbf(\\001\\d+)\\{(.*)\\1\\}/<b>$2<\\/b>/gs;\n"
+" s/\\\\mathcal(\\001\\d+)\\{(.*)\\1\\}/<i>$2<\\/i>/gs;\n"
+" s/\\\\mathit(\\001\\d+)\\{(.*)\\1\\}/<i>$2<\\/i>/gs;\n"
+" s/\\\\mathtt(\\001\\d+)\\{(.*)\\1\\}/<tt>$2<\\/tt>/gs;\n"
+" s/\\\\bibxhtmlname(\\001\\d+)\\{(.*)\\1\\}/$2/ges;\n"
+" sub domath {\n"
+" local($t) = @_;\n"
+" $t =~ s/\\^(\\001\\d+)\\{\\\\circ\\1\\}/\\&\\#176;/gs;\n"
+" $t =~ s/\\^\\\\circ/\\&\\#176;/g;\n"
+" $t =~ s/\\^(\\001\\d+)\\{(.*)\\1\\}/<sup>$2<\\/sup>/gs;\n"
+" $t =~ s/\\^(\\w)/<sup>$1<\\/sup>/g;\n"
+" $t =~ s/\\_(\\001\\d+)\\{(.*)\\1\\}/<sub>$2<\\/sub>/gs;\n"
+" $t =~ s/\\_(\\w)/<sub>$1<\\/sub>/g;\n"
+" $t;\n"
+" }\n"
+" s/(\\$([^\\$]+)\\$)/&domath($2)/ge;\n"
+" s/(\\\\\\((([^\\\\]|\\\\[^\\(\\)])+)\\\\\\))/&domath($2)/ge;\n"
+" s/\\\\mbox(\\001\\d+)\\{(.*)\\1\\}/$2/gs;\n"
+" while (s/(\\<a href\\=\\\"[^\"]*?)\\~/$1\\005/g) { ; }\n"
+" s/([^\\\\])~/$1&nbsp;/g;\n"
+" s/\\\\\\,/&thinsp;/g;\n"
+" s/\\\\ldots\\b/&hellip;/g;\n"
+" s/\\\\dots\\b/&hellip;/g;\n"
+" s/\\005/\\~/g;\n"
+" s/\\\\ / /g;\n"
+" s/\\\\textasciitilde\\b\\s*/~/g;\n"
+" s/\\\\([\\#\\&\\%\\~\\_\\^\\|])/$1/g;\n"
+" s/\\\\\\W//g;\n"
+" s/\\001(\\d+)\\{\\\\[A-Za-z]+\\001(\\d+)\\{([^\\001]*)\\001\\2\\}\\001\\1\\}/$3/g;\n"
+" s/\\\\([A-Za-z]+)/ $1 /g;\n"
+" s+In <a href=\\\"[^\\\"]*\\\"></a>++;\n"
+" s/\\001\\d+[\\{\\}]//gs;\n"
+" tr/\\002\\003\\004/{}$/;\n"
+" print HTMLFILE $_;\n"
+"}\n"
+"close(BBLFILE);\n"
+"print HTMLFILE \"<$list_end>\\n\\n$endstring\\n\";\n"
+"while (<OHTMLFILE>) {\n"
+" print HTMLFILE;\n"
+"}\n"
+"close (OHTMLFILE);\n"
+"close(HTMLFILE);\n"
+"chmod($mode, \"$htmlfile$$\");\n"
+"rename(\"$htmlfile$$\", $htmlfile);\n"
+"unlink(@tmpfiles);\n"
+"exit(0);\n"
diff --git a/src/bib2xhtml.pl b/src/bib2xhtml.pl
new file mode 100755
index 0000000..146435f
--- /dev/null
+++ b/src/bib2xhtml.pl
@@ -0,0 +1,290 @@
+#
+# Below is a stripped down version of bib2xhtml used by doxygen.
+# For the full version see http://www.spinellis.gr/sw/textproc/bib2xhtml/
+#
+# Convert from bibtex to XHTML.
+#
+# (C) Copyright 1995, 1996 David Hull.
+# (David Hull / hull@cs.uiuc.edu / http://www.uiuc.edu/ph/www/dlhull)
+#
+# (C) Copyright 2002-2010 Diomidis Spinellis
+# http://www.spinellis.gr
+#
+# This program is free software. You can redistribute it and/or modify
+# it under the terms of the GNU General Public License. See the
+# files README and COPYING for details.
+#
+# This source code contains UTF-8 characters. You might want to use
+# an appropriate editor, if you want to view/modify the LaTeX to Unicode
+# substitution commands.
+#
+
+use Getopt::Std;
+use open IO => ':crlf';
+$label_styles{'numbered'} = $LABEL_NUMBERED = 2;
+$list_start[$LABEL_NUMBERED] = 'dl class="citelist"';
+$list_end[$LABEL_NUMBERED] = "/dl";
+@tmpfiles = ();
+sub html_ent {
+ s/\\i\b/i/g;
+ s/\\\'(\001\d+)\{([AEIOUaeiou])\1\}/&$2acute;/gs;
+ s/\\\'([AEIOUaeiou])/&$1acute;/g;
+ s/\\\`(\001\d+)\{([AEIOUaeiou])\1\}/&$2grave;/gs;
+ s/\\\`([AEIOUaeiou])/&$1grave;/g;
+ s/\\\"(\001\d+)\{([AEIOUaeiouy])\1\}/&$2uml;/gs;
+ s/\\\"([AEIOUaeiouy])/&$1uml;/g;
+ s/\\\~(\001\d+)\{([ANOano])\1\}/&$2tilde;/gs;
+ s/\\\~([ANOano])/&$1tilde;/g;
+ s/\\\^(\001\d+)\{([AEIOUaeiou])\1\}/&$2circ;/gs;
+ s/\\\^([AEIOUaeiou])/&$1circ;/g;
+ s/\\c(\001\d+)\{([Cc])\1\}/&$2cedil;/gs;
+ s/\\u(\001\d+)\{(.)\1\}/$2/gs;
+ s/\\v(\001\d+)\{(.)\1\}/$2/gs;
+ s/\\([lL])\b/$1/g;
+ s/\\\=(\001\d+)\{(.)\1\}/$2/gs;
+ s/\\\=(.)/$1/g;
+ s/\\\.(\001\d+)\{(.)\1\}/$2/gs;
+ s/\\\.(.)/$1/g;
+ s/\\([Oo])\b\s*/&$1slash;/g;
+ s/\\AA\b\s*/&Aring;/g;
+ s/\\aa\b\s*/&aring;/g;
+ s/\\AE\b\s*/&AElig;/g;
+ s/\\ae\b\s*/&aelig;/g;
+ s/\\ss\b\s*/&szlig;/g;
+ s/\\S\b\s*/&sect;/g;
+ s/\\P\b\s*/&para;/g;
+ s/\\pounds\b\s*/&pound;/g;
+ s/\?\`/&iquest;/g;
+ s/\!\`/&iexcl;/g;
+ s/\-\-\-/&mdash;/g;
+ s/([^\!])\-\-([^\>])/$1&ndash;$2/g;
+ s/\\([aA]lpha)\b/&$1;/g;
+ s/\\([bB]eta)\b/&$1;/g;
+ s/\\([gG]amma)\b/&$1;/g;
+ s/\\([dD]elta)\b/&$1;/g;
+ s/\\varepsilon\b/&epsilon;/g;
+ s/\\([eE]psilon)\b/&$1;/g;
+ s/\\([zZ]eta)\b/&$1;/g;
+ s/\\([eE]ta)\b/&$1;/g;
+ s/\\([tT]heta)\b/&$1;/g;
+ s/\\vartheta\b/&theta;/g;
+ s/\\([iI]ota)\b/&$1;/g;
+ s/\\([kK]appa)\b/&$1;/g;
+ s/\\([lL]ambda)\b/&$1;/g;
+ s/\\([mM]u)\b/&$1;/g;
+ s/\\([nN]u)\b/&$1;/g;
+ s/\\([xX]i)\b/&$1;/g;
+ s/\\([oO]micron)\b/&$1;/g;
+ s/\\([pP]i)\b/&$1;/g;
+ s/\\varpi\b/&pi;/g;
+ s/\\([rR]ho)\b/&$1;/g;
+ s/\\varrho\b/&rho;/g;
+ s/\\([sS]igma)\b/&$1;/g;
+ s/\\varsigma\b/&sigmaf;/g;
+ s/\\([tT]au)\b/&$1;/g;
+ s/\\([uU]psilon)\b/&$1;/g;
+ s/\\([pP]hi)\b/&$1;/g;
+ s/\\varphi\b/&phi;/g;
+ s/\\([cC]hi)\b/&$1;/g;
+ s/\\([pP]si)\b/&$1;/g;
+ s/\\([oO]mega)\b/&$1;/g;
+}
+foreach (@ARGV) {
+ if (/\.bib$/) {
+ $bibfile = $_;
+ $bibfile =~ s/\.bib$//;
+ push(@bibfiles,$bibfile);
+ } else {
+ $htmlfile = $_;
+ }
+}
+exit(1) unless defined($htmlfile);
+$bibdatacmd="\\bibdata{".join(',',@bibfiles)."}";
+$label_style = $LABEL_NUMBERED;
+$bstfile = "doxygen";
+umask(077);
+open(HTMLFILE,">$htmlfile$$");
+if (open(OHTMLFILE, "$htmlfile")) {
+ $mode = (stat OHTMLFILE)[2] & 0xfff;
+} else {
+ print "Error opening $htmlfile\n";
+ exit(1);
+}
+$beginstring = "<!-- BEGIN CITATIONS -->";
+$endstring = "<!-- END CITATIONS -->";
+@citations = ();
+loop:
+while (<OHTMLFILE>) {
+ print HTMLFILE;
+ last loop if m/^$beginstring$/;
+}
+loop:
+while (<OHTMLFILE>) {
+ print HTMLFILE;
+ last loop if m/^$endstring$/;
+ push(@citations, $2) if m/^([^\\]*)?(.+\})(.*)?$/;
+}
+push(@citations, $bibdatacmd);
+$auxfile = "bib$$";
+push(@tmpfiles, "$auxfile.aux");
+open(AUXFILE, ">$auxfile" . ".aux");
+print AUXFILE "\\relax\n\\bibstyle{$bstfile}\n";
+foreach $citation (@citations) {
+ print AUXFILE "$citation\n";
+}
+close(AUXFILE);
+push(@tmpfiles, "$auxfile.blg");
+push(@tmpfiles, "$auxfile.bbl");
+`bibtex $auxfile 2>&1`;
+if ($?==-1)
+{
+ print "bibtex command failed: $!\n";
+}
+$beginstring = "<!-- BEGIN BIBLIOGRAPHY -->";
+$endstring = "<!-- END BIBLIOGRAPHY -->";
+loop:
+while (<OHTMLFILE>) {
+ last loop if m/^$beginstring$/;
+ print HTMLFILE;
+}
+loop:
+while (<OHTMLFILE>) {
+ last loop if m/^$endstring$/;
+}
+print HTMLFILE "$beginstring\n";
+$t = $auxfile . ".bbl";
+$/ = "";
+open(BBLFILE, "<$t") || die "error opening $t: $!\n";
+$nentry = 0;
+loop:
+while (<BBLFILE>) {
+ if (($nentry == 0) && (m/^#/)) {
+ if ((m/#\s*label-style:\s*(\S+)/) && (! defined $label_style)) {
+ $label_style = $label_styles{$1};
+ if (! defined $label_style) {
+ print STDERR "label style unknown: \n";
+ next loop;
+ }
+ }
+ next loop;
+ }
+ $nentry++;
+ ($bcite, $blabel) = m+<dt><a name=\"([^\"]*)\">\[([^\]]*)\]</a></dt><dd>+;
+ $blabel = "$nentry";
+ $bibcite{$bcite} = $blabel;
+}
+close(BBLFILE);
+$label_style = $LABEL_DEFAULT if (! defined $label_style);
+$list_start = $list_start[$label_style];
+$list_end = $list_end[$label_style];
+print HTMLFILE "<$list_start>\n\n";
+open(BBLFILE, "<$t") || die "error opening $t: $!\n";
+$nentry = 0;
+loop:
+while (<BBLFILE>) {
+ next loop if (($nentry == 0) && (m/^#/));
+ $nentry++;
+ s/\\\{/\002/g;
+ s/\\\}/\003/g;
+ s/\\\$/\004/g;
+ {
+ local ($c, $l, $z) = (0, 0, ());
+ s/([\{\}])/join("","\001",($1 eq "\{" ? $z[$l++]=$c++ : $z[--$l]),$1)/ge;
+ }
+ s/\%\n//g;
+ s/(\.(<\/cite>|<\/a>|\')+)\./$1/g;
+ s:(<dt><a name=\"[^\"]*\">\[)[^\]]*(\]</a></dt><dd>):$1$nentry$2:;
+ while (m/(\\(cite(label)?)(\001\d+)\{([^\001]+)\4\})/) {
+ $old = $1;
+ $cmd = $2;
+ $doxref = defined($3);
+ $bcite = $5;
+ if (! defined $bibcite{$bcite}) {
+ $blabel = " [" . $bcite . "]";
+ } elsif ($doxref) {
+ $blabel = " <a href=\"#$bcite\">[" . $bibcite{$bcite} . "]<\/a>";
+ } else {
+ $blabel = " [" . $bibcite{$bcite} . "]";
+ }
+ $old =~ s/(\W)/\\$1/g;
+ s/\s*$old/$blabel/g;
+ }
+ s/In (<a href=\"[^\"]*\">)([^\[]+) \[(\2)/In $1\[$2/;
+ s/\\htmladdnormallink(foot)?(\001\d+)\{([^\001]+)\2\}(\001\d+)\{([^\001]+)\4\}/<a href="$5">$3<\/a>/gs;
+ s/\&amp;/\005/g;
+ s/\\?&/&amp;/g;
+ s/\005/&amp;/g;
+ html_ent();
+ while (m/\\char([\'\"]?[0-9a-fA-F]+)/) {
+ $o = $r = $1;
+ if ($r =~ s/^\'//) {
+ $r = oct($r);
+ } elsif ($r =~ s/^\"//) {
+ $r = hex($r);
+ }
+ s/\\char$o\s*/&#$r;/g;
+ }
+ s/{\\etalchar\001(\d+)\{(.)}\001\1\}/$2/g;
+ s/\\par\b/<p \/>/g;
+ s/\\url(\001\d+)\{(.*)\1\}/<a href="$2">$2<\/a>/gs;
+ s/\\href(\001\d+)\{(.*)\1\}(\001\d+)\{([^\001]*)\3\}/<a href="$2">$4<\/a>/gs;
+ s/\\href(\001\d+)\{(.*)\1\}/<a href="$2">$2<\/a>/gs;
+ s/(\001\d+)\{\\rm\s+(.*)\1\}/$2/gs;
+ s/\\textrm(\001\d+)\{(.*)\1\}/$2/gs;
+ s/(\001\d+)\{\\em\s+(.*)\1\}/<em>$2<\/em>/gs;
+ s/(\001\d+)\{\\it\s+(.*)\1\}/<i>$2<\/i>/gs;
+ s/(\001\d+)\{\\bf\s+(.*)\1\}/<b>$2<\/b>/gs;
+ s/(\001\d+)\{\\tt\s+(.*)\1\}/<tt>$2<\/tt>/gs;
+ s/\\emph(\001\d+)\{(.*)\1\}/<em>$2<\/em>/gs;
+ s/\\textit(\001\d+)\{(.*)\1\}/<i>$2<\/i>/gs;
+ s/\\textbf(\001\d+)\{(.*)\1\}/<b>$2<\/b>/gs;
+ s/\\texttt(\001\d+)\{(.*)\1\}/<tt>$2<\/tt>/gs;
+ s/\\mathrm(\001\d+)\{(.*)\1\}/$2/gs;
+ s/\\mathnormal(\001\d+)\{(.*)\1\}/$2/gs;
+ s/\\mathsf(\001\d+)\{(.*)\1\}/$2/gs;
+ s/\\mathbf(\001\d+)\{(.*)\1\}/<b>$2<\/b>/gs;
+ s/\\mathcal(\001\d+)\{(.*)\1\}/<i>$2<\/i>/gs;
+ s/\\mathit(\001\d+)\{(.*)\1\}/<i>$2<\/i>/gs;
+ s/\\mathtt(\001\d+)\{(.*)\1\}/<tt>$2<\/tt>/gs;
+ s/\\bibxhtmlname(\001\d+)\{(.*)\1\}/$2/ges;
+ sub domath {
+ local($t) = @_;
+ $t =~ s/\^(\001\d+)\{\\circ\1\}/\&\#176;/gs;
+ $t =~ s/\^\\circ/\&\#176;/g;
+ $t =~ s/\^(\001\d+)\{(.*)\1\}/<sup>$2<\/sup>/gs;
+ $t =~ s/\^(\w)/<sup>$1<\/sup>/g;
+ $t =~ s/\_(\001\d+)\{(.*)\1\}/<sub>$2<\/sub>/gs;
+ $t =~ s/\_(\w)/<sub>$1<\/sub>/g;
+ $t;
+ }
+ s/(\$([^\$]+)\$)/&domath($2)/ge;
+ s/(\\\((([^\\]|\\[^\(\)])+)\\\))/&domath($2)/ge;
+ s/\\mbox(\001\d+)\{(.*)\1\}/$2/gs;
+ while (s/(\<a href\=\"[^"]*?)\~/$1\005/g) { ; }
+ s/([^\\])~/$1&nbsp;/g;
+ s/\\\,/&thinsp;/g;
+ s/\\ldots\b/&hellip;/g;
+ s/\\dots\b/&hellip;/g;
+ s/\005/\~/g;
+ s/\\ / /g;
+ s/\\textasciitilde\b\s*/~/g;
+ s/\\([\#\&\%\~\_\^\|])/$1/g;
+ s/\\\W//g;
+ s/\001(\d+)\{\\[A-Za-z]+\001(\d+)\{([^\001]*)\001\2\}\001\1\}/$3/g;
+ s/\\([A-Za-z]+)/ $1 /g;
+ s+In <a href=\"[^\"]*\"></a>++;
+ s/\001\d+[\{\}]//gs;
+ tr/\002\003\004/{}$/;
+ print HTMLFILE $_;
+}
+close(BBLFILE);
+print HTMLFILE "<$list_end>\n\n$endstring\n";
+while (<OHTMLFILE>) {
+ print HTMLFILE;
+}
+close (OHTMLFILE);
+close(HTMLFILE);
+chmod($mode, "$htmlfile$$");
+rename("$htmlfile$$", $htmlfile);
+unlink(@tmpfiles);
+exit(0);
diff --git a/src/cite.cpp b/src/cite.cpp
index d19dfc1..c684083 100644
--- a/src/cite.cpp
+++ b/src/cite.cpp
@@ -29,6 +29,10 @@ static const char *doxygen_bst =
#include "doxygen_bst.h"
;
+static const char *bib2xhtml_pl =
+#include "bib2xhtml.h"
+;
+
//--------------------------------------------------------------------------
const QCString CiteConsts::fileName("citelist");
@@ -38,63 +42,28 @@ const QCString CiteConsts::anchorPrefix("CITEREF_");
CiteDict::CiteDict(int size) : m_entries(size, FALSE)
{
- m_ordering.setAutoDelete(TRUE);
m_entries.setAutoDelete(TRUE);
}
-bool CiteDict::writeAux()
+static QCString getListOfBibFiles(const QCString &sep,bool stripExtension)
{
- //msg("..writing aux file\n");
- QCString auxFileName(m_baseFileName + ".aux");
- QFile auxFile(auxFileName);
- if (!auxFile.open(IO_WriteOnly))
- // point it to something valid, because warn() relies on it
- {
- err("Error opening file %s for output\n", auxFileName.data());
- return FALSE;
- }
- FTextStream t(&auxFile);
-
- QDictIterator<CiteInfo> cdi(m_entries);
- for (CiteInfo *ci = 0; (ci=cdi.current()); ++cdi)
- {
- t << "\\citation{" << ci->label << "}\n";
- }
-
- t << "\\bibstyle{" << m_baseFileName << "}\n";
-
- t << "\\bibdata{";
+ QCString result;
QStrList &citeDataList = Config_getList("CITE_BIB_FILES");
const char *bibdata = citeDataList.first();
while (bibdata)
{
QCString bibFile = bibdata;
- if (!bibFile.isEmpty() && bibFile.right(4)!=".bib") bibFile+=".bib";
+ if (stripExtension && bibFile.right(4)==".bib")
+ {
+ bibFile = bibFile.left(bibFile.length()-4);
+ }
if (!bibFile.isEmpty())
{
- QFileInfo fi(bibFile); // open file (with .bib extension)
- if (fi.exists())
- {
- if (!copyFile(bibFile,m_baseFileName+"_"+fi.fileName().data()))
- {
- return FALSE;
- }
- bibFile = fi.fileName().data();
- if (bibFile.right(4)==".bib")
- {
- bibFile = bibFile.left(bibFile.length()-4);
- }
- t << m_baseFileName+"_"+bibFile; // write name (without bib extension)
- bibdata = citeDataList.next();
- if (bibdata)
- {
- t << ",";
- }
- }
- else
+ result+=bibFile;
+ bibdata = citeDataList.next();
+ if (bibdata)
{
- err("The file %s specified at CITE_BIB_FILES could not be read!\n",bibdata);
- return FALSE;
+ result+=sep;
}
}
else
@@ -102,23 +71,7 @@ bool CiteDict::writeAux()
bibdata = citeDataList.next();
}
}
- t << "}\n";
- return TRUE;
-}
-
-bool CiteDict::writeBst()
-{
- //msg("..writing bst file\n");
- QCString fileName = m_baseFileName + ".bst";
- QCString bstData = doxygen_bst;
- QFile f(fileName);
- if (!f.open(IO_WriteOnly))
- {
- err("error: could not open file %s for writing\n",fileName.data());
- return FALSE;
- }
- f.writeBlock(bstData, bstData.length());
- return TRUE;
+ return result;
}
void CiteDict::writeLatexBibliography(FTextStream &t)
@@ -127,31 +80,7 @@ void CiteDict::writeLatexBibliography(FTextStream &t)
QCString style = Config_getString("LATEX_BIB_STYLE");
if (style.isEmpty()) style="plain";
t << "\\newpage \\bibliographystyle{" << style << "}" << endl;
- t << "\\bibliography{";
- QStrList &citeDataList = Config_getList("CITE_BIB_FILES");
- const char *bibdata = citeDataList.first();
- while (bibdata)
- {
- QCString bibFile = bibdata;
- if (bibFile.right(4)==".bib")
- {
- bibFile = bibFile.left(bibFile.length()-4);
- }
- if (!bibFile.isEmpty())
- {
- t << bibFile;
- bibdata = citeDataList.next();
- if (bibdata)
- {
- t << ",";
- }
- }
- else
- {
- bibdata = citeDataList.next();
- }
- }
- t << "}" << endl;
+ t << "\\bibliography{" << getListOfBibFiles(",",TRUE) << "}" << endl;
}
void CiteDict::insert(const char *label)
@@ -167,130 +96,123 @@ CiteInfo *CiteDict::find(const char *label) const
void CiteDict::clear()
{
m_entries.clear();
- m_ordering.clear();
}
-bool CiteDict::execute()
+bool CiteDict::isEmpty() const
{
- //msg("..running bibtex\n");
- bool result=TRUE;
- QCString auxFileName(m_baseFileName + ".aux");
- int splitPoint = auxFileName.findRev('/');
- QCString dirname = auxFileName.left(splitPoint);
- QCString basename = auxFileName.mid(splitPoint + 1);
- QCString oldDir = convertToQCString(QDir::currentDirPath());
- QDir::setCurrent(dirname);
- QCString args;
- args += "-terse ";
- args += basename;
- portable_system("bibtex", args);
- int exitCode;
- if ((exitCode=portable_system("bibtex",args))!=0)
- {
- err("Problems running bibtex: exit code=%d, command='bibtex', arguments='%s'\n",
- exitCode,args.data());
- result=FALSE;
- }
- QDir::setCurrent(oldDir);
- return result;
+ QStrList &citeBibFiles = Config_getList("CITE_BIB_FILES");
+ return (citeBibFiles.count()==0 || m_entries.isEmpty());
}
-void CiteDict::parse()
+void CiteDict::generatePage() const
{
- //msg("..parsing bbl file\n");
- QCString bblFileName(m_baseFileName + ".bbl");
- QFile f(bblFileName);
- if (!f.open(IO_ReadOnly))
- {
- err("error: could not open file %s\n",bblFileName.data());
- return;
- }
+ //printf("** CiteDict::generatePage() count=%d\n",m_ordering.count());
- m_ordering.clear();
+ // do not generate an empty citations page
+ if (isEmpty()) return; // nothing to cite
- QTextStream t(&f);
- QCString label;
- QCString line;
- while (!t.eof())
+ // 1. generate file with markers and citations to OUTPUT_DIRECTORY
+ QFile f;
+ QCString outputDir = Config_getString("OUTPUT_DIRECTORY");
+ QCString citeListFile = outputDir+"/citelist.doc";
+ f.setName(citeListFile);
+ if (!f.open(IO_WriteOnly))
{
- label=t.readLine();
- if (label.isEmpty())
- {
- continue;
- }
-
- CiteInfo* ci = m_entries.find(label);
- if (!ci) insert(label);
-
- // BibTeX has its own way of sorting references,
- // depending on the .bst file
- m_ordering.append(new QCString(label));
-
- ci->text=t.readLine();
-
- while (!(line=t.readLine()).isEmpty())
- {
- ci->fullText += line + '\n';
- }
-
- // FIXME: process LaTeX-style accents properly
- ci->fullText = substitute(substitute(substitute(ci->fullText,
- "{", ""),
- "}", ""),
- "~", " ");
-
- //printf("BIB ENTRY: %s -> %s: %s\n", ci->label.data(), ci->text.data(), ci->fullText.data());
+ err("error: could not open file %s for writing\n",citeListFile.data());
}
-}
-
-void CiteDict::clean()
-{
- // clean
- QDir thisDir;
- QStrList &citeDataList = Config_getList("CITE_BIB_FILES");
- const char *bibdata = citeDataList.first();
- while (bibdata)
+ FTextStream t(&f);
+ t << "<!-- BEGIN CITATIONS -->" << endl;
+ t << "<!--" << endl;
+ QDictIterator<CiteInfo> it(m_entries);
+ CiteInfo *ci;
+ for (it.toFirst();(ci=it.current());++it)
{
- QCString bibFile = bibdata;
- if (!bibFile.isEmpty() && bibFile.right(4)!=".bib") bibFile+=".bib";
- if (!bibFile.isEmpty()) thisDir.remove(m_baseFileName+"_"+bibFile);
- bibdata = citeDataList.next();
+ t << "\\citation{" << ci->label << "}" << endl;
}
-
- thisDir.remove(m_baseFileName + ".aux");
- thisDir.remove(m_baseFileName + ".bbl");
- thisDir.remove(m_baseFileName + ".blg");
- thisDir.remove(m_baseFileName + ".tmp");
- thisDir.remove(m_baseFileName + ".bst");
-
- QCString &outputDirectory = Config_getString("OUTPUT_DIRECTORY");
- if (outputDirectory.isEmpty())
+ t << "-->" << endl;
+ t << "<!-- END CITATIONS -->" << endl;
+ t << "<!-- BEGIN BIBLIOGRAPHY -->" << endl;
+ t << "<!-- END BIBLIOGRAPHY -->" << endl;
+ f.close();
+
+ // 2. generate bib2xhtml
+ QCString bib2xhtmlFile = outputDir+"/bib2xhtml.pl";
+ f.setName(bib2xhtmlFile);
+ QCString bib2xhtml = bib2xhtml_pl;
+ if (!f.open(IO_WriteOnly))
{
- outputDirectory=QDir::currentDirPath();
+ err("error: could not open file %s for writing\n",bib2xhtmlFile.data());
}
- QDir d(outputDirectory);
- d.rmdir("bib");
-}
+ f.writeBlock(bib2xhtml, bib2xhtml.length());
+ f.close();
-void CiteDict::resolve()
-{
- QStrList &citeBibFiles = Config_getList("CITE_BIB_FILES");
- if (citeBibFiles.count()==0 || m_entries.count()==0) return; // nothing to cite
-
- QCString outputDirectory = Config_getString("OUTPUT_DIRECTORY");
- QDir d(outputDirectory);
- d.mkdir("bib");
+ // 3. generate doxygen.bst
+ QCString doxygenBstFile = outputDir+"/doxygen.bst";
+ QCString bstData = doxygen_bst;
+ f.setName(doxygenBstFile);
+ if (!f.open(IO_WriteOnly))
+ {
+ err("error: could not open file %s for writing\n",doxygenBstFile.data());
+ }
+ f.writeBlock(bstData, bstData.length());
+ f.close();
- uint pid = portable_pid();
- m_baseFileName.sprintf("doxygen_bibtex_%d",pid);
- m_baseFileName.prepend(outputDirectory+"/bib/");
+ // 4. run bib2xhtml perl script on the generated file which will insert the
+ // bibliography in citelist.doc
+ portable_system("perl",bib2xhtmlFile+" "+getListOfBibFiles(" ",FALSE)+" "+
+ citeListFile);
- if (writeAux() && writeBst() && execute())
+ // 5. read back the file
+ f.setName(citeListFile);
+ if (!f.open(IO_ReadOnly))
{
- parse();
- clean();
+ err("error: could not open file %s/citelist.doc for reading\n",outputDir.data());
}
+ bool insideBib=FALSE;
+
+ QCString doc;
+ QFileInfo fi(citeListFile);
+ QCString input(fi.size()+1);
+ f.readBlock(input.data(),fi.size());
+ input.at(fi.size())='\0';
+ int p=0,s;
+ //printf("input=[%s]\n",input.data());
+ while ((s=input.find('\n',p))!=-1)
+ {
+ QCString line = input.mid(p,s-p);
+ //printf("p=%d s=%d line=[%s]\n",p,s,line.data());
+ p=s+1;
+
+ if (line.find("<!-- BEGIN BIBLIOGRAPHY")!=-1) insideBib=TRUE;
+ else if (line.find("<!-- END BIBLIOGRAPH")!=-1) insideBib=FALSE;
+ else if (insideBib) doc+=line+"\n";
+ int i;
+ // determine text to use at the location of the @cite command
+ if (insideBib && (i=line.find("<a name=\"CITEREF_"))!=-1)
+ {
+ int j=line.find("\">[");
+ int k=line.find("]</a>");
+ if (j!=-1 && k!=-1)
+ {
+ QCString label = line.mid(i+17,j-i-17);
+ QCString number = line.mid(j+2,k-j-1);
+ CiteInfo *ci = m_entries.find(label);
+ //printf("label='%s' number='%s' => %p\n",label.data(),number.data(),ci);
+ if (ci)
+ {
+ ci->text = number;
+ }
+ }
+ }
+ }
+ //printf("doc=[%s]\n",doc.data());
+
+ // 6. add it as a page
+ addRelatedPage(CiteConsts::fileName,
+ theTranslator->trCiteReferences(),doc,0,CiteConsts::fileName,1,0,0,0);
+ // 7. for latex we just copy the bib files to the output and let
+ // latex do this work.
if (Config_getBool("GENERATE_LATEX"))
{
// copy bib files to the latex output dir
@@ -316,41 +238,12 @@ void CiteDict::resolve()
bibdata = citeDataList.next();
}
}
-}
-bool CiteDict::isEmpty() const
-{
- QStrList &citeBibFiles = Config_getList("CITE_BIB_FILES");
- return (citeBibFiles.count()==0 || m_ordering.isEmpty());
-}
-
-void CiteDict::generatePage() const
-{
- //printf("** CiteDict::generatePage() count=%d\n",m_ordering.count());
-
- // do not generate an empty citations page
- if (isEmpty()) return; // nothing to cite
-
- QCString doc;
- doc += "<dl class=\"citelist\">";
+ // 8. Remove temporary files
+ QDir thisDir;
+ thisDir.remove(citeListFile);
+ thisDir.remove(doxygenBstFile);
+ thisDir.remove(bib2xhtmlFile);
- QListIterator<QCString> it(m_ordering);
- QCString *s;
- for (it.toFirst();(s=it.current());++it)
- {
- CiteInfo* ci = m_entries.find(*s);
- doc += " <dt>";
- doc += "\\anchor ";
- doc += CiteConsts::anchorPrefix + ci->label;
- doc += "\n";
- doc += ci->text;
- doc += "</dt><dd> ";
- doc += ci->fullText;
- doc += "</dd>";
- }
- doc += "</dl>\n";
- //printf("addRelatedPage with doc='%s'\n",doc.data());
- addRelatedPage(CiteConsts::fileName,
- theTranslator->trCiteReferences(),doc,0,CiteConsts::fileName,1,0,0,0);
}
diff --git a/src/cite.h b/src/cite.h
index d290c9c..10fc56e 100644
--- a/src/cite.h
+++ b/src/cite.h
@@ -61,8 +61,8 @@ class CiteDict
/** Create the database, with an expected maximum of \a size entries */
CiteDict(int size);
- /** Resolve references to citations */
- void resolve();
+// /** Resolve references to citations */
+// void resolve();
/** Insert a citation identified by \a label into the database */
void insert(const char *label);
@@ -87,13 +87,13 @@ class CiteDict
void writeLatexBibliography(FTextStream &t);
private:
- bool writeAux();
- bool writeBst();
- bool execute();
- void parse();
- void clean();
+// bool writeAux();
+// bool writeBst();
+// bool execute();
+// void parse();
+// void clean();
QDict<CiteInfo> m_entries;
- QList<QCString> m_ordering;
+// QList<QCString> m_ordering;
QCString m_baseFileName;
};
diff --git a/src/classdef.cpp b/src/classdef.cpp
index f868037..4dd9860 100644
--- a/src/classdef.cpp
+++ b/src/classdef.cpp
@@ -175,6 +175,9 @@ class ClassDefImpl
/** Is this a simple (non-nested) C structure? */
bool isSimple;
+ /** Does this class overloaded the -> operator? */
+ MemberDef *arrowOperator;
+
ClassList *taggedInnerClasses;
ClassDef *tagLessRef;
};
@@ -217,6 +220,7 @@ void ClassDefImpl::init(const char *defFileName, const char *name,
categoryOf = 0;
usedOnly = FALSE;
isSimple = Config_getBool("INLINE_SIMPLE_STRUCTS");
+ arrowOperator = 0;
taggedInnerClasses = 0;
tagLessRef = 0;
//QCString ns;
@@ -636,6 +640,11 @@ void ClassDef::internalInsertMember(MemberDef *md,
m_impl->isAbstract=TRUE;
}
+ if (md->name()=="operator->")
+ {
+ m_impl->arrowOperator=md;
+ }
+
//::addClassMemberNameToIndex(md);
if (addToAllList &&
!(Config_getBool("HIDE_FRIEND_COMPOUNDS") &&
@@ -3175,8 +3184,35 @@ QCString ClassDef::compoundTypeString() const
}
}
-QCString ClassDef::getXmlOutputFileBase() const
-{
+QCString ClassDef::getOutputFileBase() const
+{
+ if (!Doxygen::generatingXmlOutput)
+ {
+ static bool inlineGroupedClasses = Config_getBool("INLINE_GROUPED_CLASSES");
+ static bool inlineSimpleClasses = Config_getBool("INLINE_SIMPLE_STRUCTS");
+ Definition *scope=0;
+ if (inlineGroupedClasses && partOfGroups()!=0)
+ {
+ // point to the group that embeds this class
+ return partOfGroups()->at(0)->getOutputFileBase();
+ }
+ else if (inlineSimpleClasses && m_impl->isSimple && partOfGroups()!=0)
+ {
+ // point to simple struct inside a group
+ return partOfGroups()->at(0)->getOutputFileBase();
+ }
+ else if (inlineSimpleClasses && m_impl->isSimple && (scope=getOuterScope()))
+ {
+ if (scope==Doxygen::globalScope && getFileDef() && getFileDef()->isLinkableInProject()) // simple struct embedded in file
+ {
+ return getFileDef()->getOutputFileBase();
+ }
+ else if (scope->isLinkableInProject()) // simple struct embedded in other container (namespace/group/class)
+ {
+ return getOuterScope()->getOutputFileBase();
+ }
+ }
+ }
if (m_impl->templateMaster)
{
// point to the template of which this class is an instance
@@ -3194,35 +3230,6 @@ QCString ClassDef::getXmlOutputFileBase() const
}
}
-QCString ClassDef::getOutputFileBase() const
-{
- static bool inlineGroupedClasses = Config_getBool("INLINE_GROUPED_CLASSES");
- static bool inlineSimpleClasses = Config_getBool("INLINE_SIMPLE_STRUCTS");
- Definition *scope=0;
- if (inlineGroupedClasses && partOfGroups()!=0)
- {
- // point to the group that embeds this class
- return partOfGroups()->at(0)->getOutputFileBase();
- }
- else if (inlineSimpleClasses && m_impl->isSimple && partOfGroups()!=0)
- {
- // point to simple struct inside a group
- return partOfGroups()->at(0)->getOutputFileBase();
- }
- else if (inlineSimpleClasses && m_impl->isSimple && (scope=getOuterScope()))
- {
- if (scope==Doxygen::globalScope && getFileDef() && getFileDef()->isLinkableInProject()) // simple struct embedded in file
- {
- return getFileDef()->getOutputFileBase();
- }
- else if (scope->isLinkableInProject()) // simple struct embedded in other container (namespace/group/class)
- {
- return getOuterScope()->getOutputFileBase();
- }
- }
- return getXmlOutputFileBase();
-}
-
QCString ClassDef::getInstanceOutputFileBase() const
{
if (isReference())
@@ -3921,6 +3928,11 @@ bool ClassDef::isSimple() const
return m_impl->isSimple;
}
+MemberDef *ClassDef::isSmartPointer() const
+{
+ return m_impl->arrowOperator;
+}
+
void ClassDef::reclassifyMember(MemberDef *md,MemberDef::MemberType t)
{
md->setMemberType(t);
@@ -3936,7 +3948,7 @@ void ClassDef::reclassifyMember(MemberDef *md,MemberDef::MemberType t)
QCString ClassDef::anchor() const
{
QCString anc;
- if (isEmbeddedInOuterScope())
+ if (isEmbeddedInOuterScope() && !Doxygen::generatingXmlOutput)
{
if (m_impl->templateMaster)
{
diff --git a/src/classdef.h b/src/classdef.h
index f2d5b3a..13f1157 100644
--- a/src/classdef.h
+++ b/src/classdef.h
@@ -95,8 +95,7 @@ class ClassDef : public Definition
DefType definitionType() const { return TypeClass; }
/*! Returns the unique base name (without extension) of the class's file on disk */
- QCString getOutputFileBase() const;
- QCString getXmlOutputFileBase() const;
+ QCString getOutputFileBase() const;
QCString getInstanceOutputFileBase() const;
QCString getFileBase() const;
@@ -272,6 +271,8 @@ class ClassDef : public Definition
const ClassList *taggedInnerClasses() const;
ClassDef *tagLessReference() const;
+ MemberDef *isSmartPointer() const;
+
//-----------------------------------------------------------------------------------
// --- setters ----
//-----------------------------------------------------------------------------------
diff --git a/src/code.l b/src/code.l
index 7821320..a4313c4 100644
--- a/src/code.l
+++ b/src/code.l
@@ -246,7 +246,7 @@ void VariableContext::addVariable(const QCString &type,const QCString &name)
( // look for class definitions inside the code block
(varType=g_codeClassSDict->find(typeName)) ||
// otherwise look for global class definitions
- (varType=getResolvedClass(g_currentDefinition,g_sourceFileDef,typeName))
+ (varType=getResolvedClass(g_currentDefinition,g_sourceFileDef,typeName,0,0,TRUE,TRUE))
) && // and it must be a template
varType->templateArguments())
{
@@ -477,7 +477,8 @@ static void startCodeLine()
//printf("->startCodeLine(%s)=%p\n",d->name().data(),g_currentMemberDef);
g_insideBody = FALSE;
g_searchingForBody = TRUE;
- g_realScope = d->name().copy();
+ g_realScope = d->name();
+ //g_classScope = "";
g_type.resize(0);
g_name.resize(0);
g_args.resize(0);
@@ -724,7 +725,7 @@ static MemberDef *setCallContextForVar(const QCString &name)
ClassDef *mcd = g_theVarContext.findVariable(name);
if (mcd) // local variable
{
- //fprintf(stderr,"local variable\n");
+ //fprintf(stderr,"local variable?\n");
if (mcd!=VariableContext::dummyContext)
{
//fprintf(stderr,"local var `%s' mcd=%s\n",name.data(),mcd->name().data());
@@ -733,6 +734,7 @@ static MemberDef *setCallContextForVar(const QCString &name)
}
else
{
+ //fprintf(stderr,"class member? scope=%s\n",g_classScope.data());
// look for a class member
mcd = getClass(g_classScope);
if (mcd)
@@ -792,6 +794,22 @@ static MemberDef *setCallContextForVar(const QCString &name)
return 0;
}
+static void updateCallContextForSmartPointer()
+{
+ ClassDef *cd = g_theCallContext.getClass();
+ //printf("updateCallContextForSmartPointer() cd=%s\n",cd ? cd->name().data() : "<none>");
+ MemberDef *md;
+ if (cd && (md=cd->isSmartPointer()))
+ {
+ ClassDef *ncd = stripClassName(md->typeString());
+ if (ncd)
+ {
+ g_theCallContext.setClass(ncd);
+ //printf("Found smart pointer call %s->%s!\n",cd->name().data(),ncd->name().data());
+ }
+ }
+}
+
static void addDocCrossReference(MemberDef *src,MemberDef *dst)
{
static bool referencedByRelation = Config_getBool("REFERENCED_BY_RELATION");
@@ -942,11 +960,11 @@ static void generateClassOrGlobalLink(CodeOutputInterface &ol,char *clName,
if ((lcd=g_theVarContext.findVariable(className))==0) // not a local variable
{
Definition *d = g_currentDefinition;
- //printf("d=%p g_sourceFileDef=%p\n",d,g_currentDefinition);
+ //printf("d=%s g_sourceFileDef=%s\n",d?d->name().data():"<none>",g_sourceFileDef?g_sourceFileDef->name().data():"<none>");
cd = getResolvedClass(d,g_sourceFileDef,className,&md);
//fprintf(stderr,"non-local variable name=%s context=%d cd=%s md=%s!\n",
// className.data(),g_theVarContext.count(),cd?cd->name().data():"<none>",
- // md?md->name().data():"<none>");
+ // md?md->name().data():"<none>");
if (cd==0 && md==0 && (i=className.find('<'))!=-1)
{
QCString bareName = className.left(i); //stripTemplateSpecifiersFromScope(className);
@@ -2501,6 +2519,10 @@ OPERATOR {ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP}
endFontClass();
}
<Body>"."|"->" {
+ if (yytext[0]=='-') // -> could be overloaded
+ {
+ updateCallContextForSmartPointer();
+ }
g_code->codify(yytext);
g_memCallContext = YY_START;
BEGIN( MemberCall );
@@ -3007,6 +3029,10 @@ OPERATOR {ARITHOP}|{ASSIGNOP}|{LOGICOP}|{BITOP}
BEGIN( MemberCall2 );
}
<MemberCall2>"->"|"." {
+ if (yytext[0]=='-') // -> could be overloaded
+ {
+ updateCallContextForSmartPointer();
+ }
g_code->codify(yytext);
g_memCallContext = YY_START;
BEGIN( MemberCall );
diff --git a/src/commentscan.l b/src/commentscan.l
index 00dd4e0..c37b3dc 100644
--- a/src/commentscan.l
+++ b/src/commentscan.l
@@ -825,6 +825,7 @@ FILEECHAR [a-z_A-Z0-9\x80-\xFF\-\+]
FILE ({FILESCHAR}*{FILEECHAR}+("."{FILESCHAR}*{FILEECHAR}+)*)|("\""[^\n\"]*"\"")
ID "$"?[a-z_A-Z\x80-\xFF][a-z_A-Z0-9\x80-\xFF]*
LABELID [a-z_A-Z\x80-\xFF][a-z_A-Z0-9\x80-\xFF\-]*
+CITEID [a-z_A-Z\x80-\xFF][a-z_A-Z0-9\x80-\xFF\-:/]*
SCOPEID {ID}({ID}*{BN}*"::"{BN}*)*({ID}?)
SCOPENAME "$"?(({ID}?{BN}*("::"|"."){BN}*)*)((~{BN}*)?{ID})
MAILADR [a-z_A-Z0-9.+\-]+"@"[a-z_A-Z0-9\-]+("."[a-z_A-Z0-9\-]+)+[a-z_A-Z0-9\-]+
@@ -1966,7 +1967,7 @@ RCSTAG "$"{ID}":"[^\n$]+"$"
/* ----- handle arguments of the cite command ------- */
-<CiteLabel>{LABELID} { // found argyment
+<CiteLabel>{CITEID} { // found argyment
addCite();
addOutput(yytext);
BEGIN(Comment);
diff --git a/src/config.xml b/src/config.xml
index 8f4d36d..159fb1b 100644
--- a/src/config.xml
+++ b/src/config.xml
@@ -10,7 +10,7 @@ http://www.gnu.org/software/libiconv for the list of possible encodings.
<option type='string' id='PROJECT_NAME' format='string' docs='
The PROJECT_NAME tag is a single word (or sequence of words) that should
identify the project. Note that if you do not use Doxywizard you need
-to put quotes around the project name if it contains spaces.' defval=''/>
+to put quotes around the project name if it contains spaces.' defval='My Project'/>
<option type='string' id='PROJECT_NUMBER' format='string' docs='
The PROJECT_NUMBER tag can be used to enter a project or revision number.
This could be handy for archiving the generated documentation or
@@ -530,7 +530,8 @@ containing the references data. This must be a list of .bib files. The
.bib extension is automatically appended if omitted. Using this command
requires the bibtex tool to be installed. See also
http://en.wikipedia.org/wiki/BibTeX for more info. For LaTeX the style
-of the bibliography can be controlled using LATEX_BIB_STYLE.
+of the bibliography can be controlled using LATEX_BIB_STYLE. To use this
+feature you need bibtex and perl available in the search path.
' defval=''/>
</group>
<group name='Messages' docs='configuration options related to warning and progress messages'>
@@ -1010,12 +1011,6 @@ the value YES disables it. Since the tabs have the same information as the
navigation tree you can set this option to NO if you already set
GENERATE_TREEVIEW to YES.
' defval='0' depends='GENERATE_HTML'/>
- <option type='int' id='ENUM_VALUES_PER_LINE' docs='
-The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values
-(range [0,1..20]) that doxygen will group on one line in the generated HTML
-documentation. Note that a value of 0 will completely suppress the enum
-values from appearing in the overview section.
-' minval='0' maxval='20' defval='4' depends='GENERATE_HTML'/>
<option type='bool' id='GENERATE_TREEVIEW' defval='0' docs='
The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
structure should be generated to display hierarchical information.
@@ -1027,6 +1022,12 @@ Windows users are probably better off using the HTML help feature.
Since the tree basically has the same information as the tab index you
could consider to set DISABLE_INDEX to NO when enabling this option.
' depends='GENERATE_HTML'/>
+ <option type='int' id='ENUM_VALUES_PER_LINE' docs='
+The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values
+(range [0,1..20]) that doxygen will group on one line in the generated HTML
+documentation. Note that a value of 0 will completely suppress the enum
+values from appearing in the overview section.
+' minval='0' maxval='20' defval='4' depends='GENERATE_HTML'/>
<option type='bool' id='USE_INLINE_TREES' defval='0' docs='
By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories,
and Class Hierarchy pages using a tree view instead of an ordered list.
diff --git a/src/configoptions.cpp b/src/configoptions.cpp
index a632acb..17514c8 100644
--- a/src/configoptions.cpp
+++ b/src/configoptions.cpp
@@ -36,6 +36,7 @@ void addConfigOptions(Config *cfg)
"identify the project. Note that if you do not use Doxywizard you need\n"
"to put quotes around the project name if it contains spaces."
);
+ cs->setDefaultValue("My Project");
//----
cs = cfg->addString(
"PROJECT_NUMBER",
@@ -761,7 +762,7 @@ void addConfigOptions(Config *cfg)
".bib extension is automatically appended if omitted. Using this command\n"
"requires the bibtex tool to be installed. See also\n"
"http://en.wikipedia.org/wiki/BibTeX for more info. For LaTeX the style\n"
- "of the bibliography can be controlled using LATEX_BIB_STYLE."
+ "of the bibliography can be controlled using LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the search path."
);
cl->setWidgetType(ConfigList::File);
//---------------------------------------------------------------------------
@@ -1483,16 +1484,6 @@ void addConfigOptions(Config *cfg)
);
cb->addDependency("GENERATE_HTML");
//----
- ci = cfg->addInt(
- "ENUM_VALUES_PER_LINE",
- "The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values\n"
- "(range [0,1..20]) that doxygen will group on one line in the generated HTML\n"
- "documentation. Note that a value of 0 will completely suppress the enum\n"
- "values from appearing in the overview section.",
- 0,20,4
- );
- ci->addDependency("GENERATE_HTML");
- //----
cb = cfg->addBool(
"GENERATE_TREEVIEW",
"The GENERATE_TREEVIEW tag is used to specify whether a tree-like index\n"
@@ -1508,6 +1499,16 @@ void addConfigOptions(Config *cfg)
);
cb->addDependency("GENERATE_HTML");
//----
+ ci = cfg->addInt(
+ "ENUM_VALUES_PER_LINE",
+ "The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values\n"
+ "(range [0,1..20]) that doxygen will group on one line in the generated HTML\n"
+ "documentation. Note that a value of 0 will completely suppress the enum\n"
+ "values from appearing in the overview section.",
+ 0,20,4
+ );
+ ci->addDependency("GENERATE_HTML");
+ //----
cb = cfg->addBool(
"USE_INLINE_TREES",
"By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories,\n"
diff --git a/src/definition.h b/src/definition.h
index a2f00f0..94d1edc 100644
--- a/src/definition.h
+++ b/src/definition.h
@@ -132,6 +132,9 @@ class Definition : public DefinitionIntf, public LockableObj
*/
virtual QCString getOutputFileBase() const = 0;
+ /*! Returns the anchor within a page where this item can be found */
+ virtual QCString anchor() const = 0;
+
/*! Returns the name of the source listing of this file. */
virtual QCString getSourceFileBase() const { ASSERT(0); return "NULL"; }
diff --git a/src/dirdef.h b/src/dirdef.h
index 1f20285..445e3ff 100644
--- a/src/dirdef.h
+++ b/src/dirdef.h
@@ -49,10 +49,11 @@ class DirDef : public Definition
virtual ~DirDef();
// accessors
- virtual DefType definitionType() const { return TypeDir; }
- virtual QCString getOutputFileBase() const;
- virtual bool isLinkableInProject() const;
- virtual bool isLinkable() const;
+ DefType definitionType() const { return TypeDir; }
+ QCString getOutputFileBase() const;
+ QCString anchor() const { return QCString(); }
+ bool isLinkableInProject() const;
+ bool isLinkable() const;
QCString displayName() const { return m_dispName; }
QCString shortName() const { return m_shortName; }
void addSubDir(DirDef *subdir);
diff --git a/src/docparser.cpp b/src/docparser.cpp
index a1ad75c..17c1461 100644
--- a/src/docparser.cpp
+++ b/src/docparser.cpp
@@ -1043,7 +1043,7 @@ static void handleLinkedWord(DocNode *parent,QList<DocNode> &children)
}
else if (compound->isLinkable()) // compound link
{
- QCString anchor;
+ QCString anchor = compound->anchor();
if (compound->definitionType()==Definition::TypeFile)
{
name=g_token->name;
@@ -1052,10 +1052,6 @@ static void handleLinkedWord(DocNode *parent,QList<DocNode> &children)
{
name=((GroupDef*)compound)->groupTitle();
}
- else if (compound->definitionType()==Definition::TypeClass)
- {
- anchor=((ClassDef*)compound)->anchor();
- }
children.append(new
DocLinkedWord(parent,name,
compound->getReference(),
@@ -1700,7 +1696,7 @@ DocAnchor::DocAnchor(DocNode *parent,const QCString &id,bool newAnchor)
CiteInfo *cite = Doxygen::citeDict->find(id.mid(CiteConsts::anchorPrefix.length()));
if (cite)
{
- m_file = CiteConsts::fileName;
+ m_file = convertNameToFile(CiteConsts::fileName,FALSE,TRUE);
m_anchor = id;
}
else
@@ -2422,7 +2418,7 @@ DocCite::DocCite(DocNode *parent,const QCString &target,const QCString &) //cont
static uint numBibFiles = Config_getList("CITE_BIB_FILES").count();
m_parent = parent;
QCString anchor;
- //printf("DocCite::DocCite(target=%s,context=%s\n",target.data(),context.data());
+ //printf("DocCite::DocCite(target=%s)\n",target.data());
ASSERT(!target.isEmpty());
m_relPath = g_relPath;
CiteInfo *cite = Doxygen::citeDict->find(target);
@@ -2432,7 +2428,7 @@ DocCite::DocCite(DocNode *parent,const QCString &target,const QCString &) //cont
if (m_text.isEmpty()) m_text = cite->label;
m_ref = cite->ref;
m_anchor = CiteConsts::anchorPrefix+cite->label;
- m_file = CiteConsts::fileName;
+ m_file = convertNameToFile(CiteConsts::fileName,FALSE,TRUE);
//printf("CITE ==> m_text=%s,m_ref=%s,m_file=%s,m_anchor=%s\n",
// m_text.data(),m_ref.data(),m_file.data(),m_anchor.data());
return;
@@ -3660,6 +3656,13 @@ int DocHtmlDescTitle::parse()
retval=RetVal_EndDesc;
goto endtitle;
}
+ else if (tagId==HTML_A)
+ {
+ if (!g_token->endTag)
+ {
+ handleAHref(this,m_children,g_token->attribs);
+ }
+ }
else
{
warn_doc_error(g_fileName,doctokenizerYYlineno,"warning: Unexpected html tag <%s%s> found within <dt> context",
@@ -4500,6 +4503,7 @@ void DocPara::handleCite()
qPrint("cite"));
return;
}
+ doctokenizerYYsetStateCite();
tok=doctokenizerYYlex();
if (tok==0)
{
@@ -4514,7 +4518,6 @@ void DocPara::handleCite()
return;
}
g_token->sectionId = g_token->name;
- doctokenizerYYsetStateCite();
DocCite *cite = new DocCite(this,g_token->name,g_context);
m_children.append(cite);
//cite->parse();
diff --git a/src/doctokenizer.l b/src/doctokenizer.l
index 9fb6b2c..3e7b670 100644
--- a/src/doctokenizer.l
+++ b/src/doctokenizer.l
@@ -334,12 +334,12 @@ LNKWORD1 ("::"|"#")?{SCOPEMASK}
CVSPEC {BLANK}*("const"|"volatile")
LNKWORD2 (({SCOPEPRE}*"operator"{OPMASK})|({SCOPEPRE}"operator"{OPMASKOPT})|(("::"|"#"){SCOPEPRE}*"operator"{OPMASKOPT})){CVSPEC}?
LNKWORD3 ([0-9a-z_A-Z\-]+("/"|"\\"))*[0-9a-z_A-Z\-]+("."[0-9a-z_A-Z]+)+
-CHARWORDQ [^ \t\n\r\\@<>()\[\]:;\?{}&%$#,."=]
-ESCWORD "%"{ID}(("::"|"."){ID})*
+CHARWORDQ [^ \t\n\r\\@<>()\[\]:;\?{}&%$#,."=']
+ESCWORD ("%"{ID}(("::"|"."){ID})*)|("%'")
WORD1 {ESCWORD}|{CHARWORDQ}+|"{"|"}"|"'\"'"|("\""[^"\n]*\n?[^"\n]*"\"")
-WORD2 "."|","|"("|")"|"["|"]"|":"|";"|"\?"|"="
+WORD2 "."|","|"("|")"|"["|"]"|":"|";"|"\?"|"="|"'"
WORD1NQ {ESCWORD}|{CHARWORDQ}+|"{"|"}"
-WORD2NQ "."|","|"("|")"|"["|"]"|":"|";"|"\?"|"="
+WORD2NQ "."|","|"("|")"|"["|"]"|":"|";"|"\?"|"="|"'"
HTMLTAG "<"(("/")?){ID}({WS}+{ATTRIB})*{WS}*(("/")?)">"
HTMLKEYL "strong"|"center"|"table"|"caption"|"small"|"code"|"dfn"|"var"|"img"|"pre"|"sub"|"sup"|"tr"|"td"|"th"|"ol"|"ul"|"li"|"tt"|"kbd"|"em"|"hr"|"dl"|"dt"|"dd"|"br"|"i"|"a"|"b"|"p"
HTMLKEYU "STRONG"|"CENTER"|"TABLE"|"CAPTION"|"SMALL"|"CODE"|"DFN"|"VAR"|"IMG"|"PRE"|"SUB"|"SUP"|"TR"|"TD"|"TH"|"OL"|"UL"|"LI"|"TT"|"KBD"|"EM"|"HR"|"DL"|"DT"|"DD"|"BR"|"I"|"A"|"B"|"P"
diff --git a/src/doxygen.bst b/src/doxygen.bst
index 0dd6e28..c6ae7a8 100644
--- a/src/doxygen.bst
+++ b/src/doxygen.bst
@@ -1,31 +1,10 @@
-%% doxygen.bst
-%% This is a modification of plainhtml.bst; the original copyright notice
-%% follows.
-
-%% ORIGINAL COPYRIGHT NOTICE OF plainhtml.bst
-%%
-%% plainhtml.bst
-%%
-%% Part of bibhtml, version 2.0.1, released 2009 November 2
-%% Hg node 6ca3807543d6.
-%% See <http://purl.org/nxg/dist/bibhtml>
-%%
-%% Copyright 1999, 2005, 2006, 2009, Norman Gray <norman@astro.gla.ac.uk>
-%%
-%% This is a modification of a modification!
-%%
-%%% Modification of BibTeX style file /usr/local/texlive/2008/texmf-dist/bibtex/bst/base/plain.bst
-%%% ... by urlbst, version 0.6-4 (marked with "% urlbst")
-%%% See <http://purl.org/nxg/dist/urlbst>
-%%% Added webpage entry type, and url and lastchecked fields.
-%%% Added eprint support.
-%%% Added DOI support.
-%%% Added PUBMED support.
-%%% Added hyperref support.
-%%% Original headers follow...
-
-% BibTeX standard bibliography style `plain'
- % version 0.99a for BibTeX versions 0.99a or later, LaTeX version 2.09.
+ % $Id: html-btxbst.doc 1.5 2010/12/08 19:02:34 dds Exp $
+ %
+ % This file is either "html-btxbst.doc" or was derived from
+ % "html-btxbst.doc" using cpp. "html-btxbst.doc" itself was edited
+ % from "btxbst.doc" and "named.bst".
+ % The following copyright information is from btxbst.doc:
+ % version 0.99b for BibTeX versions 0.99a or later, LaTeX version 2.09.
% Copyright (C) 1985, all rights reserved.
% Copying of this file is authorized only if either
% (1) you make absolutely no changes to your copy, including name, or
@@ -33,6 +12,8 @@
% btxbst.doc, plain.bst, unsrt.bst, alpha.bst, and abbrv.bst.
% This restriction helps ensure that all standard styles are identical.
% The file btxbst.doc has the documentation for this style.
+ % "named" style (sorted keys of the form [name, year])
+ % Some code for this was taken from "named.bst".
ENTRY
{ address
@@ -57,76 +38,36 @@ ENTRY
type
volume
year
- eprint % urlbst
- doi % urlbst
- pubmed % urlbst
- url % urlbst
- lastchecked % urlbst
+ dvi
+ html
+ keywords
+ pdf
+ postscript
+ url
+ doi
+ mailto
}
{}
- { label }
+ { label extra.label sort.label }
-INTEGERS { output.state before.all mid.sentence after.sentence after.block doiform }
+INTEGERS { output.state before.all mid.sentence after.sentence after.block }
-STRINGS { urlintro eprinturl eprintprefix doiprefix doiurl pubmedprefix pubmedurl openinlinelink closeinlinelink } % urlbst...
-INTEGERS { inlinelinks makeinlinelink addeprints adddoiresolver addpubmedresolver }
-% Following constants may be adjusted by hand, if desired
-FUNCTION {init.urlbst.variables}
-{
- "Available from: " 'urlintro := % prefix before URL
- "http://arxiv.org/abs/" 'eprinturl := % prefix to make URL from eprint ref
- "arXiv:" 'eprintprefix := % text prefix printed before eprint ref
- "http://dx.doi.org/" 'doiurl := % prefix to make URL from DOI
- "doi:" 'doiprefix := % text prefix printed before DOI ref
- "http://www.ncbi.nlm.nih.gov/pubmed/" 'pubmedurl := % prefix to make URL from PUBMED
- "PMID:" 'pubmedprefix := % text prefix printed before PUBMED ref
- #1 'addeprints := % 0=no eprints; 1=include eprints
- #1 'adddoiresolver := % 0=no DOI resolver; 1=include it
- #1 'addpubmedresolver := % 0=no PUBMED resolver; 1=include it
- #1 'inlinelinks := % 0=URLs explicit; 1=URLs attached to titles
- #1 'doiform := % 0=simple, but can produce invalid HTML; 1=needs post-processing
- % the following are internal state variables, not config constants
- #0 'makeinlinelink := % state variable managed by possibly.setup.inlinelink
- "" 'openinlinelink := % ditto
- "" 'closeinlinelink := % ditto
-}
-INTEGERS {
- bracket.state
- outside.brackets
- open.brackets
- within.brackets
- close.brackets
- close.first.block
-}
-% ...urlbst to here
FUNCTION {init.state.consts}
-{ #0 'outside.brackets := % urlbst
- #1 'open.brackets :=
- #2 'within.brackets :=
- #3 'close.brackets :=
-
- #0 'before.all :=
+{ #0 'before.all :=
#1 'mid.sentence :=
#2 'after.sentence :=
#3 'after.block :=
- #0 'close.first.block :=
}
STRINGS { s t }
-% urlbst
-FUNCTION {output.nonnull.original}
+FUNCTION {output.nonnull}
{ 's :=
output.state mid.sentence =
{ ", " * write$ }
{ output.state after.block =
{ add.period$ write$
- % close the <dt> after the end of the first block
- close.first.block
- { newline$
- #0 'close.first.block := }
- { newline$ }
- if$
+ newline$
}
{ output.state before.all =
'write$
@@ -140,84 +81,6 @@ FUNCTION {output.nonnull.original}
s
}
-% urlbst...
-% The following three functions are for handling inlinelink. They wrap
-% a block of text which is potentially output with write$ by multiple
-% other functions, so we don't know the content a priori.
-% They communicate between each other using the variables makeinlinelink
-% (which is true if a link should be made), and closeinlinelink (which holds
-% the string which should close any current link. They can be called
-% at any time, but start.inlinelink will be a no-op unless something has
-% previously set makeinlinelink true, and the two ...end.inlinelink functions
-% will only do their stuff if start.inlinelink has previously set
-% closeinlinelink to be non-empty.
-FUNCTION {possibly.setup.inlinelink}
-{ makeinlinelink
- { "<a href=" quote$ * url * quote$ * ">" * 'openinlinelink :=
- "</a>" 'closeinlinelink :=
- #0 'makeinlinelink := }
- 'skip$
- if$ % makeinlinelink
-}
-FUNCTION {add.inlinelink}
-{ openinlinelink empty$
- 'skip$
- { openinlinelink swap$ * closeinlinelink *
- "" 'openinlinelink :=
- }
- if$
-}
-FUNCTION {output.nonnull}
-{ % Save the thing we've been asked to output
- 's :=
- % If the bracket-state is close.brackets, then add a close-bracket to
- % what is currently at the top of the stack, and set bracket.state
- % to outside.brackets
- bracket.state close.brackets =
- { "]" *
- outside.brackets 'bracket.state :=
- }
- 'skip$
- if$
- bracket.state outside.brackets =
- { % We're outside all brackets -- this is the normal situation.
- % Write out what's currently at the top of the stack, using the
- % original output.nonnull function.
- s
- add.inlinelink
- output.nonnull.original % invoke the original output.nonnull
- }
- { % Still in brackets. Add open-bracket or (continuation) comma, add the
- % new text (in s) to the top of the stack, and move to the close-brackets
- % state, ready for next time (unless inbrackets resets it). If we come
- % into this branch, then output.state is carefully undisturbed.
- bracket.state open.brackets =
- { " [" * }
- { ", " * } % bracket.state will be within.brackets
- if$
- s *
- close.brackets 'bracket.state :=
- }
- if$
-}
-
-% Call this function just before adding something which should be presented in
-% brackets. bracket.state is handled specially within output.nonnull.
-FUNCTION {inbrackets}
-{ bracket.state close.brackets =
- { within.brackets 'bracket.state := } % reset the state: not open nor closed
- { open.brackets 'bracket.state := }
- if$
-}
-
-FUNCTION {format.lastchecked}
-{ lastchecked empty$
- { "" }
- { inbrackets "cited " lastchecked * }
- if$
-}
-% ...urlbst to here
-
FUNCTION {output}
{ duplicate$ empty$
'pop$
@@ -233,21 +96,50 @@ FUNCTION {output.check}
if$
}
-FUNCTION {output.bibitem.original}
+FUNCTION {output.bibitem}
{ newline$
- cite$ write$
- newline$
- "[" label * "] " * write$
- % the <dt> is closed within output.nonnull, as long as close.first.block is true
- #1 'close.first.block :=
- newline$
+ author empty$
+ { editor empty$
+ { organization empty$
+ 'skip$
+ { "<!-- Authors: " organization purify$ * " -->" * write$ newline$ }
+ if$
+ }
+ { "<!-- Authors: " editor purify$ * " -->" * write$ newline$ }
+ if$
+ }
+ { "<!-- Authors: " author purify$ * " -->" * write$ newline$ }
+ if$
+ keywords empty$
+ 'skip$
+ { "<!-- Keywords: " keywords * " -->" * write$ newline$ }
+ if$
+ "<dt><a name=" quote$ * "CITEREF_" * cite$ * quote$ * ">[" * label * "]</a></dt><dd>" * write$
""
before.all 'output.state :=
}
-FUNCTION {fin.entry.original}
+FUNCTION {fin.entry}
{ add.period$
write$
+ postscript empty$
+ 'skip$
+ { newline$ "<!-- PostScript: " postscript * " -->" * write$ }
+ if$
+ pdf empty$
+ 'skip$
+ { newline$ "<!-- PDF: " pdf * " -->" * write$ }
+ if$
+ dvi empty$
+ 'skip$
+ { newline$ "<!-- DVI: " dvi * " -->" * write$ }
+ if$
+ doi empty$
+ 'skip$
+ { newline$ "<!-- DOI: " doi * " -->" * write$ }
+ if$
+ "</dd>" write$
+ newline$
newline$
}
@@ -287,6 +179,22 @@ FUNCTION {or}
if$
}
+FUNCTION {str.to.int}
+{
+ 's :=
+ #0
+ { s empty$ not }
+ { % Multiply the number on the top of the stack by 10 = 1010 binary
+ duplicate$ + % x2
+ duplicate$ % x2 x2
+ duplicate$ + duplicate$ + % x2 x8
+ +
+ s #1 #1 substring$ chr.to.int$ #48 - + % #48 is ascii for '0'
+ s #2 global.max$ substring$ 's :=
+ }
+ while$
+}
+
FUNCTION {new.block.checka}
{ empty$
'skip$
@@ -326,17 +234,39 @@ FUNCTION {field.or.null}
if$
}
-FUNCTION {bold}
+FUNCTION {emphasize}
{ duplicate$ empty$
{ pop$ "" }
- { "<b>" swap$ * "</b>" * }
+ { "<em>" swap$ * "</em>" * }
if$
}
-FUNCTION {emphasize}
-{ duplicate$ empty$
- { pop$ "" }
- { "<em>" swap$ * "</em>" * }
+FUNCTION {add.link} % title
+{
+ 't :=
+ t empty$
+ { "" }
+ { url empty$
+ { html empty$
+ { t }
+ { "<a href=" quote$ * html * quote$ * ">" * t * "</a>" * }
+ if$ }
+ { "<a href=" quote$ * url * quote$ * ">" * t * "</a>" * }
+ if$
+ }
+ if$
+}
+
+FUNCTION {add.mailto} % authors
+{
+ 't :=
+ t empty$
+ { "" }
+ { mailto empty$
+ { t }
+ { "<a href=" quote$ * "mailto:" * mailto * quote$ * ">" * t * "</a>" * }
+ if$
+ }
if$
}
@@ -349,6 +279,7 @@ FUNCTION {format.names}
numnames 'namesleft :=
{ namesleft #0 > }
{ s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ 't :=
+ "\bibxhtmlname{" t * "}" * 't :=
nameptr #1 >
{ namesleft #1 >
{ ", " * t * }
@@ -376,7 +307,7 @@ FUNCTION {format.authors}
{ "" }
{ author format.names }
if$
- bold
+ add.mailto
}
FUNCTION {format.editors}
@@ -396,6 +327,7 @@ FUNCTION {format.title}
{ "" }
{ title "t" change.case$ }
if$
+ add.link
}
FUNCTION {n.dashify}
@@ -438,11 +370,11 @@ FUNCTION {format.date}
if$
}
if$
- bold
}
FUNCTION {format.btitle}
{ title emphasize
+ add.link
}
FUNCTION {tie.or.space.connect}
@@ -616,18 +548,20 @@ FUNCTION {format.tr.number}
}
FUNCTION {format.article.crossref}
-{ key empty$
+{
+ "In <a href=" quote$ * "#" * crossref * quote$ * ">" *
+ key empty$
{ journal empty$
{ "need key or journal for " cite$ * " to crossref " * crossref *
warning$
""
}
- { "In <em>" journal * "</em>" * }
+ { "<cite>" * journal * "</cite>" * }
if$
}
- { "In " key * }
+ { key * }
if$
- " <span class='cite'>" * crossref * "</span>" *
+ "</a> \citelabel{" * crossref * "}" *
}
FUNCTION {format.crossref.editor}
@@ -656,6 +590,7 @@ FUNCTION {format.book.crossref}
" of " *
}
if$
+ "<a href=" * quote$ * "#" * crossref * quote$ * ">" *
editor empty$
editor field.or.null author field.or.null =
or
@@ -665,7 +600,7 @@ FUNCTION {format.book.crossref}
crossref * warning$
"" *
}
- { "<em>" * series * "</em>" * }
+ { "<cite>" * series * "</cite>" * }
if$
}
{ key * }
@@ -673,11 +608,13 @@ FUNCTION {format.book.crossref}
}
{ format.crossref.editor * }
if$
- " <span class='cite'>" * crossref * "</span>" *
+ "</a> \citelabel{" * crossref * "}" *
}
FUNCTION {format.incoll.inproc.crossref}
-{ editor empty$
+{
+ "In <a href=" quote$ * "#" * crossref * quote$ * ">" *
+ editor empty$
editor field.or.null author field.or.null =
or
{ key empty$
@@ -686,171 +623,26 @@ FUNCTION {format.incoll.inproc.crossref}
crossref * warning$
""
}
- { "In <em>" booktitle * "</em>" * }
+ { "<cite>" * booktitle * "</cite>" * }
if$
}
- { "In " key * }
+ { key * }
if$
}
- { "In " format.crossref.editor * }
- if$
- " <span class='cite'>" * crossref * "</span>" *
-}
-
-% urlbst...
-% Functions for making hypertext links.
-FUNCTION {make.href}
-{
- "<a href='" swap$ * "'><code>" * swap$ * "</code></a>" *
-}
-
-% If inlinelinks is true, then format.url should be a no-op, since it's
-% (a) redundant, and (b) could end up as a link-within-a-link.
-FUNCTION {format.url}
-{ inlinelinks #1 = url empty$ or
- { "" }
- { urlintro "<code>" * url * "</code>" * }
- if$
-}
-
-FUNCTION {format.eprint}
-{ eprint empty$
- { "" }
- { eprintprefix eprint * eprinturl eprint * make.href }
- if$
-}
-
-FUNCTION {format.doi}
-{ doi empty$
- { "" }
- { doiform #0 =
- { doiprefix doi * doiurl doi * make.href }
- { "DOI:{" doi * "}" * }
- if$
- }
- if$
-}
-
-FUNCTION {format.pubmed}
-{ pubmed empty$
- { "" }
- { pubmedprefix pubmed * pubmedurl pubmed * make.href }
- if$
-}
-
-% Output a URL. We can't use the more normal idiom (something like
-% `format.url output'), because the `inbrackets' within
-% format.lastchecked applies to everything between calls to `output',
-% so that `format.url format.lastchecked * output' ends up with both
-% the URL and the lastchecked in brackets.
-FUNCTION {output.url}
-{ url empty$
- 'skip$
- { new.block
- format.url output
- format.lastchecked output
- }
- if$
-}
-
-FUNCTION {output.web.refs}
-{
- new.block
- output.url
- addeprints eprint empty$ not and
- { format.eprint output.nonnull }
- 'skip$
- if$
- adddoiresolver doi empty$ not and
- { format.doi output.nonnull }
- 'skip$
- if$
- addpubmedresolver pubmed empty$ not and
- { format.pubmed output.nonnull }
- 'skip$
- if$
-}
-
-% Wrapper for output.bibitem.original.
-% If the URL field is not empty, set makeinlinelink to be true,
-% so that an inline link will be started at the next opportunity
-FUNCTION {output.bibitem}
-{ outside.brackets 'bracket.state :=
- output.bibitem.original
- inlinelinks url empty$ not and
- { #1 'makeinlinelink := }
- { #0 'makeinlinelink := }
- if$
-}
-
-% Wrapper for fin.entry.original
-FUNCTION {fin.entry}
-{ output.web.refs % urlbst
- makeinlinelink % ooops, it appears we didn't have a title for inlinelink
- { possibly.setup.inlinelink % add some artificial link text here, as a fallback
- "[link]" output.nonnull }
- 'skip$
- if$
- bracket.state close.brackets = % urlbst
- { "]" * }
- 'skip$
- if$
- fin.entry.original
-}
-
-% Webpage entry type.
-% Title and url fields required;
-% author, note, year, month, and lastchecked fields optional
-% See references
-% ISO 690-2 http://www.nlc-bnc.ca/iso/tc46sc9/standard/690-2e.htm
-% http://www.classroom.net/classroom/CitingNetResources.html
-% http://neal.ctstateu.edu/history/cite.html
-% http://www.cas.usf.edu/english/walker/mla.html
-% for citation formats for web pages.
-FUNCTION {webpage}
-{ output.bibitem
- author empty$
- { editor empty$
- 'skip$ % author and editor both optional
- { format.editors output.nonnull }
- if$
- }
- { editor empty$
- { format.authors output.nonnull }
- { "can't use both author and editor fields in " cite$ * warning$ }
- if$
- }
- if$
- new.block
- title empty$ 'skip$ 'possibly.setup.inlinelink if$
- format.title "title" output.check
- inbrackets "online" output
- new.block
- year empty$
- 'skip$
- { format.date "year" output.check }
+ { format.crossref.editor * }
if$
- % We don't need to output the URL details ('lastchecked' and 'url'),
- % because fin.entry does that for us, using output.web.refs. The only
- % reason we would want to put them here is if we were to decide that
- % they should go in front of the rather miscellaneous information in 'note'.
- new.block
- note output
- fin.entry
+ "</a> \citelabel{" * crossref * "}" *
}
-% ...urlbst to here
-
FUNCTION {article}
{ output.bibitem
format.authors "author" output.check
new.block
- title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst
format.title "title" output.check
new.block
crossref missing$
{ journal emphasize "journal" output.check
- possibly.setup.inlinelink format.vol.num.pages output% urlbst
+ format.vol.num.pages output
format.date "year" output.check
}
{ format.article.crossref output.nonnull
@@ -874,7 +666,6 @@ FUNCTION {book}
}
if$
new.block
- title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst
format.btitle "title" output.check
crossref missing$
{ format.bvolume output
@@ -899,7 +690,6 @@ FUNCTION {booklet}
{ output.bibitem
format.authors output
new.block
- title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst
format.title "title" output.check
howpublished address new.block.checkb
howpublished output
@@ -922,7 +712,6 @@ FUNCTION {inbook}
}
if$
new.block
- title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst
format.btitle "title" output.check
crossref missing$
{ format.bvolume output
@@ -949,7 +738,6 @@ FUNCTION {incollection}
{ output.bibitem
format.authors "author" output.check
new.block
- title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst
format.title "title" output.check
new.block
crossref missing$
@@ -976,7 +764,6 @@ FUNCTION {inproceedings}
{ output.bibitem
format.authors "author" output.check
new.block
- title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst
format.title "title" output.check
new.block
crossref missing$
@@ -1022,7 +809,6 @@ FUNCTION {manual}
{ format.authors output.nonnull }
if$
new.block
- title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst
format.btitle "title" output.check
author empty$
{ organization empty$
@@ -1048,7 +834,6 @@ FUNCTION {mastersthesis}
{ output.bibitem
format.authors "author" output.check
new.block
- title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst
format.title "title" output.check
new.block
"Master's thesis" format.thesis.type output.nonnull
@@ -1064,7 +849,6 @@ FUNCTION {misc}
{ output.bibitem
format.authors output
title howpublished new.block.checkb
- title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst
format.title output
howpublished new.block.checka
howpublished output
@@ -1079,7 +863,6 @@ FUNCTION {phdthesis}
{ output.bibitem
format.authors "author" output.check
new.block
- title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst
format.btitle "title" output.check
new.block
"PhD thesis" format.thesis.type output.nonnull
@@ -1098,7 +881,6 @@ FUNCTION {proceedings}
{ format.editors output.nonnull }
if$
new.block
- title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst
format.btitle "title" output.check
format.bvolume output
format.number.series output
@@ -1131,7 +913,6 @@ FUNCTION {techreport}
{ output.bibitem
format.authors "author" output.check
new.block
- title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst
format.title "title" output.check
new.block
format.tr.number output.nonnull
@@ -1147,7 +928,6 @@ FUNCTION {unpublished}
{ output.bibitem
format.authors "author" output.check
new.block
- title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst
format.title "title" output.check
new.block
note "note" output.check
@@ -1156,37 +936,70 @@ FUNCTION {unpublished}
}
FUNCTION {default.type} { misc }
+
MACRO {jan} {"January"}
+
MACRO {feb} {"February"}
+
MACRO {mar} {"March"}
+
MACRO {apr} {"April"}
+
MACRO {may} {"May"}
+
MACRO {jun} {"June"}
+
MACRO {jul} {"July"}
+
MACRO {aug} {"August"}
+
MACRO {sep} {"September"}
+
MACRO {oct} {"October"}
+
MACRO {nov} {"November"}
+
MACRO {dec} {"December"}
+
MACRO {acmcs} {"ACM Computing Surveys"}
+
MACRO {acta} {"Acta Informatica"}
+
MACRO {cacm} {"Communications of the ACM"}
+
MACRO {ibmjrd} {"IBM Journal of Research and Development"}
+
MACRO {ibmsj} {"IBM Systems Journal"}
+
MACRO {ieeese} {"IEEE Transactions on Software Engineering"}
+
MACRO {ieeetc} {"IEEE Transactions on Computers"}
-MACRO {ieeetcad} {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}
+
+MACRO {ieeetcad}
+ {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}
+
MACRO {ipl} {"Information Processing Letters"}
+
MACRO {jacm} {"Journal of the ACM"}
+
MACRO {jcss} {"Journal of Computer and System Sciences"}
+
MACRO {scp} {"Science of Computer Programming"}
+
MACRO {sicomp} {"SIAM Journal on Computing"}
+
MACRO {tocs} {"ACM Transactions on Computer Systems"}
+
MACRO {tods} {"ACM Transactions on Database Systems"}
+
MACRO {tog} {"ACM Transactions on Graphics"}
+
MACRO {toms} {"ACM Transactions on Mathematical Software"}
+
MACRO {toois} {"ACM Transactions on Office Information Systems"}
+
MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"}
+
MACRO {tcs} {"Theoretical Computer Science"}
READ
@@ -1207,6 +1020,177 @@ FUNCTION {chop.word}
if$
}
+
+FUNCTION {format.lab.names}
+{ 's :=
+ s num.names$ 'numnames :=
+ numnames #1 =
+ { s #1 "{vv }{ll}" format.name$ }
+ { numnames #2 =
+ { s #1 "{vv }{ll }and " format.name$ s #2 "{vv }{ll}" format.name$ * }
+ { s #1 "{vv }{ll }" format.name$ "et~al." * }
+ if$
+ }
+ if$
+}
+
+FUNCTION {author.key.label}
+{ author empty$
+ { key empty$
+ { cite$ #1 #3 substring$ }
+ { key }
+ if$
+ }
+ { author format.lab.names }
+ if$
+}
+
+FUNCTION {author.editor.key.label}
+{ author empty$
+ { editor empty$
+ { key empty$
+ { cite$ #1 #3 substring$ }
+ { key }
+ if$
+ }
+ { editor format.lab.names }
+ if$
+ }
+ { author format.lab.names }
+ if$
+}
+
+FUNCTION {author.key.organization.label}
+{ author empty$
+ { key empty$
+ { organization empty$
+ { cite$ #1 #3 substring$ }
+ { "The " #4 organization chop.word #3 text.prefix$ }
+ if$
+ }
+ { key }
+ if$
+ }
+ { author format.lab.names }
+ if$
+}
+
+FUNCTION {editor.key.organization.label}
+{ editor empty$
+ { key empty$
+ { organization empty$
+ { cite$ #1 #3 substring$ }
+ { "The " #4 organization chop.word #3 text.prefix$ }
+ if$
+ }
+ { key }
+ if$
+ }
+ { editor format.lab.names }
+ if$
+}
+
+FUNCTION {month.to.int}
+{
+ "l" change.case$ #3 text.prefix$
+ 's :=
+ s "jan" = { #1 } {
+ s "feb" = { #2 } {
+ s "mar" = { #3 } {
+ s "apr" = { #4 } {
+ s "may" = { #5 } {
+ s "jun" = { #6 } {
+ s "jul" = { #7 } {
+ s "aug" = { #8 } {
+ s "sep" = { #9 } {
+ s "oct" = { #10 } {
+ s "nov" = { #11 } {
+ s "dec" = { #12 } { #13 } % 13 if nothing matches
+ if$}if$}if$}if$}if$}if$}if$}if$}if$}if$}if$}if$
+}
+
+INTEGERS { done c }
+FUNCTION { get.day }
+{ month field.or.null 's :=
+
+ % Strip out month name
+ #0 'done :=
+ { s "" = not done not and }
+ { s #1 #1 substring$ " " = 'done :=
+ s #2 global.max$ substring$ 's :=
+ }
+ while$
+
+ % Build up first number in t
+ "0" 't :=
+ #0 'done :=
+ { s "" = not done not and }
+ { s #1 #1 substring$ chr.to.int$ 'c :=
+ c #47 > c #58 < and
+ { t c int.to.chr$ * 't := }
+ { #1 'done := }
+ if$
+ s #2 global.max$ substring$ 's :=
+ }
+ while$
+
+ t str.to.int
+}
+
+FUNCTION { sortify.fourdigit }
+{ 's :=
+ s empty$
+ { "0000" }
+ { s
+ }
+ if$
+}
+
+FUNCTION { sortify.twodigit }
+{ 's :=
+ s empty$
+ { "00" }
+ { s
+ str.to.int #10 + int.to.str$
+ }
+ if$
+}
+
+FUNCTION {calc.label}
+{ type$ "book" =
+ type$ "inbook" =
+ or
+ 'author.editor.key.label
+ { type$ "proceedings" =
+ 'editor.key.organization.label
+ { type$ "manual" =
+ 'author.key.organization.label
+ 'author.key.label
+ if$
+ }
+ if$
+ }
+ if$
+ duplicate$
+
+ year empty$
+ 'skip$
+ { ", " * }
+ if$
+ year field.or.null purify$ * % CHANGED - pfps - 15 Feb 1989
+ 'label :=
+
+ year field.or.null purify$
+ #-1 #4 substring$
+ sortify.fourdigit
+ " " *
+ month field.or.null month.to.int int.to.str$ sortify.twodigit *
+ " " *
+ get.day int.to.str$ sortify.twodigit *
+ " " *
+ * sortify 'sort.label :=
+}
+
FUNCTION {sort.format.names}
{ 's :=
#1 'nameptr :=
@@ -1220,7 +1204,7 @@ FUNCTION {sort.format.names}
if$
s nameptr "{vv{ } }{ll{ }}{ ff{ }}{ jj{ }}" format.name$ 't :=
nameptr numnames = t "others" = and
- { "et al" * }
+ { "et al." * }
{ t sortify * }
if$
nameptr #1 + 'nameptr :=
@@ -1304,36 +1288,9 @@ FUNCTION {editor.organization.sort}
if$
}
-FUNCTION {presort.by.author}
-{ type$ "book" =
- type$ "inbook" =
- or
- 'author.editor.sort
- { type$ "proceedings" =
- 'editor.organization.sort
- { type$ "manual" =
- 'author.organization.sort
- 'author.sort
- if$
- }
- if$
- }
- if$
- " "
- *
- year field.or.null sortify
- *
- " "
- *
- title field.or.null
- sort.format.title
- *
- #1 entry.max$ substring$
- 'sort.key$ :=
-}
-
-FUNCTION {presort.by.year}
-{ year field.or.null sortify
+FUNCTION {presort}
+{ calc.label
+ sort.label
" "
*
type$ "book" =
@@ -1353,6 +1310,10 @@ FUNCTION {presort.by.year}
*
" "
*
+ year field.or.null sortify
+ *
+ " "
+ *
title field.or.null
sort.format.title
*
@@ -1360,55 +1321,68 @@ FUNCTION {presort.by.year}
'sort.key$ :=
}
-ITERATE {presort.by.author}
+ITERATE {presort}
SORT
-STRINGS { longest.label }
+STRINGS { longest.label last.sort.label next.extra }
-INTEGERS { number.label longest.label.width }
+INTEGERS { longest.label.width last.extra.num }
FUNCTION {initialize.longest.label}
{ "" 'longest.label :=
- #1 'number.label :=
+ #0 int.to.chr$ 'last.sort.label :=
+ "" 'next.extra :=
#0 'longest.label.width :=
+ #0 'last.extra.num :=
+}
+
+FUNCTION {forward.pass}
+{ last.sort.label sort.label =
+ { last.extra.num #1 + 'last.extra.num :=
+ last.extra.num int.to.chr$ 'extra.label :=
+ }
+ { "a" chr.to.int$ 'last.extra.num :=
+ "" 'extra.label :=
+ sort.label 'last.sort.label :=
+ }
+ if$
}
-FUNCTION {longest.label.pass}
-{ number.label int.to.str$ 'label :=
- number.label #1 + 'number.label :=
+FUNCTION {reverse.pass}
+{ next.extra "b" =
+ { "a" 'extra.label := }
+ 'skip$
+ if$
+ label extra.label * 'label :=
label width$ longest.label.width >
{ label 'longest.label :=
label width$ 'longest.label.width :=
}
'skip$
if$
+ extra.label 'next.extra :=
}
EXECUTE {initialize.longest.label}
-ITERATE {longest.label.pass}
+ITERATE {forward.pass}
+
+REVERSE {reverse.pass}
FUNCTION {begin.bib}
-{ preamble$ empty$
- 'skip$
- { preamble$ write$ newline$ }
- if$
- %"/** \page bibref References" write$ newline$
- newline$
+{
+ "# label-style: default" write$ newline$
}
EXECUTE {begin.bib}
-EXECUTE {init.urlbst.variables}
EXECUTE {init.state.consts}
ITERATE {call.type$}
FUNCTION {end.bib}
{ newline$
- %"*/" write$ newline$
}
EXECUTE {end.bib}
-
diff --git a/src/doxygen.cpp b/src/doxygen.cpp
index 85cb417..809696a 100644
--- a/src/doxygen.cpp
+++ b/src/doxygen.cpp
@@ -149,6 +149,7 @@ IndexList Doxygen::indexList;
int Doxygen::subpageNestingLevel = 0;
bool Doxygen::userComments = FALSE;
QCString Doxygen::spaces;
+bool Doxygen::generatingXmlOutput = FALSE;
// locally accessible globals
static QDict<EntryNav> g_classEntries(1009);
@@ -252,8 +253,11 @@ static STLInfo g_stlinfo[] =
{
// className baseClass1 baseClass2 templType1 templName1 templType2 templName2 virtInheritance // iterators
{ "allocator", 0, 0, "T", "elements", 0, 0, FALSE, FALSE },
- { "auto_ptr", 0, 0, "T", "ptr", 0, 0, FALSE, FALSE },
- { "ios_base", 0, 0, 0, 0, 0, 0, FALSE, FALSE },
+ { "auto_ptr", 0, 0, "T", "ptr", 0, 0, FALSE, FALSE }, // deprecated
+ { "smart_ptr", 0, 0, "T", "ptr", 0, 0, FALSE, FALSE }, // C++11
+ { "unique_ptr", 0, 0, "T", "ptr", 0, 0, FALSE, FALSE }, // C++11
+ { "weak_ptr", 0, 0, "T", "ptr", 0, 0, FALSE, FALSE }, // C++11
+ { "ios_base", 0, 0, 0, 0, 0, 0, FALSE, FALSE }, // C++11
{ "basic_ios", "ios_base", 0, "Char", 0, 0, 0, FALSE, FALSE },
{ "basic_istream", "basic_ios<Char>", 0, "Char", 0, 0, 0, TRUE, FALSE },
{ "basic_ostream", "basic_ios<Char>", 0, "Char", 0, 0, 0, TRUE, FALSE },
@@ -321,7 +325,7 @@ static void addSTLMember(EntryNav *rootNav,const char *type,const char *name)
Entry *memEntry = new Entry;
memEntry->name = name;
memEntry->type = type;
- memEntry->protection = Private;
+ memEntry->protection = Public;
memEntry->section = Entry::VARIABLE_SEC;
memEntry->brief = "STL member";
memEntry->hidden = FALSE;
@@ -415,6 +419,22 @@ static void addSTLClasses(EntryNav *rootNav)
{
addSTLMember(classEntryNav,info->templType2,info->templName2);
}
+ if (fullName=="std::auto_ptr" || fullName=="std::smart_ptr" ||
+ fullName=="std::unique_ptr" || fullName=="std::weak_ptr")
+ {
+ Entry *memEntry = new Entry;
+ memEntry->name = "operator->";
+ memEntry->args = "()";
+ memEntry->type = "T*";
+ memEntry->protection = Public;
+ memEntry->section = Entry::FUNCTION_SEC;
+ memEntry->brief = "STL member";
+ memEntry->hidden = FALSE;
+ memEntry->artificial = FALSE;
+ EntryNav *memEntryNav = new EntryNav(classEntryNav,memEntry);
+ memEntryNav->setEntry(memEntry);
+ classEntryNav->addChild(memEntryNav);
+ }
if (info->baseClass1)
{
classEntry->extends->append(new BaseInfo(info->baseClass1,Public,info->virtualInheritance?Virtual:Normal));
@@ -10561,8 +10581,8 @@ void parseInput()
computeDirDependencies();
}
- msg("Resolving citations...\n");
- Doxygen::citeDict->resolve();
+ //msg("Resolving citations...\n");
+ //Doxygen::citeDict->resolve();
msg("Generating citations page...\n");
Doxygen::citeDict->generatePage();
@@ -10853,7 +10873,9 @@ void generateOutput()
if (Config_getBool("GENERATE_XML"))
{
msg("Generating XML output...\n");
+ Doxygen::generatingXmlOutput=TRUE;
generateXML();
+ Doxygen::generatingXmlOutput=FALSE;
}
if (Config_getBool("GENERATE_AUTOGEN_DEF"))
{
diff --git a/src/doxygen.h b/src/doxygen.h
index 401c37f..c7664c0 100644
--- a/src/doxygen.h
+++ b/src/doxygen.h
@@ -133,6 +133,7 @@ class Doxygen
static IndexList indexList;
static int subpageNestingLevel;
static QCString spaces;
+ static bool generatingXmlOutput;
};
void initDoxygen();
diff --git a/src/doxygen_bst.h b/src/doxygen_bst.h
index 6298713..c51f2df 100644
--- a/src/doxygen_bst.h
+++ b/src/doxygen_bst.h
@@ -1,31 +1,10 @@
-"%% doxygen.bst\n"
-"%% This is a modification of plainhtml.bst; the original copyright notice\n"
-"%% follows.\n"
-"\n"
-"%% ORIGINAL COPYRIGHT NOTICE OF plainhtml.bst\n"
-"%%\n"
-"%% plainhtml.bst\n"
-"%%\n"
-"%% Part of bibhtml, version 2.0.1, released 2009 November 2\n"
-"%% Hg node 6ca3807543d6.\n"
-"%% See <http://purl.org/nxg/dist/bibhtml>\n"
-"%%\n"
-"%% Copyright 1999, 2005, 2006, 2009, Norman Gray <norman@astro.gla.ac.uk>\n"
-"%%\n"
-"%% This is a modification of a modification!\n"
-"%%\n"
-"%%% Modification of BibTeX style file /usr/local/texlive/2008/texmf-dist/bibtex/bst/base/plain.bst\n"
-"%%% ... by urlbst, version 0.6-4 (marked with \"% urlbst\")\n"
-"%%% See <http://purl.org/nxg/dist/urlbst>\n"
-"%%% Added webpage entry type, and url and lastchecked fields.\n"
-"%%% Added eprint support.\n"
-"%%% Added DOI support.\n"
-"%%% Added PUBMED support.\n"
-"%%% Added hyperref support.\n"
-"%%% Original headers follow...\n"
-"\n"
-"% BibTeX standard bibliography style `plain'\n"
-" % version 0.99a for BibTeX versions 0.99a or later, LaTeX version 2.09.\n"
+" % \n"
+" % \n"
+" % This file is either \"html-btxbst.doc\" or was derived from\n"
+" % \"html-btxbst.doc\" using cpp. \"html-btxbst.doc\" itself was edited\n"
+" % from \"btxbst.doc\" and \"named.bst\".\n"
+" % The following copyright information is from btxbst.doc:\n"
+" % version 0.99b for BibTeX versions 0.99a or later, LaTeX version 2.09.\n"
" % Copyright (C) 1985, all rights reserved.\n"
" % Copying of this file is authorized only if either\n"
" % (1) you make absolutely no changes to your copy, including name, or\n"
@@ -33,6 +12,8 @@
" % btxbst.doc, plain.bst, unsrt.bst, alpha.bst, and abbrv.bst.\n"
" % This restriction helps ensure that all standard styles are identical.\n"
" % The file btxbst.doc has the documentation for this style.\n"
+" % \"named\" style (sorted keys of the form [name, year])\n"
+" % Some code for this was taken from \"named.bst\".\n"
"\n"
"ENTRY\n"
" { address\n"
@@ -57,76 +38,36 @@
" type\n"
" volume\n"
" year\n"
-" eprint % urlbst\n"
-" doi % urlbst\n"
-" pubmed % urlbst\n"
-" url % urlbst\n"
-" lastchecked % urlbst\n"
+" dvi\n"
+" html\n"
+" keywords\n"
+" pdf\n"
+" postscript\n"
+" url\n"
+" doi\n"
+" mailto\n"
" }\n"
" {}\n"
-" { label }\n"
+" { label extra.label sort.label }\n"
"\n"
-"INTEGERS { output.state before.all mid.sentence after.sentence after.block doiform }\n"
+"INTEGERS { output.state before.all mid.sentence after.sentence after.block }\n"
"\n"
-"STRINGS { urlintro eprinturl eprintprefix doiprefix doiurl pubmedprefix pubmedurl openinlinelink closeinlinelink } % urlbst...\n"
-"INTEGERS { inlinelinks makeinlinelink addeprints adddoiresolver addpubmedresolver }\n"
-"% Following constants may be adjusted by hand, if desired\n"
-"FUNCTION {init.urlbst.variables}\n"
-"{\n"
-" \"Available from: \" 'urlintro := % prefix before URL\n"
-" \"http://arxiv.org/abs/\" 'eprinturl := % prefix to make URL from eprint ref\n"
-" \"arXiv:\" 'eprintprefix := % text prefix printed before eprint ref\n"
-" \"http://dx.doi.org/\" 'doiurl := % prefix to make URL from DOI\n"
-" \"doi:\" 'doiprefix := % text prefix printed before DOI ref\n"
-" \"http://www.ncbi.nlm.nih.gov/pubmed/\" 'pubmedurl := % prefix to make URL from PUBMED\n"
-" \"PMID:\" 'pubmedprefix := % text prefix printed before PUBMED ref\n"
-" #1 'addeprints := % 0=no eprints; 1=include eprints\n"
-" #1 'adddoiresolver := % 0=no DOI resolver; 1=include it\n"
-" #1 'addpubmedresolver := % 0=no PUBMED resolver; 1=include it\n"
-" #1 'inlinelinks := % 0=URLs explicit; 1=URLs attached to titles\n"
-" #1 'doiform := % 0=simple, but can produce invalid HTML; 1=needs post-processing\n"
-" % the following are internal state variables, not config constants\n"
-" #0 'makeinlinelink := % state variable managed by possibly.setup.inlinelink\n"
-" \"\" 'openinlinelink := % ditto\n"
-" \"\" 'closeinlinelink := % ditto\n"
-"}\n"
-"INTEGERS { \n"
-" bracket.state\n"
-" outside.brackets\n"
-" open.brackets\n"
-" within.brackets\n"
-" close.brackets\n"
-" close.first.block\n"
-"}\n"
-"% ...urlbst to here\n"
"FUNCTION {init.state.consts}\n"
-"{ #0 'outside.brackets := % urlbst\n"
-" #1 'open.brackets :=\n"
-" #2 'within.brackets :=\n"
-" #3 'close.brackets :=\n"
-"\n"
-" #0 'before.all :=\n"
+"{ #0 'before.all :=\n"
" #1 'mid.sentence :=\n"
" #2 'after.sentence :=\n"
" #3 'after.block :=\n"
-" #0 'close.first.block :=\n"
"}\n"
"\n"
"STRINGS { s t }\n"
"\n"
-"% urlbst\n"
-"FUNCTION {output.nonnull.original}\n"
+"FUNCTION {output.nonnull}\n"
"{ 's :=\n"
" output.state mid.sentence =\n"
" { \", \" * write$ }\n"
" { output.state after.block =\n"
" { add.period$ write$\n"
-" % close the <dt> after the end of the first block\n"
-" close.first.block\n"
-" { newline$\n"
-" #0 'close.first.block := }\n"
-" { newline$ }\n"
-" if$\n"
+" newline$\n"
" }\n"
" { output.state before.all =\n"
" 'write$\n"
@@ -140,84 +81,6 @@
" s\n"
"}\n"
"\n"
-"% urlbst...\n"
-"% The following three functions are for handling inlinelink. They wrap\n"
-"% a block of text which is potentially output with write$ by multiple\n"
-"% other functions, so we don't know the content a priori.\n"
-"% They communicate between each other using the variables makeinlinelink\n"
-"% (which is true if a link should be made), and closeinlinelink (which holds\n"
-"% the string which should close any current link. They can be called\n"
-"% at any time, but start.inlinelink will be a no-op unless something has\n"
-"% previously set makeinlinelink true, and the two ...end.inlinelink functions\n"
-"% will only do their stuff if start.inlinelink has previously set\n"
-"% closeinlinelink to be non-empty.\n"
-"FUNCTION {possibly.setup.inlinelink}\n"
-"{ makeinlinelink\n"
-" { \"<a href=\" quote$ * url * quote$ * \">\" * 'openinlinelink :=\n"
-" \"</a>\" 'closeinlinelink :=\n"
-" #0 'makeinlinelink := }\n"
-" 'skip$\n"
-" if$ % makeinlinelink\n"
-"}\n"
-"FUNCTION {add.inlinelink}\n"
-"{ openinlinelink empty$\n"
-" 'skip$\n"
-" { openinlinelink swap$ * closeinlinelink *\n"
-" \"\" 'openinlinelink :=\n"
-" }\n"
-" if$\n"
-"}\n"
-"FUNCTION {output.nonnull}\n"
-"{ % Save the thing we've been asked to output\n"
-" 's :=\n"
-" % If the bracket-state is close.brackets, then add a close-bracket to\n"
-" % what is currently at the top of the stack, and set bracket.state\n"
-" % to outside.brackets\n"
-" bracket.state close.brackets =\n"
-" { \"]\" *\n"
-" outside.brackets 'bracket.state :=\n"
-" }\n"
-" 'skip$\n"
-" if$\n"
-" bracket.state outside.brackets =\n"
-" { % We're outside all brackets -- this is the normal situation.\n"
-" % Write out what's currently at the top of the stack, using the\n"
-" % original output.nonnull function.\n"
-" s\n"
-" add.inlinelink\n"
-" output.nonnull.original % invoke the original output.nonnull\n"
-" }\n"
-" { % Still in brackets. Add open-bracket or (continuation) comma, add the\n"
-" % new text (in s) to the top of the stack, and move to the close-brackets\n"
-" % state, ready for next time (unless inbrackets resets it). If we come\n"
-" % into this branch, then output.state is carefully undisturbed.\n"
-" bracket.state open.brackets =\n"
-" { \" [\" * }\n"
-" { \", \" * } % bracket.state will be within.brackets\n"
-" if$ \n"
-" s * \n"
-" close.brackets 'bracket.state :=\n"
-" }\n"
-" if$\n"
-"}\n"
-"\n"
-"% Call this function just before adding something which should be presented in \n"
-"% brackets. bracket.state is handled specially within output.nonnull.\n"
-"FUNCTION {inbrackets}\n"
-"{ bracket.state close.brackets =\n"
-" { within.brackets 'bracket.state := } % reset the state: not open nor closed\n"
-" { open.brackets 'bracket.state := }\n"
-" if$\n"
-"}\n"
-"\n"
-"FUNCTION {format.lastchecked}\n"
-"{ lastchecked empty$\n"
-" { \"\" }\n"
-" { inbrackets \"cited \" lastchecked * }\n"
-" if$\n"
-"}\n"
-"% ...urlbst to here\n"
-"\n"
"FUNCTION {output}\n"
"{ duplicate$ empty$\n"
" 'pop$\n"
@@ -233,21 +96,50 @@
" if$\n"
"}\n"
"\n"
-"FUNCTION {output.bibitem.original}\n"
+"FUNCTION {output.bibitem}\n"
"{ newline$\n"
-" cite$ write$\n"
-" newline$\n"
-" \"[\" label * \"] \" * write$\n"
-" % the <dt> is closed within output.nonnull, as long as close.first.block is true\n"
-" #1 'close.first.block :=\n"
-" newline$\n"
+" author empty$\n"
+" { editor empty$\n"
+" { organization empty$\n"
+" 'skip$\n"
+" { \"<!-- Authors: \" organization purify$ * \" -->\" * write$ newline$ }\n"
+" if$\n"
+" } \n"
+" { \"<!-- Authors: \" editor purify$ * \" -->\" * write$ newline$ }\n"
+" if$\n"
+" }\n"
+" { \"<!-- Authors: \" author purify$ * \" -->\" * write$ newline$ }\n"
+" if$\n"
+" keywords empty$\n"
+" 'skip$\n"
+" { \"<!-- Keywords: \" keywords * \" -->\" * write$ newline$ }\n"
+" if$\n"
+" \"<dt><a name=\" quote$ * \"CITEREF_\" * cite$ * quote$ * \">[\" * label * \"]</a></dt><dd>\" * write$\n"
" \"\"\n"
" before.all 'output.state :=\n"
"}\n"
"\n"
-"FUNCTION {fin.entry.original}\n"
+"FUNCTION {fin.entry}\n"
"{ add.period$\n"
" write$\n"
+" postscript empty$\n"
+" 'skip$\n"
+" { newline$ \"<!-- PostScript: \" postscript * \" -->\" * write$ }\n"
+" if$\n"
+" pdf empty$\n"
+" 'skip$\n"
+" { newline$ \"<!-- PDF: \" pdf * \" -->\" * write$ }\n"
+" if$\n"
+" dvi empty$\n"
+" 'skip$\n"
+" { newline$ \"<!-- DVI: \" dvi * \" -->\" * write$ }\n"
+" if$\n"
+" doi empty$\n"
+" 'skip$\n"
+" { newline$ \"<!-- DOI: \" doi * \" -->\" * write$ }\n"
+" if$\n"
+" \"</dd>\" write$\n"
+" newline$\n"
" newline$\n"
"}\n"
"\n"
@@ -287,6 +179,22 @@
" if$\n"
"}\n"
"\n"
+"FUNCTION {str.to.int}\n"
+"{\n"
+" 's :=\n"
+" #0\n"
+" { s empty$ not }\n"
+" { % Multiply the number on the top of the stack by 10 = 1010 binary\n"
+" duplicate$ + % x2\n"
+" duplicate$ % x2 x2\n"
+" duplicate$ + duplicate$ + % x2 x8\n"
+" +\n"
+" s #1 #1 substring$ chr.to.int$ #48 - + % #48 is ascii for '0'\n"
+" s #2 global.max$ substring$ 's :=\n"
+" }\n"
+" while$\n"
+"}\n"
+"\n"
"FUNCTION {new.block.checka}\n"
"{ empty$\n"
" 'skip$\n"
@@ -326,17 +234,39 @@
" if$\n"
"}\n"
"\n"
-"FUNCTION {bold}\n"
+"FUNCTION {emphasize}\n"
"{ duplicate$ empty$\n"
" { pop$ \"\" }\n"
-" { \"<b>\" swap$ * \"</b>\" * }\n"
+" { \"<em>\" swap$ * \"</em>\" * }\n"
" if$\n"
"}\n"
"\n"
-"FUNCTION {emphasize}\n"
-"{ duplicate$ empty$\n"
-" { pop$ \"\" }\n"
-" { \"<em>\" swap$ * \"</em>\" * }\n"
+"FUNCTION {add.link} % title\n"
+"{\n"
+" 't :=\n"
+" t empty$\n"
+" { \"\" }\n"
+" { url empty$\n"
+" { html empty$\n"
+" { t }\n"
+" { \"<a href=\" quote$ * html * quote$ * \">\" * t * \"</a>\" * }\n"
+" if$ }\n"
+" { \"<a href=\" quote$ * url * quote$ * \">\" * t * \"</a>\" * }\n"
+" if$\n"
+" }\n"
+" if$\n"
+"}\n"
+"\n"
+"FUNCTION {add.mailto} % authors\n"
+"{\n"
+" 't :=\n"
+" t empty$\n"
+" { \"\" }\n"
+" { mailto empty$\n"
+" { t }\n"
+" { \"<a href=\" quote$ * \"mailto:\" * mailto * quote$ * \">\" * t * \"</a>\" * }\n"
+" if$\n"
+" }\n"
" if$\n"
"}\n"
"\n"
@@ -349,6 +279,7 @@
" numnames 'namesleft :=\n"
" { namesleft #0 > }\n"
" { s nameptr \"{ff~}{vv~}{ll}{, jj}\" format.name$ 't :=\n"
+" \"\\bibxhtmlname{\" t * \"}\" * 't :=\n"
" nameptr #1 >\n"
" { namesleft #1 >\n"
" { \", \" * t * }\n"
@@ -376,7 +307,7 @@
" { \"\" }\n"
" { author format.names }\n"
" if$\n"
-" bold\n"
+" add.mailto\n"
"}\n"
"\n"
"FUNCTION {format.editors}\n"
@@ -396,6 +327,7 @@
" { \"\" }\n"
" { title \"t\" change.case$ }\n"
" if$\n"
+" add.link\n"
"}\n"
"\n"
"FUNCTION {n.dashify}\n"
@@ -438,11 +370,11 @@
" if$\n"
" }\n"
" if$\n"
-" bold\n"
"}\n"
"\n"
"FUNCTION {format.btitle}\n"
"{ title emphasize\n"
+" add.link\n"
"}\n"
"\n"
"FUNCTION {tie.or.space.connect}\n"
@@ -616,18 +548,20 @@
"}\n"
"\n"
"FUNCTION {format.article.crossref}\n"
-"{ key empty$\n"
+"{\n"
+" \"In <a href=\" quote$ * \"#\" * crossref * quote$ * \">\" *\n"
+" key empty$\n"
" { journal empty$\n"
" { \"need key or journal for \" cite$ * \" to crossref \" * crossref *\n"
" warning$\n"
" \"\"\n"
" }\n"
-" { \"In <em>\" journal * \"</em>\" * }\n"
+" { \"<cite>\" * journal * \"</cite>\" * }\n"
" if$\n"
" }\n"
-" { \"In \" key * }\n"
+" { key * }\n"
" if$\n"
-" \" <span class='cite'>\" * crossref * \"</span>\" *\n"
+" \"</a> \\citelabel{\" * crossref * \"}\" *\n"
"}\n"
"\n"
"FUNCTION {format.crossref.editor}\n"
@@ -656,6 +590,7 @@
" \" of \" *\n"
" }\n"
" if$\n"
+" \"<a href=\" * quote$ * \"#\" * crossref * quote$ * \">\" *\n"
" editor empty$\n"
" editor field.or.null author field.or.null =\n"
" or\n"
@@ -665,7 +600,7 @@
" crossref * warning$\n"
" \"\" *\n"
" }\n"
-" { \"<em>\" * series * \"</em>\" * }\n"
+" { \"<cite>\" * series * \"</cite>\" * }\n"
" if$\n"
" }\n"
" { key * }\n"
@@ -673,11 +608,13 @@
" }\n"
" { format.crossref.editor * }\n"
" if$\n"
-" \" <span class='cite'>\" * crossref * \"</span>\" *\n"
+" \"</a> \\citelabel{\" * crossref * \"}\" *\n"
"}\n"
"\n"
"FUNCTION {format.incoll.inproc.crossref}\n"
-"{ editor empty$\n"
+"{\n"
+" \"In <a href=\" quote$ * \"#\" * crossref * quote$ * \">\" *\n"
+" editor empty$\n"
" editor field.or.null author field.or.null =\n"
" or\n"
" { key empty$\n"
@@ -686,171 +623,26 @@
" crossref * warning$\n"
" \"\"\n"
" }\n"
-" { \"In <em>\" booktitle * \"</em>\" * }\n"
+" { \"<cite>\" * booktitle * \"</cite>\" * }\n"
" if$\n"
" }\n"
-" { \"In \" key * }\n"
+" { key * }\n"
" if$\n"
" }\n"
-" { \"In \" format.crossref.editor * }\n"
-" if$\n"
-" \" <span class='cite'>\" * crossref * \"</span>\" *\n"
-"}\n"
-"\n"
-"% urlbst...\n"
-"% Functions for making hypertext links.\n"
-"FUNCTION {make.href}\n"
-"{ \n"
-" \"<a href='\" swap$ * \"'><code>\" * swap$ * \"</code></a>\" *\n"
-"}\n"
-"\n"
-"% If inlinelinks is true, then format.url should be a no-op, since it's\n"
-"% (a) redundant, and (b) could end up as a link-within-a-link.\n"
-"FUNCTION {format.url}\n"
-"{ inlinelinks #1 = url empty$ or\n"
-" { \"\" }\n"
-" { urlintro \"<code>\" * url * \"</code>\" * }\n"
-" if$\n"
-"}\n"
-"\n"
-"FUNCTION {format.eprint}\n"
-"{ eprint empty$\n"
-" { \"\" }\n"
-" { eprintprefix eprint * eprinturl eprint * make.href }\n"
-" if$\n"
-"}\n"
-"\n"
-"FUNCTION {format.doi}\n"
-"{ doi empty$\n"
-" { \"\" }\n"
-" { doiform #0 =\n"
-" { doiprefix doi * doiurl doi * make.href }\n"
-" { \"DOI:{\" doi * \"}\" * }\n"
-" if$\n"
-" }\n"
-" if$\n"
-"}\n"
-"\n"
-"FUNCTION {format.pubmed}\n"
-"{ pubmed empty$\n"
-" { \"\" }\n"
-" { pubmedprefix pubmed * pubmedurl pubmed * make.href }\n"
-" if$\n"
-"}\n"
-"\n"
-"% Output a URL. We can't use the more normal idiom (something like\n"
-"% `format.url output'), because the `inbrackets' within\n"
-"% format.lastchecked applies to everything between calls to `output',\n"
-"% so that `format.url format.lastchecked * output' ends up with both\n"
-"% the URL and the lastchecked in brackets.\n"
-"FUNCTION {output.url}\n"
-"{ url empty$\n"
-" 'skip$ \n"
-" { new.block \n"
-" format.url output\n"
-" format.lastchecked output \n"
-" }\n"
-" if$\n"
-"}\n"
-"\n"
-"FUNCTION {output.web.refs}\n"
-"{\n"
-" new.block\n"
-" output.url\n"
-" addeprints eprint empty$ not and\n"
-" { format.eprint output.nonnull }\n"
-" 'skip$\n"
-" if$\n"
-" adddoiresolver doi empty$ not and\n"
-" { format.doi output.nonnull }\n"
-" 'skip$\n"
-" if$\n"
-" addpubmedresolver pubmed empty$ not and\n"
-" { format.pubmed output.nonnull }\n"
-" 'skip$\n"
-" if$\n"
-"}\n"
-"\n"
-"% Wrapper for output.bibitem.original.\n"
-"% If the URL field is not empty, set makeinlinelink to be true,\n"
-"% so that an inline link will be started at the next opportunity\n"
-"FUNCTION {output.bibitem}\n"
-"{ outside.brackets 'bracket.state :=\n"
-" output.bibitem.original\n"
-" inlinelinks url empty$ not and\n"
-" { #1 'makeinlinelink := }\n"
-" { #0 'makeinlinelink := }\n"
-" if$\n"
-"}\n"
-"\n"
-"% Wrapper for fin.entry.original\n"
-"FUNCTION {fin.entry}\n"
-"{ output.web.refs % urlbst\n"
-" makeinlinelink % ooops, it appears we didn't have a title for inlinelink\n"
-" { possibly.setup.inlinelink % add some artificial link text here, as a fallback\n"
-" \"[link]\" output.nonnull }\n"
-" 'skip$\n"
-" if$\n"
-" bracket.state close.brackets = % urlbst\n"
-" { \"]\" * }\n"
-" 'skip$\n"
-" if$\n"
-" fin.entry.original\n"
-"}\n"
-"\n"
-"% Webpage entry type.\n"
-"% Title and url fields required;\n"
-"% author, note, year, month, and lastchecked fields optional\n"
-"% See references \n"
-"% ISO 690-2 http://www.nlc-bnc.ca/iso/tc46sc9/standard/690-2e.htm\n"
-"% http://www.classroom.net/classroom/CitingNetResources.html\n"
-"% http://neal.ctstateu.edu/history/cite.html\n"
-"% http://www.cas.usf.edu/english/walker/mla.html\n"
-"% for citation formats for web pages.\n"
-"FUNCTION {webpage}\n"
-"{ output.bibitem\n"
-" author empty$\n"
-" { editor empty$\n"
-" 'skip$ % author and editor both optional\n"
-" { format.editors output.nonnull }\n"
-" if$\n"
-" }\n"
-" { editor empty$\n"
-" { format.authors output.nonnull }\n"
-" { \"can't use both author and editor fields in \" cite$ * warning$ }\n"
-" if$\n"
-" }\n"
-" if$\n"
-" new.block\n"
-" title empty$ 'skip$ 'possibly.setup.inlinelink if$\n"
-" format.title \"title\" output.check\n"
-" inbrackets \"online\" output\n"
-" new.block\n"
-" year empty$\n"
-" 'skip$\n"
-" { format.date \"year\" output.check }\n"
+" { format.crossref.editor * }\n"
" if$\n"
-" % We don't need to output the URL details ('lastchecked' and 'url'),\n"
-" % because fin.entry does that for us, using output.web.refs. The only\n"
-" % reason we would want to put them here is if we were to decide that\n"
-" % they should go in front of the rather miscellaneous information in 'note'.\n"
-" new.block\n"
-" note output\n"
-" fin.entry\n"
+" \"</a> \\citelabel{\" * crossref * \"}\" *\n"
"}\n"
-"% ...urlbst to here\n"
-"\n"
"\n"
"FUNCTION {article}\n"
"{ output.bibitem\n"
" format.authors \"author\" output.check\n"
" new.block\n"
-" title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst\n"
" format.title \"title\" output.check\n"
" new.block\n"
" crossref missing$\n"
" { journal emphasize \"journal\" output.check\n"
-" possibly.setup.inlinelink format.vol.num.pages output% urlbst\n"
+" format.vol.num.pages output\n"
" format.date \"year\" output.check\n"
" }\n"
" { format.article.crossref output.nonnull\n"
@@ -874,7 +666,6 @@
" }\n"
" if$\n"
" new.block\n"
-" title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst\n"
" format.btitle \"title\" output.check\n"
" crossref missing$\n"
" { format.bvolume output\n"
@@ -899,7 +690,6 @@
"{ output.bibitem\n"
" format.authors output\n"
" new.block\n"
-" title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst\n"
" format.title \"title\" output.check\n"
" howpublished address new.block.checkb\n"
" howpublished output\n"
@@ -922,7 +712,6 @@
" }\n"
" if$\n"
" new.block\n"
-" title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst\n"
" format.btitle \"title\" output.check\n"
" crossref missing$\n"
" { format.bvolume output\n"
@@ -949,7 +738,6 @@
"{ output.bibitem\n"
" format.authors \"author\" output.check\n"
" new.block\n"
-" title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst\n"
" format.title \"title\" output.check\n"
" new.block\n"
" crossref missing$\n"
@@ -976,7 +764,6 @@
"{ output.bibitem\n"
" format.authors \"author\" output.check\n"
" new.block\n"
-" title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst\n"
" format.title \"title\" output.check\n"
" new.block\n"
" crossref missing$\n"
@@ -1022,7 +809,6 @@
" { format.authors output.nonnull }\n"
" if$\n"
" new.block\n"
-" title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst\n"
" format.btitle \"title\" output.check\n"
" author empty$\n"
" { organization empty$\n"
@@ -1048,7 +834,6 @@
"{ output.bibitem\n"
" format.authors \"author\" output.check\n"
" new.block\n"
-" title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst\n"
" format.title \"title\" output.check\n"
" new.block\n"
" \"Master's thesis\" format.thesis.type output.nonnull\n"
@@ -1064,7 +849,6 @@
"{ output.bibitem\n"
" format.authors output\n"
" title howpublished new.block.checkb\n"
-" title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst\n"
" format.title output\n"
" howpublished new.block.checka\n"
" howpublished output\n"
@@ -1079,7 +863,6 @@
"{ output.bibitem\n"
" format.authors \"author\" output.check\n"
" new.block\n"
-" title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst\n"
" format.btitle \"title\" output.check\n"
" new.block\n"
" \"PhD thesis\" format.thesis.type output.nonnull\n"
@@ -1098,7 +881,6 @@
" { format.editors output.nonnull }\n"
" if$\n"
" new.block\n"
-" title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst\n"
" format.btitle \"title\" output.check\n"
" format.bvolume output\n"
" format.number.series output\n"
@@ -1131,7 +913,6 @@
"{ output.bibitem\n"
" format.authors \"author\" output.check\n"
" new.block\n"
-" title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst\n"
" format.title \"title\" output.check\n"
" new.block\n"
" format.tr.number output.nonnull\n"
@@ -1147,7 +928,6 @@
"{ output.bibitem\n"
" format.authors \"author\" output.check\n"
" new.block\n"
-" title empty$ 'skip$ 'possibly.setup.inlinelink if$ % urlbst\n"
" format.title \"title\" output.check\n"
" new.block\n"
" note \"note\" output.check\n"
@@ -1156,37 +936,70 @@
"}\n"
"\n"
"FUNCTION {default.type} { misc }\n"
+"\n"
"MACRO {jan} {\"January\"}\n"
+"\n"
"MACRO {feb} {\"February\"}\n"
+"\n"
"MACRO {mar} {\"March\"}\n"
+"\n"
"MACRO {apr} {\"April\"}\n"
+"\n"
"MACRO {may} {\"May\"}\n"
+"\n"
"MACRO {jun} {\"June\"}\n"
+"\n"
"MACRO {jul} {\"July\"}\n"
+"\n"
"MACRO {aug} {\"August\"}\n"
+"\n"
"MACRO {sep} {\"September\"}\n"
+"\n"
"MACRO {oct} {\"October\"}\n"
+"\n"
"MACRO {nov} {\"November\"}\n"
+"\n"
"MACRO {dec} {\"December\"}\n"
+"\n"
"MACRO {acmcs} {\"ACM Computing Surveys\"}\n"
+"\n"
"MACRO {acta} {\"Acta Informatica\"}\n"
+"\n"
"MACRO {cacm} {\"Communications of the ACM\"}\n"
+"\n"
"MACRO {ibmjrd} {\"IBM Journal of Research and Development\"}\n"
+"\n"
"MACRO {ibmsj} {\"IBM Systems Journal\"}\n"
+"\n"
"MACRO {ieeese} {\"IEEE Transactions on Software Engineering\"}\n"
+"\n"
"MACRO {ieeetc} {\"IEEE Transactions on Computers\"}\n"
-"MACRO {ieeetcad} {\"IEEE Transactions on Computer-Aided Design of Integrated Circuits\"}\n"
+"\n"
+"MACRO {ieeetcad}\n"
+" {\"IEEE Transactions on Computer-Aided Design of Integrated Circuits\"}\n"
+"\n"
"MACRO {ipl} {\"Information Processing Letters\"}\n"
+"\n"
"MACRO {jacm} {\"Journal of the ACM\"}\n"
+"\n"
"MACRO {jcss} {\"Journal of Computer and System Sciences\"}\n"
+"\n"
"MACRO {scp} {\"Science of Computer Programming\"}\n"
+"\n"
"MACRO {sicomp} {\"SIAM Journal on Computing\"}\n"
+"\n"
"MACRO {tocs} {\"ACM Transactions on Computer Systems\"}\n"
+"\n"
"MACRO {tods} {\"ACM Transactions on Database Systems\"}\n"
+"\n"
"MACRO {tog} {\"ACM Transactions on Graphics\"}\n"
+"\n"
"MACRO {toms} {\"ACM Transactions on Mathematical Software\"}\n"
+"\n"
"MACRO {toois} {\"ACM Transactions on Office Information Systems\"}\n"
+"\n"
"MACRO {toplas} {\"ACM Transactions on Programming Languages and Systems\"}\n"
+"\n"
"MACRO {tcs} {\"Theoretical Computer Science\"}\n"
"\n"
"READ\n"
@@ -1207,6 +1020,177 @@
" if$\n"
"}\n"
"\n"
+"\n"
+"FUNCTION {format.lab.names}\n"
+"{ 's :=\n"
+" s num.names$ 'numnames :=\n"
+" numnames #1 =\n"
+" { s #1 \"{vv }{ll}\" format.name$ }\n"
+" { numnames #2 =\n"
+" { s #1 \"{vv }{ll }and \" format.name$ s #2 \"{vv }{ll}\" format.name$ * }\n"
+" { s #1 \"{vv }{ll }\" format.name$ \"et~al.\" * }\n"
+" if$\n"
+" }\n"
+" if$\n"
+"}\n"
+"\n"
+"FUNCTION {author.key.label}\n"
+"{ author empty$\n"
+" { key empty$\n"
+" { cite$ #1 #3 substring$ }\n"
+" { key }\n"
+" if$\n"
+" }\n"
+" { author format.lab.names }\n"
+" if$\n"
+"}\n"
+"\n"
+"FUNCTION {author.editor.key.label}\n"
+"{ author empty$\n"
+" { editor empty$\n"
+" { key empty$\n"
+" { cite$ #1 #3 substring$ }\n"
+" { key }\n"
+" if$\n"
+" }\n"
+" { editor format.lab.names }\n"
+" if$\n"
+" }\n"
+" { author format.lab.names }\n"
+" if$\n"
+"}\n"
+"\n"
+"FUNCTION {author.key.organization.label}\n"
+"{ author empty$\n"
+" { key empty$\n"
+" { organization empty$\n"
+" { cite$ #1 #3 substring$ }\n"
+" { \"The \" #4 organization chop.word #3 text.prefix$ }\n"
+" if$\n"
+" }\n"
+" { key }\n"
+" if$\n"
+" }\n"
+" { author format.lab.names }\n"
+" if$\n"
+"}\n"
+"\n"
+"FUNCTION {editor.key.organization.label}\n"
+"{ editor empty$\n"
+" { key empty$\n"
+" { organization empty$\n"
+" { cite$ #1 #3 substring$ }\n"
+" { \"The \" #4 organization chop.word #3 text.prefix$ }\n"
+" if$\n"
+" }\n"
+" { key }\n"
+" if$\n"
+" }\n"
+" { editor format.lab.names }\n"
+" if$\n"
+"}\n"
+"\n"
+"FUNCTION {month.to.int}\n"
+"{\n"
+" \"l\" change.case$ #3 text.prefix$\n"
+" 's :=\n"
+" s \"jan\" = { #1 } {\n"
+" s \"feb\" = { #2 } {\n"
+" s \"mar\" = { #3 } {\n"
+" s \"apr\" = { #4 } {\n"
+" s \"may\" = { #5 } {\n"
+" s \"jun\" = { #6 } {\n"
+" s \"jul\" = { #7 } {\n"
+" s \"aug\" = { #8 } {\n"
+" s \"sep\" = { #9 } {\n"
+" s \"oct\" = { #10 } {\n"
+" s \"nov\" = { #11 } {\n"
+" s \"dec\" = { #12 } { #13 } % 13 if nothing matches\n"
+" if$}if$}if$}if$}if$}if$}if$}if$}if$}if$}if$}if$\n"
+"}\n"
+"\n"
+"INTEGERS { done c } \n"
+"FUNCTION { get.day }\n"
+"{ month field.or.null 's :=\n"
+" \n"
+" % Strip out month name\n"
+" #0 'done := \n"
+" { s \"\" = not done not and }\n"
+" { s #1 #1 substring$ \" \" = 'done :=\n"
+" s #2 global.max$ substring$ 's :=\n"
+" }\n"
+" while$\n"
+"\n"
+" % Build up first number in t\n"
+" \"0\" 't :=\n"
+" #0 'done :=\n"
+" { s \"\" = not done not and }\n"
+" { s #1 #1 substring$ chr.to.int$ 'c :=\n"
+" c #47 > c #58 < and\n"
+" { t c int.to.chr$ * 't := }\n"
+" { #1 'done := }\n"
+" if$\n"
+" s #2 global.max$ substring$ 's :=\n"
+" }\n"
+" while$\n"
+"\n"
+" t str.to.int\n"
+"}\n"
+"\n"
+"FUNCTION { sortify.fourdigit }\n"
+"{ 's :=\n"
+" s empty$\n"
+" { \"0000\" }\n"
+" { s\n"
+" }\n"
+" if$\n"
+"}\n"
+"\n"
+"FUNCTION { sortify.twodigit }\n"
+"{ 's :=\n"
+" s empty$\n"
+" { \"00\" }\n"
+" { s\n"
+" str.to.int #10 + int.to.str$\n"
+" }\n"
+" if$\n"
+"}\n"
+"\n"
+"FUNCTION {calc.label}\n"
+"{ type$ \"book\" =\n"
+" type$ \"inbook\" =\n"
+" or\n"
+" 'author.editor.key.label\n"
+" { type$ \"proceedings\" =\n"
+" 'editor.key.organization.label\n"
+" { type$ \"manual\" =\n"
+" 'author.key.organization.label\n"
+" 'author.key.label\n"
+" if$\n"
+" }\n"
+" if$\n"
+" }\n"
+" if$\n"
+" duplicate$\n"
+"\n"
+" year empty$\n"
+" 'skip$\n"
+" { \", \" * }\n"
+" if$\n"
+" year field.or.null purify$ * % CHANGED - pfps - 15 Feb 1989\n"
+" 'label :=\n"
+"\n"
+" year field.or.null purify$\n"
+" #-1 #4 substring$ \n"
+" sortify.fourdigit \n"
+" \" \" *\n"
+" month field.or.null month.to.int int.to.str$ sortify.twodigit *\n"
+" \" \" * \n"
+" get.day int.to.str$ sortify.twodigit *\n"
+" \" \" *\n"
+" * sortify 'sort.label :=\n"
+"}\n"
+"\n"
"FUNCTION {sort.format.names}\n"
"{ 's :=\n"
" #1 'nameptr :=\n"
@@ -1220,7 +1204,7 @@
" if$\n"
" s nameptr \"{vv{ } }{ll{ }}{ ff{ }}{ jj{ }}\" format.name$ 't :=\n"
" nameptr numnames = t \"others\" = and\n"
-" { \"et al\" * }\n"
+" { \"et al.\" * }\n"
" { t sortify * }\n"
" if$\n"
" nameptr #1 + 'nameptr :=\n"
@@ -1304,36 +1288,9 @@
" if$\n"
"}\n"
"\n"
-"FUNCTION {presort.by.author}\n"
-"{ type$ \"book\" =\n"
-" type$ \"inbook\" =\n"
-" or\n"
-" 'author.editor.sort\n"
-" { type$ \"proceedings\" =\n"
-" 'editor.organization.sort\n"
-" { type$ \"manual\" =\n"
-" 'author.organization.sort\n"
-" 'author.sort\n"
-" if$\n"
-" }\n"
-" if$\n"
-" }\n"
-" if$\n"
-" \" \"\n"
-" *\n"
-" year field.or.null sortify\n"
-" *\n"
-" \" \"\n"
-" *\n"
-" title field.or.null\n"
-" sort.format.title\n"
-" *\n"
-" #1 entry.max$ substring$\n"
-" 'sort.key$ :=\n"
-"}\n"
-"\n"
-"FUNCTION {presort.by.year}\n"
-"{ year field.or.null sortify\n"
+"FUNCTION {presort}\n"
+"{ calc.label\n"
+" sort.label\n"
" \" \"\n"
" *\n"
" type$ \"book\" =\n"
@@ -1353,6 +1310,10 @@
" *\n"
" \" \"\n"
" *\n"
+" year field.or.null sortify\n"
+" *\n"
+" \" \"\n"
+" *\n"
" title field.or.null\n"
" sort.format.title\n"
" *\n"
@@ -1360,55 +1321,68 @@
" 'sort.key$ :=\n"
"}\n"
"\n"
-"ITERATE {presort.by.author}\n"
+"ITERATE {presort}\n"
"\n"
"SORT\n"
"\n"
-"STRINGS { longest.label }\n"
+"STRINGS { longest.label last.sort.label next.extra }\n"
"\n"
-"INTEGERS { number.label longest.label.width }\n"
+"INTEGERS { longest.label.width last.extra.num }\n"
"\n"
"FUNCTION {initialize.longest.label}\n"
"{ \"\" 'longest.label :=\n"
-" #1 'number.label :=\n"
+" #0 int.to.chr$ 'last.sort.label :=\n"
+" \"\" 'next.extra :=\n"
" #0 'longest.label.width :=\n"
+" #0 'last.extra.num :=\n"
+"}\n"
+"\n"
+"FUNCTION {forward.pass}\n"
+"{ last.sort.label sort.label =\n"
+" { last.extra.num #1 + 'last.extra.num :=\n"
+" last.extra.num int.to.chr$ 'extra.label :=\n"
+" }\n"
+" { \"a\" chr.to.int$ 'last.extra.num :=\n"
+" \"\" 'extra.label :=\n"
+" sort.label 'last.sort.label :=\n"
+" }\n"
+" if$\n"
"}\n"
"\n"
-"FUNCTION {longest.label.pass}\n"
-"{ number.label int.to.str$ 'label :=\n"
-" number.label #1 + 'number.label :=\n"
+"FUNCTION {reverse.pass}\n"
+"{ next.extra \"b\" =\n"
+" { \"a\" 'extra.label := }\n"
+" 'skip$\n"
+" if$\n"
+" label extra.label * 'label :=\n"
" label width$ longest.label.width >\n"
" { label 'longest.label :=\n"
" label width$ 'longest.label.width :=\n"
" }\n"
" 'skip$\n"
" if$\n"
+" extra.label 'next.extra :=\n"
"}\n"
"\n"
"EXECUTE {initialize.longest.label}\n"
"\n"
-"ITERATE {longest.label.pass}\n"
+"ITERATE {forward.pass}\n"
+"\n"
+"REVERSE {reverse.pass}\n"
"\n"
"FUNCTION {begin.bib}\n"
-"{ preamble$ empty$\n"
-" 'skip$\n"
-" { preamble$ write$ newline$ }\n"
-" if$\n"
-" %\"/** \\page bibref References\" write$ newline$\n"
-" newline$\n"
+"{\n"
+" \"# label-style: default\" write$ newline$\n"
"}\n"
"\n"
"EXECUTE {begin.bib}\n"
"\n"
-"EXECUTE {init.urlbst.variables}\n"
"EXECUTE {init.state.consts}\n"
"\n"
"ITERATE {call.type$}\n"
"\n"
"FUNCTION {end.bib}\n"
"{ newline$\n"
-" %\"*/\" write$ newline$\n"
"}\n"
"\n"
"EXECUTE {end.bib}\n"
-"\n"
diff --git a/src/filedef.cpp b/src/filedef.cpp
index 04ec5ae..dcc2c15 100644
--- a/src/filedef.cpp
+++ b/src/filedef.cpp
@@ -1503,7 +1503,7 @@ bool FileDef::isDocumentationFile() const
void FileDef::acquireFileVersion()
{
QCString vercmd = Config_getString("FILE_VERSION_FILTER");
- if (!vercmd.isEmpty() && filepath!="generated")
+ if (!vercmd.isEmpty() && !filepath.isEmpty() && filepath!="generated")
{
msg("Version of %s : ",filepath.data());
QCString cmd = vercmd+" \""+filepath+"\"";
@@ -1518,9 +1518,8 @@ void FileDef::acquireFileVersion()
char buf[bufSize];
int numRead = fread(buf,1,bufSize,f);
portable_pclose(f);
- if (numRead > 0)
+ if (numRead>0 && !(fileVersion=QCString(buf,numRead).stripWhiteSpace()).isEmpty())
{
- fileVersion = QCString(buf,numRead).stripWhiteSpace();
msg("%s\n",fileVersion.data());
}
else
@@ -1650,6 +1649,7 @@ bool FileDef::isLinkableInProject() const
return hasDocumentation() && !isReference() && showFiles;
}
+#if 0
bool FileDef::includes(FileDef *incFile,QDict<FileDef> *includedFiles) const
{
//printf("%s::includes(%s)\n",name().data(),incFile->name().data());
@@ -1687,4 +1687,4 @@ bool FileDef::includesByName(const QCString &fileName) const
}
return FALSE;
}
-
+#endif
diff --git a/src/filedef.h b/src/filedef.h
index c34b633..6cecbdf 100644
--- a/src/filedef.h
+++ b/src/filedef.h
@@ -88,6 +88,8 @@ class FileDef : public Definition
QCString getOutputFileBase() const
{ return convertNameToFile(diskname); }
+ QCString anchor() const
+ { return QCString(); }
QCString getFileBase() const
{ return diskname; }
@@ -168,8 +170,8 @@ class FileDef : public Definition
void addListReferences();
bool isDocumentationFile() const;
- bool includes(FileDef *incFile,QDict<FileDef> *includedFiles) const;
- bool includesByName(const QCString &name) const;
+ //bool includes(FileDef *incFile,QDict<FileDef> *includedFiles) const;
+ //bool includesByName(const QCString &name) const;
MemberList *getMemberList(MemberList::ListType lt) const;
const QList<MemberList> &getMemberLists() const { return m_memberLists; }
diff --git a/src/fortranscanner.l b/src/fortranscanner.l
index d83fe85..ba0d6db 100644
--- a/src/fortranscanner.l
+++ b/src/fortranscanner.l
@@ -202,7 +202,7 @@ static void scanner_abort();
static void startScope(Entry *scope);
static bool endScope(Entry *scope, bool isGlobalRoot=FALSE);
static QCString getFullName(Entry *e);
-static bool isTypeName(QCString name);
+//static bool isTypeName(QCString name);
static void resolveModuleProcedures(QList<Entry> &moduleProcedures, Entry *current_root);
static int getAmpersandAtTheStart(const char *buf, int length);
static int getAmpOrExclAtTheEnd(const char *buf, int length);
@@ -669,10 +669,11 @@ private {
argType = QCString(yytext).simplifyWhiteSpace();
yy_push_state(AttributeList);
}
-^{BS}{PP_ID}{KIND}? { /* check for preprocessor symbol expand to type */
+ /* Dimitri: macro expansion should already be done during preprocessing not here!
+^{BS}{PP_ID}{KIND}? { // check for preprocessor symbol expand to type
QCString str = yytext;
str = str.stripWhiteSpace();
- DefineDict* defines = getGlobalDefineDict();
+ //DefineDict* defines = getGlobalDefineDict();
QCString name;
int index = str.find("(");
if (index != -1)
@@ -680,7 +681,7 @@ private {
else
name = str;
- Define *define = (*defines)[name];
+ Define *define = 0; //(*defines)[name];
if (define != 0 && isTypeName(define->definition))
{
argType = str;
@@ -692,6 +693,7 @@ private {
REJECT;
}
}
+ */
{ATTR_STMT}/{BS_}{ID} |
{ATTR_STMT}/{BS}"::" {
/* attribute statement starts */
@@ -1406,12 +1408,14 @@ void resolveModuleProcedures(QList<Entry> &moduleProcedures, Entry *current_root
moduleProcedures.clear();
}
+#if 0
static bool isTypeName(QCString name)
{
name = name.lower();
return name=="integer" || name == "real" ||
- name=="complex" || name == "logical";
+ name=="complex" || name == "logical";
}
+#endif
/*! Extracts string which resides within parentheses of provided string. */
static QCString extractFromParens(const QCString name)
diff --git a/src/groupdef.h b/src/groupdef.h
index fef38de..effefac 100644
--- a/src/groupdef.h
+++ b/src/groupdef.h
@@ -48,6 +48,7 @@ class GroupDef : public Definition
~GroupDef();
DefType definitionType() const { return TypeGroup; }
QCString getOutputFileBase() const;
+ QCString anchor() const { return QCString(); }
const char *groupTitle() const { return title; }
void setGroupTitle( const char *newtitle );
bool hasGroupTitle( ) { return titleSet; }
diff --git a/src/htmldocvisitor.cpp b/src/htmldocvisitor.cpp
index 8795bb4..e3e5b08 100644
--- a/src/htmldocvisitor.cpp
+++ b/src/htmldocvisitor.cpp
@@ -1408,32 +1408,30 @@ void HtmlDocVisitor::visitPre(DocParamSect *s)
{
if (m_hide) return;
forceEndParagraph(s);
- m_t << "<dl><dt><b>";
QCString className;
+ QCString heading;
switch(s->type())
{
case DocParamSect::Param:
- m_t << theTranslator->trParameters();
+ heading=theTranslator->trParameters();
className="params";
break;
case DocParamSect::RetVal:
- m_t << theTranslator->trReturnValues();
+ heading=theTranslator->trReturnValues();
className="retval";
break;
case DocParamSect::Exception:
- m_t << theTranslator->trExceptions();
+ heading=theTranslator->trExceptions();
className="exception";
break;
case DocParamSect::TemplateParam:
- /* TODO: add this
- m_t << theTranslator->trTemplateParam(); break;
- */
- m_t << "Template Parameters"; break;
+ heading="Template Parameters"; break; // TODO: translate me
className="tparams";
default:
ASSERT(0);
}
- m_t << ":";
+ m_t << "<dl class=\"" << className << "\"><dt><b>";
+ m_t << heading << ":";
m_t << "</b></dt><dd>" << endl;
m_t << " <table class=\"" << className << "\">" << endl;
}
@@ -1698,7 +1696,8 @@ void HtmlDocVisitor::writeDotFile(const QCString &fn,const QCString &relPath,
writeDotImageMapFromFile(m_t,fn,outDir,relPath,baseName,context);
}
-void HtmlDocVisitor::writeMscFile(const QCString &fileName,const QCString &relPath,
+void HtmlDocVisitor::writeMscFile(const QCString &fileName,
+ const QCString &relPath,
const QCString &context)
{
QCString baseName=fileName;
diff --git a/src/index.cpp b/src/index.cpp
index f244c47..fc400a1 100644
--- a/src/index.cpp
+++ b/src/index.cpp
@@ -51,9 +51,6 @@ static const char search_script[]=
#include "search_js.h"
;
-//static const char navindex_script[]=
-//#include "navindex_js.h"
-//;
int annotatedClasses;
int annotatedClassesPrinted;
@@ -70,15 +67,11 @@ int documentedPages;
int documentedDirs;
static int countClassHierarchy();
-//static int countClassMembers(int filter=CMHL_All);
-//static int countFileMembers(int filter=FMHL_All);
static void countFiles(int &htmlFiles,int &files);
static int countGroups();
static int countDirs();
static int countNamespaces();
static int countAnnotatedClasses(int *cp);
-//static int countNamespaceMembers(int filter=NMHL_All);
-//static int countIncludeFiles();
static void countRelatedPages(int &docPages,int &indexPages);
void countDataStructures()
@@ -142,7 +135,7 @@ static MemberIndexList g_memberIndexLetterUsed[CMHL_Total][MEMBER_INDEX_ENTRIES]
static MemberIndexList g_fileIndexLetterUsed[FMHL_Total][MEMBER_INDEX_ENTRIES];
static MemberIndexList g_namespaceIndexLetterUsed[NMHL_Total][MEMBER_INDEX_ENTRIES];
-static bool g_classIndexLetterUsed[CHL_Total][256];
+//static bool g_classIndexLetterUsed[CHL_Total][256];
const int maxItemsBeforeQuickIndex = MAX_ITEMS_BEFORE_QUICK_INDEX;
@@ -269,13 +262,13 @@ static void endQuickIndexItem(OutputList &ol)
if (fancyTabs) ol.writeString("</li>\n");
}
-
-static QCString fixSpaces(const QCString &s)
+// don't make this static as it is called from a template function and some
+// old compilers don't support calls to static functions from a template.
+QCString fixSpaces(const QCString &s)
{
return substitute(s," ","&#160;");
}
-
void startTitle(OutputList &ol,const char *fileName,Definition *def)
{
ol.startHeaderSection();
@@ -540,71 +533,6 @@ static void writeClassTree(BaseClassList *cl,int level)
}
}
-#if 0
-//----------------------------------------------------------------------------
-/*! Generates HTML Help tree of classes */
-
-static void writeClassTreeNode(ClassDef *cd,bool &started,int level)
-{
- //printf("writeClassTreeNode(%s) visited=%d\n",cd->name().data(),cd->visited);
- if (cd->isVisibleInHierarchy() && !cd->visited)
- {
- if (!started)
- {
- started=TRUE;
- }
- bool hasChildren = classHasVisibleChildren(cd);
- //printf("node: Has children %s: %d\n",cd->name().data(),hasChildren);
- if (cd->isLinkable())
- {
- Doxygen::indexList.addContentsItem(hasChildren,cd->displayName(),cd->getReference(),cd->getOutputFileBase(),cd->anchor());
- }
- if (hasChildren)
- {
- if (cd->getLanguage()==SrcLangExt_VHDL)
- {
- writeClassTree(cd->baseClasses(),level+1);
- }
- else
- {
- writeClassTree(cd->subClasses(),level+1);
- }
- }
- cd->visited=TRUE;
- }
-}
-
-static void writeClassTree(ClassList *cl,int level)
-{
- if (cl==0) return;
- ClassListIterator cli(*cl);
- bool started=FALSE;
- for ( cli.toFirst() ; cli.current() ; ++cli)
- {
- cli.current()->visited=FALSE;
- }
- for ( cli.toFirst() ; cli.current() ; ++cli)
- {
- writeClassTreeNode(cli.current(),started,level);
- }
-}
-
-static void writeClassTree(ClassSDict *d,int level)
-{
- if (d==0) return;
- ClassSDict::Iterator cli(*d);
- bool started=FALSE;
- for ( cli.toFirst() ; cli.current() ; ++cli)
- {
- cli.current()->visited=FALSE;
- }
- for ( cli.toFirst() ; cli.current() ; ++cli)
- {
- writeClassTreeNode(cli.current(),started,level);
- }
-}
-#endif
-
//----------------------------------------------------------------------------
static void writeClassTreeForList(OutputList &ol,ClassSDict *cl,bool &started,FTVHelp* ftv)
@@ -1129,6 +1057,7 @@ static void writeAnnotatedClassList(OutputList &ol)
ClassSDict::Iterator cli(*Doxygen::classSDict);
ClassDef *cd;
+#if 0
// clear index
int x,y;
for (y=0;y<CHL_Total;y++)
@@ -1174,6 +1103,7 @@ static void writeAnnotatedClassList(OutputList &ol)
}
}
}
+#endif
for (cli.toFirst();(cd=cli.current());++cli)
{
@@ -1298,7 +1228,6 @@ class AlphaIndexTableColumns : public QList<AlphaIndexTableRows>
// write an alphabetical index of all class with a header for each letter
static void writeAlphabeticalClassList(OutputList &ol)
{
- //ol.startAlphabeticalIndexList();
// What starting letters are used
bool indexLetterUsed[256];
memset (indexLetterUsed, 0, sizeof (indexLetterUsed));
@@ -1319,6 +1248,7 @@ static void writeAlphabeticalClassList(OutputList &ol)
}
}
+ // write quick link index (row of letters)
QCString alphaLinks = "<div class=\"qindex\">";
int l;
for (l=0; l<256; l++)
@@ -1332,7 +1262,6 @@ static void writeAlphabeticalClassList(OutputList &ol)
(char)l + "</a>";
}
}
-
alphaLinks += "</div>\n";
ol.writeString(alphaLinks);
@@ -1341,9 +1270,8 @@ static void writeAlphabeticalClassList(OutputList &ol)
const int columns = Config_getInt("COLS_IN_ALPHA_INDEX");
int i,j;
- int totalItems = headerItems*2 + annotatedClasses; // number of items in the table (headers span 2 items)
+ int totalItems = headerItems*2 + annotatedClasses; // number of items in the table (headers span 2 items)
int rows = (totalItems + columns - 1)/columns; // number of rows in the table
- //int itemsInLastRow = (totalItems + columns -1)%columns + 1; // number of items in the last row
//printf("headerItems=%d totalItems=%d columns=%d rows=%d itemsInLastRow=%d\n",
// headerItems,totalItems,columns,rows,itemsInLastRow);
@@ -1422,7 +1350,7 @@ static void writeAlphabeticalClassList(OutputList &ol)
}
}
- ol.writeString("<table style=\"margin: 10px;\" align=\"center\" width=\"95%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n");
+ ol.writeString("<table style=\"margin: 10px; white-space: nowrap;\" align=\"center\" width=\"95%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n");
// generate table
for (i=0;i<=maxRows;i++) // foreach table row
{
@@ -1525,7 +1453,6 @@ static void writeAlphabeticalClassList(OutputList &ol)
delete colIterators[i];
}
delete[] colIterators;
- //delete[] colList;
}
//----------------------------------------------------------------------------
@@ -1538,18 +1465,16 @@ static void writeAlphabeticalIndex(OutputList &ol)
LayoutNavEntry *lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::ClassIndex);
QCString title = lne ? lne->title() : theTranslator->trCompoundIndex();
startFile(ol,"classes",0,title,HLI_Classes);
+
startTitle(ol,0);
ol.parseText(title);
Doxygen::indexList.addContentsItem(TRUE,title,0,"classes",0,TRUE,TRUE);
- //ol.parseText(/*Config_getString("PROJECT_NAME")+" "+*/
- // (fortranOpt ? theTranslator->trCompoundIndexFortran() :
- // vhdlOpt ? VhdlDocGen::trDesignUnitIndex() :
- // theTranslator->trCompoundIndex()
- // ));
endTitle(ol,0,0);
+
ol.startContents();
writeAlphabeticalClassList(ol);
- endFile(ol);
+
+ endFile(ol); // contains ol.endContents()
ol.popGeneratorState();
}
@@ -1572,15 +1497,13 @@ static void writeAnnotatedIndex(OutputList &ol)
if (lne==0) lne = LayoutDocManager::instance().rootNavEntry()->find(LayoutNavEntry::Classes); // fall back
QCString title = lne ? lne->title() : theTranslator->trCompoundList();
startFile(ol,"annotated",0,title,HLI_Annotated);
+
startTitle(ol,0);
- //QCString longTitle = title;
- //if (!Config_getString("PROJECT_NAME").isEmpty())
- //{
- // longTitle.prepend(Config_getString("PROJECT_NAME")+" ");
- //}
ol.parseText(title);
endTitle(ol,0,0);
+
ol.startContents();
+
ol.startTextBlock();
Doxygen::indexList.addContentsItem(TRUE,title,0,"annotated",0,TRUE,TRUE);
Doxygen::indexList.incContentsDepth();
@@ -1589,7 +1512,7 @@ static void writeAnnotatedIndex(OutputList &ol)
writeAnnotatedClassList(ol);
Doxygen::indexList.decContentsDepth();
- endFile(ol);
+ endFile(ol); // contains ol.endContents()
ol.popGeneratorState();
}
@@ -2862,17 +2785,16 @@ void writeJavascriptSearchIndex()
<< "class=\"SRSymbol\" ";
t << externalLinkTarget() << "href=\"" << externalRef("../",d->getReference(),TRUE);
t << d->getOutputFileBase() << Doxygen::htmlFileExtension;
- if (md)
+ QCString anchor = d->anchor();
+ if (!anchor.isEmpty())
{
- t << "#" << md->anchor();
+ t << "#" << anchor;
}
t << "\"";
static bool extLinksInWindow = Config_getBool("EXT_LINKS_IN_WINDOW");
if (!extLinksInWindow || d->getReference().isEmpty())
{
- t << " target=\"";
- /*if (treeView) t << "basefrm"; else*/ t << "_parent";
- t << "\"";
+ t << " target=\"_parent\"";
}
t << ">";
t << convertToXML(d->localName());
@@ -2943,17 +2865,16 @@ void writeJavascriptSearchIndex()
}
t << "href=\"" << externalRef("../",d->getReference(),TRUE);
t << d->getOutputFileBase() << Doxygen::htmlFileExtension;
- if (isMemberDef)
+ QCString anchor = d->anchor();
+ if (!anchor.isEmpty())
{
- t << "#" << ((MemberDef *)d)->anchor();
+ t << "#" << anchor;
}
t << "\"";
static bool extLinksInWindow = Config_getBool("EXT_LINKS_IN_WINDOW");
if (!extLinksInWindow || d->getReference().isEmpty())
{
- t << " target=\"";
- /*if (treeView) t << "basefrm"; else*/ t << "_parent";
- t << "\"";
+ t << " target=\"_parent\"";
}
t << ">";
bool found=FALSE;
@@ -4466,6 +4387,7 @@ static void writeIndexHierarchyEntries(OutputList &ol,const QList<LayoutNavEntry
writeExampleIndex(ol);
break;
case LayoutNavEntry::User:
+ Doxygen::indexList.addContentsItem(TRUE,lne->title(),0,lne->baseFile(),0);
break;
}
indexWritten.at(index)=TRUE;
diff --git a/src/latexdocvisitor.cpp b/src/latexdocvisitor.cpp
index c7ca6d1..8d84c4d 100644
--- a/src/latexdocvisitor.cpp
+++ b/src/latexdocvisitor.cpp
@@ -1512,8 +1512,7 @@ void LatexDocVisitor::startMscFile(const QCString &fileName,
baseName.prepend("msc_");
QCString outDir = Config_getString("LATEX_OUTPUT");
- QCString name = fileName;
- writeMscGraphFromFile(name,outDir,baseName,MSC_EPS);
+ writeMscGraphFromFile(fileName,outDir,baseName,MSC_EPS);
if (hasCaption)
{
m_t << "\n\\begin{DoxyImage}\n";
@@ -1568,7 +1567,7 @@ void LatexDocVisitor::writeMscFile(const QCString &baseName)
shortName=shortName.right(shortName.length()-i-1);
}
QCString outDir = Config_getString("LATEX_OUTPUT");
- writeMscGraphFromFile(baseName,outDir,shortName,MSC_EPS);
+ writeMscGraphFromFile(baseName+".msc",outDir,shortName,MSC_EPS);
m_t << "\n\\begin{DoxyImageNoCaption}"
" \\mbox{\\includegraphics";
m_t << "{" << shortName << "}";
diff --git a/src/latexgen.cpp b/src/latexgen.cpp
index c3b9c6f..fad1d01 100644
--- a/src/latexgen.cpp
+++ b/src/latexgen.cpp
@@ -701,6 +701,7 @@ static void writeDefaultStyleSheetPart3(FTextStream &t)
" \\begin{longtable}{|>{\\raggedleft\\hspace{0pt}}p{0.15\\textwidth}|%\n"
" p{0.15\\textwidth}|%\n"
" p{0.635\\textwidth}|}%\n"
+ //"\\hline{\\sf\\textbf{Type}} & {\\sf\\textbf{Name}} & {\\sf\\textbf{Description}}\\endhead%\n"
" \\hline%\n"
"}{%\n"
" \\end{longtable}%\n"
@@ -1772,7 +1773,7 @@ void LatexGenerator::startDoxyAnchor(const char *fName,const char *,
t << "\\hypertarget{";
if (fName) t << stripPath(fName);
if (anchor) t << "_" << anchor;
- t << "}{" << endl;
+ t << "}{";
}
}
@@ -1782,7 +1783,7 @@ void LatexGenerator::endDoxyAnchor(const char *fName,const char *anchor)
static bool usePDFLatex = Config_getBool("USE_PDFLATEX");
if (usePDFLatex && pdfHyperlinks)
{
- t << "}" << endl;
+ t << "}";
}
t << "\\label{";
if (fName) t << fName;
@@ -2112,19 +2113,23 @@ void LatexGenerator::endMemberList()
void LatexGenerator::startMemberGroupHeader(bool hasHeader)
{
if (hasHeader) t << "\\begin{Indent}";
- if (Config_getBool("COMPACT_LATEX"))
- {
- t << "\\subparagraph*{";
- }
- else
- {
- t << "\\paragraph*{";
- }
+ t << "{\\bf ";
+ // changed back to rev 756 due to bug 660501
+ //if (Config_getBool("COMPACT_LATEX"))
+ //{
+ // t << "\\subparagraph*{";
+ //}
+ //else
+ //{
+ // t << "\\paragraph*{";
+ //}
}
void LatexGenerator::endMemberGroupHeader()
{
- t << "}" << endl;
+ // changed back to rev 756 due to bug 660501
+ t << "}\\par" << endl;
+ //t << "}" << endl;
}
void LatexGenerator::startMemberGroupDocs()
diff --git a/src/libdoxygen.pro.in b/src/libdoxygen.pro.in
index 811b3a7..6c91435 100644
--- a/src/libdoxygen.pro.in
+++ b/src/libdoxygen.pro.in
@@ -258,7 +258,6 @@ win32:TMAKE_CXXFLAGS += -DQT_NODLL
win32-msvc:TMAKE_CXXFLAGS += -Zm200
win32-g++:TMAKE_CXXFLAGS += -fno-exceptions -fno-rtti
linux-g++:TMAKE_CXXFLAGS += -fno-exceptions -fno-rtti
-TMAKE_CXXFLAGS += -DYY_TYPEDEF_YY_SIZE_T -Dyy_size_t=int
INCLUDEPATH += ../qtools
#INCLUDEPATH += ../libpng
INCLUDEPATH += ../libmd5
diff --git a/src/libdoxygen.t b/src/libdoxygen.t
index e2c17b7..e5a9e56 100644
--- a/src/libdoxygen.t
+++ b/src/libdoxygen.t
@@ -164,3 +164,7 @@ svgpan_js.h: svgpan.js
doxygen_bst.h: doxygen.bst
cat doxygen.bst | $(TO_C_CMD) >doxygen_bst.h
+bib2xhtml.h: bib2xhtml.pl
+ cat bib2xhtml.pl | $(TO_C_CMD) >bib2xhtml.h
+
+
diff --git a/src/memberdef.cpp b/src/memberdef.cpp
index b61e9d9..1439d0b 100644
--- a/src/memberdef.cpp
+++ b/src/memberdef.cpp
@@ -2522,7 +2522,7 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol,
}
// strip scope and field name from the type
-// example: "struct N::S.v.c" will become "struct S.v"
+// example: "struct N::S.v.c" will become "struct v"
static QCString simplifyTypeForTable(const QCString &s)
{
QCString ts=removeAnonymousScopes(s);
@@ -2535,6 +2535,9 @@ static QCString simplifyTypeForTable(const QCString &s)
}
i=ts.findRev('.');
if (i!=-1) ts = ts.left(i);
+ i=ts.findRev('.');
+ if (i!=-1) ts = ts.right(ts.length()-i-1);
+ //printf("simplifyTypeForTable(%s)->%s\n",s.data(),ts.data());
return ts;
}
diff --git a/src/namespacedef.h b/src/namespacedef.h
index 4360fed..67cffaf 100644
--- a/src/namespacedef.h
+++ b/src/namespacedef.h
@@ -43,6 +43,7 @@ class NamespaceDef : public Definition
~NamespaceDef();
DefType definitionType() const { return TypeNamespace; }
QCString getOutputFileBase() const;
+ QCString anchor() const { return QCString(); }
void insertUsedFile(const char *fname);
void writeDocumentation(OutputList &ol);
diff --git a/src/pagedef.h b/src/pagedef.h
index e6c9285..b0c24d4 100644
--- a/src/pagedef.h
+++ b/src/pagedef.h
@@ -39,6 +39,7 @@ class PageDef : public Definition
// functions to get a uniform interface with Definitions
QCString getOutputFileBase() const;
+ QCString anchor() const { return QCString(); }
void findSectionsInDocumentation();
QCString title() const { return m_title; }
GroupDef * getGroupDef() const;
diff --git a/src/portable.cpp b/src/portable.cpp
index 7a78131..6dadcd1 100644
--- a/src/portable.cpp
+++ b/src/portable.cpp
@@ -121,6 +121,14 @@ int portable_system(const char *command,const char *args,bool commandHasConsole
}
else
{
+ // Because ShellExecuteEx can delegate execution to Shell extensions
+ // (data sources, context menu handlers, verb implementations) that
+ // are activated using Component Object Model (COM), COM should be
+ // initialized before ShellExecuteEx is called. Some Shell extensions
+ // require the COM single-threaded apartment (STA) type.
+ // For that case COM is initialized as follows
+ CoInitializeEx(NULL, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE);
+
// gswin32 is a GUI api which will pop up a window and run
// asynchronously. To prevent both, we use ShellExecuteEx and
// WaitForSingleObject (thanks to Robert Golias for the code)
diff --git a/src/pre.h b/src/pre.h
index 3e566fb..cbb68ad 100644
--- a/src/pre.h
+++ b/src/pre.h
@@ -24,7 +24,6 @@
class BufStr;
-DefineDict* getGlobalDefineDict();
void initPreprocessor();
void cleanUpPreprocessor();
void addSearchDir(const char *dir);
diff --git a/src/pre.l b/src/pre.l
index b962711..ac1c51b 100644
--- a/src/pre.l
+++ b/src/pre.l
@@ -63,6 +63,178 @@ struct FileState
QCString fileName;
};
+/** @brief Singleton that manages the defines available while proprocessing files. */
+class DefineManager
+{
+ class DefinesPerFile
+ {
+ public:
+ DefinesPerFile() : m_defines(257), m_includedFiles(17)
+ {
+ m_defines.setAutoDelete(TRUE);
+ }
+ virtual ~DefinesPerFile()
+ {
+ }
+ void addDefine(Define *def)
+ {
+ Define *d = m_defines.find(def->name);
+ if (d!=0) // redefine
+ {
+ m_defines.remove(d->name);
+ }
+ m_defines.insert(def->name,def);
+ }
+ void addInclude(const char *fileName)
+ {
+ m_includedFiles.insert(fileName,(void*)0x8);
+ }
+ void collectDefines(DefineDict *dict,QDict<void> &includeStack);
+ private:
+ DefineDict m_defines;
+ QDict<void> m_includedFiles;
+ };
+
+ public:
+ friend class DefinesPerFile;
+ static DefineManager &instance()
+ {
+ if (theInstance==0) theInstance = new DefineManager;
+ return *theInstance;
+ }
+ static void deleteInstance()
+ {
+ delete theInstance;
+ theInstance = 0;
+ }
+ void startContext()
+ {
+ //printf("DefineManager::startContext()\n");
+ m_contextDefines.clear();
+ }
+ void endContext()
+ {
+ //printf("DefineManager::endContext()\n");
+ m_contextDefines.clear();
+ }
+ void addFileToContext(const char *fileName)
+ {
+ if (fileName==0) return;
+ //printf("DefineManager::addFileToContext(%s)\n",fileName);
+ DefinesPerFile *dpf = m_fileMap.find(fileName);
+ if (dpf==0)
+ {
+ //printf("New file!\n");
+ dpf = new DefinesPerFile;
+ m_fileMap.insert(fileName,dpf);
+ }
+ else
+ {
+ //printf("existing file!\n");
+ QDict<void> includeStack(17);
+ dpf->collectDefines(&m_contextDefines,includeStack);
+ }
+ }
+ void addDefine(const char *fileName,Define *def)
+ {
+ if (fileName==0) return;
+ //printf("DefineManager::addDefine(%s,%s)\n",fileName,def->name.data());
+ DefinesPerFile *dpf = m_fileMap.find(fileName);
+ if (dpf==0)
+ {
+ dpf = new DefinesPerFile;
+ }
+ dpf->addDefine(def);
+
+ Define *d = m_contextDefines.find(def->name);
+ if (d!=0) // redefine
+ {
+ m_contextDefines.remove(d->name);
+ }
+ m_contextDefines.insert(def->name,def);
+ }
+ void addInclude(const char *fromFileName,const char *toFileName)
+ {
+ //printf("DefineManager::addInclude(%s,%s)\n",fromFileName,toFileName);
+ if (fromFileName==0 || toFileName==0) return;
+ DefinesPerFile *dpf = m_fileMap.find(fromFileName);
+ if (dpf==0)
+ {
+ dpf = new DefinesPerFile;
+ }
+ dpf->addInclude(toFileName);
+ }
+ Define *isDefined(const char *name) const
+ {
+ return m_contextDefines.find(name);
+ }
+ const DefineDict &defineContext() const
+ {
+ return m_contextDefines;
+ }
+ private:
+ static DefineManager *theInstance;
+ void collectDefinesForFile(const char *fileName,DefineDict *dict)
+ {
+ if (fileName==0) return;
+ DefinesPerFile *dpf = m_fileMap.find(fileName);
+ if (dpf)
+ {
+ QDict<void> includeStack(17);
+ dpf->collectDefines(dict,includeStack);
+ }
+ }
+ DefinesPerFile *find(const char *fileName) const
+ {
+ if (fileName==0) return 0;
+ return m_fileMap.find(fileName);
+ }
+ DefineManager() : m_fileMap(1009), m_contextDefines(1009)
+ {
+ m_fileMap.setAutoDelete(TRUE);
+ }
+ virtual ~DefineManager()
+ {
+ }
+ QDict<DefinesPerFile> m_fileMap;
+ DefineDict m_contextDefines;
+};
+
+DefineManager *DefineManager::theInstance = 0;
+
+void DefineManager::DefinesPerFile::collectDefines(DefineDict *dict,QDict<void> &includeStack)
+{
+ //printf("DefinesPerFile::collectDefines\n");
+ {
+ QDictIterator<void> di(m_includedFiles);
+ for (di.toFirst();(di.current());++di)
+ {
+ QCString incFile = di.currentKey();
+ DefinesPerFile *dpf = DefineManager::instance().find(incFile);
+ if (dpf && includeStack.find(incFile)==0)
+ {
+ //printf(" processing include %s\n",incFile.data());
+ includeStack.insert(incFile,(void*)0x8);
+ dpf->collectDefines(dict,includeStack);
+ }
+ }
+ }
+ {
+ QDictIterator<Define> di(m_defines);
+ Define *def;
+ for (di.toFirst();(def=di.current());++di)
+ {
+ Define *d = dict->find(def->name);
+ if (d!=0) // redefine
+ {
+ dict->remove(d->name);
+ }
+ dict->insert(def->name,def);
+ //printf(" adding define %s\n",def->name.data());
+ }
+ }
+}
+
/* -----------------------------------------------------------------
*
* scanner's state
@@ -92,8 +264,6 @@ static int g_inputBufPos;
static BufStr *g_outputBuf;
static int g_roundCount;
static bool g_quoteArg;
-static DefineDict *g_globalDefineDict = new DefineDict(10009);
-static DefineDict *g_fileDefineDict = new DefineDict(1009);
static DefineDict *g_expandedDict;
static int g_findDefArgContext;
static bool g_expectGuard;
@@ -118,10 +288,10 @@ static bool g_isSource;
static bool g_lexInit = FALSE;
-DefineDict* getGlobalDefineDict()
-{
- return g_globalDefineDict;
-}
+//DefineDict* getGlobalDefineDict()
+//{
+// return g_globalDefineDict;
+//}
static void setFileName(const char *name)
{
@@ -181,6 +351,7 @@ static void setCaseDone(bool value)
g_levelGuard[g_level-1]=value;
}
+#if 0
static bool macroIsAccessible(Define *def)
{
//printf("macroIsAccessible(%s) input=%s def=%s\n",
@@ -228,6 +399,7 @@ static Define *isDefined(const char *name)
//printf("isDefined(%s)=%p\n",name,def);
return def;
}
+#endif
static QDict<void> g_allIncludes(10009);
@@ -360,7 +532,13 @@ static QCString extractTrailingComment(const char *s)
{
i--;
while (i>0 && !(s[i-1]=='/' && s[i]=='*')) i--;
- if (i==0) return s; else return &s[i-1];
+ if (i==0)
+ {
+ i++;
+ }
+ // only /*!< or /**< are treated as a comment for the macro name,
+ // otherwise the comment is treated as part of the macro definition
+ return ((s[i+1]=='*' || s[i+1]=='!') && s[i+2]=='<') ? &s[i-1] : "";
}
else
{
@@ -835,7 +1013,7 @@ static void expandExpression(QCString &expr,QCString *rest,int pos)
{
if (g_expandedDict->find(macroName)==0) // expand macro
{
- Define *def=isDefined(macroName);
+ Define *def=DefineManager::instance().isDefined(macroName);
if (definedTest) // macro name was found after defined
{
if (def) expMacro = " 1 "; else expMacro = " 0 ";
@@ -1064,11 +1242,7 @@ QCString removeMarkers(const char *s)
pc=c;
c=*++p;
}
- if (*p)
- {
- result+=c;
- p++;
- }
+ if (*p) result+=c,p++;
}
}
break;
@@ -1082,6 +1256,7 @@ QCString removeMarkers(const char *s)
result+=c;
c=*++p;
}
+ if (*p) result+=c,p++;
}
break;
case '\'': // skip char literals
@@ -1094,6 +1269,7 @@ QCString removeMarkers(const char *s)
result+=c;
c=*++p;
}
+ if (*p) result+=c,p++;
}
break;
default:
@@ -1275,6 +1451,8 @@ static void readIncludeFile(const QCString &inc)
//printf( "absIncFileName = %s\n", absIncFileName.data() );
}
}
+ DefineManager::instance().addInclude(g_yyFileName,absIncFileName);
+ DefineManager::instance().addFileToContext(absIncFileName);
// findFile will overwrite g_yyFileDef if found
FileState *fs;
@@ -1356,7 +1534,14 @@ static void readIncludeFile(const QCString &inc)
}
if (Debug::isFlagSet(Debug::Preprocessor))
{
- msg("#include %s: not found or already included! skipping...\n",incFileName.data());
+ if (alreadyIncluded)
+ {
+ msg("#include %s: already included! skipping...\n",incFileName.data());
+ }
+ else
+ {
+ msg("#include %s: not found! skipping...\n",incFileName.data());
+ }
//printf("error: include file %s not found\n",yytext);
}
if (g_curlyCount>0 && !alreadyIncluded) // failed to find #include inside { ... }
@@ -1523,8 +1708,8 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
!(
(g_includeStack.isEmpty() || g_curlyCount>0) &&
g_macroExpansion &&
- (def=g_globalDefineDict->find(name)) &&
- macroIsAccessible(def) &&
+ (def=DefineManager::instance().isDefined(name)) &&
+ /*macroIsAccessible(def) &&*/
(!g_expandOnlyPredef || def->isPredefined)
)
)
@@ -1588,6 +1773,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
g_expectGuard = FALSE;
Define *def=0;
//def=g_globalDefineDict->find(yytext);
+ //def=DefineManager::instance().isDefined(yytext);
//printf("Search for define %s found=%d g_includeStack.isEmpty()=%d "
// "g_curlyCount=%d g_macroExpansion=%d g_expandOnlyPredef=%d "
// "isPreDefined=%d\n",yytext,def ? 1 : 0,
@@ -1596,8 +1782,8 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
// );
if ((g_includeStack.isEmpty() || g_curlyCount>0) &&
g_macroExpansion &&
- (def=g_globalDefineDict->find(yytext)) &&
- (def->isPredefined || macroIsAccessible(def)) &&
+ (def=DefineManager::instance().isDefined(yytext)) &&
+ /*(def->isPredefined || macroIsAccessible(def)) && */
(!g_expandOnlyPredef || def->isPredefined)
)
{
@@ -1624,9 +1810,9 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
Define *def=0;
if ((g_includeStack.isEmpty() || g_curlyCount>0) &&
g_macroExpansion &&
- (def=g_globalDefineDict->find(yytext)) &&
+ (def=DefineManager::instance().isDefined(yytext)) &&
def->nargs==-1 &&
- (def->isPredefined || macroIsAccessible(def)) &&
+ /*(def->isPredefined || macroIsAccessible(def)) &&*/
(!g_expandOnlyPredef || def->isPredefined)
)
{
@@ -1804,7 +1990,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
<Command>.
<UndefName>{ID} {
Define *def;
- if ((def=isDefined(yytext))
+ if ((def=DefineManager::instance().isDefined(yytext))
/*&& !def->isPredefined*/
&& !def->nonRecursive
)
@@ -1846,7 +2032,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
}
<DefinedExpr1,DefinedExpr2>\\\n { g_yyLineNr++; outputChar('\n'); }
<DefinedExpr1>{ID} {
- if (isDefined(yytext) || g_guardName==yytext)
+ if (DefineManager::instance().isDefined(yytext) || g_guardName==yytext)
g_guardExpr+=" 1L ";
else
g_guardExpr+=" 0L ";
@@ -1854,7 +2040,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
BEGIN(Guard);
}
<DefinedExpr2>{ID} {
- if (isDefined(yytext) || g_guardName==yytext)
+ if (DefineManager::instance().isDefined(yytext) || g_guardName==yytext)
g_guardExpr+=" 1L ";
else
g_guardExpr+=" 0L ";
@@ -2320,19 +2506,20 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
{
addDefine();
}
- def=g_globalDefineDict->find(g_defName);
+ def=DefineManager::instance().isDefined(g_defName);
if (def==0) // new define
{
- //printf("new define!\n");
+ //printf("new define '%s'!\n",g_defName.data());
Define *nd = newDefine();
- g_globalDefineDict->insert(g_defName,nd);
+ DefineManager::instance().addDefine(g_yyFileName,nd);
+
// also add it to the local file list if it is a source file
- if (g_isSource && g_includeStack.isEmpty())
- {
- g_fileDefineDict->insert(g_defName,nd);
- }
+ //if (g_isSource && g_includeStack.isEmpty())
+ //{
+ // g_fileDefineDict->insert(g_defName,nd);
+ //}
}
- else if (def && macroIsAccessible(def))
+ else if (def /*&& macroIsAccessible(def)*/)
// name already exists
{
//printf("existing define!\n");
@@ -2534,6 +2721,7 @@ void cleanUpPreprocessor()
{
delete g_expandedDict; g_expandedDict=0;
delete g_pathList; g_pathList=0;
+ DefineManager::deleteInstance();
}
@@ -2556,7 +2744,12 @@ void preprocessFile(const char *fileName,BufStr &input,BufStr &output)
g_expandedDict->clear();
g_condStack.clear();
g_condStack.setAutoDelete(TRUE);
- g_fileDefineDict->clear();
+ //g_fileDefineDict->clear();
+
+ DefineManager::instance().startContext();
+ setFileName(fileName);
+ g_inputFileDef = g_yyFileDef;
+ DefineManager::instance().addFileToContext(g_yyFileName);
static bool firstTime=TRUE;
if (firstTime)
@@ -2627,7 +2820,7 @@ void preprocessFile(const char *fileName,BufStr &input,BufStr &output)
def->nonRecursive = nonRecursive;
def->fileDef = g_yyFileDef;
def->fileName = fileName;
- g_globalDefineDict->insert(def->name,def);
+ DefineManager::instance().addDefine(g_yyFileName,def);
}
//printf("#define `%s' `%s' #nargs=%d\n",
@@ -2658,7 +2851,7 @@ void preprocessFile(const char *fileName,BufStr &input,BufStr &output)
def->nonRecursive = nonRecursive;
def->fileDef = g_yyFileDef;
def->fileName = fileName;
- g_globalDefineDict->insert(def->name,def);
+ DefineManager::instance().addDefine(g_yyFileName,def);
}
else
{
@@ -2675,8 +2868,6 @@ void preprocessFile(const char *fileName,BufStr &input,BufStr &output)
g_yyLineNr = 1;
g_level = 0;
g_ifcount = 0;
- setFileName(fileName);
- g_inputFileDef = g_yyFileDef;
BEGIN( Start );
@@ -2692,16 +2883,16 @@ void preprocessFile(const char *fileName,BufStr &input,BufStr &output)
forceEndCondSection();
// remove locally defined macros so they can be redefined in another source file
- if (g_fileDefineDict->count()>0)
- {
- QDictIterator<Define> di(*g_fileDefineDict);
- Define *d;
- for (di.toFirst();(d=di.current());++di)
- {
- g_globalDefineDict->remove(di.currentKey());
- }
- g_fileDefineDict->clear();
- }
+ //if (g_fileDefineDict->count()>0)
+ //{
+ // QDictIterator<Define> di(*g_fileDefineDict);
+ // Define *d;
+ // for (di.toFirst();(d=di.current());++di)
+ // {
+ // g_globalDefineDict->remove(di.currentKey());
+ // }
+ // g_fileDefineDict->clear();
+ //}
if (Debug::isFlagSet(Debug::Preprocessor))
{
@@ -2717,7 +2908,17 @@ void preprocessFile(const char *fileName,BufStr &input,BufStr &output)
orgPos++;
}
msg("\n---------\n");
+ msg("Macros accessible in this file:\n");
+ msg("---------\n");
+ QDictIterator<Define> di(DefineManager::instance().defineContext());
+ Define *def;
+ for (di.toFirst();(def=di.current());++di)
+ {
+ msg("%s ",def->name.data());
+ }
+ msg("\n---------\n");
}
+ DefineManager::instance().endContext();
}
void preFreeScanner()
diff --git a/src/pycode.l b/src/pycode.l
index 852d424..0116e80 100644
--- a/src/pycode.l
+++ b/src/pycode.l
@@ -730,10 +730,9 @@ static bool findMemberLink(CodeOutputInterface &ol,Definition *sym,const char *s
{
ClassDef *cd = (ClassDef*)sym->getOuterScope();
ClassDef *thisCd = (ClassDef *)g_currentDefinition;
- QCString anchor;
+ QCString anchor=sym->anchor();
if (sym->definitionType()==Definition::TypeMember)
{
- anchor=((MemberDef *)sym)->anchor();
if (g_currentMemberDef)
{
addDocCrossReference(g_currentMemberDef,(MemberDef*)sym);
diff --git a/src/rtfdocvisitor.cpp b/src/rtfdocvisitor.cpp
index 455611d..b66a9a8 100644
--- a/src/rtfdocvisitor.cpp
+++ b/src/rtfdocvisitor.cpp
@@ -1672,7 +1672,7 @@ void RTFDocVisitor::writeMscFile(const QCString &fileName)
baseName=baseName.right(baseName.length()-i-1);
}
QCString outDir = Config_getString("RTF_OUTPUT");
- writeMscGraphFromFile(fileName,outDir,baseName,MSC_BITMAP);
+ writeMscGraphFromFile(fileName+".msc",outDir,baseName,MSC_BITMAP);
if (!m_lastIsPara) m_t << "\\par" << endl;
m_t << "{" << endl;
m_t << rtf_Style_Reset;
diff --git a/src/scanner.l b/src/scanner.l
index cf07d47..cf6d538 100644
--- a/src/scanner.l
+++ b/src/scanner.l
@@ -173,6 +173,7 @@ static QCString idlProp;
static bool g_lexInit = FALSE;
static bool externC;
+static QCString g_hereDocId;
//-----------------------------------------------------------------------------
@@ -695,6 +696,8 @@ TYPEDEFPREFIX (("typedef"{BN}+)?)((("volatile"|"const"){BN}+)?)
%x CopyArgComment
%x CopyArgCommentLine
%x CopyArgVerbatim
+%x HereDoc
+%x HereDocEnd
%x IDLAttribute
%x IDLProp
@@ -1822,6 +1825,16 @@ TYPEDEFPREFIX (("typedef"{BN}+)?)((("volatile"|"const"){BN}+)?)
else
BEGIN( EndTemplate );
}
+<EndTemplate>"<<<" {
+ if (!insidePHP)
+ {
+ REJECT;
+ }
+ else
+ {
+ BEGIN(HereDoc);
+ }
+ }
<ClassTemplSpec,EndTemplate>"<<" {
current->name+=yytext;
// *currentTemplateSpec+=yytext;
@@ -1901,6 +1914,20 @@ TYPEDEFPREFIX (("typedef"{BN}+)?)((("volatile"|"const"){BN}+)?)
else
REJECT;
}
+<HereDoc>{ID} { // PHP heredoc
+ g_hereDocId = yytext;
+ BEGIN(HereDocEnd);
+ }
+<HereDoc>"'"{ID}/"'" { // PHP nowdoc
+ g_hereDocId = &yytext[1];
+ }
+<HereDocEnd>^{ID} { // id at start of the line could mark the end of the block
+ if (g_hereDocId==yytext) // it is the end marker
+ {
+ BEGIN(FindMembers);
+ }
+ }
+<HereDocEnd>. { }
<FindMembers>"Q_OBJECT" { // Qt object macro
}
<FindMembers>"Q_PROPERTY" { // Qt property declaration
@@ -2387,7 +2414,7 @@ TYPEDEFPREFIX (("typedef"{BN}+)?)((("volatile"|"const"){BN}+)?)
}
}
}
-<FindMembers,FindFields,ReadInitializer>"//"([!/]?){B}*{CMD}"}".*|"/*"([!*]?){B}*{CMD}"}".*"*/" {
+<FindMembers,FindFields,ReadInitializer>"//"([!/]?){B}*{CMD}"}".*|"/*"([!*]?){B}*{CMD}"}"[^*]*"*/" {
closeGroup(current,yyFileName,yyLineNr);
}
<FindMembers>"=" { // in PHP code this could also be due to "<?="
@@ -5537,7 +5564,14 @@ TYPEDEFPREFIX (("typedef"{BN}+)?)((("volatile"|"const"){BN}+)?)
<SkipCxxComment>.*"\\\n" { // line continuation
- yyLineNr++;
+ if (insideCS)
+ {
+ REJECT;
+ }
+ else
+ {
+ yyLineNr++;
+ }
}
<SkipCxxComment>.*/\n {
BEGIN( lastCContext ) ;
diff --git a/src/util.cpp b/src/util.cpp
index 62f8443..c18e65e 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -1494,6 +1494,7 @@ ClassDef *getResolvedClass(Definition *scope,
{
if (!mayBeHidden || !result->isHidden())
{
+ //printf("result was %s\n",result?result->name().data():"<none>");
result=0; // don't link to artificial/hidden classes unless explicitly allowed
}
}
@@ -1878,6 +1879,7 @@ void linkifyText(const TextGeneratorIntf &out,Definition *scope,
//printf(" -> nothing\n");
}
+ int m = matchWord.findRev("::");
QCString scopeName;
if (scope &&
(scope->definitionType()==Definition::TypeClass ||
@@ -1887,13 +1889,19 @@ void linkifyText(const TextGeneratorIntf &out,Definition *scope,
{
scopeName=scope->name();
}
+ else if (m!=-1)
+ {
+ scopeName = matchWord.left(m);
+ matchWord = matchWord.mid(m+2);
+ }
+
//printf("ScopeName=%s\n",scopeName.data());
//if (!found) printf("Trying to link %s in %s\n",word.data(),scopeName.data());
if (!found &&
getDefs(scopeName,matchWord,0,md,cd,fd,nd,gd) &&
- (md->isTypedef() || md->isEnumerate() ||
- md->isReference() || md->isVariable()
- ) &&
+ //(md->isTypedef() || md->isEnumerate() ||
+ // md->isReference() || md->isVariable()
+ //) &&
(external ? md->isLinkable() : md->isLinkableInProject())
)
{
@@ -1902,6 +1910,7 @@ void linkifyText(const TextGeneratorIntf &out,Definition *scope,
// md->anchor(),word);
out.writeLink(md->getReference(),md->getOutputFileBase(),
md->anchor(),word);
+ //printf("found symbol %s\n",matchWord.data());
found=TRUE;
}
}
@@ -6356,8 +6365,8 @@ SrcLangExt getLanguageFromFileName(const QCString fileName)
//--------------------------------------------------------------------------
-/*! Returns true iff the given name string appears to be a typedef in scope. */
-bool checkIfTypedef(Definition *scope,FileDef *fileScope,const char *n)
+MemberDef *getMemberFromSymbol(Definition *scope,FileDef *fileScope,
+ const char *n)
{
if (scope==0 ||
(scope->definitionType()!=Definition::TypeClass &&
@@ -6370,11 +6379,11 @@ bool checkIfTypedef(Definition *scope,FileDef *fileScope,const char *n)
QCString name = n;
if (name.isEmpty())
- return FALSE; // no name was given
+ return 0; // no name was given
DefinitionIntf *di = Doxygen::symbolMap->find(name);
if (di==0)
- return FALSE; // could not find any matching symbols
+ return 0; // could not find any matching symbols
// mostly copied from getResolvedClassRec()
QCString explicitScopePart;
@@ -6385,12 +6394,14 @@ bool checkIfTypedef(Definition *scope,FileDef *fileScope,const char *n)
replaceNamespaceAliases(explicitScopePart,explicitScopePart.length());
name = name.mid(qualifierIndex+2);
}
+ //printf("explicitScopePart=%s\n",explicitScopePart.data());
int minDistance = 10000;
MemberDef *bestMatch = 0;
if (di->definitionType()==DefinitionIntf::TypeSymbolList)
{
+ //printf("multiple matches!\n");
// find the closest closest matching definition
DefinitionListIterator dli(*(DefinitionList*)di);
Definition *d;
@@ -6404,12 +6415,14 @@ bool checkIfTypedef(Definition *scope,FileDef *fileScope,const char *n)
{
minDistance = distance;
bestMatch = (MemberDef *)d;
+ //printf("new best match %s distance=%d\n",bestMatch->qualifiedName().data(),distance);
}
}
}
}
else if (di->definitionType()==Definition::TypeMember)
{
+ //printf("unique match!\n");
Definition *d = (Definition *)di;
g_visitedNamespaces.clear();
int distance = isAccessibleFromWithExpScope(scope,fileScope,d,explicitScopePart);
@@ -6417,8 +6430,16 @@ bool checkIfTypedef(Definition *scope,FileDef *fileScope,const char *n)
{
minDistance = distance;
bestMatch = (MemberDef *)d;
+ //printf("new best match %s distance=%d\n",bestMatch->qualifiedName().data(),distance);
}
}
+ return bestMatch;
+}
+
+/*! Returns true iff the given name string appears to be a typedef in scope. */
+bool checkIfTypedef(Definition *scope,FileDef *fileScope,const char *n)
+{
+ MemberDef *bestMatch = getMemberFromSymbol(scope,fileScope,n);
if (bestMatch && bestMatch->isTypedef())
return TRUE; // closest matching symbol is a typedef
@@ -6426,6 +6447,7 @@ bool checkIfTypedef(Definition *scope,FileDef *fileScope,const char *n)
return FALSE;
}
+
int nextUtf8CharPosition(const QCString &utf8Str,int len,int startPos)
{
int bytes=1;
@@ -6509,42 +6531,100 @@ QCString parseCommentAsText(const Definition *scope,const MemberDef *md,
static QDict<void> aliasesProcessed;
-static QCString replaceAliasArgument(const QCString &aliasValue,int paramNum,
- const QCString &paramValue);
+static QCString expandAliasRec(const QCString s);
+struct Marker
+{
+ Marker(int p, int n,int s) : pos(p),number(n),size(s) {}
+ int pos; // position in the string
+ int number; // argument number
+ int size; // size of the marker
+};
+
+/** Replaces the markers in an alias definition \a aliasValue
+ * with the corresponding values found in the comma separated argument
+ * list \a argList and the returns the result after recursive alias expansion.
+ */
static QCString replaceAliasArguments(const QCString &aliasValue,const QCString &argList)
{
- QCString result = aliasValue;
+ //printf("----- replaceAliasArguments(val=[%s],args=[%s])\n",aliasValue.data(),argList.data());
+
+ // first make a list of arguments from the comma separated argument list
QList<QCString> args;
- int p=0,i,c=1,l=(int)argList.length();
- // first count the number of arguments the command has
- // (= number of unescaped commas plus 1)
+ args.setAutoDelete(TRUE);
+ int i,l=(int)argList.length();
+ int s=0;
for (i=0;i<l;i++)
{
- if (argList.at(i)==',' && (i==0 || argList.at(i-1)!='\\')) c++;
+ if (argList.at(i)==',' && (i==0 || argList.at(i-1)!='\\'))
+ {
+ args.append(new QCString(argList.mid(s,i-s)));
+ s=i+1; // start of next argument
+ }
}
- // next we substitute the \<number> by the argument values, starting
- // with the last one. This is needed to avoid that \10 is treated as
- // a \1 followed by a 0 and already expanded as the first parameter.
- p = l;
- for (i=l-1;i>=0;i--)
+ if (l>s) args.append(new QCString(argList.right(l-s)));
+ //printf("found %d arguments\n",args.count());
+
+ // next we look for the positions of the markers and add them to a list
+ QList<Marker> markerList;
+ markerList.setAutoDelete(TRUE);
+ l = aliasValue.length();
+ int markerStart=0;
+ int markerEnd=0;
+ for (i=0;i<l;i++)
{
- if (argList.at(i)==',' && (i==0 || argList.at(i-1)!='\\'))
+ if (markerStart==0 && aliasValue.at(i)=='\\') // start of a \xx marker
{
- result = replaceAliasArgument(result,c,argList.mid(i+1,p-i-1));
- p=i;
- c--;
+ markerStart=i+1;
+ }
+ else if (markerStart>0 && aliasValue.at(i)>='0' && aliasValue.at(i)<='9')
+ {
+ // read digit that make up the marker number
+ markerEnd=i+1;
+ }
+ else
+ {
+ if (markerStart>0 && markerEnd>markerStart) // end of marker
+ {
+ int markerLen = markerEnd-markerStart;
+ markerList.append(new Marker(markerStart-1, // include backslash
+ atoi(aliasValue.mid(markerStart,markerLen)),markerLen+1));
+ //printf("found marker at %d with len %d and number %d\n",
+ // markerStart-1,markerLen+1,atoi(aliasValue.mid(markerStart,markerLen)));
+ }
+ markerStart=0; // outside marker
+ markerEnd=0;
}
}
- // special case for the first argument, whose value is not preceded by a ,
- if (p>0)
+
+ // then we replace the markers with the corresponding arguments in one pass
+ QCString result;
+ int p=0;
+ for (i=0;i<(int)markerList.count();i++)
{
- result = replaceAliasArgument(result,c,argList.left(p));
+ Marker *m = markerList.at(i);
+ result+=aliasValue.mid(p,m->pos-p);
+ //printf("part before marker %d: '%s'\n",i,aliasValue.mid(p,m->pos-p).data());
+ if (m->number>0 && m->number<=(int)args.count()) // valid number
+ {
+ result+=*args.at(m->number-1);
+ //printf("marker index=%d pos=%d number=%d size=%d replacement %s\n",i,m->pos,m->number,m->size,
+ // args.at(m->number-1)->data());
+ }
+ p=m->pos+m->size; // continue after the marker
}
+ result+=aliasValue.right(l-p); // append remainder
+ //printf("string after replacement of markers: '%s'\n",result.data());
+
+ // expand the result again
+ result = substitute(result,"\\{","{");
+ result = substitute(result,"\\}","}");
+ result = expandAliasRec(substitute(result,"\\,",","));
+
return result;
}
-QCString expandAliasRec(const QCString s)
+static QCString expandAliasRec(const QCString s)
{
QCString result;
static QRegExp cmdPat("[\\\\@][a-z_A-Z][a-z_A-Z0-9]*");
@@ -6596,39 +6676,6 @@ QCString expandAliasRec(const QCString s)
return result;
}
-static QCString replaceAliasArgument(const QCString &aliasValue,int paramNum,
- const QCString &paramValue)
-{
- QCString result;
- QCString paramMarker;
- paramMarker.sprintf("\\%d",paramNum);
- int markerLen = paramMarker.length();
- int p=0,i;
- while ((i=aliasValue.find(paramMarker,p))!=-1) // search for marker
- {
- result+=aliasValue.mid(p,i-p);
- //printf("Found marker '%s' at %d len=%d for param '%s' in '%s'\n",
- // paramMarker.data(),i,markerLen,paramValue.data(),aliasValue.data());
- if (i==0 || aliasValue.at(i-1)!='\\') // found unescaped marker
- {
- result += paramValue;
- p=i+markerLen;
- }
- else // ignore escaped markers
- {
- result += aliasValue.mid(i,markerLen);
- p=i+1;
- }
- }
- result+=aliasValue.right(aliasValue.length()-p);
- result = substitute(result,"\\{","{");
- result = substitute(result,"\\}","}");
- result = expandAliasRec(substitute(result,"\\,",","));
- //printf("replaceAliasArgument('%s',%d,'%s')->%s\n",
- // aliasValue.data(),paramNum,paramValue.data(),result.data());
- return result;
-}
-
int countAliasArguments(const QCString argList)
{
int count=1;
diff --git a/src/util.h b/src/util.h
index 07030b3..fd8c54e 100644
--- a/src/util.h
+++ b/src/util.h
@@ -354,6 +354,8 @@ bool updateLanguageMapping(const QCString &extension,const QCString &parser);
SrcLangExt getLanguageFromFileName(const QCString fileName);
void initDefaultExtensionMapping();
+MemberDef *getMemberFromSymbol(Definition *scope,FileDef *fileScope,
+ const char *n);
bool checkIfTypedef(Definition *scope,FileDef *fileScope,const char *n);
ClassDef *newResolveTypedef(FileDef *fileScope,MemberDef *md,
diff --git a/src/xmlgen.cpp b/src/xmlgen.cpp
index 764ab71..886e921 100644
--- a/src/xmlgen.cpp
+++ b/src/xmlgen.cpp
@@ -495,12 +495,18 @@ void writeXMLCodeBlock(FTextStream &t,FileDef *fd)
ParserInterface *pIntf=Doxygen::parserManager->getParser(fd->getDefFileExtension());
pIntf->resetCodeParserState();
XMLCodeGenerator *xmlGen = new XMLCodeGenerator(t);
- pIntf->parseCode(*xmlGen,
- 0,
+ pIntf->parseCode(*xmlGen, // codeOutIntf
+ 0, // scopeName
fileToString(fd->absFilePath(),Config_getBool("FILTER_SOURCE_FILES")),
- FALSE,
- 0,
- fd);
+ FALSE, // isExampleBlock
+ 0, // exampleName
+ fd, // fileDef
+ -1, // startLine
+ -1, // endLine
+ FALSE, // inlineFragement
+ 0, // memberDef
+ TRUE // showLineNumbers
+ );
xmlGen->finish();
delete xmlGen;
}
@@ -543,20 +549,21 @@ static void stripQualifiers(QCString &typeStr)
static QCString classOutputFileBase(ClassDef *cd)
{
- static bool inlineGroupedClasses = Config_getBool("INLINE_GROUPED_CLASSES");
- if (inlineGroupedClasses && cd->partOfGroups()!=0)
- return cd->getXmlOutputFileBase();
- else
- return cd->getOutputFileBase();
+ //static bool inlineGroupedClasses = Config_getBool("INLINE_GROUPED_CLASSES");
+ //if (inlineGroupedClasses && cd->partOfGroups()!=0)
+ return cd->getOutputFileBase();
+ //else
+ // return cd->getOutputFileBase();
}
static QCString memberOutputFileBase(MemberDef *md)
{
- static bool inlineGroupedClasses = Config_getBool("INLINE_GROUPED_CLASSES");
- if (inlineGroupedClasses && md->getClassDef() && md->getClassDef()->partOfGroups()!=0)
- return md->getClassDef()->getXmlOutputFileBase();
- else
- return md->getOutputFileBase();
+ //static bool inlineGroupedClasses = Config_getBool("INLINE_GROUPED_CLASSES");
+ //if (inlineGroupedClasses && md->getClassDef() && md->getClassDef()->partOfGroups()!=0)
+ // return md->getClassDef()->getXmlOutputFileBase();
+ //else
+ // return md->getOutputFileBase();
+ return md->getOutputFileBase();
}