summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2003-10-26 21:03:52 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2003-10-26 21:03:52 (GMT)
commitd25d58214567928fe15016f49b3be819aca0703f (patch)
tree4c65fd4f0ce24f06f9b7a5067eb6c577fb1479a2 /src
parent2fe3e7d170ffb3d95bdf4dadbcf257506554ebaf (diff)
downloadDoxygen-d25d58214567928fe15016f49b3be819aca0703f.zip
Doxygen-d25d58214567928fe15016f49b3be819aca0703f.tar.gz
Doxygen-d25d58214567928fe15016f49b3be819aca0703f.tar.bz2
Release-1.3.4-20031026
Diffstat (limited to 'src')
-rw-r--r--src/dot.cpp406
-rw-r--r--src/dot.h18
-rw-r--r--src/doxygen.pro.in14
-rw-r--r--src/htmlgen.cpp2
-rw-r--r--src/index.cpp4
-rw-r--r--src/latexdocvisitor.cpp10
-rw-r--r--src/libdoxygen.pro.in1
-rw-r--r--src/mandocvisitor.cpp2
-rw-r--r--src/rtfdocvisitor.cpp3
-rw-r--r--src/scanner.l173
-rw-r--r--src/search.php4
-rw-r--r--src/search_php.h4
-rw-r--r--src/translator_kr.h2
13 files changed, 446 insertions, 197 deletions
diff --git a/src/dot.cpp b/src/dot.cpp
index 79c1320..1b506b1 100644
--- a/src/dot.cpp
+++ b/src/dot.cpp
@@ -31,6 +31,7 @@
#include <qdir.h>
#include <qfile.h>
#include <qtextstream.h>
+#include <md5.h>
//--------------------------------------------------------------------
@@ -1382,7 +1383,86 @@ void writeDotGraph(DotNode *root,
}
}
-static void findMaximalDotGraph(DotNode *root,
+/*! Computes a 16 byte md5 checksum for a given dot graph.
+ * The md5 checksum is returned as a 32 character ASCII string.
+ */
+QCString computeMd5Signature(DotNode *root,
+ DotNode::GraphType gt,
+ GraphOutputFormat format,
+ bool lrRank,
+ bool renderParents,
+ int distance,
+ bool backArrows
+ )
+{
+ //printf("computeMd5Signature\n");
+ QString buf;
+ QTextStream md5stream(&buf,IO_WriteOnly);
+ if (lrRank)
+ {
+ md5stream << "rankdir=LR;" << endl;
+ }
+ root->clearWriteFlag();
+ root->write(md5stream,gt,format,gt!=DotNode::CallGraph,TRUE,distance,backArrows);
+ if (renderParents && root->m_parents)
+ {
+ QListIterator<DotNode> dnli(*root->m_parents);
+ DotNode *pn;
+ for (dnli.toFirst();(pn=dnli.current());++dnli)
+ {
+ if (pn->m_distance<=distance)
+ {
+ root->writeArrow(md5stream,
+ gt,
+ format,
+ pn,
+ pn->m_edgeInfo->at(pn->m_children->findRef(root)),
+ FALSE,
+ backArrows
+ );
+ }
+ pn->write(md5stream,gt,format,TRUE,FALSE,distance,backArrows);
+ }
+ }
+ char md5_sig[16];
+ QCString sigStr(33);
+ md5_buffer(buf.ascii(),buf.length(),md5_sig);
+ md5_sig_to_string(md5_sig,sigStr.data(),33);
+ //printf("md5: %s | file: %s\n",sigStr,baseName.data());
+ return sigStr;
+}
+
+/*! Checks if a file "baseName".md5 exists. If so the contents
+ * are compared with \a md5. If equal FALSE is returned. If the .md5
+ * file does not exist or its contents are not equal to \a md5,
+ * a new .md5 is generated with the \a md5 string as contents.
+ */
+static bool checkAndUpdateMd5Signature(const QCString &baseName,const QCString &md5)
+{
+ QFile f(baseName+".md5");
+ if (f.open(IO_ReadOnly))
+ {
+ // read checksum
+ QCString md5stored(33);
+ int bytesRead=f.readBlock(md5stored.data(),32);
+ // compare checksum
+ if (bytesRead==32 && md5==md5stored)
+ {
+ // bail out if equal
+ return FALSE;
+ }
+ }
+ f.close();
+ // create checksum file
+ if (f.open(IO_WriteOnly))
+ {
+ f.writeBlock(md5.data(),32);
+ f.close();
+ }
+ return TRUE;
+}
+
+static bool findMaximalDotGraph(DotNode *root,
int maxDist,
const QCString &baseName,
QDir &thisDir,
@@ -1402,6 +1482,10 @@ static void findMaximalDotGraph(DotNode *root,
int maxDotGraphHeight = Config_getInt("MAX_DOT_GRAPH_HEIGHT");
int lastFit=minDistance;
+ QCString md5 = computeMd5Signature(root,gt,format,lrRank,
+ renderParents,maxDistance,backArrows);
+ if (!checkAndUpdateMd5Signature(baseName,md5)) return FALSE;
+
// binary search for the maximal inheritance depth that fits in a reasonable
// sized image (dimensions: Config_getInt("MAX_DOT_GRAPH_WIDTH"), Config_getInt("MAX_DOT_GRAPH_HEIGHT"))
while (minDistance<=maxDistance)
@@ -1417,7 +1501,7 @@ static void findMaximalDotGraph(DotNode *root,
if (iSystem(Config_getString("DOT_PATH")+"dot",dotArgs)!=0)
{
err("Problems running dot. Check your installation!\n");
- return;
+ return FALSE;
}
// extract bounding box from the result
@@ -1461,6 +1545,7 @@ static void findMaximalDotGraph(DotNode *root,
lastFit,
backArrows
);
+ return TRUE;
}
QCString DotClassGraph::diskName() const
@@ -1520,105 +1605,108 @@ QCString DotClassGraph::writeGraph(QTextStream &out,
}
baseName = convertNameToFile(diskName());
- findMaximalDotGraph(m_startNode,QMIN(m_recDepth,m_maxDistance),baseName,
- thisDir,m_graphType,format,!isTBRank,m_graphType==DotNode::Inheritance);
- if (format==BITMAP) // run dot to create a bitmap image
+ if (findMaximalDotGraph(m_startNode,QMIN(m_recDepth,m_maxDistance),baseName,
+ thisDir,m_graphType,format,!isTBRank,m_graphType==DotNode::Inheritance))
{
- QCString dotArgs(maxCmdLine);
- QCString imgExt = Config_getEnum("DOT_IMAGE_FORMAT");
- QCString imgName = baseName+"."+imgExt;
- dotArgs.sprintf("-T%s \"%s.dot\" -o \"%s\"",
- imgExt.data(),baseName.data(),imgName.data());
- if (iSystem(Config_getString("DOT_PATH")+"dot",dotArgs)!=0)
- {
- err("Error: Problems running dot. Check your installation!\n");
- QDir::setCurrent(oldDir);
- return baseName;
- }
- checkDotResult(imgName);
- if (generateImageMap)
+
+ if (format==BITMAP) // run dot to create a bitmap image
{
- // run dot again to create an image map
- dotArgs.sprintf("-Timap \"%s.dot\" -o \"%s.map\"",baseName.data(),baseName.data());
+ QCString dotArgs(maxCmdLine);
+ QCString imgExt = Config_getEnum("DOT_IMAGE_FORMAT");
+ QCString imgName = baseName+"."+imgExt;
+ dotArgs.sprintf("-T%s \"%s.dot\" -o \"%s\"",
+ imgExt.data(),baseName.data(),imgName.data());
if (iSystem(Config_getString("DOT_PATH")+"dot",dotArgs)!=0)
{
err("Error: Problems running dot. Check your installation!\n");
QDir::setCurrent(oldDir);
return baseName;
}
- QCString mapLabel = convertNameToFile(m_startNode->m_label+"_"+mapName);
- out << "<p><center><img src=\"" << baseName << "."
+ checkDotResult(imgName);
+ if (generateImageMap)
+ {
+ // run dot again to create an image map
+ dotArgs.sprintf("-Timap \"%s.dot\" -o \"%s.map\"",baseName.data(),baseName.data());
+ if (iSystem(Config_getString("DOT_PATH")+"dot",dotArgs)!=0)
+ {
+ err("Error: Problems running dot. Check your installation!\n");
+ QDir::setCurrent(oldDir);
+ return baseName;
+ }
+ QCString mapLabel = convertNameToFile(m_startNode->m_label+"_"+mapName);
+ out << "<p><center><img src=\"" << baseName << "."
<< imgExt << "\" border=\"0\" usemap=\"#"
<< mapLabel << "\" alt=\"";
- switch (m_graphType)
+ switch (m_graphType)
+ {
+ case DotNode::Collaboration:
+ out << "Collaboration graph";
+ break;
+ //case Interface:
+ // out << "Interface dependency graph";
+ // break;
+ case DotNode::Inheritance:
+ out << "Inheritance graph";
+ break;
+ default:
+ ASSERT(0);
+ break;
+ }
+ out << "\"></center>" << endl;
+ QString tmpstr;
+ QTextOStream tmpout(&tmpstr);
+ convertMapFile(tmpout,baseName+".map");
+ if (!tmpstr.isEmpty())
+ {
+ out << "<map name=\"" << mapLabel << "\">" << endl;
+ out << tmpstr;
+ out << "</map>" << endl;
+ }
+ thisDir.remove(baseName+".map");
+ }
+ }
+ else if (format==EPS) // run dot to create a .eps image
+ {
+ QCString dotArgs(maxCmdLine);
+ dotArgs.sprintf("-Tps \"%s.dot\" -o \"%s.eps\"",baseName.data(),baseName.data());
+ if (iSystem(Config_getString("DOT_PATH")+"dot",dotArgs)!=0)
{
- case DotNode::Collaboration:
- out << "Collaboration graph";
- break;
- //case Interface:
- // out << "Interface dependency graph";
- // break;
- case DotNode::Inheritance:
- out << "Inheritance graph";
- break;
- default:
- ASSERT(0);
- break;
+ err("Error: Problems running dot. Check your installation!\n");
+ QDir::setCurrent(oldDir);
+ return baseName;
}
- out << "\"></center>" << endl;
- QString tmpstr;
- QTextOStream tmpout(&tmpstr);
- convertMapFile(tmpout,baseName+".map");
- if (!tmpstr.isEmpty())
+ int width,height;
+ if (!readBoundingBoxEPS(baseName+".eps",&width,&height))
{
- out << "<map name=\"" << mapLabel << "\">" << endl;
- out << tmpstr;
- out << "</map>" << endl;
+ err("Error: Could not extract bounding box from .eps!\n");
+ QDir::setCurrent(oldDir);
+ return baseName;
}
- thisDir.remove(baseName+".map");
- }
- }
- else if (format==EPS) // run dot to create a .eps image
- {
- QCString dotArgs(maxCmdLine);
- dotArgs.sprintf("-Tps \"%s.dot\" -o \"%s.eps\"",baseName.data(),baseName.data());
- if (iSystem(Config_getString("DOT_PATH")+"dot",dotArgs)!=0)
- {
- err("Error: Problems running dot. Check your installation!\n");
- QDir::setCurrent(oldDir);
- return baseName;
- }
- int width,height;
- if (!readBoundingBoxEPS(baseName+".eps",&width,&height))
- {
- err("Error: Could not extract bounding box from .eps!\n");
- QDir::setCurrent(oldDir);
- return baseName;
- }
- if (Config_getBool("USE_PDFLATEX"))
- {
- QCString epstopdfArgs(maxCmdLine);
- epstopdfArgs.sprintf("\"%s.eps\" --outfile=\"%s.pdf\"",
- baseName.data(),baseName.data());
- if (iSystem("epstopdf",epstopdfArgs,TRUE)!=0)
+ if (Config_getBool("USE_PDFLATEX"))
{
- err("Error: Problems running epstopdf. Check your TeX installation!\n");
- QDir::setCurrent(oldDir);
- return baseName;
+ QCString epstopdfArgs(maxCmdLine);
+ epstopdfArgs.sprintf("\"%s.eps\" --outfile=\"%s.pdf\"",
+ baseName.data(),baseName.data());
+ if (iSystem("epstopdf",epstopdfArgs,TRUE)!=0)
+ {
+ err("Error: Problems running epstopdf. Check your TeX installation!\n");
+ QDir::setCurrent(oldDir);
+ return baseName;
+ }
}
+ int maxWidth = 420; /* approx. page width in points */
+
+ out << "\\begin{figure}[H]\n"
+ "\\begin{center}\n"
+ "\\leavevmode\n"
+ "\\includegraphics[width=" << QMIN(width/2,maxWidth)
+ << "pt]{" << baseName << "}\n"
+ "\\end{center}\n"
+ "\\end{figure}\n";
}
- int maxWidth = 420; /* approx. page width in points */
-
- out << "\\begin{figure}[H]\n"
- "\\begin{center}\n"
- "\\leavevmode\n"
- "\\includegraphics[width=" << QMIN(width/2,maxWidth)
- << "pt]{" << baseName << "}\n"
- "\\end{center}\n"
- "\\end{figure}\n";
+ if (Config_getBool("DOT_CLEANUP")) thisDir.remove(baseName+".dot");
}
- if (Config_getBool("DOT_CLEANUP")) thisDir.remove(baseName+".dot");
QDir::setCurrent(oldDir);
return baseName;
@@ -1763,101 +1851,103 @@ QCString DotInclDepGraph::writeGraph(QTextStream &out,
QCString mapName=m_startNode->m_label.copy();
if (m_inverse) mapName+="dep";
- findMaximalDotGraph(m_startNode,QMIN(m_recDepth,m_maxDistance),
+ if (findMaximalDotGraph(m_startNode,QMIN(m_recDepth,m_maxDistance),
baseName,thisDir,DotNode::Dependency,format,
- FALSE,FALSE,!m_inverse);
-
- if (format==BITMAP)
+ FALSE,FALSE,!m_inverse)
+ )
{
- // run dot to create a bitmap image
- QCString dotArgs(maxCmdLine);
- QCString imgExt = Config_getEnum("DOT_IMAGE_FORMAT");
- QCString imgName=baseName+"."+imgExt;
- dotArgs.sprintf("-T%s \"%s.dot\" -o \"%s\"",
- imgExt.data(),baseName.data(),imgName.data());
- if (iSystem(Config_getString("DOT_PATH")+"dot",dotArgs)!=0)
- {
- err("Problems running dot. Check your installation!\n");
- QDir::setCurrent(oldDir);
- return baseName;
- }
- checkDotResult(imgName);
-
- if (generateImageMap)
+ if (format==BITMAP)
{
- // run dot again to create an image map
- dotArgs.sprintf("-Timap \"%s.dot\" -o \"%s.map\"",
- baseName.data(),baseName.data());
+ // run dot to create a bitmap image
+ QCString dotArgs(maxCmdLine);
+ QCString imgExt = Config_getEnum("DOT_IMAGE_FORMAT");
+ QCString imgName=baseName+"."+imgExt;
+ dotArgs.sprintf("-T%s \"%s.dot\" -o \"%s\"",
+ imgExt.data(),baseName.data(),imgName.data());
if (iSystem(Config_getString("DOT_PATH")+"dot",dotArgs)!=0)
{
err("Problems running dot. Check your installation!\n");
QDir::setCurrent(oldDir);
return baseName;
}
+ checkDotResult(imgName);
- out << "<p><center><img src=\"" << baseName << "."
+ if (generateImageMap)
+ {
+ // run dot again to create an image map
+ dotArgs.sprintf("-Timap \"%s.dot\" -o \"%s.map\"",
+ baseName.data(),baseName.data());
+ if (iSystem(Config_getString("DOT_PATH")+"dot",dotArgs)!=0)
+ {
+ err("Problems running dot. Check your installation!\n");
+ QDir::setCurrent(oldDir);
+ return baseName;
+ }
+
+ out << "<p><center><img src=\"" << baseName << "."
<< imgExt << "\" border=\"0\" usemap=\"#"
<< mapName << "_map\" alt=\"";
- if (m_inverse) out << "Included by dependency graph"; else out << "Include dependency graph";
- out << "\">";
- out << "</center>" << endl;
- QString tmpstr;
- QTextOStream tmpout(&tmpstr);
- convertMapFile(tmpout,baseName+".map");
- if (!tmpstr.isEmpty())
- {
- out << "<map name=\"" << mapName << "_map\">" << endl;
- out << tmpstr;
- out << "</map>" << endl;
+ if (m_inverse) out << "Included by dependency graph"; else out << "Include dependency graph";
+ out << "\">";
+ out << "</center>" << endl;
+ QString tmpstr;
+ QTextOStream tmpout(&tmpstr);
+ convertMapFile(tmpout,baseName+".map");
+ if (!tmpstr.isEmpty())
+ {
+ out << "<map name=\"" << mapName << "_map\">" << endl;
+ out << tmpstr;
+ out << "</map>" << endl;
+ }
+ thisDir.remove(baseName+".map");
}
- thisDir.remove(baseName+".map");
}
- }
- else if (format==EPS)
- {
- // run dot to create a .eps image
- QCString dotArgs(maxCmdLine);
- dotArgs.sprintf("-Tps \"%s.dot\" -o \"%s.eps\"",
- baseName.data(),baseName.data());
- if (iSystem(Config_getString("DOT_PATH")+"dot",dotArgs)!=0)
+ else if (format==EPS)
{
- err("Problems running dot. Check your installation!\n");
- QDir::setCurrent(oldDir);
- return baseName;
- }
- int width,height;
- if (!readBoundingBoxEPS(baseName+".eps",&width,&height))
- {
- err("Error: Could not extract bounding box from .eps!\n");
- QDir::setCurrent(oldDir);
- return baseName;
- }
- if (Config_getBool("USE_PDFLATEX"))
- {
- QCString epstopdfArgs(maxCmdLine);
- epstopdfArgs.sprintf("\"%s.eps\" --outfile=\"%s.pdf\"",
- baseName.data(),baseName.data());
- if (iSystem("epstopdf",epstopdfArgs,TRUE)!=0)
+ // run dot to create a .eps image
+ QCString dotArgs(maxCmdLine);
+ dotArgs.sprintf("-Tps \"%s.dot\" -o \"%s.eps\"",
+ baseName.data(),baseName.data());
+ if (iSystem(Config_getString("DOT_PATH")+"dot",dotArgs)!=0)
{
- err("Error: Problems running epstopdf. Check your TeX installation!\n");
- QDir::setCurrent(oldDir);
- return baseName;
+ err("Problems running dot. Check your installation!\n");
+ QDir::setCurrent(oldDir);
+ return baseName;
+ }
+ int width,height;
+ if (!readBoundingBoxEPS(baseName+".eps",&width,&height))
+ {
+ err("Error: Could not extract bounding box from .eps!\n");
+ QDir::setCurrent(oldDir);
+ return baseName;
+ }
+ if (Config_getBool("USE_PDFLATEX"))
+ {
+ QCString epstopdfArgs(maxCmdLine);
+ epstopdfArgs.sprintf("\"%s.eps\" --outfile=\"%s.pdf\"",
+ baseName.data(),baseName.data());
+ if (iSystem("epstopdf",epstopdfArgs,TRUE)!=0)
+ {
+ err("Error: Problems running epstopdf. Check your TeX installation!\n");
+ QDir::setCurrent(oldDir);
+ return baseName;
+ }
}
+ int maxWidth = 420; /* approx. page width in points */
+
+ out << "\\begin{figure}[H]\n"
+ "\\begin{center}\n"
+ "\\leavevmode\n"
+ //"\\setlength{\\epsfxsize}{" << QMIN(width/2,maxWidth) << "pt}\n"
+ //"\\epsfbox{" << baseName << ".eps}\n"
+ "\\includegraphics[width=" << QMIN(width/2,maxWidth)
+ << "pt]{" << baseName << "}\n"
+ "\\end{center}\n"
+ "\\end{figure}\n";
}
- int maxWidth = 420; /* approx. page width in points */
-
- out << "\\begin{figure}[H]\n"
- "\\begin{center}\n"
- "\\leavevmode\n"
- //"\\setlength{\\epsfxsize}{" << QMIN(width/2,maxWidth) << "pt}\n"
- //"\\epsfbox{" << baseName << ".eps}\n"
- "\\includegraphics[width=" << QMIN(width/2,maxWidth)
- << "pt]{" << baseName << "}\n"
- "\\end{center}\n"
- "\\end{figure}\n";
- }
- if (Config_getBool("DOT_CLEANUP")) thisDir.remove(baseName+".dot");
+ if (Config_getBool("DOT_CLEANUP")) thisDir.remove(baseName+".dot");
+ }
QDir::setCurrent(oldDir);
return baseName;
diff --git a/src/dot.h b/src/dot.h
index 1723e36..6f89200 100644
--- a/src/dot.h
+++ b/src/dot.h
@@ -99,14 +99,16 @@ class DotNode
friend class DotNodeList;
friend class DotCallGraph;
friend void writeDotGraph(
- DotNode *root,
- GraphType gt,
- GraphOutputFormat f,
- const QCString &baseName,
- bool lrRank,
- bool renderParents,
- int distance,
- bool backArrow
+ DotNode *root, GraphType gt,
+ GraphOutputFormat f, const QCString &baseName,
+ bool lrRank, bool renderParents,
+ int distance, bool backArrows
+ );
+ friend QCString computeMd5Signature(
+ DotNode *root, GraphType gt,
+ GraphOutputFormat f,
+ bool lrRank, bool renderParents,
+ int distance, bool backArrows
);
};
diff --git a/src/doxygen.pro.in b/src/doxygen.pro.in
index d397106..8469a12 100644
--- a/src/doxygen.pro.in
+++ b/src/doxygen.pro.in
@@ -18,18 +18,18 @@ TEMPLATE = app.t
CONFIG = console warn_on $extraopts
HEADERS = doxygen.h
SOURCES = main.cpp
-unix:LIBS += -L../lib -ldoxygen -ldoxycfg -lqtools -lpng
+unix:LIBS += -L../lib -ldoxygen -ldoxycfg -lqtools -lpng -lmd5
win32:INCLUDEPATH += .
-win32-mingw:LIBS += -L../lib -ldoxygen -ldoxycfg -lqtools -lpng
-win32-msvc:LIBS += qtools.lib png.lib doxygen.lib doxycfg.lib shell32.lib
+win32-mingw:LIBS += -L../lib -ldoxygen -ldoxycfg -lqtools -lpng -lmd5
+win32-msvc:LIBS += qtools.lib png.lib md5.lib doxygen.lib doxycfg.lib shell32.lib
win32-msvc:TMAKE_LFLAGS += /LIBPATH:..\lib
-win32-borland:LIBS += qtools.lib png.lib doxygen.lib doxycfg.lib shell32.lib
+win32-borland:LIBS += qtools.lib png.lib md5.lib doxygen.lib doxycfg.lib shell32.lib
win32-borland:TMAKE_LFLAGS += -L..\lib -L$(BCB)\lib\psdk
win32:TMAKE_CXXFLAGS += -DQT_NODLL
-win32-g++:LIBS = -L../lib -ldoxygen -ldoxycfg -lqtools -lpng
+win32-g++:LIBS = -L../lib -ldoxygen -ldoxycfg -lqtools -lpng -lmd5
win32-g++:TMAKE_CXXFLAGS += -fno-exceptions -fno-rtti
-INCLUDEPATH += ../qtools ../libpng .
-win32-g++:INCLUDEPATH -= ../libpng
+INCLUDEPATH += ../qtools ../libpng ../libmd5 .
+#win32-g++:INCLUDEPATH -= ../libpng
DESTDIR = ../bin
TARGET = doxygen
unix:TARGETDEPS = ../lib/libdoxygen.a ../lib/libdoxycfg.a
diff --git a/src/htmlgen.cpp b/src/htmlgen.cpp
index 99bb708..3a260a2 100644
--- a/src/htmlgen.cpp
+++ b/src/htmlgen.cpp
@@ -1412,7 +1412,7 @@ void HtmlGenerator::writeSearchPage()
writeDefaultQuickLinks(t,TRUE,HLI_Search);
}
- t << "<?php \n\n";
+ t << "\n<?php\n\n";
t << "function search_results()\n";
t << "{\n";
t << " return \"" << theTranslator->trSearchResultsTitle() << "\";\n";
diff --git a/src/index.cpp b/src/index.cpp
index 766bd80..831512b 100644
--- a/src/index.cpp
+++ b/src/index.cpp
@@ -1011,11 +1011,11 @@ void writeFileIndex(OutputList &ol)
ol.endBold();
if (hasHtmlHelp)
{
- htmlHelp->addContentsItem(FALSE,fd->name(),0);
+ htmlHelp->addContentsItem(FALSE,fullName,0);
}
if (hasFtvHelp)
{
- ftvHelp->addContentsItem(FALSE,0,0,0,fd->name());
+ ftvHelp->addContentsItem(FALSE,0,0,0,fullName);
}
}
if (src)
diff --git a/src/latexdocvisitor.cpp b/src/latexdocvisitor.cpp
index 1a6c889..f4ff312 100644
--- a/src/latexdocvisitor.cpp
+++ b/src/latexdocvisitor.cpp
@@ -249,12 +249,12 @@ void LatexDocVisitor::visit(DocVerbatim *s)
case DocVerbatim::Code:
m_t << "\n\n\\footnotesize\\begin{verbatim}";
parseCode(m_ci,s->context(),s->text().latin1(),s->isExample(),s->exampleFile());
- m_t << "\\end{verbatim}\\normalsize" << endl;
+ m_t << "\\end{verbatim}\n\\normalsize" << endl;
break;
case DocVerbatim::Verbatim:
m_t << "\n\n\\footnotesize\\begin{verbatim}";
m_t << s->text();
- m_t << "\\end{verbatim}\\normalsize" << endl;
+ m_t << "\\end{verbatim}\n\\normalsize" << endl;
break;
case DocVerbatim::HtmlOnly:
case DocVerbatim::XmlOnly:
@@ -310,7 +310,7 @@ void LatexDocVisitor::visit(DocInclude *inc)
case DocInclude::Include:
m_t << "\n\n\\footnotesize\\begin{verbatim}";
parseCode(m_ci,inc->context(),inc->text().latin1(),inc->isExample(),inc->exampleFile());
- m_t << "\\end{verbatim}\\normalsize" << endl;
+ m_t << "\\end{verbatim}\n\\normalsize" << endl;
break;
case DocInclude::DontInclude:
break;
@@ -319,7 +319,7 @@ void LatexDocVisitor::visit(DocInclude *inc)
case DocInclude::VerbInclude:
m_t << "\n\n\\footnotesize\\begin{verbatim}";
m_t << inc->text();
- m_t << "\\end{verbatim}\\normalsize" << endl;
+ m_t << "\\end{verbatim}\n\\normalsize" << endl;
break;
}
}
@@ -344,7 +344,7 @@ void LatexDocVisitor::visit(DocIncOperator *op)
if (op->isLast())
{
popEnabled();
- if (!m_hide) m_t << "\\end{verbatim}\\normalsize" << endl;
+ if (!m_hide) m_t << "\\end{verbatim}\n\\normalsize" << endl;
}
else
{
diff --git a/src/libdoxygen.pro.in b/src/libdoxygen.pro.in
index 630a39e..53b3341 100644
--- a/src/libdoxygen.pro.in
+++ b/src/libdoxygen.pro.in
@@ -186,6 +186,7 @@ win32-msvc:TMAKE_CXXFLAGS += -Zm200
win32-g++:TMAKE_CXXFLAGS += -fno-exceptions -fno-rtti
INCLUDEPATH += ../qtools
INCLUDEPATH += ../libpng
+INCLUDEPATH += ../libmd5
win32:INCLUDEPATH += .
win32-g++:INCLUDEPATH = ../qtools /usr/include/libpng12
DESTDIR = ../lib
diff --git a/src/mandocvisitor.cpp b/src/mandocvisitor.cpp
index f7f8c84..648d3b7 100644
--- a/src/mandocvisitor.cpp
+++ b/src/mandocvisitor.cpp
@@ -436,6 +436,7 @@ void ManDocVisitor::visitPre(DocSimpleList *)
{
if (m_hide) return;
m_indent+=2;
+ m_t << ".PD 0" << endl;
}
void ManDocVisitor::visitPost(DocSimpleList *)
@@ -482,6 +483,7 @@ void ManDocVisitor::visitPre(DocHtmlList *)
{
if (m_hide) return;
m_indent+=2;
+ m_t << ".PD 0" << endl;
}
void ManDocVisitor::visitPost(DocHtmlList *)
diff --git a/src/rtfdocvisitor.cpp b/src/rtfdocvisitor.cpp
index 36521ca..4ef5e49 100644
--- a/src/rtfdocvisitor.cpp
+++ b/src/rtfdocvisitor.cpp
@@ -1221,8 +1221,9 @@ void RTFDocVisitor::writeDotFile(const QString &fileName)
m_t << "{" << endl;
m_t << rtf_Style_Reset << endl;
m_t << "\\par\\pard \\qc {\\field\\flddirty {\\*\\fldinst INCLUDEPICTURE ";
- m_t << outDir << "\\" << baseName;
+ m_t << baseName << "." << Config_getEnum("DOT_IMAGE_FORMAT");
m_t << " \\\\d \\\\*MERGEFORMAT}{\\fldrslt IMAGE}}\\par" << endl;
m_t << "}" << endl;
}
+
diff --git a/src/scanner.l b/src/scanner.l
index ae63c72..d70ad39 100644
--- a/src/scanner.l
+++ b/src/scanner.l
@@ -159,6 +159,9 @@ static QCString xrefItemTitle;
static QCString xrefListTitle;
static QCString g_skipBlockName;
+static QCString oldStyleArgType;
+static QCString docBackup;
+static QCString briefBackup;
//-----------------------------------------------------------------------------
@@ -475,6 +478,58 @@ static void prependScope()
}
}
+/*! Returns TRUE iff the current entry could be a K&R style C function */
+static bool checkForKnRstyleC()
+{
+ if (((QCString)yyFileName).right(2)!=".c") return FALSE; // must be a C file
+ if (!current->argList) return FALSE;
+ ArgumentListIterator ali(*current->argList);
+ Argument *a;
+ for (ali.toFirst();(a=ali.current());++ali)
+ {
+ // in K&R style argument do not have a type, but doxygen expects a type
+ // so it will think the argument has no name
+ if (a->type.isEmpty() || !a->name.isEmpty()) return FALSE;
+ }
+ return TRUE;
+}
+
+/*! Update the argument \a name with additional \a type info. For K&R style
+ * function the type is found \e after the argument list, so this routine
+ * in needed to fix up.
+ */
+void addKnRArgInfo(const QCString &type,const QCString &name,
+ const QCString &brief,const QCString &docs)
+{
+ if (current->argList==0) return;
+ ArgumentListIterator ali(*current->argList);
+ Argument *a;
+ for (ali.toFirst();(a=ali.current());++ali)
+ {
+ if (a->type==name)
+ {
+ a->type=type.stripWhiteSpace();
+ if (a->type.left(9)=="register ") // strip keyword
+ {
+ a->type=a->type.mid(9);
+ }
+ a->name=name.stripWhiteSpace();
+ if (!brief.isEmpty() && !docs.isEmpty())
+ {
+ a->docs=brief+"\n\n"+docs;
+ }
+ else if (!brief.isEmpty())
+ {
+ a->docs=brief;
+ }
+ else
+ {
+ a->docs=docs;
+ }
+ }
+ }
+}
+
/* ----------------------------------------------------------------- */
#undef YY_INPUT
#define YY_INPUT(buf,result,max_size) result=yyread(buf,max_size);
@@ -662,6 +717,7 @@ PHPKW ("require"|"require_once"|"include"|"include_once"|"echo")[^a-zA-Z0-9_;]
%x PreLineCtrl
%x DefinePHP
%x DefinePHPEnd
+%x OldStyleArgs
%%
@@ -1510,7 +1566,7 @@ PHPKW ("require"|"require_once"|"include"|"include_once"|"echo")[^a-zA-Z0-9_;]
<FindMembers>[*&]+ { current->name += yytext ;
addType( current );
}
-<FindMembers,MemberSpec,Function,NextSemi,BitFields,ReadInitializer>";"{BN}*("/**"|"//!"|"/*!"|"///")"<" {
+<FindMembers,MemberSpec,Function,NextSemi,BitFields,ReadInitializer,OldStyleArgs>";"{BN}*("/**"|"//!"|"/*!"|"///")"<" {
lineCount();
if (current->bodyLine==-1)
current->bodyLine=yyLineNr;
@@ -1540,7 +1596,7 @@ PHPKW ("require"|"require_once"|"include"|"include_once"|"echo")[^a-zA-Z0-9_;]
BEGIN(AfterDoc);
}
}
-<MemberSpec,FindFields,FindMembers,NextSemi,BitFields,ReadInitializer>","{BN}*("/**"|"//!"|"/*!"|"///")"<" {
+<MemberSpec,FindFields,FindMembers,NextSemi,BitFields,ReadInitializer,OldStyleArgs>","{BN}*("/**"|"//!"|"/*!"|"///")"<" {
lineCount();
lastAfterDocContext = YY_START;
afterDocTerminator = ',';
@@ -1568,7 +1624,7 @@ PHPKW ("require"|"require_once"|"include"|"include_once"|"echo")[^a-zA-Z0-9_;]
BEGIN(AfterDoc);
}
}
-<DefineEnd,FindFields,FindFieldArg,ReadInitializer>{BN}*("/**"|"//!"|"/*!"|"///")"<" {
+<DefineEnd,FindFields,FindFieldArg,ReadInitializer,OldStyleArgs>{BN}*("/**"|"//!"|"/*!"|"///")"<" {
lineCount();
lastAfterDocContext = YY_START;
if (YY_START==DefineEnd)
@@ -2351,6 +2407,15 @@ PHPKW ("require"|"require_once"|"include"|"include_once"|"echo")[^a-zA-Z0-9_;]
*copyArgString+=*yytext;
fullArgString+=*yytext;
stringToArgumentList(fullArgString,current->argList);
+
+ /* remember the current documentation block, since
+ we could overwrite it with the documentation of
+ a function argument, which we then have to correct later
+ on
+ */
+ docBackup = current->doc.copy();
+ briefBackup = current->brief.copy();
+
BEGIN( currentArgumentContext );
}
/* a special comment */
@@ -2536,7 +2601,9 @@ PHPKW ("require"|"require_once"|"include"|"include_once"|"echo")[^a-zA-Z0-9_;]
}
*/
<FuncQual>[{:;,] {
- if ( strcmp(yytext,";")==0 && insidePHP && current->type.left(8) != "function" )
+ if ( strcmp(yytext,";")==0 &&
+ insidePHP &&
+ current->type.left(8) != "function" )
{
current->reset();
initEntry();
@@ -2547,17 +2614,17 @@ PHPKW ("require"|"require_once"|"include"|"include_once"|"echo")[^a-zA-Z0-9_;]
unput(*yytext); BEGIN( Function );
}
}
-<FuncQual>{BN}*"const"{BN}* {
+<FuncQual>{BN}*"const"{BN}* { // const member function
lineCount() ;
current->args += " const ";
current->argList->constSpecifier=TRUE;
}
-<FuncQual>{BN}*"volatile"{BN}* {
+<FuncQual>{BN}*"volatile"{BN}* { // volatile member function
lineCount() ;
current->args += " volatile ";
current->argList->volatileSpecifier=TRUE;
}
-<FuncQual>{BN}*"="{BN}*"0"{BN}* {
+<FuncQual>{BN}*"="{BN}*"0"{BN}* { // pure virtual member function
lineCount() ;
current->args += " = 0";
current->virt = Pure;
@@ -2576,6 +2643,82 @@ PHPKW ("require"|"require_once"|"include"|"include_once"|"echo")[^a-zA-Z0-9_;]
lastCPPContext = YY_START;
BEGIN(SkipCPP);
}
+<FuncQual>"=" { // typically a initialized function pointer
+ current->args += *yytext;
+ }
+<FuncQual>{ID} { // typically a K&R style C function
+ if (checkForKnRstyleC())
+ {
+ fprintf(stderr,"===> got a K&R style function\n");
+ current->args = yytext;
+ oldStyleArgType.resize(0);
+ BEGIN(OldStyleArgs);
+ }
+ else
+ {
+ current->args += yytext;
+ }
+ }
+<OldStyleArgs>[,;] {
+ QCString oldStyleArgPtr;
+ QCString oldStyleArgName;
+ if (oldStyleArgType.isEmpty())
+ {
+ int l=current->args.length(),i=l-1,j;
+ char c;
+ while (i>=0 && isId(current->args.at(i))) i--;
+ j=i+1;
+ while (i>=0 && ((c=current->args.at(i))=='*' || isspace(c))) i--;
+ i++;
+ if (i!=l)
+ {
+ oldStyleArgType=current->args.left(i);
+ oldStyleArgPtr=current->args.mid(i,j-i);
+ oldStyleArgName=current->args.mid(j).stripWhiteSpace();
+ }
+ else
+ {
+ oldStyleArgName=current->args.copy().stripWhiteSpace();
+ }
+ }
+ else
+ {
+ int l=current->args.length(),j=0;
+ char c;
+ while (j<l && ((c=current->args.at(j))=='*' || isspace(c))) j++;
+ if (j>0)
+ {
+ oldStyleArgPtr=current->args.left(j);
+ oldStyleArgName=current->args.mid(j).stripWhiteSpace();
+ }
+ else
+ {
+ oldStyleArgName=current->args.copy().stripWhiteSpace();
+ }
+ }
+ fprintf(stderr,"type=%s ptr=%s name=%s\n",oldStyleArgType.data(),oldStyleArgPtr.data(),oldStyleArgName.data());
+ QCString doc,brief;
+ if (current->doc!=docBackup)
+ {
+ doc=current->doc.copy();
+ current->doc=docBackup;
+ }
+ if (current->brief!=briefBackup)
+ {
+ brief=current->brief.copy();
+ current->brief=briefBackup;
+ }
+ addKnRArgInfo(oldStyleArgType+oldStyleArgPtr,oldStyleArgName,brief,doc);
+ current->args.resize(0);
+ if (*yytext==';') oldStyleArgType.resize(0);
+ }
+<OldStyleArgs>{ID} { current->args += yytext; }
+<OldStyleArgs>"{" {
+ current->args = argListToString(current->argList);
+ unput('{');
+ BEGIN(FuncQual);
+ }
+<OldStyleArgs>. { current->args += *yytext; }
<FuncQual,FuncRound,FuncFunc>. { current->args += *yytext; }
<FuncQual>{BN}*"try"{BN}+ { /* try-function-block */
insideTryBlock=TRUE;
@@ -3140,7 +3283,7 @@ PHPKW ("require"|"require_once"|"include"|"include_once"|"echo")[^a-zA-Z0-9_;]
}
<Comment>. { current->program += *yytext ; }
-<FindMembers,FindFields,MemberSpec,FuncQual,SkipCurly,Operator,ClassVar,SkipInits,Bases>("//"{B}*)?"/*!" {
+<FindMembers,FindFields,MemberSpec,FuncQual,SkipCurly,Operator,ClassVar,SkipInits,Bases,OldStyleArgs>("//"{B}*)?"/*!" {
//printf("Start doc block at %d\n",yyLineNr);
removeSlashes=(yytext[1]=='/');
tmpDocType=-1;
@@ -3161,7 +3304,7 @@ PHPKW ("require"|"require_once"|"include"|"include_once"|"echo")[^a-zA-Z0-9_;]
}
BEGIN( Doc );
}
-<FindMembers,FindFields,MemberSpec,FuncQual,SkipCurly,Operator,ClassVar,SkipInits,Bases>("//"{B}*)?"/**"/[^/*] {
+<FindMembers,FindFields,MemberSpec,FuncQual,SkipCurly,Operator,ClassVar,SkipInits,Bases,OldStyleArgs>("//"{B}*)?"/**"/[^/*] {
removeSlashes=(yytext[1]=='/');
lastDocContext = YY_START;
//printf("Found comment block at %s:%d\n",yyFileName,yyLineNr);
@@ -3212,7 +3355,7 @@ PHPKW ("require"|"require_once"|"include"|"include_once"|"echo")[^a-zA-Z0-9_;]
}
}
}
-<FindMembers,FindFields,MemberSpec,SkipCurly,FuncQual,Operator,ClassVar,Bases>"//!" {
+<FindMembers,FindFields,MemberSpec,SkipCurly,FuncQual,Operator,ClassVar,Bases,OldStyleArgs>"//!" {
if (YY_START!=SkipCurly)
{
current->brief.resize(0);
@@ -3231,7 +3374,7 @@ PHPKW ("require"|"require_once"|"include"|"include_once"|"echo")[^a-zA-Z0-9_;]
}
BEGIN( LineDoc );
}
-<FindMembers,FindFields,MemberSpec,SkipCurly,FuncQual,Operator,ClassVar,Bases>"///"/[^/] {
+<FindMembers,FindFields,MemberSpec,SkipCurly,FuncQual,Operator,ClassVar,Bases,OldStyleArgs>"///"/[^/] {
if (YY_START!=SkipCurly)
{
current->brief.resize(0);
@@ -4367,13 +4510,15 @@ PHPKW ("require"|"require_once"|"include"|"include_once"|"echo")[^a-zA-Z0-9_;]
}
}
<SkipSection>"*/" {
- unput('/');unput('*');
- BEGIN( lastIfContext );
+ BEGIN( SkipSection );
+ }
+<SkipSection>"/*!" {
+ BEGIN( SkipSection );
}
<SkipSection>\n {
yyLineNr++;
}
-<SkipSection>"//"|"*/"
+<SkipSection>"//"|"*/"
<ClassDoc,ClassDocBrief,LineDoc,AfterDocLine,AfterDocBrief,Doc,JavaDoc,AfterDoc,PageDoc,ExampleDoc>{CMD}"elseif"/[^a-z_A-Z0-9] {
// previous section enabled => skip now
depthIf=1;
diff --git a/src/search.php b/src/search.php
index 29bbc7a..7075ea3 100644
--- a/src/search.php
+++ b/src/search.php
@@ -193,6 +193,10 @@ function filter_results($docs,&$requiredWords,&$forbiddenWords)
function compare_rank($a,$b)
{
+ if ($a["rank"] == $b["rank"])
+ {
+ return 0;
+ }
return ($a["rank"]>$b["rank"]) ? -1 : 1;
}
diff --git a/src/search_php.h b/src/search_php.h
index 7f24842..4213b19 100644
--- a/src/search_php.h
+++ b/src/search_php.h
@@ -193,6 +193,10 @@
"\n"
"function compare_rank($a,$b)\n"
"{\n"
+" if ($a[\"rank\"] == $b[\"rank\"]) \n"
+" {\n"
+" return 0;\n"
+" }\n"
" return ($a[\"rank\"]>$b[\"rank\"]) ? -1 : 1; \n"
"}\n"
"\n"
diff --git a/src/translator_kr.h b/src/translator_kr.h
index bdf1e5e..f94dcb6 100644
--- a/src/translator_kr.h
+++ b/src/translator_kr.h
@@ -26,7 +26,7 @@
#ifndef TRANSLATOR_KR_H
#define TRANSLATOR_KR_H
-class TranslatorKorean : public TranslatorAdapter_1_3
+class TranslatorKorean : public Translator
{
public: