From c0b0e4b86db9d2bd699ce2bcd0bca479167a76a6 Mon Sep 17 00:00:00 2001 From: dimitri Date: Wed, 9 Nov 2005 21:17:04 +0000 Subject: Release-1.4.5-20051109 --- INSTALL | 4 ++-- README | 4 ++-- VERSION | 2 +- src/commentscan.l | 4 ---- src/config.l | 4 ++-- src/dirdef.cpp | 48 ++++++++++++++++++++++++++++++----------- src/doxygen.cpp | 24 ++++++++++++++------- src/htmlgen.cpp | 19 ++++++++++------- src/index.cpp | 61 ++++++++++++++++++++++++++++++----------------------- src/memberdef.cpp | 5 ++++- src/scanner.l | 17 +++++++-------- src/translator_jp.h | 2 +- src/util.cpp | 50 ++++++++++++++++++++++++++++++++++++++++++- src/util.h | 14 ++++++++++++ 14 files changed, 181 insertions(+), 77 deletions(-) diff --git a/INSTALL b/INSTALL index a267c4e..513c952 100644 --- a/INSTALL +++ b/INSTALL @@ -1,7 +1,7 @@ -DOXYGEN Version 1.4.5-20051024 +DOXYGEN Version 1.4.5-20051109 Please read the installation section of the manual (http://www.doxygen.org/install.html) for instructions. -------- -Dimitri van Heesch (24 October 2005) +Dimitri van Heesch (09 November 2005) diff --git a/README b/README index 521e50f..7b3b640 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -DOXYGEN Version 1.4.5_20051024 +DOXYGEN Version 1.4.5_20051109 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) (24 October 2005) +Dimitri van Heesch (dimitri@stack.nl) (09 November 2005) diff --git a/VERSION b/VERSION index 17af46e..08c1674 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.4.5-20051024 +1.4.5-20051109 diff --git a/src/commentscan.l b/src/commentscan.l index e5830df..76f50f1 100644 --- a/src/commentscan.l +++ b/src/commentscan.l @@ -959,20 +959,17 @@ MAILADR [a-z_A-Z0-9.+\-]+"@"[a-z_A-Z0-9\-]+("."[a-z_A-Z0-9\-]+)+[a-z_A-Z0-9\-] {CMD}"f$" { // end of inline formula formulaText+="$"; addOutput(addFormula()); - addOutput(' '); BEGIN(Comment); } {CMD}"f]" { // end of block formula formulaText+="\\]"; addOutput(addFormula()); - addOutput(' '); BEGIN(Comment); } {CMD}"f}" { // end of custom env formula formulaText+="\\end"; formulaText+=formulaEnv; addOutput(addFormula()); - addOutput(' '); BEGIN(Comment); } [^\\@\n]+ { // any non-special character @@ -1636,7 +1633,6 @@ MAILADR [a-z_A-Z0-9.+\-]+"@"[a-z_A-Z0-9\-]+("."[a-z_A-Z0-9\-]+)+[a-z_A-Z0-9\-] { if (*yytext=='\n') yyLineNr++; addOutput('\n'); - printf("functionProto=%s\n",functionProto.data()); langParser->parsePrototype(functionProto); BEGIN( Comment ); } diff --git a/src/config.l b/src/config.l index 4860177..7298baa 100644 --- a/src/config.l +++ b/src/config.l @@ -1734,8 +1734,8 @@ void Config::create() "SHOW_DIRECTORIES", "If the sources in your project are distributed over multiple directories \n" "then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy \n" - "in the documentation. The default is YES.\n", - TRUE + "in the documentation. The default is NO.\n", + FALSE ); cs = addString( "FILE_VERSION_FILTER", "The FILE_VERSION_FILTER tag can be used to specify a program or script that \n" diff --git a/src/dirdef.cpp b/src/dirdef.cpp index 8452f0b..286f527 100644 --- a/src/dirdef.cpp +++ b/src/dirdef.cpp @@ -227,7 +227,13 @@ void DirDef::writeDocumentation(OutputList &ol) if (!dd->briefDescription().isEmpty() && Config_getBool("BRIEF_MEMBER_DESC")) { ol.startMemberDescription(); - ol.parseDoc(briefFile(),briefLine(),dd,0,dd->briefDescription(),FALSE,FALSE); + ol.parseDoc(briefFile(),briefLine(),dd,0,dd->briefDescription(), + FALSE, // indexWords + FALSE, // isExample + 0, // exampleName + FALSE, // single line + TRUE // link from index + ); ol.endMemberDescription(); ol.newParagraph(); } @@ -280,7 +286,13 @@ void DirDef::writeDocumentation(OutputList &ol) if (!fd->briefDescription().isEmpty() && Config_getBool("BRIEF_MEMBER_DESC")) { ol.startMemberDescription(); - ol.parseDoc(briefFile(),briefLine(),fd,0,fd->briefDescription(),FALSE,FALSE); + ol.parseDoc(briefFile(),briefLine(),fd,0,fd->briefDescription(), + FALSE, // indexWords + FALSE, // isExample + 0, // exampleName + FALSE, // single line + TRUE // link from index + ); ol.endMemberDescription(); ol.newParagraph(); } @@ -354,8 +366,12 @@ void DirDef::addUsesDependency(DirDef *dir,FileDef *srcFd, FileDef *dstFd,bool inherited) { if (this==dir) return; // do not add self-dependencies - //printf(" > add dependency %s->%s due to %s\n",shortName().data(), - // dir->shortName().data(),fd->name().data()); + //static int count=0; + //printf(" %d add dependency %s->%s due to %s->%s\n", + // count++,shortName().data(), + // dir->shortName().data(), + // srcFd->name().data(), + // dstFd->name().data()); // levels match => add direct dependency bool added=FALSE; @@ -383,15 +399,18 @@ void DirDef::addUsesDependency(DirDef *dir,FileDef *srcFd, m_usedDirs->insert(dir->getOutputFileBase(),usedDir); added=TRUE; } - if (added && dir->parent()) + if (added) { - // add relation to parent of used dir - addUsesDependency(dir->parent(),srcFd,dstFd,inherited); - } - if (parent()) - { - // add relation for the parent of this dir as well - parent()->addUsesDependency(dir,srcFd,dstFd,TRUE); + if (dir->parent()) + { + // add relation to parent of used dir + addUsesDependency(dir->parent(),srcFd,dstFd,inherited); + } + if (parent()) + { + // add relation for the parent of this dir as well + parent()->addUsesDependency(dir,srcFd,dstFd,TRUE); + } } } @@ -406,6 +425,7 @@ void DirDef::computeDependencies() FileDef *fd; for (fli.toFirst();(fd=fli.current());++fli) // foreach file in dir dd { + //printf(" File %s\n",fd->name().data()); //printf("** dir=%s file=%s\n",shortName().data(),fd->name().data()); QList *ifl = fd->includeFileList(); if (ifl) @@ -415,12 +435,15 @@ void DirDef::computeDependencies() for (ifli.toFirst();(ii=ifli.current());++ifli) // foreach include file { //printf(" > %s\n",ii->includeName.data()); + //printf(" #include %s\n",ii->includeName.data()); if (ii->fileDef && ii->fileDef->isLinkable()) // linkable file { DirDef *usedDir = ii->fileDef->getDirDef(); if (usedDir) { // add dependency: thisDir->usedDir + //static int count=0; + //printf(" %d: add dependency %s->%s\n",count++,name().data(),usedDir->name().data()); addUsesDependency(usedDir,fd,ii->fileDef,FALSE); } } @@ -818,6 +841,7 @@ void computeDirDependencies() // compute uses dependencies between directories for (sdi.toFirst();(dir=sdi.current());++sdi) { + //printf("computeDependencies for %s: #dirs=%d\n",dir->name().data(),Doxygen::directories.count()); dir->computeDependencies(); } diff --git a/src/doxygen.cpp b/src/doxygen.cpp index 6bfedd4..0e3133d 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -1805,11 +1805,19 @@ static MemberDef *addVariableToFile( ) // variable already in the scope { - Debug::print(Debug::Variables,0, - " variable already found: scope=%s\n",md->getOuterScope()->name().data()); - addMemberDocs(root,md,def,0,FALSE); - md->setRefItems(root->sli); - return md; + if (! // not a php array + (getLanguageFromFileName(md->getFileDef()->name())==SrcLangExt_PHP) && + (md->argsString()!=root->args && root->args.find('[')!=-1) + ) + // not a php array variable + { + + Debug::print(Debug::Variables,0, + " variable already found: scope=%s\n",md->getOuterScope()->name().data()); + addMemberDocs(root,md,def,0,FALSE); + md->setRefItems(root->sli); + return md; + } } } } @@ -6789,7 +6797,7 @@ static void findMainPage(Entry *root) QCString title=root->args.stripWhiteSpace(); QCString indexName=Config_getBool("GENERATE_TREEVIEW")?"main":"index"; Doxygen::mainPage = new PageDef(root->fileName,root->startLine, - indexName, root->doc,title); + indexName, root->brief+root->doc,title); //setFileNameForSections(root->anchors,"index",Doxygen::mainPage); Doxygen::mainPage->setFileName(indexName); @@ -6983,7 +6991,7 @@ static void buildExampleList(Entry *root) else { PageDef *pd=new PageDef(root->fileName,root->startLine, - root->name,root->doc,root->args); + root->name,root->brief+root->doc,root->args); pd->setFileName(convertNameToFile(pd->name()+"-example")); pd->addSectionsToDefinition(root->anchors); //pi->addSections(root->anchors); @@ -8709,7 +8717,7 @@ void parseInput() msg("Adding todo/test/bug list items...\n"); addListReferences(); - if (Config_getBool("SHOW_DIRECTORIES")) + if (Config_getBool("SHOW_DIRECTORIES") && Config_getBool("DIRECTORY_GRAPH")) { msg("Computing dependencies between directories...\n"); computeDirDependencies(); diff --git a/src/htmlgen.cpp b/src/htmlgen.cpp index 64166e0..9ff634d 100644 --- a/src/htmlgen.cpp +++ b/src/htmlgen.cpp @@ -1693,10 +1693,13 @@ static void writeDefaultQuickLinks(QTextStream &t,bool compact, if (annotatedClasses>0) { - startQuickIndexItem(t,"annotated"+Doxygen::htmlFileExtension, - hli==HLI_Hierarchy || hli==HLI_Classes || - hli==HLI_Annotated || hli==HLI_Functions || hli==HLI_ClassVisible, - compact,first,relPath); + static bool alphaIndex=Config_getBool("ALPHABETICAL_INDEX"); + { + startQuickIndexItem(t,QCString(alphaIndex?"classes":"annotated")+Doxygen::htmlFileExtension, + hli==HLI_Hierarchy || hli==HLI_Classes || + hli==HLI_Annotated || hli==HLI_Functions || hli==HLI_ClassVisible, + compact,first,relPath); + } t << fixSpaces(theTranslator->trClasses()); endQuickIndexItem(t); } @@ -1822,10 +1825,6 @@ static void writeDefaultQuickLinks(QTextStream &t,bool compact, startQuickIndexList(t,compact); if (annotatedClasses>0) { - startQuickIndexItem(t,"annotated"+Doxygen::htmlFileExtension, - hli==HLI_Annotated,compact,first,relPath); - t << fixSpaces(theTranslator->trCompoundList()); - endQuickIndexItem(t); if (Config_getBool("ALPHABETICAL_INDEX")) { startQuickIndexItem(t,"classes"+Doxygen::htmlFileExtension, @@ -1833,6 +1832,10 @@ static void writeDefaultQuickLinks(QTextStream &t,bool compact, t << fixSpaces(theTranslator->trAlphabeticalList()); endQuickIndexItem(t); } + startQuickIndexItem(t,"annotated"+Doxygen::htmlFileExtension, + hli==HLI_Annotated,compact,first,relPath); + t << fixSpaces(theTranslator->trCompoundList()); + endQuickIndexItem(t); } if (hierarchyClasses>0) { diff --git a/src/index.cpp b/src/index.cpp index e5e3ace..ca9ff6a 100644 --- a/src/index.cpp +++ b/src/index.cpp @@ -614,9 +614,28 @@ void writeClassHierarchy(OutputList &ol) //---------------------------------------------------------------------------- -// TODO: let this function return the real number of items in the hierarchy. +static int countClassesInTreeList(const ClassSDict &cl) +{ + int count=0; + ClassSDict::Iterator cli(cl); + for (;cli.current(); ++cli) + { + ClassDef *cd=cli.current(); + if (!hasVisibleRoot(cd->baseClasses())) // filter on root classes + { + if (cd->isVisibleInHierarchy()) // should it be visible + { + count++; + } + } + } + return count; +} + int countClassHierarchy() { +#if 0 +// TODO: let this function return the real number of items in the hierarchy. initClassHierarchy(&Doxygen::classSDict); int count=0; ClassSDict::Iterator cli(Doxygen::classSDict); @@ -625,6 +644,13 @@ int countClassHierarchy() if (cli.current()->subClasses()->count()>0) count++; } return count; +#endif + int count=0; + initClassHierarchy(&Doxygen::classSDict); + initClassHierarchy(&Doxygen::hiddenClasses); + count+=countClassesInTreeList(Doxygen::classSDict); + count+=countClassesInTreeList(Doxygen::hiddenClasses); + return count; } //---------------------------------------------------------------------------- @@ -2985,7 +3011,11 @@ void writeDirTreeNode(OutputList &ol, DirDef *dd,int level) ftvHelp = FTVHelp::getInstance(); } - bool isDir = TRUE; + static bool tocExpand = Config_getBool("TOC_EXPAND"); + bool isDir = dd->subDirs().count()>0 || // there are subdirs + (tocExpand && // or toc expand and + dd->getFiles() && dd->getFiles()->count()>0 // there are files + ); //printf("gd=`%s': pageDict=%d\n",gd->name().data(),gd->pageDict->count()); if (htmlHelp) { @@ -3008,7 +3038,7 @@ void writeDirTreeNode(OutputList &ol, DirDef *dd,int level) ol.endTypewriter(); } - // write subgroups + // write sub directories if (dd->subDirs().count()>0) { startIndexHierarchy(ol,level+1); @@ -3021,29 +3051,12 @@ void writeDirTreeNode(OutputList &ol, DirDef *dd,int level) endIndexHierarchy(ol,level+1); } - if (Config_getBool("TOC_EXPAND")) + if (tocExpand) { - // write file list + // write files of this directory FileList *fileList=dd->getFiles(); if (fileList && fileList->count()>0) { - if (htmlHelp) - { - htmlHelp->addContentsItem(TRUE, - convertToHtml(theTranslator->trFile(TRUE,FALSE)), - dd->getOutputFileBase(), 0); - htmlHelp->incContentsDepth(); - } - - if (ftvHelp) - { - - ftvHelp->addContentsItem(TRUE, dd->getReference(), - dd->getOutputFileBase(), 0, - theTranslator->trFile(TRUE,FALSE)); - ftvHelp->incContentsDepth(); - } - FileDef *fd=fileList->first(); while (fd) { @@ -3053,10 +3066,6 @@ void writeDirTreeNode(OutputList &ol, DirDef *dd,int level) ftvHelp->addContentsItem(FALSE, fd->getReference(), fd->getOutputFileBase(), 0, convertToHtml(fd->name())); fd=fileList->next(); } - if (htmlHelp) - htmlHelp->decContentsDepth(); - if (ftvHelp) - ftvHelp->decContentsDepth(); } } diff --git a/src/memberdef.cpp b/src/memberdef.cpp index 15a95f5..9651e33 100644 --- a/src/memberdef.cpp +++ b/src/memberdef.cpp @@ -2039,7 +2039,10 @@ void MemberDef::setAnchor(const char *a) a=a; QCString memAnchor = name(); if (!args.isEmpty()) memAnchor+=args; - //anc = escapeAnchor(memAnchor); + + // include definition as well, to distinguish between two template + // specializations that only differ in the template parameters. + memAnchor.prepend(definition()); // convert to md5 hash uchar md5_sig[16]; diff --git a/src/scanner.l b/src/scanner.l index 4f05a10..b69690c 100644 --- a/src/scanner.l +++ b/src/scanner.l @@ -213,6 +213,7 @@ static void initEntry() // current->groups->append(new Grouping(*autoGroupStack.top())); //} initGroupInfo(current); + isTypedef=FALSE; } @@ -314,15 +315,13 @@ static bool nameIsOperator(QCString &name) static void setContext() { QCString fileName = yyFileName; - insideIDL = fileName.right(4)==".idl" || fileName.right(5)==".pidl" || - fileName.right(4)==".odl"; - insideJava = fileName.right(5)==".java" || fileName.right(3)==".as"; - insideCS = fileName.right(3)==".cs"; // for normal keywords add colon - insideD = fileName.right(2)==".d"; // for normal keywords add colon - insidePHP = fileName.right(4)==".php" || fileName.right(5)==".php4" || - fileName.right(4)==".inc" || fileName.right(6)==".phtml"; - insideObjC = fileName.right(2)==".m" || fileName.right(2)==".M" || - fileName.right(3)==".mm"; + SrcLangExt langExt = getLanguageFromFileName(fileName); + insideIDL = langExt==SrcLangExt_IDL; + insideJava = langExt==SrcLangExt_Java; + insideCS = langExt==SrcLangExt_CSharp; + insideD = langExt==SrcLangExt_D; + insidePHP = langExt==SrcLangExt_PHP; + insideObjC = langExt==SrcLangExt_ObjC; if ( insidePHP ) { useOverrideCommands = TRUE; diff --git a/src/translator_jp.h b/src/translator_jp.h index f6216df..87bc077 100644 --- a/src/translator_jp.h +++ b/src/translator_jp.h @@ -29,7 +29,7 @@ #ifndef TRANSLATOR_JP_H #define TRANSLATOR_JP_H -class TranslatorJapanese : public TranslatorAdapter_1_3_9 +class TranslatorJapanese : public Translator { private: /*! The decode() can change euc into sjis */ diff --git a/src/util.cpp b/src/util.cpp index e07536a..50e0fb3 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -4277,7 +4277,7 @@ QCString convertNameToFile(const char *name,bool allowDots) static bool shortNames = Config_getBool("SHORT_NAMES"); static bool createSubdirs = Config_getBool("CREATE_SUBDIRS"); QCString result; - if (shortNames) + if (shortNames) // use short names only { static QDict usedNames(10007); static int count=1; @@ -4298,6 +4298,16 @@ QCString convertNameToFile(const char *name,bool allowDots) else // long names { result=escapeCharsInString(name,allowDots); + int resultLen = result.length(); + if (resultLen>=128) // prevent names that cannot be created! + { + // third algorithm based on MD5 hash + uchar md5_sig[16]; + QCString sigStr(33); + MD5Buffer((const unsigned char *)result.data(),resultLen,md5_sig); + MD5SigToString(md5_sig,sigStr.data(),33); + result=result.left(128-32)+sigStr; + } } if (createSubdirs) { @@ -5648,3 +5658,41 @@ void stringToSearchIndex(const QCString &docBaseUrl,const QCString &title, } } +SrcLangExt getLanguageFromFileName(const QCString fileName) +{ + int i = fileName.findRev('.'); + static bool init=FALSE; + static QDict extLookup; + if (!init) // one time initialization + { + extLookup.insert(".idl", (void*)SrcLangExt_IDL); + extLookup.insert(".odl", (void*)SrcLangExt_IDL); + extLookup.insert(".java", (void*)SrcLangExt_Java); + extLookup.insert(".as", (void*)SrcLangExt_Java); + extLookup.insert(".cs", (void*)SrcLangExt_CSharp); + extLookup.insert(".d", (void*)SrcLangExt_D); + extLookup.insert(".php", (void*)SrcLangExt_PHP); + extLookup.insert(".php4", (void*)SrcLangExt_PHP); + extLookup.insert(".inc", (void*)SrcLangExt_PHP); + extLookup.insert(".phtml", (void*)SrcLangExt_PHP); + extLookup.insert(".m", (void*)SrcLangExt_ObjC); + extLookup.insert(".M", (void*)SrcLangExt_ObjC); + extLookup.insert(".mm", (void*)SrcLangExt_ObjC); + init=TRUE; + } + if (i!=-1) // name has an extension + { + QCString extStr=fileName.right(fileName.length()-i); + if (!extStr.isEmpty()) // non-empty extension + { + void *pVal=extLookup.find(extStr); + if (pVal) // listed extension + { + return *(SrcLangExt*)&pVal; // cast void* address to enum value + } + } + } + return SrcLangExt_Cpp; // not listed => assume C-ish language. +} + + diff --git a/src/util.h b/src/util.h index 6381a40..00d52ee 100644 --- a/src/util.h +++ b/src/util.h @@ -240,5 +240,19 @@ void stringToSearchIndex(const QCString &docUrlBase,const QCString &title, const QCString &str, bool priority=FALSE, const QCString &anchor=""); +enum SrcLangExt +{ + SrcLangExt_IDL = 0x008, + SrcLangExt_Java = 0x010, + SrcLangExt_CSharp = 0x020, + SrcLangExt_D = 0x040, + SrcLangExt_PHP = 0x080, + SrcLangExt_ObjC = 0x100, + SrcLangExt_Cpp = 0x200, +}; + +SrcLangExt getLanguageFromFileName(const QCString fileName); + + #endif -- cgit v0.12