diff options
author | Dimitri van Heesch <dimitri@stack.nl> | 2002-04-30 17:51:14 (GMT) |
---|---|---|
committer | Dimitri van Heesch <dimitri@stack.nl> | 2002-04-30 17:51:14 (GMT) |
commit | 758291b1be0c43c13088389b0cfbb560efe00c1f (patch) | |
tree | a37d75aa0ebe073906cb1a3c2c1506b96409f075 /src/code.l | |
parent | 210582f8060fb41f6ad34d8315c9dd27b1bb6834 (diff) | |
download | Doxygen-758291b1be0c43c13088389b0cfbb560efe00c1f.zip Doxygen-758291b1be0c43c13088389b0cfbb560efe00c1f.tar.gz Doxygen-758291b1be0c43c13088389b0cfbb560efe00c1f.tar.bz2 |
Release-1.2.15-20020430
Diffstat (limited to 'src/code.l')
-rw-r--r-- | src/code.l | 29 |
1 files changed, 28 insertions, 1 deletions
@@ -24,6 +24,7 @@ #include <assert.h> #include <ctype.h> #include <qregexp.h> +#include <qdir.h> #include "qtbc.h" #include "scanner.h" @@ -1044,10 +1045,36 @@ TYPEKW ("bool"|"char"|"double"|"float"|"int"|"long"|"short"|"signed"|"unsigned" <ReadInclude>[^\n\"\>]+/(">"|"\"") { //FileInfo *f; bool ambig; - FileDef *fd; + bool found=FALSE; + FileDef *fd=0; if ((fd=findFileDef(Doxygen::inputNameDict,yytext,ambig)) && fd->isLinkable()) { + if (ambig) // multiple input files match the name + { + //printf("===== yes %s is ambigious\n",yytext); + QCString name = convertToQCString(QDir::cleanDirPath(yytext)); + if (!name.isEmpty() && g_sourceFileDef) + { + FileName *fn = Doxygen::inputNameDict->find(name); + FileNameIterator fni(*fn); + // for each include name + for (fni.toFirst();!found && (fd=fni.current());++fni) + { + // see if this source file actually includes the file + found = g_sourceFileDef->isIncluded(fd->absFilePath()); + //printf(" include file %s found=%d\n",fd->absFilePath().data(),found); + } + } + } + else // not ambiguous + { + found = TRUE; + } + } + if (found) + { + //printf(" include file %s found=%d\n",fd->absFilePath().data(),found); g_code->writeCodeLink(fd->getReference(),fd->getOutputFileBase(),0,yytext); } else |