diff options
author | dimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7> | 2003-09-09 19:57:43 (GMT) |
---|---|---|
committer | dimitri <dimitri@afe2bf4a-e733-0410-8a33-86f594647bc7> | 2003-09-09 19:57:43 (GMT) |
commit | 5042f14501ee003ee5b13173877936f0138f0544 (patch) | |
tree | c0925e732c4e9f06ccfc3974882096c5f56db513 /src | |
parent | d20edf5ddd0f90ea5b220ad743bf311f74383fc8 (diff) | |
download | Doxygen-5042f14501ee003ee5b13173877936f0138f0544.zip Doxygen-5042f14501ee003ee5b13173877936f0138f0544.tar.gz Doxygen-5042f14501ee003ee5b13173877936f0138f0544.tar.bz2 |
Release-1.3.3-20030909
Diffstat (limited to 'src')
-rw-r--r-- | src/definition.cpp | 6 | ||||
-rw-r--r-- | src/doxygen.cpp | 28 | ||||
-rw-r--r-- | src/pngenc.cpp | 13 | ||||
-rw-r--r-- | src/pre.l | 15 | ||||
-rw-r--r-- | src/translator_br.h | 56 | ||||
-rw-r--r-- | src/translator_hr.h | 79 | ||||
-rw-r--r-- | src/translator_it.h | 52 | ||||
-rw-r--r-- | src/util.cpp | 205 |
8 files changed, 238 insertions, 216 deletions
diff --git a/src/definition.cpp b/src/definition.cpp index 2733ab3..c94c7c5 100644 --- a/src/definition.cpp +++ b/src/definition.cpp @@ -243,6 +243,7 @@ static bool readCodeFragment(const char *fileName, if (fileName==0 || fileName[0]==0) return FALSE; // not a valid file name QCString cmd=Config_getString("INPUT_FILTER")+" \""+fileName+"\""; FILE *f = Config_getBool("FILTER_SOURCE_FILES") ? popen(cmd,"r") : fopen(fileName,"r"); + bool found=FALSE; if (f) { int c=0; @@ -257,7 +258,6 @@ static bool readCodeFragment(const char *fileName, if (!feof(f)) { // skip until the opening bracket or lonely : is found - bool found=FALSE; char cn=0; while (lineNr<=endLine && !feof(f) && !found) { @@ -324,11 +324,11 @@ static bool readCodeFragment(const char *fileName, result.truncate(braceIndex+1); } endLine=lineNr-1; - return TRUE; } } + if (Config_getBool("FILTER_SOURCE_FILES")) pclose(f); else fclose(f); } - return FALSE; + return found; } /*! Write a reference to the source code defining this definition */ diff --git a/src/doxygen.cpp b/src/doxygen.cpp index b380d07..19aadee 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -856,13 +856,17 @@ Definition *buildScopeFromQualifiedName(const QCString name,int level) QCString nsName = name.mid(idx,l); if (!fullScope.isEmpty()) fullScope+="::"; fullScope+=nsName; - //printf("adding dummy namespace %s to %s\n",nsName.data(),prevScope->name().data()); - // introduce bogus namespace - NamespaceDef *nd=new NamespaceDef( + NamespaceDef *nd=Doxygen::namespaceSDict.find(fullScope); + if (nd==0) + { + // introduce bogus namespace + //printf("adding dummy namespace %s to %s\n",nsName.data(),prevScope->name().data()); + nd=new NamespaceDef( "<generated>",1,fullScope); - // add namespace to the list - Doxygen::namespaceSDict.inSort(fullScope,nd); + // add namespace to the list + Doxygen::namespaceSDict.inSort(fullScope,nd); + } prevScope->addInnerCompound(nd); nd->setOuterScope(prevScope); p=idx+l+2; @@ -897,13 +901,13 @@ static void resolveClassNestingRelations() Definition *d = findScopeFromQualifiedName(Doxygen::globalScope,cd->name()); if (d==0) { - //Definition *d = buildScopeFromQualifiedName(cd->name(),cd->name().contains("::")); - //d->addInnerCompound(nd); - //nd->setOuterScope(d); - warn(cd->getDefFileName(),cd->getDefLine(), - "Warning: Internal inconsistency: scope for class %s not " - "found!\n",cd->name().data() - ); + Definition *d = buildScopeFromQualifiedName(cd->name(),cd->name().contains("::")); + d->addInnerCompound(cd); + cd->setOuterScope(d); + //warn(cd->getDefFileName(),cd->getDefLine(), + // "Warning: Internal inconsistency: scope for class %s not " + // "found!\n",cd->name().data() + // ); } else { diff --git a/src/pngenc.cpp b/src/pngenc.cpp index 3ed69b3..5a52e2f 100644 --- a/src/pngenc.cpp +++ b/src/pngenc.cpp @@ -27,6 +27,8 @@ #include <png.h> #include <stdio.h> #include <stdlib.h> +#include <string.h> +#include <errno.h> #include "pngenc.h" #include "message.h" @@ -133,8 +135,15 @@ void PngEncoder::write(const char *name) png_set_rows(png_ptr,info_ptr,rows); file = fopen(name,"wb"); - png_init_io(png_ptr,file); - png_write_png(png_ptr,info_ptr,PNG_TRANSFORM_IDENTITY,NULL); + if (file==0) + { + err("Error opening png file %s for writing: %s!\n",name,strerror(errno)); + } + else + { + png_init_io(png_ptr,file); + png_write_png(png_ptr,info_ptr,PNG_TRANSFORM_IDENTITY,NULL); + } } png_destroy_write_struct(&png_ptr, &info_ptr); @@ -1061,6 +1061,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'")) %x Ifdef %x Ifndef %x SkipCComment +%x SkipVerbatim %x SkipCPPComment %x RemoveCComment %x RemoveCPPComment @@ -1660,14 +1661,22 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'")) outputChar('/');outputChar('*'); //g_commentCount++; } -<SkipCComment>[^*\n\/]+ { +<SkipCComment>[\\@]"verbatim"{BN}+ { outputArray(yytext,yyleng); + BEGIN(SkipVerbatim); } -<SkipCComment>\n { +<SkipVerbatim>[\\@]"endverbatim" { + outputArray(yytext,yyleng); + BEGIN(SkipCComment); + } +<SkipCComment,SkipVerbatim>[^*\n\/]+ { + outputArray(yytext,yyleng); + } +<SkipCComment,SkipVerbatim>\n { g_yyLineNr++; outputChar('\n'); } -<SkipCComment>. { +<SkipCComment,SkipVerbatim>. { outputChar(*yytext); } <RemoveCComment>"*/" { BEGIN(g_lastCContext); } diff --git a/src/translator_br.h b/src/translator_br.h index 8f4e501..1f4c9b3 100644 --- a/src/translator_br.h +++ b/src/translator_br.h @@ -16,6 +16,8 @@ * Version: 1.3 (2003/05/01) * * History: + * 1.3.3: + * - Updated to Doxygen 1.3.3 * 1.3.2: * - Updated to Doxygen 1.3.2 * 1.3: @@ -29,7 +31,7 @@ #ifndef TRANSLATOR_BR_H #define TRANSLATOR_BR_H -class TranslatorBrazilian: public TranslatorAdapter_1_3_3 +class TranslatorBrazilian: public Translator { public: @@ -1466,7 +1468,7 @@ class TranslatorBrazilian: public TranslatorAdapter_1_3_3 // new since 1.3.1 ////////////////////////////////////////////////////////////////////////// - /*! Used in the quick index of a class/file/namespace member list page + /*! Used in the quick index of a class/file/namespace member list page * to link to the unfiltered list of all members. */ virtual QCString trAll() @@ -1479,5 +1481,55 @@ class TranslatorBrazilian: public TranslatorAdapter_1_3_3 return "Este é o grafo de chamadas para esta funçăo:"; } +////////////////////////////////////////////////////////////////////////// +// new since 1.3.3 +////////////////////////////////////////////////////////////////////////// + + /*! When the search engine is enabled this text is put in the header + * of each page before the field where one can enter the text to search + * for. + */ + virtual QCString trSearchForIndex() + { + return "Procurar por"; + } + /*! This string is used as the title for the page listing the search + * results. + */ + virtual QCString trSearchResultsTitle() + { + return "Resultado da Busca"; + } + /*! This string is put just before listing the search results. The + * text can be different depending on the number of documents found. + * Inside the text you can put the special marker $num to insert + * the number representing the actual number of search results. + * The @a numDocuments parameter can be either 0, 1 or 2, where the + * value 2 represents 2 or more matches. HTML markup is allowed inside + * the returned string. + */ + virtual QCString trSearchResults(int numDocuments) + { + if (numDocuments==0) + { + return "Nenhum documento foi encontrado."; + } + else if (numDocuments==1) + { + return "Apenas <b>1</b> documento foi encontrado."; + } + else + { + return "<b>$num</b> documentos encontrados. " + "Os melhores resultados vem primeiro."; + } + } + /*! This string is put before the list of matched words, for each search + * result. What follows is the list of words that matched the query. + */ + virtual QCString trSearchMatches() + { + return "Resultados:"; + } }; #endif diff --git a/src/translator_hr.h b/src/translator_hr.h index 5a8e2f0..acc21a5 100644 --- a/src/translator_hr.h +++ b/src/translator_hr.h @@ -56,7 +56,7 @@ #ifndef TRANSLATOR_HR_H #define TRANSLATOR_HR_H -class TranslatorCroatian : public TranslatorAdapter_1_3_1 +class TranslatorCroatian : public Translator { private: /*! to avoid macro redefinition from translator_cz.h */ @@ -1130,6 +1130,83 @@ class TranslatorCroatian : public TranslatorAdapter_1_3_1 { return decode("Statički atributi u paketu"); } + ////////////////////////////////////////////////////////////////////////// + // new since 1.3.1 + ////////////////////////////////////////////////////////////////////////// + + /*! Used in the quick index of a class/file/namespace member list page + * to link to the unfiltered list of all members. + */ + virtual QCString trAll() + { + return "Sve"; + } + /*! Put in front of the call graph for a function. */ + virtual QCString trCallGraph() + { + return "Ovo je dijagram poziva za ovu funkciju:"; + } + + ////////////////////////////////////////////////////////////////////////// + // new since 1.3.3 + ////////////////////////////////////////////////////////////////////////// + + /*! When the search engine is enabled this text is put in the header + * of each page before the field where one can enter the text to search + * for. + */ + virtual QCString trSearchForIndex() + { + return decode("Traži"); + } + /*! This string is used as the title for the page listing the search + * results. + */ + virtual QCString trSearchResultsTitle() + { + return "Rezultati pretrage"; + } + /*! This string is put just before listing the search results. The + * text can be different depending on the number of documents found. + * Inside the text you can put the special marker $num to insert + * the number representing the actual number of search results. + * The @a numDocuments parameter can be either 0, 1 or 2, where the + * value 2 represents 2 or more matches. HTML markup is allowed inside + * the returned string. + */ + virtual QCString trSearchResults(int numDocuments) + { + if (numDocuments==0) + { + return decode("Nema dokumenta koji odgovaraju vašem upitu"); + } + else if (numDocuments==1) + { + return decode("Nađen <b>1</b> dokument koji odgovara vašem upitu."); + } + else if (numDocuments<5) + { + // croatian handle numbers up to 5 differently + // For those of you who like to read comments : + // There are only 4 men in the world in croatian. + // We say 1 čovjek (man), 2 čovjeka, 3 čovjeka , 4 čovjeka , but 5, 6, 7 ... ljudi (people) + // That's deep, isn't it :-)? + return decode("Nađena <b>$num</b> dokumenta koji odgovaraju vašem upitu." + "Najbolji su prikazani prvi."); + } + else + { + return decode("Nađeno <b>$num</b> dokumenata koji odgovaraju vašem upitu." + "Najbolji su prikazani prvi."); + } + } + /*! This string is put before the list of matched words, for each search + * result. What follows is the list of words that matched the query. + */ + virtual QCString trSearchMatches() + { + return decode("Pronađeno:"); + } }; diff --git a/src/translator_it.h b/src/translator_it.h index 302c0df..9346593 100644 --- a/src/translator_it.h +++ b/src/translator_it.h @@ -19,6 +19,7 @@ * * Revision history * + * 2003/11: translated new items used since version 1.3.3 * 2003/06: translated new items used since version 1.3.1 * 2003/04: translated new items used since version 1.3 * 2002/11: translated new items used since version 1.2.18 @@ -1448,6 +1449,57 @@ class TranslatorItalian : public TranslatorAdapter_1_3_3 return "Questo č il grafo delle chiamate per questa funzione:"; } +////////////////////////////////////////////////////////////////////////// +// new since 1.3.3 +////////////////////////////////////////////////////////////////////////// + + /*! When the search engine is enabled this text is put in the header + * of each page before the field where one can enter the text to search + * for. + */ + virtual QCString trSearchForIndex() + { + return "Cerca"; + } + /*! This string is used as the title for the page listing the search + * results. + */ + virtual QCString trSearchResultsTitle() + { + return "Risultati della ricerca"; + } + /*! This string is put just before listing the search results. The + * text can be different depending on the number of documents found. + * Inside the text you can put the special marker $num to insert + * the number representing the actual number of search results. + * The @a numDocuments parameter can be either 0, 1 or 2, where the + * value 2 represents 2 or more matches. HTML markup is allowed inside + * the returned string. + */ + virtual QCString trSearchResults(int numDocuments) + { + if (numDocuments==0) + { + return "Nessun documento soddisfa la tua richiesta."; + } + else if (numDocuments==1) + { + return "Trovato <b>1</b> documento rispondente alla tua richiesta."; + } + else + { + return "Trovati <b>$num</b> documenti rispondenti alla tua richiesta. " + "Le corrispondenze migliori sono in testa."; + } + } + /*! This string is put before the list of matched words, for each search + * result. What follows is the list of words that matched the query. + */ + virtual QCString trSearchMatches() + { + return "Corrispondenze:"; + } + }; #endif diff --git a/src/util.cpp b/src/util.cpp index c6ac2f0..3cd0c80 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -405,6 +405,7 @@ int guessSection(const char *name) return 0; } +// TODO: remove this! QCString resolveTypeDef(Definition *context,const QCString &qualifiedName, Definition **typedefContext) { @@ -543,195 +544,6 @@ NamespaceDef *getResolvedNamespace(const char *name) } } -//static QDict<Definition> g_resolvedScopes; -// -///* -// * find the fully qualified class name refered to by the input class -// * or typedef name against the input scope. -// * loops through scope and each of its parent scopes looking for a -// * match against the input name. Also recursively calls itself to check -// * against any imported namespaces in each scope being checked. -// */ -//ClassDef *getResolvedClassRecursive( -// Definition *scope, -// const char *n, -// bool *pIsTypeDef, -// QCString *pTemplSpec -// ) -//{ -// QCString name = n; -// // bail out if there is no name -// if (name.isEmpty()) return 0; -// // use the global scope if no scope was passed -// if (scope==0) scope=Doxygen::globalScope; -// ClassDef *cd=0; -// -// //printf("===================\n"); -// Definition *typedefScope = 0; -// //printf("-----------------------------------------------------\n"); -// QCString subst = resolveTypeDef(scope,name,&typedefScope); -// //printf("trying getResolvedClass(%s,%s) => subst=%s\n", -// // scope ? scope->name().data() : "<none>", name.data(),subst.data()); -// -// if (!subst.isEmpty()) -// { -// //printf(" typedef value=%s typedefScope=%s\n",subst.data(), -// // typedefScope?typedefScope->qualifiedName().data():0); -// -// // strip * and & from n -// int ip=subst.length()-1; -// while (ip>=0 && (subst.at(ip)=='*' || subst.at(ip)=='&' || -// subst.at(ip)==' ')) ip--; -// subst=subst.left(ip+1); -// -// if (pIsTypeDef) *pIsTypeDef=TRUE; -// if (subst==name) // avoid resolving "typedef struct foo foo"; -// { -// cd = Doxygen::classSDict.find(name); -// if (cd) goto found; -// } -// else -// { -// int count=0; // recursion detection guard -// QCString newSubst; -// QCString typeName = subst; -// //printf( "---> subst=%s\n",subst.data()); -// -// while (!(newSubst=resolveTypeDef(typedefScope,typeName)).isEmpty() -// && count<10) -// { -// //printf( "---> newSubst=%s\n",newSubst.data()); -// if (typeName==newSubst) -// { -// cd = Doxygen::classSDict.find(subst); // for breaking typedef struct A A; -// //printf(" getClass: exit `%s' %p\n",subst.data(),cd); -// if (cd) goto found; -// break; -// } -// subst=newSubst; -// // strip * and & from n -// int ip=subst.length()-1; -// while (ip>=0 && subst.at(ip)=='*' || subst.at(ip)=='&' || subst.at(ip)==' ') ip--; -// subst=subst.left(ip+1); -// //printf(" getResolvedClass `%s'->`%s'\n",name.data(),subst.data()); -// -// typeName=newSubst; -// //if (index!=-1) typeName.prepend(name.left(index)+"::"); -// count++; -// } -// if (count==10) -// { -// warn_cont("Warning: possible recursive typedef dependency detected for %s!\n",n); -// cd = Doxygen::classSDict.find(name); -// if (cd) goto found; -// } -// else -// { -// int i; -// if (typedefScope) -// { -// cd = Doxygen::classSDict.find(typedefScope->qualifiedName()+"::"+typeName); -// } -// if (cd==0) -// { -// cd = Doxygen::classSDict.find(typeName); -// } -// //printf(" getClass: subst %s->%s cd=%p\n",name.data(),typeName.data(),cd); -// if (cd==0 && (i=typeName.find('<'))>0) // try unspecialized version as well -// { -// if (pTemplSpec) *pTemplSpec = typeName.right(typeName.length()-i); -// cd = Doxygen::classSDict.find(typeName.left(i)); -// } -// //if (cd) goto found; -// } -// } -// // whether we found something or not, we stop searching to prevent -// // finding false positives. -// goto found; -// } -// else // not a typedef -// { -// do -// { -// //printf(" %s is not a typedef value in scope %s\n",name.data(),scope?scope->name().data():"<global>"); -// if (pIsTypeDef) *pIsTypeDef=FALSE; -// if (scope!=Doxygen::globalScope) -// { -// cd = Doxygen::classSDict.find(scope->name()+"::"+name); -// } -// else -// { -// cd = Doxygen::classSDict.find(name); -// } -// if (cd==0) -// { -// if (scope->definitionType()==Definition::TypeNamespace) -// { -// NamespaceDef *nscope = (NamespaceDef*)scope; -// ClassSDict *cl = nscope->getUsedClasses(); -// if (cl) // see if the class was imported via a using statement -// { -// ClassSDict::Iterator cli(*cl); -// ClassDef *ucd; -// for (cli.toFirst();(ucd=cli.current());++cli) -// { -// //printf("comparing %s<->%s\n",ucd->name().data(),name.data()); -// if (rightScopeMatch(ucd->name(),name)) -// { -// cd=ucd; -// break; -// } -// } -// } -// NamespaceSDict *nl = nscope->getUsedNamespaces(); -// if (nl) // check used namespaces for the class -// { -// NamespaceSDict::Iterator nli(*nl); -// NamespaceDef *und; -// for (nli.toFirst();(und=nli.current());++nli) -// { -// if (g_resolvedScopes.find(und->name())==0) -// { -// g_resolvedScopes.insert(und->name(),und); -// cd = getResolvedClassRecursive(und,name,pIsTypeDef,pTemplSpec); -// g_resolvedScopes.remove(und->name()); -// if (cd) break; -// } -// } -// } -// } -// } -// if (cd) goto found; -// -// if (scope==Doxygen::globalScope) scope=0; -// else if (scope) scope=scope->getOuterScope(); -// //fprintf(stderr,"scope=%p\n",scope); -// } while (scope); -// } -// -//found: -// //printf("getResolvedClass()=%s\n",cd?cd->name().data():"<none>"); -// return cd; -//} -// -// -//ClassDef *getOldResolvedClass( -// Definition *scope, -// const char *n, -// bool *pIsTypeDef, -// QCString *pTemplSpec -// ) -//{ -// g_resolvedScopes.clear(); -// return getResolvedClassRecursive(scope,n,pIsTypeDef,pTemplSpec); -//} -// - -//------------------------------------------------------------------------- -//------------------------------------------------------------------------- -//------------------------------------------------------------------------- -//------------------------------------------------------------------------- - static QDict<MemberDef> g_resolvedTypedefs; // forward declaration @@ -744,7 +556,8 @@ ClassDef *getResolvedClassRec(Definition *scope, int isAccessibleFrom(Definition *scope,FileDef *fileScope,Definition *item, const QCString &explicitScopePart); -/*! Returns the class representing the value of the typedef represented by md. +/*! Returns the class representing the value of the typedef represented by \a md + * within file \a fileScope. * * Example: typedef A T; will return the class representing A if it is a class. * @@ -865,7 +678,10 @@ static Definition *followPath(Definition *start,FileDef *fileScope,const QCStrin return current; // path could be followed } -bool accessibleViaUsingClass(const ClassSDict *cl,FileDef *fileScope,Definition *item,const QCString &explicitScopePart="") +bool accessibleViaUsingClass(const ClassSDict *cl, + FileDef *fileScope, + Definition *item, + const QCString &explicitScopePart="") { if (cl) // see if the class was imported via a using statement { @@ -893,7 +709,10 @@ bool accessibleViaUsingClass(const ClassSDict *cl,FileDef *fileScope,Definition return FALSE; } -bool accessibleViaUsingNamespace(const NamespaceSDict *nl,FileDef *fileScope,Definition *item,const QCString &explicitScopePart="") +bool accessibleViaUsingNamespace(const NamespaceSDict *nl, + FileDef *fileScope, + Definition *item, + const QCString &explicitScopePart="") { if (nl) // check used namespaces for the class { @@ -1211,7 +1030,7 @@ QCString removeRedundantWhiteSpace(const QCString &s) result+=' '; result+=s.at(i); } - else if (c=='t' && csp==5) // prevent const ::A from being converted to const::A + else if (c=='t' && csp==5 && !isId(s.at(i+1))) // prevent const ::A from being converted to const::A { result+="t "; csp=0; |