From 8491e9fbd06ef8a8f1cc542a524c673d7781d4b6 Mon Sep 17 00:00:00 2001 From: Dimitri van Heesch Date: Thu, 27 Oct 2011 18:00:16 +0000 Subject: Release-1.7.5.1-20111027 --- Doxyfile | 1 + INSTALL | 4 +- README | 4 +- configure | 2 +- doc/commands.doc | 3 +- doc/faq.doc | 6 + src/bib2xhtml.h | 290 ++++++++++++++ src/bib2xhtml.pl | 290 ++++++++++++++ src/cite.cpp | 343 ++++++---------- src/cite.h | 16 +- src/classdef.cpp | 76 ++-- src/classdef.h | 5 +- src/code.l | 36 +- src/commentscan.l | 3 +- src/config.xml | 17 +- src/configoptions.cpp | 23 +- src/definition.h | 3 + src/dirdef.h | 9 +- src/docparser.cpp | 21 +- src/doctokenizer.l | 8 +- src/doxygen.bst | 760 +++++++++++++++++------------------- src/doxygen.cpp | 32 +- src/doxygen.h | 1 + src/doxygen_bst.h | 760 +++++++++++++++++------------------- src/filedef.cpp | 8 +- src/filedef.h | 6 +- src/fortranscanner.l | 14 +- src/groupdef.h | 1 + src/htmldocvisitor.cpp | 19 +- src/index.cpp | 130 ++---- src/latexdocvisitor.cpp | 5 +- src/latexgen.cpp | 27 +- src/libdoxygen.pro.in | 1 - src/libdoxygen.t | 4 + src/memberdef.cpp | 5 +- src/namespacedef.h | 1 + src/pagedef.h | 1 + src/portable.cpp | 8 + src/pre.h | 1 - src/pre.l | 293 +++++++++++--- src/pycode.l | 3 +- src/rtfdocvisitor.cpp | 2 +- src/scanner.l | 38 +- src/util.cpp | 167 +++++--- src/util.h | 2 + src/xmlgen.cpp | 37 +- tmake/lib/macosx-c++/tmake.conf | 2 +- tmake/lib/macosx-uni-c++/tmake.conf | 2 +- 48 files changed, 2113 insertions(+), 1377 deletions(-) create mode 100644 src/bib2xhtml.h create mode 100755 src/bib2xhtml.pl diff --git a/Doxyfile b/Doxyfile index 621c9d9..3f3e703 100644 --- a/Doxyfile +++ b/Doxyfile @@ -121,6 +121,7 @@ EXCLUDE = src/code.cpp \ src/doxygen_php.h \ src/compound_xsd.h \ src/layout_default.h \ + src/bib2xhtml.h EXCLUDE_SYMLINKS = NO EXCLUDE_PATTERNS = EXCLUDE_SYMBOLS = diff --git a/INSTALL b/INSTALL index f50fc35..8615b17 100644 --- a/INSTALL +++ b/INSTALL @@ -1,7 +1,7 @@ -DOXYGEN Version 1.7.5.1-20110925 +DOXYGEN Version 1.7.5.1-20111027 Please read the installation section of the manual (http://www.doxygen.org/install.html) for instructions. -------- -Dimitri van Heesch (25 September 2011) +Dimitri van Heesch (27 October 2011) diff --git a/README b/README index 5fe20b2..978a647 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -DOXYGEN Version 1.7.5.1_20110925 +DOXYGEN Version 1.7.5.1_20111027 Please read INSTALL for compilation instructions. @@ -26,4 +26,4 @@ forum. Enjoy, -Dimitri van Heesch (dimitri@stack.nl) (25 September 2011) +Dimitri van Heesch (dimitri@stack.nl) (27 October 2011) diff --git a/configure b/configure index 084edff..b43bf32 100755 --- a/configure +++ b/configure @@ -20,7 +20,7 @@ doxygen_version_minor=7 doxygen_version_revision=5.1 #NOTE: Setting version_mmn to "NO" will omit mmn info from the package. -doxygen_version_mmn=20110925 +doxygen_version_mmn=20111027 bin_dirs=`echo $PATH | sed -e "s/:/ /g"` diff --git a/doc/commands.doc b/doc/commands.doc index d74452a..72ec29f 100644 --- a/doc/commands.doc +++ b/doc/commands.doc @@ -629,8 +629,7 @@ Structural indicators */ \endverbatim - You can refer to the main page using \\ref index (if the treeview - is disabled, otherwise you should use \\ref main). + You can refer to the main page using \\ref index. \sa section \ref cmdsection "\\section", section \ref cmdsubsection "\\subsection", and diff --git a/doc/faq.doc b/doc/faq.doc index 7bbf858..7547d16 100644 --- a/doc/faq.doc +++ b/doc/faq.doc @@ -254,6 +254,12 @@ in a configuration file from the command line (assuming a UNIX environment): ( cat Doxyfile ; echo "PROJECT_NUMBER=1.0" ) | doxygen - \endverbatim +For Windows the following would do the same: + +\verbatim +( type Doxyfile & echo PROJECT_NUMBER=1.0 ) | doxygen.exe - +\endverbatim + If multiple options with the same name are specified then doxygen will use the last one. To append to an existing option you can use the += operator. 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*/Å/g;\n" +" s/\\\\aa\\b\\s*/å/g;\n" +" s/\\\\AE\\b\\s*/Æ/g;\n" +" s/\\\\ae\\b\\s*/æ/g;\n" +" s/\\\\ss\\b\\s*/ß/g;\n" +" s/\\\\S\\b\\s*/§/g;\n" +" s/\\\\P\\b\\s*/¶/g;\n" +" s/\\\\pounds\\b\\s*/£/g;\n" +" s/\\?\\`/¿/g;\n" +" s/\\!\\`/¡/g;\n" +" s/\\-\\-\\-/—/g;\n" +" s/([^\\!])\\-\\-([^\\>])/$1–$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/ε/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/θ/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/π/g;\n" +" s/\\\\([rR]ho)\\b/&$1;/g;\n" +" s/\\\\varrho\\b/ρ/g;\n" +" s/\\\\([sS]igma)\\b/&$1;/g;\n" +" s/\\\\varsigma\\b/ς/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/φ/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 = \"\";\n" +"$endstring = \"\";\n" +"@citations = ();\n" +"loop:\n" +"while () {\n" +" print HTMLFILE;\n" +" last loop if m/^$beginstring$/;\n" +"}\n" +"loop:\n" +"while () {\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 = \"\";\n" +"$endstring = \"\";\n" +"loop:\n" +"while () {\n" +" last loop if m/^$beginstring$/;\n" +" print HTMLFILE;\n" +"}\n" +"loop:\n" +"while () {\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 () {\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+
\\[([^\\]]*)\\]
+;\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 () {\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:(
\\[)[^\\]]*(\\]
):$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 = \" [\" . $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 ()([^\\[]+) \\[(\\2)/In $1\\[$2/;\n" +" s/\\\\htmladdnormallink(foot)?(\\001\\d+)\\{([^\\001]+)\\2\\}(\\001\\d+)\\{([^\\001]+)\\4\\}/$3<\\/a>/gs;\n" +" s/\\&/\\005/g;\n" +" s/\\\\?&/&/g;\n" +" s/\\005/&/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/

/g;\n" +" s/\\\\url(\\001\\d+)\\{(.*)\\1\\}/$2<\\/a>/gs;\n" +" s/\\\\href(\\001\\d+)\\{(.*)\\1\\}(\\001\\d+)\\{([^\\001]*)\\3\\}/$4<\\/a>/gs;\n" +" s/\\\\href(\\001\\d+)\\{(.*)\\1\\}/$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\\}/$2<\\/em>/gs;\n" +" s/(\\001\\d+)\\{\\\\it\\s+(.*)\\1\\}/$2<\\/i>/gs;\n" +" s/(\\001\\d+)\\{\\\\bf\\s+(.*)\\1\\}/$2<\\/b>/gs;\n" +" s/(\\001\\d+)\\{\\\\tt\\s+(.*)\\1\\}/$2<\\/tt>/gs;\n" +" s/\\\\emph(\\001\\d+)\\{(.*)\\1\\}/$2<\\/em>/gs;\n" +" s/\\\\textit(\\001\\d+)\\{(.*)\\1\\}/$2<\\/i>/gs;\n" +" s/\\\\textbf(\\001\\d+)\\{(.*)\\1\\}/$2<\\/b>/gs;\n" +" s/\\\\texttt(\\001\\d+)\\{(.*)\\1\\}/$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\\}/$2<\\/b>/gs;\n" +" s/\\\\mathcal(\\001\\d+)\\{(.*)\\1\\}/$2<\\/i>/gs;\n" +" s/\\\\mathit(\\001\\d+)\\{(.*)\\1\\}/$2<\\/i>/gs;\n" +" s/\\\\mathtt(\\001\\d+)\\{(.*)\\1\\}/$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\\}/$2<\\/sup>/gs;\n" +" $t =~ s/\\^(\\w)/$1<\\/sup>/g;\n" +" $t =~ s/\\_(\\001\\d+)\\{(.*)\\1\\}/$2<\\/sub>/gs;\n" +" $t =~ s/\\_(\\w)/$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/(\\++;\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 () {\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*/Å/g; + s/\\aa\b\s*/å/g; + s/\\AE\b\s*/Æ/g; + s/\\ae\b\s*/æ/g; + s/\\ss\b\s*/ß/g; + s/\\S\b\s*/§/g; + s/\\P\b\s*/¶/g; + s/\\pounds\b\s*/£/g; + s/\?\`/¿/g; + s/\!\`/¡/g; + s/\-\-\-/—/g; + s/([^\!])\-\-([^\>])/$1–$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/ε/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/θ/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/π/g; + s/\\([rR]ho)\b/&$1;/g; + s/\\varrho\b/ρ/g; + s/\\([sS]igma)\b/&$1;/g; + s/\\varsigma\b/ς/g; + s/\\([tT]au)\b/&$1;/g; + s/\\([uU]psilon)\b/&$1;/g; + s/\\([pP]hi)\b/&$1;/g; + s/\\varphi\b/φ/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 = ""; +$endstring = ""; +@citations = (); +loop: +while () { + print HTMLFILE; + last loop if m/^$beginstring$/; +} +loop: +while () { + 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 = ""; +$endstring = ""; +loop: +while () { + last loop if m/^$beginstring$/; + print HTMLFILE; +} +loop: +while () { + last loop if m/^$endstring$/; +} +print HTMLFILE "$beginstring\n"; +$t = $auxfile . ".bbl"; +$/ = ""; +open(BBLFILE, "<$t") || die "error opening $t: $!\n"; +$nentry = 0; +loop: +while () { + 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+

\[([^\]]*)\]
+; + $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 () { + 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:(
\[)[^\]]*(\]
):$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 = " [" . $bibcite{$bcite} . "]<\/a>"; + } else { + $blabel = " [" . $bibcite{$bcite} . "]"; + } + $old =~ s/(\W)/\\$1/g; + s/\s*$old/$blabel/g; + } + s/In ()([^\[]+) \[(\2)/In $1\[$2/; + s/\\htmladdnormallink(foot)?(\001\d+)\{([^\001]+)\2\}(\001\d+)\{([^\001]+)\4\}/$3<\/a>/gs; + s/\&/\005/g; + s/\\?&/&/g; + s/\005/&/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/

/g; + s/\\url(\001\d+)\{(.*)\1\}/$2<\/a>/gs; + s/\\href(\001\d+)\{(.*)\1\}(\001\d+)\{([^\001]*)\3\}/$4<\/a>/gs; + s/\\href(\001\d+)\{(.*)\1\}/$2<\/a>/gs; + s/(\001\d+)\{\\rm\s+(.*)\1\}/$2/gs; + s/\\textrm(\001\d+)\{(.*)\1\}/$2/gs; + s/(\001\d+)\{\\em\s+(.*)\1\}/$2<\/em>/gs; + s/(\001\d+)\{\\it\s+(.*)\1\}/$2<\/i>/gs; + s/(\001\d+)\{\\bf\s+(.*)\1\}/$2<\/b>/gs; + s/(\001\d+)\{\\tt\s+(.*)\1\}/$2<\/tt>/gs; + s/\\emph(\001\d+)\{(.*)\1\}/$2<\/em>/gs; + s/\\textit(\001\d+)\{(.*)\1\}/$2<\/i>/gs; + s/\\textbf(\001\d+)\{(.*)\1\}/$2<\/b>/gs; + s/\\texttt(\001\d+)\{(.*)\1\}/$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\}/$2<\/b>/gs; + s/\\mathcal(\001\d+)\{(.*)\1\}/$2<\/i>/gs; + s/\\mathit(\001\d+)\{(.*)\1\}/$2<\/i>/gs; + s/\\mathtt(\001\d+)\{(.*)\1\}/$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\}/$2<\/sup>/gs; + $t =~ s/\^(\w)/$1<\/sup>/g; + $t =~ s/\_(\001\d+)\{(.*)\1\}/$2<\/sub>/gs; + $t =~ s/\_(\w)/$1<\/sub>/g; + $t; + } + s/(\$([^\$]+)\$)/&domath($2)/ge; + s/(\\\((([^\\]|\\[^\(\)])+)\\\))/&domath($2)/ge; + s/\\mbox(\001\d+)\{(.*)\1\}/$2/gs; + while (s/(\++; + s/\001\d+[\{\}]//gs; + tr/\002\003\004/{}$/; + print HTMLFILE $_; +} +close(BBLFILE); +print HTMLFILE "<$list_end>\n\n$endstring\n"; +while () { + 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 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 << "" << endl; + t << "" << endl; + t << "" << endl; + t << "" << endl; + t << "" << 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("" * write$ newline$ } + if$ + } + { "" * write$ newline$ } + if$ + } + { "" * write$ newline$ } + if$ + keywords empty$ + 'skip$ + { "" * write$ newline$ } + if$ + "

[" * label * "]
" * write$ "" before.all 'output.state := } -FUNCTION {fin.entry.original} +FUNCTION {fin.entry} { add.period$ write$ + postscript empty$ + 'skip$ + { newline$ "" * write$ } + if$ + pdf empty$ + 'skip$ + { newline$ "" * write$ } + if$ + dvi empty$ + 'skip$ + { newline$ "" * write$ } + if$ + doi empty$ + 'skip$ + { newline$ "" * write$ } + if$ + "
" 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$ "" } - { "" swap$ * "" * } + { "" swap$ * "" * } if$ } -FUNCTION {emphasize} -{ duplicate$ empty$ - { pop$ "" } - { "" swap$ * "" * } +FUNCTION {add.link} % title +{ + 't := + t empty$ + { "" } + { url empty$ + { html empty$ + { t } + { "" * t * "" * } + if$ } + { "" * t * "" * } + if$ + } + if$ +} + +FUNCTION {add.mailto} % authors +{ + 't := + t empty$ + { "" } + { mailto empty$ + { t } + { "" * t * "" * } + 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 " * + key empty$ { journal empty$ { "need key or journal for " cite$ * " to crossref " * crossref * warning$ "" } - { "In " journal * "" * } + { "" * journal * "" * } if$ } - { "In " key * } + { key * } if$ - " " * crossref * "" * + " \citelabel{" * crossref * "}" * } FUNCTION {format.crossref.editor} @@ -656,6 +590,7 @@ FUNCTION {format.book.crossref} " of " * } if$ + "" * editor empty$ editor field.or.null author field.or.null = or @@ -665,7 +600,7 @@ FUNCTION {format.book.crossref} crossref * warning$ "" * } - { "" * series * "" * } + { "" * series * "" * } if$ } { key * } @@ -673,11 +608,13 @@ FUNCTION {format.book.crossref} } { format.crossref.editor * } if$ - " " * crossref * "" * + " \citelabel{" * crossref * "}" * } FUNCTION {format.incoll.inproc.crossref} -{ editor empty$ +{ + "In " * + 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 " booktitle * "" * } + { "" * booktitle * "" * } if$ } - { "In " key * } + { key * } if$ } - { "In " format.crossref.editor * } - if$ - " " * crossref * "" * -} - -% urlbst... -% Functions for making hypertext links. -FUNCTION {make.href} -{ - "" * swap$ * "" * -} - -% 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 "" * url * "" * } - 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 + " \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 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", 0, "Char", 0, 0, 0, TRUE, FALSE }, { "basic_ostream", "basic_ios", 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 \n" -"%%\n" -"%% Copyright 1999, 2005, 2006, 2009, Norman Gray \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 \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
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" -" { \"\" * 'openinlinelink :=\n" -" \"\" '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
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" +" { \"\" * write$ newline$ }\n" +" if$\n" +" } \n" +" { \"\" * write$ newline$ }\n" +" if$\n" +" }\n" +" { \"\" * write$ newline$ }\n" +" if$\n" +" keywords empty$\n" +" 'skip$\n" +" { \"\" * write$ newline$ }\n" +" if$\n" +" \"
[\" * label * \"]
\" * 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$ \"\" * write$ }\n" +" if$\n" +" pdf empty$\n" +" 'skip$\n" +" { newline$ \"\" * write$ }\n" +" if$\n" +" dvi empty$\n" +" 'skip$\n" +" { newline$ \"\" * write$ }\n" +" if$\n" +" doi empty$\n" +" 'skip$\n" +" { newline$ \"\" * write$ }\n" +" if$\n" +" \"
\" 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" -" { \"\" swap$ * \"\" * }\n" +" { \"\" swap$ * \"\" * }\n" " if$\n" "}\n" "\n" -"FUNCTION {emphasize}\n" -"{ duplicate$ empty$\n" -" { pop$ \"\" }\n" -" { \"\" swap$ * \"\" * }\n" +"FUNCTION {add.link} % title\n" +"{\n" +" 't :=\n" +" t empty$\n" +" { \"\" }\n" +" { url empty$\n" +" { html empty$\n" +" { t }\n" +" { \"\" * t * \"\" * }\n" +" if$ }\n" +" { \"\" * t * \"\" * }\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" +" { \"\" * t * \"\" * }\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 \" *\n" +" key empty$\n" " { journal empty$\n" " { \"need key or journal for \" cite$ * \" to crossref \" * crossref *\n" " warning$\n" " \"\"\n" " }\n" -" { \"In \" journal * \"\" * }\n" +" { \"\" * journal * \"\" * }\n" " if$\n" " }\n" -" { \"In \" key * }\n" +" { key * }\n" " if$\n" -" \" \" * crossref * \"\" *\n" +" \" \\citelabel{\" * crossref * \"}\" *\n" "}\n" "\n" "FUNCTION {format.crossref.editor}\n" @@ -656,6 +590,7 @@ " \" of \" *\n" " }\n" " if$\n" +" \"\" *\n" " editor empty$\n" " editor field.or.null author field.or.null =\n" " or\n" @@ -665,7 +600,7 @@ " crossref * warning$\n" " \"\" *\n" " }\n" -" { \"\" * series * \"\" * }\n" +" { \"\" * series * \"\" * }\n" " if$\n" " }\n" " { key * }\n" @@ -673,11 +608,13 @@ " }\n" " { format.crossref.editor * }\n" " if$\n" -" \" \" * crossref * \"\" *\n" +" \" \\citelabel{\" * crossref * \"}\" *\n" "}\n" "\n" "FUNCTION {format.incoll.inproc.crossref}\n" -"{ editor empty$\n" +"{\n" +" \"In \" *\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 \" booktitle * \"\" * }\n" +" { \"\" * booktitle * \"\" * }\n" " if$\n" " }\n" -" { \"In \" key * }\n" +" { key * }\n" " if$\n" " }\n" -" { \"In \" format.crossref.editor * }\n" -" if$\n" -" \" \" * crossref * \"\" *\n" -"}\n" -"\n" -"% urlbst...\n" -"% Functions for making hypertext links.\n" -"FUNCTION {make.href}\n" -"{ \n" -" \"\" * swap$ * \"\" *\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 \"\" * url * \"\" * }\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" +" \" \\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 *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 *includedFiles) const; - bool includesByName(const QCString &name) const; + //bool includes(FileDef *incFile,QDict *includedFiles) const; + //bool includesByName(const QCString &name) const; MemberList *getMemberList(MemberList::ListType lt) const; const QList &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 &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 &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 << "
"; 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 << "
"; + m_t << heading << ":"; m_t << "
" << endl; m_t << " " << 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("\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," "," "); } - 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 // 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 = "
"; int l; for (l=0; l<256; l++) @@ -1332,7 +1262,6 @@ static void writeAlphabeticalClassList(OutputList &ol) (char)l + ""; } } - alphaLinks += "
\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("
\n"); + ol.writeString("
\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 QListtitle(),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 &includeStack); + private: + DefineDict m_defines; + QDict 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 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 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 m_fileMap; + DefineDict m_contextDefines; +}; + +DefineManager *DefineManager::theInstance = 0; + +void DefineManager::DefinesPerFile::collectDefines(DefineDict *dict,QDict &includeStack) +{ + //printf("DefinesPerFile::collectDefines\n"); + { + QDictIterator 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 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 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}"'")) . {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}"'")) } \\\n { g_yyLineNr++; outputChar('\n'); } {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); } {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 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 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 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 ); } +"<<<" { + if (!insidePHP) + { + REJECT; + } + else + { + BEGIN(HereDoc); + } + } "<<" { current->name+=yytext; // *currentTemplateSpec+=yytext; @@ -1901,6 +1914,20 @@ TYPEDEFPREFIX (("typedef"{BN}+)?)((("volatile"|"const"){BN}+)?) else REJECT; } +{ID} { // PHP heredoc + g_hereDocId = yytext; + BEGIN(HereDocEnd); + } +"'"{ID}/"'" { // PHP nowdoc + g_hereDocId = &yytext[1]; + } +^{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); + } + } +. { } "Q_OBJECT" { // Qt object macro } "Q_PROPERTY" { // Qt property declaration @@ -2387,7 +2414,7 @@ TYPEDEFPREFIX (("typedef"{BN}+)?)((("volatile"|"const"){BN}+)?) } } } -"//"([!/]?){B}*{CMD}"}".*|"/*"([!*]?){B}*{CMD}"}".*"*/" { +"//"([!/]?){B}*{CMD}"}".*|"/*"([!*]?){B}*{CMD}"}"[^*]*"*/" { closeGroup(current,yyFileName,yyLineNr); } "=" { // in PHP code this could also be due to ".*"\\\n" { // line continuation - yyLineNr++; + if (insideCS) + { + REJECT; + } + else + { + yyLineNr++; + } } .*/\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():""); 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 aliasesProcessed; -static QCString replaceAliasArgument(const QCString &aliasValue,int paramNum, - const QCString ¶mValue); +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 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 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 markerList; + markerList.setAutoDelete(TRUE); + l = aliasValue.length(); + int markerStart=0; + int markerEnd=0; + for (i=0;i0 && 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 ¶mValue) -{ - 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(); } diff --git a/tmake/lib/macosx-c++/tmake.conf b/tmake/lib/macosx-c++/tmake.conf index 01f036d..3c2cd24 100755 --- a/tmake/lib/macosx-c++/tmake.conf +++ b/tmake/lib/macosx-c++/tmake.conf @@ -17,7 +17,7 @@ TMAKE_CFLAGS_SHLIB = -fPIC TMAKE_CFLAGS_YACC = -Wno-unused -Wno-parentheses TMAKE_CXX = c++ -TMAKE_CXXFLAGS = $$TMAKE_CFLAGS -D__FreeBSD__=6 +TMAKE_CXXFLAGS = $$TMAKE_CFLAGS -D__FreeBSD__=6 -DYY_TYPEDEF_YY_SIZE_T -Dyy_size_t=int TMAKE_CXXFLAGS_WARN_ON = $$TMAKE_CFLAGS_WARN_ON TMAKE_CXXFLAGS_WARN_OFF = $$TMAKE_CFLAGS_WARN_OFF TMAKE_CXXFLAGS_RELEASE = $$TMAKE_CFLAGS_RELEASE diff --git a/tmake/lib/macosx-uni-c++/tmake.conf b/tmake/lib/macosx-uni-c++/tmake.conf index 2c34161..4f2f0c2 100644 --- a/tmake/lib/macosx-uni-c++/tmake.conf +++ b/tmake/lib/macosx-uni-c++/tmake.conf @@ -17,7 +17,7 @@ TMAKE_CFLAGS_SHLIB = -fPIC TMAKE_CFLAGS_YACC = -Wno-unused -Wno-parentheses TMAKE_CXX = c++ -TMAKE_CXXFLAGS = $$TMAKE_CFLAGS -D__FreeBSD__=6 -mmacosx-version-min=10.5 +TMAKE_CXXFLAGS = $$TMAKE_CFLAGS -D__FreeBSD__=6 -mmacosx-version-min=10.5 -DYY_TYPEDEF_YY_SIZE_T -Dyy_size_t=int TMAKE_CXXFLAGS_WARN_ON = $$TMAKE_CFLAGS_WARN_ON TMAKE_CXXFLAGS_WARN_OFF = $$TMAKE_CFLAGS_WARN_OFF TMAKE_CXXFLAGS_RELEASE = $$TMAKE_CFLAGS_RELEASE -- cgit v0.12