From 8626ab32d671ffcdc75dffce04dd05a671cfb42c Mon Sep 17 00:00:00 2001
From: Dimitri van Heesch
Date: Fri, 8 Aug 2003 12:54:22 +0000
Subject: Release-1.3.3-20030808
---
INSTALL | 4 +-
Makefile.in | 4 +-
Makefile.win_make.in | 3 +-
Makefile.win_nmake.in | 3 +-
README | 4 +-
VERSION | 2 +-
configure | 2 +-
doc/faq.doc | 2 +-
doc/language.doc | 269 +---------
doc/starting.doc | 2 +-
packages/rpm/doxygen.spec | 3 +-
src/Makefile.in | 10 +-
src/classdef.cpp | 6 +-
src/classlist.cpp | 4 +-
src/compound.xsd | 1 +
src/compound_xsd.h | 1 +
src/config.h | 22 +-
src/config.l | 245 ++++-----
src/docparser.cpp | 172 ++++++-
src/docparser.h | 24 +-
src/doxygen.cpp | 325 ++++++------
src/doxygen.h | 2 +
src/doxysearch.cpp | 1080 ---------------------------------------
src/doxysearch.pro.in | 20 -
src/doxytag.l | 116 ++---
src/doxytag.pro.in | 5 +-
src/entry.h | 6 +-
src/filedef.cpp | 221 +++++++-
src/filedef.h | 47 ++
src/ftvhelp.cpp | 121 ++---
src/ftvhelp.h | 41 +-
src/groupdef.cpp | 14 +-
src/htmldocvisitor.cpp | 43 +-
src/htmlgen.cpp | 398 ++++++++++++---
src/htmlgen.h | 11 +-
src/index.cpp | 504 +++++++++---------
src/index.h | 67 ++-
src/language.cpp | 6 +-
src/latexdocvisitor.cpp | 47 +-
src/latexgen.cpp | 4 +-
src/latexgen.h | 10 +-
src/libdoxygen.pro.in | 3 +-
src/libdoxygen.t | 3 +
src/mandocvisitor.cpp | 1 +
src/mangen.cpp | 3 +-
src/mangen.h | 10 +-
src/memberdef.cpp | 20 +-
src/memberlist.cpp | 7 +-
src/namespacedef.cpp | 6 +-
src/outputgen.h | 9 +-
src/outputlist.cpp | 11 +-
src/outputlist.h | 24 +-
src/packagedef.cpp | 126 -----
src/packagedef.h | 68 ---
src/perlmodgen.cpp | 21 +-
src/pre.l | 8 +-
src/rtfdocvisitor.cpp | 11 +-
src/rtfgen.cpp | 3 +-
src/rtfgen.h | 10 +-
src/scanner.l | 6 +-
src/search.php | 303 +++++++++++
src/search_php.h | 303 +++++++++++
src/searchindex.cpp | 257 ++++++++++
src/searchindex.h | 50 +-
src/suffixtree.cpp | 358 -------------
src/suffixtree.h | 89 ----
src/translator.h | 9 +
src/translator_adapter.h | 20 +-
src/translator_br.h | 2 +-
src/translator_cz.h | 2 +-
src/translator_en.h | 57 ++-
src/translator_fr.h | 2 +-
src/translator_it.h | 2 +-
src/translator_kr.h | 56 ++
src/translator_nl.h | 59 ++-
src/translator_pt.h | 2 +-
src/translator_se.h | 1022 +++++++++++++++++++++++++++++++-----
src/translator_sr.h | 2 +-
src/translator_tw.h | 2 +-
src/util.cpp | 64 ++-
src/util.h | 2 +-
src/xmldocvisitor.cpp | 7 +-
src/xmlgen.cpp | 32 +-
tmake/lib/macosx-c++/tmake.conf | 6 +-
wintools/Doxysearch.dsp | 97 ----
wintools/Doxysearch.dsw | 33 --
86 files changed, 3735 insertions(+), 3324 deletions(-)
delete mode 100644 src/doxysearch.cpp
delete mode 100644 src/doxysearch.pro.in
delete mode 100644 src/packagedef.cpp
delete mode 100644 src/packagedef.h
create mode 100644 src/search.php
create mode 100644 src/search_php.h
delete mode 100644 src/suffixtree.cpp
delete mode 100644 src/suffixtree.h
delete mode 100644 wintools/Doxysearch.dsp
delete mode 100644 wintools/Doxysearch.dsw
diff --git a/INSTALL b/INSTALL
index cbe7ad8..11e0f3d 100644
--- a/INSTALL
+++ b/INSTALL
@@ -1,7 +1,7 @@
-DOXYGEN Version 1.3.3
+DOXYGEN Version 1.3.3-20030808
Please read the installation section of the manual
(http://www.doxygen.org/install.html) for instructions.
--------
-Dimitri van Heesch (25 July 2003)
+Dimitri van Heesch (08 August 2003)
diff --git a/Makefile.in b/Makefile.in
index 27a404d..7c388f5 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -28,11 +28,10 @@ distclean: clean
-rm -f objects/*.o
-rm -f src/Makefile.doxygen src/Makefile.libdoxygen
-rm -f src/Makefile.doxytag src/Makefile.libdoxycfg
- -rm -f src/Makefile.doxysearch qtools/Makefile.qtools
-rm -f libpng/Makefile.libpng
-rm -f Makefile qtools/Makefile src/Makefile examples/Makefile doc/Makefile
-rm -f .makeconfig .tmakeconfig
- -rm -f src/doxygen.pro src/libdoxygen.pro src/doxytag.pro src/doxysearch.pro qtools/qtools.pro src/libdoxycfg.pro libpng/libpng.pro
+ -rm -f src/doxygen.pro src/libdoxygen.pro src/doxytag.pro qtools/qtools.pro src/libdoxycfg.pro libpng/libpng.pro
-rm -f src/version.cpp
-rm -r addon/doxywizard/Makefile
-rm -f addon/doxywizard/Makefile.doxywizard
@@ -46,7 +45,6 @@ install: doxywizard_install
$(INSTTOOL) -d $(INSTALL)/bin
$(INSTTOOL) -m 755 bin/doxygen $(INSTALL)/bin
$(INSTTOOL) -m 755 bin/doxytag $(INSTALL)/bin
- $(INSTTOOL) -m 755 bin/doxysearch $(INSTALL)/bin
install_docs: install
$(INSTTOOL) -d $(DOCDIR)
diff --git a/Makefile.win_make.in b/Makefile.win_make.in
index 81348d4..17c93a9 100644
--- a/Makefile.win_make.in
+++ b/Makefile.win_make.in
@@ -14,10 +14,9 @@ distclean: clean
-del src\Makefile.libdoxygen \
src\Makefile.doxygen \
src\Makefile.doxytag \
- src\Makefile.doxysearch \
src\Makefile.libdoxycfg
-del Makefile src\Makefile examples\Makefile doc\Makefile
- -del src\libdoxygen.pro src\doxygen.pro src\doxytag.pro src\doxysearch.pro src\libdoxycfg.pro
+ -del src\libdoxygen.pro src\doxygen.pro src\doxytag.pro src\libdoxycfg.pro
-del src\version.cpp
docs:
diff --git a/Makefile.win_nmake.in b/Makefile.win_nmake.in
index 9c035f8..4a2ff78 100644
--- a/Makefile.win_nmake.in
+++ b/Makefile.win_nmake.in
@@ -26,10 +26,9 @@ distclean: clean
-del src\Makefile.libdoxygen \
src\Makefile.doxygen \
src\Makefile.doxytag \
- src\Makefile.doxysearch \
src\Makefile.libdoxycfg
-del Makefile src\Makefile examples\Makefile doc\Makefile
- -del src\libdoxygen.pro src\doxygen.pro src\doxytag.pro src\doxysearch.pro src\libdoxycfg.pro
+ -del src\libdoxygen.pro src\doxygen.pro src\doxytag.pro src\libdoxycfg.pro
-del src\version.cpp
docs: FORCE
diff --git a/README b/README
index ac7a18c..e7ad550 100644
--- a/README
+++ b/README
@@ -1,4 +1,4 @@
-DOXYGEN Version 1.3.3
+DOXYGEN Version 1.3.3_20030808
Please read INSTALL for compilation instructions.
@@ -17,4 +17,4 @@ to subscribe to the lists or to visit the archives.
Enjoy,
-Dimitri van Heesch (dimitri@stack.nl) (25 July 2003)
+Dimitri van Heesch (dimitri@stack.nl) (08 August 2003)
diff --git a/VERSION b/VERSION
index 31e5c84..d8d942b 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-1.3.3
+1.3.3-20030808
diff --git a/configure b/configure
index d14a648..687066a 100755
--- a/configure
+++ b/configure
@@ -460,7 +460,7 @@ EOF
echo " Created $DST from $SRC..."
done
-f_inprofiles="qtools/qtools.pro.in src/libdoxygen.pro.in src/libdoxycfg.pro.in src/doxygen.pro.in src/doxytag.pro.in src/doxysearch.pro.in addon/doxywizard/doxywizard.pro.in addon/doxmlparser/src/doxmlparser.pro.in addon/doxmlparser/test/xmlparse.pro.in addon/doxmlparser/examples/metrics/metrics.pro.in libpng/libpng.pro.in"
+f_inprofiles="qtools/qtools.pro.in src/libdoxygen.pro.in src/libdoxycfg.pro.in src/doxygen.pro.in src/doxytag.pro.in addon/doxywizard/doxywizard.pro.in addon/doxmlparser/src/doxmlparser.pro.in addon/doxmlparser/test/xmlparse.pro.in addon/doxmlparser/examples/metrics/metrics.pro.in libpng/libpng.pro.in"
for i in $f_inprofiles ; do
SRC=$i
diff --git a/doc/faq.doc b/doc/faq.doc
index d9f3f6d..7bfa112 100644
--- a/doc/faq.doc
+++ b/doc/faq.doc
@@ -136,7 +136,7 @@ Unfortunately this only works if both compressed HTML files are in the same
directory.
As a result you must rename the generated \c index.chm files for all projects
-into something unique and put all \c .chm files in one directory.
+into something unique and put all .chm
files in one directory.
Suppose you have a project \e a referring to a project \e b using tag file
\c b.tag, then you could rename the \c index.chm for project \e a into
diff --git a/doc/language.doc b/doc/language.doc
index d3c9db1..97f481a 100644
--- a/doc/language.doc
+++ b/doc/language.doc
@@ -1,8 +1,6 @@
/******************************************************************************
- * Warning: this file was generated from the language.tpl template
- * and the maintainers.txt files by the translator.pl script.
- *
- * Do not edit this file. Edit the above mentioned files!
+ * This is the template for generating language.doc.
+ * Edit manually this file, not the language.doc!
*
*
* Copyright (C) 1997-2002 by Dimitri van Heesch.
@@ -25,7 +23,7 @@ Doxygen has built-in support for multiple languages. This means
that the text fragments that doxygen generates can be produced in
languages other than English (the default) at configuration time.
-Currently (version 1.3.2-20030717), 28 languages
+Currently (version unknown), 28 languages
are supported (sorted alphabetically):
Brazilian Portuguese, Catalan, Chinese, Chinese Traditional, Croatian,
Czech, Danish, Dutch, English, Finnish,
@@ -39,261 +37,7 @@ It is sorted by language alphabetically. The Status column
was generated from sources and shows approximately the last version
when the translator was updated.
-\htmlonly
-
-
-
-
-
- Language |
- Maintainer |
- Contact address
- (remove the NOSPAM.) |
- Status |
-
-
- Brazilian Portuguese |
- Fabio "FJTC" Jun Takada Chino |
- chino@NOSPAM.icmc.sc.usp.br |
- up-to-date |
-
-
- Catalan |
- Albert Mora |
- amora@NOSPAM.iua.upf.es |
- 1.2.17 |
-
-
- Chinese |
- Wei Liu Wang Weihan |
- liuwei@NOSPAM.asiainfo.com wangweihan@NOSPAM.capinfo.com.cn |
- 1.2.13 |
-
-
- Chinese Traditional |
- Daniel YC Lin Gary Lee |
- daniel@NOSPAM.twpda.com garylee@NOSPAM.ecosine.com.tw |
- up-to-date |
-
-
- Croatian |
- Boris Bralo |
- boris.bralo@NOSPAM.zg.tel.hr |
- 1.3.1 |
-
-
- Czech |
- Petr Přikryl |
- prikrylp@NOSPAM.skil.cz |
- up-to-date |
-
-
- Danish |
- Erik Søe Sørensen |
- erik@NOSPAM.mail.nu |
- strange |
-
-
- Dutch |
- Dimitri van Heesch |
- dimitri@NOSPAM.stack.nl |
- up-to-date |
-
-
- English |
- Dimitri van Heesch |
- dimitri@NOSPAM.stack.nl |
- up-to-date |
-
-
- Finnish |
- Olli Korhonen |
- Olli.Korhonen@NOSPAM.ccc.fi |
- obsolete |
-
-
- French |
- Xavier Outhier |
- xouthier@NOSPAM.yahoo.fr |
- up-to-date |
-
-
- German |
- Jens Seidel |
- jensseidel@NOSPAM.users.sf.net |
- 1.3.1 |
-
-
- Greek |
- Harry Kalogirou |
- harkal@NOSPAM.rainbow.cs.unipi.gr |
- 1.2.11 |
-
-
- Hungarian |
- Földvári György |
- foldvari@NOSPAM.diatronltd.com |
- 1.2.1 |
-
-
- Italian |
- Alessandro Falappa Ahmed Aldo Faisal |
- alessandro@NOSPAM.falappa.net aaf23@NOSPAM.cam.ac.uk |
- up-to-date |
-
-
- Japanese |
- Ryunosuke Satoh Kenji Nagamatsu |
- sun594@NOSPAM.hotmail.com naga@NOSPAM.joyful.club.ne.jp |
- obsolete |
-
-
- Korean |
- Richard Kim |
- ryk@NOSPAM.dspwiz.com |
- strange |
-
-
- Norwegian |
- Lars Erik Jordet |
- lej@NOSPAM.circuitry.no |
- 1.2.2 |
-
-
- Polish |
- Piotr Kaminski Grzegorz Kowal |
- Piotr.Kaminski@NOSPAM.ctm.gdynia.pl g_kowal@NOSPAM.poczta.onet.pl |
- strange |
-
-
- Portuguese |
- Rui Godinho Lopes |
- ruiglopes@NOSPAM.yahoo.com |
- up-to-date |
-
-
- Romanian |
- Alexandru Iosup |
- aiosup@NOSPAM.yahoo.com |
- 1.2.16 |
-
-
- Russian |
- Alexandr Chelpanov |
- cav@NOSPAM.cryptopro.ru |
- strange |
-
-
- Serbian |
- Dejan Milosavljevic |
- dmilos@NOSPAM.email.com |
- up-to-date |
-
-
- Slovak |
- Stanislav Kudláč |
- skudlac@NOSPAM.pobox.sk |
- 1.2.18 |
-
-
- Slovene |
- Matjaz Ostroversnik |
- matjaz.ostroversnik@NOSPAM.zrs-tk.si |
- 1.2.16 |
-
-
- Spanish |
- Francisco Oltra Thennet |
- foltra@NOSPAM.puc.cl |
- 1.2.7 |
-
-
- Swedish |
- XeT Erixon |
- xet@NOSPAM.hem.passagen.se |
- obsolete |
-
-
- Ukrainian |
- Olexij Tkatchenko |
- olexij.tkatchenko@NOSPAM.gmx.de |
- 1.2.11 |
-
-
- |
-
-
-\endhtmlonly
-\latexonly
-\begin{tabular}{|l|l|l|l|}
- \hline
- {\bf Language} & {\bf Maintainer} & {\bf Contact address} & {\bf Status} \\
- \hline
- \hline
- Brazilian Portuguese & Fabio "FJTC" Jun Takada Chino & {\tt chino@icmc.sc.usp.br} & up-to-date \\
- \hline
- Catalan & Albert Mora & {\tt amora@iua.upf.es} & 1.2.17 \\
- \hline
- Chinese & Wei Liu & {\tt liuwei@asiainfo.com} & 1.2.13 \\
- & Wang Weihan & {\tt wangweihan@capinfo.com.cn} & \\
- \hline
- Chinese Traditional & Daniel YC Lin & {\tt daniel@twpda.com} & up-to-date \\
- & Gary Lee & {\tt garylee@ecosine.com.tw} & \\
- \hline
- Croatian & Boris Bralo & {\tt boris.bralo@zg.tel.hr} & 1.3.1 \\
- \hline
- Czech & Petr P\v{r}ikryl & {\tt prikrylp@skil.cz} & up-to-date \\
- \hline
- Danish & Erik S\o{}e S\o{}rensen & {\tt erik@mail.nu} & strange \\
- \hline
- Dutch & Dimitri van Heesch & {\tt dimitri@stack.nl} & up-to-date \\
- \hline
- English & Dimitri van Heesch & {\tt dimitri@stack.nl} & up-to-date \\
- \hline
- Finnish & Olli Korhonen & {\tt Olli.Korhonen@ccc.fi} & obsolete \\
- \hline
- French & Xavier Outhier & {\tt xouthier@yahoo.fr} & up-to-date \\
- \hline
- German & Jens Seidel & {\tt jensseidel@users.sf.net} & 1.3.1 \\
- \hline
- Greek & Harry Kalogirou & {\tt harkal@rainbow.cs.unipi.gr} & 1.2.11 \\
- \hline
- Hungarian & F\"{o}ldv\'{a}ri Gy\"{o}rgy & {\tt foldvari@diatronltd.com} & 1.2.1 \\
- \hline
- Italian & Alessandro Falappa & {\tt alessandro@falappa.net} & up-to-date \\
- & Ahmed Aldo Faisal & {\tt aaf23@cam.ac.uk} & \\
- \hline
- Japanese & Ryunosuke Satoh & {\tt sun594@hotmail.com} & obsolete \\
- & Kenji Nagamatsu & {\tt naga@joyful.club.ne.jp} & \\
- \hline
- Korean & Richard Kim & {\tt ryk@dspwiz.com} & strange \\
- \hline
- Norwegian & Lars Erik Jordet & {\tt lej@circuitry.no} & 1.2.2 \\
- \hline
- Polish & Piotr Kaminski & {\tt Piotr.Kaminski@ctm.gdynia.pl} & strange \\
- & Grzegorz Kowal & {\tt g\_kowal@poczta.onet.pl} & \\
- \hline
- Portuguese & Rui Godinho Lopes & {\tt ruiglopes@yahoo.com} & up-to-date \\
- \hline
- Romanian & Alexandru Iosup & {\tt aiosup@yahoo.com} & 1.2.16 \\
- \hline
- Russian & Alexandr Chelpanov & {\tt cav@cryptopro.ru} & strange \\
- \hline
- Serbian & Dejan Milosavljevic & {\tt dmilos@email.com} & up-to-date \\
- \hline
- Slovak & Stanislav Kudl\'{a}\v{c} & {\tt skudlac@pobox.sk} & 1.2.18 \\
- \hline
- Slovene & Matjaz Ostroversnik & {\tt matjaz.ostroversnik@zrs-tk.si} & 1.2.16 \\
- \hline
- Spanish & Francisco Oltra Thennet & {\tt foltra@puc.cl} & 1.2.7 \\
- \hline
- Swedish & XeT Erixon & {\tt xet@hem.passagen.se} & obsolete \\
- \hline
- Ukrainian & Olexij Tkatchenko & {\tt olexij.tkatchenko@gmx.de} & 1.2.11 \\
- \hline
-\end{tabular}
-\endlatexonly
-
+$information_table
Most people on the list have indicated that they were also busy
doing other things, so if you want to help to speed things up please
@@ -514,10 +258,9 @@ script was developed (located in \c doxygen/doc directory).
It extracts the important information about obsolete and
new methods from the source files for each of the languages.
The information is stored in the translator report ASCII file
-(doxygen/doc/translator_report.txt
). \htmlonly If you compiled this documentation
+($translator_report_file_name). \htmlonly If you compiled this documentation
from sources and if you have also doxygen sources available the
-link
- doxygen/doc/translator_report.txt
should be valid.\endhtmlonly
+link $translator_report_link should be valid.\endhtmlonly
Looking at the base class of the language translator, the script
guesses also the status of the translator -- see the last column of
diff --git a/doc/starting.doc b/doc/starting.doc
index 0d05378..e2335e3 100644
--- a/doc/starting.doc
+++ b/doc/starting.doc
@@ -29,7 +29,7 @@ information.
The executable \c doxysearch is only needed if you want to use the search
engine. See section \ref doxysearch_usage for more detailed usage information.
-Optionally, the executable \c doxywizard is a GUI front-end for editing
+Optionally, the executable \c doxywizard is a graphical front-end for editing
the configuration files that are used by doxygen.
The following figure shows the relation between the tools and the flow
diff --git a/packages/rpm/doxygen.spec b/packages/rpm/doxygen.spec
index 21bbd3f..034ba89 100644
--- a/packages/rpm/doxygen.spec
+++ b/packages/rpm/doxygen.spec
@@ -1,6 +1,6 @@
Summary: A documentation system for C/C++.
Name: doxygen
-Version: 1.3.3
+Version: 1.3.3_20030808
Release: 1
Epoch: 1
Source0: ftp://ftp.stack.nl/pub/users/dimitri/%{name}-%{version}.src.tar.gz
@@ -56,7 +56,6 @@ rm -rf ${RPM_BUILD_ROOT}
%defattr(-,root,root)
%doc LANGUAGE.HOWTO README examples html
%{_bindir}/doxygen
-%{_bindir}/doxysearch
%{_bindir}/doxytag
%files doxywizard
diff --git a/src/Makefile.in b/src/Makefile.in
index 226d891..1d57871 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -14,12 +14,11 @@
# input used in their production; they are not affected by this license.
#
-all: Makefile.libdoxygen Makefile.libdoxycfg Makefile.doxygen Makefile.doxytag Makefile.doxysearch Makefile
+all: Makefile.libdoxygen Makefile.libdoxycfg Makefile.doxygen Makefile.doxytag Makefile
$(MAKE) -f Makefile.libdoxycfg PERL=$(PERL) $@
$(MAKE) -f Makefile.libdoxygen PERL=$(PERL) $@
$(MAKE) -f Makefile.doxygen PERL=$(PERL) $@
$(MAKE) -f Makefile.doxytag PERL=$(PERL) $@
- $(MAKE) -f Makefile.doxysearch PERL=$(PERL) $@
Makefile.libdoxygen: libdoxygen.pro libdoxygen.t
$(ENV) $(PERL) $(TMAKE) libdoxygen.pro >Makefile.libdoxygen
@@ -33,22 +32,17 @@ Makefile.doxygen: doxygen.pro
Makefile.doxytag: doxytag.pro doxytag.t
$(ENV) $(PERL) $(TMAKE) doxytag.pro >Makefile.doxytag
-Makefile.doxysearch: doxysearch.pro
- $(ENV) $(PERL) $(TMAKE) doxysearch.pro >Makefile.doxysearch
-
tmake:
$(ENV) $(PERL) $(TMAKE) libdoxygen.pro >Makefile.libdoxygen
$(ENV) $(PERL) $(TMAKE) libdoxycfg.pro >Makefile.libdoxycfg
$(ENV) $(PERL) $(TMAKE) doxygen.pro >Makefile.doxygen
$(ENV) $(PERL) $(TMAKE) doxytag.pro >Makefile.doxytag
- $(ENV) $(PERL) $(TMAKE) doxysearch.pro >Makefile.doxysearch
-clean: Makefile.libdoxygen Makefile.doxygen Makefile.doxytag Makefile.doxysearch
+clean: Makefile.libdoxygen Makefile.doxygen Makefile.doxytag
$(MAKE) -f Makefile.libdoxygen clean
$(MAKE) -f Makefile.libdoxycfg clean
$(MAKE) -f Makefile.doxygen clean
$(MAKE) -f Makefile.doxytag clean
- $(MAKE) -f Makefile.doxysearch clean
distclean: clean
-$(RM) scanner.cpp code.cpp config.cpp pre.cpp ce_lex.cpp \
diff --git a/src/classdef.cpp b/src/classdef.cpp
index d6f5352..e20e9d6 100644
--- a/src/classdef.cpp
+++ b/src/classdef.cpp
@@ -791,7 +791,7 @@ void ClassDef::writeDetailedDescription(OutputList &ol, const QCString &pageType
// repeat brief description
if (!briefDescription().isEmpty() && Config_getBool("REPEAT_BRIEF"))
{
- ol.parseDoc(briefFile(),briefLine(),name(),0,briefDescription(),FALSE);
+ ol.parseDoc(briefFile(),briefLine(),this,0,briefDescription(),FALSE,FALSE);
}
if (!briefDescription().isEmpty() && Config_getBool("REPEAT_BRIEF") &&
!documentation().isEmpty())
@@ -811,7 +811,7 @@ void ClassDef::writeDetailedDescription(OutputList &ol, const QCString &pageType
ol.disableAllBut(OutputGenerator::RTF);
ol.newParagraph();
ol.popGeneratorState();
- ol.parseDoc(docFile(),docLine(),name(),0,documentation()+"\n",FALSE);
+ ol.parseDoc(docFile(),docLine(),this,0,documentation()+"\n",TRUE,FALSE);
}
// write examples
if (exampleFlag)
@@ -860,7 +860,7 @@ void ClassDef::writeDocumentation(OutputList &ol)
{
if (!Config_getBool("DETAILS_AT_TOP"))
{
- ol.parseDoc(briefFile(),briefLine(),name(),0,briefDescription(),FALSE);
+ ol.parseDoc(briefFile(),briefLine(),this,0,briefDescription(),TRUE,FALSE);
ol.writeString(" \n");
ol.pushGeneratorState();
ol.disableAllBut(OutputGenerator::Html);
diff --git a/src/classlist.cpp b/src/classlist.cpp
index c370196..60ac20c 100644
--- a/src/classlist.cpp
+++ b/src/classlist.cpp
@@ -117,8 +117,8 @@ void ClassSDict::writeDeclaration(OutputList &ol,const ClassDef::CompoundType *f
if (!cd->briefDescription().isEmpty())
{
ol.startMemberDescription();
- ol.parseDoc(cd->briefFile(),cd->briefLine(),cd->name(),0,
- cd->briefDescription(),FALSE);
+ ol.parseDoc(cd->briefFile(),cd->briefLine(),cd,0,
+ cd->briefDescription(),FALSE,FALSE);
if ((!cd->briefDescription().isEmpty() && Config_getBool("REPEAT_BRIEF")) ||
!cd->documentation().isEmpty())
{
diff --git a/src/compound.xsd b/src/compound.xsd
index 9fb394a..5844f07 100644
--- a/src/compound.xsd
+++ b/src/compound.xsd
@@ -323,6 +323,7 @@
+
diff --git a/src/compound_xsd.h b/src/compound_xsd.h
index ca866bb..d84816b 100644
--- a/src/compound_xsd.h
+++ b/src/compound_xsd.h
@@ -323,6 +323,7 @@
" \n"
" \n"
" \n"
+" \n"
" \n"
" \n"
" \n"
diff --git a/src/config.h b/src/config.h
index 5869add..5bd4209 100644
--- a/src/config.h
+++ b/src/config.h
@@ -25,7 +25,8 @@ class ConfigOption
O_Enum, //getString(__FILE__,__LINE__,val)
#define Config_getInt(val) Config::instance()->getInt(__FILE__,__LINE__,val)
@@ -479,6 +492,13 @@ class Config
m_dict->insert(name,result);
return result;
}
+ /*! Adds an option that has become obsolete. */
+ ConfigOption *addObsolete(const char *name)
+ {
+ ConfigObsolete *option = new ConfigObsolete(ConfigOption::O_Obsolete);
+ m_dict->insert(name,option);
+ return option;
+ }
/*! @} */
/*! Writes a template configuration file to \a f. If \a shortIndex
diff --git a/src/config.l b/src/config.l
index 87b98a0..a22e4de 100644
--- a/src/config.l
+++ b/src/config.l
@@ -469,6 +469,12 @@ static void readIncludeFile(const char *incName)
s->resize(0);
BEGIN(GetString);
break;
+ case ConfigOption::O_Obsolete:
+ config_err("Warning: Tag `%s' at line %d of file %s has become obsolete.\n"
+ "To avoid this warning please update your configuration "
+ "file using \"doxygen -u\"\n", cmd.data(),yyLineNr,yyFileName.data());
+ BEGIN(SkipInvalid);
+ break;
}
}
}
@@ -502,6 +508,12 @@ static void readIncludeFile(const char *incName)
yytext,yyLineNr,yyFileName.data());
BEGIN(SkipInvalid);
break;
+ case ConfigOption::O_Obsolete:
+ config_err("Warning: Tag `%s' at line %d of file %s has become obsolete.\n"
+ "To avoid this warning please update your configuration "
+ "file using \"doxygen -u\"\n", cmd.data(),yyLineNr,yyFileName.data());
+ BEGIN(SkipInvalid);
+ break;
}
}
}
@@ -1077,6 +1089,9 @@ void Config::check()
filePatternList.append("*.idl");
filePatternList.append("*.odl");
filePatternList.append("*.cs");
+ filePatternList.append("*.php");
+ filePatternList.append("*.php3");
+ filePatternList.append("*.inc");
}
// add default pattern if needed
@@ -1094,102 +1109,102 @@ void Config::check()
//}
// more checks needed if and only if the search engine is enabled.
- if (Config_getBool("SEARCHENGINE"))
+// if (Config_getBool("SEARCHENGINE"))
+// {
+// // check cgi name
+// QCString &cgiName = Config_getString("CGI_NAME");
+// if (cgiName.isEmpty())
+// {
+// config_err("Error: tag CGI_NAME: no cgi script name after the CGI_NAME tag.\n");
+// exit(1);
+// }
+// // check cgi URL
+// QCString &cgiURL = Config_getString("CGI_URL");
+// if (cgiURL.isEmpty())
+// {
+// config_err("Error: tag CGI_URL: no URL to cgi directory specified.\n");
+// exit(1);
+// }
+// else if (cgiURL.left(7)!="http://" &&
+// cgiURL.left(8)!="https://" &&
+// cgiURL.left(4)!="cgi:"
+// )
+// {
+// config_err("Error: tag CGI_URL: URL to cgi directory is invalid (must "
+// "start with http:// or https://).\n");
+// exit(1);
+// }
+// // check documentation URL
+// QCString &docURL = Config_getString("DOC_URL");
+// if (docURL.isEmpty())
+// {
+// docURL = Config_getString("OUTPUT_DIRECTORY").copy().prepend("file://").append("html");
+// }
+// else if (docURL.left(7)!="http://" &&
+// docURL.left(8)!="https://" &&
+// docURL.left(7)!="file://"
+// )
+// {
+// config_err("Error: tag DOC_URL: URL to documentation is invalid or "
+// "not absolute.\n");
+// exit(1);
+// }
+// // check absolute documentation path
+// QCString &docAbsPath = Config_getString("DOC_ABSPATH");
+// if (docAbsPath.isEmpty())
+// {
+// docAbsPath = Config_getString("OUTPUT_DIRECTORY")+"/html";
+// }
+// else if (docAbsPath[0]!='/' && docAbsPath[1]!=':')
+// {
+// config_err("Error: tag DOC_ABSPATH: path is not absolute!\n");
+// exit(1);
+// }
+// // check path to doxysearch
+// QCString &binAbsPath = Config_getString("BIN_ABSPATH");
+// if (binAbsPath.isEmpty())
+// {
+// config_err("Error: tag BIN_ABSPATH: no absolute path to doxysearch "
+// "specified.\n");
+// exit(1);
+// }
+// else if (binAbsPath[0]!='/' && binAbsPath[1]!=':')
+// {
+// config_err("Error: tag BIN_ABSPATH: path is not absolute!\n");
+// exit(1);
+// }
+//
+// }
+ // check perl path
+ bool found=FALSE;
+ QCString &perlPath = Config_getString("PERL_PATH");
+ if (perlPath.isEmpty())
{
- // check cgi name
- QCString &cgiName = Config_getString("CGI_NAME");
- if (cgiName.isEmpty())
- {
- config_err("Error: tag CGI_NAME: no cgi script name after the CGI_NAME tag.\n");
- exit(1);
- }
- // check cgi URL
- QCString &cgiURL = Config_getString("CGI_URL");
- if (cgiURL.isEmpty())
- {
- config_err("Error: tag CGI_URL: no URL to cgi directory specified.\n");
- exit(1);
- }
- else if (cgiURL.left(7)!="http://" &&
- cgiURL.left(8)!="https://" &&
- cgiURL.left(4)!="cgi:"
- )
- {
- config_err("Error: tag CGI_URL: URL to cgi directory is invalid (must "
- "start with http:// or https://).\n");
- exit(1);
- }
- // check documentation URL
- QCString &docURL = Config_getString("DOC_URL");
- if (docURL.isEmpty())
- {
- docURL = Config_getString("OUTPUT_DIRECTORY").copy().prepend("file://").append("html");
- }
- else if (docURL.left(7)!="http://" &&
- docURL.left(8)!="https://" &&
- docURL.left(7)!="file://"
- )
- {
- config_err("Error: tag DOC_URL: URL to documentation is invalid or "
- "not absolute.\n");
- exit(1);
- }
- // check absolute documentation path
- QCString &docAbsPath = Config_getString("DOC_ABSPATH");
- if (docAbsPath.isEmpty())
- {
- docAbsPath = Config_getString("OUTPUT_DIRECTORY")+"/html";
- }
- else if (docAbsPath[0]!='/' && docAbsPath[1]!=':')
- {
- config_err("Error: tag DOC_ABSPATH: path is not absolute!\n");
- exit(1);
- }
- // check path to doxysearch
- QCString &binAbsPath = Config_getString("BIN_ABSPATH");
- if (binAbsPath.isEmpty())
- {
- config_err("Error: tag BIN_ABSPATH: no absolute path to doxysearch "
- "specified.\n");
- exit(1);
- }
- else if (binAbsPath[0]!='/' && binAbsPath[1]!=':')
+ QFileInfo fi;
+ fi.setFile("/usr/bin/perl");
+ if (fi.exists())
{
- config_err("Error: tag BIN_ABSPATH: path is not absolute!\n");
- exit(1);
+ perlPath="/usr/bin/perl";
+ found=TRUE;
}
-
- // check perl path
- bool found=FALSE;
- QCString &perlPath = Config_getString("PERL_PATH");
- if (perlPath.isEmpty())
+ else
{
- QFileInfo fi;
- fi.setFile("/usr/bin/perl");
- if (fi.exists())
+ fi.setFile("/usr/local/bin/perl");
+ if (fi.exists())
{
- perlPath="/usr/bin/perl";
- found=TRUE;
- }
- else
- {
- fi.setFile("/usr/local/bin/perl");
- if (fi.exists())
- {
- perlPath="/usr/local/bin/perl";
- found=TRUE;
- }
+ perlPath="/usr/local/bin/perl";
+ found=TRUE;
}
}
- if (!found)
+ }
+ if (!found)
+ {
+ QFileInfo fi(perlPath);
+ if (!fi.exists())
{
- QFileInfo fi(perlPath);
- if (!fi.exists())
- {
- config_warn("Warning: tag PERL_PATH: perl interpreter not found at default or"
- "user specified (%s) location\n",
- perlPath.data());
- }
+ config_warn("Warning: tag PERL_PATH: perl interpreter not found at default or"
+ "user specified (%s) location\n",
+ perlPath.data());
}
}
@@ -1742,7 +1757,7 @@ void Config::create()
"and *.h) to filter out the source-files in the directories. If left \n"
"blank the following patterns are tested: \n"
"*.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx *.hpp \n"
- "*.h++ *.idl *.odl *.cs\n"
+ "*.h++ *.idl *.odl *.cs *.php *.php3 *.inc\n"
);
cb = addBool(
"RECURSIVE",
@@ -2611,52 +2626,12 @@ void Config::create()
"used. If set to NO the values of all tags below this one will be ignored. \n",
FALSE
);
- cs = addString(
- "CGI_NAME",
- "The CGI_NAME tag should be the name of the CGI script that \n"
- "starts the search engine (doxysearch) with the correct parameters. \n"
- "A script with this name will be generated by doxygen. \n"
- );
- cs->setDefaultValue("search.cgi");
- cs->addDependency("SEARCHENGINE");
- cs = addString(
- "CGI_URL",
- "The CGI_URL tag should be the absolute URL to the directory where the \n"
- "cgi binaries are located. See the documentation of your http daemon for \n"
- "details. \n"
- );
- cs->addDependency("SEARCHENGINE");
- cs = addString(
- "DOC_URL",
- "The DOC_URL tag should be the absolute URL to the directory where the \n"
- "documentation is located. If left blank the absolute path to the \n"
- "documentation, with file:// prepended to it, will be used. \n"
- );
- cs->addDependency("SEARCHENGINE");
- cs = addString(
- "DOC_ABSPATH",
- "The DOC_ABSPATH tag should be the absolute path to the directory where the \n"
- "documentation is located. If left blank the directory on the local machine \n"
- "will be used. \n"
- );
- cs->setWidgetType(ConfigString::Dir);
- cs->addDependency("SEARCHENGINE");
- cs = addString(
- "BIN_ABSPATH",
- "The BIN_ABSPATH tag must point to the directory where the doxysearch binary \n"
- "is installed. \n"
- );
- cs->setDefaultValue("/usr/local/bin/");
- cs->setWidgetType(ConfigString::Dir);
- cs->addDependency("SEARCHENGINE");
- cl = addList(
- "EXT_DOC_PATHS",
- "The EXT_DOC_PATHS tag can be used to specify one or more paths to \n"
- "documentation generated for other projects. This allows doxysearch to search \n"
- "the documentation for these projects as well. \n"
- );
- cl->setWidgetType(ConfigList::Dir);
- cl->addDependency("SEARCHENGINE");
+ addObsolete("CGI_NAME");
+ addObsolete("CGI_URL");
+ addObsolete("DOC_URL");
+ addObsolete("DOC_ABSPATH");
+ addObsolete("BIN_ABSPATH");
+ addObsolete("EXT_DOC_PATHS");
// The IMAGE_PATTERNS tag is now officially obsolete.
}
diff --git a/src/docparser.cpp b/src/docparser.cpp
index 1b584b3..4cbb0a7 100644
--- a/src/docparser.cpp
+++ b/src/docparser.cpp
@@ -38,6 +38,8 @@
#include "printdocvisitor.h"
#include "message.h"
#include "section.h"
+#include "searchindex.h"
+#include "language.h"
#define DBG(x) do {} while(0)
//#define DBG(x) printf x
@@ -66,6 +68,8 @@ static bool g_isExample;
static QCString g_exampleName;
static SectionDict *g_sectionDict;
+static QCString g_searchUrl;
+
// include file state
static QString g_includeFileText;
static uint g_includeFileOffset;
@@ -691,7 +695,7 @@ static void handleLinkedWord(DocNode *parent,QList &children)
{
Definition *compound=0;
MemberDef *member=0;
- QString name = linkToText(g_token->name);
+ QString name = linkToText(g_token->name,TRUE);
if (resolveRef(g_context,g_token->name,g_inSeeBlock,&compound,&member))
{
if (member) // member link
@@ -1088,6 +1092,11 @@ DocSymbol::SymType DocSymbol::decodeSymbol(const QString &symName,char *letter)
*letter=symName.at(1);
return DocSymbol::Ring;
}
+ else if (l==8 && symName.right(6)=="slash;")
+ {
+ *letter=symName.at(1);
+ return DocSymbol::Slash;
+ }
return DocSymbol::Unknown;
}
@@ -1103,7 +1112,7 @@ static int internalValidatingParseDoc(DocNode *parent,QList &children,
doctokenizerYYinit(doc,g_fileName);
// first parse any number of paragraphs
- bool isFirst=FALSE;
+ bool isFirst=TRUE;
DocPara *lastPar=0;
do
{
@@ -1151,6 +1160,33 @@ static void readTextFileByName(const QString &file,QString &text)
//---------------------------------------------------------------------------
+DocWord::DocWord(DocNode *parent,const QString &word) :
+ m_parent(parent), m_word(word)
+{
+ //printf("new word %s url=%s\n",word.data(),g_searchUrl.data());
+ if (!g_searchUrl.isEmpty())
+ {
+ Doxygen::searchIndex->addWord(word.lower());
+ }
+}
+
+//---------------------------------------------------------------------------
+
+DocLinkedWord::DocLinkedWord(DocNode *parent,const QString &word,
+ const QString &ref,const QString &file,
+ const QString &anchor) :
+ m_parent(parent), m_word(word), m_ref(ref),
+ m_file(file), m_anchor(anchor)
+{
+ //printf("new word %s url=%s\n",word.data(),g_searchUrl.data());
+ if (!g_searchUrl.isEmpty())
+ {
+ Doxygen::searchIndex->addWord(word.lower());
+ }
+}
+
+//---------------------------------------------------------------------------
+
DocAnchor::DocAnchor(DocNode *parent,const QString &id,bool newAnchor)
: m_parent(parent)
{
@@ -1636,7 +1672,6 @@ DocRef::DocRef(DocNode *parent,const QString &target) :
m_parent(parent), m_refToSection(FALSE), m_refToAnchor(FALSE)
{
Definition *compound = 0;
- //PageInfo *pageInfo = 0;
QCString anchor;
ASSERT(!target.isEmpty());
SectionInfo *sec = Doxygen::sectionDict[target];
@@ -1653,14 +1688,11 @@ DocRef::DocRef(DocNode *parent,const QString &target) :
}
else if (resolveLink(g_context,target,TRUE,&compound,/*&pageInfo,*/anchor))
{
- m_text = linkToText(target);
+ bool isFile = compound ?
+ (compound->definitionType()==Definition::TypeFile ? TRUE : FALSE) :
+ FALSE;
+ m_text = linkToText(target,isFile);
m_anchor = anchor;
- //if (pageInfo) // ref to page
- //{
- // m_file = pageInfo->getOutputFileBase();
- // m_ref = pageInfo->getReference();
- //}
- //else
if (compound) // ref to compound
{
if (anchor.isEmpty() && /* compound link */
@@ -1681,6 +1713,7 @@ DocRef::DocRef(DocNode *parent,const QString &target) :
}
else // oops, bogus target
{
+ m_text = linkToText(target,FALSE);
warn_doc_error(g_fileName,doctokenizerYYlineno,"Warning: unable to resolve reference to `%s' for \\ref command",
target.data());
}
@@ -2150,7 +2183,7 @@ int DocInternal::parse(int level)
DBG(("DocInternal::parse() start\n"));
// first parse any number of paragraphs
- bool isFirst=FALSE;
+ bool isFirst=TRUE;
DocPara *lastPar=0;
do
{
@@ -2347,7 +2380,7 @@ int DocHtmlCell::parse()
DBG(("DocHtmlCell::parse() start\n"));
// parse one or more paragraphs
- bool isFirst=FALSE;
+ bool isFirst=TRUE;
DocPara *par=0;
do
{
@@ -2680,7 +2713,7 @@ int DocHtmlDescData::parse()
g_nodeStack.push(this);
DBG(("DocHtmlDescData::parse() start\n"));
- bool isFirst=FALSE;
+ bool isFirst=TRUE;
DocPara *par=0;
do
{
@@ -2778,7 +2811,7 @@ int DocHtmlListItem::parse()
g_nodeStack.push(this);
// parse one or more paragraphs
- bool isFirst=FALSE;
+ bool isFirst=TRUE;
DocPara *par=0;
do
{
@@ -4444,7 +4477,7 @@ int DocSection::parse()
}
// first parse any number of paragraphs
- bool isFirst=FALSE;
+ bool isFirst=TRUE;
DocPara *lastPar=0;
do
{
@@ -4634,7 +4667,7 @@ void DocRoot::parse()
int retval=0;
// first parse any number of paragraphs
- bool isFirst=FALSE;
+ bool isFirst=TRUE;
DocPara *lastPar=0;
do
{
@@ -4703,16 +4736,103 @@ void DocRoot::parse()
//--------------------------------------------------------------------------
DocNode *validatingParseDoc(const char *fileName,int startLine,
- const char *context,MemberDef *md,
- const char *input,bool isExample,
- const char *exampleName)
+ Definition *ctx,MemberDef *md,
+ const char *input,bool indexWords,
+ bool isExample, const char *exampleName)
{
+ //printf("validatingParseDoc(%s,%s)\n",ctx?ctx->name().data():"",
+ // md?md->name().data():"");
//printf("========== validating %s at line %d\n",fileName,startLine);
//printf("---------------- input --------------------\n%s\n----------- end input -------------------\n",input);
g_token = new TokenInfo;
- g_context = context;
+ if (ctx &&
+ (ctx->definitionType()==Definition::TypeClass ||
+ ctx->definitionType()==Definition::TypeNamespace
+ )
+ )
+ {
+ g_context = ctx->name();
+ }
+ else
+ {
+ g_context = "";
+ }
+
+ if (indexWords && md && Config_getBool("SEARCHENGINE"))
+ {
+ g_searchUrl=md->getOutputFileBase()+
+ Config_getString("HTML_FILE_EXTENSION")+"#"+md->anchor();
+ Doxygen::searchIndex->setCurrentDoc(
+ theTranslator->trMember(TRUE,TRUE)+" "+md->qualifiedName(),
+ g_searchUrl);
+ }
+ else if (indexWords && ctx && Config_getBool("SEARCHENGINE"))
+ {
+ g_searchUrl=ctx->getOutputFileBase()+
+ Config_getString("HTML_FILE_EXTENSION");
+ QCString name = ctx->qualifiedName();
+ if (Config_getBool("OPTIMIZE_OUTPUT_JAVA"))
+ {
+ name = substitute(name,"::",".");
+ }
+ switch (ctx->definitionType())
+ {
+ case Definition::TypePage:
+ {
+ PageDef *pd = (PageDef *)ctx;
+ if (!pd->title().isEmpty())
+ {
+ name = theTranslator->trPage(TRUE,TRUE)+" "+pd->title();
+ }
+ else
+ {
+ name = theTranslator->trPage(TRUE,TRUE)+" "+pd->name();
+ }
+ }
+ break;
+ case Definition::TypeClass:
+ {
+ ClassDef *cd = (ClassDef *)ctx;
+ name.prepend(cd->compoundTypeString()+" ");
+ }
+ break;
+ case Definition::TypeNamespace:
+ {
+ if (Config_getBool("OPTIMIZE_OUTPUT_JAVA"))
+ {
+ name = theTranslator->trPackage(name);
+ }
+ else
+ {
+ name.prepend(theTranslator->trNamespace(TRUE,TRUE)+" ");
+ }
+ }
+ break;
+ case Definition::TypeGroup:
+ {
+ GroupDef *gd = (GroupDef *)ctx;
+ if (gd->groupTitle())
+ {
+ name = theTranslator->trGroup(TRUE,TRUE)+" "+gd->groupTitle();
+ }
+ else
+ {
+ name.prepend(theTranslator->trGroup(TRUE,TRUE)+" ");
+ }
+ }
+ break;
+ default:
+ break;
+ }
+ Doxygen::searchIndex->setCurrentDoc(name,g_searchUrl);
+ }
+ else
+ {
+ g_searchUrl="";
+ }
+
g_fileName = fileName;
g_memberDef = md;
g_nodeStack.clear();
@@ -4779,6 +4899,7 @@ DocNode *validatingParseText(const char *input)
g_hasParamCommand = FALSE;
g_paramsFound.setAutoDelete(FALSE);
g_paramsFound.clear();
+ g_searchUrl="";
doctokenizerYYlineno=1;
doctokenizerYYinit(input,g_fileName);
@@ -4808,3 +4929,14 @@ void docFindSections(const char *input,
doctokenizerYYFindSections(input,d,mg,fileName);
}
+void initDocParser()
+{
+ if (Config_getBool("SEARCHENGINE"))
+ {
+ Doxygen::searchIndex = new SearchIndex;
+ }
+ else
+ {
+ Doxygen::searchIndex = 0;
+ }
+}
diff --git a/src/docparser.h b/src/docparser.h
index 1554037..6b79220 100644
--- a/src/docparser.h
+++ b/src/docparser.h
@@ -36,24 +36,28 @@ class SectionDict;
//---------------------------------------------------------------------------
+/*! Initialize the documentation parser */
+void initDocParser();
+
/*! Main entry point for the documentation parser.
* @param fileName File in which the documentation block is found (or the
* name of the example file in case isExample is TRUE).
* @param startLine Line at which the documentation block is found.
- * @param context Class or namespace in which of the item to which this
- * block belongs.
+ * @param context Class or namespace to which this block belongs.
* @param md Member definition to which the documentation belongs.
* Can be 0.
* @param input String representation of the documentation block.
+ * @param indexWords Indicates whether or not words should be put in the
+ * search index.
* @param isExample TRUE if the documentation belongs to an example.
* @param exampleName Base name of the example file (0 if isExample is FALSE).
* @returns Root node of the abstract syntax tree. Ownership of the
* pointer is handed over to the caller.
*/
DocNode *validatingParseDoc(const char *fileName,int startLine,
- const char *context, MemberDef *md,
- const char *input,bool isExample,
- const char *exampleName=0);
+ Definition *context, MemberDef *md,
+ const char *input,bool indexWords,
+ bool isExample,const char *exampleName=0);
/*! Main entry point for parsing simple text fragments. These
* fragments are limited to words, whitespace and symbols.
@@ -176,8 +180,7 @@ template class CompAccept
class DocWord : public DocNode
{
public:
- DocWord(DocNode *parent,const QString &word) :
- m_parent(parent), m_word(word) {}
+ DocWord(DocNode *parent,const QString &word);
QString word() const { return m_word; }
Kind kind() const { return Kind_Word; }
DocNode *parent() const { return m_parent; }
@@ -195,9 +198,7 @@ class DocLinkedWord : public DocNode
public:
DocLinkedWord(DocNode *parent,const QString &word,
const QString &ref,const QString &file,
- const QString &anchor) :
- m_parent(parent), m_word(word), m_ref(ref),
- m_file(file), m_anchor(anchor) {}
+ const QString &anchor);
QString word() const { return m_word; }
Kind kind() const { return Kind_Word; }
DocNode *parent() const { return m_parent; }
@@ -312,7 +313,7 @@ class DocSymbol : public DocNode
public:
enum SymType { Unknown=0, BSlash,At,Less,Greater,Amp,Dollar,Hash,Percent,
Copy, Tm, Reg, Apos, Quot, Uml, Acute, Grave, Circ, Tilde, Szlig,
- Cedil, Ring, Nbsp
+ Cedil, Ring, Nbsp, Slash
};
DocSymbol(DocNode *parent,SymType s,char letter='\0') :
m_parent(parent), m_symbol(s), m_letter(letter) {}
@@ -923,6 +924,7 @@ class DocPara : public CompAccept, public DocNode
void markLast(bool v=TRUE) { m_isLast=v; }
bool isFirst() const { return m_isFirst; }
bool isLast() const { return m_isLast; }
+ const QList &children() const { return m_children; }
int handleCommand(const QString &cmdName);
int handleHtmlStartTag(const QString &tagName,const HtmlAttribList &tagHtmlAttribs);
diff --git a/src/doxygen.cpp b/src/doxygen.cpp
index addf597..fbfe2e2 100644
--- a/src/doxygen.cpp
+++ b/src/doxygen.cpp
@@ -42,6 +42,7 @@
#include "pre.h"
#include "tagreader.h"
#include "dot.h"
+#include "docparser.h"
#include "outputlist.h"
#include "declinfo.h"
@@ -62,6 +63,7 @@
#include "bufstr.h"
#include "commentcnv.h"
#include "cmdmapper.h"
+#include "searchindex.h"
#if defined(_MSC_VER) || defined(__BORLANDC__)
#define popen _popen
@@ -113,6 +115,7 @@ QDict *Doxygen::xrefLists = new QDict; // dictionary of cross-
bool Doxygen::parseSourcesNeeded = FALSE;
double Doxygen::sysElapsedTime = 0.0;
QTime Doxygen::runningTime;
+SearchIndex * Doxygen::searchIndex=0;
static StringList inputFiles;
static StringDict excludeNameDict(1009); // sections
@@ -893,6 +896,9 @@ static void resolveClassNestingRelations()
Definition *d = findScopeFromQualifiedName(Doxygen::globalScope,cd->name());
if (d==0)
{
+ //Definition *d = buildScopeFromQualifiedName(cd->name(),cd->name().contains("::"));
+ //d->addInnerCompound(nd);
+ //nd->setOuterScope(d);
warn(cd->getDefFileName(),cd->getDefLine(),
"Warning: Internal inconsistency: scope for class %s not "
"found!\n",cd->name().data()
@@ -1497,12 +1503,13 @@ static MemberDef *addVariableToFile(
{
Debug::print(Debug::Variables,0,
" global variable:\n"
- " type=`%s' scope=`%s' name=`%s' args=`%s' prot=`%d\n",
+ " type=`%s' scope=`%s' name=`%s' args=`%s' prot=`%d mtype=%d\n",
root->type.data(),
scope.data(),
name.data(),
root->args.data(),
- root->protection
+ root->protection,
+ mtype
);
bool ambig;
@@ -2200,7 +2207,8 @@ static void buildFunctionList(Entry *root)
)
)
{
- addMethodToClass(root,cd,rname,/*scope,*/isFriend);
+ Debug::print(Debug::Functions,0,"--> member of class %s!\n",rname.data(),cd->name().data());
+ addMethodToClass(root,cd,rname,isFriend);
}
else if (root->parent &&
!(root->parent->section & Entry::COMPOUND_MASK) &&
@@ -2220,7 +2228,7 @@ static void buildFunctionList(Entry *root)
//MemberDef *fmd;
if ((mn=Doxygen::functionNameSDict[rname]))
{
- //printf("--> function %s already found!\n",rname.data());
+ Debug::print(Debug::Functions,0,"--> function %s already found!\n",rname.data());
MemberNameIterator mni(*mn);
MemberDef *md;
for (mni.toFirst();((md=mni.current()) && !found);++mni)
@@ -2294,7 +2302,7 @@ static void buildFunctionList(Entry *root)
}
else if (!md->documentation().isEmpty() && !root->doc.isEmpty())
{
- warn(root->docFile,root->docLine,"Warning: ignoring the detailed description found here, since another one was found at line %d of file %s!",md->docLine(),md->docFile().data());
+ warn(root->docFile,root->docLine,"Warning: member %s: ignoring the detailed description found here, since another one was found at line %d of file %s!",md->name().data(),md->docLine(),md->docFile().data());
}
if (md->briefDescription().isEmpty() && !root->brief.isEmpty())
@@ -2303,7 +2311,7 @@ static void buildFunctionList(Entry *root)
}
else if (!md->briefDescription().isEmpty() && !root->brief.isEmpty())
{
- warn(root->briefFile,root->briefLine,"Warning: ignoring the brief description found here, since another one was found at line %d of file %s!",md->briefLine(),md->briefFile().data());
+ warn(root->briefFile,root->briefLine,"Warning: member %s: ignoring the brief description found here, since another one was found at line %d of file %s!",md->name().data(),md->briefLine(),md->briefFile().data());
}
md->addSectionsToDefinition(root->anchors);
@@ -2635,26 +2643,26 @@ static void transferFunctionDocumentation()
//printf("transfering docs mdef->mdec (%s->%s)\n",mdef->argsString(),mdec->argsString());
mdec->setDocumentation(mdef->documentation(),mdef->docFile(),mdef->docLine());
mdec->setDocsForDefinition(mdef->isDocsForDefinition());
- ArgumentList *mdefAl = new ArgumentList;
- stringToArgumentList(mdef->argsString(),mdefAl);
if (mdef->argumentList())
{
+ ArgumentList *mdefAl = new ArgumentList;
+ stringToArgumentList(mdef->argsString(),mdefAl);
transferArgumentDocumentation(mdef->argumentList(),mdefAl);
+ mdec->setArgumentList(mdefAl);
}
- mdec->setArgumentList(mdefAl);
}
else if (!mdec->documentation().isEmpty())
{
//printf("transfering docs mdec->mdef (%s->%s)\n",mdec->argsString(),mdef->argsString());
mdef->setDocumentation(mdec->documentation(),mdec->docFile(),mdec->docLine());
mdef->setDocsForDefinition(mdec->isDocsForDefinition());
- ArgumentList *mdecAl = new ArgumentList;
- stringToArgumentList(mdec->argsString(),mdecAl);
if (mdec->argumentList())
{
+ ArgumentList *mdecAl = new ArgumentList;
+ stringToArgumentList(mdec->argsString(),mdecAl);
transferArgumentDocumentation(mdec->argumentList(),mdecAl);
+ mdef->setDeclArgumentList(mdecAl);
}
- mdef->setDeclArgumentList(mdecAl);
}
if (mdec->getStartBodyLine()!=-1 && mdef->getStartBodyLine()==-1)
{
@@ -6250,20 +6258,12 @@ static void generatePageDocs()
outputList->endSection(si->label,si->type);
}
outputList->startTextBlock();
- QCString scName;
- if (pd->getOuterScope() &&
- (pd->getOuterScope()->definitionType()==Definition::TypeClass ||
- pd->getOuterScope()->definitionType()==Definition::TypeNamespace
- )
- )
- {
- scName=pd->getOuterScope()->name();
- }
outputList->parseDoc(pd->docFile(),
pd->docLine(),
- scName,0,
+ pd->getOuterScope(),0,
pd->documentation(),
- FALSE
+ TRUE, // index words
+ FALSE // not an example
/*,pd->sectionDict*/);
outputList->endTextBlock();
endFile(*outputList);
@@ -6352,10 +6352,11 @@ static void generateExampleDocs()
endTitle(*outputList,n,0);
outputList->parseDoc(pd->docFile(), // file
pd->docLine(), // startLine
- pd->getOuterScope()?pd->getOuterScope()->name().data():0, // context
+ pd->getOuterScope(), // context
0, // memberDef
pd->documentation()+"\n\\include "+pd->name(), // docs
- TRUE, // is example
+ TRUE, // index words
+ TRUE, // is example
pd->name()
);
endFile(*outputList);
@@ -6458,116 +6459,116 @@ static QCString fixSlashes(QCString &s)
//----------------------------------------------------------------------------
// generate files for the search engine
-static void generateSearchIndex()
-{
- if (Config_getBool("SEARCHENGINE") && Config_getBool("GENERATE_HTML"))
- {
- // create search index
- QCString fileName;
- writeSearchButton(Config_getString("HTML_OUTPUT"));
-
-#if !defined(_WIN32)
- // create cgi script
- fileName = Config_getString("HTML_OUTPUT")+"/"+Config_getString("CGI_NAME");
- QFile f(fileName);
- if (f.open(IO_WriteOnly))
- {
- QTextStream t(&f);
- t << "#!/bin/sh" << endl
- << "DOXYSEARCH=" << Config_getString("BIN_ABSPATH") << "/doxysearch" << endl
- << "DOXYPATH=\"" << Config_getString("DOC_ABSPATH") << " ";
-
- QStrList &extDocPaths=Config_getList("EXT_DOC_PATHS");
- char *s= extDocPaths.first();
- while (s)
- {
- t << s << " ";
- s=extDocPaths.next();
- }
-
- t << "\"" << endl
- << "if [ -f $DOXYSEARCH ]" << endl
- << "then" << endl
- << " $DOXYSEARCH $DOXYPATH" << endl
- << "else" << endl
- << " echo \"Content-Type: text/html\"" << endl
- << " echo \"\"" << endl
- << " echo \"Error: $DOXYSEARCH not found. Check cgi script!
\"" << endl
- << "fi" << endl;
-
- f.close();
- struct stat stat_struct;
- stat(fileName,&stat_struct);
- chmod(fileName,stat_struct.st_mode|S_IXUSR|S_IXGRP|S_IXOTH);
- }
- else
- {
- err("Error: Cannot open file %s for writing\n",fileName.data());
- }
-#else /* Windows platform */
- // create cgi program
- fileName = Config_getString("CGI_NAME").copy();
- if (fileName.right(4)==".cgi")
- fileName=fileName.left(fileName.length()-4);
- fileName+=".c";
- fileName.prepend(Config_getString("HTML_OUTPUT")+"/");
- QFile f(fileName);
- if (f.open(IO_WriteOnly))
- {
- QTextStream t(&f);
- t << "#include " << endl;
- t << "#include " << endl;
- t << "#include " << endl;
- t << endl;
- t << "const char *DOXYSEARCH = \"" <<
- fixSlashes(Config_getString("BIN_ABSPATH")) << "\\\\doxysearch.exe\";" << endl;
- t << "const char *DOXYPATH = \"" <<
- fixSlashes(Config_getString("DOC_ABSPATH")) << "\";" << endl;
- t << endl;
- t << "int main(void)" << endl;
- t << "{" << endl;
- t << " char buf[1024];" << endl;
- t << " sprintf(buf,\"%s %s\",DOXYSEARCH,DOXYPATH);" << endl;
- t << " if (system(buf))" << endl;
- t << " {" << endl;
- t << " printf(\"Content-Type: text/html\\n\\n\");" << endl;
- t << " printf(\"Error: failed to execute %s
\\n\",DOXYSEARCH);" << endl;
- t << " exit(1);" << endl;
- t << " }" << endl;
- t << " return 0;" << endl;
- t << "}" << endl;
- f.close();
- }
- else
- {
- err("Error: Cannot open file %s for writing\n",fileName.data());
- }
-#endif /* !defined(_WIN32) */
-
- // create config file
- fileName = Config_getString("HTML_OUTPUT")+"/search.cfg";
- f.setName(fileName);
- if (f.open(IO_WriteOnly))
- {
- QTextStream t(&f);
- t << Config_getString("DOC_URL") << "/" << endl
- << Config_getString("CGI_URL") << "/" << Config_getString("CGI_NAME") << endl;
- f.close();
- }
- else
- {
- err("Error: Cannot open file %s for writing\n",fileName.data());
- }
- //outputList->generateExternalIndex();
- outputList->pushGeneratorState();
- outputList->disableAllBut(OutputGenerator::Html);
- startFile(*outputList,"header"+Doxygen::htmlFileExtension,0,"Search Engine",TRUE);
- outputList->endPlainFile();
- outputList->startPlainFile("footer"+Doxygen::htmlFileExtension);
- endFile(*outputList,TRUE);
- outputList->popGeneratorState();
- }
-}
+//static void generateSearchIndex()
+//{
+// if (Config_getBool("SEARCHENGINE") && Config_getBool("GENERATE_HTML"))
+// {
+// // create search index
+// QCString fileName;
+// writeSearchButton(Config_getString("HTML_OUTPUT"));
+//
+//#if !defined(_WIN32)
+// // create cgi script
+// fileName = Config_getString("HTML_OUTPUT")+"/"+Config_getString("CGI_NAME");
+// QFile f(fileName);
+// if (f.open(IO_WriteOnly))
+// {
+// QTextStream t(&f);
+// t << "#!/bin/sh" << endl
+// << "DOXYSEARCH=" << Config_getString("BIN_ABSPATH") << "/doxysearch" << endl
+// << "DOXYPATH=\"" << Config_getString("DOC_ABSPATH") << " ";
+//
+// QStrList &extDocPaths=Config_getList("EXT_DOC_PATHS");
+// char *s= extDocPaths.first();
+// while (s)
+// {
+// t << s << " ";
+// s=extDocPaths.next();
+// }
+//
+// t << "\"" << endl
+// << "if [ -f $DOXYSEARCH ]" << endl
+// << "then" << endl
+// << " $DOXYSEARCH $DOXYPATH" << endl
+// << "else" << endl
+// << " echo \"Content-Type: text/html\"" << endl
+// << " echo \"\"" << endl
+// << " echo \"Error: $DOXYSEARCH not found. Check cgi script!
\"" << endl
+// << "fi" << endl;
+//
+// f.close();
+// struct stat stat_struct;
+// stat(fileName,&stat_struct);
+// chmod(fileName,stat_struct.st_mode|S_IXUSR|S_IXGRP|S_IXOTH);
+// }
+// else
+// {
+// err("Error: Cannot open file %s for writing\n",fileName.data());
+// }
+//#else /* Windows platform */
+// // create cgi program
+// fileName = Config_getString("CGI_NAME").copy();
+// if (fileName.right(4)==".cgi")
+// fileName=fileName.left(fileName.length()-4);
+// fileName+=".c";
+// fileName.prepend(Config_getString("HTML_OUTPUT")+"/");
+// QFile f(fileName);
+// if (f.open(IO_WriteOnly))
+// {
+// QTextStream t(&f);
+// t << "#include " << endl;
+// t << "#include " << endl;
+// t << "#include " << endl;
+// t << endl;
+// t << "const char *DOXYSEARCH = \"" <<
+// fixSlashes(Config_getString("BIN_ABSPATH")) << "\\\\doxysearch.exe\";" << endl;
+// t << "const char *DOXYPATH = \"" <<
+// fixSlashes(Config_getString("DOC_ABSPATH")) << "\";" << endl;
+// t << endl;
+// t << "int main(void)" << endl;
+// t << "{" << endl;
+// t << " char buf[1024];" << endl;
+// t << " sprintf(buf,\"%s %s\",DOXYSEARCH,DOXYPATH);" << endl;
+// t << " if (system(buf))" << endl;
+// t << " {" << endl;
+// t << " printf(\"Content-Type: text/html\\n\\n\");" << endl;
+// t << " printf(\"Error: failed to execute %s
\\n\",DOXYSEARCH);" << endl;
+// t << " exit(1);" << endl;
+// t << " }" << endl;
+// t << " return 0;" << endl;
+// t << "}" << endl;
+// f.close();
+// }
+// else
+// {
+// err("Error: Cannot open file %s for writing\n",fileName.data());
+// }
+//#endif /* !defined(_WIN32) */
+//
+// // create config file
+// fileName = Config_getString("HTML_OUTPUT")+"/search.cfg";
+// f.setName(fileName);
+// if (f.open(IO_WriteOnly))
+// {
+// QTextStream t(&f);
+// t << Config_getString("DOC_URL") << "/" << endl
+// << Config_getString("CGI_URL") << "/" << Config_getString("CGI_NAME") << endl;
+// f.close();
+// }
+// else
+// {
+// err("Error: Cannot open file %s for writing\n",fileName.data());
+// }
+// //outputList->generateExternalIndex();
+// outputList->pushGeneratorState();
+// outputList->disableAllBut(OutputGenerator::Html);
+// startFile(*outputList,"header"+Doxygen::htmlFileExtension,0,"Search Engine",TRUE);
+// outputList->endPlainFile();
+// outputList->startPlainFile("footer"+Doxygen::htmlFileExtension);
+// endFile(*outputList,TRUE);
+// outputList->popGeneratorState();
+// }
+//}
//----------------------------------------------------------------------------
@@ -7534,14 +7535,14 @@ void parseInput()
Doxygen::imageNameDict = new FileNameDict(257);
Doxygen::dotFileNameDict = new FileNameDict(257);
- if (!Config_getString("DOC_URL").isEmpty())
- {
- Doxygen::tagDestinationDict.insert("_doc",new QCString(Config_getString("DOC_URL")));
- }
- if (!Config_getString("CGI_URL").isEmpty())
- {
- Doxygen::tagDestinationDict.insert("_cgi",new QCString(Config_getString("CGI_URL")+"/"+Config_getString("CGI_NAME")));
- }
+ //if (!Config_getString("DOC_URL").isEmpty())
+ //{
+ // Doxygen::tagDestinationDict.insert("_doc",new QCString(Config_getString("DOC_URL")));
+ //}
+ //if (!Config_getString("CGI_URL").isEmpty())
+ //{
+ // Doxygen::tagDestinationDict.insert("_cgi",new QCString(Config_getString("CGI_URL")+"/"+Config_getString("CGI_NAME")));
+ //}
/**************************************************************************
* Initialize some global constants
@@ -8025,6 +8026,32 @@ void generateOutput()
* Initialize output generators *
**************************************************************************/
+ initDocParser();
+
+ //{
+ // QCString fileName = Config_getString("HTML_OUTPUT")+"/filetree.html";
+ // QFile f(fileName);
+ // if (f.open(IO_WriteOnly))
+ // {
+ // QTextStream t(&f);
+ // t << "\n";
+ // t << " \n";
+ // t << " \n";
+ // t << " \n";
+ // t << " \n";
+ // generateFileTree(t);
+ // t << " \n";
+ // t << "\n";
+ // }
+ //}
outputList = new OutputList(TRUE);
if (Config_getBool("GENERATE_HTML"))
@@ -8144,8 +8171,8 @@ void generateOutput()
writeGraphInfo(*outputList);
}
- msg("Generating search index...\n");
- generateSearchIndex();
+ //msg("Generating search index...\n");
+ //generateSearchIndex();
msg("Generating style sheet...\n");
//printf("writing style info\n");
@@ -8237,7 +8264,12 @@ void generateOutput()
}
QDir::setCurrent(oldDir);
}
- cleanUpDoxygen();
+ if (Config_getBool("SEARCHENGINE"))
+ {
+ msg("Generating search index\n");
+ HtmlGenerator::writeSearchPage();
+ Doxygen::searchIndex->write(Config_getString("HTML_OUTPUT")+"/search.idx");
+ }
if (Debug::isFlagSet(Debug::Time))
{
msg("Total elapsed time: %.3f seconds\n(of which %.3f seconds waiting for external tools to finish)\n",
@@ -8245,5 +8277,6 @@ void generateOutput()
Doxygen::sysElapsedTime
);
}
+ cleanUpDoxygen();
}
diff --git a/src/doxygen.h b/src/doxygen.h
index a24a4b6..9cca76d 100644
--- a/src/doxygen.h
+++ b/src/doxygen.h
@@ -39,6 +39,7 @@
class PageSList;
class PageSDict;
class PageDef;
+class SearchIndex;
typedef QList StringList;
typedef QDict FileDict;
@@ -97,6 +98,7 @@ class Doxygen
static bool parseSourcesNeeded;
static double sysElapsedTime;
static QTime runningTime;
+ static SearchIndex *searchIndex;
};
void initDoxygen();
diff --git a/src/doxysearch.cpp b/src/doxysearch.cpp
deleted file mode 100644
index ebdf223..0000000
--- a/src/doxysearch.cpp
+++ /dev/null
@@ -1,1080 +0,0 @@
-/******************************************************************************
- *
- *
- *
- * Copyright (C) 1997-2003 by Dimitri van Heesch.
- *
- * Permission to use, copy, modify, and distribute this software and its
- * documentation under the terms of the GNU General Public License is hereby
- * granted. No representations are made about the suitability of this software
- * for any purpose. It is provided "as is" without express or implied warranty.
- * See the GNU General Public License for more details.
- *
- * Documents produced by Doxygen are derivative works derived from the
- * input used in their production; they are not affected by this license.
- *
- */
-
-// includes
-
-#ifdef _WIN32
-#include // for AllocConsole
-#endif
-
-
-#include
-#include
-#include
-#include
-#include
-#include
-#ifdef PROFILING
-#include
-#include
-#endif
-
-// defines
-
-#ifndef bool
-#define bool int
-#endif
-
-#define MAXSTRLEN 1024
-#ifndef TRUE
-#define TRUE 1
-#endif
-#ifndef FALSE
-#define FALSE 0
-#endif
-
-#define NORMAL 1 // OR search results
-#define INCLUDE 2 // AND search results
-#define EXCLUDE 3 // AND NOT search results
-
-#define TERMMASK (1<<31)
-#define OFFSETMASK (~TERMMASK)
-
-// structs
-
-//----------------------------------------------------------------------------
-
-struct FileInfo
-{
- FileInfo() { name[0]='\0'; f=0; url=0; }
- ~FileInfo() { if (f) fclose(f);
- delete[] url;
- }
- FILE *f;
- char name[MAXSTRLEN];
- int index;
- int refOffset;
- char *url;
- FileInfo *next;
-};
-
-//----------------------------------------------------------------------------
-
-struct FileList
-{
- FileList() { first=0; last=0; index=0; }
- ~FileList() { FileInfo *fi=first;
- while (fi) { FileInfo *ofi=fi; fi=fi->next; delete ofi; }
- }
- FileInfo *add()
- {
- FileInfo *nf=new FileInfo;
- nf->next=0;
- nf->index=index++;
- if (last) { last->next=nf; last=nf; } else { first=nf; last=nf; }
- return nf;
- }
- FileInfo *first;
- FileInfo *last;
- int index;
-};
-
-//----------------------------------------------------------------------------
-
-struct WordInfo
-{
- WordInfo() { word=0; }
- ~WordInfo() { delete[] word; }
- char *word;
- int freq;
- WordInfo *next;
-};
-
-//----------------------------------------------------------------------------
-
-struct WordList
-{
- WordList() { first=0; last=0; }
- ~WordList() { WordInfo *wi=first;
- while (wi) { WordInfo *owi=wi; wi=wi->next; delete owi; }
- }
- void add(const char *word,int freq)
- {
- WordInfo *nw=new WordInfo;
- nw->word = new char[strlen(word)+1];
- strcpy(nw->word,word);
- nw->freq=freq;
- nw->next=0;
- if (last) { last->next=nw; last=nw; } else { first=nw; last=nw; }
- }
- WordInfo *first;
- WordInfo *last;
-};
-
-//----------------------------------------------------------------------------
-
-struct SearchDoc
-{
- FileInfo *fileInfo;
- int index;
- int freq;
- double rank;
- SearchDoc *next;
-};
-
-//----------------------------------------------------------------------------
-
-struct SearchResults
-{
- SearchResults() { totalFreq=0; docList=0; last=0; }
- ~SearchResults() { SearchDoc *d=docList;
- while (d) { SearchDoc *od=d; d=d->next; delete od; }
- }
- void add(FileInfo *fi,int index,int freq)
- {
- SearchDoc *nd=new SearchDoc;
- nd->fileInfo=fi;
- nd->index=index;
- nd->freq=freq;
- nd->next=0;
- if (last) { last->next=nd; last=nd; } else { docList=nd; last=nd; }
- }
- SearchDoc *docList;
- SearchDoc *last;
- int totalFreq;
-};
-
-//----------------------------------------------------------------------------
-
-// global vars
-
-static WordList wordList;
-static FileList fileList;
-static char cgiBin[MAXSTRLEN];
-static char queryInput[MAXSTRLEN];
-static char encQueryInput[MAXSTRLEN];
-static char firstDocUrl[MAXSTRLEN];
-static bool nameOnly;
-static bool wordOnly;
-static bool helpOnly;
-static int page;
-static char *headerBuf=0;
-static char *footerBuf=0;
-
-//----------------------------------------------------------------------------
-
-// functions
-
-void printHeader()
-{
- if (headerBuf)
- {
- printf("Content-Type: text/html\r\n\r\n%s",headerBuf);
- }
- else
- {
- printf("Content-Type: text/html\r\n\r\n");
- printf("Search the documentation\n"
- "\n");
- }
-}
-
-//----------------------------------------------------------------------------
-
-void printFooter()
-{
- if (footerBuf)
- {
- printf("%s",footerBuf);
- }
- else
- {
- printf("\n");
- }
-}
-
-//----------------------------------------------------------------------------
-
-void message(const char *fmt,...)
-{
- printHeader();
- printf("");
- va_list args;
- va_start(args, fmt);
- vfprintf(stdout, fmt, args);
- va_end(args);
- printf("
");
- printFooter();
-}
-
-//----------------------------------------------------------------------------
-
-void printSearchPage(bool open=FALSE)
-{
- printf("\n");
- }
-}
-
-//----------------------------------------------------------------------------
-
-int readInt(FILE *f)
-{
- unsigned char c_24 = fgetc(f);
- unsigned char c_16 = fgetc(f);
- unsigned char c_08 = fgetc(f);
- unsigned char c_00 = fgetc(f);
- return ((unsigned int)c_24<<24)+
- ((unsigned int)c_16<<16)+
- ((unsigned int)c_08<<8)+
- c_00;
- //return (fgetc(f)<<24)+(fgetc(f)<<16)+(fgetc(f)<<8)+fgetc(f);
-}
-
-//----------------------------------------------------------------------------
-
-int readEncodedNumber(FILE *f)
-{
- int n=0,b,s=0;
- do { b=fgetc(f); n|=(b&0x7f)<f,entry,MAXSTRLEN);
- while (entry[0]!='\0')
- {
- //printf("Found entry `%s'\n",entry);
- int i=0, w=word[0], e=entry[0];
- while (w!=0 && e!=0 && w==e) { i++; w=word[i]; e=entry[i]; }
- if (w==0 && e!=0) // word is a substring of entry
- {
- if (wordOnly) return FALSE; // no full word match
- //printf("Word found as substring of `%s%s'\n",&word[-index],&entry[i]);
- int offset=readInt(fi->f); // <= follow for extensions
- if (!(offset&TERMMASK)) // extra info available
- {
- int tfreq=readEncodedNumber(fi->f);
- sr->totalFreq+=tfreq;
- //printf("Total frequency %d\n",tfreq);
- int s=-1,k;
- while ((k=readEncodedNumber(fi->f))!=0)
- {
- bool inName = (k&2)==2;
- s+=(k>>3);
- int freq=readEncodedNumber(fi->f);
- //printf("Doc index %d frequency %d\n",s,freq);
- if (!nameOnly || inName)
- //addResult(fi,sr,s,freq);
- sr->add(fi,s,freq);
- }
- }
- return TRUE;
- }
- else if (e==0) // entry is a substring of word
- {
- if (w==0) // word is equal to entry => exact match found
- {
- int offset=readInt(fi->f); // <= follow for extensions
- if (!(offset&TERMMASK)) // extra info available
- {
- //printf("Match found\n");
- int tfreq=readEncodedNumber(fi->f);
- sr->totalFreq+=tfreq;
- //printf("Total frequency %d\n",tfreq);
- int s=-1,k;
- while ((k=readEncodedNumber(fi->f))!=0)
- {
- bool fullWord = (k&1)==1;
- bool inName = (k&2)==2;
- bool wordInName = (k&4)==4;
- s+=(k>>3);
- int freq=readEncodedNumber(fi->f);
- if (nameOnly && wordOnly)
- {
- if (wordInName) sr->add(fi,s,freq);
- }
- else if (!nameOnly && wordOnly)
- {
- if (fullWord) sr->add(fi,s,freq);
- }
- else if (nameOnly && !wordOnly)
- {
- if (inName) sr->add(fi,s,freq);
- }
- else // !nameOnly && !wordOnly
- {
- sr->add(fi,s,freq);
- }
- }
- }
- return TRUE;
- }
- else // follow branch to next entry
- {
- int offset=readInt(fi->f);
- if ((offset&OFFSETMASK)==0) // no next entry (leaf node)
- {
- return FALSE;
- }
- else // follow branch
- {
- fseek(fi->f,offset&OFFSETMASK,SEEK_SET);
- //printf("Recursive call; jump to %lx\n",ftell(f));
- return searchRecursive(sr,fi,&word[i]);
- }
- }
- }
- else // skip rest of the entry
- {
- int offset=readInt(fi->f);
- if (!(offset&TERMMASK)) while (readEncodedNumber(fi->f)!=0);
- }
- readString(fi->f,entry,MAXSTRLEN);
- }
- //printf("Sorry no match found\n");
- return FALSE;
-}
-
-//----------------------------------------------------------------------------
-
-
-void searchIndex(const char *word,SearchResults *results)
-{
- FileInfo *fi=fileList.first;
- while (fi)
- {
- fi->f = fopen(fi->name, "rb");
- fseek(fi->f,8,SEEK_SET);
- searchRecursive(results,fi,word);
- fclose(fi->f);
- fi->f=0;
- fi=fi->next;
- }
-
- SearchDoc *ds = results->docList;
- while (ds)
- {
- ds->rank = ds->freq/(double)results->totalFreq;
- ds = ds->next;
- }
-
- wordList.add(word,results->totalFreq);
-}
-
-//----------------------------------------------------------------------------
-
-extern "C" int sortResults(const void *a1,const void *a2)
-{
- SearchDoc **d1=(SearchDoc **)a1;
- SearchDoc **d2=(SearchDoc **)a2;
- if ((*d1)->rank > (*d2)->rank)
- return -1;
- else if ((*d1)->rank == (*d2)->rank)
- return 0;
- else
- return 1;
-}
-
-//----------------------------------------------------------------------------
-
-void generateResults(SearchResults *sr)
-{
- // compute the maximum rank
- SearchDoc *ds = sr->docList;
- double maxRank = 0.00000001;
- int resultCount=0;
- if (ds)
- {
- while (ds)
- {
- if (ds->rank>maxRank) maxRank = ds->rank;
- ds = ds->next;
- }
-
- // scale ranks, so the highest is 1 and count the number of links
- double oneOverMaxRank = 1.0/maxRank;
- ds = sr->docList;
- while (ds)
- {
- ds->rank *= oneOverMaxRank;
- resultCount++;
- ds = ds->next;
- }
- }
- SearchDoc **docPtrArray=0;
- if (resultCount>0)
- {
- docPtrArray=(SearchDoc **)calloc(resultCount,sizeof(SearchDoc *));
- int offset=0;
- ds = sr->docList;
- while (ds)
- {
- docPtrArray[offset++]=ds;
- ds = ds->next;
- }
- qsort(docPtrArray,resultCount,sizeof(SearchDoc *),sortResults);
- }
-
- // start generating output
- printHeader();
- printSearchPage(TRUE);
-
- printf(" \n"
- " "
- "
Search results\n"
- " | \n"
- "
\n");
- if (resultCount==0) // nothing found
- {
- printf(" \n"
- " Sorry, no documents matching your query.\n"
- " | \n"
- "
\n");
- }
- else // something found
- {
- printf(" \n"
- " "
- "Found %d document%s matching your query. ",
- resultCount,resultCount==1?"":"s");
-
- if (resultCount>1)
- printf("Showing best matches first.\n");
-
- printf("
\n");
- printf(" | \n"
- "
\n");
-
- const int lpp=20;
- int numPages = (resultCount+lpp-1)/lpp;
-
- // clip page
- if (page<0) page=0;
- if (page>=numPages) page=numPages-1;
- int skipEntries = page * lpp;
- int pageEntries = lpp;
-
- printf(" "
- "Page %d / %d"
- " |
\n",page+1,numPages);
- printf(" \n"
- " \n"
- " \n");
- int i;
- for (i=0 ; i < resultCount && pageEntries > 0; i++)
- {
- if (skipEntries == 0)
- {
- SearchDoc *d=docPtrArray[i];
- if (d->fileInfo->f == 0)
- {
- d->fileInfo->f = fopen(d->fileInfo->name, "rb");
- }
- FILE *f=d->fileInfo->f;
- fseek(f,d->fileInfo->refOffset+d->index*4,SEEK_SET);
- int offset=readInt(f);
- fseek(f,offset,SEEK_SET);
- char linkName[MAXSTRLEN];
- char htmlName[MAXSTRLEN];
- readString(f,linkName,MAXSTRLEN);
- readString(f,htmlName,MAXSTRLEN);
- int rank=(int)(d->rank*100+0.5);
- if (rank==0) rank++;
- printf(" %d"
- " | %s | \n",
- rank*2+55, 255-rank*2, rank,
- d->fileInfo->url, htmlName, linkName);
- pageEntries--;
- if (d->fileInfo->f != 0)
- {
- fclose(d->fileInfo->f);
- d->fileInfo->f = 0;
- }
- }
- else
- {
- skipEntries--;
- }
- }
- printf(" \n"
- " | \n"
- "
\n"
- " ");
-
- if (page>0)
- {
- printf(""
- "prev ",
- cgiBin, page-1,
- wordOnly?"word":"doc",
- nameOnly?"name":"string",
- encQueryInput);
- }
- int startPage = page-5 < 0 ? 0 : page-5;
- int endPage = page+6 > numPages ? numPages : page+5;
- if (endPage-startPage>1)
- {
- for (i=startPage;i"
- "%d ",
- cgiBin, i,
- wordOnly?"word":"doc",
- nameOnly?"name":"string",
- encQueryInput, i+1);
- }
- else
- {
- printf("%d ",i+1);
- }
- }
- }
- if (page"
- "next",
- cgiBin, page+1,
- wordOnly?"word":"doc",
- nameOnly?"name":"string",
- encQueryInput);
- }
- printf(" |
\n"
- " \n"
- " \n"
- " Occurrence count: ");
- WordInfo *wi=wordList.first;
- while (wi)
- {
- printf("%s ",wi->word);
- if (wi->freq>0) printf("(%d)",wi->freq); else printf("(ignored)");
- wi=wi->next;
- if (wi)
- {
- if (wi->next) printf(", "); else printf(" and ");
- }
- }
- printf("\n"
- " | \n"
- "
\n");
- }
- printf("\n\n\n");
- printFooter();
- free(docPtrArray);
-}
-
-//----------------------------------------------------------------------------
-
-void generateHelpPage()
-{
- printHeader();
- printf("Doxysearch help page
\n"
- "Basic search instructions\n"
- "\n"
- "Just type in one or more words or fragments of words and press the "
- "search button. Doxysearch will return a list of functions and class names, "
- "whose documentation or name matches one or more of the words. "
- "Documents containing more matches will appear earlier in the list. "
- "\n"
- "
\n"
- "Search modes\n"
- "\n"
- "Doxysearch has four search modes. From least restrictive to most "
- "restrictive they are:\n"
- " \n"
- "
- Search for strings in the documentation:\n"
- " The words you type will be searched in the documentation as substrings."
- " Typing the word "the" for example, will find "
- " documents containing the words "the", "
- " "there", and "feather".
\n"
- "
- Search for words in the documentation:\n"
- " The words you type will be searched in the documentation as words."
- " Typing the word "the" for example, will look "
- " for documents containing the word "the" and not for"
- " documents containing the word "there".
\n"
- "
- Search for strings in the function and class names:\n"
- " The words you type will be searched in the function and class names "
- " as substrings. Typing the word "set" for example, will "
- " result in a list of links to the documentation of all functions and classes "
- " that contain the word "set" in the name, such as the function "
- "
setCursor
.\n"
- "
- Search for words in the function and class names:\n"
- " The words you type will be matched against the function and class names."
- " The result will be a list of links to the documentation of all function "
- " and class names that are equal to one of the words.\n"
- "
\n"
- "
\n"
- "Requiring/Excluding words\n"
- "\n"
- " Often you will know a word that will be guaranteed to appear in a document "
- " for which you are searching. If this is the case, require that the word appears "
- " in all of the results by attaching a "+" to the beginning of "
- " the word. You can quickly reject results by adding a word that appears only "
- " in unwanted documents with a "-" before it."
- "
\n"
- );
-
- printFooter();
-}
-
-//----------------------------------------------------------------------------
-
-void mergeSearchResults(SearchResults *totalResults,
- SearchResults *sr,int mode)
-{
- SearchDoc *otd = 0,
- *td = totalResults->docList,
- *d = sr->docList;
- totalResults->totalFreq += sr->totalFreq;
- if (!d) return; // nothing to add
- while (td && d)
- {
- int otdih = otd ? otd->fileInfo->index : -1,
- otdil = otd ? otd->index : -1,
- tdih = td->fileInfo->index,
- tdil = td->index,
- dih = d->fileInfo->index,
- dil = d->index;
- if (tdih==dih && tdil==dil) // combine results
- {
- if (mode != EXCLUDE)
- {
- td->rank += d->rank;
- td->rank *= 2; // put extra emphasis on multiple word matches
- td->freq += d->freq;
- d = d->next;
- otd = td; td = td->next;
- }
- else // mode == EXCLUDE => remove entry from results
- {
- SearchDoc *tmp=td;
- td=td->next;
- if (otd) otd->next=td; else totalResults->docList = td;
- delete tmp;
- }
- }
- else if ((otdihdih || (tdih==dih && tdil>dil))) // insert
- {
- if (mode == NORMAL)
- {
- SearchDoc *nd = new SearchDoc(*d);
- if (otd) otd->next = nd; else totalResults->docList = nd;
- nd->next = td;
- td = nd;
- }
- d = d->next;
- }
- else if (tdihnext;
- if (otd) otd->next=td; else totalResults->docList = td;
- delete tmp;
- }
- else // mode == EXCLUDE or mode == NORMAL
- {
- otd = td; td = td->next;
- }
- }
- }
- if (td==0 && d && mode==NORMAL) // append rest of sr to totalResults
- {
- while (d)
- {
- SearchDoc *nd = new SearchDoc(*d);
- if (otd) otd->next = nd; else totalResults->docList = nd;
- nd->next = 0;
- d = d->next;
- otd = nd;
- }
- }
- if (td && d==0 && mode==INCLUDE) // delete the rest of the results
- {
- while (td)
- {
- SearchDoc *tmp=td;
- td=td->next;
- if (otd) otd->next = td; else totalResults->docList = td;
- delete tmp;
- }
- }
-}
-
-//----------------------------------------------------------------------------
-
-int asciiToHex(char c)
-{
- char l=tolower(c);
- if (l>='0' && l<='9')
- return l-'0';
- else if (l>='a' && l<='f')
- return l+10-'a';
- else // invalid hex char
- return 0;
-}
-
-//----------------------------------------------------------------------------
-
-void fileToBuf(const char *name, char **buf)
-{
- FILE *f;
- struct stat file_stats;
- if ((f=fopen(name,"rb"))==NULL) return;
- if (stat(name,&file_stats)==-1)
- {
- message("Error: could not fstat file %s\n",name);
- exit(1);
- }
- unsigned int len=file_stats.st_size;
- if ((*buf=(char *)malloc(len+1))==NULL)
- {
- message("Error: out of memory\n");
- exit(1);
- }
- if (fread(*buf,1,len,f)!=len)
- {
- message("Error: could not read file %s\n",name);
- exit(1);
- }
- (*buf)[len]='\0';
- fclose(f);
-}
-
-//----------------------------------------------------------------------------
-
-void getConfig(const char *s)
-{
- int l;
- char configFile[MAXSTRLEN];
- strcpy(configFile,s);
-#if defined(_WIN32)
- strcat(configFile,"\\search.cfg");
-#else
- strcat(configFile,"/search.cfg");
-#endif
-
- FILE *f;
- if ((f=fopen(configFile,"r"))==NULL)
- {
- message("Error: could not open config file %s\n",configFile);
- exit(1);
- }
-
- // get the URL to the documentation
- fgets(firstDocUrl,MAXSTRLEN,f);
- l=strlen(firstDocUrl)-1;
- if (firstDocUrl[l]=='\n') firstDocUrl[l]='\0';
- l=strlen(firstDocUrl);
- if (firstDocUrl[l]=='/') firstDocUrl[l]='\0';
-
- // get the URL to the cgi script
- fgets(cgiBin,MAXSTRLEN,f);
- l=strlen(cgiBin)-1;
- if (cgiBin[l]=='\n') cgiBin[l]='\0';
-
- fclose(f);
-
- char headerFile[MAXSTRLEN];
- strcpy(headerFile,s);
-#if defined(_WIN32)
- strcat(headerFile,"\\header.html");
-#else
- strcat(headerFile,"/header.html");
-#endif
- fileToBuf(headerFile,&headerBuf);
-
- char footerFile[MAXSTRLEN];
- strcpy(footerFile,s);
-#if defined(_WIN32)
- strcat(footerFile,"\\footer.html");
-#else
- strcat(footerFile,"/footer.html");
-#endif
- fileToBuf(footerFile,&footerBuf);
-
-}
-
-//----------------------------------------------------------------------------
-// copy and convert string to lower case
-
-void strlowercpy(char *d,const char *s)
-{
- while (*s!='\0') *d++=tolower(*s++); *d='\0';
-}
-
-//----------------------------------------------------------------------------
-
-int main(int argc,char **argv)
-{
-#ifdef _WIN32
- AllocConsole();
-#endif
-
-#ifdef PROFILING
- struct timeval tv_start,tv_end;
- gettimeofday(&tv_start,0);
-#endif
- char *argString=getenv("QUERY_STRING");
- if (argc==1)
- {
- message("Error: invalid number of arguments. "
- "Usage: %s doc_path [doc_path ...]",argv[0]);
- exit(1);
- }
- // read the configuration file for this instance of the search engine
- getConfig(argv[1]);
-
- if (!argString)
- {
- printHeader();
- printSearchPage();
- printFooter();
- exit(1);
- }
-
- SearchResults tsr;
-
- // parse cgi arguments
- char *arg=strtok(argString,"&");
- char *query = 0;
- char *what = 0;
- char *which = 0;
- char *help = 0;
- page = 0;
- while (arg)
- {
- int namelen=strcspn(arg,"=");
- if (!strncmp(arg,"query", namelen)) query = &arg[namelen+1];
- else if (!strncmp(arg,"what", namelen)) what = &arg[namelen+1];
- else if (!strncmp(arg,"which", namelen)) which = &arg[namelen+1];
- else if (!strncmp(arg,"help", namelen)) help = &arg[namelen+1];
- else if (!strncmp(arg,"page", namelen)) page = atoi(&arg[namelen+1]);
- arg=strtok(0,"&");
- }
-
- wordOnly=which ? strcmp(which,"word")==0 : FALSE;
- nameOnly=what ? strcmp(what, "name")==0 : FALSE;
- helpOnly=help ? strcmp(help, "on" )==0 : FALSE;
-
- // store encoded query string
- if (query) strcpy(encQueryInput,query); else encQueryInput[0]='\0';
-
- // convert query string to original input
- char *s=query,*d=queryInput;
- if (s)
- {
- while (*s!='\0')
- {
- char c=*s++;
- if (c=='+')
- *d++=' ';
- else if (c=='%')
- {
- *d=asciiToHex(*s++)*16;
- *d+=asciiToHex(*s++);
- d++;
- }
- else
- *d++=c;
- }
- }
- *d='\0';
-
- if (helpOnly)
- {
- generateHelpPage();
- exit(1);
- }
-
- // read search index files
- int argIndex=0;
- for (argIndex=1;argIndexname,indexFile);
- if ((fi->f=fopen(indexFile,"rb"))==NULL)
- {
- message("Error: could not open index file %s\n",indexFile);
- exit(1);
- }
- if ((g=fopen(configFile,"r"))==NULL)
- {
- message("Error: could not open config file %s\n",configFile);
- exit(1);
- }
-
- // get URL to the documentation
- char tmp[MAXSTRLEN];
- fgets(tmp,MAXSTRLEN,g);
- if (tmp[strlen(tmp)-1]=='\n') tmp[strlen(tmp)-1]='\0';
- if (tmp[strlen(tmp)-1]=='/') tmp[strlen(tmp)-1]='\0';
- fi->url = new char[strlen(tmp)+1];
- strcpy(fi->url,tmp);
- fclose(g);
-
- // read & check the format of the search index file
- fseek(fi->f,0,SEEK_SET);
- char header[5];
- if (fread(header,1,4,fi->f)!=4)
- {
- message("Error: Couldn't read header of the index file %s\n",indexFile);
- exit(1);
- }
- header[4]='\0';
- if (strcmp(header,"DOXI"))
- {
- message("Error: Index file %s has an unknown format\n",indexFile);
- exit(1);
- }
- // read and store the offset to the link index
- fi->refOffset=readInt(fi->f);
- fclose(fi->f);
- fi->f = 0;
- }
-
- char *word;
- char wordString[MAXSTRLEN];
-
- // search for included words
- strlowercpy(wordString,queryInput);
- word=strtok(wordString," ");
- bool first=TRUE;
- while (word)
- {
- if (word[0]=='+') // + character => include
- {
- SearchResults sr;
- searchIndex(&word[1],&sr);
- if (first)
- mergeSearchResults(&tsr,&sr,NORMAL);
- else
- mergeSearchResults(&tsr,&sr,INCLUDE);
- first=FALSE;
- }
- word=strtok(0," ");
- }
-
- // search for normal words
- strlowercpy(wordString,queryInput);
- word=strtok(wordString," ");
- while (word)
- {
- if (word[0]!='-' && word[0]!='+') // normal word
- {
- SearchResults sr;
- searchIndex(word,&sr);
- mergeSearchResults(&tsr,&sr,NORMAL);
- }
- word=strtok(0," ");
- }
-
- // search for excluded words
- strlowercpy(wordString,queryInput);
- word=strtok(wordString," ");
- while (word)
- {
- if (word[0]=='-') // - character => exclude
- {
- SearchResults sr;
- searchIndex(&word[1],&sr);
- mergeSearchResults(&tsr,&sr,EXCLUDE);
- }
- word=strtok(0," ");
- }
-
- // write results to HTML page
- generateResults(&tsr);
-
- free(headerBuf);
- free(footerBuf);
-
-#ifdef PROFILING
- gettimeofday(&tv_end,0);
- printf("processing time %3.3f msec\n",
- ((tv_end.tv_sec-tv_start.tv_sec)*1000000+
- tv_end.tv_usec-tv_start.tv_usec)/1000.0
- );
-#endif
- return 0;
-}
diff --git a/src/doxysearch.pro.in b/src/doxysearch.pro.in
deleted file mode 100644
index 07865cd..0000000
--- a/src/doxysearch.pro.in
+++ /dev/null
@@ -1,20 +0,0 @@
-#
-#
-#
-# Copyright (C) 1997-2003 by Dimitri van Heesch.
-#
-# Permission to use, copy, modify, and distribute this software and its
-# documentation under the terms of the GNU General Public License is hereby
-# granted. No representations are made about the suitability of this software
-# for any purpose. It is provided "as is" without express or implied warranty.
-# See the GNU General Public License for more details.
-#
-# Documents produced by Doxygen are derivative works derived from the
-# input used in their production; they are not affected by this license.
-
-TEMPLATE = app.t
-CONFIG = console warn_on $extraopts
-SOURCES = doxysearch.cpp
-TARGET = ../bin/doxysearch
-OBJECTS_DIR = ../objects
-win32-g++:TMAKE_CXXFLAGS += -fno-exceptions -fno-rtti
diff --git a/src/doxytag.l b/src/doxytag.l
index d5a3edc..91dfac5 100644
--- a/src/doxytag.l
+++ b/src/doxytag.l
@@ -32,8 +32,8 @@
#include
#include "version.h"
-#include "suffixtree.h"
-#include "searchindex.h"
+//#include "suffixtree.h"
+//#include "searchindex.h"
#include "logos.h"
static QCString convertToXML(const char *s)
@@ -95,7 +95,7 @@ static QCString docBaseLink;
static QCString docAnchor;
static QCString docRefName;
static bool nameBug;
-static SearchIndex searchIndex;
+//static SearchIndex searchIndex;
#define YY_NEVER_INTERACTIVE 1
@@ -162,14 +162,14 @@ static void addReference()
{
//printf("addReference() key: %s ref:%s\n",
// docRefName.data(),(docBaseLink+"#"+docAnchor).data());
- if (genIndex && !docRefName.isEmpty() && !docBaseLink.isEmpty())
- {
- if (docAnchor.isEmpty())
- searchIndex.addReference(docRefName,docBaseLink);
- else
- searchIndex.addReference(docRefName,docBaseLink+"#"+docAnchor);
- searchIndex.addWord(docRefName,docRefName,TRUE);
- }
+ //if (genIndex && !docRefName.isEmpty() && !docBaseLink.isEmpty())
+ //{
+ // if (docAnchor.isEmpty())
+ // searchIndex.addReference(docRefName,docBaseLink);
+ // else
+ // searchIndex.addReference(docRefName,docBaseLink+"#"+docAnchor);
+ // searchIndex.addWord(docRefName,docRefName,TRUE);
+ //}
}
QCString unhtmlify(const char *str)
@@ -247,10 +247,10 @@ QCString unhtmlify(const char *str)
//printf("tag: %s#%s ref: %s word: `%s'\n",
// docBaseLink.data(),docAnchor.data(),
// docRefName.data(),yytext);
- if (genIndex && !docRefName.isEmpty() && yyleng>2)
- searchIndex.addWord(docRefName,
- yytext,FALSE
- );
+ //if (genIndex && !docRefName.isEmpty() && yyleng>2)
+ // searchIndex.addWord(docRefName,
+ // yytext,FALSE
+ // );
}
"" {
BEGIN( Start );
@@ -458,8 +458,8 @@ void parseFile(QFileInfo &fi)
QCString input(fi.size()+1);
docBaseLink=fi.fileName();
docRefName=fi.fileName().copy();
- searchIndex.addReference(docRefName,docBaseLink);
- searchIndex.addWord(docRefName,docRefName,TRUE);
+ //searchIndex.addReference(docRefName,docBaseLink);
+ //searchIndex.addWord(docRefName,docRefName,TRUE);
f.readBlock(input.data(),fi.size());
input.at(fi.size())='\0';
parse(input);
@@ -584,46 +584,48 @@ int main(int argc,char **argv)
}
if (genIndex)
{
- //printf("Writing search index\n");
- if (!searchIndex.saveIndex(indexName))
- {
- fprintf(stderr,"Error: Could not write search index\n");
- }
- QFileInfo fi(indexName);
- if (fi.exists())
- {
- QCString dir=convertToQCString(fi.dir().absPath());
- fi.setFile(dir+"/search.png");
- if (!fi.exists()) writeSearchButton(dir);
- fi.setFile(dir+"/doxygen.png");
- if (!fi.exists()) writeLogo(dir);
- fi.setFile(dir+"/search.cgi");
- if (!fi.exists())
- {
- QFile f;
- f.setName(dir+"/search.cgi");
- if (f.open(IO_WriteOnly))
- {
- QTextStream t(&f);
- t << "#!/bin/sh" << endl
- << "DOXYSEARCH=" << endl
- << "DOXYPATH=" << endl
- << "if [ -f $DOXYSEARCH ]" << endl
- << "then" << endl
- << " $DOXYSEARCH $DOXYPATH" << endl
- << "else" << endl
- << " echo \"Content-Type: text/html\"" << endl
- << " echo \"\"" << endl
- << " echo \"Error: $DOXYSEARCH not found. Check cgi script!\"" << endl
- << "fi" << endl;
- f.close();
- }
- else
- {
- fprintf(stderr,"Error: could not open file %s for writing\n",(dir+"/search.cgi").data());
- }
- }
- }
+ fprintf(stderr,"Error: doxytag cannot be used to generate a search index anymore.\n"
+ "This functionality has been integrated into doxygen.\n");
+// printf("Writing search index\n");
+// if (!searchIndex.saveIndex(indexName))
+// {
+// fprintf(stderr,"Error: Could not write search index\n");
+// }
+// QFileInfo fi(indexName);
+// if (fi.exists())
+// {
+// QCString dir=convertToQCString(fi.dir().absPath());
+// fi.setFile(dir+"/search.png");
+// if (!fi.exists()) writeSearchButton(dir);
+// fi.setFile(dir+"/doxygen.png");
+// if (!fi.exists()) writeLogo(dir);
+// fi.setFile(dir+"/search.cgi");
+// if (!fi.exists())
+// {
+// QFile f;
+// f.setName(dir+"/search.cgi");
+// if (f.open(IO_WriteOnly))
+// {
+// QTextStream t(&f);
+// t << "#!/bin/sh" << endl
+// << "DOXYSEARCH=" << endl
+// << "DOXYPATH=" << endl
+// << "if [ -f $DOXYSEARCH ]" << endl
+// << "then" << endl
+// << " $DOXYSEARCH $DOXYPATH" << endl
+// << "else" << endl
+// << " echo \"Content-Type: text/html\"" << endl
+// << " echo \"\"" << endl
+// << " echo \"Error: $DOXYSEARCH not found. Check cgi script!\"" << endl
+// << "fi" << endl;
+// f.close();
+// }
+// else
+// {
+// fprintf(stderr,"Error: could not open file %s for writing\n",(dir+"/search.cgi").data());
+// }
+// }
+// }
}
if (genTag)
{
diff --git a/src/doxytag.pro.in b/src/doxytag.pro.in
index 6900938..820c094 100644
--- a/src/doxytag.pro.in
+++ b/src/doxytag.pro.in
@@ -16,9 +16,8 @@
TEMPLATE = doxytag.t
CONFIG = console warn_on $extraopts
-HEADERS = suffixtree.h searchindex.h logos.h version.h
-SOURCES = doxytag.cpp suffixtree.cpp searchindex.cpp \
- logos.cpp version.cpp
+HEADERS = logos.h version.h
+SOURCES = doxytag.cpp logos.cpp version.cpp
unix:LIBS += -L../lib -lqtools
win32:INCLUDEPATH += .
win32-mingw:LIBS += -L../lib -lqtools
diff --git a/src/entry.h b/src/entry.h
index 594a3c8..ef50658 100644
--- a/src/entry.h
+++ b/src/entry.h
@@ -135,9 +135,9 @@ struct Grouping
{
GROUPING_LOWEST,
GROUPING_AUTO_WEAK =
- GROUPING_LOWEST, //!< membership in group was defined via \@weakgroup \@{ \@}
- GROUPING_AUTO_ADD, //!< membership in group was defined via \@add[to]group \@{ \@}
- GROUPING_AUTO_DEF, //!< membership in group was defined via \@defgroup \@{ \@}
+ GROUPING_LOWEST, //!< membership in group was defined via \@weakgroup
+ GROUPING_AUTO_ADD, //!< membership in group was defined via \@add[to]group
+ GROUPING_AUTO_DEF, //!< membership in group was defined via \@defgroup
GROUPING_AUTO_HIGHEST = GROUPING_AUTO_DEF,
GROUPING_INGROUP, //!< membership in group was defined by \@ingroup
GROUPING_HIGHEST = GROUPING_INGROUP
diff --git a/src/filedef.cpp b/src/filedef.cpp
index 0e9104e..0278688 100644
--- a/src/filedef.cpp
+++ b/src/filedef.cpp
@@ -30,6 +30,7 @@
#include "message.h"
#include "code.h"
#include "docparser.h"
+#include "ftvhelp.h"
//#include "xml.h"
class DevNullCodeDocInterface : public BaseCodeDocInterface
@@ -159,7 +160,7 @@ void FileDef::writeDetailedDocumentation(OutputList &ol)
ol.endGroupHeader();
if (!briefDescription().isEmpty() && Config_getBool("REPEAT_BRIEF"))
{
- ol.parseDoc(briefFile(),briefLine(),0,0,briefDescription(),FALSE);
+ ol.parseDoc(briefFile(),briefLine(),this,0,briefDescription(),FALSE,FALSE);
}
if (!briefDescription().isEmpty() && Config_getBool("REPEAT_BRIEF") &&
!documentation().isEmpty())
@@ -176,7 +177,7 @@ void FileDef::writeDetailedDocumentation(OutputList &ol)
{
//if (doc.at(dl-1)!='.' && doc.at(dl-1)!='!' && doc.at(dl-1)!='?')
// doc+='.';
- ol.parseDoc(docFile(),docLine(),0,0,documentation()+"\n",FALSE);
+ ol.parseDoc(docFile(),docLine(),this,0,documentation()+"\n",TRUE,FALSE);
}
//printf("Writing source ref for file %s\n",name().data());
if (Config_getBool("SOURCE_BROWSER"))
@@ -237,7 +238,7 @@ void FileDef::writeDocumentation(OutputList &ol)
}
else if (briefDescription())
{
- ol.parseDoc(briefFile(),briefLine(),0,0,briefDescription(),FALSE);
+ ol.parseDoc(briefFile(),briefLine(),this,0,briefDescription(),TRUE,FALSE);
ol.writeString(" \n");
ol.disableAllBut(OutputGenerator::Html);
ol.startTextLink(0,"_details");
@@ -779,3 +780,217 @@ void FileDef::addListReferences()
docVarMembers.addListReferences(this);
}
+//-------------------------------------------------------------------
+
+static int findMatchingPart(const QCString &path,const QCString dir)
+{
+ int si1;
+ int pos1=0,pos2=0;
+ while ((si1=path.find('/',pos1))!=-1)
+ {
+ int si2=dir.find('/',pos2);
+ //printf(" found slash at pos %d in path %d: %s<->%s\n",si1,si2,
+ // path.mid(pos1,si1-pos2).data(),dir.mid(pos2).data());
+ if (si2==-1 && path.mid(pos1,si1-pos2)==dir.mid(pos2)) // match at end
+ {
+ return dir.length();
+ }
+ if (si1!=si2 || path.mid(pos1,si1-pos2)!=dir.mid(pos2,si2-pos2)) // no match in middle
+ {
+ return QMAX(pos1-1,0);
+ }
+ pos1=si1+1;
+ pos2=si2+1;
+ }
+ return 0;
+}
+
+static Directory *findDirNode(Directory *root,const QCString &name)
+{
+ QListIterator dli(root->children());
+ DirEntry *de;
+ for (dli.toFirst();(de=dli.current());++dli)
+ {
+ if (de->kind()==DirEntry::Dir)
+ {
+ Directory *dir = (Directory *)de;
+ QCString dirName=dir->name();
+ int sp=findMatchingPart(name,dirName);
+ //printf("findMatchingPart(%s,%s)=%d\n",name.data(),dirName.data(),sp);
+ if (sp>0) // match found
+ {
+ if ((uint)sp==dirName.length()) // whole directory matches
+ {
+ // recurse into the directory
+ return findDirNode(dir,name.mid(dirName.length()+1));
+ }
+ else // partial match => we need to split the path into three parts
+ {
+ QCString baseName =dirName.left(sp);
+ QCString oldBranchName=dirName.mid(sp+1);
+ QCString newBranchName=name.mid(sp+1);
+ // strip file name from path
+ int newIndex=newBranchName.findRev('/');
+ if (newIndex>0) newBranchName=newBranchName.left(newIndex);
+
+ //printf("Splitting off part in new branch \n"
+ // "base=%s old=%s new=%s\n",
+ // baseName.data(),
+ // oldBranchName.data(),
+ // newBranchName.data()
+ // );
+ Directory *base = new Directory(root,baseName);
+ Directory *newBranch = new Directory(base,newBranchName);
+ dir->reParent(base);
+ dir->rename(oldBranchName);
+ base->addChild(dir);
+ base->addChild(newBranch);
+ dir->setLast(FALSE);
+ // remove DirEntry container from list (without deleting it)
+ root->children().setAutoDelete(FALSE);
+ root->children().removeRef(dir);
+ root->children().setAutoDelete(TRUE);
+ // add new branch to the root
+ if (!root->children().isEmpty())
+ {
+ root->children().last()->setLast(FALSE);
+ }
+ root->addChild(base);
+ return newBranch;
+ }
+ }
+ }
+ }
+ int si=name.findRev('/');
+ if (si==-1) // no subdir
+ {
+ return root; // put the file under the root node.
+ }
+ else // need to create a subdir
+ {
+ QCString baseName = name.left(si);
+ //printf("new subdir %s\n",baseName.data());
+ Directory *newBranch = new Directory(root,baseName);
+ if (!root->children().isEmpty())
+ {
+ root->children().last()->setLast(FALSE);
+ }
+ root->addChild(newBranch);
+ return newBranch;
+ }
+}
+
+static void mergeFileDef(Directory *root,FileDef *fd)
+{
+ QCString rootPath = root->name();
+ QCString filePath = fd->absFilePath();
+ //printf("merging %s\n",filePath.data());
+ Directory *dirNode = findDirNode(root,filePath);
+ if (!dirNode->children().isEmpty())
+ {
+ dirNode->children().last()->setLast(FALSE);
+ }
+ DirEntry *e=new DirEntry(dirNode,fd);
+ dirNode->addChild(e);
+}
+
+static void generateIndent(QTextStream &t,DirEntry *de,int level)
+{
+ if (de->parent())
+ {
+ generateIndent(t,de->parent(),level+1);
+ }
+ // from the root up to node n do...
+ if (level==0) // item before a dir or document
+ {
+ if (de->isLast())
+ {
+ if (de->kind()==DirEntry::Dir)
+ {
+ t << "";
+ }
+ else
+ {
+ t << "";
+ }
+ }
+ else
+ {
+ if (de->kind()==DirEntry::Dir)
+ {
+ t << "";
+ }
+ else
+ {
+ t << "";
+ }
+ }
+ }
+ else // item at another level
+ {
+ if (de->isLast())
+ {
+ t << "";
+ }
+ else
+ {
+ t << "";
+ }
+ }
+}
+
+
+static void writeDirTreeNode(QTextStream &t,Directory *root,int level)
+{
+ QCString indent;
+ indent.fill(' ',level*2);
+ QListIterator dli(root->children());
+ DirEntry *de;
+ for (dli.toFirst();(de=dli.current());++dli)
+ {
+ t << indent << "";
+ generateIndent(t,de,0);
+ if (de->kind()==DirEntry::Dir)
+ {
+ Directory *dir=(Directory *)de;
+ //printf("%s [dir]: %s (last=%d,dir=%d)\n",indent.data(),dir->name().data(),dir->isLast(),dir->kind()==DirEntry::Dir);
+ t << "";
+ t << dir->name();
+ t << "
\n";
+ t << indent << "\n";
+ writeDirTreeNode(t,dir,level+1);
+ t << indent << "
\n";
+ }
+ else
+ {
+ //printf("%s [file]: %s (last=%d,dir=%d)\n",indent.data(),de->file()->name().data(),de->isLast(),de->kind()==DirEntry::Dir);
+ t << "";
+ t << de->file()->name();
+ t << "
\n";
+ }
+ }
+}
+
+void generateFileTree(QTextStream &t)
+{
+ FTVHelp::generateTreeViewImages();
+
+ Directory *root=new Directory(0,"");
+ root->setLast(TRUE);
+ FileNameListIterator fnli(Doxygen::inputNameList);
+ FileName *fn;
+ for (fnli.toFirst();(fn=fnli.current());++fnli)
+ {
+ FileNameIterator fni(*fn);
+ FileDef *fd;
+ for (;(fd=fni.current());++fni)
+ {
+ mergeFileDef(root,fd);
+ }
+ }
+ t << "\n";
+ writeDirTreeNode(t,root,0);
+ t << "
\n";
+ delete root;
+}
+
diff --git a/src/filedef.h b/src/filedef.h
index 13b3b2c..d0e7c02 100644
--- a/src/filedef.h
+++ b/src/filedef.h
@@ -241,4 +241,51 @@ class OutputNameDict : public QDict
~OutputNameDict() {}
};
+class Directory;
+
+class DirEntry
+{
+ public:
+ enum EntryKind { Dir, File };
+ DirEntry::DirEntry(DirEntry *parent,FileDef *fd)
+ : m_parent(parent), m_kind(File), m_fd(fd), m_isLast(FALSE) { }
+ DirEntry::DirEntry(DirEntry *parent)
+ : m_parent(parent), m_kind(Dir), m_fd(0), m_isLast(FALSE) { }
+ virtual ~DirEntry() { }
+ EntryKind kind() const { return m_kind; }
+ FileDef *file() const { return m_fd; }
+ bool isLast() const { return m_isLast; }
+ void setLast(bool b) { m_isLast=b; }
+ DirEntry *parent() const { return m_parent; }
+
+ protected:
+ DirEntry *m_parent;
+ private:
+ EntryKind m_kind;
+ FileDef *m_fd;
+ int num;
+ bool m_isLast;
+};
+
+class Directory : public DirEntry
+{
+ public:
+ Directory(Directory *parent,const QCString &name)
+ : DirEntry(parent), m_name(name)
+ { m_children.setAutoDelete(TRUE); }
+ virtual ~Directory() {}
+ void addChild(DirEntry *d) { m_children.append(d); d->setLast(TRUE); }
+ QList &children() { return m_children; }
+ void rename(const QCString &name) { m_name=name; }
+ void reParent(Directory *parent) { m_parent=parent; }
+ QCString name() const { return m_name; }
+
+ private:
+ QCString m_name;
+ QList m_children;
+};
+
+void generateFileTree(QTextStream &t);
+
#endif
+
diff --git a/src/ftvhelp.cpp b/src/ftvhelp.cpp
index f196253..941808d 100644
--- a/src/ftvhelp.cpp
+++ b/src/ftvhelp.cpp
@@ -291,65 +291,23 @@ unsigned char ftv2vertline_png[] = {
};
-struct ImageInfo
-{
- const char *alt;
- const char *name;
- const unsigned char *data;
- unsigned int len;
- unsigned short width, height;
-} image_info[] =
+FTVImageInfo image_info[] =
{
{ " ", "ftv2blank.png",ftv2blank_png,174,16,22 },
-#define FTVIMG_blank 0
-
- { "*", "ftv2doc.png",ftv2doc_png,255,24,22 },
-#define FTVIMG_doc 1
-
- { "+", "ftv2folderclosed.png",ftv2folderclosed_png,259,24,22 },
-#define FTVIMG_folderclosed 2
-
- { "-", "ftv2folderopen.png",ftv2folderopen_png,261,24,22 },
-#define FTVIMG_folderopen 3
-
+ { "*", "ftv2doc.png",ftv2doc_png,255,24,22 },
+ { "+", "ftv2folderclosed.png",ftv2folderclosed_png,259,24,22 },
+ { "-", "ftv2folderopen.png",ftv2folderopen_png,261,24,22 },
{ "\\", "ftv2lastnode.png",ftv2lastnode_png,233,16,22 },
-#define FTVIMG_lastnode 4
-
- { "-", "ftv2link.png",ftv2link_png,358,24,22 },
-#define FTVIMG_link 5
-
+ { "-", "ftv2link.png",ftv2link_png,358,24,22 },
{ "\\", "ftv2mlastnode.png",ftv2mlastnode_png,160,16,22 },
-#define FTVIMG_mlastnode 6
-
- { "o", "ftv2mnode.png",ftv2mnode_png,194,16,22 },
-#define FTVIMG_mnode 7
-
- { "o", "ftv2node.png",ftv2node_png,235,16,22 },
-#define FTVIMG_node 8
-
+ { "o", "ftv2mnode.png",ftv2mnode_png,194,16,22 },
+ { "o", "ftv2node.png",ftv2node_png,235,16,22 },
{ "\\", "ftv2plastnode.png",ftv2plastnode_png,165,16,22 },
-#define FTVIMG_plastnode 9
-
- { "o", "ftv2pnode.png",ftv2pnode_png,200,16,22 },
-#define FTVIMG_pnode 10
-
- { "|", "ftv2vertline.png",ftv2vertline_png,229,16,22 },
-#define FTVIMG_vertline 11
-
+ { "o", "ftv2pnode.png",ftv2pnode_png,200,16,22 },
+ { "|", "ftv2vertline.png",ftv2vertline_png,229,16,22 },
{ 0,0,0,0,0,0 }
-#define FTVIMG_UNUSED 12
};
-#define _S(nym) #nym
-#define FTV_ICON_FILE(nym) "ftv2" _S(nym) ".png"
-#define FTVIMG_INDEX(nym) FTVIMG_ ## nym
-#define _INFO(nym) ( image_info[FTVIMG_INDEX(nym)] )
-#define IMG_PREAMBLE(nym) \
- "close();
- //delete m_cf;
generateTreeView();
- //generateFolderTreeViewData();
}
/*! Increase the level of the contents hierarchy.
@@ -496,22 +450,22 @@ void FTVHelp::generateIndent(QTextStream &t, FTVNode *n,int level)
{
if (n->isDir)
{
- t << IMG_PREAMBLE(plastnode) << "onclick=\"toggleFolder('folder" << folderId << "', this)\"/>";
+ t << "";
}
else
{
- t << IMG_PREAMBLE(lastnode) << "/>";
+ t << "";
}
}
else
{
if (n->isDir)
{
- t << IMG_PREAMBLE(pnode) << "onclick=\"toggleFolder('folder" << folderId << "', this)\"/>";
+ t << "";
}
else
{
- t << IMG_PREAMBLE(node) << "/>";
+ t << "";
}
}
}
@@ -519,11 +473,11 @@ void FTVHelp::generateIndent(QTextStream &t, FTVNode *n,int level)
{
if (n->isLast)
{
- t << IMG_PREAMBLE(blank) << "/>";
+ t << "";
}
else
{
- t << IMG_PREAMBLE(vertline) << "/>";
+ t << "";
}
}
}
@@ -579,7 +533,7 @@ void FTVHelp::generateTree(QTextStream &t, const QList &nl,int level)
generateIndent(t,n,0);
if (n->isDir)
{
- t << IMG_PREAMBLE(folderclosed) << "onclick=\"toggleFolder('folder" << folderId << "', this)\"/>";
+ t << "";
generateLink(t,n);
t << "\n";
t << spaces << "\n";
@@ -589,13 +543,38 @@ void FTVHelp::generateTree(QTextStream &t, const QList
&nl,int level)
}
else
{
- t << IMG_PREAMBLE(doc) << "/>";
+ t << "";
generateLink(t,n);
t << "\n";
}
}
}
+void FTVHelp::generateTreeViewImages()
+{
+ static bool done=FALSE;
+ if (done) return;
+ done=TRUE;
+
+ // Generate tree view images
+ FTVImageInfo *p = image_info;
+ while (p->name)
+ {
+ QCString fileName=Config_getString("HTML_OUTPUT")+"/"+p->name;
+ QFile f(fileName);
+ if (f.open(IO_WriteOnly))
+ {
+ f.writeBlock((char *)p->data,p->len);
+ }
+ else
+ {
+ fprintf(stderr,"Warning: Cannot open file %s for writing\n",fileName.data());
+ }
+ f.close();
+ p++;
+ }
+}
+
void FTVHelp::generateTreeView()
{
// Generate alternative index.html as a frame
@@ -792,21 +771,7 @@ void FTVHelp::generateTreeView()
t << "