summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDimitri van Heesch <dimitri@stack.nl>2010-02-16 21:11:17 (GMT)
committerDimitri van Heesch <dimitri@stack.nl>2010-02-16 21:11:17 (GMT)
commite2eb1d33d197604c048fb035fd1b6ecbd6a7494a (patch)
tree524eebded0dbf9efbc5b02ab15856f10f914ff99 /src
parentf22ba481afa686d1a834e056963f8d41621aba88 (diff)
downloadDoxygen-e2eb1d33d197604c048fb035fd1b6ecbd6a7494a.zip
Doxygen-e2eb1d33d197604c048fb035fd1b6ecbd6a7494a.tar.gz
Doxygen-e2eb1d33d197604c048fb035fd1b6ecbd6a7494a.tar.bz2
Release-1.6.2-20100216
Diffstat (limited to 'src')
-rw-r--r--src/config.xml2
-rw-r--r--src/configoptions.cpp2
-rw-r--r--src/define.cpp8
-rw-r--r--src/definition.cpp2
-rw-r--r--src/diagram.cpp2
-rw-r--r--src/doxygen.cpp13
-rw-r--r--src/doxygen.css53
-rw-r--r--src/doxygen_css.h53
-rw-r--r--src/filedef.cpp21
-rw-r--r--src/filedef.h3
-rw-r--r--src/latexgen.cpp2
-rw-r--r--src/mangen.cpp3
-rw-r--r--src/memberdef.cpp2
-rw-r--r--src/memberlist.cpp2
-rw-r--r--src/pre.l109
-rw-r--r--src/scanner.l10
-rw-r--r--src/util.cpp2
17 files changed, 212 insertions, 77 deletions
diff --git a/src/config.xml b/src/config.xml
index 62b3438..0c00f5e 100644
--- a/src/config.xml
+++ b/src/config.xml
@@ -773,7 +773,7 @@ stylesheet in the HTML output directory as well, or it will be erased!
If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
page will contain the date and time when the page was generated. Setting
this to NO can help when comparing the output of multiple runs.
-' defval='0' depends='GENERATE_HTML'/>
+' defval='1' depends='GENERATE_HTML'/>
<option type='bool' id='HTML_ALIGN_MEMBERS' docs='
If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
files or namespaces will be aligned in HTML using tables. If set to
diff --git a/src/configoptions.cpp b/src/configoptions.cpp
index 3233bef..7212a6f 100644
--- a/src/configoptions.cpp
+++ b/src/configoptions.cpp
@@ -1105,7 +1105,7 @@ void addConfigOptions(Config *cfg)
"If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML\n"
"page will contain the date and time when the page was generated. Setting\n"
"this to NO can help when comparing the output of multiple runs.",
- FALSE
+ TRUE
);
cb->addDependency("GENERATE_HTML");
//----
diff --git a/src/define.cpp b/src/define.cpp
index c40d0cb..987a8c4 100644
--- a/src/define.cpp
+++ b/src/define.cpp
@@ -20,8 +20,11 @@
Define::Define()
{
- undef=FALSE;
fileDef=0;
+ lineNr=1;
+ nargs=-1;
+ undef=FALSE;
+ varArgs=FALSE;
isPredefined=FALSE;
nonRecursive=FALSE;
}
@@ -33,6 +36,9 @@ Define::Define(const Define &d)
lineNr=d.lineNr;
nargs=d.nargs;
undef=d.undef;
+ varArgs=d.varArgs;
+ isPredefined=d.isPredefined;
+ nonRecursive=d.nonRecursive;
fileDef=0;
}
diff --git a/src/definition.cpp b/src/definition.cpp
index e714818..acd3374 100644
--- a/src/definition.cpp
+++ b/src/definition.cpp
@@ -1146,6 +1146,7 @@ void Definition::makePartOfGroup(GroupDef *gd)
void Definition::setRefItems(const QList<ListItemInfo> *sli)
{
+ //printf("%s::setRefItems()\n",name().data());
if (sli)
{
makeResident();
@@ -1166,6 +1167,7 @@ void Definition::setRefItems(const QList<ListItemInfo> *sli)
void Definition::mergeRefItems(Definition *d)
{
+ //printf("%s::mergeRefItems()\n",name().data());
LockingPtr< QList<ListItemInfo> > xrefList = d->xrefListItems();
if (xrefList!=0)
{
diff --git a/src/diagram.cpp b/src/diagram.cpp
index 22d98fa..ee5111e 100644
--- a/src/diagram.cpp
+++ b/src/diagram.cpp
@@ -999,7 +999,7 @@ void ClassDiagram::writeFigure(QTextStream &output,const char *path,
}
//output << "}\n";
- output << ":\\begin{figure}[H]\n"
+ output << "\\begin{figure}[H]\n"
"\\begin{center}\n"
"\\leavevmode\n";
output << "\\includegraphics[height=" << realHeight << "cm]{"
diff --git a/src/doxygen.cpp b/src/doxygen.cpp
index ff76488..f37bad1 100644
--- a/src/doxygen.cpp
+++ b/src/doxygen.cpp
@@ -6617,6 +6617,7 @@ static void addEnumValuesToEnums(EntryNav *rootNav)
fmd->setMaxInitLines(root->initLines);
fmd->setMemberGroupId(root->mGrpId);
fmd->setExplicitExternal(root->explicitExternal);
+ fmd->setRefItems(root->sli);
if (fmd)
{
md->insertEnumField(fmd);
@@ -7737,6 +7738,16 @@ static void findDirDocumentation(EntryNav *rootNav)
QCString normalizedName = root->name;
normalizedName = substitute(normalizedName,"\\","/");
+ //printf("root->docFile=%s normalizedName=%s\n",
+ // root->docFile.data(),normalizedName.data());
+ if (root->docFile==normalizedName) // current dir?
+ {
+ int lastSlashPos=normalizedName.findRev('/');
+ if (lastSlashPos!=-1) // strip file name
+ {
+ normalizedName=normalizedName.left(lastSlashPos);
+ }
+ }
if (normalizedName.at(normalizedName.length()-1)!='/')
{
normalizedName+='/';
@@ -7774,7 +7785,7 @@ static void findDirDocumentation(EntryNav *rootNav)
else
{
warn(root->fileName,root->startLine,"Warning: No matching "
- "directory found for command \\dir %s\n",root->name.data());
+ "directory found for command \\dir %s\n",normalizedName.data());
}
rootNav->releaseEntry();
}
diff --git a/src/doxygen.css b/src/doxygen.css
index d93c02d..d6aaf28 100644
--- a/src/doxygen.css
+++ b/src/doxygen.css
@@ -369,37 +369,46 @@ hr.footer {
}
.memname {
- white-space: nowrap;
- font-weight: bold;
-}
-
-.memproto, .memdoc {
- border: 1px solid #84b0c7;
+ white-space: nowrap;
+ font-weight: bold;
+ margin-left: 6px;
}
.memproto {
- padding: 0;
- background-color: #d5e1e8;
- font-weight: bold;
- -webkit-border-top-left-radius: 8px;
- -webkit-border-top-right-radius: 8px;
- -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
- -moz-border-radius-topleft: 8px;
- -moz-border-radius-topright: 8px;
+ border-top: 1px solid #84b0c7;
+ border-left: 1px solid #84b0c7;
+ border-right: 1px solid #84b0c7;
+ padding: 0;
+ background-color: #d5e1e8;
+ font-weight: bold;
+ /* firefox specific markup */
+ background-image: -moz-linear-gradient(rgba(228, 233, 245, 1.0) 0%, rgba(193, 205, 232, 1.0) 100%);
-moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px;
+ -moz-border-radius-topright: 8px;
+ -moz-border-radius-topleft: 8px;
+ /* webkit specific markup */
+ background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(rgba(228, 233, 245, 1.0)), to(rgba(193, 205, 232, 1.0)));
+ -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
+ -webkit-border-top-right-radius: 8px;
+ -webkit-border-top-left-radius: 8px;
}
.memdoc {
- padding: 2px 5px;
- background-color: #eef3f5;
- border-top-width: 0;
- -webkit-border-bottom-left-radius: 8px;
- -webkit-border-bottom-right-radius: 8px;
- -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
- -moz-border-radius-bottomleft: 8px;
- -moz-border-radius-bottomright: 8px;
+ border-bottom: 1px solid #84b0c7;
+ border-left: 1px solid #84b0c7;
+ border-right: 1px solid #84b0c7;
+ padding: 2px 5px;
+ background-color: #eef3f5;
+ border-top-width: 0;
+ /* firefox specific markup */
+ -moz-border-radius-bottomleft: 8px;
+ -moz-border-radius-bottomright: 8px;
-moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px;
+ /* webkit specific markup */
+ -webkit-border-bottom-left-radius: 8px;
+ -webkit-border-bottom-right-radius: 8px;
+ -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
}
.paramkey {
diff --git a/src/doxygen_css.h b/src/doxygen_css.h
index 02161bd..5d58fad 100644
--- a/src/doxygen_css.h
+++ b/src/doxygen_css.h
@@ -369,37 +369,46 @@
"}\n"
"\n"
".memname {\n"
-" white-space: nowrap;\n"
-" font-weight: bold;\n"
-"}\n"
-"\n"
-".memproto, .memdoc {\n"
-" border: 1px solid #84b0c7; \n"
+" white-space: nowrap;\n"
+" font-weight: bold;\n"
+" margin-left: 6px;\n"
"}\n"
"\n"
".memproto {\n"
-" padding: 0;\n"
-" background-color: #d5e1e8;\n"
-" font-weight: bold;\n"
-" -webkit-border-top-left-radius: 8px;\n"
-" -webkit-border-top-right-radius: 8px;\n"
-" -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);\n"
-" -moz-border-radius-topleft: 8px;\n"
-" -moz-border-radius-topright: 8px;\n"
+" border-top: 1px solid #84b0c7; \n"
+" border-left: 1px solid #84b0c7; \n"
+" border-right: 1px solid #84b0c7; \n"
+" padding: 0;\n"
+" background-color: #d5e1e8;\n"
+" font-weight: bold;\n"
+" /* firefox specific markup */\n"
+" background-image: -moz-linear-gradient(rgba(228, 233, 245, 1.0) 0%, rgba(193, 205, 232, 1.0) 100%);\n"
" -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px;\n"
+" -moz-border-radius-topright: 8px;\n"
+" -moz-border-radius-topleft: 8px;\n"
+" /* webkit specific markup */\n"
+" background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(rgba(228, 233, 245, 1.0)), to(rgba(193, 205, 232, 1.0)));\n"
+" -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);\n"
+" -webkit-border-top-right-radius: 8px;\n"
+" -webkit-border-top-left-radius: 8px;\n"
"\n"
"}\n"
"\n"
".memdoc {\n"
-" padding: 2px 5px;\n"
-" background-color: #eef3f5;\n"
-" border-top-width: 0;\n"
-" -webkit-border-bottom-left-radius: 8px;\n"
-" -webkit-border-bottom-right-radius: 8px;\n"
-" -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);\n"
-" -moz-border-radius-bottomleft: 8px;\n"
-" -moz-border-radius-bottomright: 8px;\n"
+" border-bottom: 1px solid #84b0c7; \n"
+" border-left: 1px solid #84b0c7; \n"
+" border-right: 1px solid #84b0c7; \n"
+" padding: 2px 5px;\n"
+" background-color: #eef3f5;\n"
+" border-top-width: 0;\n"
+" /* firefox specific markup */\n"
+" -moz-border-radius-bottomleft: 8px;\n"
+" -moz-border-radius-bottomright: 8px;\n"
" -moz-box-shadow: rgba(0, 0, 0, 0.15) 5px 5px 5px;\n"
+" /* webkit specific markup */\n"
+" -webkit-border-bottom-left-radius: 8px;\n"
+" -webkit-border-bottom-right-radius: 8px;\n"
+" -webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);\n"
"}\n"
"\n"
".paramkey {\n"
diff --git a/src/filedef.cpp b/src/filedef.cpp
index edc0ff3..0f2889a 100644
--- a/src/filedef.cpp
+++ b/src/filedef.cpp
@@ -93,6 +93,7 @@ FileDef::FileDef(const char *p,const char *nm,
docname.prepend(stripFromPath(path.copy()));
}
m_isJava = name().right(5)==".java";
+ m_isCSharp = name().right(5)==".cs";
memberGroupSDict = 0;
acquireFileVersion();
m_subGrouping=Config_getBool("SUBGROUPING");
@@ -1550,3 +1551,23 @@ bool FileDef::isLinkableInProject() const
return hasDocumentation() && !isReference() && showFiles;
}
+bool FileDef::includes(FileDef *incFile,QDict<FileDef> *includedFiles) const
+{
+ if (incFile==this) return TRUE;
+ //printf("%s::includes(%s)\n",name().data(),incFile->name().data());
+ includedFiles->insert(absFilePath(),this);
+ if (includeList)
+ {
+ QListIterator<IncludeInfo> ili(*includeList);
+ IncludeInfo *ii;
+ for (;(ii=ili.current());++ili)
+ {
+ if (ii->fileDef &&
+ includedFiles->find(ii->fileDef->absFilePath())==0 &&
+ ii->fileDef->includes(incFile,includedFiles)) return TRUE;
+ }
+ }
+ return FALSE;
+}
+
+
diff --git a/src/filedef.h b/src/filedef.h
index 9bb1e10..9ca3bee 100644
--- a/src/filedef.h
+++ b/src/filedef.h
@@ -125,6 +125,7 @@ class FileDef : public Definition
bool isIncluded(const QCString &name) const;
bool isJava() const { return m_isJava; }
+ bool isCSharp() const { return m_isCSharp; }
void writeDocumentation(OutputList &ol);
void writeMemberPages(OutputList &ol);
@@ -164,6 +165,7 @@ class FileDef : public Definition
void addListReferences();
bool isDocumentationFile() const;
+ bool includes(FileDef *incFile,QDict<FileDef> *includedFiles) const;
MemberList *getMemberList(MemberList::ListType lt) const;
const QList<MemberList> &getMemberLists() const { return m_memberLists; }
@@ -216,6 +218,7 @@ class FileDef : public Definition
QIntDict<MemberDef> *srcMemberDict;
bool isSource;
bool m_isJava;
+ bool m_isCSharp;
QCString fileVersion;
PackageDef *package;
DirDef *dir;
diff --git a/src/latexgen.cpp b/src/latexgen.cpp
index 01b06dd..d193f39 100644
--- a/src/latexgen.cpp
+++ b/src/latexgen.cpp
@@ -1658,6 +1658,7 @@ void LatexGenerator::startClassDiagram()
{
//if (Config_getBool("COMPACT_LATEX")) t << "\\subsubsection"; else t << "\\subsection";
//t << "{";
+ newParagraph();
}
void LatexGenerator::endClassDiagram(const ClassDiagram &d,
@@ -1812,6 +1813,7 @@ void LatexGenerator::endMemberGroup(bool hasHeader)
void LatexGenerator::startDotGraph()
{
+ newParagraph();
}
void LatexGenerator::endDotGraph(const DotClassGraph &g)
diff --git a/src/mangen.cpp b/src/mangen.cpp
index 816f8a6..f0e904a 100644
--- a/src/mangen.cpp
+++ b/src/mangen.cpp
@@ -100,6 +100,7 @@ void ManGenerator::init()
static QCString buildFileName(const char *name)
{
QCString fileName;
+ if (name==0) return "noname";
const char *p=name;
char c;
@@ -407,7 +408,7 @@ void ManGenerator::startDoxyAnchor(const char *,const char *manName,
// the name of the link file is derived from the name of the anchor:
// - truncate after an (optional) ::
QCString baseName = name;
- int i=baseName.findRev(':');
+ int i=baseName.findRev("::");
if (i!=-1) baseName=baseName.right(baseName.length()-i-1);
// - remove dangerous characters and append suffix, then add dir prefix
diff --git a/src/memberdef.cpp b/src/memberdef.cpp
index b861750..3c16df0 100644
--- a/src/memberdef.cpp
+++ b/src/memberdef.cpp
@@ -2700,7 +2700,7 @@ void MemberDef::addListReference(Definition *)
if (xrefItems!=0)
{
addRefItem(xrefItems.pointer(),
- qualifiedName(),
+ qualifiedName()+argsString(), // argsString is needed for overloaded functions (see bug 609624)
memLabel,
getOutputFileBase()+"#"+anchor(),memName,memArgs);
}
diff --git a/src/memberlist.cpp b/src/memberlist.cpp
index 9868d10..f22ea5d 100644
--- a/src/memberlist.cpp
+++ b/src/memberlist.cpp
@@ -511,10 +511,12 @@ void MemberList::addListReferences(Definition *def)
LockingPtr<MemberList> enumFields = md->enumFieldList();
if (md->memberType()==MemberDef::Enumeration && enumFields!=0)
{
+ //printf(" Adding enum values!\n");
MemberListIterator vmli(*enumFields);
MemberDef *vmd;
for ( ; (vmd=vmli.current()) ; ++vmli)
{
+ //printf(" adding %s\n",vmd->name().data());
vmd->addListReference(def);
}
}
diff --git a/src/pre.l b/src/pre.l
index 6ae01cb..6eb2794 100644
--- a/src/pre.l
+++ b/src/pre.l
@@ -53,7 +53,7 @@
struct FileState
{
- FileState(int size) : fileBuf(size), oldFileBuf(0), oldFileBufPos(0) {}
+ FileState(int size) : fileBuf(size), oldFileBuf(0), oldFileBufPos(0),fileDef(0) {}
int lineNr;
//FILE *filePtr;
BufStr fileBuf;
@@ -63,6 +63,7 @@ struct FileState
//bool isPlainFile;
YY_BUFFER_STATE bufState;
QCString fileName;
+ FileDef *fileDef;
};
/* -----------------------------------------------------------------
@@ -121,6 +122,7 @@ DefineDict* getFileDefineDict()
return g_fileDefineDict;
}
+#if 0
static void setFileName(const char *name)
{
bool ambig;
@@ -130,6 +132,16 @@ static void setFileName(const char *name)
if (g_yyFileDef && g_yyFileDef->isReference()) g_yyFileDef=0;
g_insideCS = g_yyFileName.right(3)==".cs";
}
+#endif
+
+static void setFileName(FileState *fs)
+{
+ g_yyFileName=fs->fileName;
+ g_yyFileDef=fs->fileDef;
+ //printf("^^ setFileName: %s->%p\n",g_yyFileName.data(),g_yyFileDef);
+ if (g_yyFileDef && g_yyFileDef->isReference()) g_yyFileDef=0;
+ g_insideCS = g_yyFileName.right(3)==".cs";
+}
static void incrLevel()
{
@@ -173,18 +185,42 @@ static void setCaseDone(bool value)
g_levelGuard[g_level-1]=value;
}
+static bool macroIsAccessible(Define *def)
+{
+ //printf("macroIsAccessible(%s) input=%s def=%s\n",
+ // def->name.data(),g_inputFileDef?g_inputFileDef->name().data():"<none>",
+ // def->fileDef ? def->fileDef->name().data() : "<none>");
+ if (def && def->isPredefined) // predefined macro -> globally accessible
+ {
+ //printf("%s: predefined macro %s\n",g_inputFileDef->name().data(),def->name.data());
+ return TRUE;
+ }
+ if (g_inputFileDef && def && def->fileDef) // check if g_inputFileDef actually includes def->fileDef
+ {
+ QDict<FileDef> includedFiles(257);
+ bool b = g_inputFileDef->includes(def->fileDef,&includedFiles);
+ //printf("%s: Checking for accessibility of define '%s' (defined in %s): result=%d\n",
+ // g_inputFileDef->name().data(),def->name.data(),def->fileDef->name().data(),b);
+ return b;
+ }
+ return FALSE;
+}
+
static Define *isDefined(const char *name)
{
+ Define *def=0;
if (name)
{
- Define *def;
+ def=g_fileDefineDict->find(name);
//if ((def=fileDefineCache->findDefine(g_yyFileName,name)) && !def->undef)
// return def;
- if ((def=g_fileDefineDict->find(name)) && !def->undef) return def;
+ if (def && def->undef) def=0;
+ if (def && !macroIsAccessible(def)) def=0;
}
- return 0;
+ return def;
}
+
static QDict<void> g_allIncludes(10009);
static FileState *checkAndOpenFile(const QCString &fileName,bool &alreadyIncluded)
@@ -245,6 +281,8 @@ static FileState *checkAndOpenFile(const QCString &fileName,bool &alreadyInclude
{
fs->oldFileBuf = g_inputBuf;
fs->oldFileBufPos = g_inputBufPos;
+ fs->fileDef = g_yyFileDef;
+ fs->fileName = g_yyFileName;
}
}
return fs;
@@ -262,7 +300,7 @@ static FileState *findFile(const char *fileName,bool localInclude,bool &alreadyI
FileState *fs = checkAndOpenFile(absName,alreadyIncluded);
if (fs)
{
- setFileName(absName);
+ setFileName(fs);
g_yyLineNr=1;
return fs;
}
@@ -283,7 +321,7 @@ static FileState *findFile(const char *fileName,bool localInclude,bool &alreadyI
FileState *fs = checkAndOpenFile(absName,alreadyIncluded);
if (fs)
{
- setFileName(absName);
+ setFileName(fs);
g_yyLineNr=1;
return fs;
}
@@ -1062,12 +1100,15 @@ QCString expandMacro(const QCString &name)
Define *newDefine()
{
Define *def=new Define;
- def->name = g_defName;
+ def->name = g_defName;
def->definition = g_defText.stripWhiteSpace();
- def->nargs = g_defArgs;
- def->fileName = g_yyFileName;
- def->lineNr = g_yyLineNr;
- def->varArgs = g_defVarArgs;
+ def->nargs = g_defArgs;
+ def->fileName = g_yyFileName;
+ def->fileDef = g_yyFileDef;
+ def->lineNr = g_yyLineNr;
+ def->varArgs = g_defVarArgs;
+ //printf("newDefine: %s->%s\n",def->name.data(),
+ // def->fileDef ? def->fileDef->name().data() : "<none>");
//printf("newDefine: `%s'->`%s'\n",def->name.data(),def->definition.data());
if (!def->name.isEmpty() && Doxygen::expandAsDefinedDict[def->name])
{
@@ -1124,7 +1165,10 @@ void addDefine()
Doxygen::functionNameSDict->append(g_defName,mn);
}
mn->append(md);
- if (g_yyFileDef) g_yyFileDef->insertMember(md);
+ if (g_yyFileDef)
+ {
+ g_yyFileDef->insertMember(md);
+ }
//Define *d;
//if ((d=defineDict[g_defName])==0) defineDict.insert(g_defName,newDefine());
@@ -1190,9 +1234,10 @@ static void readIncludeFile(const QCString &inc)
g_yyFileDef->addIncludedByDependency(oldFileDef,oldFileDef->docName(),localInclude,g_isImported);
}
}
- fs->bufState=YY_CURRENT_BUFFER;
- fs->lineNr=oldLineNr;
- fs->fileName=oldFileName;
+ fs->bufState = YY_CURRENT_BUFFER;
+ fs->lineNr = oldLineNr;
+ fs->fileName = oldFileName;
+ fs->fileDef = oldFileDef;
// push the state on the stack
g_includeStack.push(fs);
// set the scanner to the include file
@@ -1398,6 +1443,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
(g_includeStack.isEmpty() || g_curlyCount>0) &&
g_macroExpansion &&
(def=g_fileDefineDict->find(name)) &&
+ macroIsAccessible(def) &&
(!g_expandOnlyPredef || def->isPredefined)
)
)
@@ -1470,10 +1516,11 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
if ((g_includeStack.isEmpty() || g_curlyCount>0) &&
g_macroExpansion &&
(def=g_fileDefineDict->find(yytext)) &&
+ macroIsAccessible(def) &&
(!g_expandOnlyPredef || def->isPredefined)
)
{
- //printf("Found it!\n");
+ //printf("Found it! #args=%d\n",def->nargs);
g_roundCount=0;
g_defArgsStr=yytext;
if (def->nargs==-1) // no function macro
@@ -1499,6 +1546,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
g_macroExpansion &&
(def=g_fileDefineDict->find(yytext)) &&
def->nargs==-1 &&
+ macroIsAccessible(def) &&
(!g_expandOnlyPredef || def->isPredefined)
)
{
@@ -2181,7 +2229,8 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
//printf("new define!\n");
g_fileDefineDict->insert(g_defName,newDefine());
}
- else if (def)// name already exists
+ else if (def && macroIsAccessible(def))
+ // name already exists
{
//printf("existing define!\n");
//printf("define found\n");
@@ -2271,11 +2320,11 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'"))
YY_BUFFER_STATE oldBuf = YY_CURRENT_BUFFER;
yy_switch_to_buffer( fs->bufState );
yy_delete_buffer( oldBuf );
- g_yyLineNr=fs->lineNr;
+ g_yyLineNr = fs->lineNr;
//preYYin = fs->oldYYin;
- g_inputBuf = fs->oldFileBuf;
+ g_inputBuf = fs->oldFileBuf;
g_inputBufPos = fs->oldFileBufPos;
- setFileName(fs->fileName.copy());
+ setFileName(fs);
//fprintf(stderr,"######## FileName %s\n",g_yyFileName.data());
// Deal with file changes due to
@@ -2454,6 +2503,7 @@ void preprocessFile(const char *fileName,BufStr &input,BufStr &output)
i_obrace<i_cbrace
) // predefined function macro definition
{
+ //printf("predefined function macro '%s'\n",defStr);
QRegExp reId("[a-z_A-Z][a-z_A-Z0-9]*"); // regexp matching an id
QDict<int> argDict(17);
argDict.setAutoDelete(TRUE);
@@ -2493,11 +2543,13 @@ void preprocessFile(const char *fileName,BufStr &input,BufStr &output)
if (!dname.isEmpty())
{
Define *def = new Define;
- def->name = dname;
- def->definition = definition;
- def->nargs = count;
+ def->name = dname;
+ def->definition = definition;
+ def->nargs = count;
def->isPredefined = TRUE;
def->nonRecursive = nonRecursive;
+ def->fileDef = g_yyFileDef;
+ def->fileName = fileName;
g_fileDefineDict->insert(def->name,def);
}
@@ -2509,6 +2561,7 @@ void preprocessFile(const char *fileName,BufStr &input,BufStr &output)
!ds.isEmpty() && (int)ds.length()>i_equals
) // predefined non-function macro definition
{
+ //printf("predefined normal macro '%s'\n",defStr);
Define *def = new Define;
if (i_equals==-1) // simple define without argument
{
@@ -2526,6 +2579,8 @@ void preprocessFile(const char *fileName,BufStr &input,BufStr &output)
def->nargs = -1;
def->isPredefined = TRUE;
def->nonRecursive = nonRecursive;
+ def->fileDef = g_yyFileDef;
+ def->fileName = fileName;
g_fileDefineDict->insert(def->name,def);
}
else
@@ -2566,8 +2621,14 @@ void preprocessFile(const char *fileName,BufStr &input,BufStr &output)
g_yyLineNr = 1;
g_level = 0;
g_ifcount = 0;
- setFileName(fileName);
+ QFileInfo fi(fileName);
+ bool ambig;
+ g_yyFileName = convertToQCString(fi.absFilePath());
+ g_yyFileDef = findFileDef(Doxygen::inputNameDict,g_yyFileName,ambig);
+ if (g_yyFileDef && g_yyFileDef->isReference()) g_yyFileDef=0;
+ g_insideCS = g_yyFileName.right(3)==".cs";
g_inputFileDef = g_yyFileDef;
+
BEGIN( Start );
g_expectGuard = TRUE;
diff --git a/src/scanner.l b/src/scanner.l
index 038eb1b..b7d70aa 100644
--- a/src/scanner.l
+++ b/src/scanner.l
@@ -4031,7 +4031,7 @@ TYPEDEFPREFIX (("typedef"{BN}+)?)((("volatile"|"const"){BN}+)?)
// was: current->args.simplifyWhiteSpace();
current->fileName = yyFileName;
current->startLine = yyLineNr;
- static QRegExp re("([^)]*\\[*&][^)]*)"); // (...*...)
+ static QRegExp re("([^)]*[*&][^)]*)"); // (...*...)
if (*yytext!=';' || (current_root->section&Entry::COMPOUND_MASK) )
{
int tempArg=current->name.find('<');
@@ -4041,6 +4041,10 @@ TYPEDEFPREFIX (("typedef"{BN}+)?)((("volatile"|"const"){BN}+)?)
(current->type.find(re,0)!=-1 || current->type.left(8)=="typedef "))
{
//printf("Scanner.l: found in class variable: `%s' `%s' `%s'\n", current->type.data(),current->name.data(),current->args.data());
+ if (isTypedef && current->type.left(8)!="typedef ")
+ {
+ current->type.prepend("typedef ");
+ }
current->section = Entry::VARIABLE_SEC ;
}
else
@@ -4056,6 +4060,10 @@ TYPEDEFPREFIX (("typedef"{BN}+)?)((("volatile"|"const"){BN}+)?)
if (!current->type.isEmpty() &&
(current->type.find(re,0)!=-1 || current->type.left(8)=="typedef "))
{
+ if (isTypedef && current->type.left(8)!="typedef ")
+ {
+ current->type.prepend("typedef ");
+ }
//printf("Scanner.l: found function variable!\n");
current->section = Entry::VARIABLE_SEC;
}
diff --git a/src/util.cpp b/src/util.cpp
index 0f7c17d..ebf876b 100644
--- a/src/util.cpp
+++ b/src/util.cpp
@@ -5829,7 +5829,7 @@ void addRefItem(const QList<ListItemInfo> *sli,
const char *key,
const char *prefix, const char *name,const char *title,const char *args)
{
- //printf("addRefItem(sli=%p,prefix=%s,name=%s,title=%s,args=%s)\n",sli,prefix,name,title,args);
+ //printf("addRefItem(sli=%p,key=%s,prefix=%s,name=%s,title=%s,args=%s)\n",sli,key,prefix,name,title,args);
if (sli)
{
QListIterator<ListItemInfo> slii(*sli);