diff options
author | Dimitri van Heesch <dimitri@stack.nl> | 2007-02-19 18:51:10 (GMT) |
---|---|---|
committer | Dimitri van Heesch <dimitri@stack.nl> | 2007-02-19 18:51:10 (GMT) |
commit | eb591296685b8268427173e0a24f74abd987170d (patch) | |
tree | c87efff649bf31ee31966a867e71ba7f159fca43 /src | |
parent | 84dc695cd534be6a58ae71ec7f2bcf3b6b5e9e64 (diff) | |
download | Doxygen-eb591296685b8268427173e0a24f74abd987170d.zip Doxygen-eb591296685b8268427173e0a24f74abd987170d.tar.gz Doxygen-eb591296685b8268427173e0a24f74abd987170d.tar.bz2 |
Release-1.5.1-20070219
Diffstat (limited to 'src')
193 files changed, 2528 insertions, 1112 deletions
diff --git a/src/Makefile.in b/src/Makefile.in index e9decc4..bef323e 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -2,7 +2,7 @@ # # # -# Copyright (C) 1997-2006 by Dimitri van Heesch. +# Copyright (C) 1997-2007 by Dimitri van Heesch. # # Permission to use, copy, modify, and distribute this software and its # documentation under the terms of the GNU General Public License is hereby diff --git a/src/bufstr.h b/src/bufstr.h index 3fcdd1d..3d33cce 100644 --- a/src/bufstr.h +++ b/src/bufstr.h @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/classdef.cpp b/src/classdef.cpp index 6d00ea5..e815517 100644 --- a/src/classdef.cpp +++ b/src/classdef.cpp @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -359,6 +359,8 @@ void ClassDef::internalInsertMember(MemberDef *md, bool addToAllList ) { + if (md->isHidden()) return; + //printf("adding %s::%s\n",name().data(),md->name().data()); if (!isReference()) { @@ -2043,6 +2045,7 @@ bool ClassDef::isBaseClass(ClassDef *bcd, bool followInstances,int level) if (level>256) { err("Possible recursive class relation while inside %s and looking for %s\n",name().data(),bcd->name().data()); + abort(); return FALSE; } if (baseClasses()) diff --git a/src/classdef.h b/src/classdef.h index 5d745bf..2153def 100644 --- a/src/classdef.h +++ b/src/classdef.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/classlist.cpp b/src/classlist.cpp index 67507d6..0e9de89 100644 --- a/src/classlist.cpp +++ b/src/classlist.cpp @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/classlist.h b/src/classlist.h index 0b74b03..ace8195 100644 --- a/src/classlist.h +++ b/src/classlist.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/cmdmapper.cpp b/src/cmdmapper.cpp index 12b1432..da66f45 100644 --- a/src/cmdmapper.cpp +++ b/src/cmdmapper.cpp @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/cmdmapper.h b/src/cmdmapper.h index 6a261fa..1ef3053 100644 --- a/src/cmdmapper.h +++ b/src/cmdmapper.h @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/commentcnv.h b/src/commentcnv.h index 7ccbc4f..a2965f7 100644 --- a/src/commentcnv.h +++ b/src/commentcnv.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/commentcnv.l b/src/commentcnv.l index c26334e..25a0f1a 100644 --- a/src/commentcnv.l +++ b/src/commentcnv.l @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/commentscan.h b/src/commentscan.h index a30ae61..85ff2a0 100644 --- a/src/commentscan.h +++ b/src/commentscan.h @@ -1,6 +1,6 @@ /****************************************************************************** * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/commentscan.l b/src/commentscan.l index ddd62a5..ec58264 100644 --- a/src/commentscan.l +++ b/src/commentscan.l @@ -1,6 +1,6 @@ /***************************************************************************** * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/config.h b/src/config.h index 311bfb8..ea8fdad 100644 --- a/src/config.h +++ b/src/config.h @@ -50,6 +50,7 @@ class ConfigOption QCString dependsOn() const { return m_dependency; } void addDependency(const char *dep) { m_dependency = dep; } + void setEncoding(const QCString &e) { m_encoding = e; } protected: virtual void writeTemplate(QTextStream &t,bool sl,bool upd) = 0; @@ -67,6 +68,7 @@ class ConfigOption QCString m_name; QCString m_doc; QCString m_dependency; + QCString m_encoding; OptionType m_kind; }; @@ -357,6 +359,7 @@ class Config static void deleteInstance() { delete m_instance; + m_instance=0; } /*! Returns an iterator that can by used to iterate over the diff --git a/src/config.l b/src/config.l index 19d3c1e..2818b0a 100644 --- a/src/config.l +++ b/src/config.l @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -22,6 +22,7 @@ #include <assert.h> #include <ctype.h> #include <stdarg.h> +#include <errno.h> #include <qfileinfo.h> #include <qdir.h> @@ -31,6 +32,7 @@ #include "config.h" #include "version.h" +#include "portable.h" #include "lang_cfg.h" @@ -62,6 +64,11 @@ void config_warn(const char *fmt, ...) va_end(args); } +static QCString configStringRecode( + const QCString &str, + const char *fromEncoding, + const char *toEncoding); + #define MAX_INCLUDE_DEPTH 10 #define YY_NEVER_INTERACTIVE 1 @@ -100,9 +107,11 @@ void ConfigOption::writeIntValue(QTextStream &t,int i) void ConfigOption::writeStringValue(QTextStream &t,QCString &s) { - const char *p=s.data(); char c; bool needsEscaping=FALSE; + // convert the string back to it original encoding + QCString se = configStringRecode(s,"UTF-8",m_encoding); + const char *p=se.data(); if (p) { while ((c=*p++)!=0 && !needsEscaping) @@ -110,7 +119,7 @@ void ConfigOption::writeStringValue(QTextStream &t,QCString &s) if (needsEscaping) { t << "\""; - p=s.data(); + p=se.data(); while (*p) { if (*p=='"') t << "\\"; // escape quotes @@ -120,7 +129,7 @@ void ConfigOption::writeStringValue(QTextStream &t,QCString &s) } else { - t << s; + t << se; } } } @@ -297,6 +306,7 @@ static QCString enumValuesPerLineString; static QCString treeViewWidthString; static QCString maxDotGraphWidthString; static QCString maxDotGraphHeightString; +static QCString encoding; static Config *config; @@ -327,6 +337,51 @@ static int yyread(char *buf,int max_size) } +static QCString configStringRecode( + const QCString &str, + const char *fromEncoding, + const char *toEncoding) +{ + QCString inputEncoding = fromEncoding; + QCString outputEncoding = toEncoding; + if (inputEncoding.isEmpty() || outputEncoding.isEmpty() || inputEncoding==outputEncoding) return str; + int inputSize=str.length(); + int outputSize=inputSize*4+1; + QCString output(outputSize); + void *cd = portable_iconv_open(outputEncoding,inputEncoding); + if (cd==(void *)(-1)) + { + fprintf(stderr,"Error: unsupported character conversion: '%s'->'%s'\n", + inputEncoding.data(),outputEncoding.data()); + exit(1); + } + size_t iLeft=inputSize; + size_t oLeft=outputSize; + const char *inputPtr = str.data(); + char *outputPtr = output.data(); + if (!portable_iconv(cd, &inputPtr, &iLeft, &outputPtr, &oLeft)) + { + outputSize-=oLeft; + output.resize(outputSize+1); + output.at(outputSize+1)='\0'; + //printf("iconv: input size=%d output size=%d\n[%s]\n",size,newSize,srcBuf.data()); + } + else + { + fprintf(stderr,"Error: failed to translate characters from %s to %s: %s\n", + inputEncoding.data(),outputEncoding.data(),strerror(errno)); + exit(1); + } + portable_iconv_close(cd); + return output; +} + +static void checkEncoding() +{ + ConfigString *option = (ConfigString*)config->get("DOXYFILE_ENCODING"); + encoding = *option->valueRef(); +} + static FILE *tryPath(const char *path,const char *fileName) { QCString absName=(QCString)path+"/"+fileName; @@ -429,6 +484,7 @@ static void readIncludeFile(const char *incName) <Start>[a-z_A-Z][a-z_A-Z0-9]*[ \t]*"=" { QCString cmd=yytext; cmd=cmd.left(cmd.length()-1).stripWhiteSpace(); ConfigOption *option = config->get(cmd); + option->setEncoding(encoding); if (option==0) // oops not known { config_err("Warning: ignoring unsupported tag `%s' at line %d, file %s\n", @@ -521,7 +577,7 @@ static void readIncludeFile(const char *incName) /* include a config file */ <Start>"@INCLUDE"[ \t]*"=" { BEGIN(Include);} <Include>([^ \"\t\r\n]+)|("\""[^\n\"]+"\"") { - readIncludeFile(yytext); + readIncludeFile(configStringRecode(yytext,encoding,"UTF-8")); BEGIN(Start); } <<EOF>> { @@ -565,7 +621,9 @@ static void readIncludeFile(const char *incName) } elemStr.resize(0); } -<GetString>[^ \"\t\r\n]+ { (*s)+=yytext; } +<GetString>[^ \"\t\r\n]+ { (*s)+=configStringRecode(yytext,encoding,"UTF-8"); + checkEncoding(); + } <GetString,GetStrList,SkipInvalid>"\"" { lastState=YY_START; BEGIN(GetQuotedString); tmpString.resize(0); @@ -573,9 +631,14 @@ static void readIncludeFile(const char *incName) <GetQuotedString>"\""|"\n" { //printf("Quoted String = `%s'\n",tmpString.data()); if (lastState==GetString) - (*s)+=tmpString; + { + (*s)+=configStringRecode(tmpString,encoding,"UTF-8"); + checkEncoding(); + } else - elemStr+=tmpString; + { + elemStr+=configStringRecode(tmpString,encoding,"UTF-8"); + } if (*yytext=='\n') { config_err("Warning: Missing end quote (\") on line %d, file %s\n",yyLineNr,yyFileName.data()); @@ -603,7 +666,7 @@ static void readIncludeFile(const char *incName) } } <GetStrList>[^ \#\"\t\r\n]+ { - elemStr+=yytext; + elemStr+=configStringRecode(yytext,encoding,"UTF-8"); } <SkipComment>\n { yyLineNr++; BEGIN(Start); } <SkipComment>\\[ \r\t]*\n { yyLineNr++; BEGIN(Start); } @@ -704,7 +767,7 @@ static void substEnvVarsInString(QCString &s) while ((i=re.match(s,p,&l))!=-1) { //printf("Found environment var s.mid(%d,%d)=`%s'\n",i+2,l-3,s.mid(i+2,l-3).data()); - QCString env=getenv(s.mid(i+2,l-3)); + QCString env=portable_getenv(s.mid(i+2,l-3)); substEnvVarsInString(env); // recursively expand variables if needed. s = s.left(i)+env+s.right(s.length()-i-l); p=i+env.length(); // next time start at the end of the expanded string @@ -1040,11 +1103,7 @@ void Config::check() dotPath+='/'; } } -#if defined(_WIN32) - QFileInfo dp(dotPath+"dot.exe"); -#else - QFileInfo dp(dotPath+"dot"); -#endif + QFileInfo dp(dotPath+portable_dotCommand()); if (!dp.exists() || !dp.isFile()) { config_err("Warning: the dot tool could not be found at %s\n",dotPath.data()); @@ -1117,23 +1176,24 @@ void Config::check() filePatternList.append("*.mm"); filePatternList.append("*.dox"); filePatternList.append("*.py"); -#if !defined(_WIN32) - // unix => case sensitive match => also include useful uppercase versions - filePatternList.append("*.C"); - filePatternList.append("*.CC"); - filePatternList.append("*.C++"); - filePatternList.append("*.II"); - filePatternList.append("*.I++"); - filePatternList.append("*.H"); - filePatternList.append("*.HH"); - filePatternList.append("*.H++"); - filePatternList.append("*.CS"); - filePatternList.append("*.PHP"); - filePatternList.append("*.PHP3"); - filePatternList.append("*.M"); - filePatternList.append("*.MM"); - filePatternList.append("*.PY"); -#endif + if (portable_fileSystemIsCaseSensitive()) + { + // unix => case sensitive match => also include useful uppercase versions + filePatternList.append("*.C"); + filePatternList.append("*.CC"); + filePatternList.append("*.C++"); + filePatternList.append("*.II"); + filePatternList.append("*.I++"); + filePatternList.append("*.H"); + filePatternList.append("*.HH"); + filePatternList.append("*.H++"); + filePatternList.append("*.CS"); + filePatternList.append("*.PHP"); + filePatternList.append("*.PHP3"); + filePatternList.append("*.M"); + filePatternList.append("*.MM"); + filePatternList.append("*.PY"); + } } // add default pattern if needed @@ -1143,44 +1203,35 @@ void Config::check() examplePatternList.append("*"); } -#undef PUTENV -#undef SEP -#if defined(_WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ < 0x0550)) -#define PUTENV _putenv -#define SEP ";" -#else -#define PUTENV putenv -#define SEP ":" -#endif if (Config_getBool("HAVE_DOT")) { - char *curFontPath = getenv("DOTFONTPATH"); - int l=curFontPath ? strlen(curFontPath)+1 : 0; - static char *buf = 0; - buf = (char *)realloc(buf,strlen("DOTFONTPATH=.")+l+1); - strcpy(buf,"DOTFONTPATH=."); - if (l>0) + QCString curFontPath = portable_getenv("DOTFONTPATH"); + QCString newFontPath = "."; + if (!curFontPath.isEmpty()) { - strcat(buf,SEP); - strcat(buf,curFontPath); + newFontPath+=portable_pathListSeparator(); + newFontPath+=curFontPath; } - PUTENV(buf); + portable_setenv("DOTFONTPATH",newFontPath); } -#if 0 - int &depth = Config_getInt("MAX_DOT_GRAPH_DEPTH"); - if (depth==0) - { - depth=1000; - } -#endif - if (Config_getBool("OPTIMIZE_OUTPUT_JAVA") && Config_getBool("INLINE_INFO")) { // don't show inline info for Java output, since Java has no inline // concept. Config_getBool("INLINE_INFO")=FALSE; } + +#if 0 + if (Config_getString("RTF_OUTPUT_ENCODING").isEmpty()) + { + Config_getString("RTF_OUTPUT_ENCODING")="ISO-8859-1"; + } + if (Config_getString("LATEX_OUTPUT_ENCODING").isEmpty()) + { + Config_getString("LATEX_OUTPUT_ENCODING")="ISO-8859-1"; + } +#endif // add default words if needed QStrList &annotationFromBrief = Config_getList("ABBREVIATE_BRIEF"); @@ -1247,7 +1298,15 @@ void Config::create() addInfo("Project","Project related configuration options"); //----------------------------------------------------------------------------------------------- - + cs = addString( + "DOXYFILE_ENCODING", + "This tag specifies the encoding used for all characters in the config file that \n" + "follow. The default is UTF-8 which is also the encoding used for all text before \n" + "the first occurrence of this tag. Doxygen uses libiconv (or the iconv built into \n" + "libc) for the transcoding. See http://www.gnu.org/software/libiconv for the list of \n" + "possible encodings.\n" + ); + cs->setDefaultValue("UTF-8"); cs = addString( "PROJECT_NAME", "The PROJECT_NAME tag is a single word (or a sequence of words surrounded \n" @@ -1386,6 +1445,8 @@ void Config::create() #ifdef LANG_UA ce->addValue("Ukrainian"); #endif + +#if 0 cb = addBool( "USE_WINDOWS_ENCODING", "This tag can be used to specify the encoding used in the generated output. \n" @@ -1401,6 +1462,9 @@ void Config::create() FALSE #endif ); +#endif + addObsolete("USE_WINDOWS_ENCODING"); + cb = addBool( "BRIEF_MEMBER_DESC", "If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will \n" @@ -1667,11 +1731,7 @@ void Config::create() "allowed. This is useful if you have classes or files whose names only differ \n" "in case and if your file system supports case sensitive file names. Windows \n" "and Mac users are advised to set this option to NO.\n", -#if defined(_WIN32) || defined(macintosh) || defined(__MACOSX__) || defined(__APPLE__) - FALSE // case insensitive file system expected -#else - TRUE // case sensitive file system expected -#endif + portable_fileSystemIsCaseSensitive() ); cb = addBool( "HIDE_SCOPE_NAMES", @@ -1858,6 +1918,13 @@ void Config::create() "with spaces. \n" ); cl->setWidgetType(ConfigList::FileAndDir); + cs = addString( "INPUT_ENCODING", + "This tag can be used to specify the character encoding of the source files that \n" + "doxygen parses. Internally doxygen uses the UTF-8 encoding, which is also the default \n" + "input encoding. Doxygen uses libiconv (or the iconv built into libc) for the transcoding. \n" + "See http://www.gnu.org/software/libiconv for the list of possible encodings.\n" + ); + cs->setDefaultValue("UTF-8"); cl = addList( "FILE_PATTERNS", "If the value of the INPUT tag contains directories, you can use the \n" @@ -1897,6 +1964,13 @@ void Config::create() "for example use the pattern */test/* \n" ); cl = addList( + "EXCLUDE_SYMBOLS", + "The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names \n" + "(namespaces, classes, functions, etc.) that should be excluded from the output. \n" + "The symbol name can be a fully qualified name, a word, or if the wildcard * is used, \n" + "a substring. Examples: ANamespace, AClass, AClass::ANamespace, ANamespace::*Test \n" + ); + cl = addList( "EXAMPLE_PATH", "The EXAMPLE_PATH tag can be used to specify one or more files or \n" "directories that contain example code fragments that are included (see \n" @@ -2206,6 +2280,16 @@ void Config::create() cs->setDefaultValue("latex"); cs->setWidgetType(ConfigString::Dir); cs->addDependency("GENERATE_LATEX"); +#if 0 + cs = addString( "LATEX_OUTPUT_ENCODING", + "The LATEX_OUTPUT_ENCODING specifies the character encoding of the LaTeX output.\n" + "produced by doxygen. If left blank ISO-8859-1 will be used. Doxygen uses \n" + "libiconv for the transcoding. See http://www.gnu.org/software/libiconv for \n" + "the list of possible encodings.\n" + ); + cs->setDefaultValue("ISO-8859-1"); + cs->addDependency("GENERATE_LATEX"); +#endif cs = addString( "LATEX_CMD_NAME", "The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be \n" @@ -2312,6 +2396,16 @@ void Config::create() cs->setDefaultValue("rtf"); cs->setWidgetType(ConfigString::Dir); cs->addDependency("GENERATE_RTF"); +#if 0 + cs = addString( "RTF_OUTPUT_ENCODING", + "The RTF_OUTPUT_ENCODING specifies the character encoding of the RTF output.\n" + "produced by doxygen. If left blank ISO-8859-1 will be used. Doxygen uses \n" + "libiconv for the transcoding. See http://www.gnu.org/software/libiconv for \n" + "the list of possible encodings.\n" + ); + cs->setDefaultValue("ISO-8859-1"); + cs->addDependency("GENERATE_RTF"); +#endif cb = addBool( "COMPACT_RTF", "If the COMPACT_RTF tag is set to YES Doxygen generates more compact \n" @@ -2855,21 +2949,21 @@ static QCString configFileToString(const char *name) config_err("Error: file `%s' not found\n",name); return ""; } - f.setName(name); - fileOpened=f.open(IO_ReadOnly); - if (fileOpened) - { - int fsize=f.size(); - QCString contents(fsize+2); - f.readBlock(contents.data(),fsize); - f.close(); - if (fsize==0 || contents[fsize-1]=='\n') - contents[fsize]='\0'; - else - contents[fsize]='\n'; // to help the scanner - contents[fsize+1]='\0'; - return contents; - } + f.setName(name); + fileOpened=f.open(IO_ReadOnly); + if (fileOpened) + { + int fsize=f.size(); + QCString contents(fsize+2); + f.readBlock(contents.data(),fsize); + f.close(); + if (fsize==0 || contents[fsize-1]=='\n') + contents[fsize]='\0'; + else + contents[fsize]='\n'; // to help the scanner + contents[fsize+1]='\0'; + return contents; + } } if (!fileOpened) { @@ -2897,6 +2991,7 @@ bool Config::parseString(const char *fn,const char *str) bool Config::parse(const char *fn) { + encoding = "UTF-8"; return parseString(fn,configFileToString(fn)); } diff --git a/src/constexp.h b/src/constexp.h index 1a6c37b..0df7ec3 100644 --- a/src/constexp.h +++ b/src/constexp.h @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/constexp.l b/src/constexp.l index 3a09242..c2cd529 100644 --- a/src/constexp.l +++ b/src/constexp.l @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/constexp.y b/src/constexp.y index 81282dc..04c6224 100644 --- a/src/constexp.y +++ b/src/constexp.y @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/cppvalue.cpp b/src/cppvalue.cpp index f1df666..983a55f 100644 --- a/src/cppvalue.cpp +++ b/src/cppvalue.cpp @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/cppvalue.h b/src/cppvalue.h index 0a8d638..b080431 100644 --- a/src/cppvalue.h +++ b/src/cppvalue.h @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/debug.cpp b/src/debug.cpp index 258980e..f1033a5 100644 --- a/src/debug.cpp +++ b/src/debug.cpp @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/debug.h b/src/debug.h index 777b8fe..95891d2 100644 --- a/src/debug.h +++ b/src/debug.h @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/declinfo.h b/src/declinfo.h index 28c8add..7287e1e 100644 --- a/src/declinfo.h +++ b/src/declinfo.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/declinfo.l b/src/declinfo.l index c269700..3ca4c97 100644 --- a/src/declinfo.l +++ b/src/declinfo.l @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/defargs.h b/src/defargs.h index aeb8175..fe9ea28 100644 --- a/src/defargs.h +++ b/src/defargs.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/defargs.l b/src/defargs.l index e5a2de4..94578ff 100644 --- a/src/defargs.l +++ b/src/defargs.l @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/defgen.cpp b/src/defgen.cpp index 8211151..26201b7 100644 --- a/src/defgen.cpp +++ b/src/defgen.cpp @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/defgen.h b/src/defgen.h index 0e03064..5560602 100644 --- a/src/defgen.h +++ b/src/defgen.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/define.cpp b/src/define.cpp index 12846b9..42789be 100644 --- a/src/define.cpp +++ b/src/define.cpp @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/define.h b/src/define.h index fc32bfe..4c1f904 100644 --- a/src/define.h +++ b/src/define.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/definition.cpp b/src/definition.cpp index ce8d1c4..bfcfbad 100644 --- a/src/definition.cpp +++ b/src/definition.cpp @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -135,6 +135,63 @@ void DefinitionImpl::init(const char *df,int dl, //----------------------------------------------------------------------------------------- +static bool matchExcludedSymbols(const char *name) +{ + static QStrList &exclSyms = Config_getList("EXCLUDE_SYMBOLS"); + if (exclSyms.count()==0) return FALSE; // nothing specified + const char *pat = exclSyms.first(); + QCString symName = name; + while (pat) + { + QCString pattern = pat; + bool forceStart=FALSE; + bool forceEnd=FALSE; + if (pattern.at(0)=='^') + pattern=pattern.mid(1),forceStart=TRUE; + if (pattern.at(pattern.length()-1)=='$') + pattern=pattern.left(pattern.length()-1),forceEnd=TRUE; + if (pattern.find('*')!=-1) // wildcard mode + { + QRegExp re(substitute(pattern,"*",".*"),TRUE); + int i,pl; + i = re.match(symName,0,&pl); + //printf(" %d = re.match(%s) pattern=%s\n",i,symName.data(),pattern.data()); + if (i!=-1) // wildcard match + { + int sl=symName.length(); + // check if it is a whole word match + if ((i==0 || pattern.at(0)=='*' || (!isId(symName.at(i-1)) && !forceStart)) && + (i+pl==sl || pattern.at(i+pl)=='*' || (!isId(symName.at(i+pl)) && !forceEnd)) + ) + { + //printf("--> name=%s pattern=%s match at %d\n",symName.data(),pattern.data(),i); + return TRUE; + } + } + } + else if (!pattern.isEmpty()) // match words + { + int i = symName.find(pattern); + if (i!=-1) // we have a match! + { + int pl=pattern.length(); + int sl=symName.length(); + // check if it is a whole word match + if ((i==0 || (!isId(symName.at(i-1)) && !forceStart)) && + (i+pl==sl || (!isId(symName.at(i+pl)) && !forceEnd)) + ) + { + //printf("--> name=%s pattern=%s match at %d\n",symName.data(),pattern.data(),i); + return TRUE; + } + } + } + pat = exclSyms.next(); + } + //printf("--> name=%s: no match\n",name); + return FALSE; +} + void Definition::addToMap(const char *name,Definition *d) { QCString symbolName = name; @@ -224,6 +281,7 @@ Definition::Definition(const char *df,int dl, if (isSymbol) addToMap(name,this); _setBriefDescription(b,df,dl); _setDocumentation(d,df,dl,TRUE); + if (matchExcludedSymbols(name)) m_impl->hidden = TRUE; } Definition::~Definition() @@ -472,6 +530,7 @@ static bool readCodeFragment(const char *fileName, } if (Config_getBool("FILTER_SOURCE_FILES")) pclose(f); else fclose(f); } + result = transcodeCharacterStringToUTF8(result); return found; } @@ -849,6 +908,7 @@ void Definition::setOuterScope(Definition *d) m_impl->qualifiedName.resize(0); // flush cached scope name m_impl->outerScope = d; } + m_impl->hidden = m_impl->hidden || d->isHidden(); } QCString Definition::localName() const @@ -1079,12 +1139,12 @@ bool Definition::isHidden() const bool Definition::isVisibleInProject() const { - return isLinkableInProject() || m_impl->hidden; + return isLinkableInProject() && !m_impl->hidden; } bool Definition::isVisible() const { - return isLinkable() || m_impl->hidden; + return isLinkable() && !m_impl->hidden; } QCString Definition::getReference() const @@ -1155,7 +1215,7 @@ void Definition::_setSymbolName(const QCString &name) void Definition::setHidden(bool b) { makeResident(); - m_impl->hidden = b; + m_impl->hidden = m_impl->hidden || b; } void Definition::setLocalName(const QCString name) diff --git a/src/definition.h b/src/definition.h index d3723a1..0b8b95e 100644 --- a/src/definition.h +++ b/src/definition.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/diagram.cpp b/src/diagram.cpp index d169617..45e839b 100644 --- a/src/diagram.cpp +++ b/src/diagram.cpp @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -33,6 +33,7 @@ //#include "latexgen.h" //#include "htmlgen.h" #include "doxygen.h" +#include "portable.h" //----------------------------------------------------------------------------- @@ -1251,7 +1252,7 @@ void ClassDiagram::writeFigure(QTextStream &output,const char *path, epstopdfArgs.sprintf("\"%s.eps\" --outfile=\"%s.pdf\"", epsBaseName.data(),epsBaseName.data()); //printf("Converting eps using `%s'\n",epstopdfCmd.data()); - if (iSystem("epstopdf",epstopdfArgs)!=0) + if (portable_system("epstopdf",epstopdfArgs)!=0) { err("Error: Problems running epstopdf. Check your TeX installation!\n"); return; diff --git a/src/diagram.h b/src/diagram.h index bf95ef7..ad19723 100644 --- a/src/diagram.h +++ b/src/diagram.h @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/dirdef.cpp b/src/dirdef.cpp index ef5d7b9..7768c32 100644 --- a/src/dirdef.cpp +++ b/src/dirdef.cpp @@ -908,7 +908,7 @@ void writeDirDependencyGraph(const char *dirName) //QCString dotArgs(4096); //dotArgs.sprintf("%s -Tgif -o %s",path.data(),outFile.data()); - //if (iSystem(Config_getString("DOT_PATH")+"dot",dotArgs,FALSE)!=0) + //if (portable_system(Config_getString("DOT_PATH")+"dot",dotArgs,FALSE)!=0) //{ // err("Problems running dot. Check your installation!\n"); //} diff --git a/src/dirdef.h b/src/dirdef.h index d8d7cf1..27224de 100644 --- a/src/dirdef.h +++ b/src/dirdef.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/docparser.cpp b/src/docparser.cpp index dc87b57..090c67f 100644 --- a/src/docparser.cpp +++ b/src/docparser.cpp @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -40,6 +40,7 @@ #include "section.h" #include "searchindex.h" #include "language.h" +#include "portable.h" // debug off #define DBG(x) do {} while(0) @@ -220,7 +221,7 @@ static QCString findAndCopyImage(const char *fileName,DocImage::Type type) epstopdfArgs.sprintf("\"%s/%s.eps\" --outfile=\"%s/%s.pdf\"", outputDir.data(), baseName.data(), outputDir.data(), baseName.data()); - if (iSystem("epstopdf",epstopdfArgs)!=0) + if (portable_system("epstopdf",epstopdfArgs)!=0) { err("Error: Problems running epstopdf. Check your TeX installation!\n"); } @@ -5642,7 +5643,6 @@ DocNode *validatingParseDoc(const char *fileName,int startLine, bool isExample, const char *exampleName, bool singleLine, bool linkFromIndex) { - //printf("validatingParseDoc(%s,%s)\n",ctx?ctx->name().data():"<none>", // md?md->name().data():"<none>"); //printf("========== validating %s at line %d\n",fileName,startLine); diff --git a/src/docparser.h b/src/docparser.h index 4ce3a11..7f074e4 100644 --- a/src/docparser.h +++ b/src/docparser.h @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/doctokenizer.h b/src/doctokenizer.h index 3602b95..301f79b 100644 --- a/src/doctokenizer.h +++ b/src/doctokenizer.h @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/doctokenizer.l b/src/doctokenizer.l index b285322..d26db37 100644 --- a/src/doctokenizer.l +++ b/src/doctokenizer.l @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -31,6 +31,7 @@ #include "membergroup.h" #include "definition.h" #include "doxygen.h" +#include "portable.h" #define YY_NEVER_INTERACTIVE 1 @@ -472,7 +473,7 @@ REFWORD ("#"|"::")?({ID}("."|"#"|"::"|"-"|"/"))*({ID}(":")?){FUNCARG}? <St_Para,St_HtmlOnly>"$("{ID}")" { /* environment variable */ QCString name = &yytext[2]; name = name.left(name.length()-1); - QCString value = getenv(name); + QCString value = portable_getenv(name); for (int i=value.length()-1;i>=0;i--) unput(value.at(i)); } <St_Para>{HTMLTAG} { /* html tag */ diff --git a/src/docvisitor.h b/src/docvisitor.h index c0a5e4d..82f5137 100644 --- a/src/docvisitor.h +++ b/src/docvisitor.h @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/dot.cpp b/src/dot.cpp index e57557a..dae373c 100644 --- a/src/dot.cpp +++ b/src/dot.cpp @@ -1,9 +1,9 @@ /***************************************************************************** * - * $Id$ + * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -33,6 +33,7 @@ #include "docparser.h" #include "debug.h" #include "pagedef.h" +#include "portable.h" #include <qdir.h> #include <qfile.h> @@ -527,7 +528,7 @@ bool DotRunner::run() dotArgs+=' '; dotArgs+=*s; } - if ((exitCode=iSystem(dotExe,dotArgs,FALSE))!=0) + if ((exitCode=portable_system(dotExe,dotArgs,FALSE))!=0) { goto error; } @@ -537,7 +538,7 @@ bool DotRunner::run() for (li.toFirst();(s=li.current());++li) { dotArgs="\""+m_file+"\" "+*s; - if ((exitCode=iSystem(dotExe,dotArgs,FALSE))!=0) + if ((exitCode=portable_system(dotExe,dotArgs,FALSE))!=0) { goto error; } @@ -2063,7 +2064,7 @@ QCString DotClassGraph::writeGraph(QTextStream &out, QCString epstopdfArgs(maxCmdLine); epstopdfArgs.sprintf("\"%s.eps\" --outfile=\"%s.pdf\"", baseName.data(),baseName.data()); - if (iSystem("epstopdf",epstopdfArgs)!=0) + if (portable_system("epstopdf",epstopdfArgs)!=0) { err("Error: Problems running epstopdf. Check your TeX installation!\n"); QDir::setCurrent(oldDir); @@ -2370,7 +2371,7 @@ QCString DotInclDepGraph::writeGraph(QTextStream &out, QCString epstopdfArgs(maxCmdLine); epstopdfArgs.sprintf("\"%s.eps\" --outfile=\"%s.pdf\"", baseName.data(),baseName.data()); - if (iSystem("epstopdf",epstopdfArgs)!=0) + if (portable_system("epstopdf",epstopdfArgs)!=0) { err("Error: Problems running epstopdf. Check your TeX installation!\n"); QDir::setCurrent(oldDir); @@ -2649,7 +2650,7 @@ QCString DotCallGraph::writeGraph(QTextStream &out, GraphOutputFormat format, QCString epstopdfArgs(maxCmdLine); epstopdfArgs.sprintf("\"%s.eps\" --outfile=\"%s.pdf\"", baseName.data(),baseName.data()); - if (iSystem("epstopdf",epstopdfArgs)!=0) + if (portable_system("epstopdf",epstopdfArgs)!=0) { err("Error: Problems running epstopdf. Check your TeX installation!\n"); QDir::setCurrent(oldDir); @@ -2780,7 +2781,7 @@ QCString DotDirDeps::writeGraph(QTextStream &out, QCString epstopdfArgs(maxCmdLine); epstopdfArgs.sprintf("\"%s.eps\" --outfile=\"%s.pdf\"", baseName.data(),baseName.data()); - if (iSystem("epstopdf",epstopdfArgs)!=0) + if (portable_system("epstopdf",epstopdfArgs)!=0) { err("Error: Problems running epstopdf. Check your TeX installation!\n"); QDir::setCurrent(oldDir); @@ -2902,22 +2903,11 @@ void generateGraphLegend(const char *path) QDir::setCurrent(oldDir); } -#undef PUTENV -#if defined(_WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ < 0x0550)) -#define PUTENV _putenv -#else -#define PUTENV putenv -#endif - void writeDotGraphFromFile(const char *inFile,const char *outDir, const char *outFile,GraphOutputFormat format) { QCString absOutFile = outDir; -#ifdef _WIN32 - absOutFile+='\\'; -#else - absOutFile+='/'; -#endif + absOutFile+=portable_pathSeparator(); absOutFile+=outFile; // chdir to the output dir, so dot can find the font file. @@ -2926,18 +2916,14 @@ void writeDotGraphFromFile(const char *inFile,const char *outDir, QDir::setCurrent(outDir); //printf("Going to dir %s\n",QDir::currentDirPath().data()); - QCString env = getenv("DOTFONTPATH"); + QCString env = portable_getenv("DOTFONTPATH"); if (env==".") // this path was set by doxygen, so dot can find the FreeSans.ttf font, // for user defined graphs we use the default search path built into dot, // unless the user has set the DOTFONTPATH as well. { // temporarily remove the DOTFONTPATH environment variable // so dot will use the built-in search path. -#ifdef _WIN32 - SetEnvironmentVariable("DOTFONTPATH", 0); -#else - unsetenv("DOTFONTPATH"); -#endif + portable_unsetenv("DOTFONTPATH"); } QCString imgExt = Config_getEnum("DOT_IMAGE_FORMAT"); @@ -2959,7 +2945,7 @@ void writeDotGraphFromFile(const char *inFile,const char *outDir, QCString epstopdfArgs(maxCmdLine); epstopdfArgs.sprintf("\"%s.eps\" --outfile=\"%s.pdf\"", outFile,outFile); - if (iSystem("epstopdf",epstopdfArgs)!=0) + if (portable_system("epstopdf",epstopdfArgs)!=0) { err("Error: Problems running epstopdf. Check your TeX installation!\n"); } @@ -2970,11 +2956,7 @@ void writeDotGraphFromFile(const char *inFile,const char *outDir, if (env==".") { // restore the DOTFONTPATH variable again -#ifdef _WIN32 - SetEnvironmentVariable("DOTFONTPATH", env); -#else - setenv("DOTFONTPATH",env,1); -#endif + portable_setenv("DOTFONTPATH",env); } error: @@ -3320,7 +3302,7 @@ QCString DotGroupCollaboration::writeGraph( QTextStream &t, GraphOutputFormat fo QCString epstopdfArgs(maxCmdLine); epstopdfArgs.sprintf("\"%s.eps\" --outfile=\"%s.pdf\"", baseName.data(),baseName.data()); - if (iSystem("epstopdf",epstopdfArgs)!=0) + if (portable_system("epstopdf",epstopdfArgs)!=0) { err("Error: Problems running epstopdf. Check your TeX installation!\n"); QDir::setCurrent(oldDir); @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/doxygen.cpp b/src/doxygen.cpp index 68d7055..b4b2025 100644 --- a/src/doxygen.cpp +++ b/src/doxygen.cpp @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -28,6 +28,7 @@ #include <sys/stat.h> #include <qtextcodec.h> #include <unistd.h> +#include <errno.h> #include "version.h" #include "doxygen.h" @@ -71,6 +72,7 @@ #include "objcache.h" #include "store.h" #include "marshal.h" +#include "portable.h" #define RECURSE_ENTRYTREE(func,var) \ do { if (var->children()) { \ @@ -79,11 +81,6 @@ } } while(0) -#if defined(_MSC_VER) || defined(__BORLANDC__) -#define popen _popen -#define pclose _pclose -#endif - #if !defined(_WIN32) || defined(__CYGWIN__) #include <signal.h> #define HAS_SIGNALS @@ -149,6 +146,8 @@ FileStorage *g_storage = 0; QCString spaces; +static bool g_successfulRun = FALSE; + void clearAll() @@ -1422,7 +1421,6 @@ static void buildNamespaceList(EntryNav *rootNav) nd->setDocumentation(root->doc,root->docFile,root->docLine); // copy docs to definition nd->setBriefDescription(root->brief,root->briefFile,root->briefLine); nd->addSectionsToDefinition(root->anchors); - nd->setHidden(root->hidden); //printf("Adding namespace to group\n"); addNamespaceToGroups(root,nd); @@ -3846,8 +3844,15 @@ static bool findTemplateInstanceRelation(Entry *root, EntryNav *templateRootNav = classEntries.find(templateClass->name()); if (templateRootNav) { - templateRootNav->loadEntry(g_storage); + bool unloadNeeded=FALSE; Entry *templateRoot = templateRootNav->entry(); + if (templateRoot==0) // not yet loaded + { + templateRootNav->loadEntry(g_storage); + templateRoot = templateRootNav->entry(); + ASSERT(templateRoot!=0); // now it should really be loaded + unloadNeeded=TRUE; + } Debug::print(Debug::Classes,0," template root found %s templSpec=%s!\n", templateRoot->name.data(),templSpec.data()); @@ -3860,7 +3865,10 @@ static bool findTemplateInstanceRelation(Entry *root, isArtificial,templArgs,templateNames); delete templArgs; - templateRootNav->releaseEntry(); + if (unloadNeeded) // still cleanup to do + { + templateRootNav->releaseEntry(); + } } else { @@ -8022,6 +8030,7 @@ static void generateConfigFile(const char *configFile,bool shortList, if (fileOpened) { QTextStream t(&f); + t.setEncoding(QTextStream::Latin1); Config::instance()->writeTemplate(t,shortList,updateOnly); if (!writeToStdout) { @@ -8128,6 +8137,43 @@ static bool patternMatch(QFileInfo *fi,QStrList *patList) return found; } +static int transcodeCharacterBuffer(BufStr &srcBuf,int size, + const char *inputEncoding,const char *outputEncoding) +{ + if (inputEncoding==0 || outputEncoding==0) return size; + if (qstricmp(inputEncoding,outputEncoding)==0) return size; + void *cd = portable_iconv_open(outputEncoding,inputEncoding); + if (cd==(void *)(-1)) + { + err("Error: unsupported character conversion: '%s'->'%s': %s\n" + "Check the INPUT_ENCODING setting in the config file!\n", + inputEncoding,outputEncoding,strerror(errno)); + exit(1); + } + int tmpBufSize=size*4+1; + BufStr tmpBuf(tmpBufSize); + size_t iLeft=size; + size_t oLeft=tmpBufSize; + const char *srcPtr = srcBuf.data(); + char *dstPtr = tmpBuf.data(); + uint newSize=0; + if (!portable_iconv(cd, &srcPtr, &iLeft, &dstPtr, &oLeft)) + { + newSize = tmpBufSize-oLeft; + srcBuf.shrink(newSize); + strncpy(srcBuf.data(),tmpBuf.data(),newSize); + //printf("iconv: input size=%d output size=%d\n[%s]\n",size,newSize,srcBuf.data()); + } + else + { + err("Error: failed to translate characters from %s to %s: check INPUT_ENCODING\n", + inputEncoding,outputEncoding); + exit(1); + } + portable_iconv_close(cd); + return newSize; +} + //---------------------------------------------------------------------------- // reads a file into an array and filters out any 0x00 and 0x06 bytes, // because these are special for the parser. @@ -8136,7 +8182,7 @@ static void copyAndFilterFile(const char *fileName,BufStr &dest) { // try to open file int size=0; - uint oldPos = dest.curPos(); + //uint oldPos = dest.curPos(); //printf(".......oldPos=%d\n",oldPos); QFileInfo fi(fileName); @@ -8153,7 +8199,7 @@ static void copyAndFilterFile(const char *fileName,BufStr &dest) size=fi.size(); // read the file dest.skip(size); - if (f.readBlock(dest.data()+oldPos,size)!=size) + if (f.readBlock(dest.data()/*+oldPos*/,size)!=size) { err("Error while reading file %s\n",fileName); return; @@ -8162,7 +8208,7 @@ static void copyAndFilterFile(const char *fileName,BufStr &dest) else { QCString cmd=filterName+" \""+fileName+"\""; - FILE *f=popen(cmd,"r"); + FILE *f=portable_popen(cmd,"r"); if (!f) { err("Error: could not execute filter %s\n",filterName.data()); @@ -8176,7 +8222,7 @@ static void copyAndFilterFile(const char *fileName,BufStr &dest) //printf(">>>>>>>>Reading %d bytes\n",numRead); dest.addArray(buf,numRead),size+=numRead; } - pclose(f); + portable_pclose(f); } // filter unwanted bytes from the resulting data uchar conv[256]; @@ -8185,14 +8231,14 @@ static void copyAndFilterFile(const char *fileName,BufStr &dest) conv[0x06]=0x20; // replace the offending characters with spaces conv[0x00]=0x20; // remove any special markers from the input - uchar *p=(uchar *)dest.data()+oldPos; + uchar *p=(uchar *)dest.data()/*+oldPos*/; for (i=0;i<size;i++,p++) *p=conv[*p]; // and translate CR's - int newSize=filterCRLF(dest.data()+oldPos,size); + int newSize=filterCRLF(dest.data()/*+oldPos*/,size); //printf("filter char at %p size=%d newSize=%d\n",dest.data()+oldPos,size,newSize); if (newSize!=size) // we removed chars { - dest.shrink(oldPos+newSize); // resize the array + dest.shrink(/*oldPos+*/newSize); // resize the array //printf(".......resizing from %d to %d result=[%s]\n",oldPos+size,oldPos+newSize,dest.data()); } } @@ -8232,6 +8278,18 @@ static void copyStyleSheet() static void parseFiles(Entry *root,EntryNav *rootNav) { + void *cd = 0; + QCString inpEncoding = Config_getString("INPUT_ENCODING"); + bool needsTranscoding = !inpEncoding.isEmpty(); + if (needsTranscoding) + { + if (!(cd = portable_iconv_open("UTF-8", inpEncoding))) + { + err("Error: unsupported character enconding: '%s'",inpEncoding.data()); + exit(1); + } + } + QCString *s=inputFiles.first(); while (s) { @@ -8243,23 +8301,27 @@ static void parseFiles(Entry *root,EntryNav *rootNav) QFileInfo fi(fileName); BufStr preBuf(fi.size()+4096); - BufStr *bufPtr = &preBuf; + //BufStr *bufPtr = &preBuf; if (Config_getBool("ENABLE_PREPROCESSING") && parser->needsPreprocessing(extension)) { msg("Preprocessing %s...\n",s->data()); - preprocessFile(fileName,*bufPtr); + preprocessFile(fileName,preBuf); } else { msg("Reading %s...\n",s->data()); - copyAndFilterFile(fileName,*bufPtr); + copyAndFilterFile(fileName,preBuf); } - bufPtr->addChar('\n'); /* to prevent problems under Windows ? */ + preBuf.addChar('\n'); /* to prevent problems under Windows ? */ + + // do character transcoding if needed. + transcodeCharacterBuffer(preBuf,preBuf.curPos(), + Config_getString("INPUT_ENCODING"),"UTF-8"); - BufStr convBuf(bufPtr->curPos()+1024); + BufStr convBuf(preBuf.curPos()+1024); // convert multi-line C++ comments to C style comments convertCppComments(&preBuf,&convBuf,fileName); @@ -8622,7 +8684,7 @@ static void readAliases() static void usage(const char *name) { - msg("Doxygen version %s\nCopyright Dimitri van Heesch 1997-2006\n\n",versionString); + msg("Doxygen version %s\nCopyright Dimitri van Heesch 1997-2007\n\n",versionString); msg("You can use doxygen in a number of ways:\n\n"); msg("1) Use doxygen to generate a template configuration file:\n"); msg(" %s [-s] -g [configName]\n\n",name); @@ -9073,9 +9135,27 @@ static void stopDoxygen(int) } #endif +static void exitDoxygen() +{ + if (!g_successfulRun) // premature exit + { + QDir thisDir; + msg("Exiting...\n"); + if (!Doxygen::entryDBFileName.isEmpty()) + { + thisDir.remove(Doxygen::entryDBFileName); + } + if (!Doxygen::objDBFileName.isEmpty()) + { + thisDir.remove(Doxygen::objDBFileName); + } + } +} void parseInput() { + atexit(exitDoxygen); + /************************************************************************** * Make sure the output directory exists **************************************************************************/ @@ -9120,7 +9200,7 @@ void parseInput() signal(SIGINT, stopDoxygen); #endif - uint pid = iPid(); + uint pid = portable_pid(); Doxygen::objDBFileName.sprintf("doxygen_objdb_%d.tmp",pid); Doxygen::objDBFileName.prepend(outputDirectory+"/"); Doxygen::entryDBFileName.sprintf("doxygen_entrydb_%d.tmp",pid); @@ -9741,17 +9821,15 @@ void generateOutput() msg("Generating style sheet...\n"); //printf("writing style info\n"); + QCString genString = + theTranslator->trGeneratedAt(dateToString(TRUE),Config_getString("PROJECT_NAME")); outputList->writeStyleInfo(0); // write first part outputList->disableAllBut(OutputGenerator::Latex); - outputList->parseText( - theTranslator->trGeneratedAt(dateToString(TRUE),Config_getString("PROJECT_NAME")) - ); + outputList->parseText(genString); outputList->writeStyleInfo(1); // write second part //parseText(*outputList,theTranslator->trWrittenBy()); outputList->writeStyleInfo(2); // write third part - outputList->parseText( - theTranslator->trGeneratedAt(dateToString(TRUE),Config_getString("PROJECT_NAME")) - ); + outputList->parseText(genString); outputList->writeStyleInfo(3); // write fourth part //parseText(*outputList,theTranslator->trWrittenBy()); outputList->writeStyleInfo(4); // write last part @@ -9897,7 +9975,7 @@ void generateOutput() msg("Running html help compiler...\n"); QString oldDir = QDir::currentDirPath(); QDir::setCurrent(Config_getString("HTML_OUTPUT")); - if (iSystem(Config_getString("HHC_LOCATION"), "index.hhp", FALSE)) + if (portable_system(Config_getString("HHC_LOCATION"), "index.hhp", FALSE)) { err("Error: failed to run html help compiler on index.hhp"); } @@ -9934,5 +10012,6 @@ void generateOutput() delete Doxygen::symbolCache; delete Doxygen::symbolMap; delete Doxygen::symbolStorage; + g_successfulRun=TRUE; } diff --git a/src/doxygen.h b/src/doxygen.h index c52829c..bb98dab 100644 --- a/src/doxygen.h +++ b/src/doxygen.h @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/doxygen.pro.in b/src/doxygen.pro.in index 7d1e812..25fdfb3 100644 --- a/src/doxygen.pro.in +++ b/src/doxygen.pro.in @@ -1,7 +1,7 @@ # # # -# Copyright (C) 1997-2006 by Dimitri van Heesch. +# Copyright (C) 1997-2007 by Dimitri van Heesch. # # Permission to use, copy, modify, and distribute this software and its # documentation under the terms of the GNU General Public License is hereby @@ -18,15 +18,15 @@ TEMPLATE = app.t CONFIG = console warn_on $extraopts HEADERS = doxygen.h SOURCES = main.cpp -unix:LIBS += -L../lib -ldoxygen -ldoxycfg -lqtools -lpng -lmd5 +unix:LIBS += -L../lib -ldoxygen -ldoxycfg -lqtools -lpng -lmd5 win32:INCLUDEPATH += . -win32-mingw:LIBS += -L../lib -ldoxygen -ldoxycfg -lqtools -lpng -lmd5 +win32-mingw:LIBS += -L../lib -ldoxygen -ldoxycfg -lqtools -lpng -lmd5 win32-msvc:LIBS += qtools.lib png.lib md5.lib doxygen.lib doxycfg.lib shell32.lib win32-msvc:TMAKE_LFLAGS += /LIBPATH:..\lib win32-borland:LIBS += qtools.lib png.lib md5.lib doxygen.lib doxycfg.lib shell32.lib win32-borland:TMAKE_LFLAGS += -L..\lib -L$(BCB)\lib\psdk win32:TMAKE_CXXFLAGS += -DQT_NODLL -win32-g++:LIBS = -L../lib -ldoxygen -ldoxycfg -lqtools -lpng -lmd5 +win32-g++:LIBS = -L../lib -ldoxygen -ldoxycfg -lqtools -lpng -lmd5 win32-g++:TMAKE_CXXFLAGS += -fno-exceptions -fno-rtti INCLUDEPATH += ../qtools ../libpng ../libmd5 . #win32-g++:INCLUDEPATH -= ../libpng diff --git a/src/doxytag.l b/src/doxytag.l index 53e89a3..5c8a4b3 100644 --- a/src/doxytag.l +++ b/src/doxytag.l @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -750,7 +750,7 @@ void parseFileOrDir(const char *fileName) void usage(const char *name) { - fprintf(stderr,"Doxytag version %s\nCopyright Dimitri van Heesch 1997-2006\n\n", + fprintf(stderr,"Doxytag version %s\nCopyright Dimitri van Heesch 1997-2007\n\n", versionString); fprintf(stderr," Generates a tag file and/or a search index for a set of HTML files\n\n"); fprintf(stderr,"Usage: %s [-t tag_file] [ html_file [html_file...] ]\n",name); diff --git a/src/doxytag.pro.in b/src/doxytag.pro.in index 8df2777..28e829e 100644 --- a/src/doxytag.pro.in +++ b/src/doxytag.pro.in @@ -1,7 +1,7 @@ # # # -# Copyright (C) 1997-2006 by Dimitri van Heesch. +# Copyright (C) 1997-2007 by Dimitri van Heesch. # # Permission to use, copy, modify, and distribute this software and its # documentation under the terms of the GNU General Public License is hereby diff --git a/src/doxytag.t b/src/doxytag.t index 82cf04b..570acc3 100644 --- a/src/doxytag.t +++ b/src/doxytag.t @@ -1,7 +1,7 @@ # # # -# Copyright (C) 1997-2006 by Dimitri van Heesch. +# Copyright (C) 1997-2007 by Dimitri van Heesch. # # Permission to use, copy, modify, and distribute this software and its # documentation under the terms of the GNU General Public License is hereby diff --git a/src/entry.cpp b/src/entry.cpp index eaeaf5e..ca831c8 100644 --- a/src/entry.cpp +++ b/src/entry.cpp @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/entry.h b/src/entry.h index 30b55fb..8c45ad0 100644 --- a/src/entry.h +++ b/src/entry.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/example.h b/src/example.h index 4b6e06e..98fde77 100644 --- a/src/example.h +++ b/src/example.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/filedef.cpp b/src/filedef.cpp index 046232c..ecbb102 100644 --- a/src/filedef.cpp +++ b/src/filedef.cpp @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -33,11 +33,7 @@ #include "searchindex.h" #include "htags.h" #include "parserintf.h" - -#if defined(_MSC_VER) || defined(__BORLANDC__) -#define popen _popen -#define pclose _pclose -#endif +#include "portable.h" class DevNullCodeDocInterface : public CodeOutputInterface { @@ -712,6 +708,7 @@ void FileDef::addMembersToMemberGroup() /*! Adds member definition \a md to the list of all members of this file */ void FileDef::insertMember(MemberDef *md) { + if (md->isHidden()) return; //printf("%s:FileDef::insertMember(%s (=%p) list has %d elements)\n", // name().data(),md->name().data(),md,allMemberList.count()); MemberList *allMemberList = getMemberList(MemberList::allMembersList); @@ -769,6 +766,7 @@ void FileDef::insertMember(MemberDef *md) /*! Adds compound definition \a cd to the list of all compounds of this file */ void FileDef::insertClass(ClassDef *cd) { + if (cd->isHidden()) return; if (classSDict==0) { classSDict = new ClassSDict(17); @@ -782,6 +780,7 @@ void FileDef::insertClass(ClassDef *cd) /*! Adds namespace definition \a nd to the list of all compounds of this file */ void FileDef::insertNamespace(NamespaceDef *nd) { + if (nd->isHidden()) return; if (!nd->name().isEmpty() && (namespaceSDict==0 || namespaceSDict->find(nd->name())==0)) { @@ -1310,7 +1309,7 @@ void FileDef::acquireFileVersion() if (!vercmd.isEmpty()) { msg("Version of %s : ",filepath.data()); - FILE *f=popen(vercmd+" \""+filepath+"\"","r"); + FILE *f=portable_popen(vercmd+" \""+filepath+"\"","r"); if (!f) { err("Error: could not execute %s\n",vercmd.data()); @@ -1319,7 +1318,7 @@ void FileDef::acquireFileVersion() const int bufSize=1024; char buf[bufSize]; int numRead = fread(buf,1,bufSize,f); - pclose(f); + portable_pclose(f); if (numRead > 0) { fileVersion = QCString(buf,numRead).stripWhiteSpace(); diff --git a/src/filedef.h b/src/filedef.h index c5b99ab..1ad232c 100644 --- a/src/filedef.h +++ b/src/filedef.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/filename.cpp b/src/filename.cpp index 2399124..21659ef 100644 --- a/src/filename.cpp +++ b/src/filename.cpp @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/filename.h b/src/filename.h index c1b30b6..b665255 100644 --- a/src/filename.h +++ b/src/filename.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/formula.cpp b/src/formula.cpp index 07d60d2..673ca7e 100644 --- a/src/formula.cpp +++ b/src/formula.cpp @@ -2,7 +2,7 @@ i * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -17,9 +17,6 @@ #include <stdlib.h> #include <unistd.h> -#ifdef _WIN32 -#include <windows.h> -#endif #include "qtbc.h" #include <qfile.h> @@ -32,6 +29,7 @@ #include "util.h" #include "message.h" #include "config.h" +#include "portable.h" Formula::Formula(const char *text) { @@ -105,7 +103,7 @@ void FormulaList::generateBitmaps(const char *path) //system("latex _formulas.tex </dev/null >/dev/null"); QCString latexCmd = Config_getString("LATEX_CMD_NAME"); if (latexCmd.isEmpty()) latexCmd="latex"; - if (iSystem(latexCmd,"_formulas.tex")!=0) + if (portable_system(latexCmd,"_formulas.tex")!=0) { err("Problems running latex. Check your installation or look " "for typos in _formulas.tex and check _formulas.log!\n"); @@ -127,7 +125,7 @@ void FormulaList::generateBitmaps(const char *path) // encapsulated postscript. sprintf(dviArgs,"-q -D 600 -E -n 1 -p %d -o %s.eps _formulas.dvi", pageIndex,formBase.data()); - if (iSystem("dvips",dviArgs)!=0) + if (portable_system("dvips",dviArgs)!=0) { err("Problems running dvips. Check your installation!\n"); return; @@ -175,22 +173,15 @@ void FormulaList::generateBitmaps(const char *path) // The pixmap is a truecolor image, where only black and white are // used. -#if defined(_WIN32) && !defined(__CYGWIN__) - // used the c version of program, so standard in / standard out work. - const char *ghostscriptCommand = "gswin32c.exe"; -#else - const char *ghostscriptCommand = "gs"; -#endif - char gsArgs[4096]; sprintf(gsArgs,"-q -g%dx%d -r%dx%dx -sDEVICE=ppmraw " "-sOutputFile=%s.pnm -dNOPAUSE -dBATCH -- %s.ps", gx,gy,(int)(scaleFactor*72),(int)(scaleFactor*72), formBase.data(),formBase.data() ); - if (iSystem(ghostscriptCommand,gsArgs)!=0) + if (portable_system(portable_ghostScriptCommand(),gsArgs)!=0) { - err("Problem running ghostscript %s %s. Check your installation!\n",ghostscriptCommand,gsArgs); + err("Problem running ghostscript %s %s. Check your installation!\n",portable_ghostScriptCommand(),gsArgs); return; } f.setName(formBase+".pnm"); diff --git a/src/formula.h b/src/formula.h index a4c0f53..581b6a2 100644 --- a/src/formula.h +++ b/src/formula.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/groupdef.cpp b/src/groupdef.cpp index 13a5681..4370f5c 100644 --- a/src/groupdef.cpp +++ b/src/groupdef.cpp @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -153,6 +153,7 @@ void GroupDef::findSectionsInDocumentation() void GroupDef::addFile(const FileDef *def) { + if (def->isHidden()) return; if (Config_getBool("SORT_BRIEF_DOCS")) fileList->inSort(def); else @@ -161,6 +162,7 @@ void GroupDef::addFile(const FileDef *def) void GroupDef::addClass(const ClassDef *cd) { + if (cd->isHidden()) return; if (Config_getBool("SORT_BRIEF_DOCS")) classSDict->inSort(cd->name(),cd); else @@ -169,6 +171,7 @@ void GroupDef::addClass(const ClassDef *cd) void GroupDef::addNamespace(const NamespaceDef *def) { + if (def->isHidden()) return; if (Config_getBool("SORT_BRIEF_DOCS")) namespaceSDict->inSort(def->name(),def); else @@ -177,6 +180,7 @@ void GroupDef::addNamespace(const NamespaceDef *def) void GroupDef::addDir(const DirDef *def) { + if (def->isHidden()) return; if (Config_getBool("SORT_BRIEF_DOCS")) dirList->inSort(def); else @@ -185,6 +189,7 @@ void GroupDef::addDir(const DirDef *def) void GroupDef::addPage(PageDef *def) { + if (def->isHidden()) return; //printf("Making page %s part of a group\n",def->name.data()); pageDict->append(def->name(),def); def->makePartOfGroup(this); @@ -192,6 +197,7 @@ void GroupDef::addPage(PageDef *def) void GroupDef::addExample(const PageDef *def) { + if (def->isHidden()) return; exampleDict->append(def->name(),def); } @@ -229,6 +235,7 @@ void GroupDef::addMembersToMemberGroup() bool GroupDef::insertMember(MemberDef *md,bool docOnly) { + if (md->isHidden()) return FALSE; //printf("GroupDef(%s)::insertMember(%s)\n", title.data(), md->name().data()); MemberNameInfo *mni=0; if ((mni=(*allMemberNameInfoSDict)[md->name()])) diff --git a/src/groupdef.h b/src/groupdef.h index 25bc79d..dddf52b 100644 --- a/src/groupdef.h +++ b/src/groupdef.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/htags.cpp b/src/htags.cpp index 012c844..05cf07b 100644 --- a/src/htags.cpp +++ b/src/htags.cpp @@ -1,6 +1,6 @@ /****************************************************************************** * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -23,6 +23,7 @@ #include "util.h" #include "message.h" #include "config.h" +#include "portable.h" bool Htags::useHtags = FALSE; @@ -89,7 +90,7 @@ bool Htags::execute(const QCString &htmldir) QCString oldDir = convertToQCString(QDir::currentDirPath()); QDir::setCurrent(g_inputDir.absPath()); //printf("CommandLine=[%s]\n",commandLine.data()); - bool result=iSystem("htags",commandLine,FALSE)==0; + bool result=portable_system("htags",commandLine,FALSE)==0; QDir::setCurrent(oldDir); return result; } diff --git a/src/htags.h b/src/htags.h index 1038e91..a75e9c7 100644 --- a/src/htags.h +++ b/src/htags.h @@ -1,6 +1,6 @@ /****************************************************************************** * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/htmlattrib.h b/src/htmlattrib.h index 9a1609b..3291d05 100644 --- a/src/htmlattrib.h +++ b/src/htmlattrib.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/htmldocvisitor.cpp b/src/htmldocvisitor.cpp index cc59c47..4f1034f 100644 --- a/src/htmldocvisitor.cpp +++ b/src/htmldocvisitor.cpp @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -1081,7 +1081,7 @@ void HtmlDocVisitor::startLink(const QString &ref,const QString &file, m_t << "href=\""; if (!ref.isEmpty()) { - if ((dest=Doxygen::tagDestinationDict[ref])) m_t << relPath << *dest << "/"; + if ((dest=Doxygen::tagDestinationDict[ref])) m_t << *dest << "/"; } else { diff --git a/src/htmldocvisitor.h b/src/htmldocvisitor.h index 5cf95c0..7dedf88 100644 --- a/src/htmldocvisitor.h +++ b/src/htmldocvisitor.h @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/htmlgen.cpp b/src/htmlgen.cpp index 235fb64..3dbec0e 100644 --- a/src/htmlgen.cpp +++ b/src/htmlgen.cpp @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -546,8 +546,9 @@ static void writeDefaultHeaderFile(QTextStream &t, const char *title, t << "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n" "<html><head>" - "<meta http-equiv=\"Content-Type\" content=\"text/html;charset=" - << theTranslator->idLanguageCharset() << "\">\n" + "<meta http-equiv=\"Content-Type\" content=\"text/html;charset=UTF-8" + //<< theTranslator->idLanguageCharset() + << "\">\n" "<title>"; t << convertToHtml(title); t << "</title>\n"; @@ -778,6 +779,10 @@ void HtmlGenerator::startIndexItem(const char *ref,const char *f) { if ((dest=Doxygen::tagDestinationDict[ref])) t << *dest << "/"; } + else + { + t << relPath; + } if (f) t << f << Doxygen::htmlFileExtension << "\">"; } else diff --git a/src/htmlgen.h b/src/htmlgen.h index ed57628..8ca87d0 100644 --- a/src/htmlgen.h +++ b/src/htmlgen.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/htmlhelp.cpp b/src/htmlhelp.cpp index c9328e6..5cbb5c7 100644 --- a/src/htmlhelp.cpp +++ b/src/htmlhelp.cpp @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/htmlhelp.h b/src/htmlhelp.h index 67e0e20..81cac26 100644 --- a/src/htmlhelp.h +++ b/src/htmlhelp.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/image.cpp b/src/image.cpp index ee00835..811317a 100644 --- a/src/image.cpp +++ b/src/image.cpp @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/image.h b/src/image.h index 49ba9ba..34a07f3 100644 --- a/src/image.h +++ b/src/image.h @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/index.cpp b/src/index.cpp index 076a68b..dc8cdd5 100644 --- a/src/index.cpp +++ b/src/index.cpp @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/index.h b/src/index.h index e63537f..ebe563e 100644 --- a/src/index.h +++ b/src/index.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/instdox.cpp b/src/instdox.cpp index 3f814d4..85ff84d 100644 --- a/src/instdox.cpp +++ b/src/instdox.cpp @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/instdox.h b/src/instdox.h index ede8e8f..a35e2b1 100644 --- a/src/instdox.h +++ b/src/instdox.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/language.cpp b/src/language.cpp index 58655d8..1168bef 100644 --- a/src/language.cpp +++ b/src/language.cpp @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -19,6 +19,7 @@ #include "language.h" #include "lang_cfg.h" #include "translator.h" +#include "translatordecoder.h" #include "translator_en.h" #if !defined(ENGLISH_ONLY) #include "translator_adapter.h" @@ -159,55 +160,55 @@ bool setTranslator(const char *langName) #ifdef LANG_SE else if (L_EQUAL("swedish")) { - theTranslator=new TranslatorSwedish; + theTranslator=new TranslatorDecoder(new TranslatorSwedish); } #endif #ifdef LANG_CZ else if (L_EQUAL("czech")) { - theTranslator=new TranslatorCzech; + theTranslator=new TranslatorDecoder(new TranslatorCzech); } #endif #ifdef LANG_FR else if (L_EQUAL("french")) { - theTranslator=new TranslatorFrench; + theTranslator=new TranslatorDecoder(new TranslatorFrench); } #endif #ifdef LANG_ID else if (L_EQUAL("indonesian")) { - theTranslator=new TranslatorIndonesian; + theTranslator=new TranslatorDecoder(new TranslatorIndonesian); } #endif #ifdef LANG_IT else if (L_EQUAL("italian")) { - theTranslator=new TranslatorItalian; + theTranslator=new TranslatorDecoder(new TranslatorItalian); } #endif #ifdef LANG_DE else if (L_EQUAL("german")) { - theTranslator=new TranslatorGerman; + theTranslator=new TranslatorDecoder(new TranslatorGerman); } #endif #ifdef LANG_JP else if (L_EQUAL("japanese")) { - theTranslator=new TranslatorJapanese; + theTranslator=new TranslatorDecoder(new TranslatorJapanese); } #endif #ifdef LANG_JE else if (L_EQUAL("japanese-en")) { - theTranslator=new TranslatorJapaneseEn; + theTranslator=new TranslatorDecoder(new TranslatorJapaneseEn); } #endif #ifdef LANG_ES else if (L_EQUAL("spanish")) { - theTranslator=new TranslatorSpanish; + theTranslator=new TranslatorDecoder(new TranslatorSpanish); } #endif #ifdef LANG_FI @@ -221,139 +222,139 @@ bool setTranslator(const char *langName) #ifdef LANG_RU else if (L_EQUAL("russian")) { - theTranslator=new TranslatorRussian; + theTranslator=new TranslatorDecoder(new TranslatorRussian); } #endif #ifdef LANG_HR else if (L_EQUAL("croatian")) { - theTranslator=new TranslatorCroatian; + theTranslator=new TranslatorDecoder(new TranslatorCroatian); } #endif #ifdef LANG_PL else if (L_EQUAL("polish")) { - theTranslator=new TranslatorPolish; + theTranslator=new TranslatorDecoder(new TranslatorPolish); } #endif #ifdef LANG_PT else if (L_EQUAL("portuguese")) { - theTranslator=new TranslatorPortuguese; + theTranslator=new TranslatorDecoder(new TranslatorPortuguese); } #endif #ifdef LANG_HU else if (L_EQUAL("hungarian")) { - theTranslator=new TranslatorHungarian; + theTranslator=new TranslatorDecoder(new TranslatorHungarian); } #endif #ifdef LANG_KR else if (L_EQUAL("korean")) { - theTranslator=new TranslatorKorean; + theTranslator=new TranslatorDecoder(new TranslatorKorean); } #endif #ifdef LANG_KE else if (L_EQUAL("korean-en")) { - theTranslator=new TranslatorKoreanEn; + theTranslator=new TranslatorDecoder(new TranslatorKoreanEn); } #endif #ifdef LANG_RO else if (L_EQUAL("romanian")) { - theTranslator=new TranslatorRomanian; + theTranslator=new TranslatorDecoder(new TranslatorRomanian); } #endif #ifdef LANG_SI else if (L_EQUAL("slovene")) { - theTranslator=new TranslatorSlovene; + theTranslator=new TranslatorDecoder(new TranslatorSlovene); } #endif #ifdef LANG_CN else if (L_EQUAL("chinese")) { - theTranslator=new TranslatorChinese; + theTranslator=new TranslatorDecoder(new TranslatorChinese); } #endif #ifdef LANG_TW else if (L_EQUAL("chinese-traditional")) { - theTranslator=new TranslatorChinesetraditional; + theTranslator=new TranslatorDecoder(new TranslatorChinesetraditional); } #endif #ifdef LANG_NO else if (L_EQUAL("norwegian")) { - theTranslator=new TranslatorNorwegian; + theTranslator=new TranslatorDecoder(new TranslatorNorwegian); } #endif #ifdef LANG_BR else if (L_EQUAL("brazilian")) { - theTranslator=new TranslatorBrazilian; + theTranslator=new TranslatorDecoder(new TranslatorBrazilian); } #endif #ifdef LANG_DK else if (L_EQUAL("danish")) { - theTranslator=new TranslatorDanish; + theTranslator=new TranslatorDecoder(new TranslatorDanish); } #endif #ifdef LANG_SK else if (L_EQUAL("slovak")) { - theTranslator=new TranslatorSlovak; + theTranslator=new TranslatorDecoder(new TranslatorSlovak); } #endif #ifdef LANG_UA else if (L_EQUAL("ukrainian")) { - theTranslator=new TranslatorUkrainian; + theTranslator=new TranslatorDecoder(new TranslatorUkrainian); } #endif #ifdef LANG_GR else if (L_EQUAL("greek")) { - theTranslator=new TranslatorGreek; + theTranslator=new TranslatorDecoder(new TranslatorGreek); } #endif #ifdef LANG_SR else if (L_EQUAL("serbian")) { - theTranslator=new TranslatorSerbian; + theTranslator=new TranslatorDecoder(new TranslatorSerbian); } #endif #ifdef LANG_CA else if (L_EQUAL("catalan")) { - theTranslator=new TranslatorCatalan; + theTranslator=new TranslatorDecoder(new TranslatorCatalan); } #endif #ifdef LANG_LT else if (L_EQUAL("lithuanian")) { - theTranslator=new TranslatorLithuanian; + theTranslator=new TranslatorDecoder(new TranslatorLithuanian); } #endif #ifdef LANG_ZA else if (L_EQUAL("afrikaans")) { - theTranslator=new TranslatorAfrikaans; + theTranslator=new TranslatorDecoder(new TranslatorAfrikaans); } #endif #ifdef LANG_AR else if (L_EQUAL("arabic")) { - theTranslator=new TranslatorArabic; + theTranslator=new TranslatorDecoder(new TranslatorArabic); } #endif #ifdef LANG_FA else if (L_EQUAL("persian")) { - theTranslator=new TranslatorPersian; + theTranslator=new TranslatorDecoder(new TranslatorPersian); } #endif #endif // ENGLISH_ONLY diff --git a/src/language.h b/src/language.h index 22932eb..2028387 100644 --- a/src/language.h +++ b/src/language.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/latexdocvisitor.cpp b/src/latexdocvisitor.cpp index 9ac9a87..9426a1e 100644 --- a/src/latexdocvisitor.cpp +++ b/src/latexdocvisitor.cpp @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/latexdocvisitor.h b/src/latexdocvisitor.h index 2241f06..62f1011 100644 --- a/src/latexdocvisitor.h +++ b/src/latexdocvisitor.h @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/latexgen.cpp b/src/latexgen.cpp index 624278d..385c7bc 100644 --- a/src/latexgen.cpp +++ b/src/latexgen.cpp @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -239,19 +239,22 @@ static void writeDefaultHeaderPart1(QTextStream &t) << "\\usepackage[ps2pdf," << endl << " pagebackref=true," << endl << " colorlinks=true," << endl - << " linkcolor=blue" << endl + << " linkcolor=blue," << endl + << " unicode" << endl << " ]{hyperref}" << endl << "\\usepackage{pspicture}" << endl << "\\else" << endl << "\\usepackage[pdftex," << endl << " pagebackref=true," << endl << " colorlinks=true," << endl - << " linkcolor=blue" << endl + << " linkcolor=blue," << endl + << " unicode" << endl << " ]{hyperref}" << endl << "\\fi" << endl; } // Try to get the command for switching on the language // support + t << "\\usepackage[utf8]{inputenc}" << endl; QCString sLanguageSupportCommand( theTranslator->latexLanguageSupportCommand()); @@ -261,7 +264,6 @@ static void writeDefaultHeaderPart1(QTextStream &t) // if the command is empty, no output is needed. t << sLanguageSupportCommand << endl; } - t << "\\usepackage{doxygen}\n"; QStrList &extraPackages = Config_getList("EXTRA_PACKAGES"); const char *s=extraPackages.first(); @@ -425,17 +427,20 @@ void LatexGenerator::writeStyleSheetFile(QFile &f) t << theTranslator->trGeneratedAt( dateToString(TRUE), projectName ); t << " doxygen"; //t << " " << theTranslator->trWrittenBy() << " "; - //t << "Dimitri van Heesch \\copyright~1997-2006"; + //t << "Dimitri van Heesch \\copyright~1997-2007"; writeDefaultStyleSheetPart2(t); t << theTranslator->trGeneratedAt( dateToString(TRUE), projectName ); t << " doxygen"; //t << " << theTranslator->trWrittenBy() << " "; - //t << "Dimitri van Heesch \\copyright~1997-2006"; + //t << "Dimitri van Heesch \\copyright~1997-2007"; writeDefaultStyleSheetPart3(t); } void LatexGenerator::startFile(const char *name,const char *,const char *) { +#if 0 + setEncoding(Config_getString("LATEX_OUTPUT_ENCODING")); +#endif QCString fileName=name; relPath = relativePathToRoot(fileName); if (fileName.right(4)!=".tex" && fileName.right(4)!=".sty") fileName+=".tex"; @@ -845,14 +850,14 @@ void LatexGenerator::writeStyleInfo(int part) break; case 2: { - //t << " Dimitri van Heesch \\copyright~1997-2006"; + //t << " Dimitri van Heesch \\copyright~1997-2007"; t << "}]{}\n"; writeDefaultStyleSheetPart2(t); } break; case 4: { - //t << " Dimitri van Heesch \\copyright~1997-2006"; + //t << " Dimitri van Heesch \\copyright~1997-2007"; writeDefaultStyleSheetPart3(t); endPlainFile(); } diff --git a/src/latexgen.h b/src/latexgen.h index 4d361ab..e4e4378 100644 --- a/src/latexgen.h +++ b/src/latexgen.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/libdoxycfg.pro.in b/src/libdoxycfg.pro.in index cf4454e..1632b4f 100644 --- a/src/libdoxycfg.pro.in +++ b/src/libdoxycfg.pro.in @@ -1,7 +1,7 @@ # # # -# Copyright (C) 1997-2006 by Dimitri van Heesch. +# Copyright (C) 1997-2007 by Dimitri van Heesch. # # Permission to use, copy, modify, and distribute this software and its # documentation under the terms of the GNU General Public License is hereby @@ -16,8 +16,8 @@ TEMPLATE = libdoxycfg.t CONFIG = console warn_on staticlib $extraopts -HEADERS = config.h -SOURCES = config.cpp +HEADERS = config.h portable.h +SOURCES = config.cpp portable.cpp win32:TMAKE_CXXFLAGS += -DQT_NODLL win32-g++:TMAKE_CXXFLAGS += -fno-exceptions -fno-rtti INCLUDEPATH += ../qtools diff --git a/src/libdoxycfg.t b/src/libdoxycfg.t index aa75498..6be6e51 100644 --- a/src/libdoxycfg.t +++ b/src/libdoxycfg.t @@ -1,7 +1,7 @@ # # # -# Copyright (C) 1997-2006 by Dimitri van Heesch. +# Copyright (C) 1997-2007 by Dimitri van Heesch. # # Permission to use, copy, modify, and distribute this software and its # documentation under the terms of the GNU General Public License is hereby diff --git a/src/libdoxygen.pro.in b/src/libdoxygen.pro.in index ae89a80..656c75f 100644 --- a/src/libdoxygen.pro.in +++ b/src/libdoxygen.pro.in @@ -1,7 +1,7 @@ # # # -# Copyright (C) 1997-2006 by Dimitri van Heesch. +# Copyright (C) 1997-2007 by Dimitri van Heesch. # # Permission to use, copy, modify, and distribute this software and its # documentation under the terms of the GNU General Public License is hereby diff --git a/src/libdoxygen.t b/src/libdoxygen.t index 7910d01..541ec97 100644 --- a/src/libdoxygen.t +++ b/src/libdoxygen.t @@ -1,7 +1,7 @@ # # # -# Copyright (C) 1997-2006 by Dimitri van Heesch. +# Copyright (C) 1997-2007 by Dimitri van Heesch. # # Permission to use, copy, modify, and distribute this software and its # documentation under the terms of the GNU General Public License is hereby diff --git a/src/lockingptr.h b/src/lockingptr.h index 99a1772..a3cedfd 100644 --- a/src/lockingptr.h +++ b/src/lockingptr.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/logos.cpp b/src/logos.cpp index 861e942..dfed41c 100644 --- a/src/logos.cpp +++ b/src/logos.cpp @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/logos.h b/src/logos.h index b4c95ad..1dc89cc 100644 --- a/src/logos.h +++ b/src/logos.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/main.cpp b/src/main.cpp index 232bf0e..64006bc 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/mandocvisitor.cpp b/src/mandocvisitor.cpp index 530b272..3f305a9 100644 --- a/src/mandocvisitor.cpp +++ b/src/mandocvisitor.cpp @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/mandocvisitor.h b/src/mandocvisitor.h index 93e2eb1..c2c5f0d 100644 --- a/src/mandocvisitor.h +++ b/src/mandocvisitor.h @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/mangen.cpp b/src/mangen.cpp index 3a47043..f8bfb57 100644 --- a/src/mangen.cpp +++ b/src/mangen.cpp @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/mangen.h b/src/mangen.h index df9effa..38b566a 100644 --- a/src/mangen.h +++ b/src/mangen.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/memberdef.cpp b/src/memberdef.cpp index 55a8fb8..155e10d 100644 --- a/src/memberdef.cpp +++ b/src/memberdef.cpp @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -771,6 +771,8 @@ bool MemberDef::isLinkableInProject() const static bool extractPrivate = Config_getBool("EXTRACT_PRIVATE"); static bool extractStatic = Config_getBool("EXTRACT_STATIC"); makeResident(); + + if (isHidden()) return FALSE; //printf("MemberDef::isLinkableInProject(name=%s)\n",name().data()); if (m_impl->templateMaster) { @@ -1792,7 +1794,7 @@ void MemberDef::writeDocumentation(MemberList *ml,OutputList &ol, else if (protection()==Package) sl.append("package"); if (lvirt==Virtual) sl.append("virtual"); else if (lvirt==Pure) sl.append("pure virtual"); - if (isSignal()) sl.append("signal"); + if (isSignal()) sl.append("signal"); if (isSlot()) sl.append("slot"); } if (m_impl->classDef && m_impl->classDef!=container) sl.append("inherited"); @@ -2562,14 +2564,22 @@ void MemberDef::setSectionList(Definition *d, MemberList *sl) m_impl->classSectionSDict->append(key,sl); } -Specifier MemberDef::virtualness() const +Specifier MemberDef::virtualness(int count) const { + if (count>25) + { + warn(getDefFileName(),getDefLine(), + "Warning: Internal inconsistency: recursion detected in overload relation for member %s!" + ,name().data() + ); + return Normal; + } makeResident(); Specifier v = m_impl->virt; MemberDef *rmd = reimplements(); while (rmd && v==Normal) { - v = rmd->virtualness()==Normal ? Normal : Virtual; + v = rmd->virtualness(count+1)==Normal ? Normal : Virtual; rmd = rmd->reimplements(); } return v; diff --git a/src/memberdef.h b/src/memberdef.h index b313f30..c396346 100644 --- a/src/memberdef.h +++ b/src/memberdef.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -114,7 +114,7 @@ class MemberDef : public Definition // direct kind info Protection protection() const; - Specifier virtualness() const; + Specifier virtualness(int count=0) const; MemberType memberType() const; QCString memberTypeName() const; diff --git a/src/membergroup.cpp b/src/membergroup.cpp index 60ac5d4..dc2f200 100644 --- a/src/membergroup.cpp +++ b/src/membergroup.cpp @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/membergroup.h b/src/membergroup.h index 885341a..93f9184 100644 --- a/src/membergroup.h +++ b/src/membergroup.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/memberlist.cpp b/src/memberlist.cpp index 8864488..6bb14af 100644 --- a/src/memberlist.cpp +++ b/src/memberlist.cpp @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/memberlist.h b/src/memberlist.h index 1467835..c032c21 100644 --- a/src/memberlist.h +++ b/src/memberlist.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/membername.cpp b/src/membername.cpp index e05e28b..136d215 100644 --- a/src/membername.cpp +++ b/src/membername.cpp @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/membername.h b/src/membername.h index 8c71af0..8b7ac22 100644 --- a/src/membername.h +++ b/src/membername.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/message.cpp b/src/message.cpp index 572542a..8b24e31 100644 --- a/src/message.cpp +++ b/src/message.cpp @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/message.h b/src/message.h index 12af48c..a5b3031 100644 --- a/src/message.h +++ b/src/message.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/namespacedef.cpp b/src/namespacedef.cpp index 54278b1..1ebaaf9 100644 --- a/src/namespacedef.cpp +++ b/src/namespacedef.cpp @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -171,6 +171,7 @@ void NamespaceDef::addMembersToMemberGroup() void NamespaceDef::insertMember(MemberDef *md) { + if (md->isHidden()) return; MemberList *allMemberList = getMemberList(MemberList::allMembersList); if (allMemberList==0) { diff --git a/src/namespacedef.h b/src/namespacedef.h index 827ace3..f36e89c 100644 --- a/src/namespacedef.h +++ b/src/namespacedef.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/objcache.cpp b/src/objcache.cpp index f45a0e7..05c62cf 100644 --- a/src/objcache.cpp +++ b/src/objcache.cpp @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/objcache.h b/src/objcache.h index 3516534..2795e34 100644 --- a/src/objcache.h +++ b/src/objcache.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/outputgen.cpp b/src/outputgen.cpp index 4a5c54a..d085312 100644 --- a/src/outputgen.cpp +++ b/src/outputgen.cpp @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -20,6 +20,7 @@ #include "qtbc.h" #include "outputgen.h" #include "message.h" +#include "portable.h" OutputGenerator::OutputGenerator() { @@ -63,11 +64,37 @@ void OutputGenerator::startPlainFile(const char *name) void OutputGenerator::endPlainFile() { - //printf("endPlainFile(%s)\n",file->name()); - fs.writeRawBytes(a.data(),a.size()) ; // write string buffer to file + bool converted=false; + if (!encoding.isEmpty()) + { + QByteArray enc(a.size()*4); + void *cd = portable_iconv_open(encoding,"UTF-8"); + if (cd!=(void *)(-1)) + { + size_t iLeft=a.size(); + size_t oLeft=enc.size(); + const char *inputPtr = a.data(); + char *outputPtr = enc.data(); + if (!portable_iconv(cd, &inputPtr, &iLeft, &outputPtr, &oLeft)) + { + enc.resize(enc.size()-oLeft); + postProcess(enc); + //printf("a.size()=%d enc.size()=%d iLeft=%d oLeft=%d enc2.size()=%d\n", + // a.size(),enc.size(),iLeft,oLeft,enc2.size()); + fs.writeRawBytes(enc.data(),enc.size()) ; // write string buffer to file + converted=TRUE; + } + portable_iconv_close(cd); + } + } + if (!converted) + { + //printf("endPlainFile(%s)\n",file->name()); + fs.writeRawBytes(a.data(),a.size()) ; // write string buffer to file + } + b.close(); delete file; file=0; - b.close(); a.resize(0); b.setBuffer(a); b.open(IO_WriteOnly); diff --git a/src/outputgen.h b/src/outputgen.h index 13f2970..0a7c06c 100644 --- a/src/outputgen.h +++ b/src/outputgen.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -278,6 +278,8 @@ class OutputGenerator : public BaseOutputDocInterface bool isEnabled() const { return active; } void pushGeneratorState(); void popGeneratorState(); + void setEncoding(const QCString &enc) { encoding = enc; } + virtual void postProcess(QByteArray &) { } virtual void printDoc(DocNode *,const char *langExt) = 0; @@ -383,6 +385,7 @@ class OutputGenerator : public BaseOutputDocInterface QCString dir; bool active; QStack<bool> *genStack; + QString encoding; private: OutputGenerator(const OutputGenerator &o); diff --git a/src/outputlist.cpp b/src/outputlist.cpp index dac4972..27e1237 100644 --- a/src/outputlist.cpp +++ b/src/outputlist.cpp @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/outputlist.h b/src/outputlist.h index 6a8c4c8..4a8a0d7 100644 --- a/src/outputlist.h +++ b/src/outputlist.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/pagedef.h b/src/pagedef.h index 2d4c59d..a605aaf 100644 --- a/src/pagedef.h +++ b/src/pagedef.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/parserintf.h b/src/parserintf.h index 477958a..6e45a96 100644 --- a/src/parserintf.h +++ b/src/parserintf.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/perlmodgen.cpp b/src/perlmodgen.cpp index c1298d5..73f25db 100644 --- a/src/perlmodgen.cpp +++ b/src/perlmodgen.cpp @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * Authors: Dimitri van Heesch, Miguel Lobo. * * Permission to use, copy, modify, and distribute this software and its diff --git a/src/perlmodgen.h b/src/perlmodgen.h index 7bc1068..14daa25 100644 --- a/src/perlmodgen.h +++ b/src/perlmodgen.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/pngenc.cpp b/src/pngenc.cpp index 79a83ac..0624c91 100644 --- a/src/pngenc.cpp +++ b/src/pngenc.cpp @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/pngenc.h b/src/pngenc.h index f32248e..88dfa25 100644 --- a/src/pngenc.h +++ b/src/pngenc.h @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/portable.cpp b/src/portable.cpp new file mode 100644 index 0000000..94f8c20 --- /dev/null +++ b/src/portable.cpp @@ -0,0 +1,385 @@ +#include <stdlib.h> +#include <ctype.h> +#if defined(_WIN32) && !defined(__CYGWIN__) +#undef UNICODE +#include <windows.h> +#else +#include <unistd.h> +#include <stdlib.h> +#include <sys/types.h> +#include <sys/wait.h> +#include <errno.h> +extern char **environ; +#endif + +#include <qglobal.h> +#include <qdatetime.h> +#include <iconv.h> + +#if defined(_MSC_VER) || defined(__BORLANDC__) +#define popen _popen +#define pclose _pclose +#endif + +#include "portable.h" +//#include "debug.h" +//#include "doxygen.h" + +static double sysElapsedTime; + +int portable_system(const char *command,const char *args,bool commandHasConsole) +{ + QTime time; + time.start(); + + if (command==0) return 1; + + QCString fullCmd=command; + fullCmd=fullCmd.stripWhiteSpace(); + if (fullCmd.at(0)!='"' && fullCmd.find(' ')!=-1) + { + // add quotes around command as it contains spaces and is not quoted already + fullCmd="\""+fullCmd+"\""; + } + fullCmd += " "; + fullCmd += args; + //Debug::print(Debug::ExtCmd,0,"Executing external command `%s`\n",fullCmd.data()); + +#if !defined(_WIN32) || defined(__CYGWIN__) + commandHasConsole=commandHasConsole; + /*! taken from the system() manpage on my Linux box */ + int pid,status=0; + +#ifdef _OS_SOLARIS // for Solaris we use vfork since it is more memory efficient + + // on Solaris fork() duplicates the memory usage + // so we use vfork instead + + // spawn shell + if ((pid=vfork())<0) + { + status=-1; + } + else if (pid==0) + { + execl("/bin/sh","sh","-c",fullCmd.data(),(char*)0); + _exit(127); + } + else + { + while (waitpid(pid,&status,0 )<0) + { + if (errno!=EINTR) + { + status=-1; + break; + } + } + } + sysElapsedTime+=((double)time.elapsed())/1000.0; + return status; + +#else // Other Unices just use fork + + pid = fork(); + if (pid==-1) return -1; + if (pid==0) + { + const char * argv[4]; + argv[0] = "sh"; + argv[1] = "-c"; + argv[2] = fullCmd.data(); + argv[3] = 0; + execve("/bin/sh",(char * const *)argv,environ); + exit(127); + } + for (;;) + { + if (waitpid(pid,&status,0)==-1) + { + if (errno!=EINTR) return -1; + } + else + { + sysElapsedTime+=((double)time.elapsed())/1000.0; + if (WIFEXITED(status)) + { + return WEXITSTATUS(status); + } + else + { + return status; + } + } + } +#endif // !_OS_SOLARIS + +#else // Win32 specific + if (commandHasConsole) + { + return system(fullCmd); + } + else + { + // gswin32 is a GUI api which will pop up a window and run + // asynchronously. To prevent both, we use ShellExecuteEx and + // WaitForSingleObject (thanks to Robert Golias for the code) + + SHELLEXECUTEINFO sInfo = { + sizeof(SHELLEXECUTEINFO), /* structure size */ + SEE_MASK_NOCLOSEPROCESS | SEE_MASK_FLAG_NO_UI, /* leave the process running */ + NULL, /* window handle */ + NULL, /* action to perform: open */ + command, /* file to execute */ + args, /* argument list */ + NULL, /* use current working dir */ + SW_HIDE, /* minimize on start-up */ + 0, /* application instance handle */ + NULL, /* ignored: id list */ + NULL, /* ignored: class name */ + NULL, /* ignored: key class */ + 0, /* ignored: hot key */ + NULL, /* ignored: icon */ + NULL /* resulting application handle */ + }; + if (!ShellExecuteEx(&sInfo)) + { + return -1; + } + else if (sInfo.hProcess) /* executable was launched, wait for it to finish */ + { + WaitForSingleObject(sInfo.hProcess,INFINITE); + CloseHandle(sInfo.hProcess); + } + } + sysElapsedTime+=((double)time.elapsed())/1000.0; + return 0; +#endif + +} + +uint portable_pid() +{ + uint pid; +#if !defined(_WIN32) || defined(__CYGWIN__) + pid = (uint)getpid(); +#else + pid = (uint)GetCurrentProcessId(); +#endif + return pid; +} + +static char **last_environ; + +void portable_setenv(const char *name,const char *value) +{ +#ifdef _WIN32 + SetEnvironmentVariable(name,value); +#else + register char **ep = 0; + register size_t size; + const size_t namelen=strlen(name); + const size_t vallen=strlen(value) + 1; + + size = 0; + if (environ!=0) + { + for (ep = environ; *ep; ++ep) + { + if (!strncmp (*ep, name, namelen) && (*ep)[namelen] == '=') + break; + else + ++size; + } + } + + if (environ==0 || *ep==0) /* add new string */ + { + char **new_environ; + if (environ == last_environ && environ!=0) + { + // We allocated this space; we can extend it. + new_environ = (char **) realloc (last_environ, (size + 2) * sizeof (char *)); + } + else + { + new_environ = (char **) malloc ((size + 2) * sizeof (char *)); + } + + if (new_environ==0) // no more memory + { + return; + } + + new_environ[size] = (char *)malloc (namelen + 1 + vallen); + if (new_environ[size]==0) + { + free (new_environ); + return; + } + + if (environ != last_environ) + { + memcpy ((char *) new_environ, environ, size * sizeof (char *)); + } + + memcpy(new_environ[size], name, namelen); + new_environ[size][namelen] = '='; + memcpy(&new_environ[size][namelen + 1], value, vallen); + new_environ[size + 1] = 0; + last_environ = environ = new_environ; + } + else /* replace existing string */ + { + size_t len = strlen (*ep); + if (len + 1 < namelen + 1 + vallen) + { + /* The existing string is too short; malloc a new one. */ + char *newString = (char *)malloc(namelen + 1 + vallen); + if (newString==0) + { + return; + } + *ep = newString; + } + memcpy(*ep, name, namelen); + (*ep)[namelen] = '='; + memcpy(&(*ep)[namelen + 1], value, vallen); + } + +#endif +} + +void portable_unsetenv(const char *variable) +{ +#ifdef _WIN32 + SetEnvironmentVariable(variable,0); +#else + /* Some systems don't have unsetenv(), so we do it ourselves */ + size_t len; + char **ep; + + if (variable == NULL || *variable == '\0' || strchr (variable, '=') != NULL) + { + return; // not properly formatted + } + + len = strlen(variable); + + ep = environ; + while (*ep != NULL) + { + if (!strncmp(*ep, variable, len) && (*ep)[len]=='=') + { + /* Found it. Remove this pointer by moving later ones back. */ + char **dp = ep; + do dp[0] = dp[1]; while (*dp++); + /* Continue the loop in case NAME appears again. */ + } + else + { + ++ep; + } + } +#endif +} + +const char *portable_getenv(const char *variable) +{ + return getenv(variable); +} + +portable_off_t portable_fseek(FILE *f,portable_off_t offset, int whence) +{ +#if defined(_WIN32) && !defined(__CYGWIN__) + return _fseeki64(f,offset,whence); +#else + return fseeko(f,offset,whence); +#endif +} + +portable_off_t portable_ftell(FILE *f) +{ +#if defined(_WIN32) && !defined(__CYGWIN__) + return _ftelli64(f); +#else + return ftello(f); +#endif +} + +char portable_pathSeparator() +{ +#if defined(_WIN32) && !defined(__CYGWIN__) + return '\\'; +#else + return '/'; +#endif +} + +char portable_pathListSeparator() +{ +#if defined(_WIN32) && !defined(__CYGWIN__) + return ';'; +#else + return ':'; +#endif +} + +const char *portable_ghostScriptCommand() +{ +#if defined(_WIN32) && !defined(__CYGWIN__) + return "gswin32c.exe"; +#else + return "gs"; +#endif +} + +const char *portable_dotCommand() +{ +#if defined(_WIN32) && !defined(__CYGWIN__) + return "dot.exe"; +#else + return "dot"; +#endif +} + +bool portable_fileSystemIsCaseSensitive() +{ +#if defined(_WIN32) || defined(macintosh) || defined(__MACOSX__) || defined(__APPLE__) + return FALSE; +#else + return TRUE; +#endif +} + +FILE * portable_popen(const char *name,const char *type) +{ + return popen(name,type); +} + +int portable_pclose(FILE *stream) +{ + return pclose(stream); +} + +void * portable_iconv_open(const char* tocode, const char* fromcode) +{ + return iconv_open(tocode,fromcode); +} + +size_t portable_iconv (void *cd, const char** inbuf, size_t *inbytesleft, + char** outbuf, size_t *outbytesleft) +{ +#if (defined(_LIBICONV_VERSION) && (_LIBICONV_VERSION==0x0109)) +#define CASTNEEDED(x) (x) +#else +#define CASTNEEDED(x) (char **)(x) +#endif + return iconv(cd,CASTNEEDED(inbuf),inbytesleft,outbuf,outbytesleft); +} + +int portable_iconv_close (void *cd) +{ + return iconv_close(cd); +} + diff --git a/src/portable.h b/src/portable.h new file mode 100644 index 0000000..0a88079 --- /dev/null +++ b/src/portable.h @@ -0,0 +1,38 @@ +#ifndef PORTABLE_H +#define PORTABLE_H + +#include <sys/types.h> +#include <stdio.h> + +#if defined(_WIN32) +typedef __int64 portable_off_t; +#else +typedef off_t portable_off_t; +#endif + +/** @file + * @brief Portable versions of functions that are platform dependent. + */ + +int portable_system(const char *command,const char *args,bool commandHasConsole=TRUE); +uint portable_pid(); +const char * portable_getenv(const char *variable); +void portable_setenv(const char *variable,const char *value); +void portable_unsetenv(const char *variable); +portable_off_t portable_fseek(FILE *f,portable_off_t offset, int whence); +portable_off_t portable_ftell(FILE *f); +char portable_pathSeparator(); +char portable_pathListSeparator(); +const char * portable_ghostScriptCommand(); +const char * portable_dotCommand(); +bool portable_fileSystemIsCaseSensitive(); +FILE * portable_popen(const char *name,const char *type); +int portable_pclose(FILE *stream); +void * portable_iconv_open(const char* tocode, const char* fromcode); +size_t portable_iconv (void *cd, const char** inbuf, size_t *inbytesleft, + char* * outbuf, size_t *outbytesleft); +int portable_iconv_close (void *cd); + + +#endif + @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -44,11 +44,7 @@ #include "defargs.h" #include "debug.h" #include "bufstr.h" - -#if defined(_MSC_VER) || defined(__BORLANDC__) -#define popen _popen -#define pclose _pclose -#endif +#include "portable.h" #define YY_NEVER_INTERACTIVE 1 @@ -202,7 +198,7 @@ static FILE *checkAndOpenFile(const QCString &absName) if (!filterName.isEmpty()) { QCString cmd = filterName+" \""+absName+"\""; - f=popen(cmd,"r"); + f=portable_popen(cmd,"r"); if (!f) err("Error: could not execute filter %s\n",cmd.data()); } else @@ -2112,7 +2108,7 @@ CHARLIT (("'"\\[0-7]{1,3}"'")|("'"\\."'")|("'"[^'\\\n]{1,4}"'")) if (getFileFilter(fs->fileName.data()).isEmpty()) fclose(fs->filePtr); else - pclose(fs->filePtr); + portable_pclose(fs->filePtr); YY_BUFFER_STATE oldBuf = YY_CURRENT_BUFFER; yy_switch_to_buffer( fs->bufState ); yy_delete_buffer( oldBuf ); @@ -2384,7 +2380,7 @@ void preprocessFile(const char *fileName,BufStr &output) { QCString cmd = inputFilter+" \""+fileName+"\""; Debug::print(Debug::ExtCmd,0,"Executing popen(`%s`)\n",cmd.data()); - preYYin = popen(cmd,"r"); + preYYin = portable_popen(cmd,"r"); if (!preYYin) { err("Error: could not execute filter %s\n",cmd.data()); @@ -2406,7 +2402,7 @@ void preprocessFile(const char *fileName,BufStr &output) if (inputFilter.isEmpty()) fclose(preYYin); else - pclose(preYYin); + portable_pclose(preYYin); if (Debug::isFlagSet(Debug::Preprocessor)) { diff --git a/src/printdocvisitor.h b/src/printdocvisitor.h index fa1ab26..faf9b16 100644 --- a/src/printdocvisitor.h +++ b/src/printdocvisitor.h @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/pycode.h b/src/pycode.h index b3007d4..04ca268 100644 --- a/src/pycode.h +++ b/src/pycode.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/pycode.l b/src/pycode.l index 348b521..473d0f6 100644 --- a/src/pycode.l +++ b/src/pycode.l @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/pyscanner.h b/src/pyscanner.h index 03dce0b..ebe9ab8 100644 --- a/src/pyscanner.h +++ b/src/pyscanner.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/pyscanner.l b/src/pyscanner.l index 478a5d2..bdd4f71 100644 --- a/src/pyscanner.l +++ b/src/pyscanner.l @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/reflist.cpp b/src/reflist.cpp index 99d94cd..edbf86a 100644 --- a/src/reflist.cpp +++ b/src/reflist.cpp @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/reflist.h b/src/reflist.h index bc2b52f..9e47505 100644 --- a/src/reflist.h +++ b/src/reflist.h @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/rtfdocvisitor.cpp b/src/rtfdocvisitor.cpp index 0d99613..fb0b1e1 100644 --- a/src/rtfdocvisitor.cpp +++ b/src/rtfdocvisitor.cpp @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -29,8 +29,8 @@ #include "parserintf.h" -#define DBG_RTF(x) m_t << x -//#define DBG_RTF(x) do {} while(0) +//#define DBG_RTF(x) m_t << x +#define DBG_RTF(x) do {} while(0) RTFDocVisitor::RTFDocVisitor(QTextStream &t,CodeOutputInterface &ci, const char *langExt) @@ -1294,12 +1294,12 @@ void RTFDocVisitor::visitPost(DocText *) DBG_RTF("{\\comment RTFDocVisitor::visitPost(DocText)}\n"); } -static char* getMultiByte(int c) -{ - static char s[10]; - sprintf(s,"\\'%X",c); - return s; -} +//static char* getMultiByte(int c) +//{ +// static char s[10]; +// sprintf(s,"\\'%X",c); +// return s; +//} void RTFDocVisitor::filter(const char *str,bool verbatim) { @@ -1310,21 +1310,21 @@ void RTFDocVisitor::filter(const char *str,bool verbatim) unsigned char pc='\0'; while (*p) { - static bool MultiByte = FALSE; + //static bool MultiByte = FALSE; c=*p++; - if ( MultiByte ) - { - m_t << getMultiByte( c ); - MultiByte = FALSE; - continue; - } - if ( c >= 0x80 ) - { - MultiByte = TRUE; - m_t << getMultiByte( c ); - continue; - } + //if ( MultiByte ) + //{ + // m_t << getMultiByte( c ); + // MultiByte = FALSE; + // continue; + //} + //if ( c >= 0x80 ) + //{ + // MultiByte = TRUE; + // m_t << getMultiByte( c ); + // continue; + //} switch (c) { diff --git a/src/rtfdocvisitor.h b/src/rtfdocvisitor.h index 5462480..63aa662 100644 --- a/src/rtfdocvisitor.h +++ b/src/rtfdocvisitor.h @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/rtfgen.cpp b/src/rtfgen.cpp index 447cbdb..f6fb8af 100644 --- a/src/rtfgen.cpp +++ b/src/rtfgen.cpp @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Parker Waechter & Dimitri van Heesch. + * Copyright (C) 1997-2007 by Parker Waechter & Dimitri van Heesch. * * Style sheet additions by Alexander Bartolich * @@ -324,6 +324,7 @@ void RTFGenerator::beginRTFSection() void RTFGenerator::startFile(const char *name,const char *,const char *) { + setEncoding(QCString().sprintf("CP%s",theTranslator->trRTFansicp().data())); QCString fileName=name; relPath = relativePathToRoot(fileName); @@ -1600,13 +1601,13 @@ void RTFGenerator::endSection(const char *lab,SectionInfo::SectionType) // writeSectionRef(name,lab,title); //} -char* RTFGenerator::getMultiByte(int c) -{ - static char s[10]; - - sprintf(s,"\\'%X",c); - return s; -} +//char* RTFGenerator::getMultiByte(int c) +//{ +// static char s[10]; +// +// sprintf(s,"\\'%X",c); +// return s; +//} void RTFGenerator::docify(const char *str) { @@ -1617,9 +1618,10 @@ void RTFGenerator::docify(const char *str) unsigned char pc='\0'; while (*p) { - static bool MultiByte = FALSE; + //static bool MultiByte = FALSE; c=*p++; +#if 0 if ( MultiByte ) { t << getMultiByte( c ); @@ -1632,6 +1634,7 @@ void RTFGenerator::docify(const char *str) t << getMultiByte( c ); continue; } +#endif switch (c) { @@ -1664,10 +1667,11 @@ void RTFGenerator::codify(const char *str) while (*p) { - static bool MultiByte = FALSE; + //static bool MultiByte = FALSE; c=*p++; +#if 0 if( MultiByte ) { t << getMultiByte( c ); @@ -1680,6 +1684,7 @@ void RTFGenerator::codify(const char *str) t << getMultiByte( c ); continue; } +#endif switch(c) { @@ -2517,3 +2522,26 @@ void RTFGenerator::rtfwriteRuler_thin() t << "{\\pard\\widctlpar\\brdrb\\brdrs\\brdrw5\\brsp20 \\adjustright \\par}" << endl; } +void RTFGenerator::postProcess(QByteArray &a) +{ + QByteArray enc(a.size()*4); // worst case + int off=0; + uint i; + for (i=0;i<a.size();i++) + { + unsigned char c = (unsigned char)a.at(i); + if (c>0x80) + { + char s[10]; + sprintf(s,"\\'%X",c); + qstrcpy(enc.data()+off,s); + off+=qstrlen(s); + } + else + { + enc.at(off++)=c; + } + } + enc.resize(off); + a = enc; +} diff --git a/src/rtfgen.h b/src/rtfgen.h index 8cc8c5c..2183237 100644 --- a/src/rtfgen.h +++ b/src/rtfgen.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Parker Waechter & Dimitri van Heesch. + * Copyright (C) 1997-2007 by Parker Waechter & Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -49,6 +49,7 @@ class RTFGenerator : public OutputGenerator void writeFooter() {} void endFile(); void clearBuffer(); + void postProcess(QByteArray &); //void writeIndex(); @@ -298,7 +299,7 @@ class RTFGenerator : public OutputGenerator void rtfwriteRuler_thick(); void rtfwriteRuler_thin(); void writeRTFReference(const char *label); - char *getMultiByte(int c); + //char *getMultiByte(int c); }; #endif diff --git a/src/rtfstyle.cpp b/src/rtfstyle.cpp index 430ed37..ff3c2f1 100644 --- a/src/rtfstyle.cpp +++ b/src/rtfstyle.cpp @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/rtfstyle.h b/src/rtfstyle.h index 6f4af29..172e4fe 100644 --- a/src/rtfstyle.h +++ b/src/rtfstyle.h @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/scanner.h b/src/scanner.h index e82daf8..891487a 100644 --- a/src/scanner.h +++ b/src/scanner.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/scanner.l b/src/scanner.l index 5d75f5f..ec6ff31 100644 --- a/src/scanner.l +++ b/src/scanner.l @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2005 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/searchindex.cpp b/src/searchindex.cpp index 2610c52..acc6a58 100644 --- a/src/searchindex.cpp +++ b/src/searchindex.cpp @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/searchindex.h b/src/searchindex.h index e5c9387..8a2bf08 100644 --- a/src/searchindex.h +++ b/src/searchindex.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/section.h b/src/section.h index 70dd5e1..2423a5f 100644 --- a/src/section.h +++ b/src/section.h @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/sortdict.h b/src/sortdict.h index 07c450a..790d796 100644 --- a/src/sortdict.h +++ b/src/sortdict.h @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/store.cpp b/src/store.cpp index 5e6e8f7..328b679 100644 --- a/src/store.cpp +++ b/src/store.cpp @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -17,6 +17,7 @@ */ #include "store.h" +#include "portable.h" #include <stdio.h> @@ -26,7 +27,7 @@ #include <assert.h> #define BLOCK_SIZE 512 // should be >8 and a multiple of 8 -#define BLOCK_POINTER_SIZE sizeof(off_t) +#define BLOCK_POINTER_SIZE sizeof(portable_off_t) #define ASSERTS_ENABLED @@ -37,12 +38,6 @@ #define STORE_ASSERT(x) #endif -#ifdef _WIN32 // TODO: add 64bit support using _fseeki64 and _ftelli64 (studio 2003+ req) -#define fseeko fseek -#define ftello ftell -#endif - - //------------------------------------------------------------------------------------ Store::Store() @@ -101,20 +96,20 @@ void Store::close() m_state = Init; } -off_t Store::alloc() +portable_off_t Store::alloc() { STORE_ASSERT(m_state==Reading); m_state=Writing; - off_t pos; + portable_off_t pos; if (m_head==0) // allocate new block { //printf("alloc: new block\n"); - if (fseeko(m_file,0,SEEK_END)==-1) // go to end of the file + if (portable_fseek(m_file,0,SEEK_END)==-1) // go to end of the file { fprintf(stderr,"Store::alloc: Error seeking to end of file: %s\n",strerror(errno)); exit(1); } - pos = ftello(m_file); + pos = portable_ftell(m_file); STORE_ASSERT( (pos & (BLOCK_SIZE-1))==0 ); m_front = pos + BLOCK_SIZE; // move front to end of this block } @@ -127,7 +122,7 @@ off_t Store::alloc() m_head = node->next; delete node; // move to start of the block - if (fseeko(m_file,pos,SEEK_SET)==-1) + if (portable_fseek(m_file,pos,SEEK_SET)==-1) { fprintf(stderr,"Store::alloc: Error seeking to position %d: %s\n", (int)pos,strerror(errno)); @@ -142,10 +137,10 @@ off_t Store::alloc() int Store::write(const char *buf,uint size) { STORE_ASSERT(m_state==Writing); - //printf("%x: Store::write\n",(int)ftello(m_file)); + //printf("%x: Store::write\n",(int)portable_ftell(m_file)); do { - off_t curPos = ftello(m_file); + portable_off_t curPos = portable_ftell(m_file); int bytesInBlock = BLOCK_SIZE - BLOCK_POINTER_SIZE - (curPos & (BLOCK_SIZE-1)); int bytesLeft = bytesInBlock<(int)size ? (int)size-bytesInBlock : 0; int numBytes = size - bytesLeft; @@ -162,26 +157,26 @@ int Store::write(const char *buf,uint size) } if (bytesLeft>0) // still more bytes to write { - STORE_ASSERT(((ftello(m_file)+BLOCK_POINTER_SIZE)&(BLOCK_SIZE-1))==0); + STORE_ASSERT(((portable_ftell(m_file)+BLOCK_POINTER_SIZE)&(BLOCK_SIZE-1))==0); // allocate new block if (m_head==0) // no free blocks to reuse { - //printf("%x: Store::write: new: pos=%x\n",(int)m_front,(int)ftello(m_file)); + //printf("%x: Store::write: new: pos=%x\n",(int)m_front,(int)portable_ftell(m_file)); // write pointer to next block if (fwrite(&m_front,BLOCK_POINTER_SIZE,1,m_file)!=1) { fprintf(stderr,"Error writing to store: %s\n",strerror(errno)); exit(1); } - STORE_ASSERT(ftello(m_file)==(curPos&~(BLOCK_SIZE-1))+BLOCK_SIZE); + STORE_ASSERT(portable_ftell(m_file)==(curPos&~(BLOCK_SIZE-1))+BLOCK_SIZE); // move to next block - if (fseeko(m_file,0,SEEK_END)==-1) // go to end of the file + if (portable_fseek(m_file,0,SEEK_END)==-1) // go to end of the file { fprintf(stderr,"Store::alloc: Error seeking to end of file: %s\n",strerror(errno)); exit(1); } - STORE_ASSERT(ftello(m_file)==m_front); + STORE_ASSERT(portable_ftell(m_file)==m_front); // move front to the next of the block m_front+=BLOCK_SIZE; } @@ -194,12 +189,12 @@ int Store::write(const char *buf,uint size) exit(1); } Node *node = m_head; - off_t pos = node->pos; + portable_off_t pos = node->pos; // point head to next free item m_head = node->next; delete node; // move to start of the block - if (fseeko(m_file,pos,SEEK_SET)==-1) + if (portable_fseek(m_file,pos,SEEK_SET)==-1) { fprintf(stderr,"Store::write: Error seeking to position %d: %s\n", (int)pos,strerror(errno)); @@ -218,7 +213,7 @@ int Store::write(const char *buf,uint size) void Store::end() { STORE_ASSERT(m_state==Writing); - off_t curPos = ftello(m_file); + portable_off_t curPos = portable_ftell(m_file); int bytesInBlock = BLOCK_SIZE - (curPos & (BLOCK_SIZE-1)); //printf("%x: Store::end erasing %x bytes\n",(int)curPos&~(BLOCK_SIZE-1),bytesInBlock); //printf("end: bytesInBlock=%x\n",bytesInBlock); @@ -231,13 +226,13 @@ void Store::end() m_state=Reading; } -void Store::release(off_t pos) +void Store::release(portable_off_t pos) { STORE_ASSERT(m_state==Reading); //printf("%x: Store::release\n",(int)pos); STORE_ASSERT(pos>0 && (pos & (BLOCK_SIZE-1))==0); // goto end of the block - off_t cur = pos, next; + portable_off_t cur = pos, next; while (1) { // add new node to the free list @@ -247,7 +242,7 @@ void Store::release(off_t pos) m_head = node; // goto the end of cur block - if (fseeko(m_file,cur+BLOCK_SIZE-BLOCK_POINTER_SIZE,SEEK_SET)==-1) + if (portable_fseek(m_file,cur+BLOCK_SIZE-BLOCK_POINTER_SIZE,SEEK_SET)==-1) { fprintf(stderr,"Store::release: Error seeking to position %d: %s\n", (int)(cur+BLOCK_SIZE-BLOCK_POINTER_SIZE),strerror(errno)); @@ -266,11 +261,11 @@ void Store::release(off_t pos) } } -void Store::seek(off_t pos) +void Store::seek(portable_off_t pos) { STORE_ASSERT(m_state==Reading); //printf("%x: Store::seek\n",(int)pos); - if (fseeko(m_file,pos,SEEK_SET)==-1) + if (portable_fseek(m_file,pos,SEEK_SET)==-1) { fprintf(stderr,"Store::seek: Error seeking to position %d: %s\n", (int)pos,strerror(errno)); @@ -282,10 +277,10 @@ void Store::seek(off_t pos) int Store::read(char *buf,uint size) { STORE_ASSERT(m_state==Reading); - //printf("%x: Store::read total=%d\n",(int)ftello(m_file),size); + //printf("%x: Store::read total=%d\n",(int)portable_ftell(m_file),size); do { - off_t curPos = ftello(m_file); + portable_off_t curPos = portable_ftell(m_file); int bytesInBlock = BLOCK_SIZE - BLOCK_POINTER_SIZE - (curPos & (BLOCK_SIZE-1)); int bytesLeft = bytesInBlock<(int)size ? (int)size-bytesInBlock : 0; int numBytes = size - bytesLeft; @@ -293,7 +288,7 @@ int Store::read(char *buf,uint size) if (numBytes>0) { - //printf("%x: Store::read: %d out of %d bytes\n",(int)ftello(m_file),numBytes,size); + //printf("%x: Store::read: %d out of %d bytes\n",(int)portable_ftell(m_file),numBytes,size); if ((int)fread(buf,1,numBytes,m_file)!=numBytes) { fprintf(stderr,"Error reading from store: %s\n",strerror(errno)); @@ -303,9 +298,9 @@ int Store::read(char *buf,uint size) } if (bytesLeft>0) { - off_t newPos; + portable_off_t newPos; // read offset of the next block - STORE_ASSERT(((ftello(m_file)+BLOCK_POINTER_SIZE)&(BLOCK_SIZE-1))==0); + STORE_ASSERT(((portable_ftell(m_file)+BLOCK_POINTER_SIZE)&(BLOCK_SIZE-1))==0); if (fread((char *)&newPos,BLOCK_POINTER_SIZE,1,m_file)!=1) { fprintf(stderr,"Error reading from store: %s\n",strerror(errno)); @@ -317,7 +312,7 @@ int Store::read(char *buf,uint size) STORE_ASSERT((newPos&(BLOCK_SIZE-1))==0); curPos = newPos; // move to next block - if (fseeko(m_file,curPos,SEEK_SET)==-1) + if (portable_fseek(m_file,curPos,SEEK_SET)==-1) { fprintf(stderr,"Store::read: Error seeking to position %d: %s\n", (int)curPos,strerror(errno)); @@ -335,7 +330,7 @@ int Store::read(char *buf,uint size) void Store::printFreeList() { printf("FreeList: "); - off_t pos = m_head->pos; + portable_off_t pos = m_head->pos; while (pos) { printf("%x ",(int)pos); @@ -354,7 +349,7 @@ void Store::printStats() int main() { - printf("sizeof(off_t)=%d\n",(int)sizeof(off_t)); + printf("sizeof(portable_off_t)=%d\n",(int)sizeof(portable_off_t)); Store s; if (s.open("test.db")==0) { @@ -366,13 +361,13 @@ int main() { char buf[100]; - off_t handle = s.alloc(); + portable_off_t handle = s.alloc(); for (i=0;i<1000000000;i++) { s.write(str1,strlen(str1)+1); } s.end(); - off_t handle2 = s.alloc(); + portable_off_t handle2 = s.alloc(); for (i=0;i<10;i++) { s.write(str2,strlen(str2)+1); diff --git a/src/store.h b/src/store.h index 3fc3ac0..4e0503e 100644 --- a/src/store.h +++ b/src/store.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -20,7 +20,8 @@ #include <qglobal.h> #include <stdio.h> -#include <sys/types.h> + +#include "portable.h" /*! @brief Abstract interface for file based memory storage operations */ class StorageIntf @@ -63,7 +64,7 @@ class Store : public StorageIntf int open(const char *name); /*! Allocates a handle to write to and read from. */ - off_t alloc(); + portable_off_t alloc(); /*! Writes \a size bytes in array \a buf to the store. * First alloc() has to be called. @@ -78,13 +79,13 @@ class Store : public StorageIntf void end(); /*! Releases the memory corresponding to the handle returned with alloc() */ - void release(off_t handle); + void release(portable_off_t handle); /*! Closes the store */ void close(); /*! Goes to the start of information corresponding to handle \a pos */ - void seek(off_t handle); + void seek(portable_off_t handle); /*! Reads \a size bytes from the store into the array pointed to be \a buf. * \note Before reading seek() has to be called to set the right start of the store. @@ -102,12 +103,12 @@ class Store : public StorageIntf }; struct Node { - off_t pos; + portable_off_t pos; struct Node *next; }; void printFreeList(); FILE *m_file; - off_t m_front; + portable_off_t m_front; Node *m_head; State m_state; int m_reads; diff --git a/src/tagreader.cpp b/src/tagreader.cpp index 8fd61a8..22a0648 100644 --- a/src/tagreader.cpp +++ b/src/tagreader.cpp @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/tagreader.h b/src/tagreader.h index d52b3df..6bc466e 100644 --- a/src/tagreader.h +++ b/src/tagreader.h @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/textdocvisitor.cpp b/src/textdocvisitor.cpp index a2c722b..fe5573b 100644 --- a/src/textdocvisitor.cpp +++ b/src/textdocvisitor.cpp @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/textdocvisitor.h b/src/textdocvisitor.h index 3fcf96a..cf7788a 100644 --- a/src/textdocvisitor.h +++ b/src/textdocvisitor.h @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/translator.h b/src/translator.h index 449af81..dc18558 100644 --- a/src/translator.h +++ b/src/translator.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/translator_ar.h b/src/translator_ar.h index 7ce9c0a..6a37040 100644 --- a/src/translator_ar.h +++ b/src/translator_ar.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2005 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -71,7 +71,7 @@ class TranslatorArabic : public TranslatorAdapter_1_4_6 /*! return the language charset. This will be used for the HTML output */ virtual QCString idLanguageCharset() { - return "cp 1256"; + return "cp1256"; } // --- Language translation methods ------------------- diff --git a/src/translator_br.h b/src/translator_br.h index 51f426d..da6bdbd 100644 --- a/src/translator_br.h +++ b/src/translator_br.h @@ -1,5 +1,5 @@ /****************************************************************************** - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -64,7 +64,7 @@ class TranslatorBrazilian : public Translator */ virtual QCString latexLanguageSupportCommand() { - return ""; + return "\\usepackage[spanish]{babel}"; } /*! return the language charset. This will be used for the HTML output */ diff --git a/src/translator_ca.h b/src/translator_ca.h index d2a0be3..5380d0a 100644 --- a/src/translator_ca.h +++ b/src/translator_ca.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -70,7 +70,8 @@ class TranslatorCatalan : public Translator */ virtual QCString latexLanguageSupportCommand() { - return "\\usepackage[catalan]{babel} \n\\usepackage[latin1]{inputenc}"; + //return "\\usepackage[catalan]{babel}\n\\usepackage[latin1]{inputenc}"; + return "\\usepackage[catalan]{babel}\n"; } /*! return the language charset. This will be used for the HTML output */ diff --git a/src/translator_cn.h b/src/translator_cn.h index 3233755..ac2bb6d 100644 --- a/src/translator_cn.h +++ b/src/translator_cn.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/translator_cz.h b/src/translator_cz.h index 348e2b7..ef261ed 100644 --- a/src/translator_cz.h +++ b/src/translator_cz.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -96,14 +96,14 @@ class TranslatorCzech : public Translator */ inline QCString decode(const QCString & sInput) { - if (Config_getBool("USE_WINDOWS_ENCODING")) - { + //if (Config_getBool("USE_WINDOWS_ENCODING")) + //{ return sInput; - } - else - { - return Win1250ToISO88592(sInput); - } + //} + //else + //{ + // return Win1250ToISO88592(sInput); + //} } public: @@ -113,19 +113,22 @@ class TranslatorCzech : public Translator { return "czech"; } virtual QCString latexLanguageSupportCommand() - { return "\\usepackage{czech}\n"; } + { + return "\\usepackage[T2A]{fontenc}\n" + "\\usepackage[czech]{babel}\n"; + } /*! return the language charset. This will be used for the HTML output */ virtual QCString idLanguageCharset() { - if (Config_getBool("USE_WINDOWS_ENCODING")) - { + //if (Config_getBool("USE_WINDOWS_ENCODING")) + //{ return "windows-1250"; - } - else - { - return "iso-8859-2"; - } + //} + //else + //{ + // return "iso-8859-2"; + //} } // --- Language translation methods ------------------- diff --git a/src/translator_de.h b/src/translator_de.h index 2b40e9d..f36c971 100644 --- a/src/translator_de.h +++ b/src/translator_de.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -137,9 +137,10 @@ class TranslatorGerman : public Translator */ virtual QCString latexLanguageSupportCommand() { - QCString result="\\usepackage{ngerman}\n"; - result+="\\usepackage[latin1]{inputenc}\n"; + //QCString result="\\usepackage{ngerman}\n"; + //result+="\\usepackage[latin1]{inputenc}\n"; //result+="%\\usepackage[latin1]{inputenc}% Kodierung (cp850,latin1,ansinew)\n"; + QCString result="\\usepackage[german]{babel}\n"; return result; } diff --git a/src/translator_dk.h b/src/translator_dk.h index 1168a38..c6fe415 100644 --- a/src/translator_dk.h +++ b/src/translator_dk.h @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -109,7 +109,6 @@ class TranslatorDanish : public Translator { return "\\usepackage[danish]{babel}\n" - "\\usepackage[latin1]{inputenc}\n" "\\usepackage[T1]{fontenc}\n"; } diff --git a/src/translator_en.h b/src/translator_en.h index 877f861..b53a355 100644 --- a/src/translator_en.h +++ b/src/translator_en.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/translator_es.h b/src/translator_es.h index 10b2aa7..996665d 100644 --- a/src/translator_es.h +++ b/src/translator_es.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -21,17 +21,28 @@ * - It's posible that some sentences haven't got meaning because * some words haven't got translate in spanish. * Updated from 1.3.8 to 1.4.6 by Guillermo Ballester Valor (May-05-2006) + * Updated fron 1.4.6 to 1.5.1 by Bartomeu Creus Navarro (22-enero-2007) */ #ifndef TRANSLATOR_ES_H #define TRANSLATOR_ES_H -class TranslatorSpanish : public TranslatorAdapter_1_4_6 +class TranslatorSpanish : public Translator { + public: + + // --- Language control methods ------------------- + + /*! Used for identification of the language. The identification + * should not be translated. It should be replaced by the name + * of the language in English using lower-case characters only + * (e.g. "czech", "japanese", "russian", etc.). It should be equal to + * the identification used in language.cpp. + */ virtual QCString idLanguage() { return "spanish"; } - + /*! Used to get the LaTeX command(s) for the language support. * This method should return string with commands that switch * LaTeX to the desired language. For example @@ -57,6 +68,8 @@ class TranslatorSpanish : public TranslatorAdapter_1_4_6 return "iso-8859-1"; } + // --- Language translation methods ------------------- + /*! used in the compound documentation before a list of related functions. */ virtual QCString trRelatedFunctions() { return "Funciones relacionadas"; } @@ -83,7 +96,16 @@ class TranslatorSpanish : public TranslatorAdapter_1_4_6 /*! header that is put before the list of member attributes. */ virtual QCString trMemberDataDocumentation() - { return "Documentación de los datos miembro"; } + { + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + return "Documentación de los campos"; + } + else + { + return "Documentación de los datos miembro"; + } + } /*! this is the text of a link put after brief descriptions. */ virtual QCString trMore() @@ -141,23 +163,46 @@ class TranslatorSpanish : public TranslatorAdapter_1_4_6 /*! This is put above each page as a link to the list of annotated classes */ virtual QCString trCompoundList() - { return "Lista de componentes"; } + { + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + return "Estructura de datos"; + } + else + { + return "Lista de clases"; + } + } /*! This is put above each page as a link to the list of documented files */ virtual QCString trFileList() { return "Lista de archivos"; } - /*! This is put above each page as a link to the list of all verbatim headers */ - virtual QCString trHeaderFiles() - { return "Archivos cabecera"; } - /*! This is put above each page as a link to all members of compounds. */ virtual QCString trCompoundMembers() - { return "Miembros de las clases"; } + { + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + return "Campos de datos"; + } + else + { + return "Miembros de las clases"; + } + } /*! This is put above each page as a link to all members of files. */ virtual QCString trFileMembers() - { return "Archivos de los miembros"; } + { + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + return "Globales"; + } + else + { + return "Miembros de los ficheros"; + } + } /*! This is put above each page as a link to all related pages. */ virtual QCString trRelatedPages() @@ -173,8 +218,8 @@ class TranslatorSpanish : public TranslatorAdapter_1_4_6 /*! This is an introduction to the class hierarchy. */ virtual QCString trClassHierarchyDescription() - { return "Esta lista de herencias esta ordenada rigurosamente, " - "pero no completa, por orden alfabético:"; + { return "Esta lista de herencias esta ordenada " + "aproximadamente por orden alfabético:"; } /*! This is an introduction to the list with all files. */ @@ -188,40 +233,82 @@ class TranslatorSpanish : public TranslatorAdapter_1_4_6 /*! This is an introduction to the annotated compound list. */ virtual QCString trCompoundListDescription() - { return "Lista de las clases, estructuras, " + { + + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + return "Lista de estructuras con una breve descripción:"; + } + else + { + return "Lista de las clases, estructuras, " "uniones e interfaces con una breve descripción:"; + } } /*! This is an introduction to the page with all class members. */ virtual QCString trCompoundMembersDescription(bool extractAll) { - QCString result="Lista de"; - if (!extractAll) result+=" toda la documentación de"; - result+=" los miembros de la clase con enlaces a "; + QCString result="Esta es la lista de todos los "; + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + result+="campos de estructuras y uniones"; + } + else + { + result+="campos de clases"; + } + if (!extractAll) + { + result+=" documentados"; + } + result+=" con enlaces a "; if (!extractAll) - result+=" la documentación de cada clase:"; + { + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + result+="la documentación de la estructura/unión para cada campo:"; + } + else + { + result+="la documentación de la clase para cada miembro:"; + } + } else - result+=" la clase de la que forman parte:"; + { + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + result+="las estructuras/uniones a que pertenecen:"; + } + else + { + result+="las classes a que pertenecen:"; + } + } return result; } /*! This is an introduction to the page with all file members. */ virtual QCString trFileMembersDescription(bool extractAll) { - QCString result="Lista de "; - if (!extractAll) result+="toda la documentación de "; - result+="los miembros con enlaces a "; + QCString result="Esta es la lista de "; + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + result+="todas las funciones, variables, definiciones, enumeraciones y definiciones de tipos"; + } + else + { + result+="todos los mienbros de los ficheros"; + } + if (!extractAll) result+=" documentados"; + result+=" con enlaces "; if (extractAll) - result+="los documentos de cada archivo a los que pertenecen:"; + result+="a los ficheros a los que corresponden:"; else - result+="los archivos de los que forman parte:"; + result+="a la documentación:"; return result; } - /*! This is an introduction to the page with the list of all header files. */ - virtual QCString trHeaderFilesDescription() - { return "Lista de los archivos cabecera que crean el API:"; } - /*! This is an introduction to the page with the list of all examples */ virtual QCString trExamplesDescription() { return "Lista de todos los ejemplos:"; } @@ -234,15 +321,8 @@ class TranslatorSpanish : public TranslatorAdapter_1_4_6 virtual QCString trModulesDescription() { return "Lista de todos los módulos:"; } - /*! This sentences is used in the annotated class/file lists if no brief - * description is given. - */ - virtual QCString trNoDescriptionAvailable() - { return "Descripción no disponible"; } - // index titles (the project name is prepended for these) - /*! This is used in HTML as the title of index.html. */ virtual QCString trDocumentation() { return "Documentación"; } @@ -263,7 +343,16 @@ class TranslatorSpanish : public TranslatorAdapter_1_4_6 * annotated compound index. */ virtual QCString trCompoundIndex() - { return "Indice de clases"; } + { + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + return "Índice de estructura de datos"; + } + else + { + return "Índice de clases"; + } + } /*! This is used in LaTeX as the title of the chapter with the * list of all files. @@ -281,7 +370,16 @@ class TranslatorSpanish : public TranslatorAdapter_1_4_6 * the documentation of all classes, structs and unions. */ virtual QCString trClassDocumentation() - { return "Documentación de clases"; } + { + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + return "Documentación de las estructuras de datos"; + } + else + { + return "Documentación de las clases"; + } + } /*! This is used in LaTeX as the title of the chapter containing * the documentation of all files. @@ -347,15 +445,6 @@ class TranslatorSpanish : public TranslatorAdapter_1_4_6 virtual QCString trEnumerationValues() { return "Valores de la enumeración"; } - /*! This text is generated when the \\author command is used and - * for the author section in man pages. */ - virtual QCString trAuthor(bool first_capital, bool singular) - { - QCString result((first_capital ? "Autor" : "autor")); - if (!singular) result+="s"; - return result; - } - /*! This is used in the documentation of a file before the list of * documentation blocks for defines */ @@ -381,12 +470,6 @@ class TranslatorSpanish : public TranslatorAdapter_1_4_6 { return "Documentación de las enumeraciones"; } /*! This is used in the documentation of a file/namespace before the list - * of documentation blocks for enumeration values - */ - virtual QCString trEnumerationValueDocumentation() - { return "Documentación de los valores de la enumeración"; } - - /*! This is used in the documentation of a file/namespace before the list * of documentation blocks for functions */ virtual QCString trFunctionDocumentation() @@ -402,7 +485,16 @@ class TranslatorSpanish : public TranslatorAdapter_1_4_6 * the list of links to documented compounds */ virtual QCString trCompounds() - { return "Clases"; } + { + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + return "Estructuras de datos"; + } + else + { + return "Clases"; + } + } /*! This is used in the standard footer of each page and indicates when * the page was generated @@ -431,18 +523,10 @@ class TranslatorSpanish : public TranslatorAdapter_1_4_6 virtual QCString trForInternalUseOnly() { return "Para uso interno exclusivamente."; } - /*! this text is generated when the \\reimp command is used. */ - virtual QCString trReimplementedForInternalReasons() - { return "Reimplementado por razones internas; el API no se ve afectado."; } - /*! this text is generated when the \\warning command is used. */ virtual QCString trWarning() { return "Atención"; } - /*! this text is generated when the \\bug command is used. */ - virtual QCString trBugsAndLimitations() - { return "Bugs y limitaciones"; } - /*! this text is generated when the \\version command is used. */ virtual QCString trVersion() { return "Versión"; } @@ -451,7 +535,7 @@ class TranslatorSpanish : public TranslatorAdapter_1_4_6 virtual QCString trDate() { return "Fecha"; } - /*! this text is generated when the \return command is used. */ + /*! this text is generated when the \\return command is used. */ virtual QCString trReturns() { return "Devuelve"; } @@ -471,7 +555,9 @@ class TranslatorSpanish : public TranslatorAdapter_1_4_6 virtual QCString trGeneratedBy() { return "Generado por"; } - // new since 0.49-990307 +////////////////////////////////////////////////////////////////////////// +// new since 0.49-990307 +////////////////////////////////////////////////////////////////////////// /*! used as the title of page containing all the index of all namespaces. */ virtual QCString trNamespaceList() @@ -509,9 +595,8 @@ class TranslatorSpanish : public TranslatorAdapter_1_4_6 /*! used as the title of the HTML page of a class/struct/union */ virtual QCString trCompoundReference(const char *clName, ClassDef::CompoundType compType, - bool /*isTemplate*/) + bool isTemplate) { - QCString result="Referencia de "; switch(compType) { @@ -519,10 +604,11 @@ class TranslatorSpanish : public TranslatorAdapter_1_4_6 case ClassDef::Struct: result+="la Estructura "; break; case ClassDef::Union: result+="la Unión "; break; case ClassDef::Interface: result+="la Interfaz "; break; - case ClassDef::Protocol: result+="Protocol "; break; // translate me! - case ClassDef::Category: result+="Category "; break; // translate me! + case ClassDef::Protocol: result+="el Protocolo "; break; + case ClassDef::Category: result+="la Categoria "; break; case ClassDef::Exception: result+="la Excepción "; break; } + if (isTemplate) result+=" <template>"; result+=(QCString)clName; return result; } @@ -543,7 +629,6 @@ class TranslatorSpanish : public TranslatorAdapter_1_4_6 return result; } - /* these are for the member sections of a class, struct or union */ virtual QCString trPublicMembers() { return "Métodos públicos"; } virtual QCString trPublicSlots() @@ -671,20 +756,20 @@ class TranslatorSpanish : public TranslatorAdapter_1_4_6 bool single) { // here s is one of " Class", " Struct" or " Union" // single is true implies a single file - QCString result=(QCString)"La documentación para esta "; + QCString result=(QCString)"La documentación para est"; switch(compType) { - case ClassDef::Class: result+="clase"; break; - case ClassDef::Struct: result+="estructura"; break; - case ClassDef::Union: result+="unión"; break; - case ClassDef::Interface: result+="interfaz"; break; - case ClassDef::Protocol: result+="protocol"; break; // translate me! - case ClassDef::Category: result+="category"; break; // translate me! - case ClassDef::Exception: result+="excepción"; break; + case ClassDef::Class: result+="a clase"; break; + case ClassDef::Struct: result+="a estructura"; break; + case ClassDef::Union: result+="a unión"; break; + case ClassDef::Interface: result+="e interfaz"; break; + case ClassDef::Protocol: result+="e protocolo"; break; + case ClassDef::Category: result+="a categoría"; break; + case ClassDef::Exception: result+="a excepción"; break; } - result+=" fué generada a partir "; - if (single) result+="del siguiente archivo:"; - else result+="de los siguientes archivos:"; + result+=" fué generada a partir de"; + if (single) result+="l siguiente fichero:"; + else result+=" los siguientes ficheros:"; return result; } @@ -717,10 +802,6 @@ class TranslatorSpanish : public TranslatorAdapter_1_4_6 // new since 0.49-991003 ////////////////////////////////////////////////////////////////////////// - virtual QCString trSources() - { - return "Fuentes"; - } virtual QCString trDefinedAtLineInSourceFile() { return "Definición en la línea @0 del archivo @1."; @@ -729,19 +810,20 @@ class TranslatorSpanish : public TranslatorAdapter_1_4_6 { return "Definición en el archivo @0."; } + ////////////////////////////////////////////////////////////////////////// // new since 0.49-991205 ////////////////////////////////////////////////////////////////////////// + virtual QCString trDeprecated() { - return "Desaprobado"; + return "Obsoleto"; } ////////////////////////////////////////////////////////////////////////// // new since 1.0.0 ////////////////////////////////////////////////////////////////////////// - /*! this text is put before a collaboration diagram */ virtual QCString trCollaborationDiagram(const char *clName) { @@ -812,19 +894,25 @@ class TranslatorSpanish : public TranslatorAdapter_1_4_6 ////////////////////////////////////////////////////////////////////////// // new since 1.1.0 ////////////////////////////////////////////////////////////////////////// - + virtual QCString trNote() { return "Nota"; } - virtual QCString trPublicTypes() { return "Tipos públicos"; } virtual QCString trPublicAttribs() { - return "Atributos públicos"; + if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) + { + return "Campos de datos"; + } + else + { + return "Atributos públicos"; + } } virtual QCString trStaticPublicAttribs() { @@ -859,7 +947,7 @@ class TranslatorSpanish : public TranslatorAdapter_1_4_6 // new since 1.1.3 ////////////////////////////////////////////////////////////////////////// - /*! Used as a marker that is put before a todo item */ + /*! Used as a marker that is put before a \\todo item */ virtual QCString trTodo() { return "Tareas Pendientes"; @@ -889,13 +977,13 @@ class TranslatorSpanish : public TranslatorAdapter_1_4_6 virtual QCString trInclByDepGraph() { return "Este gráfico muestra que archivos directa o " - "indirectamente incluyen a este archivo:"; + "indirectamente incluyen a este archivo:"; } virtual QCString trSince() { return "Desde"; } - + ////////////////////////////////////////////////////////////////////////// // new since 1.1.5 ////////////////////////////////////////////////////////////////////////// @@ -905,14 +993,17 @@ class TranslatorSpanish : public TranslatorAdapter_1_4_6 { return "Leyenda del Gráfico"; } - /*! page explaining how the dot graph's should be interpreted */ - QCString trLegendDocs() + /*! page explaining how the dot graph's should be interpreted + * The %A in the text below are to prevent link to classes called "A". + */ + virtual QCString trLegendDocs() { return "Esta página explica como interpretar los gráficos que son generados " - "por doxygen.<p>\n" - "Considere el siguiente ejemplo:\n" - "/*! Clase invisible por truncamiento */\n" + "por doxygen.<p>\n" + "Considere el siguiente ejemplo:\n" + "\\code\n" + "/*! Clase invisible por truncamiento */\n" "class Invisible { };\n\n" "/*! Clase truncada, relación de herencia escondida */\n" "class Truncated : public Invisible { };\n\n" @@ -920,7 +1011,9 @@ class TranslatorSpanish : public TranslatorAdapter_1_4_6 "class Undocumented { };\n\n" "/*! Clase que es heredera usando herencia publica */\n" "class PublicBase : public Truncated { };\n\n" - "/*! Clase que es heredera usando herencia protegida */\n" + "/*! Clase plantilla */\n" + "template<class T> class Templ { };\n\n" + "/*! Clase que es heredera usando herencia protegida */\n" "class ProtectedBase { };\n\n" "/*! Clase que es heredera usando herencia privada */\n" "class PrivateBase { };\n\n" @@ -931,60 +1024,60 @@ class TranslatorSpanish : public TranslatorAdapter_1_4_6 " protected ProtectedBase,\n" " private PrivateBase,\n" " public Undocumented\n" + " public Templ<int>\n" "{\n" " private:\n" " Used *m_usedClass;\n" "};\n" "\\endcode\n" "Si la etiqueta \\c MAX_DOT_GRAPH_HEIGHT en el archivo de configuración " - "tiene valor 200 resultará en el siguiente gráfico:" - "<p><center><img src=\"graph_legend."+Config_getEnum("DOT_IMAGE_FORMAT")+"\"></center>\n" + "tiene valor 240 resultará en el siguiente gráfico:" + "<p><center><img alt=\"\" src=\"graph_legend."+Config_getEnum("DOT_IMAGE_FORMAT")+"\"></center>\n" "<p>\n" "Las cajas en el gráfico arriba tienen el significado que sigue:\n" "<ul>\n" "<li>Una caja llena negra representa la estructura o clase para la cuál" - "se generó el gráfico.\n" + "se generó el gráfico.\n" "<li>Una caja con borde negro señala una estructura o clase documentada.\n" "<li>Una caja con borde griz señala una estructura o clase no documentada.\n" - "<li>una caja con borde rojo señala una estructura o clase documentada \n" - " de la cuál no toda las relaciones de jerarquía/contenido son " - "mostradas. El gráfico sera truncado si este no calza dentro de los " - "límites especificados." - "afgekapt als hij niet past binnen de gespecificeerde grenzen." + "<li>una caja con borde rojo señala una estructura o clase documentada" + " de la cuál no toda las relaciones de jerarquía/contenido son " + "mostradas. El gráfico sera truncado si este no calza dentro de los " + "límites especificados." "</ul>\n" "Las flechas tienen el siguiente significado:\n" "<ul>\n" - "<li>Una flecha azul oscuro es usada para visualizar una relación " - "herencia publica entre dos clases.\n" + "<li>Una flecha azul oscuro es usada para visualizar una relación herencia publica entre dos clases.\n" "<li>Una flecha verde oscura es usada para herencia protegida.\n" "<li>Una flecha rojo oscura es usada para herencia privada.\n" "<li>Una flecha segmentada púrpura se usa si la clase es contenida o " - "usada por otra clase. La flecha está etiquetada por la variable " - "con que se accede a la clase o estructura apuntada. \n" + "usada por otra clase. La flecha está etiquetada por la variable " + "con que se accede a la clase o estructura apuntada. \n" + "<li>Una flecha segmentada amarilla indica la relación entre una instancia template y la clase template de la que se ha instanciado." + " La flecha se etiqueta con los parámetros con que se llama al template.\n" "</ul>\n"; } /*! text for the link to the legend page */ - QCString trLegend() + virtual QCString trLegend() { return "leyenda"; } - + ////////////////////////////////////////////////////////////////////////// // new since 1.2.0 ////////////////////////////////////////////////////////////////////////// /*! Used as a marker that is put before a test item */ - QCString trTest() + virtual QCString trTest() { return "Prueba"; } /*! Used as the header of the test list */ - QCString trTestList() + virtual QCString trTestList() { return "Lista de Pruebas"; } - ////////////////////////////////////////////////////////////////////////// // new since 1.2.1 ////////////////////////////////////////////////////////////////////////// @@ -994,6 +1087,7 @@ class TranslatorSpanish : public TranslatorAdapter_1_4_6 { return "Métodos DCOP"; } + ////////////////////////////////////////////////////////////////////////// // new since 1.2.2 ////////////////////////////////////////////////////////////////////////// @@ -1013,11 +1107,6 @@ class TranslatorSpanish : public TranslatorAdapter_1_4_6 // new since 1.2.4 ////////////////////////////////////////////////////////////////////////// - /*! Used for Java interfaces in the summary section of Java packages */ - virtual QCString trInterfaces() - { - return "Interfaces"; - } /*! Used for Java classes in the summary section of Java packages */ virtual QCString trClasses() { @@ -1050,11 +1139,6 @@ class TranslatorSpanish : public TranslatorAdapter_1_4_6 { return "Paquetes"; } - /*! Used as a chapter title for Latex & RTF output */ - virtual QCString trPackageDocumentation() - { - return "Documentación del Paquete"; - } /*! Text shown before a multi-line define */ virtual QCString trDefineValue() { @@ -1110,6 +1194,7 @@ class TranslatorSpanish : public TranslatorAdapter_1_4_6 return "1252"; } + /*! Used as ansicpg for RTF fcharset * \see trRTFansicp() for a table of possible values. */ @@ -1131,7 +1216,6 @@ class TranslatorSpanish : public TranslatorAdapter_1_4_6 virtual QCString trClass(bool first_capital, bool singular) { QCString result((first_capital ? "Clase" : "clase")); - if (first_capital) toupper(result.at(0)); if (!singular) result+="s"; return result; } @@ -1175,7 +1259,7 @@ class TranslatorSpanish : public TranslatorAdapter_1_4_6 */ virtual QCString trPage(bool first_capital, bool singular) { - QCString result((first_capital ? "Página" : "pagina")); + QCString result((first_capital ? "Página" : "página")); if (!singular) result+="s"; return result; } @@ -1195,24 +1279,30 @@ class TranslatorSpanish : public TranslatorAdapter_1_4_6 * be followed by a single name or by a list of names * of the category. */ - virtual QCString trField(bool first_capital, bool singular) + virtual QCString trGlobal(bool first_capital, bool singular) { - QCString result((first_capital ? "Campo" : "campo")); - if (!singular) result+="s"; + QCString result((first_capital ? "Global" : "global")); + if (!singular) result+="es"; return result; } - /*! This is used for translation of the word that will possibly - * be followed by a single name or by a list of names - * of the category. - */ - virtual QCString trGlobal(bool first_capital, bool singular) - { - QCString result((first_capital ? "Global" : "global")); +////////////////////////////////////////////////////////////////////////// +// new since 1.2.7 +////////////////////////////////////////////////////////////////////////// + + /*! This text is generated when the \\author command is used and + * for the author section in man pages. */ + virtual QCString trAuthor(bool first_capital, bool singular) + { + QCString result((first_capital ? "Autor" : "autor")); if (!singular) result+="es"; return result; } +////////////////////////////////////////////////////////////////////////// +// new since 1.2.11 +////////////////////////////////////////////////////////////////////////// + /*! This text is put before the list of members referenced by a member */ virtual QCString trReferences() @@ -1220,6 +1310,10 @@ class TranslatorSpanish : public TranslatorAdapter_1_4_6 return "Hace referencia a"; } +////////////////////////////////////////////////////////////////////////// +// new since 1.2.13 +////////////////////////////////////////////////////////////////////////// + /*! used in member documentation blocks to produce a list of * members that are implemented by this one. */ @@ -1236,6 +1330,10 @@ class TranslatorSpanish : public TranslatorAdapter_1_4_6 return "Implementado en "+trWriteList(numEntries)+"."; } +////////////////////////////////////////////////////////////////////////// +// new since 1.2.16 +////////////////////////////////////////////////////////////////////////// + /*! used in RTF documentation as a heading for the Table * of Contents. */ @@ -1244,6 +1342,10 @@ class TranslatorSpanish : public TranslatorAdapter_1_4_6 return "Tabla de Contenidos"; } +////////////////////////////////////////////////////////////////////////// +// new since 1.2.17 +////////////////////////////////////////////////////////////////////////// + /*! Used as the header of the list of item that have been * flagged deprecated */ @@ -1252,6 +1354,10 @@ class TranslatorSpanish : public TranslatorAdapter_1_4_6 return "Lista de Desaprobados"; } +////////////////////////////////////////////////////////////////////////// +// new since 1.2.18 +////////////////////////////////////////////////////////////////////////// + /*! Used as a header for declaration section of the events found in * a C# program */ @@ -1259,20 +1365,22 @@ class TranslatorSpanish : public TranslatorAdapter_1_4_6 { return "Eventos"; } - /*! Header used for the documentation section of a class' events. */ virtual QCString trEventDocumentation() { return "Documentación de los Eventos"; } +////////////////////////////////////////////////////////////////////////// +// new since 1.3 +////////////////////////////////////////////////////////////////////////// + /*! Used as a heading for a list of Java class types with package scope. */ virtual QCString trPackageTypes() { return "Tipos del Paquete"; } - /*! Used as a heading for a list of Java class functions with package * scope. */ @@ -1280,7 +1388,6 @@ class TranslatorSpanish : public TranslatorAdapter_1_4_6 { return "Funciones del Paquete"; } - /*! Used as a heading for a list of static Java class functions with * package scope. */ @@ -1288,7 +1395,6 @@ class TranslatorSpanish : public TranslatorAdapter_1_4_6 { return "Funciones Estáticas del Paquete"; } - /*! Used as a heading for a list of Java class variables with package * scope. */ @@ -1296,7 +1402,6 @@ class TranslatorSpanish : public TranslatorAdapter_1_4_6 { return "Atributos del Paquete"; } - /*! Used as a heading for a list of static Java class variables with * package scope. */ @@ -1304,7 +1409,7 @@ class TranslatorSpanish : public TranslatorAdapter_1_4_6 { return "Atributos Estáticos del Paquete"; } - + ////////////////////////////////////////////////////////////////////////// // new since 1.3.1 ////////////////////////////////////////////////////////////////////////// @@ -1316,7 +1421,6 @@ class TranslatorSpanish : public TranslatorAdapter_1_4_6 { return "Todo"; } - /*! Put in front of the call graph for a function. */ virtual QCString trCallGraph() { @@ -1327,15 +1431,14 @@ class TranslatorSpanish : public TranslatorAdapter_1_4_6 // new since 1.3.3 ////////////////////////////////////////////////////////////////////////// - - /*! When the search engine is enabled this text is put in the index - * of each page before the search field. + /*! 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 "Buscar"; } - /*! This string is used as the title for the page listing the search * results. */ @@ -1343,7 +1446,6 @@ class TranslatorSpanish : public TranslatorAdapter_1_4_6 { return "Resultados de la Búsqueda"; } - /*! 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 @@ -1368,7 +1470,6 @@ class TranslatorSpanish : public TranslatorAdapter_1_4_6 "Se muestran los mejores resultados primero."; } } - /*! 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. */ @@ -1414,8 +1515,8 @@ class TranslatorSpanish : public TranslatorAdapter_1_4_6 * and the fact that it is sorted alphabetically per level */ virtual QCString trDirDescription() - { return "La jeraquía de este directorio está ordenada casi, " - "pero no completamente, de forma alfabética:"; + { return "La jeraquía de este directorio está ordenada" + " alfabéticamente, de manera aproximada:"; } /*! This returns the title of a directory page. The name of the @@ -1447,9 +1548,24 @@ class TranslatorSpanish : public TranslatorAdapter_1_4_6 "suministra por conveniencia. Difiere de la anterior " "función solamente en los argumentos que acepta."; } -}; +////////////////////////////////////////////////////////////////////////// +// new since 1.4.6 +////////////////////////////////////////////////////////////////////////// + + /*! This is used to introduce a caller (or called-by) graph */ + virtual QCString trCallerGraph() + { + return "Gráfico de llamadas a esta función:"; + } -#endif + /*! This is used in the documentation of a file/namespace before the list + * of documentation blocks for enumeration values + */ + virtual QCString trEnumerationValueDocumentation() + { return "Documentación de los valores de la enumeración"; } +}; + +#endif diff --git a/src/translator_fa.h b/src/translator_fa.h index 2a13f61..5f3a436 100644 --- a/src/translator_fa.h +++ b/src/translator_fa.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2005 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/translator_fi.h b/src/translator_fi.h index b983c10..132da4d 100644 --- a/src/translator_fi.h +++ b/src/translator_fi.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/translator_fr.h b/src/translator_fr.h index 861c5c4..f79b0cc 100644 --- a/src/translator_fr.h +++ b/src/translator_fr.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/translator_gr.h b/src/translator_gr.h index 3833185..3faae08 100644 --- a/src/translator_gr.h +++ b/src/translator_gr.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2005 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -46,7 +46,8 @@ class TranslatorGreek : public Translator virtual QCString latexLanguageSupportCommand() { - return "\\usepackage[greek,english]{babel}\n\\usepackage[iso-8859-7]{inputenc}\n"; + //return "\\usepackage[greek,english]{babel}\n\\usepackage[iso-8859-7]{inputenc}\n"; + return "\\usepackage[greek,english]{babel}\n"; } /*! return the language charset. This will be used for the HTML output */ diff --git a/src/translator_hr.h b/src/translator_hr.h index e4d6f43..7779087 100644 --- a/src/translator_hr.h +++ b/src/translator_hr.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -77,14 +77,14 @@ class TranslatorCroatian : public Translator /*! to avoid macro redefinition from translator_cz.h */ inline QCString decode(const QCString& sInput) { - if (Config_getBool("USE_WINDOWS_ENCODING")) - { - return ISO88592ToWin1250(sInput); - } - else - { + //if (Config_getBool("USE_WINDOWS_ENCODING")) + //{ + // return ISO88592ToWin1250(sInput); + //} + //else + //{ return sInput; - } + //} } public: @@ -92,14 +92,14 @@ class TranslatorCroatian : public Translator { return "croatian"; } QCString idLanguageCharset() { - if (Config_getBool("USE_WINDOWS_ENCODING")) - { - return "windows-1250"; - } - else - { + //if (Config_getBool("USE_WINDOWS_ENCODING")) + //{ + // return "windows-1250"; + //} + //else + //{ return "iso-8859-2"; - } + //} } QCString latexLanguageSupportCommand() { return "\\usepackage[croatian]{babel}\n"; } diff --git a/src/translator_hu.h b/src/translator_hu.h index a0bbbcb..3325125 100644 --- a/src/translator_hu.h +++ b/src/translator_hu.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -56,7 +56,8 @@ class TranslatorHungarian : public TranslatorAdapter_1_4_6 */ virtual QCString latexLanguageSupportCommand() { - return "\\usepackage{t1enc}\n\\usepackage[latin2]{inputenc}\n\\usepackage[magyar]{babel}\n"; + return "\\usepackage[T2A]{fontenc}\n" + "\\usepackage[magyar]{babel}\n"; } /*! return the language charset. This will be used for the HTML output */ diff --git a/src/translator_id.h b/src/translator_id.h index a68e328..053f0d6 100644 --- a/src/translator_id.h +++ b/src/translator_id.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -54,7 +54,7 @@ class TranslatorIndonesian : public TranslatorAdapter_1_4_6 */ virtual QCString latexLanguageSupportCommand() { - return ""; + return "\\usepackage[indonesian]{babel}"; } /*! return the language charset. This will be used for the HTML output */ diff --git a/src/translator_it.h b/src/translator_it.h index 6e5820c..c289807 100644 --- a/src/translator_it.h +++ b/src/translator_it.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/translator_je.h b/src/translator_je.h index cbccb32..1b7f4b1 100644 --- a/src/translator_je.h +++ b/src/translator_je.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -41,14 +41,14 @@ class TranslatorJapaneseEn : public TranslatorEnglish /*! returns the name of the package that is included by LaTeX */ virtual QCString idLanguageCharset() { - if (Config_getBool("USE_WINDOWS_ENCODING")) - { - return "Shift_JIS"; - } - else - { + //if (Config_getBool("USE_WINDOWS_ENCODING")) + //{ + // return "Shift_JIS"; + //} + //else + //{ return "euc-jp"; - } + //} } virtual QCString trRTFansicp() { diff --git a/src/translator_jp.h b/src/translator_jp.h index 8e84750..1b509b4 100644 --- a/src/translator_jp.h +++ b/src/translator_jp.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -35,33 +35,33 @@ class TranslatorJapanese : public Translator /*! The decode() can change euc into sjis */ inline QCString decode(const QCString & sInput) { - if (Config_getBool("USE_WINDOWS_ENCODING")) - { - return JapaneseEucToSjis(sInput); - } - else - { + //if (Config_getBool("USE_WINDOWS_ENCODING")) + //{ + // return JapaneseEucToSjis(sInput); + //} + //else + //{ return sInput; - } + //} } public: virtual QCString idLanguage() { return "japanese"; } virtual QCString latexLanguageSupportCommand() - { - return ""; - } + { + return ""; + } /*! returns the name of the package that is included by LaTeX */ virtual QCString idLanguageCharset() { - if (Config_getBool("USE_WINDOWS_ENCODING")) - { - return "Shift_JIS"; - } - else - { + //if (Config_getBool("USE_WINDOWS_ENCODING")) + //{ + // return "Shift_JIS"; + //} + //else + //{ return "euc-jp"; - } + //} } /*! used in the compound documentation before a list of related functions. */ diff --git a/src/translator_ke.h b/src/translator_ke.h index e1f558a..027a670 100644 --- a/src/translator_ke.h +++ b/src/translator_ke.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/translator_kr.h b/src/translator_kr.h index 9f8ee93..2593e02 100644 --- a/src/translator_kr.h +++ b/src/translator_kr.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -116,7 +116,9 @@ class TranslatorKorean : public TranslatorAdapter_1_4_6 // I'm not sure what this should be. // When I figure it out, I'll update this. //see http://www.ktug.or.kr/jsboard/read.php?table=operate&no=4422&page=1 - return "\\usepackage{hfont}\n"; + return "\\usepackage{hfont}\n" + "\\usepackage{ucs}\n" + "\\usepackage[encapsulation]{CJK}\n"; } /*! return the language charset. This will be used for the HTML output */ diff --git a/src/translator_lt.h b/src/translator_lt.h index da67dad..72c4199 100644 --- a/src/translator_lt.h +++ b/src/translator_lt.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -63,7 +63,8 @@ class TranslatorLithuanian : public TranslatorAdapter_1_4_6 */ virtual QCString latexLanguageSupportCommand() { - return ""; + return "\\usepackage[T2A]{fontenc}\n" + "\\usepackage[lithuanian]{babel}\n"; } /*! return the language charset. This will be used for the HTML output */ diff --git a/src/translator_nl.h b/src/translator_nl.h index fb24e83..fcf821cb 100644 --- a/src/translator_nl.h +++ b/src/translator_nl.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/translator_no.h b/src/translator_no.h index bf0ac74..35df614 100644 --- a/src/translator_no.h +++ b/src/translator_no.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -75,7 +75,6 @@ class TranslatorNorwegian : public TranslatorAdapter_1_4_6 { return "\\usepackage[norwegian]{babel}\n" - "\\usepackage[latin1]{inputenc}\n" "\\usepackage[T1]{fontenc}\n"; } diff --git a/src/translator_pl.h b/src/translator_pl.h index 69c4829..71af4c8 100644 --- a/src/translator_pl.h +++ b/src/translator_pl.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -26,14 +26,14 @@ class TranslatorPolish : public TranslatorAdapter_1_4_6 /*! to avoid macro redefinition from translator_pl.h */ inline QCString decode(const QCString& sInput) { - if (Config_getBool("USE_WINDOWS_ENCODING")) - { - return ISO88592ToWin1250(sInput); - } - else - { + //if (Config_getBool("USE_WINDOWS_ENCODING")) + //{ + // return ISO88592ToWin1250(sInput); + //} + //else + //{ return sInput; - } + //} } public: @@ -55,20 +55,21 @@ class TranslatorPolish : public TranslatorAdapter_1_4_6 */ QCString latexLanguageSupportCommand() { - return "\\usepackage{polski} \\usepackage[latin2]{inputenc} \\usepackage[T1]{fontenc}"; + return "\\usepackage{polski}\n" + "\\usepackage[T1]{fontenc}\n"; } /*! return the language charset. This will be used for the HTML output */ virtual QCString idLanguageCharset() { - if (Config_getBool("USE_WINDOWS_ENCODING")) - { - return "windows-1250"; - } - else - { + //if (Config_getBool("USE_WINDOWS_ENCODING")) + //{ + // return "windows-1250"; + //} + //else + //{ return "iso-8859-2"; - } + //} } // --- Language translation methods ------------------- diff --git a/src/translator_pt.h b/src/translator_pt.h index e53efdd..ebe8ce9 100644 --- a/src/translator_pt.h +++ b/src/translator_pt.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/translator_ro.h b/src/translator_ro.h index fe12908..32fb99c 100644 --- a/src/translator_ro.h +++ b/src/translator_ro.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -75,7 +75,7 @@ class TranslatorRomanian : public TranslatorAdapter_1_4_1 */ virtual QCString latexLanguageSupportCommand() { - return "\\usepackage{romanian}\n"; + return "\\usepackage[romanian]{babel}\n"; } /*! return the language charset. This will be used for the HTML output */ diff --git a/src/translator_ru.h b/src/translator_ru.h index d4df826..0921549 100644 --- a/src/translator_ru.h +++ b/src/translator_ru.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -57,14 +57,14 @@ class TranslatorRussian : public Translator */ inline QCString decode(const QCString & sInput) { - if (Config_getBool("USE_WINDOWS_ENCODING")) - { - return Koi8RToWindows1251(sInput); - } - else - { + //if (Config_getBool("USE_WINDOWS_ENCODING")) + //{ + // return Koi8RToWindows1251(sInput); + //} + //else + //{ return sInput; - } + //} } public: @@ -75,27 +75,27 @@ class TranslatorRussian : public Translator /* Used to get the command(s) for the language support. */ virtual QCString latexLanguageSupportCommand() { - if (Config_getBool("USE_WINDOWS_ENCODING")) - { - return "\\usepackage[cp1251]{inputenc}\n\\usepackage[russian]{babel}\n"; - } - else - { - return "\\usepackage[koi8-r]{inputenc}\n\\usepackage[russian]{babel}\n"; - } + //if (Config_getBool("USE_WINDOWS_ENCODING")) + //{ + // return "\\usepackage[cp1251]{inputenc}\n\\usepackage[russian]{babel}\n"; + //} + //else + //{ + return "\\usepackage[T2A]{fontenc}\n\\usepackage[russian]{babel}\n"; + //} } /*! return the language charset. This will be used for the HTML output */ virtual QCString idLanguageCharset() { - if (Config_getBool("USE_WINDOWS_ENCODING")) - { - return "Windows-1251"; - } - else - { + //if (Config_getBool("USE_WINDOWS_ENCODING")) + //{ + // return "Windows-1251"; + //} + //else + //{ return "koi8-r"; - } + //} } // --- Language translation methods ------------------- diff --git a/src/translator_se.h b/src/translator_se.h index 1e9355a..a474915 100644 --- a/src/translator_se.h +++ b/src/translator_se.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -92,7 +92,7 @@ class TranslatorSwedish : public TranslatorAdapter_1_4_6 */ virtual QCString latexLanguageSupportCommand() { - return ""; + return "\\usepackage[swedish]{babel}\n"; } /*! return the language charset. This will be used for the HTML output */ diff --git a/src/translator_si.h b/src/translator_si.h index 005ffc7..d5fb31e 100644 --- a/src/translator_si.h +++ b/src/translator_si.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -37,15 +37,15 @@ class TranslatorSlovene : public TranslatorAdapter_1_4_6 */ QCString latexLanguageSupportCommand() { - return "\\usepackage[slovene]{babel} \n\\usepackage[latin2]{inputenc} \n\\usepackage[T1]{fontenc}\n"; + return "\\usepackage[slovene]{babel}\n\\usepackage[T1]{fontenc}\n"; } QCString idLanguageCharset() { -#ifdef _WIN32 +//#ifdef _WIN32 return "windows-1250"; -#else - return "iso-8859-2"; -#endif +//#else +// return "iso-8859-2"; +//#endif } QCString trRelatedFunctions() { return "Povezane funkcije"; } diff --git a/src/translator_sk.h b/src/translator_sk.h index f8123e7..20bf1d1 100644 --- a/src/translator_sk.h +++ b/src/translator_sk.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -31,11 +31,11 @@ class TranslatorSlovak : public TranslatorAdapter_1_2_18 */ inline QCString Decode(const QCString & sInput) { -#ifdef _WIN32 +//#ifdef _WIN32 return sInput; -#else - return Win1250ToISO88592(sInput); -#endif +//#else +// return Win1250ToISO88592(sInput); +//#endif } public: @@ -45,16 +45,16 @@ class TranslatorSlovak : public TranslatorAdapter_1_2_18 { return "slovak"; } virtual QCString latexLanguageSupportCommand() - { return "\\usepackage{slovak}\n"; } + { return "\\usepackage[slovak]{babel}\n"; } /*! return the language charset. This will be used for the HTML output */ virtual QCString idLanguageCharset() { -#ifdef _WIN32 +//#ifdef _WIN32 return "windows-1250"; -#else - return "iso-8859-2"; -#endif +//#else +// return "iso-8859-2"; +//#endif } // --- Language translation methods ------------------- diff --git a/src/translator_sr.h b/src/translator_sr.h index 677f77f..6445d1e 100644 --- a/src/translator_sr.h +++ b/src/translator_sr.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -21,16 +21,18 @@ // translation by Dejan D. M. Milosavljevic <dmilos@email.com>;<dmilosx@ptt.yu>;<office@ddmrm.com> // // 10x 2 Ivana Miletic for gramatical consutation. +// UTF-8 patch by Nenad Bulatovic <buletina@gmail.com> + class TranslatorSerbian : public TranslatorAdapter_1_4_1 { private: QCString decode(const QCString& sInput) { -#ifdef _WIN32 - return ISO88592ToWin1250(sInput); -#else +//#ifdef _WIN32 +// return ISO88592ToWin1250(sInput); +//#else return sInput; -#endif +//#endif } @@ -63,17 +65,18 @@ private: */ virtual QCString latexLanguageSupportCommand() { - return ""; + QCString result="\\usepackage[serbian]{babel}\n"; + return result; } /*! return the language charset. This will be used for the HTML output */ virtual QCString idLanguageCharset() { -#ifdef _WIN32 - { return "windows-1250"; } -#else - { return "iso-8859-2"; } -#endif +//#ifdef _WIN32 +// { return "windows-1250"; } +//#else + { return "UTF-8"; } +//#endif } // --- Language translation methods ------------------- @@ -84,56 +87,56 @@ private: /*! subscript for the related functions. */ virtual QCString trRelatedSubscript() - { return decode( "(To nisu funkcije èlanice.)" ); } + { return decode( "(To nisu funkcije Älanice.)" ); } /*! header that is put before the detailed description of files, classes and namespaces. */ virtual QCString trDetailedDescription() - { return decode( "Op¹irnije obja¹njenje" ); } // detalj je francuska rec. + { return decode( "OpÅ¡irnije objaÅ¡njenje" ); } // detalj je francuska rec. /*! header that is put before the list of typedefs. */ virtual QCString trMemberTypedefDocumentation() - { return decode( "Dokumentacija typedef èlanova" ); } + { return decode( "Dokumentacija typedef Älanova" ); } /*! header that is put before the list of enumerations. */ virtual QCString trMemberEnumerationDocumentation() - { return decode( "Dokumentacija enum èlanova" ); } + { return decode( "Dokumentacija enum Älanova" ); } /*! header that is put before the list of member functions. */ virtual QCString trMemberFunctionDocumentation() - { return decode( "Dokumentacija funkcija èlanica" ); } + { return decode( "Dokumentacija funkcija Älanica" ); } /*! header that is put before the list of member attributes. */ virtual QCString trMemberDataDocumentation() { if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) { - return decode( "Dokumentacija èlanova" ); + return decode( "Dokumentacija Älanova" ); } else { - return decode( "Dokumentacija javnih èlanova" ); + return decode( "Dokumentacija javnih Älanova" ); } } /*! this is the text of a link put after brief descriptions. */ virtual QCString trMore() - { return decode( "Jo¹..." ); } + { return decode( "JoÅ¡..." ); } /*! put in the class documentation */ virtual QCString trListOfAllMembers() - { return decode( "Spisak svih èlanova." ); } + { return decode( "Spisak svih Älanova." ); } /*! used as the title of the "list of all members" page of a class */ virtual QCString trMemberList() - { return decode( "Spisak èlanova" ); } + { return decode( "Spisak Älanova" ); } /*! this is the first part of a sentence that is followed by a class name */ virtual QCString trThisIsTheListOfAllMembers() - { return decode( "Ovo je spisak svih èlanova " ); } + { return decode( "Ovo je spisak svih Älanova " ); } /*! this is the remainder of the sentence after the class name */ virtual QCString trIncludingInheritedMembers() - { return decode( ", ukljuèujuæi nasleðene èlanove." ); } + { return decode( ", ukljuÄujući nasleÄ‘ene Älanove." ); } /*! this is put at the author sections at the bottom of man pages. * parameter s is name of the project name. @@ -195,11 +198,11 @@ private: { if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) { - return decode( "Svi èlanovi struktura" ); + return decode( "Svi Älanovi struktura" ); } else { - return decode( "Svi èlanovi klasa" ); + return decode( "Svi Älanovi klasa" ); } } @@ -208,11 +211,11 @@ private: { if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) { - return decode( "Èlanovi datoteke" ); + return decode( "ÄŒlanovi datoteke" ); } else { - return decode( "Èlanovi datoteke" ); + return decode( "ÄŒlanovi datoteke" ); } } @@ -226,12 +229,12 @@ private: /*! This is put above each page as a link to the search engine. */ virtual QCString trSearch() - { return decode( "Tra¾i" ); } + { return decode( "Traži" ); } /*! This is an introduction to the class hierarchy. */ virtual QCString trClassHierarchyDescription() - { return decode( "Stablo nasleðivanja je slo¾eno " - "pribli¾no po abecedi:" ); } + { return decode( "Stablo nasleÄ‘ivanja je složeno " + "približno po abecedi:" ); } /*! This is an introduction to the list with all files. */ virtual QCString trFileListDescription(bool extractAll) @@ -252,7 +255,7 @@ private: } else { - return decode( "Spisak klasa, struktura, unija i interjfejsa sa kratkim opisom:" ); + return decode( "Spisak klasa, struktura, unija i interfejsa sa kratkim opisom:" ); } } @@ -267,22 +270,22 @@ private: } if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) { - result+="èlanova struktura ili unija"; + result+="Älanova struktura ili unija"; } else { - result+="èlanova klasa"; + result+="Älanova klasa"; } result+=" sa linkovima na "; if (extractAll) { if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) { - result+="dokumentaciju èlanova struktura/unija:"; + result+="dokumentaciju Älanova struktura/unija:"; } else { - result+="dokumentaciju svakog èlana klase:"; + result+="dokumentaciju svakog Älana klase:"; } } else @@ -311,7 +314,7 @@ private: } else { - result+="èlanova"; + result+="Älanova"; } result+=" sa linkovima na "; @@ -326,7 +329,7 @@ private: /*! This is an introduction to the page with the list of all header files. */ virtual QCString trHeaderFilesDescription() - { return decode( "Zaglavlja koje izgraðuju API:" ); } + { return decode( "Zaglavlja koje izgraÄ‘uju API:" ); } /*! This is an introduction to the page with the list of all examples */ virtual QCString trExamplesDescription() @@ -334,7 +337,7 @@ private: /*! This is an introduction to the page with the list of related pages */ virtual QCString trRelatedPagesDescription() - { return decode( "Spisak svih sliènih stranica:" ); } + { return decode( "Spisak svih sliÄnih stranica:" ); } /*! This is an introduction to the page with the list of class/file groups */ virtual QCString trModulesDescription() @@ -363,7 +366,7 @@ private: * class hierarchy. */ virtual QCString trHierarchicalIndex() - { return decode( "Hijerarhijski sad¾raj" ); } + { return decode( "Hijerarhijski sadžraj" ); } /*! This is used in LaTeX as the title of the chapter with the * annotated compound index. @@ -372,11 +375,11 @@ private: { if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) { - return decode( "Glavni sadr¾aj" ); + return decode( "Glavni sadržaj" ); } else { - return decode( "Glavni sadr¾aj" ); + return decode( "Glavni sadržaj" ); } } @@ -427,7 +430,7 @@ private: /*! This is used in LaTeX as the title of the document */ virtual QCString trReferenceManual() - { return decode( "Priruènik" ); } + { return decode( "PriruÄnik" ); } /*! This is used in the documentation of a file as a header before the * list of defines @@ -548,16 +551,16 @@ private: /*! this text is put before a class diagram */ virtual QCString trClassDiagram(const char *clName) { - return decode( QCString("Dijagram nasleðivanja za klasu ") + clName + ":" ); + return decode( QCString("Dijagram nasleÄ‘ivanja za klasu ") + clName + ":" ); } /*! this text is generated when the \\internal command is used. */ virtual QCString trForInternalUseOnly() - { return decode( "Samo za unutra¹nju upotrebu." ); } + { return decode( "Samo za unutraÅ¡nju upotrebu." ); } /*! this text is generated when the \\reimp command is used. */ virtual QCString trReimplementedForInternalReasons() - { return decode("Preuraðeno zbog unutra¹njih razloga; Nema uticaja na API." ); } + { return decode("PreuraÄ‘eno zbog unutraÅ¡njih razloga; Nema uticaja na API." ); } /*! this text is generated when the \\warning command is used. */ virtual QCString trWarning() @@ -565,7 +568,7 @@ private: /*! this text is generated when the \\bug command is used. */ virtual QCString trBugsAndLimitations() - { return decode( "Gre¹ke i ogranièenja" ); } + { return decode( "GreÅ¡ke i ograniÄenja" ); } /*! this text is generated when the \\version command is used. */ virtual QCString trVersion() @@ -577,11 +580,11 @@ private: /*! this text is generated when the \\return command is used. */ virtual QCString trReturns() - { return decode( "Vraæene vrednosti" ); } + { return decode( "Vraćene vrednosti" ); } /*! this text is generated when the \\sa command is used. */ virtual QCString trSeeAlso() - { return decode( "Takoðe pogledati" ); } + { return decode( "TakoÄ‘e pogledati" ); } /*! this text is generated when the \\param command is used. */ virtual QCString trParameters() @@ -649,7 +652,7 @@ private: case ClassDef::Category: result+="kategorije "; break; // case ClassDef::Exception: result+="izuzetka "; break; } - if (isTemplate) result += "¹ablona "; + if (isTemplate) result += "Å¡ablona "; result += clName; return decode( result ); @@ -672,25 +675,25 @@ private: } virtual QCString trPublicMembers() - { return decode("Javni èlanovi"); } + { return decode("Javni Älanovi"); } virtual QCString trPublicSlots() { return "Javni slotovi"; } virtual QCString trSignals() { return "Signali"; } virtual QCString trStaticPublicMembers() - { return decode("Zajednièki javni èlanovi"); } + { return decode("ZajedniÄki javni Älanovi"); } virtual QCString trProtectedMembers() - { return decode("Za¹tiæeni èlanovi"); } + { return decode("ZaÅ¡tićeni Älanovi"); } virtual QCString trProtectedSlots() - { return decode("Za¹tiæeni slotovi"); } + { return decode("ZaÅ¡tićeni slotovi"); } virtual QCString trStaticProtectedMembers() - { return decode("Zajednièki za¹tiæeni èlanovi"); } + { return decode("ZajedniÄki zaÅ¡tićeni Älanovi"); } virtual QCString trPrivateMembers() - { return decode("Privani èlanovi"); } + { return decode("Privatni Älanovi"); } virtual QCString trPrivateSlots() { return decode("Privatni slotovi"); } virtual QCString trStaticPrivateMembers() - { return decode("Zajednièki privatni èlanovi"); } + { return decode("ZajedniÄki privatni Älanovi"); } /*! this function is used to produce a comma-separated list of items. * use generateMarker(i) to indicate where item i should be put. @@ -722,7 +725,7 @@ private: */ virtual QCString trInheritsList(int numEntries) { - return decode("Nasleðeno od "+trWriteList(numEntries)+"."); + return decode("NasleÄ‘eno od "+trWriteList(numEntries)+"."); } /*! used in class documentation to produce a list of super classes, @@ -730,7 +733,7 @@ private: */ virtual QCString trInheritedByList(int numEntries) { - return decode( "Nasleðeno u "+trWriteList(numEntries)+"." ); + return decode( "NasleÄ‘eno u "+trWriteList(numEntries)+"." ); } /*! used in member documentation blocks to produce a list of @@ -738,7 +741,7 @@ private: */ virtual QCString trReimplementedFromList(int numEntries) { - return decode("Preuraðeno od "+trWriteList(numEntries)+"." ); + return decode("PreuraÄ‘eno od "+trWriteList(numEntries)+"." ); } /*! used in member documentation blocks to produce a list of @@ -746,21 +749,21 @@ private: */ virtual QCString trReimplementedInList(int numEntries) { - return decode("Preuraðeno u "+trWriteList(numEntries)+"." ); + return decode("PreuraÄ‘eno u "+trWriteList(numEntries)+"." ); } /*! This is put above each page as a link to all members of namespaces. */ virtual QCString trNamespaceMembers() - { return decode("Èlanovi prostora imena"); } + { return decode("ÄŒlanovi prostora imena"); } /*! This is an introduction to the page with all namespace members */ virtual QCString trNamespaceMemberDescription(bool extractAll) { QCString result="Spisak svih "; if (!extractAll) result+="dokumentovanih "; - result+="èlanova prostora imena sa linkovima na "; + result+="Älanova prostora imena sa linkovima na "; if (extractAll) - result+="dokumentaciju svakog èlana prostora imena: "; + result+="dokumentaciju svakog Älana prostora imena: "; else result+="prostor imena kojima pripadaju: "; return decode( result ); @@ -826,7 +829,7 @@ private: /*! This is used as the heading text for the retval command. */ virtual QCString trReturnValues() - { return decode( "Vraæena vrednost" ); } + { return decode( "Vraćena vrednost" ); } /*! This is in the (quick) index as a link to the main page (index.html) */ @@ -872,7 +875,7 @@ private: /*! this text is put before a collaboration diagram */ virtual QCString trCollaborationDiagram(const char *clName) { - return decode( (QCString)"Dijagram nasleðenih èlanova za "+clName+":" ); + return decode( (QCString)"Dijagram nasleÄ‘enih Älanova za "+clName+":" ); } /*! this text is put before an include dependency graph */ virtual QCString trInclDepGraph(const char *fName) @@ -912,7 +915,7 @@ private: /*! Text shown before a multi-line variable/enum initialization */ virtual QCString trInitialValue() { - return decode( "Poèetna vriednost:" ); + return decode( "PoÄetna vrednost:" ); } /*! Text used the source code in the file index */ virtual QCString trCode() @@ -921,15 +924,15 @@ private: } virtual QCString trGraphicalHierarchy() { - return decode("Grafièki prikaz stabla klasa"); + return decode("GrafiÄki prikaz stabla klasa"); } virtual QCString trGotoGraphicalHierarchy() { - return decode("Prika¾i stablo klasa u grafièkom obliku"); + return decode("Prikaži stablo klasa u grafiÄkom obliku"); } virtual QCString trGotoTextualHierarchy() { - return decode( "Prika¾i stablo klasa u tekstualnom obliku" ); + return decode( "Prikaži stablo klasa u tekstualnom obliku" ); } virtual QCString trPageIndex() { @@ -952,28 +955,28 @@ private: { if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) { - return decode( "Èlanovi" ); + return decode( "ÄŒlanovi" ); } else { - return decode( "Javni èlanovi" ); + return decode( "Javni Älanovi" ); } } virtual QCString trStaticPublicAttribs() { - return decode( "Zajednièki javni èlanovi"); + return decode( "ZajedniÄki javni Älanovi"); } virtual QCString trProtectedTypes() { - return decode( "Za¹tiæeni tipovi" ); + return decode( "ZaÅ¡tićeni tipovi" ); } virtual QCString trProtectedAttribs() { - return decode( "Za¹tiæeni èlanovi" ); + return decode( "ZaÅ¡tićeni Älanovi" ); } virtual QCString trStaticProtectedAttribs() { - return decode( "Zajednièki za¹tiæeni èlanovi" ); + return decode( "ZajedniÄki zaÅ¡tićeni Älanovi" ); } virtual QCString trPrivateTypes() { @@ -981,11 +984,11 @@ private: } virtual QCString trPrivateAttribs() { - return decode( "Privatni èlanovi" ); + return decode( "Privatni Älanovi" ); } virtual QCString trStaticPrivateAttribs() { - return decode( "Zajednièki privatni èlanovi" ); + return decode( "ZajedniÄki privatni Älanovi" ); } ////////////////////////////////////////////////////////////////////////// @@ -995,12 +998,12 @@ private: /*! Used as a marker that is put before a \\todo item */ virtual QCString trTodo() { - return decode( "Neuraðeno" ); + return decode( "NeuraÄ‘eno" ); } /*! Used as the header of the todo list */ virtual QCString trTodoList() { - return decode("Spisak neuraðenog"); + return decode("Spisak neuraÄ‘enog"); } ////////////////////////////////////////////////////////////////////////// @@ -1009,20 +1012,20 @@ private: virtual QCString trReferencedBy() { - return decode( "Kori¹æeno od" ); + return decode( "Korišćeno od" ); } virtual QCString trRemarks() { - return decode( "Zapa¾anja" ); + return decode( "Zapažanja" ); } virtual QCString trAttention() { - return decode( "Pa¾nja" ); + return decode( "Pažnja" ); } virtual QCString trInclByDepGraph() { return decode("Ovaj graf pokazuje koja datoteka direktno " - "ili indirektno ukljuèuju ovu datoteku: "); + "ili indirektno ukljuÄuju ovu datoteku: "); } virtual QCString trSince() { @@ -1036,7 +1039,7 @@ private: /*! title of the graph legend page */ virtual QCString trLegendTitle() { - return decode( "Obja¹njenje kori¹æenih simbola" ); + return decode( "ObjaÅ¡njenje korišćenih simbola" ); } /*! page explaining how the dot graph's should be interpreted * The %A in the text below are to prevent link to classes called "A". @@ -1044,7 +1047,7 @@ private: virtual QCString trLegendDocs() { return decode( - "Ova stranica obja¹njava kako tumaèiti grafikone koje je napravio " + "Ova stranica objaÅ¡njava kako tumaÄiti grafikone koje je napravio " "doxygen.<p>\n" "Na primer:\n" "\\code\n" @@ -1076,29 +1079,29 @@ private: "};\n" "\\endcode\n" "Ako je \\c MAX_DOT_GRAPH_HEIGHT tag u konfiguracionoj datoteci " - "postavljen na 200 gornje veze æe izgledati:" + "postavljen na 200 gornje veze će izgledati:" "<p><center><img src=\"graph_legend."+Config_getEnum("DOT_IMAGE_FORMAT")+"\"></center>\n" "<p>\n" - "Pravougaonici imaju sledeæa znaèenja:\n" + "Pravougaonici imaju sledeća znaÄenja:\n" "<ul>\n" "<li>Puni crni predstavlja strukturu ili klasu za koju je graf napravljen.\n" "<li>Sa crnom ivicom predstavlja dokumentovanu strukturu ili klasu.\n" "<li>Sa sivom ivicom predstavlja nedokumentovanu strukturu ili klasu.\n" "<li>Sa crvenom ivicom predstavlja dokumentovanu strukturu ili klasu\n" - "za koju nije prikazan graf nasleðivanja/kori¹æenja. Graf je odseèen " - "ako ne stane unutar odreðenih granica." + "za koju nije prikazan graf nasleÄ‘ivanja/korišćenja. Graf je odseÄen " + "ako ne stane unutar odreÄ‘enih granica." "</ul>" - "Strelice imaju sledeæa znaèenja:\n" + "Strelice imaju sledeća znaÄenja:\n" "<ul>\n" - "<li>Tamnoplava strelica oznaèava javno nasleðivanje.\n" - "<li>Tamnozelena strelica oznaèava za¹tiæeno nasleðivanje.\n" - "<li>Tamnocrvena strelica oznaèava privatno nasleðivanje.\n" - "<li>Ljubièasta isprekidana strelica ako je klasa koristi ili je njen èlan. " - "Strelica je oznaèena imenom èlana.\n" - "<li>Zuta strelica oznaèava vezu izmeðu primerka ¹ablona" - " i ¹ablon klase od koje je napravljena. " - "Strelica je oznaèena imenom prarametra ¹ablona.\n" + "<li>Tamnoplava strelica oznaÄava javno nasleÄ‘ivanje.\n" + "<li>Tamnozelena strelica oznaÄava zaÅ¡tićeno nasleÄ‘ivanje.\n" + "<li>Tamnocrvena strelica oznaÄava privatno nasleÄ‘ivanje.\n" + "<li>LjubiÄasta isprekidana strelica ako je klasa koristi ili je njen Älan. " + "Strelica je oznaÄena imenom Älana.\n" + "<li>Zuta strelica oznaÄava vezu izmeÄ‘u primerka Å¡ablona" + " i Å¡ablon klase od koje je napravljena. " + "Strelica je oznaÄena imenom parametra Å¡ablona.\n" "</ul>\n" ); @@ -1106,7 +1109,7 @@ private: /*! text for the link to the legend page */ virtual QCString trLegend() { - return decode( "Obja¹njenje kori¹æenih simbola" ); + return decode( "ObjaÅ¡njenje korišćenih simbola" ); } ////////////////////////////////////////////////////////////////////////// @@ -1163,7 +1166,7 @@ private: { if (Config_getBool("OPTIMIZE_OUTPUT_FOR_C")) { - return "Strikture"; + return "Strukture"; } else { @@ -1208,12 +1211,12 @@ private: /*! Used as a marker that is put before a \\bug item */ virtual QCString trBug() { - return decode( "Gre¹ka" ); + return decode( "GreÅ¡ka" ); } /*! Used as the header of the bug list */ virtual QCString trBugList() { - return decode( "Spisak gre¹aka" ); + return decode( "Spisak greÅ¡aka" ); } ////////////////////////////////////////////////////////////////////////// @@ -1262,7 +1265,7 @@ private: /*! Used as header RTF general index */ virtual QCString trRTFGeneralIndex() { - return decode( "Sadr¾aj" ); + return decode( "Sadržaj" ); } /*! This is used for translation of the word that will possibly @@ -1327,7 +1330,7 @@ private: */ virtual QCString trMember(bool first_capital, bool singular) { - QCString result((first_capital ? "Èlan" : "èlan")); + QCString result((first_capital ? "ÄŒlan" : "Älan")); result+= (singular ? "" : "ovi"); return decode( result ); } @@ -1387,7 +1390,7 @@ private: */ virtual QCString trImplementedFromList(int numEntries) { - return decode( "Defini¹e "+trWriteList(numEntries)+"." ); + return decode( "DefiniÅ¡e "+trWriteList(numEntries)+"." ); } /*! used in member documentation blocks to produce a list of @@ -1407,7 +1410,7 @@ private: */ virtual QCString trRTFTableOfContents() { - return decode( "Sadr¾aj" ); + return decode( "Sadržaj" ); } ////////////////////////////////////////////////////////////////////////// @@ -1419,7 +1422,7 @@ private: */ virtual QCString trDeprecatedList() { - return decode( "Spisak zastarelih funkcija èlanica" ); + return decode( "Spisak zastarelih funkcija Älanica" ); } ////////////////////////////////////////////////////////////////////////// // new since 1.2.18 @@ -1430,12 +1433,12 @@ private: */ virtual QCString trEvents() { - return decode( "Dogaðaji" ); + return decode( "DogaÄ‘aji" ); } /*! Header used for the documentation section of a class' events. */ virtual QCString trEventDocumentation() { - return decode( "Dokumentacija dogaðaja" ); + return decode( "Dokumentacija dogaÄ‘aja" ); } ////////////////////////////////////////////////////////////////////////// // new since 1.3 @@ -1459,7 +1462,7 @@ private: */ virtual QCString trStaticPackageMembers() { - return decode( "Statièke funkcije u paketu" ); // Zajednicke funkcije u paketu + return decode( "StatiÄke funkcije u paketu" ); // Zajednicke funkcije u paketu } /*! Used as a heading for a list of Java class variables with package * scope. @@ -1473,7 +1476,7 @@ private: */ virtual QCString trStaticPackageAttribs() { - return decode( "Statièki atributi u paketu" ); // Zajednicki clanovi u paketu + return decode( "StatiÄki atributi u paketu" ); // Zajednicki clanovi u paketu } ////////////////////////////////////////////////////////////////////////// @@ -1503,14 +1506,14 @@ private: */ virtual QCString trSearchForIndex() { - return decode("Tra¾i"); + return decode("Traži"); } /*! This string is used as the title for the page listing the search * results. */ virtual QCString trSearchResultsTitle() { - return decode( "Rezultati pretra¾ivanja" ); + return decode( "Rezultati pretraživanja" ); } /*! This string is put just before listing the search results. The * text can be different depending on the number of documents found. @@ -1524,20 +1527,20 @@ private: { if (numDocuments==0) { - return decode("Nema dokumenta koji odgovaraju va¹em upitu"); + return decode("Nema dokumenta koji odgovaraju vaÅ¡em upitu"); } else if (numDocuments==1) { // 10x 2 Ivana Miletic 4 gramatical consutation. - return decode("Naðen je <b>1</b> dokument koji odgovara va¹em upitu."); + return decode("NaÄ‘en je <b>1</b> dokument koji odgovara vaÅ¡em upitu."); } else if (numDocuments<5) { // 10x 2 Ivana Miletic 4 gramatical consutation. - return decode("Naðena su <b>$num</b> dokumenta koji odgovaraju va¹em upitu." + return decode("NaÄ‘ena su <b>$num</b> dokumenta koji odgovaraju vaÅ¡em upitu." "Najbolji su prikazani prvi."); } else { // 10x 2 Ivana Miletic 4 gramatical consutation. - return decode("Naðeno je <b>$num</b> dokumenata koji odgovaraju va¹em upitu." + return decode("NaÄ‘eno je <b>$num</b> dokumenata koji odgovaraju vaÅ¡em upitu." "Najbolji su prikazani prvi."); } } @@ -1546,7 +1549,7 @@ private: */ virtual QCString trSearchMatches() { - return decode( "Pronaðeno:" ); + return decode( "PronaÄ‘eno:" ); } ////////////////////////////////////////////////////////////////////////// @@ -1586,7 +1589,7 @@ private: * and the fact that it is sorted alphabetically per level */ virtual QCString trDirDescription() - { return decode( "Stablo direktorijuma slozeno priblizno abecednim redom" ); + { return decode( "Stablo direktorijuma slozeno približno po abecednom redu" ); } /*! This returns the title of a directory page. The name of the diff --git a/src/translator_tw.h b/src/translator_tw.h index 4757533..1fcedba 100644 --- a/src/translator_tw.h +++ b/src/translator_tw.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/translator_ua.h b/src/translator_ua.h index baa3e4d..c9460de 100644 --- a/src/translator_ua.h +++ b/src/translator_ua.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -28,11 +28,11 @@ class TranslatorUkrainian : public TranslatorAdapter_1_4_1 */ inline QCString decode(const QCString & sInput) { -#ifdef _WIN32 - return Koi8RToWindows1251(sInput); -#else +//#ifdef _WIN32 +// return Koi8RToWindows1251(sInput); +//#else return sInput; -#endif +//#endif } public: @@ -43,21 +43,21 @@ class TranslatorUkrainian : public TranslatorAdapter_1_4_1 /* Used to get the command(s) for the language support. */ virtual QCString latexLanguageSupportCommand() { -#ifdef _WIN32 - return "\\usepackage[cp1251]{inputenc}\n\\usepackage[ukrainian]{babel}\n"; -#else - return "\\usepackage[koi8-u]{inputenc}\n\\usepackage[ukrainian]{babel}\n"; -#endif +//#ifdef _WIN32 +// return "\\usepackage[cp1251]{inputenc}\n\\usepackage[ukrainian]{babel}\n"; +//#else + return "\\usepackage[T2A]{fontenc}\n\\usepackage[ukrainian]{babel}\n"; +//#endif } /*! return the language charset. This will be used for the HTML output */ virtual QCString idLanguageCharset() { -#ifdef _WIN32 - return "Windows-1251"; -#else +//#ifdef _WIN32 +// return "Windows-1251"; +//#else return "koi8-u"; -#endif +//#endif } // --- Language translation methods ------------------- diff --git a/src/translator_za.h b/src/translator_za.h index 169b3c7..75e0a09 100644 --- a/src/translator_za.h +++ b/src/translator_za.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/translatordecoder.h b/src/translatordecoder.h new file mode 100644 index 0000000..71610eb --- /dev/null +++ b/src/translatordecoder.h @@ -0,0 +1,658 @@ +/****************************************************************************** + * + * + * + * Copyright (C) 1997-2007 by Dimitri van Heesch. + * + * Permission to use, copy, modify, and distribute this software and its + * documentation under the terms of the GNU General Public License is hereby + * granted. No representations are made about the suitability of this software + * for any purpose. It is provided "as is" without express or implied warranty. + * See the GNU General Public License for more details. + * + * Documents produced by Doxygen are derivative works derived from the + * input used in their production; they are not affected by this license. + * + */ + +#ifndef TRANSLATORDECODER_H +#define TRANSLATORDECODER_H + +#include "translator.h" +#include "portable.h" + +class TranslatorDecoder : public Translator +{ + public: + + TranslatorDecoder(Translator *translator) : m_translator(translator) + { + m_toUtf8 = portable_iconv_open("UTF-8",translator->idLanguageCharset()); + m_fromUtf8 = portable_iconv_open(translator->idLanguageCharset(),"UTF-8"); + } + virtual ~TranslatorDecoder() + { + if (m_toUtf8!=(void *)(-1)) portable_iconv_close(m_toUtf8); + if (m_fromUtf8!=(void *)(-1)) portable_iconv_close(m_fromUtf8); + delete m_translator; + } + + /*! This method is used to provide warning message that is displayed + * if the user chooses a language whose translation is not up to date. + * It is implemented by the adapter classes. + */ + virtual QCString updateNeededMessage() { return m_translator->updateNeededMessage(); } + + // Please, have a look at comments inside the translator_en.h file + // to learn the meaning of the following methods. The translator_en.h + // file contains the TranslatorEnglish implementation, which is + // always up-to-date (by definition). + + // --- Language control methods ------------------- + + QCString idLanguage() + { return m_translator->idLanguage(); } + QCString latexLanguageSupportCommand() + { return m_translator->latexLanguageSupportCommand(); } + QCString idLanguageCharset() + { return m_translator->idLanguageCharset(); } + + QCString recode(const QCString &s,void *cd) + { + if (cd==(void*)(-1)) return s; + int iSize = s.length(); + int oSize = iSize*4+1; + QCString output(oSize); + size_t iLeft = iSize; + size_t oLeft = oSize; + const char *iPtr = s.data(); + char *oPtr = output.data(); + if (!portable_iconv(cd,&iPtr,&iLeft,&oPtr,&oLeft)) + { + oSize -= oLeft; + output.resize(oSize+1); + output.at(oSize+1)='\0'; + return output; + } + else + { + return s; + } + } + QCString toUtf8(const QCString &s) + { + return recode(s,m_toUtf8); + } + QCString fromUtf8(const QCString &s) + { + return recode(s,m_fromUtf8); + } + + // --- Language translation methods ------------------- + + QCString trRelatedFunctions() + { return toUtf8(m_translator->trRelatedFunctions()); } + QCString trRelatedSubscript() + { return toUtf8(m_translator->trRelatedSubscript()); } + QCString trDetailedDescription() + { return toUtf8(m_translator->trDetailedDescription()); } + QCString trMemberTypedefDocumentation() + { return toUtf8(m_translator->trMemberTypedefDocumentation()); } + QCString trMemberEnumerationDocumentation() + { return toUtf8(m_translator->trMemberEnumerationDocumentation()); } + QCString trMemberFunctionDocumentation() + { return toUtf8(m_translator->trMemberFunctionDocumentation()); } + QCString trMemberDataDocumentation() + { return toUtf8(m_translator->trMemberDataDocumentation()); } + QCString trMore() + { return toUtf8(m_translator->trMore()); } + QCString trListOfAllMembers() + { return toUtf8(m_translator->trListOfAllMembers()); } + QCString trMemberList() + { return toUtf8(m_translator->trMemberList()); } + QCString trThisIsTheListOfAllMembers() + { return toUtf8(m_translator->trThisIsTheListOfAllMembers()); } + QCString trIncludingInheritedMembers() + { return toUtf8(m_translator->trIncludingInheritedMembers()); } + QCString trGeneratedAutomatically(const char *s) + { return toUtf8(m_translator->trGeneratedAutomatically(fromUtf8(s))); } + QCString trEnumName() + { return toUtf8(m_translator->trEnumName()); } + QCString trEnumValue() + { return toUtf8(m_translator->trEnumValue()); } + QCString trDefinedIn() + { return toUtf8(m_translator->trDefinedIn()); } + + // quick reference sections + + QCString trModules() + { return toUtf8(m_translator->trModules()); } + QCString trClassHierarchy() + { return toUtf8(m_translator->trClassHierarchy()); } + QCString trCompoundList() + { return toUtf8(m_translator->trCompoundList()); } + QCString trFileList() + { return toUtf8(m_translator->trFileList()); } + QCString trCompoundMembers() + { return toUtf8(m_translator->trCompoundMembers()); } + QCString trFileMembers() + { return toUtf8(m_translator->trFileMembers()); } + QCString trRelatedPages() + { return toUtf8(m_translator->trRelatedPages()); } + QCString trExamples() + { return toUtf8(m_translator->trExamples()); } + QCString trSearch() + { return toUtf8(m_translator->trSearch()); } + QCString trClassHierarchyDescription() + { return toUtf8(m_translator->trClassHierarchyDescription()); } + QCString trFileListDescription(bool extractAll) + { return toUtf8(m_translator->trFileListDescription(extractAll)); } + QCString trCompoundListDescription() + { return toUtf8(m_translator->trCompoundListDescription()); } + QCString trCompoundMembersDescription(bool extractAll) + { return toUtf8(m_translator->trCompoundMembersDescription(extractAll)); } + QCString trFileMembersDescription(bool extractAll) + { return toUtf8(m_translator->trFileMembersDescription(extractAll)); } + QCString trExamplesDescription() + { return toUtf8(m_translator->trExamplesDescription()); } + QCString trRelatedPagesDescription() + { return toUtf8(m_translator->trRelatedPagesDescription()); } + QCString trModulesDescription() + { return toUtf8(m_translator->trModulesDescription()); } + + // index titles (the project name is prepended for these) + + QCString trDocumentation() + { return toUtf8(m_translator->trDocumentation()); } + QCString trModuleIndex() + { return toUtf8(m_translator->trModuleIndex()); } + QCString trHierarchicalIndex() + { return toUtf8(m_translator->trHierarchicalIndex()); } + QCString trCompoundIndex() + { return toUtf8(m_translator->trCompoundIndex()); } + QCString trFileIndex() + { return toUtf8(m_translator->trFileIndex()); } + QCString trModuleDocumentation() + { return toUtf8(m_translator->trModuleDocumentation()); } + QCString trClassDocumentation() + { return toUtf8(m_translator->trClassDocumentation()); } + QCString trFileDocumentation() + { return toUtf8(m_translator->trFileDocumentation()); } + QCString trExampleDocumentation() + { return toUtf8(m_translator->trExampleDocumentation()); } + QCString trPageDocumentation() + { return toUtf8(m_translator->trPageDocumentation()); } + QCString trReferenceManual() + { return toUtf8(m_translator->trReferenceManual()); } + QCString trDefines() + { return toUtf8(m_translator->trDefines()); } + QCString trFuncProtos() + { return toUtf8(m_translator->trFuncProtos()); } + QCString trTypedefs() + { return toUtf8(m_translator->trTypedefs()); } + QCString trEnumerations() + { return toUtf8(m_translator->trEnumerations()); } + QCString trFunctions() + { return toUtf8(m_translator->trFunctions()); } + QCString trVariables() + { return toUtf8(m_translator->trVariables()); } + QCString trEnumerationValues() + { return toUtf8(m_translator->trEnumerationValues()); } + QCString trDefineDocumentation() + { return toUtf8(m_translator->trDefineDocumentation()); } + QCString trFunctionPrototypeDocumentation() + { return toUtf8(m_translator->trFunctionPrototypeDocumentation()); } + QCString trTypedefDocumentation() + { return toUtf8(m_translator->trTypedefDocumentation()); } + QCString trEnumerationTypeDocumentation() + { return toUtf8(m_translator->trEnumerationTypeDocumentation()); } + QCString trFunctionDocumentation() + { return toUtf8(m_translator->trFunctionDocumentation()); } + QCString trVariableDocumentation() + { return toUtf8(m_translator->trVariableDocumentation()); } + QCString trCompounds() + { return toUtf8(m_translator->trCompounds()); } + QCString trGeneratedAt(const char *date,const char *projName) + { return toUtf8(m_translator->trGeneratedAt(date,fromUtf8(projName))); } + QCString trWrittenBy() + { return toUtf8(m_translator->trWrittenBy()); } + QCString trClassDiagram(const char *clName) + { return toUtf8(m_translator->trClassDiagram(clName)); } + QCString trForInternalUseOnly() + { return toUtf8(m_translator->trForInternalUseOnly()); } + QCString trWarning() + { return toUtf8(m_translator->trWarning()); } + QCString trVersion() + { return toUtf8(m_translator->trVersion()); } + QCString trDate() + { return toUtf8(m_translator->trDate()); } + QCString trReturns() + { return toUtf8(m_translator->trReturns()); } + QCString trSeeAlso() + { return toUtf8(m_translator->trSeeAlso()); } + QCString trParameters() + { return toUtf8(m_translator->trParameters()); } + QCString trExceptions() + { return toUtf8(m_translator->trExceptions()); } + QCString trGeneratedBy() + { return toUtf8(m_translator->trGeneratedBy()); } + +////////////////////////////////////////////////////////////////////////// +// new since 0.49-990307 +////////////////////////////////////////////////////////////////////////// + + QCString trNamespaceList() + { return toUtf8(m_translator->trNamespaceList()); } + QCString trNamespaceListDescription(bool extractAll) + { return toUtf8(m_translator->trNamespaceListDescription(extractAll)); } + QCString trFriends() + { return toUtf8(m_translator->trFriends()); } + +////////////////////////////////////////////////////////////////////////// +// new since 0.49-990405 +////////////////////////////////////////////////////////////////////////// + + QCString trRelatedFunctionDocumentation() + { return toUtf8(m_translator->trRelatedFunctionDocumentation()); } + +////////////////////////////////////////////////////////////////////////// +// new since 0.49-990425 +////////////////////////////////////////////////////////////////////////// + + QCString trCompoundReference(const char *clName, + ClassDef::CompoundType compType, + bool isTemplate) + { return toUtf8(m_translator->trCompoundReference(clName,compType,isTemplate)); } + + QCString trFileReference(const char *fileName) + { return toUtf8(m_translator->trFileReference(fromUtf8(fileName))); } + QCString trNamespaceReference(const char *namespaceName) + { return toUtf8(m_translator->trNamespaceReference(namespaceName)); } + + QCString trPublicMembers() + { return toUtf8(m_translator->trPublicMembers()); } + QCString trPublicSlots() + { return toUtf8(m_translator->trPublicSlots()); } + QCString trSignals() + { return toUtf8(m_translator->trSignals()); } + QCString trStaticPublicMembers() + { return toUtf8(m_translator->trStaticPublicMembers()); } + QCString trProtectedMembers() + { return toUtf8(m_translator->trProtectedMembers()); } + QCString trProtectedSlots() + { return toUtf8(m_translator->trProtectedSlots()); } + QCString trStaticProtectedMembers() + { return toUtf8(m_translator->trStaticProtectedMembers()); } + QCString trPrivateMembers() + { return toUtf8(m_translator->trPrivateMembers()); } + QCString trPrivateSlots() + { return toUtf8(m_translator->trPrivateSlots()); } + QCString trStaticPrivateMembers() + { return toUtf8(m_translator->trStaticPrivateMembers()); } + QCString trWriteList(int numEntries) + { return toUtf8(m_translator->trWriteList(numEntries)); } + QCString trInheritsList(int numEntries) + { return toUtf8(m_translator->trInheritsList(numEntries)); } + QCString trInheritedByList(int numEntries) + { return toUtf8(m_translator->trInheritedByList(numEntries)); } + QCString trReimplementedFromList(int numEntries) + { return toUtf8(m_translator->trReimplementedFromList(numEntries)); } + QCString trReimplementedInList(int numEntries) + { return toUtf8(m_translator->trReimplementedInList(numEntries)); } + QCString trNamespaceMembers() + { return toUtf8(m_translator->trNamespaceMembers()); } + QCString trNamespaceMemberDescription(bool extractAll) + { return toUtf8(m_translator->trNamespaceMemberDescription(extractAll)); } + QCString trNamespaceIndex() + { return toUtf8(m_translator->trNamespaceIndex()); } + QCString trNamespaceDocumentation() + { return toUtf8(m_translator->trNamespaceDocumentation()); } + +////////////////////////////////////////////////////////////////////////// +// new since 0.49-990522 +////////////////////////////////////////////////////////////////////////// + + QCString trNamespaces() + { return toUtf8(m_translator->trNamespaces()); } + +////////////////////////////////////////////////////////////////////////// +// new since 0.49-990728 +////////////////////////////////////////////////////////////////////////// + + QCString trGeneratedFromFiles(ClassDef::CompoundType compType, + bool single) + { return toUtf8(m_translator->trGeneratedFromFiles(compType,single)); } + QCString trAlphabeticalList() + { return toUtf8(m_translator->trAlphabeticalList()); } + +////////////////////////////////////////////////////////////////////////// +// new since 0.49-990901 +////////////////////////////////////////////////////////////////////////// + + QCString trReturnValues() + { return toUtf8(m_translator->trReturnValues()); } + QCString trMainPage() + { return toUtf8(m_translator->trMainPage()); } + QCString trPageAbbreviation() + { return toUtf8(m_translator->trPageAbbreviation()); } + +////////////////////////////////////////////////////////////////////////// +// new since 0.49-991003 +////////////////////////////////////////////////////////////////////////// + + QCString trDefinedAtLineInSourceFile() + { return toUtf8(m_translator->trDefinedAtLineInSourceFile()); } + QCString trDefinedInSourceFile() + { return toUtf8(m_translator->trDefinedInSourceFile()); } + +////////////////////////////////////////////////////////////////////////// +// new since 0.49-991205 +////////////////////////////////////////////////////////////////////////// + + QCString trDeprecated() + { return toUtf8(m_translator->trDeprecated()); } + +////////////////////////////////////////////////////////////////////////// +// new since 1.0.0 +////////////////////////////////////////////////////////////////////////// + + QCString trCollaborationDiagram(const char *clName) + { return toUtf8(m_translator->trCollaborationDiagram(clName)); } + QCString trInclDepGraph(const char *fName) + { return toUtf8(m_translator->trInclDepGraph(fromUtf8(fName))); } + QCString trConstructorDocumentation() + { return toUtf8(m_translator->trConstructorDocumentation()); } + QCString trGotoSourceCode() + { return toUtf8(m_translator->trGotoSourceCode()); } + QCString trGotoDocumentation() + { return toUtf8(m_translator->trGotoDocumentation()); } + QCString trPrecondition() + { return toUtf8(m_translator->trPrecondition()); } + QCString trPostcondition() + { return toUtf8(m_translator->trPostcondition()); } + QCString trInvariant() + { return toUtf8(m_translator->trInvariant()); } + QCString trInitialValue() + { return toUtf8(m_translator->trInitialValue()); } + QCString trCode() + { return toUtf8(m_translator->trCode()); } + + QCString trGraphicalHierarchy() + { return toUtf8(m_translator->trGraphicalHierarchy()); } + QCString trGotoGraphicalHierarchy() + { return toUtf8(m_translator->trGotoGraphicalHierarchy()); } + QCString trGotoTextualHierarchy() + { return toUtf8(m_translator->trGotoTextualHierarchy()); } + QCString trPageIndex() + { return toUtf8(m_translator->trPageIndex()); } + +////////////////////////////////////////////////////////////////////////// +// new since 1.1.0 +////////////////////////////////////////////////////////////////////////// + + QCString trNote() + { return toUtf8(m_translator->trNote()); } + QCString trPublicTypes() + { return toUtf8(m_translator->trPublicTypes()); } + QCString trPublicAttribs() + { return toUtf8(m_translator->trPublicAttribs()); } + QCString trStaticPublicAttribs() + { return toUtf8(m_translator->trStaticPublicAttribs()); } + QCString trProtectedTypes() + { return toUtf8(m_translator->trProtectedTypes()); } + QCString trProtectedAttribs() + { return toUtf8(m_translator->trProtectedAttribs()); } + QCString trStaticProtectedAttribs() + { return toUtf8(m_translator->trStaticProtectedAttribs()); } + QCString trPrivateTypes() + { return toUtf8(m_translator->trPrivateTypes()); } + QCString trPrivateAttribs() + { return toUtf8(m_translator->trPrivateAttribs()); } + QCString trStaticPrivateAttribs() + { return toUtf8(m_translator->trStaticPrivateAttribs()); } + +////////////////////////////////////////////////////////////////////////// +// new since 1.1.3 +////////////////////////////////////////////////////////////////////////// + + QCString trTodo() + { return toUtf8(m_translator->trTodo()); } + QCString trTodoList() + { return toUtf8(m_translator->trTodoList()); } + +////////////////////////////////////////////////////////////////////////// +// new since 1.1.4 +////////////////////////////////////////////////////////////////////////// + + QCString trReferencedBy() + { return toUtf8(m_translator->trReferencedBy()); } + QCString trRemarks() + { return toUtf8(m_translator->trRemarks()); } + QCString trAttention() + { return toUtf8(m_translator->trAttention()); } + QCString trInclByDepGraph() + { return toUtf8(m_translator->trInclByDepGraph()); } + QCString trSince() + { return toUtf8(m_translator->trSince()); } + +////////////////////////////////////////////////////////////////////////// +// new since 1.1.5 +////////////////////////////////////////////////////////////////////////// + + QCString trLegendTitle() + { return toUtf8(m_translator->trLegendTitle()); } + QCString trLegendDocs() + { return toUtf8(m_translator->trLegendDocs()); } + QCString trLegend() + { return toUtf8(m_translator->trLegend()); } + +////////////////////////////////////////////////////////////////////////// +// new since 1.2.0 +////////////////////////////////////////////////////////////////////////// + + QCString trTest() + { return toUtf8(m_translator->trTest()); } + QCString trTestList() + { return toUtf8(m_translator->trTestList()); } + +////////////////////////////////////////////////////////////////////////// +// new since 1.2.1 +////////////////////////////////////////////////////////////////////////// + + QCString trDCOPMethods() + { return toUtf8(m_translator->trDCOPMethods()); } + +////////////////////////////////////////////////////////////////////////// +// new since 1.2.2 +////////////////////////////////////////////////////////////////////////// + + QCString trProperties() + { return toUtf8(m_translator->trProperties()); } + QCString trPropertyDocumentation() + { return toUtf8(m_translator->trPropertyDocumentation()); } + +////////////////////////////////////////////////////////////////////////// +// new since 1.2.4 +////////////////////////////////////////////////////////////////////////// + + QCString trClasses() + { return toUtf8(m_translator->trClasses()); } + QCString trPackage(const char *name) + { return toUtf8(m_translator->trPackage(name)); } + QCString trPackageList() + { return toUtf8(m_translator->trPackageList()); } + QCString trPackageListDescription() + { return toUtf8(m_translator->trPackageListDescription()); } + QCString trPackages() + { return toUtf8(m_translator->trPackages()); } + QCString trDefineValue() + { return toUtf8(m_translator->trDefineValue()); } + +////////////////////////////////////////////////////////////////////////// +// new since 1.2.5 +////////////////////////////////////////////////////////////////////////// + + QCString trBug() + { return toUtf8(m_translator->trBug()); } + QCString trBugList() + { return toUtf8(m_translator->trBugList()); } + +////////////////////////////////////////////////////////////////////////// +// new since 1.2.6 +////////////////////////////////////////////////////////////////////////// + + QCString trRTFansicp() + { return toUtf8(m_translator->trRTFansicp()); } + QCString trRTFCharSet() + { return toUtf8(m_translator->trRTFCharSet()); } + QCString trRTFGeneralIndex() + { return toUtf8(m_translator->trRTFGeneralIndex()); } + + // Translation of the word + + QCString trClass(bool first_capital, bool singular) + { return toUtf8(m_translator->trClass(first_capital,singular)); } + QCString trFile(bool first_capital, bool singular) + { return toUtf8(m_translator->trFile(first_capital,singular)); } + QCString trNamespace(bool first_capital, bool singular) + { return toUtf8(m_translator->trNamespace(first_capital,singular)); } + QCString trGroup(bool first_capital, bool singular) + { return toUtf8(m_translator->trGroup(first_capital,singular)); } + QCString trPage(bool first_capital, bool singular) + { return toUtf8(m_translator->trPage(first_capital,singular)); } + QCString trMember(bool first_capital, bool singular) + { return toUtf8(m_translator->trMember(first_capital,singular)); } + QCString trGlobal(bool first_capital, bool singular) + { return toUtf8(m_translator->trGlobal(first_capital,singular)); } + +////////////////////////////////////////////////////////////////////////// +// new since 1.2.7 +////////////////////////////////////////////////////////////////////////// + + QCString trAuthor(bool first_capital, bool singular) + { return toUtf8(m_translator->trAuthor(first_capital,singular)); } + +////////////////////////////////////////////////////////////////////////// +// new since 1.2.11 +////////////////////////////////////////////////////////////////////////// + + QCString trReferences() + { return toUtf8(m_translator->trReferences()); } + +////////////////////////////////////////////////////////////////////////// +// new since 1.2.13 +////////////////////////////////////////////////////////////////////////// + + QCString trImplementedFromList(int numEntries) + { return toUtf8(m_translator->trImplementedFromList(numEntries)); } + QCString trImplementedInList(int numEntries) + { return toUtf8(m_translator->trImplementedInList(numEntries)); } + +////////////////////////////////////////////////////////////////////////// +// new since 1.2.16 +////////////////////////////////////////////////////////////////////////// + + QCString trRTFTableOfContents() + { return toUtf8(m_translator->trRTFTableOfContents()); } + +////////////////////////////////////////////////////////////////////////// +// new since 1.2.17 +////////////////////////////////////////////////////////////////////////// + + QCString trDeprecatedList() + { return toUtf8(m_translator->trDeprecatedList()); } + +////////////////////////////////////////////////////////////////////////// +// new since 1.2.18 +////////////////////////////////////////////////////////////////////////// + + QCString trEvents() + { return toUtf8(m_translator->trEvents()); } + QCString trEventDocumentation() + { return toUtf8(m_translator->trEventDocumentation()); } + +////////////////////////////////////////////////////////////////////////// +// new since 1.3 +////////////////////////////////////////////////////////////////////////// + + QCString trPackageTypes() + { return toUtf8(m_translator->trPackageTypes()); } + QCString trPackageMembers() + { return toUtf8(m_translator->trPackageMembers()); } + QCString trStaticPackageMembers() + { return toUtf8(m_translator->trStaticPackageMembers()); } + QCString trPackageAttribs() + { return toUtf8(m_translator->trPackageAttribs()); } + QCString trStaticPackageAttribs() + { return toUtf8(m_translator->trStaticPackageAttribs()); } + +////////////////////////////////////////////////////////////////////////// +// new since 1.3.1 +////////////////////////////////////////////////////////////////////////// + + QCString trAll() + { return toUtf8(m_translator->trAll()); } + QCString trCallGraph() + { return toUtf8(m_translator->trCallGraph()); } + +////////////////////////////////////////////////////////////////////////// +// new since 1.3.3 +////////////////////////////////////////////////////////////////////////// + + QCString trSearchForIndex() + { return toUtf8(m_translator->trSearchForIndex()); } + QCString trSearchResultsTitle() + { return toUtf8(m_translator->trSearchResultsTitle()); } + QCString trSearchResults(int numDocuments) + { return toUtf8(m_translator->trSearchResults(numDocuments)); } + QCString trSearchMatches() + { return toUtf8(m_translator->trSearchMatches()); } + +////////////////////////////////////////////////////////////////////////// +// new since 1.3.8 +////////////////////////////////////////////////////////////////////////// + + QCString trSourceFile(QCString& filename) + { return toUtf8(m_translator->trSourceFile(filename)); } + +////////////////////////////////////////////////////////////////////////// +// new since 1.3.9 +////////////////////////////////////////////////////////////////////////// + + QCString trDirIndex() + { return toUtf8(m_translator->trDirIndex()); } + QCString trDirDocumentation() + { return toUtf8(m_translator->trDirDocumentation()); } + QCString trDirectories() + { return toUtf8(m_translator->trDirectories()); } + QCString trDirDescription() + { return toUtf8(m_translator->trDirDescription()); } + QCString trDirReference(const char *dirName) + { return toUtf8(m_translator->trDirReference(fromUtf8(dirName))); } + QCString trDir(bool first_capital, bool singular) + { return toUtf8(m_translator->trDir(first_capital,singular)); } + +////////////////////////////////////////////////////////////////////////// +// new since 1.4.1 +////////////////////////////////////////////////////////////////////////// + + QCString trOverloadText() + { return toUtf8(m_translator->trOverloadText()); } + +////////////////////////////////////////////////////////////////////////// +// new since 1.4.6 +////////////////////////////////////////////////////////////////////////// + + QCString trCallerGraph() + { return toUtf8(m_translator->trCallerGraph()); } + QCString trEnumerationValueDocumentation() + { return toUtf8(m_translator->trEnumerationValueDocumentation()); } + + private: + Translator *m_translator; + void *m_toUtf8; + void *m_fromUtf8; + +}; + +#endif diff --git a/src/unistd.h b/src/unistd.h deleted file mode 100644 index 46a5fbc..0000000 --- a/src/unistd.h +++ /dev/null @@ -1,7 +0,0 @@ -/* this is a dummy file, that is needed for compiling files that are - * generated with flex under Windows 95/NT. - */ -#if defined(_MSC_VER) -#include <io.h> -#endif - diff --git a/src/util.cpp b/src/util.cpp index 8b822a8..985718a 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -17,9 +17,7 @@ #include <stdlib.h> #include <ctype.h> -#if defined(_WIN32) && !defined(__CYGWIN__) -#include <windows.h> -#endif +#include <errno.h> #include <md5.h> @@ -49,20 +47,7 @@ #include "searchindex.h" #include "doxygen.h" #include "textdocvisitor.h" - -#if !defined(_WIN32) || defined(__CYGWIN__) -#include <unistd.h> -#include <stdlib.h> -#include <sys/types.h> -#include <sys/wait.h> -#include <errno.h> -extern char **environ; -#endif - -#if defined(_MSC_VER) || defined(__BORLANDC__) -#define popen _popen -#define pclose _pclose -#endif +#include "portable.h" //------------------------------------------------------------------------ @@ -128,155 +113,6 @@ void TextGeneratorOLImpl::writeLink(const char *extRef,const char *file, //------------------------------------------------------------------------ //------------------------------------------------------------------------ - -/*! Implements an interruptable system call on Unix/Windows */ -int iSystem(const char *command,const char *args,bool commandHasConsole) -{ - QTime time; - time.start(); - - if (command==0) return 1; - - QCString fullCmd=command; - fullCmd=fullCmd.stripWhiteSpace(); - if (fullCmd.at(0)!='"' && fullCmd.find(' ')!=-1) - { - // add quotes around command as it contains spaces and is not quoted already - fullCmd="\""+fullCmd+"\""; - } - fullCmd += " "; - fullCmd += args; - Debug::print(Debug::ExtCmd,0,"Executing external command `%s`\n",fullCmd.data()); - -#if !defined(_WIN32) || defined(__CYGWIN__) - commandHasConsole=commandHasConsole; - /*! taken from the system() manpage on my Linux box */ - int pid,status=0; - - -#ifdef _OS_SOLARIS // for Solaris we use vfork since it is more memory efficient - - // on Solaris fork() duplicates the memory usage - // so we use vfork instead - - // spawn shell - if ((pid=vfork())<0) - { - status=-1; - } - else if (pid==0) - { - execl("/bin/sh","sh","-c",fullCmd.data(),(char*)0); - _exit(127); - } - else - { - while (waitpid(pid,&status,0 )<0) - { - if (errno!=EINTR) - { - status=-1; - break; - } - } - } - Doxygen::sysElapsedTime+=((double)time.elapsed())/1000.0; - return status; - -#else // Other Unices just use fork - - pid = fork(); - if (pid==-1) return -1; - if (pid==0) - { - const char * argv[4]; - argv[0] = "sh"; - argv[1] = "-c"; - argv[2] = fullCmd.data(); - argv[3] = 0; - execve("/bin/sh",(char * const *)argv,environ); - exit(127); - } - for (;;) - { - if (waitpid(pid,&status,0)==-1) - { - if (errno!=EINTR) return -1; - } - else - { - Doxygen::sysElapsedTime+=((double)time.elapsed())/1000.0; - if (WIFEXITED(status)) - { - return WEXITSTATUS(status); - } - else - { - return status; - } - } - } -#endif // _OS_SOLARIS - -#else // Win32 specific - if (commandHasConsole) - { - return system(fullCmd); - } - else - { - // gswin32 is a GUI api which will pop up a window and run - // asynchronously. To prevent both, we use ShellExecuteEx and - // WaitForSingleObject (thanks to Robert Golias for the code) - - SHELLEXECUTEINFO sInfo = { - sizeof(SHELLEXECUTEINFO), /* structure size */ - SEE_MASK_NOCLOSEPROCESS | SEE_MASK_FLAG_NO_UI, /* leave the process running */ - NULL, /* window handle */ - NULL, /* action to perform: open */ - command, /* file to execute */ - args, /* argument list */ - NULL, /* use current working dir */ - SW_HIDE, /* minimize on start-up */ - 0, /* application instance handle */ - NULL, /* ignored: id list */ - NULL, /* ignored: class name */ - NULL, /* ignored: key class */ - 0, /* ignored: hot key */ - NULL, /* ignored: icon */ - NULL /* resulting application handle */ - }; - if (!ShellExecuteEx(&sInfo)) - { - return -1; - } - else if (sInfo.hProcess) /* executable was launched, wait for it to finish */ - { - WaitForSingleObject(sInfo.hProcess,INFINITE); - CloseHandle(sInfo.hProcess); - } - } - Doxygen::sysElapsedTime+=((double)time.elapsed())/1000.0; - return 0; -#endif - -} - -uint iPid() -{ - uint pid; -#if !defined(_WIN32) || defined(__CYGWIN__) - pid = (uint)getpid(); -#else - pid = (uint)GetCurrentProcessId(); -#endif - return pid; -} - - - - - // an inheritance tree of depth of 100000 should be enough for everyone :-) const int maxInheritanceDepth = 100000; @@ -2051,13 +1887,7 @@ QCString getFileFilter(const char* name) if (i_equals!=-1) { QCString filterPattern = fs.left(i_equals); - -#if defined(_WIN32) || defined(_OS_MAC_) // windows or mac - QRegExp fpat(filterPattern,FALSE,TRUE); // case insensitive match -#else // unix - QRegExp fpat(filterPattern,TRUE,TRUE); // case sensitive match -#endif - + QRegExp fpat(filterPattern,portable_fileSystemIsCaseSensitive(),TRUE); if (fpat.match(name)!=-1) { // found a match! @@ -2075,6 +1905,80 @@ QCString getFileFilter(const char* name) return ""; } +QCString recodeString(const QCString &str,const char *fromEncoding,const char *toEncoding) +{ + QCString inputEncoding = fromEncoding; + QCString outputEncoding = toEncoding; + if (inputEncoding.isEmpty() || outputEncoding.isEmpty() || + inputEncoding==outputEncoding) return str; + int inputSize=str.length(); + int outputSize=inputSize*4+1; + QCString output(outputSize); + void *cd = portable_iconv_open(outputEncoding,inputEncoding); + if (cd==(void *)(-1)) + { + err("Error: unsupported character conversion: '%s'->'%s'\n", + inputEncoding.data(),outputEncoding.data()); + exit(1); + } + size_t iLeft=inputSize; + size_t oLeft=outputSize; + const char *inputPtr = str.data(); + char *outputPtr = output.data(); + if (!portable_iconv(cd, &inputPtr, &iLeft, &outputPtr, &oLeft)) + { + outputSize-=oLeft; + output.resize(outputSize+1); + output.at(outputSize+1)='\0'; + //printf("iconv: input size=%d output size=%d\n[%s]\n",size,newSize,srcBuf.data()); + } + else + { + err("Error: failed to translate characters from %s to %s: %s\n", + inputEncoding.data(),outputEncoding.data(),strerror(errno)); + exit(1); + } + portable_iconv_close(cd); + return output; +} + + +QCString transcodeCharacterStringToUTF8(const QCString &input) +{ + static QCString inputEncoding = Config_getString("INPUT_ENCODING"); + const char *outputEncoding = "UTF-8"; + if (inputEncoding.isEmpty() || qstricmp(inputEncoding,outputEncoding)==0) return input; + int inputSize=input.length(); + int outputSize=inputSize*4+1; + QCString output(outputSize); + void *cd = portable_iconv_open(outputEncoding,inputEncoding); + if (cd==(void *)(-1)) + { + err("Error: unsupported character conversion: '%s'->'%s'\n", + inputEncoding.data(),outputEncoding); + exit(1); + } + size_t iLeft=inputSize; + size_t oLeft=outputSize; + const char *inputPtr = input.data(); + char *outputPtr = output.data(); + if (!portable_iconv(cd, &inputPtr, &iLeft, &outputPtr, &oLeft)) + { + outputSize-=oLeft; + output.resize(outputSize+1); + output.at(outputSize+1)='\0'; + //printf("iconv: input size=%d output size=%d\n[%s]\n",size,newSize,srcBuf.data()); + } + else + { + err("Error: failed to translate characters from %s to %s: check INPUT_ENCODING\n", + inputEncoding.data(),outputEncoding); + exit(1); + } + portable_iconv_close(cd); + return output; +} + /*! reads a file with name \a name and returns it as a string. If \a filter * is TRUE the file will be filtered by any user specified input filter. * If \a name is "-" the string will be read from standard input. @@ -2135,13 +2039,13 @@ QCString fileToString(const char *name,bool filter) { contents.resize(newSize); } - return contents; + return transcodeCharacterStringToUTF8(contents); } } else // filter the input { QCString cmd=filterName+" \""+name+"\""; - FILE *f=popen(cmd,"r"); + FILE *f=portable_popen(cmd,"r"); if (!f) { err("Error: could not execute filter %s\n",filterName.data()); @@ -2160,8 +2064,8 @@ QCString fileToString(const char *name,bool filter) contents.resize(totalSize); contents.at(totalSize-2)='\n'; // to help the scanner contents.at(totalSize-1)='\0'; - pclose(f); - return contents; + portable_pclose(f); + return transcodeCharacterStringToUTF8(contents); } } if (!fileOpened) @@ -4629,19 +4533,20 @@ QCString convertNameToFile(const char *name,bool allowDots) QCString result; if (shortNames) // use short names only { - static QDict<void> usedNames(10007); + static QDict<int> usedNames(10007); + usedNames.setAutoDelete(TRUE); static int count=1; - void *value=usedNames.find(name); + int *value=usedNames.find(name); int num; if (value==0) { - usedNames.insert(name,(void *)count); + usedNames.insert(name,new int(count)); num = count++; } else { - num = *(int*)&value; + num = *value; } result.sprintf("a%05d",num); } @@ -5488,6 +5393,7 @@ void addGroupListToTitle(OutputList &ol,Definition *d) } } +#if 0 /*! * Function converts Latin1 character to latex string representin the same * character. @@ -5622,7 +5528,7 @@ static void latin2ToLatex(QTextStream &t,unsigned char c) case 0xCE: t << "\\^{I}"; break; case 0xCF: t << "\\v{D}"; break; - case 0xD0: t << "\\bar{D}"; break; + case 0xD0: t << "\\DJ "; break; case 0xD1: t << "\\'{N}"; break; case 0xD2: t << "\\v{N}"; break; case 0xD3: t << "\\'{O}"; break; @@ -5656,7 +5562,7 @@ static void latin2ToLatex(QTextStream &t,unsigned char c) case 0xEE: t << "\\^{\\i}"; break; case 0xEF: t << "\\v{d}"; break; - case 0xF0: t << "\\bar{d}"; break; + case 0xF0: t << "\\dj "; break; case 0xF1: t << "\\'{n}"; break; case 0xF2: t << "\\v{n}"; break; case 0xF3: t << "\\'{o}"; break; @@ -5676,11 +5582,14 @@ static void latin2ToLatex(QTextStream &t,unsigned char c) default: t << (char)c; } } +#endif void filterLatexString(QTextStream &t,const char *str, bool insideTabbing,bool insidePre,bool insideItem) { +#if 0 static bool isCzech = theTranslator->idLanguage()=="czech"; + static bool isSerbian = theTranslator->idLanguage()=="serbian"; static bool isJapanese = theTranslator->idLanguage()=="japanese" || theTranslator->idLanguage()=="japanese-en"; static bool isKorean = theTranslator->idLanguage()=="korean" || @@ -5693,6 +5602,7 @@ void filterLatexString(QTextStream &t,const char *str, static bool isLatin2 = theTranslator->idLanguageCharset()=="iso-8859-2"; static bool isGreek = theTranslator->idLanguage()=="greek"; //printf("filterLatexString(%s)\n",str); +#endif if (str) { const unsigned char *p=(const unsigned char *)str; @@ -5711,9 +5621,11 @@ void filterLatexString(QTextStream &t,const char *str, case '}': t << "\\}"; break; case '_': t << "\\_"; break; default: + t << (char)c; +#if 0 { // Some languages use wide characters - if (c>=128 && (isJapanese || isKorean || isChinese)) + if (c>=128 && (isJapanese || isKorean || isChinese || isSerbian)) { t << (char)c; if (*p) @@ -5728,6 +5640,7 @@ void filterLatexString(QTextStream &t,const char *str, } break; } +#endif } } else @@ -5776,9 +5689,11 @@ void filterLatexString(QTextStream &t,const char *str, break; default: + t << (char)c; +#if 0 { // Some languages use wide characters - if (isJapanese || isKorean || isChinese) + if (isJapanese || isKorean || isChinese || isSerbian) { if (c>=128) { @@ -5845,6 +5760,7 @@ void filterLatexString(QTextStream &t,const char *str, } } } +#endif } } pc = c; @@ -6024,24 +5940,25 @@ SrcLangExt getLanguageFromFileName(const QCString fileName) { int i = fileName.findRev('.'); static bool init=FALSE; - static QDict<void> extLookup; + static QDict<int> extLookup; + extLookup.setAutoDelete(TRUE); 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(".jsl", (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(".php5", (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); + extLookup.insert(".idl", new int(SrcLangExt_IDL)); + extLookup.insert(".odl", new int(SrcLangExt_IDL)); + extLookup.insert(".java", new int(SrcLangExt_Java)); + extLookup.insert(".jsl", new int(SrcLangExt_Java)); + extLookup.insert(".as", new int(SrcLangExt_Java)); + extLookup.insert(".cs", new int(SrcLangExt_CSharp)); + extLookup.insert(".d", new int(SrcLangExt_D)); + extLookup.insert(".php", new int(SrcLangExt_PHP)); + extLookup.insert(".php4", new int(SrcLangExt_PHP)); + extLookup.insert(".php5", new int(SrcLangExt_PHP)); + extLookup.insert(".inc", new int(SrcLangExt_PHP)); + extLookup.insert(".phtml", new int(SrcLangExt_PHP)); + extLookup.insert(".m", new int(SrcLangExt_ObjC)); + extLookup.insert(".M", new int(SrcLangExt_ObjC)); + extLookup.insert(".mm", new int(SrcLangExt_ObjC)); init=TRUE; } if (i!=-1) // name has an extension @@ -6049,10 +5966,10 @@ SrcLangExt getLanguageFromFileName(const QCString fileName) QCString extStr=fileName.right(fileName.length()-i); if (!extStr.isEmpty()) // non-empty extension { - void *pVal=extLookup.find(extStr); + int *pVal=extLookup.find(extStr); if (pVal) // listed extension { - return *(SrcLangExt*)&pVal; // cast void* address to enum value + return (SrcLangExt)*pVal; // cast void* address to enum value } } } @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -233,10 +233,6 @@ QCString insertTemplateSpecifierInScope(const QCString &scope,const QCString &te QCString stripScope(const char *name); -int iSystem(const char *command,const char *args,bool commandHasConsole=TRUE); - -uint iPid(); - QCString convertToHtml(const char *s); QCString convertToXML(const char *s); @@ -334,5 +330,9 @@ ClassDef *newResolveTypedef(FileDef *fileScope,MemberDef *md, QCString parseCommentAsText(const QString &doc,const QCString &fileName,int lineNr); +QCString transcodeCharacterStringToUTF8(const QCString &input); + +QCString recodeString(const QCString &str,const char *fromEncoding,const char *toEncoding); + #endif diff --git a/src/version.h b/src/version.h index 226de7e..a040af7 100644 --- a/src/version.h +++ b/src/version.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/xmldocvisitor.cpp b/src/xmldocvisitor.cpp index d9b63a3..2fd186a 100644 --- a/src/xmldocvisitor.cpp +++ b/src/xmldocvisitor.cpp @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/xmldocvisitor.h b/src/xmldocvisitor.h index c347e0e..695a72f 100644 --- a/src/xmldocvisitor.h +++ b/src/xmldocvisitor.h @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby diff --git a/src/xmlgen.cpp b/src/xmlgen.cpp index 3d0788e..e0ef129 100644 --- a/src/xmlgen.cpp +++ b/src/xmlgen.cpp @@ -3,7 +3,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby @@ -563,6 +563,7 @@ static void generateXMLForMember(MemberDef *md,QTextStream &ti,QTextStream &t,De // enum values are written as part of the enum if (md->memberType()==MemberDef::EnumValue) return; + if (md->isHidden()) return; // group members are only visible in their group //if (def->definitionType()!=Definition::TypeGroup && md->getGroupDef()) return; @@ -1051,7 +1052,7 @@ static void writeInnerClasses(const ClassSDict *cl,QTextStream &t) ClassDef *cd; for (cli.toFirst();(cd=cli.current());++cli) { - if (cd->name().find('@')==-1) // skip anonymous scopes + if (!cd->isHidden() && cd->name().find('@')==-1) // skip anonymous scopes { t << " <innerclass refid=\"" << cd->getOutputFileBase() << "\" prot=\""; @@ -1076,7 +1077,7 @@ static void writeInnerNamespaces(const NamespaceSDict *nl,QTextStream &t) NamespaceDef *nd; for (nli.toFirst();(nd=nli.current());++nli) { - if (nd->name().find('@')==-1) // skip anonymouse scopes + if (!nd->isHidden() && nd->name().find('@')==-1) // skip anonymouse scopes { t << " <innernamespace refid=\"" << nd->getOutputFileBase() << "\">" << convertToXML(nd->name()) << "</innernamespace>" << endl; @@ -1166,6 +1167,7 @@ static void generateXMLForClass(ClassDef *cd,QTextStream &ti) // - examples using the class if (cd->isReference()) return; // skip external references. + if (cd->isHidden()) return; // skip hidden classes. if (cd->name().find('@')!=-1) return; // skip anonymous compounds. if (cd->templateMaster()!=0) return; // skip generated template instances. @@ -1393,7 +1395,7 @@ static void generateXMLForNamespace(NamespaceDef *nd,QTextStream &ti) // + location // - files containing (parts of) the namespace definition - if (nd->isReference()) return; // skip external references + if (nd->isReference() || nd->isHidden()) return; // skip external references ti << " <compound refid=\"" << nd->getOutputFileBase() << "\" kind=\"namespace\"" << "><name>" diff --git a/src/xmlgen.h b/src/xmlgen.h index 5193b76..b65689c 100644 --- a/src/xmlgen.h +++ b/src/xmlgen.h @@ -2,7 +2,7 @@ * * * - * Copyright (C) 1997-2006 by Dimitri van Heesch. + * Copyright (C) 1997-2007 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its * documentation under the terms of the GNU General Public License is hereby |