Commit 188f7573 authored by Dimitri van Heesch's avatar Dimitri van Heesch

Release-1.4.5-20051109

parent 32557464
DOXYGEN Version 1.4.5-20051024 DOXYGEN Version 1.4.5-20051109
Please read the installation section of the manual Please read the installation section of the manual
(http://www.doxygen.org/install.html) for instructions. (http://www.doxygen.org/install.html) for instructions.
-------- --------
Dimitri van Heesch (24 October 2005) Dimitri van Heesch (09 November 2005)
DOXYGEN Version 1.4.5_20051024 DOXYGEN Version 1.4.5_20051109
Please read INSTALL for compilation instructions. Please read INSTALL for compilation instructions.
...@@ -17,4 +17,4 @@ to subscribe to the lists or to visit the archives. ...@@ -17,4 +17,4 @@ to subscribe to the lists or to visit the archives.
Enjoy, Enjoy,
Dimitri van Heesch (dimitri@stack.nl) (24 October 2005) Dimitri van Heesch (dimitri@stack.nl) (09 November 2005)
1.4.5-20051024 1.4.5-20051109
...@@ -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\-] ...@@ -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\-]
<ReadFormulaShort>{CMD}"f$" { // end of inline formula <ReadFormulaShort>{CMD}"f$" { // end of inline formula
formulaText+="$"; formulaText+="$";
addOutput(addFormula()); addOutput(addFormula());
addOutput(' ');
BEGIN(Comment); BEGIN(Comment);
} }
<ReadFormulaLong>{CMD}"f]" { // end of block formula <ReadFormulaLong>{CMD}"f]" { // end of block formula
formulaText+="\\]"; formulaText+="\\]";
addOutput(addFormula()); addOutput(addFormula());
addOutput(' ');
BEGIN(Comment); BEGIN(Comment);
} }
<ReadFormulaLong>{CMD}"f}" { // end of custom env formula <ReadFormulaLong>{CMD}"f}" { // end of custom env formula
formulaText+="\\end"; formulaText+="\\end";
formulaText+=formulaEnv; formulaText+=formulaEnv;
addOutput(addFormula()); addOutput(addFormula());
addOutput(' ');
BEGIN(Comment); BEGIN(Comment);
} }
<ReadFormulaLong,ReadFormulaShort>[^\\@\n]+ { // any non-special character <ReadFormulaLong,ReadFormulaShort>[^\\@\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\-] ...@@ -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++; if (*yytext=='\n') yyLineNr++;
addOutput('\n'); addOutput('\n');
printf("functionProto=%s\n",functionProto.data());
langParser->parsePrototype(functionProto); langParser->parsePrototype(functionProto);
BEGIN( Comment ); BEGIN( Comment );
} }
......
...@@ -1734,8 +1734,8 @@ void Config::create() ...@@ -1734,8 +1734,8 @@ void Config::create()
"SHOW_DIRECTORIES", "SHOW_DIRECTORIES",
"If the sources in your project are distributed over multiple directories \n" "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" "then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy \n"
"in the documentation. The default is YES.\n", "in the documentation. The default is NO.\n",
TRUE FALSE
); );
cs = addString( "FILE_VERSION_FILTER", cs = addString( "FILE_VERSION_FILTER",
"The FILE_VERSION_FILTER tag can be used to specify a program or script that \n" "The FILE_VERSION_FILTER tag can be used to specify a program or script that \n"
......
...@@ -227,7 +227,13 @@ void DirDef::writeDocumentation(OutputList &ol) ...@@ -227,7 +227,13 @@ void DirDef::writeDocumentation(OutputList &ol)
if (!dd->briefDescription().isEmpty() && Config_getBool("BRIEF_MEMBER_DESC")) if (!dd->briefDescription().isEmpty() && Config_getBool("BRIEF_MEMBER_DESC"))
{ {
ol.startMemberDescription(); 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.endMemberDescription();
ol.newParagraph(); ol.newParagraph();
} }
...@@ -280,7 +286,13 @@ void DirDef::writeDocumentation(OutputList &ol) ...@@ -280,7 +286,13 @@ void DirDef::writeDocumentation(OutputList &ol)
if (!fd->briefDescription().isEmpty() && Config_getBool("BRIEF_MEMBER_DESC")) if (!fd->briefDescription().isEmpty() && Config_getBool("BRIEF_MEMBER_DESC"))
{ {
ol.startMemberDescription(); 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.endMemberDescription();
ol.newParagraph(); ol.newParagraph();
} }
...@@ -354,8 +366,12 @@ void DirDef::addUsesDependency(DirDef *dir,FileDef *srcFd, ...@@ -354,8 +366,12 @@ void DirDef::addUsesDependency(DirDef *dir,FileDef *srcFd,
FileDef *dstFd,bool inherited) FileDef *dstFd,bool inherited)
{ {
if (this==dir) return; // do not add self-dependencies if (this==dir) return; // do not add self-dependencies
//printf(" > add dependency %s->%s due to %s\n",shortName().data(), //static int count=0;
// dir->shortName().data(),fd->name().data()); //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 // levels match => add direct dependency
bool added=FALSE; bool added=FALSE;
...@@ -383,7 +399,9 @@ void DirDef::addUsesDependency(DirDef *dir,FileDef *srcFd, ...@@ -383,7 +399,9 @@ void DirDef::addUsesDependency(DirDef *dir,FileDef *srcFd,
m_usedDirs->insert(dir->getOutputFileBase(),usedDir); m_usedDirs->insert(dir->getOutputFileBase(),usedDir);
added=TRUE; added=TRUE;
} }
if (added && dir->parent()) if (added)
{
if (dir->parent())
{ {
// add relation to parent of used dir // add relation to parent of used dir
addUsesDependency(dir->parent(),srcFd,dstFd,inherited); addUsesDependency(dir->parent(),srcFd,dstFd,inherited);
...@@ -393,6 +411,7 @@ void DirDef::addUsesDependency(DirDef *dir,FileDef *srcFd, ...@@ -393,6 +411,7 @@ void DirDef::addUsesDependency(DirDef *dir,FileDef *srcFd,
// add relation for the parent of this dir as well // add relation for the parent of this dir as well
parent()->addUsesDependency(dir,srcFd,dstFd,TRUE); parent()->addUsesDependency(dir,srcFd,dstFd,TRUE);
} }
}
} }
/** Computes the dependencies between directories /** Computes the dependencies between directories
...@@ -406,6 +425,7 @@ void DirDef::computeDependencies() ...@@ -406,6 +425,7 @@ void DirDef::computeDependencies()
FileDef *fd; FileDef *fd;
for (fli.toFirst();(fd=fli.current());++fli) // foreach file in dir dd 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()); //printf("** dir=%s file=%s\n",shortName().data(),fd->name().data());
QList<IncludeInfo> *ifl = fd->includeFileList(); QList<IncludeInfo> *ifl = fd->includeFileList();
if (ifl) if (ifl)
...@@ -415,12 +435,15 @@ void DirDef::computeDependencies() ...@@ -415,12 +435,15 @@ void DirDef::computeDependencies()
for (ifli.toFirst();(ii=ifli.current());++ifli) // foreach include file for (ifli.toFirst();(ii=ifli.current());++ifli) // foreach include file
{ {
//printf(" > %s\n",ii->includeName.data()); //printf(" > %s\n",ii->includeName.data());
//printf(" #include %s\n",ii->includeName.data());
if (ii->fileDef && ii->fileDef->isLinkable()) // linkable file if (ii->fileDef && ii->fileDef->isLinkable()) // linkable file
{ {
DirDef *usedDir = ii->fileDef->getDirDef(); DirDef *usedDir = ii->fileDef->getDirDef();
if (usedDir) if (usedDir)
{ {
// add dependency: thisDir->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); addUsesDependency(usedDir,fd,ii->fileDef,FALSE);
} }
} }
...@@ -818,6 +841,7 @@ void computeDirDependencies() ...@@ -818,6 +841,7 @@ void computeDirDependencies()
// compute uses dependencies between directories // compute uses dependencies between directories
for (sdi.toFirst();(dir=sdi.current());++sdi) for (sdi.toFirst();(dir=sdi.current());++sdi)
{ {
//printf("computeDependencies for %s: #dirs=%d\n",dir->name().data(),Doxygen::directories.count());
dir->computeDependencies(); dir->computeDependencies();
} }
......
...@@ -1805,6 +1805,13 @@ static MemberDef *addVariableToFile( ...@@ -1805,6 +1805,13 @@ static MemberDef *addVariableToFile(
) )
// variable already in the scope // variable already in the scope
{ {
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, Debug::print(Debug::Variables,0,
" variable already found: scope=%s\n",md->getOuterScope()->name().data()); " variable already found: scope=%s\n",md->getOuterScope()->name().data());
addMemberDocs(root,md,def,0,FALSE); addMemberDocs(root,md,def,0,FALSE);
...@@ -1813,6 +1820,7 @@ static MemberDef *addVariableToFile( ...@@ -1813,6 +1820,7 @@ static MemberDef *addVariableToFile(
} }
} }
} }
}
Debug::print(Debug::Variables,0, Debug::print(Debug::Variables,0,
" new variable!\n"); " new variable!\n");
// new global variable, enum value or typedef // new global variable, enum value or typedef
...@@ -6789,7 +6797,7 @@ static void findMainPage(Entry *root) ...@@ -6789,7 +6797,7 @@ static void findMainPage(Entry *root)
QCString title=root->args.stripWhiteSpace(); QCString title=root->args.stripWhiteSpace();
QCString indexName=Config_getBool("GENERATE_TREEVIEW")?"main":"index"; QCString indexName=Config_getBool("GENERATE_TREEVIEW")?"main":"index";
Doxygen::mainPage = new PageDef(root->fileName,root->startLine, Doxygen::mainPage = new PageDef(root->fileName,root->startLine,
indexName, root->doc,title); indexName, root->brief+root->doc,title);
//setFileNameForSections(root->anchors,"index",Doxygen::mainPage); //setFileNameForSections(root->anchors,"index",Doxygen::mainPage);
Doxygen::mainPage->setFileName(indexName); Doxygen::mainPage->setFileName(indexName);
...@@ -6983,7 +6991,7 @@ static void buildExampleList(Entry *root) ...@@ -6983,7 +6991,7 @@ static void buildExampleList(Entry *root)
else else
{ {
PageDef *pd=new PageDef(root->fileName,root->startLine, 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->setFileName(convertNameToFile(pd->name()+"-example"));
pd->addSectionsToDefinition(root->anchors); pd->addSectionsToDefinition(root->anchors);
//pi->addSections(root->anchors); //pi->addSections(root->anchors);
...@@ -8709,7 +8717,7 @@ void parseInput() ...@@ -8709,7 +8717,7 @@ void parseInput()
msg("Adding todo/test/bug list items...\n"); msg("Adding todo/test/bug list items...\n");
addListReferences(); addListReferences();
if (Config_getBool("SHOW_DIRECTORIES")) if (Config_getBool("SHOW_DIRECTORIES") && Config_getBool("DIRECTORY_GRAPH"))
{ {
msg("Computing dependencies between directories...\n"); msg("Computing dependencies between directories...\n");
computeDirDependencies(); computeDirDependencies();
......
...@@ -1693,10 +1693,13 @@ static void writeDefaultQuickLinks(QTextStream &t,bool compact, ...@@ -1693,10 +1693,13 @@ static void writeDefaultQuickLinks(QTextStream &t,bool compact,
if (annotatedClasses>0) if (annotatedClasses>0)
{ {
startQuickIndexItem(t,"annotated"+Doxygen::htmlFileExtension, static bool alphaIndex=Config_getBool("ALPHABETICAL_INDEX");
{
startQuickIndexItem(t,QCString(alphaIndex?"classes":"annotated")+Doxygen::htmlFileExtension,
hli==HLI_Hierarchy || hli==HLI_Classes || hli==HLI_Hierarchy || hli==HLI_Classes ||
hli==HLI_Annotated || hli==HLI_Functions || hli==HLI_ClassVisible, hli==HLI_Annotated || hli==HLI_Functions || hli==HLI_ClassVisible,
compact,first,relPath); compact,first,relPath);
}
t << fixSpaces(theTranslator->trClasses()); t << fixSpaces(theTranslator->trClasses());
endQuickIndexItem(t); endQuickIndexItem(t);
} }
...@@ -1822,10 +1825,6 @@ static void writeDefaultQuickLinks(QTextStream &t,bool compact, ...@@ -1822,10 +1825,6 @@ static void writeDefaultQuickLinks(QTextStream &t,bool compact,
startQuickIndexList(t,compact); startQuickIndexList(t,compact);
if (annotatedClasses>0) 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")) if (Config_getBool("ALPHABETICAL_INDEX"))
{ {
startQuickIndexItem(t,"classes"+Doxygen::htmlFileExtension, startQuickIndexItem(t,"classes"+Doxygen::htmlFileExtension,
...@@ -1833,6 +1832,10 @@ static void writeDefaultQuickLinks(QTextStream &t,bool compact, ...@@ -1833,6 +1832,10 @@ static void writeDefaultQuickLinks(QTextStream &t,bool compact,
t << fixSpaces(theTranslator->trAlphabeticalList()); t << fixSpaces(theTranslator->trAlphabeticalList());
endQuickIndexItem(t); endQuickIndexItem(t);
} }
startQuickIndexItem(t,"annotated"+Doxygen::htmlFileExtension,
hli==HLI_Annotated,compact,first,relPath);
t << fixSpaces(theTranslator->trCompoundList());
endQuickIndexItem(t);
} }
if (hierarchyClasses>0) if (hierarchyClasses>0)
{ {
......
...@@ -614,9 +614,28 @@ void writeClassHierarchy(OutputList &ol) ...@@ -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() int countClassHierarchy()
{ {
#if 0
// TODO: let this function return the real number of items in the hierarchy.
initClassHierarchy(&Doxygen::classSDict); initClassHierarchy(&Doxygen::classSDict);
int count=0; int count=0;
ClassSDict::Iterator cli(Doxygen::classSDict); ClassSDict::Iterator cli(Doxygen::classSDict);
...@@ -625,6 +644,13 @@ int countClassHierarchy() ...@@ -625,6 +644,13 @@ int countClassHierarchy()
if (cli.current()->subClasses()->count()>0) count++; if (cli.current()->subClasses()->count()>0) count++;
} }
return 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) ...@@ -2985,7 +3011,11 @@ void writeDirTreeNode(OutputList &ol, DirDef *dd,int level)
ftvHelp = FTVHelp::getInstance(); 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()); //printf("gd=`%s': pageDict=%d\n",gd->name().data(),gd->pageDict->count());
if (htmlHelp) if (htmlHelp)
{ {
...@@ -3008,7 +3038,7 @@ void writeDirTreeNode(OutputList &ol, DirDef *dd,int level) ...@@ -3008,7 +3038,7 @@ void writeDirTreeNode(OutputList &ol, DirDef *dd,int level)
ol.endTypewriter(); ol.endTypewriter();
} }
// write subgroups // write sub directories
if (dd->subDirs().count()>0) if (dd->subDirs().count()>0)
{ {
startIndexHierarchy(ol,level+1); startIndexHierarchy(ol,level+1);
...@@ -3021,29 +3051,12 @@ void writeDirTreeNode(OutputList &ol, DirDef *dd,int level) ...@@ -3021,29 +3051,12 @@ void writeDirTreeNode(OutputList &ol, DirDef *dd,int level)
endIndexHierarchy(ol,level+1); endIndexHierarchy(ol,level+1);
} }
if (Config_getBool("TOC_EXPAND")) if (tocExpand)
{ {
// write file list // write files of this directory
FileList *fileList=dd->getFiles(); FileList *fileList=dd->getFiles();
if (fileList && fileList->count()>0) 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(); FileDef *fd=fileList->first();
while (fd) while (fd)
{ {
...@@ -3053,10 +3066,6 @@ void writeDirTreeNode(OutputList &ol, DirDef *dd,int level) ...@@ -3053,10 +3066,6 @@ void writeDirTreeNode(OutputList &ol, DirDef *dd,int level)
ftvHelp->addContentsItem(FALSE, fd->getReference(), fd->getOutputFileBase(), 0, convertToHtml(fd->name())); ftvHelp->addContentsItem(FALSE, fd->getReference(), fd->getOutputFileBase(), 0, convertToHtml(fd->name()));
fd=fileList->next(); fd=fileList->next();
} }
if (htmlHelp)
htmlHelp->decContentsDepth();
if (ftvHelp)
ftvHelp->decContentsDepth();
} }
} }
......
...@@ -2039,7 +2039,10 @@ void MemberDef::setAnchor(const char *a) ...@@ -2039,7 +2039,10 @@ void MemberDef::setAnchor(const char *a)
a=a; a=a;
QCString memAnchor = name(); QCString memAnchor = name();
if (!args.isEmpty()) memAnchor+=args; 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 // convert to md5 hash
uchar md5_sig[16]; uchar md5_sig[16];
......
...@@ -213,6 +213,7 @@ static void initEntry() ...@@ -213,6 +213,7 @@ static void initEntry()
// current->groups->append(new Grouping(*autoGroupStack.top())); // current->groups->append(new Grouping(*autoGroupStack.top()));
//} //}
initGroupInfo(current); initGroupInfo(current);
isTypedef=FALSE;
} }
...@@ -314,15 +315,13 @@ static bool nameIsOperator(QCString &name) ...@@ -314,15 +315,13 @@ static bool nameIsOperator(QCString &name)
static void setContext() static void setContext()
{ {
QCString fileName = yyFileName; QCString fileName = yyFileName;
insideIDL = fileName.right(4)==".idl" || fileName.right(5)==".pidl" || SrcLangExt langExt = getLanguageFromFileName(fileName);
fileName.right(4)==".odl"; insideIDL = langExt==SrcLangExt_IDL;
insideJava = fileName.right(5)==".java" || fileName.right(3)==".as"; insideJava = langExt==SrcLangExt_Java;
insideCS = fileName.right(3)==".cs"; // for normal keywords add colon insideCS = langExt==SrcLangExt_CSharp;
insideD = fileName.right(2)==".d"; // for normal keywords add colon insideD = langExt==SrcLangExt_D;
insidePHP = fileName.right(4)==".php" || fileName.right(5)==".php4" || insidePHP = langExt==SrcLangExt_PHP;
fileName.right(4)==".inc" || fileName.right(6)==".phtml"; insideObjC = langExt==SrcLangExt_ObjC;
insideObjC = fileName.right(2)==".m" || fileName.right(2)==".M" ||
fileName.right(3)==".mm";
if ( insidePHP ) if ( insidePHP )
{ {
useOverrideCommands = TRUE; useOverrideCommands = TRUE;
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
#ifndef TRANSLATOR_JP_H #ifndef TRANSLATOR_JP_H
#define TRANSLATOR_JP_H #define TRANSLATOR_JP_H
class TranslatorJapanese : public TranslatorAdapter_1_3_9 class TranslatorJapanese : public Translator
{ {
private: private:
/*! The decode() can change euc into sjis */ /*! The decode() can change euc into sjis */
......
...@@ -4277,7 +4277,7 @@ QCString convertNameToFile(const char *name,bool allowDots) ...@@ -4277,7 +4277,7 @@ QCString convertNameToFile(const char *name,bool allowDots)
static bool shortNames = Config_getBool("SHORT_NAMES"); static bool shortNames = Config_getBool("SHORT_NAMES");
static bool createSubdirs = Config_getBool("CREATE_SUBDIRS"); static bool createSubdirs = Config_getBool("CREATE_SUBDIRS");
QCString result; QCString result;
if (shortNames) if (shortNames) // use short names only
{ {
static QDict<void> usedNames(10007); static QDict<void> usedNames(10007);
static int count=1; static int count=1;
...@@ -4298,6 +4298,16 @@ QCString convertNameToFile(const char *name,bool allowDots) ...@@ -4298,6 +4298,16 @@ QCString convertNameToFile(const char *name,bool allowDots)
else // long names else // long names
{ {
result=escapeCharsInString(name,allowDots); 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) if (createSubdirs)
{ {
...@@ -5648,3 +5658,41 @@ void stringToSearchIndex(const QCString &docBaseUrl,const QCString &title, ...@@ -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<void> 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.
}
...@@ -240,5 +240,19 @@ void stringToSearchIndex(const QCString &docUrlBase,const QCString &title, ...@@ -240,5 +240,19 @@ void stringToSearchIndex(const QCString &docUrlBase,const QCString &title,
const QCString &str, bool priority=FALSE, const QCString &str, bool priority=FALSE,
const QCString &anchor=""); 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 #endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment